diff --git a/AppKit/Tools/BlendKit/BKShowcaseController.j b/AppKit/Tools/BlendKit/BKShowcaseController.j index 623aba85f..d442a573a 100644 --- a/AppKit/Tools/BlendKit/BKShowcaseController.j +++ b/AppKit/Tools/BlendKit/BKShowcaseController.j @@ -1,13 +1,33 @@ +/* + * BKShowcaseController.j + * BlendKit + * + * Created by Francisco Tolmasky. + * Copyright 2009, 280 North, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ @import @import -@import "BKUtilities.j" - var LEFT_PANEL_WIDTH = 176.0; -var BKStateToolbarItemIdentifier = @"BKStateToolbarItemIdentifier", +var BKLearnMoreToolbarItemIdentifier = @"BKLearnMoreToolbarItemIdentifier", + BKStateToolbarItemIdentifier = @"BKStateToolbarItemIdentifier", BKBackgroundColorToolbarItemIdentifier = @"BKBackgroundColorToolbarItemIdentifier"; @implementation BKShowcaseController : CPObject @@ -120,12 +140,12 @@ var BKStateToolbarItemIdentifier = @"BKStateToolbarItemIdenti - (CPArray)toolbarAllowedItemIdentifiers:(CPToolbar)aToolbar { - return [CPToolbarSpaceItemIdentifier, CPToolbarFlexibleSpaceItemIdentifier, BKBackgroundColorToolbarItemIdentifier, BKStateToolbarItemIdentifier]; + return [BKLearnMoreToolbarItemIdentifier, CPToolbarSpaceItemIdentifier, CPToolbarFlexibleSpaceItemIdentifier, BKBackgroundColorToolbarItemIdentifier, BKStateToolbarItemIdentifier]; } - (CPArray)toolbarDefaultItemIdentifiers:(CPToolbar)aToolbar { - return [CPToolbarFlexibleSpaceItemIdentifier, BKBackgroundColorToolbarItemIdentifier, BKStateToolbarItemIdentifier]; + return [BKLearnMoreToolbarItemIdentifier, CPToolbarFlexibleSpaceItemIdentifier, BKBackgroundColorToolbarItemIdentifier, BKStateToolbarItemIdentifier]; } - (CPToolbarItem)toolbar:(CPToolbar)aToolbar itemForItemIdentifier:(CPString)anItemIdentifier willBeInsertedIntoToolbar:(BOOL)aFlag @@ -151,7 +171,7 @@ var BKStateToolbarItemIdentifier = @"BKStateToolbarItemIdenti [toolbarItem setMaxSize:CGSizeMake(width + 20.0, 32.0)]; } - else if (BKBackgroundColorToolbarItemIdentifier) + else if (anItemIdentifier === BKBackgroundColorToolbarItemIdentifier) { var popUpButton = [CPPopUpButton buttonWithTitle:@"Light Checkers"]; @@ -179,6 +199,20 @@ var BKStateToolbarItemIdentifier = @"BKStateToolbarItemIdenti [toolbarItem setMinSize:CGSizeMake(width, 32.0)]; [toolbarItem setMaxSize:CGSizeMake(width, 32.0)]; } + else if (anItemIdentifier === BKLearnMoreToolbarItemIdentifier) + { + var button = [CPButton buttonWithTitle:@" Aristo Home Page "]; + + [button setDefaultButton:YES]; + + [toolbarItem setView:button]; + [toolbarItem setLabel:@"Learn More"]; + + var width = CGRectGetWidth([button frame]); + + [toolbarItem setMinSize:CGSizeMake(width, 32.0)]; + [toolbarItem setMaxSize:CGSizeMake(width, 32.0)]; + } return toolbarItem; } diff --git a/AppKit/Tools/BlendKit/BKThemeDescriptor.j b/AppKit/Tools/BlendKit/BKThemeDescriptor.j index fde4743fd..0475e008a 100644 --- a/AppKit/Tools/BlendKit/BKThemeDescriptor.j +++ b/AppKit/Tools/BlendKit/BKThemeDescriptor.j @@ -1,3 +1,24 @@ +/* + * BKThemeDescriptor.j + * BlendKit + * + * Created by Francisco Tolmasky. + * Copyright 2009, 280 North, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ @import @@ -121,7 +142,7 @@ var ItemSizes = { }, if (!object) continue; - var template = [[BKThemeObjectTemplate alloc] init]; + var template = [[BKThemedObjectTemplate alloc] init]; [template setValue:object forKey:@"themedObject"]; [template setValue:BKLabelFromIdentifier(selector) forKey:@"label"]; diff --git a/AppKit/Tools/BlendKit/BKThemeTemplate.j b/AppKit/Tools/BlendKit/BKThemeTemplate.j new file mode 100644 index 000000000..ed5fd7226 --- /dev/null +++ b/AppKit/Tools/BlendKit/BKThemeTemplate.j @@ -0,0 +1,51 @@ +/* + * BKThemeTemplate.j + * BlendKit + * + * Created by Francisco Tolmasky. + * Copyright 2009, 280 North, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +@import + + +@implementation BKThemeTemplate : CPObject +{ + CPString _name; + CPString _description; +} + +- (id)initWithCoder:(CPCoder)aCoder +{ + self = [super init]; + + if (self) + { + _name = [aCoder decodeObjectForKey:@"BKThemeTemplateName"]; + _description = [aCoder decodeObjectForKey:@"BKThemeTemplateDescription"]; + } + + return self; +} + +- (void)encodeWithCoder:(CPCoder)aCoder +{ + [aCoder encodeObject:_name forKey:@"BKThemeTemplateName"]; + [aCoder encodeObject:_description forKey:@"BKThemeTemplateDescription"]; +} + +@end diff --git a/AppKit/Tools/BlendKit/BKThemedObjectTemplate.j b/AppKit/Tools/BlendKit/BKThemedObjectTemplate.j new file mode 100644 index 000000000..46797a525 --- /dev/null +++ b/AppKit/Tools/BlendKit/BKThemedObjectTemplate.j @@ -0,0 +1,51 @@ +/* + * BKThemedObjectTemplate.j + * BlendKit + * + * Created by Francisco Tolmasky. + * Copyright 2009, 280 North, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +@import + + +@implementation BKThemedObjectTemplate : CPView +{ + CPString _label; + id _themedObject; +} + +- (id)initWithCoder:(CPCoder)aCoder +{ + self = [super init]; + + if (self) + { + _label = [aCoder decodeObjectForKey:@"BKThemedObjectTemplateLabel"]; + _themedObject = [aCoder decodeObjectForKey:@"BKThemedObjectTemplateThemedObject"]; + } + + return self; +} + +- (void)encodeWithCoder:(CPCoder)aCoder +{ + [aCoder encodeObject:_label forKey:@"BKThemedObjectTemplateLabel"]; + [aCoder encodeObject:_themedObject forKey:@"BKThemedObjectTemplateThemedObject"]; +} + +@end diff --git a/AppKit/Tools/BlendKit/BKUtilities.j b/AppKit/Tools/BlendKit/BKUtilities.j deleted file mode 100644 index ca8986cdd..000000000 --- a/AppKit/Tools/BlendKit/BKUtilities.j +++ /dev/null @@ -1,54 +0,0 @@ - -@implementation BKThemeTemplate : CPObject -{ - CPString _name; - CPString _description; -} - -- (id)initWithCoder:(CPCoder)aCoder -{ - self = [super init]; - - if (self) - { - _name = [aCoder decodeObjectForKey:@"BKThemeTemplateName"]; - _description = [aCoder decodeObjectForKey:@"BKThemeTemplateDescription"]; - } - - return self; -} - -- (void)encodeWithCoder:(CPCoder)aCoder -{ - [aCoder encodeObject:_name forKey:@"BKThemeTemplateName"]; - [aCoder encodeObject:_description forKey:@"BKThemeTemplateDescription"]; -} - -@end - -@implementation BKThemeObjectTemplate : CPView -{ - CPString _label; - id _themedObject; -} - -- (id)initWithCoder:(CPCoder)aCoder -{ - self = [super init]; - - if (self) - { - _label = [aCoder decodeObjectForKey:@"BKThemeObjectTemplateLabel"]; - _themedObject = [aCoder decodeObjectForKey:@"BKThemeObjectTemplateThemedObject"]; - } - - return self; -} - -- (void)encodeWithCoder:(CPCoder)aCoder -{ - [aCoder encodeObject:_label forKey:@"BKThemeObjectTemplateLabel"]; - [aCoder encodeObject:_themedObject forKey:@"BKThemeObjectTemplateThemedObject"]; -} - -@end diff --git a/AppKit/Tools/BlendKit/BlendKit.j b/AppKit/Tools/BlendKit/BlendKit.j index 9b0cf5122..45d827ced 100644 --- a/AppKit/Tools/BlendKit/BlendKit.j +++ b/AppKit/Tools/BlendKit/BlendKit.j @@ -1,4 +1,26 @@ +/* + * BlendKit.j + * BlendKit + * + * Created by Francisco Tolmasky. + * Copyright 2009, 280 North, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ @import "BKShowcaseController.j" @import "BKThemeDescriptor.j" -@import "BKUtilities.j" +@import "BKThemeTemplate.j" +@import "BKThemedObjectTemplate.j" diff --git a/AppKit/Tools/blend/main.j b/AppKit/Tools/blend/main.j index 92cadf4de..c39f462d5 100755 --- a/AppKit/Tools/blend/main.j +++ b/AppKit/Tools/blend/main.j @@ -1,8 +1,28 @@ +/* + * main.j + * blend + * + * Created by Francisco Tolmasky. + * Copyright 2009, 280 North, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + @import @import -@import -@import @import var File = require("file"); @@ -246,7 +266,7 @@ function exec(/*Array*/ command, /*Boolean*/ showOutput) { var theClass = [self class]; - if ([theClass isKindOfClass:[BKThemeObjectTemplate class]]) + if ([theClass isKindOfClass:[BKThemedObjectTemplate class]]) return [self]; if ([theClass isKindOfClass:[CPView class]]) @@ -266,7 +286,7 @@ function exec(/*Array*/ command, /*Boolean*/ showOutput) @end -@implementation BKThemeObjectTemplate (BlendAdditions) +@implementation BKThemedObjectTemplate (BlendAdditions) - (void)blendAddThemedObjectAttributesToTheme:(CPTheme)aTheme {