Compare commits

...
Author SHA1 Message Date
release 834d878a4d Changed version number to 1.0.0.004 2011-06-24 04:36:38 -05:00
release 4cb5ccbc3a Changed version number to 1.0.0.004-SNAPSHOT 2011-06-24 03:05:58 -05:00
release 929cd78bae Changed version number to 1.0.0.003 2011-06-24 03:05:51 -05:00
hmalphettes f5961b9e06 remove the web-fragment.xml. it is not used and could be harmful. 2011-06-15 14:42:01 +08:00
Pascal Belloncle 7fb17e9f41 added Gemfile 2011-06-14 14:55:18 -03:00
hmalphettes dd70bdc698 use '/' for development. use the BundleShape to be able to be published by the latest version of tycho eventually 2011-06-13 17:14:35 +08:00
release 59d619d190 Changed version number to 1.0.0.003-SNAPSHOT 2011-06-13 03:31:35 -05:00
release dd160d6bed Changed version number to 1.0.0.002 2011-06-13 03:31:30 -05:00
hmalphettes ae5a2c4164 CARBON-183 and remove harful servlet-3.0 web-fragment.xml. Remove the dependency on buildr4osgi 2011-06-13 16:15:15 +08:00
hmalphettes a939bed8e0 CORE-153 pad the buildnumber 2011-06-13 15:51:15 +08:00
release c686a4384b Changed version number to 1.0.0.2-SNAPSHOT 2011-06-11 13:19:43 -05:00
release 6bb2dd2a16 Changed version number to 1.0.0.1 2011-06-11 13:19:38 -05:00
Pascal Belloncle 2ec574173a correct path for patch in archive 2011-06-10 17:17:00 -07:00
Pascal Belloncle 743feb5360 stupid copy paste typo 2011-06-10 16:52:14 -07:00
Pascal Belloncle bc4dc041e5 Merge branch 'master' of github.com:intalio/cappuccino 2011-06-10 16:37:40 -07:00
Pascal Belloncle 8c8d1ae3d3 osgi build 2011-06-10 16:37:30 -07:00
Aparajita Fishman a9781016be Look for frameworks in the app/Frameworks directory before the install directory. Document framework search path and CPAuxiliaryThemes support in the man page. 2011-06-04 22:53:31 -07:00
Aparajita Fishman 4be0bb3a30 Load userland NS classes from the main bundle as well as frameworks, and temporarily change the class of NSSwapper classes to the target class when calling KVC methods. 2011-06-04 18:03:53 -07:00
Aparajita Fishman a74267e937 Merge remote branch 'refs/remotes/280north/master' 2011-06-04 16:20:50 -07:00
Alexander LjungbergandAparajita Fishman 6dea853ef3 Decode but mostly ignore NSImages in nib2cib. Fixed: radio groups in IB come with an NSImage and so would not nib2cib anymore after the recent addition of template image support in NSButton. 2011-06-04 16:19:59 -07:00
Aparajita Fishman 94df530580 Another overhaul of nib2cib.
- Added support for userland NS classes.
- Added support for auxiliary themes.
- NSView should be writing _themeClass, otherwise custom themed classes do not get the correct _themeClass when unarchived.
- Added support for stored options, this is critical. For example, if you are using custom frameworks, you have to ensure they are loaded during automatic nib2cib'ing that occurs when building an app or using xcodecapp. Stored options makes this easy to do.
- Finally did the right thing and made nib2cib into an Objective-J class.
2011-06-04 16:07:00 -07:00
Aparajita Fishman d038c50531 Added ability to specify bundle, which makes this usable with non-main bundle images. 2011-06-04 12:01:19 -07:00
Aparajita Fishman 83546d58db Tweak language of error message to be clearer, currently it sounds like it was searching in the cib file for the class, not the other way around. 2011-06-04 10:59:49 -07:00
Aparajita Fishman 8de587d4fc Only log the connection info if _source and _destination are defined. Runtime attribute connections do not have both. Correctly show boolean value types as BOOL, not CPNumber. 2011-06-04 10:58:38 -07:00
Aparajita Fishman bd9a6ea150 A few more fixes to support multiple themes. 2011-06-04 10:46:29 -07:00
Aparajita Fishman fe69142567 Merge remote branch 'refs/remotes/aparajita/runtime-attributes'
Conflicts:
	Tools/nib2cib/NSNibConnector.j
2011-06-04 10:39:50 -07:00
Aparajita Fishman 5f85f7bef1 Removed unused variable, fixed typo 2011-06-03 18:08:33 -07:00
Aparajita Fishman 397e314cc9 Use Menlo if Consolas is not available 2011-06-01 18:19:49 -07:00
Aparajita Fishman c87d96676c Merge remote branch 'refs/remotes/280north/master' 2011-06-01 12:21:27 -07:00
Aparajita Fishman 13d4e36d39 Lost this change in the merge 2011-05-30 23:39:44 -07:00
Aparajita Fishman a5c06c8f27 Merge remote branch 'refs/remotes/280north/master'
Conflicts:
	AppKit/CPTableView.j
2011-05-30 23:37:16 -07:00
Aparajita Fishman 76bdbb660e clickedRow should be -1 initially, remove leftover setTheme. 2011-05-30 23:31:28 -07:00
Aparajita Fishman a7929e6c1e Enable escape as key equivalent. 2011-05-30 23:18:43 -07:00
Aparajita Fishman b3cbc7e362 Test app and unit test to validate pinned ranges in beginsWith/endsWith predicate comparison. 2011-05-26 14:29:51 -07:00
Aparajita Fishman d6b3efaae8 Pin ranges to valid values. 2011-05-26 13:00:46 -07:00
Aparajita Fishman 33345f65ce Restored space, backspace and escape as key equivalents, but only if the first responder is not a CPTextField. Updated test app to show clearly the effect of this change. 2011-05-23 16:31:15 -07:00
Aparajita Fishman 3fe5ec5d6d Fixed set of keys that can be considered a key equivalent, removed redundant call to performKeyEquivalent, test app 2011-05-22 18:05:08 -07:00
Aparajita Fishman 142b982577 Documentation tweaks 2011-05-22 17:19:06 -07:00
Aparajita Fishman 147c65b962 On WebKit (at least on Mac), right Command key code is 93, not 91. This was not being interpreted correctly. 2011-05-22 17:06:25 -07:00
Aparajita Fishman 89dbccd74e Use CPLog instead of console.log 2011-05-20 08:01:22 -07:00
Aparajita Fishman a4647f2b82 CPColor and CPImage enhancements
- Enhanced -description method of CPImage and CPColor to show the exact content, especially for pattern colors.

- Added CPColorWithImages() convenience function, analogous to PatternColor() function used in theme descriptors.

- Added @cond/@endcond in CPColor to ignore local variables.

- Sample app included.
2011-05-20 00:23:17 -07:00
Aparajita Fishman 94336ebcbb Merge remote branch 'refs/remotes/280north/master'
Conflicts:
	Tools/Documentation/preprocess/003.make_headers.rb
2011-05-19 23:19:08 -07:00
Aparajita Fishman 5dfa43ce5f Oops, accessor methods weren't being synthesized, removed some cruft 2011-05-19 17:10:26 -07:00
Aparajita Fishman ff7774976e Major fix to documentation generation:
- It turns out doxygen would not generate documentation for the first method in a file (or sometimes any methods at all) if there was no ivar block or an empty ivar block. Now a dummy __doxygen__ ivar is inserted in empty blocks to force correct behavior.

- Added a missing @endverbatim to CPExpression.j.

- Tweaked class documentation for CPPredicate.j.
2011-05-19 16:46:41 -07:00
Aparajita Fishman a435e54a67 Stupid Uber Glory bundle duplicated the file a few times when stripping whitespace. 2011-05-18 17:32:59 -07:00
Aparajita Fishman 852597f11d Fixed formatting of lists and code in class description. The code did not change, I don't know why git says it did. 2011-05-18 16:55:15 -07:00
Aparajita Fishman 806fea9222 Whitespace cleanup 2011-05-18 16:53:51 -07:00
Aparajita Fishman 972bb4100f If there is no header view, there should be no corner view. This is what Cocoa does. Also for correctness -enclosingScrollView should be used to get the table's scrollview. Test app included. 2011-05-18 10:29:54 -07:00
Aparajita Fishman 6a6b83635f More documentation enhancements...
- Changed to centered, fixed-width layout, it results in shorter line lengths which reads more easily.
- Moved support files to separate support directory.
- Removed blank lines at end of multi-parameter method prototypes.
2011-05-18 07:49:52 -07:00
Aparajita Fishman d8f202fc1f Missed a text substitution, darkened up the method header a bit 2011-05-17 21:11:31 -07:00
Aparajita Fishman 2322743252 Documentation tweak 2011-05-17 10:51:09 -07:00
Aparajita Fishman 8b3f9c5557 Merge remote branch 'refs/remotes/280north/master'
Conflicts:
	Tools/Documentation/doxygen.css
	Tools/Documentation/processor_setup.sh
2011-05-17 10:48:22 -07:00
Aparajita Fishman b573daf59b NSColorWell was not setting its enabled state 2011-05-16 11:12:48 -07:00
Aparajita Fishman 4f8fa778d5 Style cleanup 2011-05-14 14:03:51 -04:00
Aparajita Fishman 30d5a7f7a2 Tweak the class list page 2011-05-12 23:15:13 -04:00
Aparajita Fishman b01a4436b6 Lightened up box around method prototype 2011-05-12 16:55:32 -04:00
Aparajita Fishman 9ad8f75a08 Another overhaul of doc generation.
- Added generic facility for pre- and post-processor scripts to be run.
- Added support utility script for inclusion by processors.
- Totally overhauled css to make the pages more readable (I hope).
- Fixed some doc errors in CPTableView.
- Don't generate XML.
- Added colorize() and colorPrint() functions to common.jake.
- Added docs-no-frame task for generating docs without a sidebar frame.
2011-05-12 14:40:19 -04:00
Aparajita Fishman 2bf9afa97a Whitespace cleanup 2011-05-11 23:58:20 -04:00
Aparajita Fishman 9e892d4eea Added CPMenu -removeAll method, removed unused internal _itemIsHighlighted method, test app 2011-05-11 23:56:01 -04:00
Aparajita Fishman d2407d1c2a Don't generate XML for docs, updated ThemeDescriptor capp template 2011-05-11 12:18:21 -04:00
Aparajita Fishman 17dc96ad2f Merge remote branch 'refs/remotes/280north/master' 2011-05-11 08:13:33 -04:00
Aparajita Fishman b3a427ba18 Correct performKeyEquivalent documentation 2011-05-10 19:17:32 -04:00
Aparajita Fishman 4cdefcc2c7 Merge remote branch 'refs/remotes/280north/master' 2011-05-10 11:12:05 -04:00
Aparajita Fishman b7c0dcf050 Added textFrame method to locate the text within the view 2011-05-09 21:14:02 -04:00
Aparajita Fishman fe9573e5b8 Merge branch 'refs/heads/object-union-operators' 2011-05-09 17:12:54 -04:00
Aparajita Fishman 9fcf0258e0 Fix the content inset on CPTextField so there are 2 pixels below and 3 pixels above a text selection. 2011-05-09 17:12:27 -04:00
Aparajita Fishman e22faa0d79 Added distinctUnionOfObjects and unionOfObjects object operators. 2011-05-09 15:31:12 -04:00
Aparajita Fishman 175b204bb6 Improvements to the ThemeDescriptor capp template:
- New/improved jake tasks: debug, release, all, clean, clobber, test, test-release, help.
- help task shows comprehensive, formatted documentation for the available tasks.
- BlendKit is automatically symlinked into the Frameworks directory if necessary as part of the build process, so that the showcase will always work.
- User can easily change the build directory by changing one line.
- Fixed incorrect placeholders in main.j.
2011-05-07 13:10:33 -04:00
Aparajita Fishman b126b2946d Revert "Using objects to encapsulate a bit more"
This reverts commit f0a2a91837.
5c10615c9f fixes the root cause,
thus obviating the reverted commit.
2011-05-06 18:04:36 -04:00
Aparajita Fishman fec200c835 Merge remote branch 'refs/remotes/280north/master' 2011-05-06 17:56:00 -04:00
Aparajita Fishman ea0a47a845 _CPThemeAttribute -setValue should not blow away existing values. 2011-05-06 08:51:17 -04:00
Aparajita Fishman 835d89774a Merge remote branch 'refs/remotes/origin/nib2cib-fix-load-theme' 2011-05-05 15:00:01 -04:00
Aparajita Fishman f0a2a91837 Using objects to encapsulate a bit more 2011-05-05 14:40:19 -04:00
Aparajita Fishman 8614bab724 Merge branch 'master' of git://github.com/280north/cappuccino 2011-05-05 08:07:16 -04:00
Aparajita Fishman 9c181cc9c9 Allow class to be used with +themeForView, fix to image load notification 2011-05-05 08:06:31 -04:00
Aparajita Fishman a0a7b126ab When multiple _CPImageAndTextViews to share a common image, update them all when the image loads. 2011-05-04 10:59:23 -04:00
Aparajita Fishman 78ddc2db70 Automated support for multiple themes and simple theme inheritance 2011-04-29 16:45:00 -04:00
Aparajita Fishman e80cbc89b2 Added debug logging, some more samples in AppController 2011-03-28 19:24:13 -04:00
Aparajita Fishman c0f5ed1f87 Fixed the copyright 2011-03-28 07:50:15 -04:00
Aparajita Fishman 51a8975f0a Implement support for user defined runtime attributes in nib2cib 2011-03-27 22:14:43 -04:00
82 changed files with 6681 additions and 853 deletions
+1
View File
@@ -9,3 +9,4 @@ WebSite
*.xcodeproj/*.perspectivev3
xcuserdata/
!*.xcodeproj/project.pbxproj
target
+2
View File
@@ -0,0 +1,2 @@
rvm_install_on_use_flag=1
rvm jruby-head@buildr
+1
View File
@@ -37,6 +37,7 @@
@import "CPCibControlConnector.j"
@import "CPCibLoading.j"
@import "CPCibOutletConnector.j"
@import "CPCibRuntimeAttributesConnector.j"
@import "CPClipView.j"
@import "CPCollectionView.j"
@import "CPCollectionViewItem.j"
+47 -16
View File
@@ -107,7 +107,7 @@ CPRunContinuesResponse = -1002;
CPPanel _aboutPanel;
CPThemeBlend _themeBlend @accessors(property=themeBlend);
CPArray _themeBlends @accessors(property=themeBlends);
}
/*!
@@ -141,6 +141,8 @@ CPRunContinuesResponse = -1002;
_windows = [];
[_windows addObject:nil];
_themeBlends = [];
}
return self;
@@ -338,7 +340,7 @@ CPRunContinuesResponse = -1002;
Copyright - Human readable copyright information.
</pre>
If you choose not the include any of the above keys, they will default
If you choose not the include any of the above keys, they will default
to the following respective keys in your info.plist file.
<pre>
@@ -1003,7 +1005,7 @@ CPRunContinuesResponse = -1002;
}
/*!
Sets the arguments of your application.
Sets the arguments of your application.
That is, set the slash seperated values of an array as the window location hash.
For example if you pass an array:
@@ -1156,6 +1158,16 @@ CPRunContinuesResponse = -1002;
userInfo:nil];
}
- (CPThemeBlend)themeBlend
{
return (_themeBlends.length > 0 ? _themeBlends[0] : nil);
}
- (void)setThemeBlend:(CPThemeBlend)aThemeBlend
{
_themeBlends[0] = aThemeBlend;
}
+ (CPString)defaultThemeName
{
return ([[CPBundle mainBundle] objectForInfoDictionaryKey:"CPDefaultTheme"] || @"Aristo");
@@ -1218,15 +1230,14 @@ function CPApplicationMain(args, namedArgs)
[_CPAppBootstrapper performActions];
}
var _CPAppBootstrapperActions = nil;
var _CPAppBootstrapperActions = nil,
_CPAppThemeURLsToLoad = [];
@implementation _CPAppBootstrapper : CPObject
{
}
+ (CPArray)actions
{
return [@selector(bootstrapPlatform), @selector(loadDefaultTheme), @selector(loadMainCibFile)];
return [@selector(bootstrapPlatform), @selector(loadThemes), @selector(loadMainCibFile)];
}
+ (void)performActions
@@ -1250,17 +1261,30 @@ var _CPAppBootstrapperActions = nil;
return [CPPlatform bootstrap];
}
+ (BOOL)loadDefaultTheme
+ (BOOL)loadThemes
{
var defaultThemeName = [CPApplication defaultThemeName],
themeURL = nil;
_CPAppThemeURLsToLoad.push([CPApplication defaultThemeName]);
if (defaultThemeName === @"Aristo")
themeURL = [[CPBundle bundleForClass:[CPApplication class]] pathForResource:defaultThemeName + @".blend"];
var auxiliaryThemes = ([[CPBundle mainBundle] objectForInfoDictionaryKey:@"CPAuxiliaryThemes"] || []);
_CPAppThemeURLsToLoad = _CPAppThemeURLsToLoad.concat(auxiliaryThemes);
[self loadNextTheme];
return YES;
}
+ (BOOL)loadNextTheme
{
var themeName = _CPAppThemeURLsToLoad.shift();
if (themeName === @"Aristo")
themeURL = [[CPBundle bundleForClass:[CPApplication class]] pathForResource:themeName + @".blend"];
else
themeURL = [[CPBundle mainBundle] pathForResource:defaultThemeName + @".blend"];
themeURL = [[CPBundle mainBundle] pathForResource:themeName + @".blend"];
var blend = [[CPThemeBlend alloc] initWithContentsOfURL:themeURL];
[blend loadWithDelegate:self];
return YES;
@@ -1268,10 +1292,17 @@ var _CPAppBootstrapperActions = nil;
+ (void)blendDidFinishLoading:(CPThemeBlend)aThemeBlend
{
[[CPApplication sharedApplication] setThemeBlend:aThemeBlend];
[CPTheme setDefaultTheme:[CPTheme themeNamed:[CPApplication defaultThemeName]]];
var themeBlends = [CPApp themeBlends];
[self performActions];
[themeBlends addObject:aThemeBlend];
if ([themeBlends count] === 1)
[CPTheme setDefaultTheme:[CPTheme themeNamed:[CPApplication defaultThemeName]]];
if (_CPAppThemeURLsToLoad.length === 0)
[self performActions];
else
[self loadNextTheme];
}
+ (BOOL)loadMainCibFile
+99 -6
View File
@@ -27,6 +27,7 @@
@import "CPCompatibility.j"
@import "CPImage.j"
/// @cond IGNORE
var _redComponent = 0,
_greenComponent = 1,
@@ -54,6 +55,66 @@ var cachedBlackColor,
cachedShadowColor,
cachedClearColor;
/// @endcond
/*!
Orientation to use with \c CPColorPattern for vertical patterns.
*/
CPColorPatternIsVertical = YES,
/*!
Orientation to use with \c CPColorPattern for horizontal patterns.
*/
CPColorPatternIsHorizontal = NO;
/*!
To create a simple color with a pattern image:
<code>CPColorWithImages(name, width, height{, bundle})</code>
To create a color with a three part pattern image:
<code>CPColorWithImages(slices{, orientation})</code>
where slices is an array of three [name, width, height{, bundle}] arrays,
and orientation is \c CPColorPatternIsVertical or \ref CPColorPatternIsHorizontal.
If orientatation is not passed, it defaults to \ref CPColorPatternIsHorizontal.
To create a color with a nine part pattern image:
<code>CPColorWithImages(slices);</code>
where slices is an array of nine [name, width, height{, bundle}] arrays.
*/
function CPColorWithImages()
{
if (arguments.length < 3)
{
var slices = arguments[0],
imageSlices = [];
for (var i = 0; i < slices.length; ++i)
{
var slice = slices[i];
imageSlices.push(slice ? CPImageInBundle(slice[0], CGSizeMake(slice[1], slice[2]), slice[3]) : nil);
}
if (imageSlices.length === 3)
return [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:imageSlices isVertical:arguments[1] || CPColorPatternIsHorizontal]];
else
return [CPColor colorWithPatternImage:[[CPNinePartImage alloc] initWithImageSlices:imageSlices]];
}
else if (arguments.length === 3 || arguments.length === 4)
{
return [CPColor colorWithPatternImage:CPImageInBundle(arguments[0], CGSizeMake(arguments[1], arguments[2]), arguments[3])];
}
else
{
return nil;
}
}
/*!
@ingroup appkit
@@ -633,7 +694,36 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image
- (CPString)description
{
return [super description]+" "+[self cssString];
var description = [super description],
patternImage = [self patternImage];
if (!patternImage)
return description + " " + [self cssString];
description += " {\n";
if ([patternImage isThreePartImage] || [patternImage isNinePartImage])
{
var slices = [patternImage imageSlices];
if ([patternImage isThreePartImage])
description += " orientation: " + ([patternImage isVertical] ? "vertical" : "horizontal") + ",\n";
description += " patternImage (" + slices.length + " part): [\n";
for (var i = 0; i < slices.length; ++i)
{
var imgDescription = [slices[i] description];
description += imgDescription.replace(/^/mg, " ") + ",\n";
}
description = description.substr(0, description.length - 2) + "\n ]\n}";
}
else
description += [patternImage description].replace(/^/mg, " ") + "\n}";
return description;
}
@end
@@ -678,8 +768,10 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image
@end
/// @cond IGNORE
var CPColorComponentsKey = @"CPColorComponentsKey",
CPColorPatternImageKey = @"CPColorPatternImageKey";
/// @endcond
@implementation CPColor (CPCoding)
@@ -710,13 +802,12 @@ var CPColorComponentsKey = @"CPColorComponentsKey",
@end
/// @cond IGNORE
var hexCharacters = "0123456789ABCDEF";
/*!
Used for the CPColor \c +colorWithHexString: implementation
@ignore
@class CPColor
@return an array of rgb components
/*
Used for the CPColor +colorWithHexString: implementation.
Returns an array of rgb components.
*/
var hexToRGB = function(hex)
{
@@ -754,3 +845,5 @@ var byteToHex = function(n)
return hexCharacters.charAt((n - n % 16) / 16) +
hexCharacters.charAt(n % 16);
};
/// @endcond
+17 -19
View File
@@ -571,29 +571,28 @@ var _CPEventPeriodicEventPeriod = 0,
if (_modifierFlags & (CPCommandKeyMask | CPControlKeyMask))
return YES;
// Cocoa does not consider space, backspace, or escape a key equivalent
// if the first responder is a text field (presumably a subclass of NSText).
var firstResponderIsText = [[_window firstResponder] isKindOfClass:[CPTextField class]];
for (var i = 0; i < characterCount; i++)
{
switch (_characters.charAt(i))
var c = _characters.charAt(i);
if ((c >= CPUpArrowFunctionKey && c <= CPModeSwitchFunctionKey) ||
c === CPEnterCharacter ||
c === CPNewlineCharacter ||
c === CPCarriageReturnCharacter ||
c === CPEscapeFunctionKey ||
(!firstResponderIsText &&
(c === CPSpaceFunctionKey ||
c === CPDeleteCharacter ||
c === CPBackspaceCharacter)))
{
case CPBackspaceCharacter:
case CPDeleteCharacter:
case CPDeleteFunctionKey:
case CPTabCharacter:
case CPCarriageReturnCharacter:
case CPNewlineCharacter:
case CPSpaceFunctionKey:
case CPEscapeFunctionKey:
case CPPageUpFunctionKey:
case CPPageDownFunctionKey:
case CPLeftArrowFunctionKey:
case CPUpArrowFunctionKey:
case CPRightArrowFunctionKey:
case CPDownArrowFunctionKey:
case CPEndFunctionKey:
case CPHomeFunctionKey:
return YES;
return YES;
}
}
// FIXME: More cases?
return NO;
}
@@ -651,4 +650,3 @@ function _CPEventFromNativeMouseEvent(aNativeEvent, anEventType, aPoint, modifie
return aNativeEvent;
}
+20 -1
View File
@@ -44,7 +44,8 @@ CPImageNameColorPanel = @"CPImageNameColorPanel";
CPImageNameColorPanelHighlighted = @"CPImageNameColorPanelHighlighted";
var imagesForNames = { },
AppKitImageForNames = { };
AppKitImageForNames = { },
ImageDescriptionFormat = "%s {\n filename: \"%s\",\n size: { width:%f, height:%f }\n}";
AppKitImageForNames[CPImageNameColorPanel] = CGSizeMake(26.0, 29.0);
AppKitImageForNames[CPImageNameColorPanelHighlighted] = CGSizeMake(26.0, 29.0);
@@ -324,6 +325,24 @@ function CPAppKitImage(aFilename, aSize)
return NO;
}
- (CPString)description
{
var filename = [self filename],
size = [self size];
if (filename.indexOf("data:") === 0)
{
var index = filename.indexOf(",");
if (index > 0)
filename = [CPString stringWithFormat:@"%s,%s...%s", filename.substr(0, index), filename.substr(index + 1, 10), filename.substr(filename.length - 10)];
else
filename = "data:<unknown type>";
}
return [CPString stringWithFormat:ImageDescriptionFormat, [super description], filename, size.width, size.height];
}
/* @ignore */
- (void)_derefFromImage
{
+10 -10
View File
@@ -332,18 +332,18 @@ CPTableColumnUserResizingMask = 1 << 1;
individual cell that is shown. As a result, changes made after calling this method won't be reflected.
Example:
@code
[tableColumn setDataView:someView]; // snapshot taken
[[tableColumn dataView] setSomething:x]; //won't work
@endcode
@code
[tableColumn setDataView:someView]; // snapshot taken
[[tableColumn dataView] setSomething:x]; //won't work
@endcode
This doesn't work because the snapshot is taken before the new property is applied. Instead, do:
@code
[someView setSomething:x];
[tableColumn setDataView:someView];
@endcode
@code
[someView setSomething:x];
[tableColumn setDataView:someView];
@endcode
@note you should implement CPKeyedArchiving otherwise you might see unexpected results.
@note You should implement CPKeyedArchiving otherwise you might see unexpected results.
This is done by adding the following methods to your class:
@endnote
@@ -380,7 +380,7 @@ CPTableColumnUserResizingMask = 1 << 1;
}
@endcode
@section Themeing
@section Theming
When you set a dataview and it is added to the tableview the theme state will be set to \c CPThemeStateTableDataView
When the dataview becomes selected the theme state will be set to \c CPThemeStateSelectedDataView.
+1
View File
@@ -323,6 +323,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
{
_tableViewFlags = 0;
_lastSelectedRow = -1;
_clickedRow = -1;
_selectedColumnIndexes = [CPIndexSet indexSet];
_selectedRowIndexes = [CPIndexSet indexSet];
-3
View File
@@ -704,9 +704,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
- (void)keyDown:(CPEvent)anEvent
{
if ([anEvent _couldBeKeyEquivalent] && [self performKeyEquivalent:anEvent])
return;
// CPTextField uses an HTML input element to take the input so we need to
// propagate the dom event so the element is updated. This has to be done
// before interpretKeyEvents: though so individual commands have a chance
+57 -9
View File
@@ -25,9 +25,10 @@
@import <Foundation/CPKeyedUnarchiver.j>
var CPThemesByName = { },
CPThemeDefaultTheme = nil,
CPThemeDefaultHudTheme = nil;
var CPThemesByName = { },
CPThemeNamesByInheritance = [],
CPThemeDefaultTheme = nil,
CPThemeDefaultHudTheme = nil;
/*!
@@ -76,6 +77,52 @@ var CPThemesByName = { },
return CPThemesByName[aName];
}
/*!
Returns an array of names of all loaded themes, in the order they were loaded.
*/
+ (CPArray)allThemeNames
{
return [CPThemeNamesByInheritance copy];
}
/*!
Returns the closest matching theme for a given view or view class.
The matching proceeds as follows:
- The default theme class name for the class is retrieved.
- Starting with the last loaded theme and proceeding towards the default theme,
each theme is checked to see if it defines that theme class.
- If the theme defines the class name, that theme is returned.
- If no themes match, the default theme is returned.
@param aViewOrClass The view or view class to match with a theme
@return The first matching theme
*/
+ (CPTheme)themeForView:(id)aViewOrClass
{
var themeClass = nil;
if (class_isMetaClass(aViewOrClass.isa))
themeClass = [aViewOrClass defaultThemeClass];
else
themeClass = [aViewOrClass themeClass];
if (themeClass)
{
var count = CPThemeNamesByInheritance.length;
while (count--)
{
var theme = CPThemesByName[CPThemeNamesByInheritance[count]];
if ([theme._attributes containsKey:themeClass])
return theme;
}
}
return CPThemeDefaultTheme;
}
- (id)initWithName:(CPString)aName
{
self = [super init];
@@ -86,6 +133,9 @@ var CPThemesByName = { },
_attributes = [CPDictionary dictionary];
CPThemesByName[_name] = self;
if (![CPThemeNamesByInheritance containsObject:_name])
CPThemeNamesByInheritance.push(_name);
}
return self;
@@ -299,6 +349,9 @@ var CPThemeNameKey = @"CPThemeNameKey",
_attributes = [aCoder decodeObjectForKey:CPThemeAttributesKey];
CPThemesByName[_name] = self;
if (![CPThemeNamesByInheritance containsObject:_name])
CPThemeNamesByInheritance.push(_name);
}
return self;
@@ -466,12 +519,7 @@ CPThemeStateCircular = CPThemeState("circular");
- (void)setValue:(id)aValue
{
_cache = {};
if (aValue === undefined || aValue === nil)
_values = [CPDictionary dictionary];
else
_values = [CPDictionary dictionaryWithObject:aValue forKey:String(CPThemeStateNormal)];
[self setValue:aValue forState:CPThemeStateNormal];
}
- (void)setValue:(id)aValue forState:(CPThemeState)aState
+2 -2
View File
@@ -295,7 +295,7 @@ var CPViewFlags = { },
_DOMImageSizes = [];
#endif
_theme = [CPTheme defaultTheme];
_theme = [CPTheme themeForView:self];
_themeState = CPThemeStateNormal;
[self setupViewFlags];
@@ -2695,7 +2695,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
[self setupViewFlags];
_theme = [CPTheme defaultTheme];
_theme = [CPTheme themeForView:self];
_themeClass = [aCoder decodeObjectForKey:CPViewThemeClassKey];
_themeState = CPThemeState([aCoder decodeIntForKey:CPViewThemeStateKey]);
_themeAttributes = {};
@@ -0,0 +1,64 @@
/*
* CPCibRuntimeAttributesConnector.j
* AppKit
*
* Created by Aparajita Fishman.
* Copyright 2011, 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 "CPCibConnector.j"
var CPCibRuntimeAttributesConnectorObjectKey = @"CPCibRuntimeAttributesConnectorObjectKey",
CPCibRuntimeAttributesConnectorKeyPathsKey = @"CPCibRuntimeAttributesConnectorKeyPathsKey",
CPCibRuntimeAttributesConnectorValuesKey = @"CPCibRuntimeAttributesConnectorValuesKey";
@implementation CPCibRuntimeAttributesConnector : CPCibConnector
{
id _keyPaths;
id _values;
}
- (id)initWithCoder:(CPCoder)aCoder
{
if (self = [super initWithCoder:aCoder])
{
_source = [aCoder decodeObjectForKey:CPCibRuntimeAttributesConnectorObjectKey];
_keyPaths = [aCoder decodeObjectForKey:CPCibRuntimeAttributesConnectorKeyPathsKey];
_values = [aCoder decodeObjectForKey:CPCibRuntimeAttributesConnectorValuesKey];
}
return self;
}
- (void)encodeWithCoder:(CPCoder)aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeObject:_source forKey:CPCibRuntimeAttributesConnectorObjectKey];
[aCoder encodeObject:_keyPaths forKey:CPCibRuntimeAttributesConnectorKeyPathsKey];
[aCoder encodeObject:_values forKey:CPCibRuntimeAttributesConnectorValuesKey];
}
- (void)establishConnection
{
var count = [_keyPaths count];
while (count--)
[_source setValue:_values[count] forKeyPath:_keyPaths[count]];
}
@end
+2 -2
View File
@@ -61,14 +61,14 @@ var _CPCibClassSwapperClassNameKey = @"_CPCibClassSwapperClassNameKey",
if (!object)
{
CPLog.error("Unable to find class " + theClassName + " in cib file.");
CPLog.error("Unable to find class " + theClassName + " referenced in cib file.");
object = [self allocObjectWithCoder:aCoder className:[aCoder decodeObjectForKey:_CPCibClassSwapperOriginalClassNameKey]];
}
}
if (!object)
[CPException raise:CPInvalidArgumentException reason:@"Unable to find class " + theClassName + " in cib file."];
[CPException raise:CPInvalidArgumentException reason:@"Unable to find class " + theClassName + " referenced in cib file."];
return object;
}
+17 -1
View File
@@ -43,6 +43,11 @@ var _CPCibCustomResourceClassNameKey = @"_CPCibCustomResourceClassNameKey",
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:[CPDictionary dictionaryWithObject:aSize forKey:@"size"]];
}
+ (id)imageResourceWithName:(CPString)aResourceName size:(CGSize)aSize bundleClass:(CPString)aBundleClass
{
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:[CPDictionary dictionaryWithObjects:[aSize, aBundleClass] forKeys:[@"size", @"bundleClass"]]];
}
- (id)initWithClassName:(CPString)aClassName resourceName:(CPString)aResourceName properties:(CPDictionary)properties
{
self = [super init];
@@ -89,7 +94,18 @@ var _CPCibCustomResourceClassNameKey = @"_CPCibCustomResourceClassNameKey",
else if (_resourceName == "CPRemoveTemplate")
return [[CPImage alloc] initWithContentsOfFile:[[CPBundle bundleForClass:[CPButtonBar class]] pathForResource:@"minus_button.png"] size:CGSizeMake(11, 4)];
return [[CPImage alloc] initWithContentsOfFile:[[aCoder bundle] pathForResource:_resourceName] size:_properties.valueForKey(@"size")];
var bundleClass = _properties.valueForKey(@"bundleClass"),
bundle = nil;
if (bundleClass)
{
bundleClass = CPClassFromString(bundleClass);
if (bundleClass)
bundle = [CPBundle bundleForClass:bundleClass];
}
return [[CPImage alloc] initWithContentsOfFile:[(bundle || [aCoder bundle]) pathForResource:_resourceName] size:_properties.valueForKey(@"size")];
}
return self;
+21 -2
View File
@@ -29,6 +29,7 @@
@import "CPCibControlConnector.j"
@import "CPCibOutletConnector.j"
@import "CPCibBindingConnector.j"
@import "CPCibRuntimeAttributesConnector.j"
@implementation _CPCibObjectData : CPObject
@@ -257,11 +258,29 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
_replacementObjects[[_fileOwner UID]] = anOwner;
var index = 0,
count = _connections.length;
count = _connections.length,
runtimeAttributeConnectors = [],
connection = nil;
for (; index < count; ++index)
{
var connection = _connections[index];
connection = _connections[index];
if ([connection isKindOfClass:[CPCibRuntimeAttributesConnector class]])
// Defer runtime attribute connections until after all other connections are made
runtimeAttributeConnectors.push(connection);
else
{
[connection replaceObjects:_replacementObjects];
[connection establishConnection];
}
}
count = runtimeAttributeConnectors.length;
for (index = 0; index < count; ++index)
{
connection = runtimeAttributeConnectors[index];
[connection replaceObjects:_replacementObjects];
[connection establishConnection];
+2 -2
View File
@@ -810,8 +810,8 @@ var themedButtonValues = nil,
[@"bezel-color", bezelDisabledColor, CPThemeStateBezeled | CPThemeStateDisabled],
[@"font", [CPFont systemFontOfSize:12.0], CPThemeStateBezeled],
[@"content-inset", CGInsetMake(8.0, 7.0, 5.0, 8.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(7.0, 7.0, 5.0, 8.0), CPThemeStateBezeled | CPThemeStateEditing],
[@"content-inset", CGInsetMake(7.0, 7.0, 6.0, 8.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(6.0, 7.0, 6.0, 8.0), CPThemeStateBezeled | CPThemeStateEditing],
[@"bezel-inset", CGInsetMake(3.0, 4.0, 3.0, 4.0), CPThemeStateBezeled],
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled | CPThemeStateEditing],
+22
View File
@@ -288,6 +288,28 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
return _textShadowOffset;
}
- (CGRect)textFrame
{
[self layoutIfNeeded];
var textFrame = CGRectMakeZero();
if (_DOMTextElement)
{
var textStyle = _DOMTextElement.style;
textFrame.origin.y = parseInt(textStyle.top.substr(0, textStyle.top.length - 2), 10),
textFrame.origin.x = parseInt(textStyle.left.substr(0, textStyle.left.length - 2), 10),
textFrame.size.width = parseInt(textStyle.width.substr(0, textStyle.width.length - 2), 10),
textFrame.size.height = parseInt(textStyle.height.substr(0, textStyle.height.length - 2), 10);
textFrame.size.width += _textShadowOffset.width;
textFrame.size.height += _textShadowOffset.height;
}
return textFrame;
}
- (void)setImage:(CPImage)anImage
{
if (_image == anImage)
+54
View File
@@ -0,0 +1,54 @@
require File.join(File.dirname(__FILE__), "repositories.rb")
require File.join(File.dirname(__FILE__), "dependencies.rb")
# Keep this structure to allow the build system to update version numbers.
VERSION_NUMBER = "1.0.0.004"
# Shorten expressions
def jars(*args)
args.collect {|arg| project(arg).package(:jar)}
end
desc "Cappuccino Distribution"
define "cappuccino" do
project.version = VERSION_NUMBER
project.group = "com.intalio.cloud.cappuccino"
file(_("target/patch")).enhance do
mkdir_p "target/patch"
end
file(_("target/Frameworks")).enhance do
mkdir_p "target/Frameworks/Debug"
system <<-BASH
export BUILD_PATH="target/Build"
jake debug release
BASH
cp_r "target/Build/Release/AppKit", "target/Frameworks/"
cp_r "target/Build/Release/Foundation", "target/Frameworks/"
cp_r "target/Build/Release/Objective-J", "target/Frameworks/"
cp_r "target/Build/Debug/AppKit", "target/Frameworks/Debug/"
cp_r "target/Build/Debug/Foundation", "target/Frameworks/Debug/"
cp_r "target/Build/Debug/Objective-J", "target/Frameworks/Debug/"
end
# file(_("target/Build")).enhance do
# end
read_m = ::Buildr::Packaging::Java::Manifest.parse(File.read(_("META-INF/MANIFEST.MF"))).main
read_m["Copyright"]="Intalio, Inc 2011"
read_m["Bundle-Version"]=VERSION_NUMBER.gsub(/SNAPSHOT/, "#{Time.now.to_i}")
read_m.delete("Jetty-WarFragmentFolderPath")
read_m.delete("Jetty-WarPatchFragmentFolderPath")
package(:jar).with :manifest => read_m
#package(:jar).include _("target/patch"), :as => "patch"
package(:jar).include _("target/Frameworks"), :as => "META-INF/resources/Frameworks"
#do not include those: they are at best not read harmful.
#package(:bundle).include _("build.properties"), :as => "build.properties"
#package(:bundle).meta_inf << file('META-INF/web-fragment.xml')
end
+15 -1
View File
@@ -428,7 +428,9 @@ var avgOperator,
maxOperator,
minOperator,
countOperator,
sumOperator;
sumOperator,
distinctUnionOfObjectsOperator,
unionOfObjectsOperator;
kvoOperators["avg"] = function avgOperator(self, _cmd, param)
{
@@ -495,6 +497,18 @@ kvoOperators["sum"] = function sumOperator(self, _cmd, param)
return sum;
}
kvoOperators["distinctUnionOfObjects"] = function distinctUnionOfObjectsOperator(self, _cmd, param)
{
var objects = [self valueForKeyPath:param];
return [[CPSet setWithArray:objects] allObjects];
}
kvoOperators["unionOfObjects"] = function unionOfObjectsOperator(self, _cmd, param)
{
return [self valueForKeyPath:param];
}
@implementation CPArray (KeyValueObserving)
- (void)addObserver:(id)anObserver toObjectsAtIndexes:(CPIndexSet)indexes forKeyPath:(CPString)aKeyPath options:(unsigned)options context:(id)context
+2 -3
View File
@@ -201,11 +201,10 @@ var _CPKeyedArchiverStringClass = Nil,
for (; i < _objects.length; ++i)
{
var object = _objects[i],
theClass = [object classForKeyedArchiver];
var object = _objects[i];
// Do whatever with the class, yo.
// We call willEncodeObject previously.
// We called willEncodeObject previously.
_plistObject = _plistObjects[[_UIDs objectForKey:[object UID]]];
[object encodeWithCoder:self];
+10 -6
View File
@@ -438,14 +438,18 @@ var CPComparisonPredicateModifier,
reg = new RegExp(rhs.escapeForRegExp(),commut);
return reg.test(lhs);
case CPBeginsWithPredicateOperatorType: var range = CPMakeRange(0,[rhs length]);
if (_options & CPCaseInsensitivePredicateOption) string_compare_options |= CPCaseInsensitiveSearch;
if (_options & CPDiacriticInsensitivePredicateOption) string_compare_options |= CPDiacriticInsensitiveSearch;
case CPBeginsWithPredicateOperatorType: var range = CPMakeRange(0, MIN([lhs length], [rhs length]));
if (_options & CPCaseInsensitivePredicateOption)
string_compare_options |= CPCaseInsensitiveSearch;
if (_options & CPDiacriticInsensitivePredicateOption)
string_compare_options |= CPDiacriticInsensitiveSearch;
return ([lhs compare:rhs options:string_compare_options range:range] == CPOrderedSame);
case CPEndsWithPredicateOperatorType: var range = CPMakeRange([lhs length] - [rhs length],[rhs length]);
if (_options & CPCaseInsensitivePredicateOption) string_compare_options |= CPCaseInsensitiveSearch;
if (_options & CPDiacriticInsensitivePredicateOption) string_compare_options |= CPDiacriticInsensitiveSearch;
case CPEndsWithPredicateOperatorType: var range = CPMakeRange(MAX([lhs length] - [rhs length], 0), MIN([lhs length], [rhs length]));
if (_options & CPCaseInsensitivePredicateOption)
string_compare_options |= CPCaseInsensitiveSearch;
if (_options & CPDiacriticInsensitivePredicateOption)
string_compare_options |= CPDiacriticInsensitiveSearch;
return ([lhs compare:rhs options:string_compare_options range:range] == CPOrderedSame);
case CPCustomSelectorPredicateOperatorType: return [lhs performSelector:_customSelector withObject:rhs];
+25
View File
@@ -0,0 +1,25 @@
source "http://rubygems.org"
gem "atoulme-Antwrap", "0.7.1" # -java
gem "bouncy-castle-java", "1.5.0146.1"
gem "builder", "2.1.2"
gem "buildr", "1.4.5" # -java
gem "buildr4osgi", "0.9.6"
gem "bundler", "1.0.0.rc.5"
gem "diff-lcs", "1.1.2"
gem "highline", "1.5.1"
gem "hoe", "2.3.3"
gem "jruby-openssl", "0.7.4"
gem "json_pure", "1.4.3"
gem "manifest", "0.0.8"
gem "minitar", "0.5.3"
gem "net-sftp", "2.0.4"
gem "net-ssh", "2.0.23" # 2.1.4
gem "rake", "0.8.7" # 0.9.1
gem "rspec", "2.1.0"
gem "rspec-core", "2.1.0"
gem "rspec-expectations", "2.1.0"
gem "rspec-mocks", "2.1.0"
gem "rubyforge", "2.0.3"
gem "rubyzip", "0.9.4"
gem "xml-simple", "1.0.12"
+81
View File
@@ -0,0 +1,81 @@
GEM
remote: http://rubygems.org/
specs:
atoulme-Antwrap (0.7.1-java)
bouncy-castle-java (1.5.0146.1)
builder (2.1.2)
buildr (1.4.5-java)
atoulme-Antwrap (= 0.7.1)
builder (= 2.1.2)
diff-lcs (= 1.1.2)
highline (= 1.5.1)
hoe (= 2.3.3)
jruby-openssl (>= 0.7)
json_pure (= 1.4.3)
minitar (= 0.5.3)
net-sftp (= 2.0.4)
net-ssh (= 2.0.23)
rake (= 0.8.7)
rspec (= 2.1.0)
rspec-core (= 2.1.0)
rspec-expectations (= 2.1.0)
rspec-mocks (= 2.1.0)
rubyforge (= 2.0.3)
rubyzip (= 0.9.4)
xml-simple (= 1.0.12)
buildr4osgi (0.9.6)
manifest (= 0.0.8)
diff-lcs (1.1.2)
highline (1.5.1)
hoe (2.3.3)
rake (>= 0.8.7)
rubyforge (>= 1.0.4)
jruby-openssl (0.7.4)
bouncy-castle-java
json_pure (1.4.3)
manifest (0.0.8)
minitar (0.5.3)
net-sftp (2.0.4)
net-ssh (>= 2.0.9)
net-ssh (2.0.23)
rake (0.8.7)
rspec (2.1.0)
rspec-core (~> 2.1.0)
rspec-expectations (~> 2.1.0)
rspec-mocks (~> 2.1.0)
rspec-core (2.1.0)
rspec-expectations (2.1.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.1.0)
rubyforge (2.0.3)
json_pure (>= 1.1.7)
rubyzip (0.9.4)
xml-simple (1.0.12)
PLATFORMS
java
DEPENDENCIES
atoulme-Antwrap (= 0.7.1)
bouncy-castle-java (= 1.5.0146.1)
builder (= 2.1.2)
buildr (= 1.4.5)
buildr4osgi (= 0.9.6)
bundler (= 1.0.0.rc.5)
diff-lcs (= 1.1.2)
highline (= 1.5.1)
hoe (= 2.3.3)
jruby-openssl (= 0.7.4)
json_pure (= 1.4.3)
manifest (= 0.0.8)
minitar (= 0.5.3)
net-sftp (= 2.0.4)
net-ssh (= 2.0.23)
rake (= 0.8.7)
rspec (= 2.1.0)
rspec-core (= 2.1.0)
rspec-expectations (= 2.1.0)
rspec-mocks (= 2.1.0)
rubyforge (= 2.0.3)
rubyzip (= 0.9.4)
xml-simple (= 1.0.12)
+9
View File
@@ -0,0 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: cappuccinofrag
Bundle-SymbolicName: com.intalio.cloud.cappuccino
Fragment-Host: com.intalio.cloud.carbon
Jetty-WarPatchFragmentFolderPath: /
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-BundleShape: dir
+22
View File
@@ -189,6 +189,28 @@
[self assertTrue:[pred evaluateWithObject:dict] message:"'"+ [pred description] + "' should be true"];
}
- (void)testBeginsWithEndsWithPredicate
{
// This always worked
var data = ["To", "Tom", "Tomb", "Tomboy"],
pred = [CPPredicate predicateWithFormat:@"SELF beginsWith 'To'"],
result = [data filteredArrayUsingPredicate:pred];
[self assertTrue:result.length === 4 message:"'" + [pred description] + "' should return [\"To\", \"Tom\", \"Tomb\", \"Tomboy\"]"];
// Make sure beginsWith comparison string longer than source strings works
pred = [CPPredicate predicateWithFormat:@"SELF beginsWith 'Tomb'"];
result = [data filteredArrayUsingPredicate:pred];
[self assertTrue:[result isEqual:["Tomb", "Tomboy"]] message:"'" + [pred description] + "' should return [\"Tomb\", \"Tomboy\"]"];
// Make sure endsWith comparison string longer than source strings works
pred = [CPPredicate predicateWithFormat:@"SELF endsWith 'boy'"];
result = [data filteredArrayUsingPredicate:pred];
[self assertTrue:[result isEqual:["Tomboy"]] message:"'" + [pred description] + "' should return [\"Tomboy\"]"];
}
- (void)testNilComparisons
{
// Custom Selector Predicate
@@ -0,0 +1,80 @@
/*
* AppController.j
* test
*
* Created by aparajita on May 19, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
@import <Foundation/CPObject.j>
function formatter(aString, aLevel, aTitle)
{
return aString;
}
@implementation AppController : CPObject
{
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
CPView simpleColor;
CPView patternColor;
CPView threePartColor;
CPView ninePartColor;
CPImage imageView;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (void)awakeFromCib
{
CPLogRegister(CPLogConsole, null, formatter);
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
var color = [CPColor colorWithHexString:@"88B3FF"];
CPLog([color description]);
[simpleColor setBackgroundColor:color];
color = CPColorWithImages("wheel_button.png", 32, 32, [CPBundle bundleForClass:[CPView class]]);
CPLog([color description]);
[patternColor setBackgroundColor:color];
var bundle = [CPBundle bundleForClass:[CPView class]];
color = CPColorWithImages([
["Aristo.blend/Resources/button-bezel-left.png", 4, 24, bundle],
["Aristo.blend/Resources/button-bezel-center.png", 1, 24, bundle],
["Aristo.blend/Resources/button-bezel-right.png", 4, 24, bundle]
]);
CPLog([color description]);
[threePartColor setBackgroundColor:color];
color = CPColorWithImages([
["Aristo.blend/Resources/textfield-bezel-square-focused-0.png", 7, 7, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-1.png", 1, 7, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-2.png", 7, 7, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-3.png", 7, 1, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-4.png", 1, 1, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-5.png", 7, 1, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-6.png", 7, 7, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-7.png", 1, 7, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-8.png", 7, 7, bundle],
]);
CPLog([color description]);
[ninePartColor setBackgroundColor:color];
var image = CPImageInBundle("add1-32.png", CGSizeMake(32, 32));
CPLog([image description]);
[imageView setImage:image];
}
@end
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Main cib file base name</key>
<string>MainMenu.cib</string>
<key>CPBundleName</key>
<string>CPColor-CPImage-description</string>
</dict>
</plist>
@@ -0,0 +1,94 @@
/*
* Jakefile
* test
*
* Created by aparajita on May 19, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("test", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "test.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("test");
task.setIdentifier("com.aparajita.test");
task.setVersion("1.0");
task.setAuthor("Victory-Heart Productions");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("test");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
task.setNib2CibFlags("-R Resources/");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["test"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "test", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "test", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "test"));
OS.system(["press", "-f", FILE.join("Build", "Release", "test"), FILE.join("Build", "Deployment", "test")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "test"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "test"), FILE.join("Build", "Desktop", "test", "test.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "test", "test.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "test"));
print("----------------------------");
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,654 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10J869</string>
<string key="IBDocument.InterfaceBuilderVersion">804</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">804</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="372"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="1021">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomObject" id="1014">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1050">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="972006081">
<int key="NSWindowStyleMask">7</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{335, 370}, {389, 380}}</string>
<int key="NSWTFlags">1946157056</int>
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<object class="NSView" key="NSWindowView" id="439893737">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomView" id="1066696903">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 297}, {159, 36}}</string>
<reference key="NSSuperview" ref="439893737"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSTextField" id="385245898">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{47, 307}, {82, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="12386750">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Simple color</string>
<object class="NSFont" key="NSSupport" id="710279137">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="385245898"/>
<object class="NSColor" key="NSBackgroundColor" id="616930867">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="968014435">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
</object>
<object class="NSCustomView" id="605260233">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 243}, {159, 36}}</string>
<reference key="NSSuperview" ref="439893737"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSTextField" id="179895693">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{47, 253}, {85, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="222300836">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Pattern color</string>
<reference key="NSSupport" ref="710279137"/>
<reference key="NSControlView" ref="179895693"/>
<reference key="NSBackgroundColor" ref="616930867"/>
<reference key="NSTextColor" ref="968014435"/>
</object>
</object>
<object class="NSCustomView" id="688674788">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 186}, {159, 36}}</string>
<reference key="NSSuperview" ref="439893737"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSTextField" id="63869060">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{47, 196}, {85, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="828490958">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">3-part color</string>
<reference key="NSSupport" ref="710279137"/>
<reference key="NSControlView" ref="63869060"/>
<reference key="NSBackgroundColor" ref="616930867"/>
<reference key="NSTextColor" ref="968014435"/>
</object>
</object>
<object class="NSCustomView" id="100716157">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 130}, {159, 36}}</string>
<reference key="NSSuperview" ref="439893737"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSTextField" id="488609560">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{47, 140}, {85, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="548167261">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">9-part color</string>
<reference key="NSSupport" ref="710279137"/>
<reference key="NSControlView" ref="488609560"/>
<reference key="NSBackgroundColor" ref="616930867"/>
<reference key="NSTextColor" ref="968014435"/>
</object>
</object>
<object class="NSTextField" id="696346150">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{47, 84}, {85, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="30856995">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Image</string>
<reference key="NSSupport" ref="710279137"/>
<reference key="NSControlView" ref="696346150"/>
<reference key="NSBackgroundColor" ref="616930867"/>
<reference key="NSTextColor" ref="968014435"/>
</object>
</object>
<object class="NSImageView" id="276994718">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<object class="NSMutableSet" key="NSDragTypes">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="set.sortedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>Apple PDF pasteboard type</string>
<string>Apple PICT pasteboard type</string>
<string>Apple PNG pasteboard type</string>
<string>NSFilenamesPboardType</string>
<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
<string>NeXT TIFF v4.0 pasteboard type</string>
</object>
</object>
<string key="NSFrame">{{148, 68}, {48, 48}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="334634827">
<int key="NSCellFlags">130560</int>
<int key="NSCellFlags2">33554432</int>
<int key="NSAlign">0</int>
<int key="NSScale">2</int>
<int key="NSStyle">0</int>
<bool key="NSAnimates">NO</bool>
</object>
<bool key="NSEditable">YES</bool>
</object>
</object>
<string key="NSFrameSize">{389, 380}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSCustomObject" id="635946545">
<string key="NSClassName">AppController</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1021"/>
<reference key="destination" ref="635946545"/>
</object>
<int key="connectionID">451</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">theWindow</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="972006081"/>
</object>
<int key="connectionID">459</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">ninePartColor</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="100716157"/>
</object>
<int key="connectionID">480</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">threePartColor</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="688674788"/>
</object>
<int key="connectionID">481</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">patternColor</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="605260233"/>
</object>
<int key="connectionID">482</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">simpleColor</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="1066696903"/>
</object>
<int key="connectionID">483</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">imageView</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="276994718"/>
</object>
<int key="connectionID">490</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1048"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1021"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1014"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1050"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">371</int>
<reference key="object" ref="972006081"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="439893737"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">372</int>
<reference key="object" ref="439893737"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="385245898"/>
<reference ref="1066696903"/>
<reference ref="605260233"/>
<reference ref="179895693"/>
<reference ref="688674788"/>
<reference ref="63869060"/>
<reference ref="100716157"/>
<reference ref="488609560"/>
<reference ref="696346150"/>
<reference ref="276994718"/>
</object>
<reference key="parent" ref="972006081"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">450</int>
<reference key="object" ref="635946545"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">468</int>
<reference key="object" ref="1066696903"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">469</int>
<reference key="object" ref="385245898"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="12386750"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">470</int>
<reference key="object" ref="12386750"/>
<reference key="parent" ref="385245898"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">471</int>
<reference key="object" ref="605260233"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">472</int>
<reference key="object" ref="179895693"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="222300836"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">473</int>
<reference key="object" ref="222300836"/>
<reference key="parent" ref="179895693"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">474</int>
<reference key="object" ref="688674788"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">475</int>
<reference key="object" ref="63869060"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="828490958"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">476</int>
<reference key="object" ref="828490958"/>
<reference key="parent" ref="63869060"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">477</int>
<reference key="object" ref="100716157"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">478</int>
<reference key="object" ref="488609560"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="548167261"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">479</int>
<reference key="object" ref="548167261"/>
<reference key="parent" ref="488609560"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">485</int>
<reference key="object" ref="696346150"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="30856995"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">486</int>
<reference key="object" ref="30856995"/>
<reference key="parent" ref="696346150"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">487</int>
<reference key="object" ref="276994718"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="334634827"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">488</int>
<reference key="object" ref="334634827"/>
<reference key="parent" ref="276994718"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-3.IBPluginDependency</string>
<string>371.IBEditorWindowLastContentRect</string>
<string>371.IBPluginDependency</string>
<string>371.IBViewEditorWindowController.showingBoundsRectangles</string>
<string>371.IBViewEditorWindowController.showingLayoutRectangles</string>
<string>371.IBWindowTemplateEditedContentRect</string>
<string>371.NSWindowTemplate.visibleAtLaunch</string>
<string>371.editorWindowContentRectSynchronizationRect</string>
<string>372.IBPluginDependency</string>
<string>468.IBPluginDependency</string>
<string>468.IBViewBoundsToFrameTransform</string>
<string>469.IBPluginDependency</string>
<string>469.IBViewBoundsToFrameTransform</string>
<string>470.IBPluginDependency</string>
<string>471.IBPluginDependency</string>
<string>471.IBViewBoundsToFrameTransform</string>
<string>472.IBPluginDependency</string>
<string>472.IBViewBoundsToFrameTransform</string>
<string>473.IBPluginDependency</string>
<string>474.IBPluginDependency</string>
<string>474.IBViewBoundsToFrameTransform</string>
<string>475.IBPluginDependency</string>
<string>475.IBViewBoundsToFrameTransform</string>
<string>476.IBPluginDependency</string>
<string>477.IBPluginDependency</string>
<string>477.IBViewBoundsToFrameTransform</string>
<string>478.IBPluginDependency</string>
<string>478.IBViewBoundsToFrameTransform</string>
<string>479.IBPluginDependency</string>
<string>485.IBPluginDependency</string>
<string>485.IBViewBoundsToFrameTransform</string>
<string>486.IBPluginDependency</string>
<string>487.IBPluginDependency</string>
<string>488.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{432, 718}, {389, 380}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<boolean value="YES"/>
<string>{{432, 718}, {389, 380}}</string>
<integer value="1"/>
<string>{{33, 99}, {480, 360}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AUMXAABDm4AAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAw6gAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AUMXAABDgIAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAw40AAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AUMXAABDSAAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAw2EAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AUMXAABDAgAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAwxsAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCUAAAwxYAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">490</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">theWindow</string>
<string key="NS.object.0">NSWindow</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">theWindow</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">theWindow</string>
<string key="candidateClassName">NSWindow</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/AppController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>imageView</string>
<string>ninePartColor</string>
<string>patternColor</string>
<string>simpleColor</string>
<string>threePartColor</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>imageView</string>
<string>ninePartColor</string>
<string>patternColor</string>
<string>simpleColor</string>
<string>threePartColor</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">imageView</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">ninePartColor</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">patternColor</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">simpleColor</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">threePartColor</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,103 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index-debug.html
test
Created by aparajita on May 19, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>CPColor-CPImage-description</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading test...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
@@ -0,0 +1,77 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index.html
test
Created by aparajita on May 19, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>CPColor-CPImage-description</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading test...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
@@ -0,0 +1,18 @@
/*
* AppController.j
* test
*
* Created by aparajita on May 19, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
@@ -0,0 +1,43 @@
/*
* AppController.j
* RuntimeAttributesTest
*
* Created by Aparajita Fishman on March 26, 2011.
* Copyright 2009, 280 North, Inc. All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
CPView firstResponder;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
// In this case, we want the window from Cib to become our full browser window
//[theWindow setFullPlatformWindow:YES];
}
- (void)setInitialResponder:(CPInteger)tag
{
[theWindow setInitialFirstResponder:[[theWindow contentView] viewWithTag:tag]];
}
- (void)setValue:(id)value forUndefinedKey:(CPString)key
{
console.log("setValue:" + value + " forKey:" + key);
}
@end
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Main cib file base name</key>
<string>MainMenu.cib</string>
<key>CPBundleName</key>
<string>RuntimeAttributesTest</string>
</dict>
</plist>
@@ -0,0 +1,94 @@
/*
* Jakefile
* test
*
* Created by aparajita on March 26, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("test", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "test.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("test");
task.setIdentifier("com.aparajitaworld.test");
task.setVersion("1.0");
task.setAuthor("Victory-Heart Productions");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("test");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
task.setNib2CibFlags("-R Resources/");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["test"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "test", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "test", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "test"));
OS.system(["press", "-f", FILE.join("Build", "Release", "test"), FILE.join("Build", "Deployment", "test")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "test"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "test"), FILE.join("Build", "Desktop", "test", "test.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "test", "test.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "test"));
print("----------------------------");
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,609 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1060</int>
<string key="IBDocument.SystemVersion">10J869</string>
<string key="IBDocument.InterfaceBuilderVersion">804</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">804</string>
</object>
<array class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<integer value="24"/>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</array>
<dictionary class="NSMutableDictionary" key="IBDocument.Metadata"/>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="NSCustomObject" id="1001">
<string key="NSClassName">NSObject</string>
</object>
<object class="NSCustomObject" id="1003">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1004">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomObject" id="673890665">
<string key="NSClassName">AppController</string>
</object>
<object class="NSWindowTemplate" id="917316023">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{162, 992}, {548, 314}}</string>
<int key="NSWTFlags">611844096</int>
<string key="NSWindowTitle">RuntimeAttributes Test</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<object class="NSView" key="NSWindowView" id="412280178">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSButton" id="332976459">
<reference key="NSNextResponder" ref="412280178"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{37, 187}, {118, 25}}</string>
<reference key="NSSuperview" ref="412280178"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="941203667">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">button</string>
<object class="NSFont" key="NSSupport" id="28800349">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="332976459"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<object class="NSButton" id="361072273">
<reference key="NSNextResponder" ref="412280178"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{37, 148}, {118, 25}}</string>
<reference key="NSSuperview" ref="412280178"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="431597734">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">disabled</string>
<reference key="NSSupport" ref="28800349"/>
<reference key="NSControlView" ref="361072273"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<object class="NSTextField" id="920139093">
<reference key="NSNextResponder" ref="412280178"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{37, 99}, {118, 22}}</string>
<reference key="NSSuperview" ref="412280178"/>
<int key="NSTag">1</int>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="224672534">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="28800349"/>
<reference key="NSControlView" ref="920139093"/>
<bool key="NSDrawsBackground">YES</bool>
<object class="NSColor" key="NSBackgroundColor" id="339930237">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textBackgroundColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="702864141">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textColor</string>
<object class="NSColor" key="NSColor" id="369941818">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
</object>
<object class="NSTextField" id="138511613">
<reference key="NSNextResponder" ref="412280178"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{37, 53}, {118, 22}}</string>
<reference key="NSSuperview" ref="412280178"/>
<int key="NSTag">2</int>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="515815898">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="28800349"/>
<reference key="NSControlView" ref="138511613"/>
<bool key="NSDrawsBackground">YES</bool>
<reference key="NSBackgroundColor" ref="339930237"/>
<reference key="NSTextColor" ref="702864141"/>
</object>
</object>
<object class="NSTextField" id="957450672">
<reference key="NSNextResponder" ref="412280178"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{179, 194}, {166, 17}}</string>
<reference key="NSSuperview" ref="412280178"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="536930828">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">This button's title was set</string>
<reference key="NSSupport" ref="28800349"/>
<reference key="NSControlView" ref="957450672"/>
<object class="NSColor" key="NSBackgroundColor" id="893262643">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="1038132650">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<reference key="NSColor" ref="369941818"/>
</object>
</object>
</object>
<object class="NSTextField" id="529909268">
<reference key="NSNextResponder" ref="412280178"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{34, 249}, {389, 45}}</string>
<reference key="NSSuperview" ref="412280178"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1030502695">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">272629760</int>
<string key="NSContents">See the User Defined Runtime Attributes for each view below and for the AppController to see the effect.</string>
<reference key="NSSupport" ref="28800349"/>
<reference key="NSControlView" ref="529909268"/>
<reference key="NSBackgroundColor" ref="893262643"/>
<reference key="NSTextColor" ref="1038132650"/>
</object>
</object>
<object class="NSTextField" id="1027602674">
<reference key="NSNextResponder" ref="412280178"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{179, 156}, {166, 17}}</string>
<reference key="NSSuperview" ref="412280178"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="861810273">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">This button was disabled</string>
<reference key="NSSupport" ref="28800349"/>
<reference key="NSControlView" ref="1027602674"/>
<reference key="NSBackgroundColor" ref="893262643"/>
<reference key="NSTextColor" ref="1038132650"/>
</object>
</object>
<object class="NSTextField" id="440736310">
<reference key="NSNextResponder" ref="412280178"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{179, 101}, {255, 17}}</string>
<reference key="NSSuperview" ref="412280178"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="464063783">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">This ordinarily would be first responder</string>
<reference key="NSSupport" ref="28800349"/>
<reference key="NSControlView" ref="440736310"/>
<reference key="NSBackgroundColor" ref="893262643"/>
<reference key="NSTextColor" ref="1038132650"/>
</object>
</object>
<object class="NSTextField" id="646490210">
<reference key="NSNextResponder" ref="412280178"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{179, 22}, {352, 51}}</string>
<reference key="NSSuperview" ref="412280178"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="393618729">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">272629760</int>
<string type="base64-UTF8" key="NSContents">VGhpcyB3YXMgc2V0IHRvIGJlIGZpcnN0IHJlc3BvbmRlciBieSB0aGUKQXBwQ29udHJvbGxlciAtc2V0
SW5pdGlhbEZpcnN0UmVzcG9uZGVyIG1ldGhvZA</string>
<reference key="NSSupport" ref="28800349"/>
<reference key="NSControlView" ref="646490210"/>
<reference key="NSBackgroundColor" ref="893262643"/>
<reference key="NSTextColor" ref="1038132650"/>
</object>
</object>
</array>
<string key="NSFrameSize">{548, 314}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="673890665"/>
</object>
<int key="connectionID">10</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">theWindow</string>
<reference key="source" ref="673890665"/>
<reference key="destination" ref="917316023"/>
</object>
<int key="connectionID">25</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1001"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1003"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1004"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="673890665"/>
<reference key="parent" ref="0"/>
<string key="objectName">App Controller</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="917316023"/>
<array class="NSMutableArray" key="children">
<reference ref="412280178"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">24</int>
<reference key="object" ref="412280178"/>
<array class="NSMutableArray" key="children">
<reference ref="332976459"/>
<reference ref="361072273"/>
<reference ref="920139093"/>
<reference ref="138511613"/>
<reference ref="1027602674"/>
<reference ref="440736310"/>
<reference ref="646490210"/>
<reference ref="957450672"/>
<reference ref="529909268"/>
</array>
<reference key="parent" ref="917316023"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="332976459"/>
<array class="NSMutableArray" key="children">
<reference ref="941203667"/>
</array>
<reference key="parent" ref="412280178"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="941203667"/>
<reference key="parent" ref="332976459"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">32</int>
<reference key="object" ref="920139093"/>
<array class="NSMutableArray" key="children">
<reference ref="224672534"/>
</array>
<reference key="parent" ref="412280178"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">33</int>
<reference key="object" ref="224672534"/>
<reference key="parent" ref="920139093"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">34</int>
<reference key="object" ref="138511613"/>
<array class="NSMutableArray" key="children">
<reference ref="515815898"/>
</array>
<reference key="parent" ref="412280178"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">35</int>
<reference key="object" ref="515815898"/>
<reference key="parent" ref="138511613"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">36</int>
<reference key="object" ref="361072273"/>
<array class="NSMutableArray" key="children">
<reference ref="431597734"/>
</array>
<reference key="parent" ref="412280178"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">37</int>
<reference key="object" ref="431597734"/>
<reference key="parent" ref="361072273"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">39</int>
<reference key="object" ref="957450672"/>
<array class="NSMutableArray" key="children">
<reference ref="536930828"/>
</array>
<reference key="parent" ref="412280178"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">40</int>
<reference key="object" ref="536930828"/>
<reference key="parent" ref="957450672"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">41</int>
<reference key="object" ref="1027602674"/>
<array class="NSMutableArray" key="children">
<reference ref="861810273"/>
</array>
<reference key="parent" ref="412280178"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">42</int>
<reference key="object" ref="861810273"/>
<reference key="parent" ref="1027602674"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">43</int>
<reference key="object" ref="440736310"/>
<array class="NSMutableArray" key="children">
<reference ref="464063783"/>
</array>
<reference key="parent" ref="412280178"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">44</int>
<reference key="object" ref="464063783"/>
<reference key="parent" ref="440736310"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">45</int>
<reference key="object" ref="646490210"/>
<array class="NSMutableArray" key="children">
<reference ref="393618729"/>
</array>
<reference key="parent" ref="412280178"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">46</int>
<reference key="object" ref="393618729"/>
<reference key="parent" ref="646490210"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">47</int>
<reference key="object" ref="529909268"/>
<array class="NSMutableArray" key="children">
<reference ref="1030502695"/>
</array>
<reference key="parent" ref="412280178"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">48</int>
<reference key="object" ref="1030502695"/>
<reference key="parent" ref="529909268"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="23.IBEditorWindowLastContentRect">{{719, 660}, {548, 314}}</string>
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="23.IBWindowTemplateEditedContentRect">{{719, 660}, {548, 314}}</string>
<boolean value="YES" key="23.NSWindowTemplate.visibleAtLaunch"/>
<string key="24.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSMutableDictionary" key="26.IBAttributePlaceholdersKey">
<string key="NS.key.0">IBUserDefinedRuntimeAttributesPlaceholderName</string>
<object class="IBUserDefinedRuntimeAttributesPlaceholder" key="NS.object.0">
<string key="name">IBUserDefinedRuntimeAttributesPlaceholderName</string>
<reference key="object" ref="332976459"/>
<array key="userDefinedRuntimeAttributes">
<object class="IBUserDefinedRuntimeAttribute">
<string key="typeIdentifier">com.apple.InterfaceBuilder.userDefinedRuntimeAttributeType.boolean</string>
<string key="keyPath">hidden</string>
<boolean value="NO" key="value"/>
</object>
<object class="IBUserDefinedRuntimeAttribute">
<string key="typeIdentifier">com.apple.InterfaceBuilder.userDefinedRuntimeAttributeType.string</string>
<string key="keyPath">title</string>
<string key="value">Hello!</string>
</object>
</array>
</object>
</object>
<string key="26.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform" key="26.IBViewBoundsToFrameTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCDAAAw3IAAA</bytes>
</object>
<string key="27.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="32.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform" key="32.IBViewBoundsToFrameTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCFAAAwsgAAA</bytes>
</object>
<string key="33.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="34.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform" key="34.IBViewBoundsToFrameTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCDAAAwtIAAA</bytes>
</object>
<string key="35.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSMutableDictionary" key="36.IBAttributePlaceholdersKey">
<string key="NS.key.0">IBUserDefinedRuntimeAttributesPlaceholderName</string>
<object class="IBUserDefinedRuntimeAttributesPlaceholder" key="NS.object.0">
<string key="name">IBUserDefinedRuntimeAttributesPlaceholderName</string>
<reference key="object" ref="361072273"/>
<array key="userDefinedRuntimeAttributes">
<object class="IBUserDefinedRuntimeAttribute">
<string key="typeIdentifier">com.apple.InterfaceBuilder.userDefinedRuntimeAttributeType.boolean</string>
<string key="keyPath">enabled</string>
<boolean value="NO" key="value"/>
</object>
</array>
</object>
</object>
<string key="36.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform" key="36.IBViewBoundsToFrameTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCDAAAw0sAAA</bytes>
</object>
<string key="37.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="39.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform" key="39.IBViewBoundsToFrameTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDMwAAwzwAAA</bytes>
</object>
<string key="40.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="41.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform" key="41.IBViewBoundsToFrameTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDMQAAw0oAAA</bytes>
</object>
<string key="42.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="43.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform" key="43.IBViewBoundsToFrameTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDMQAAwxQAAA</bytes>
</object>
<string key="44.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="45.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform" key="45.IBViewBoundsToFrameTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDMQAAws4AAA</bytes>
</object>
<string key="46.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="47.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform" key="47.IBViewBoundsToFrameTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCCAAAw5MAAA</bytes>
</object>
<string key="48.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSMutableDictionary" key="9.IBAttributePlaceholdersKey">
<string key="NS.key.0">IBUserDefinedRuntimeAttributesPlaceholderName</string>
<object class="IBUserDefinedRuntimeAttributesPlaceholder" key="NS.object.0">
<string key="name">IBUserDefinedRuntimeAttributesPlaceholderName</string>
<reference key="object" ref="673890665"/>
<array key="userDefinedRuntimeAttributes">
<object class="IBUserDefinedRuntimeAttribute">
<string key="typeIdentifier">com.apple.InterfaceBuilder.userDefinedRuntimeAttributeType.number</string>
<string key="keyPath">initialResponder</string>
<real value="2" key="value"/>
</object>
<object class="IBUserDefinedRuntimeAttribute">
<string key="typeIdentifier">com.apple.InterfaceBuilder.userDefinedRuntimeAttributeType.string</string>
<string key="keyPath">localized</string>
<string key="value">foo</string>
<bool key="localized">YES</bool>
</object>
<object class="IBUserDefinedRuntimeAttribute">
<string key="typeIdentifier">com.apple.InterfaceBuilder.userDefinedRuntimeAttributeType.nil</string>
<string key="keyPath">null</string>
<nil key="value"/>
</object>
</array>
</object>
</object>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">48</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">theWindow</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">theWindow</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">theWindow</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">delegate</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">delegate</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">delegate</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="3200" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,103 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index-debug.html
test
Created by aparajita on March 26, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>RuntimeAttributesTest</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading test...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
@@ -0,0 +1,77 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index.html
test
Created by aparajita on March 26, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>RuntimeAttributesTest</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading test...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
/*
* AppController.j
* test
*
* Created by aparajita on March 26, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
@@ -0,0 +1,145 @@
/*
* AppController.j
* performKeyEquivalentTest
*
* Created by aparajita on May 22, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
@import <Foundation/CPObject.j>
@import <AppKit/CPEvent.j>
var usesNewCode = YES;
@implementation AppController : CPObject
{
CPWindow theWindow;
CPWindow theOtherWindow;
CPCheckBox useNewCode;
CPTextField textField;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
[theOtherWindow orderFront:nil];
[theWindow setInitialFirstResponder:textField];
[theWindow makeKeyAndOrderFront:nil];
}
- (void)setUsesNewCode:(id)sender
{
usesNewCode = [sender state] === CPOnState;
}
@end
@implementation MyTextField : CPTextField
- (void)keyDown:(CPEvent)anEvent
{
CPLog("keyDown:%s", [self description]);
if (!usesNewCode)
{
if ([anEvent _couldBeKeyEquivalent] && [self performKeyEquivalent:anEvent])
return;
}
// CPTextField uses an HTML input element to take the input so we need to
// propagate the dom event so the element is updated. This has to be done
// before interpretKeyEvents: though so individual commands have a chance
// to override this (escape to clear the text in a search field for example).
[[[self window] platformWindow] _propagateCurrentDOMEvent:YES];
[self interpretKeyEvents:[anEvent]];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
- (BOOL)performKeyEquivalent:(CPEvent)anEvent
{
CPLog("performKeyEquivalent:%s", [self description]);
return [super performKeyEquivalent:anEvent];
}
@end
@implementation CPEvent (test)
- (BOOL)_couldBeKeyEquivalent
{
if (_type !== CPKeyDown)
return NO;
var characterCount = _characters.length;
if (!characterCount)
return NO;
if (_modifierFlags & (CPCommandKeyMask | CPControlKeyMask))
return YES;
// Cocoa does not consider space, backspace, or escape a key equivalent
// if the first responder is a text field (presumably a subclass of NSText).
var firstResponderIsText = [[_window firstResponder] isKindOfClass:[CPTextField class]];
for (var i = 0; i < characterCount; i++)
{
if (usesNewCode)
{
var c = _characters.charAt(i);
if ((c >= CPUpArrowFunctionKey && c <= CPModeSwitchFunctionKey) ||
c === CPEnterCharacter ||
c === CPNewlineCharacter ||
c === CPCarriageReturnCharacter ||
(!firstResponderIsText &&
(c === CPSpaceFunctionKey ||
c === CPDeleteCharacter ||
c === CPBackspaceCharacter ||
c === CPEscapeFunctionKey)))
{
return YES;
}
}
else
{
switch (_characters.charAt(i))
{
case CPBackspaceCharacter:
case CPDeleteCharacter:
case CPDeleteFunctionKey:
case CPTabCharacter:
case CPCarriageReturnCharacter:
case CPNewlineCharacter:
case CPSpaceFunctionKey:
case CPEscapeFunctionKey:
case CPPageUpFunctionKey:
case CPPageDownFunctionKey:
case CPLeftArrowFunctionKey:
case CPUpArrowFunctionKey:
case CPRightArrowFunctionKey:
case CPDownArrowFunctionKey:
case CPEndFunctionKey:
case CPHomeFunctionKey:
return YES;
}
}
}
// FIXME: More cases?
return NO;
}
@end
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Main cib file base name</key>
<string>MainMenu.cib</string>
<key>CPBundleName</key>
<string>performKeyEquivalentTest</string>
</dict>
</plist>
@@ -0,0 +1,94 @@
/*
* Jakefile
* performKeyEquivalentTest
*
* Created by aparajita on May 22, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("performKeyEquivalentTest", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "performKeyEquivalentTest.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("performKeyEquivalentTest");
task.setIdentifier("com.aparajita.performKeyEquivalentTest");
task.setVersion("1.0");
task.setAuthor("Victory-Heart Productions");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("performKeyEquivalentTest");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
task.setNib2CibFlags("-R Resources/");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["performKeyEquivalentTest"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "performKeyEquivalentTest", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "performKeyEquivalentTest", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "performKeyEquivalentTest"));
OS.system(["press", "-f", FILE.join("Build", "Release", "performKeyEquivalentTest"), FILE.join("Build", "Deployment", "performKeyEquivalentTest")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "performKeyEquivalentTest"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "performKeyEquivalentTest"), FILE.join("Build", "Desktop", "performKeyEquivalentTest", "performKeyEquivalentTest.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "performKeyEquivalentTest", "performKeyEquivalentTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "performKeyEquivalentTest"));
print("----------------------------");
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,862 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10J869</string>
<string key="IBDocument.InterfaceBuilderVersion">804</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">804</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="371"/>
<integer value="475"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="1021">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomObject" id="1014">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1050">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="972006081">
<int key="NSWindowStyleMask">7</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{100, 1000}, {480, 360}}</string>
<int key="NSWTFlags">1946157056</int>
<string key="NSWindowTitle">Text + Buttons</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<object class="NSView" key="NSWindowView" id="439893737">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTextField" id="160623561">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{189, 290}, {96, 22}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="46991665">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<object class="NSFont" key="NSSupport" id="455972270">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="160623561"/>
<bool key="NSDrawsBackground">YES</bool>
<object class="NSColor" key="NSBackgroundColor" id="465635440">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textBackgroundColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="403720344">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
</object>
<object class="NSTextField" id="215024340">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{189, 237}, {96, 22}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="894772288">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="455972270"/>
<reference key="NSControlView" ref="215024340"/>
<bool key="NSDrawsBackground">YES</bool>
<reference key="NSBackgroundColor" ref="465635440"/>
<reference key="NSTextColor" ref="403720344"/>
</object>
</object>
<object class="NSButton" id="962787846">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{187, 178}, {109, 18}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="679700256">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Use new code</string>
<reference key="NSSupport" ref="455972270"/>
<reference key="NSControlView" ref="962787846"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">2</int>
<object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSSwitch</string>
</object>
<object class="NSButtonImageSource" key="NSAlternateImage">
<string key="NSImageName">NSSwitch</string>
</object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
</object>
<object class="NSButton" id="995743194">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{106, 99}, {118, 25}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="599889457">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Escape</string>
<reference key="NSSupport" ref="455972270"/>
<reference key="NSControlView" ref="995743194"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<object class="NSButton" id="610457973">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{258, 99}, {118, 25}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="432442054">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Backspace</string>
<reference key="NSSupport" ref="455972270"/>
<reference key="NSControlView" ref="610457973"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"></string>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<object class="NSButton" id="905278565">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{106, 58}, {118, 25}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="527208717">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Space</string>
<reference key="NSSupport" ref="455972270"/>
<reference key="NSControlView" ref="905278565"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string type="base64-UTF8" key="NSKeyEquivalent">IA</string>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<object class="NSButton" id="106930791">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{258, 58}, {118, 25}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="165714669">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Down arrow</string>
<reference key="NSSupport" ref="455972270"/>
<reference key="NSControlView" ref="106930791"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"></string>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
</object>
<string key="NSFrameSize">{480, 360}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSCustomObject" id="635946545">
<string key="NSClassName">AppController</string>
</object>
<object class="NSWindowTemplate" id="264185350">
<int key="NSWindowStyleMask">7</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{700, 1000}, {480, 360}}</string>
<int key="NSWTFlags">1946157056</int>
<string key="NSWindowTitle">Buttons</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<object class="NSView" key="NSWindowView" id="841164116">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSButton" id="1039086975">
<reference key="NSNextResponder" ref="841164116"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{106, 99}, {118, 25}}</string>
<reference key="NSSuperview" ref="841164116"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="536067330">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Escape</string>
<reference key="NSSupport" ref="455972270"/>
<reference key="NSControlView" ref="1039086975"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<object class="NSButton" id="949576017">
<reference key="NSNextResponder" ref="841164116"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{258, 99}, {118, 25}}</string>
<reference key="NSSuperview" ref="841164116"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="1006898495">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Backspace</string>
<reference key="NSSupport" ref="455972270"/>
<reference key="NSControlView" ref="949576017"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"></string>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<object class="NSButton" id="928640245">
<reference key="NSNextResponder" ref="841164116"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{106, 58}, {118, 25}}</string>
<reference key="NSSuperview" ref="841164116"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="246606737">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Space</string>
<reference key="NSSupport" ref="455972270"/>
<reference key="NSControlView" ref="928640245"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string type="base64-UTF8" key="NSKeyEquivalent">IA</string>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<object class="NSButton" id="37863177">
<reference key="NSNextResponder" ref="841164116"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{258, 58}, {118, 25}}</string>
<reference key="NSSuperview" ref="841164116"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="160250892">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Down arrow</string>
<reference key="NSSupport" ref="455972270"/>
<reference key="NSControlView" ref="37863177"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"></string>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
</object>
<string key="NSFrameSize">{480, 360}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1021"/>
<reference key="destination" ref="635946545"/>
</object>
<int key="connectionID">451</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">theWindow</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="972006081"/>
</object>
<int key="connectionID">459</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">useNewCode</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="962787846"/>
</object>
<int key="connectionID">465</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">setUsesNewCode:</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="962787846"/>
</object>
<int key="connectionID">466</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">theOtherWindow</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="264185350"/>
</object>
<int key="connectionID">492</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">textField</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="160623561"/>
</object>
<int key="connectionID">493</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1048"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1021"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1014"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1050"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">371</int>
<reference key="object" ref="972006081"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="439893737"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">372</int>
<reference key="object" ref="439893737"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="160623561"/>
<reference ref="215024340"/>
<reference ref="962787846"/>
<reference ref="995743194"/>
<reference ref="610457973"/>
<reference ref="905278565"/>
<reference ref="106930791"/>
</object>
<reference key="parent" ref="972006081"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">450</int>
<reference key="object" ref="635946545"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">456</int>
<reference key="object" ref="160623561"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="46991665"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">457</int>
<reference key="object" ref="46991665"/>
<reference key="parent" ref="160623561"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">460</int>
<reference key="object" ref="215024340"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="894772288"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">461</int>
<reference key="object" ref="894772288"/>
<reference key="parent" ref="215024340"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">462</int>
<reference key="object" ref="962787846"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="679700256"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">463</int>
<reference key="object" ref="679700256"/>
<reference key="parent" ref="962787846"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">467</int>
<reference key="object" ref="995743194"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="599889457"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">468</int>
<reference key="object" ref="599889457"/>
<reference key="parent" ref="995743194"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">469</int>
<reference key="object" ref="610457973"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="432442054"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">470</int>
<reference key="object" ref="432442054"/>
<reference key="parent" ref="610457973"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">471</int>
<reference key="object" ref="905278565"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="527208717"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">472</int>
<reference key="object" ref="106930791"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="165714669"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">473</int>
<reference key="object" ref="165714669"/>
<reference key="parent" ref="106930791"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">474</int>
<reference key="object" ref="527208717"/>
<reference key="parent" ref="905278565"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">475</int>
<reference key="object" ref="264185350"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="841164116"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">476</int>
<reference key="object" ref="841164116"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="37863177"/>
<reference ref="928640245"/>
<reference ref="949576017"/>
<reference ref="1039086975"/>
</object>
<reference key="parent" ref="264185350"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">477</int>
<reference key="object" ref="37863177"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="160250892"/>
</object>
<reference key="parent" ref="841164116"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">478</int>
<reference key="object" ref="928640245"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="246606737"/>
</object>
<reference key="parent" ref="841164116"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">479</int>
<reference key="object" ref="949576017"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="1006898495"/>
</object>
<reference key="parent" ref="841164116"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">480</int>
<reference key="object" ref="1039086975"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="536067330"/>
</object>
<reference key="parent" ref="841164116"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">487</int>
<reference key="object" ref="536067330"/>
<reference key="parent" ref="1039086975"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">488</int>
<reference key="object" ref="1006898495"/>
<reference key="parent" ref="949576017"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">489</int>
<reference key="object" ref="246606737"/>
<reference key="parent" ref="928640245"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">490</int>
<reference key="object" ref="160250892"/>
<reference key="parent" ref="37863177"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-3.IBPluginDependency</string>
<string>371.IBEditorWindowLastContentRect</string>
<string>371.IBPluginDependency</string>
<string>371.IBWindowTemplateEditedContentRect</string>
<string>371.NSWindowTemplate.visibleAtLaunch</string>
<string>371.editorWindowContentRectSynchronizationRect</string>
<string>372.IBPluginDependency</string>
<string>456.CustomClassName</string>
<string>456.IBPluginDependency</string>
<string>456.IBViewBoundsToFrameTransform</string>
<string>457.IBPluginDependency</string>
<string>460.CustomClassName</string>
<string>460.IBPluginDependency</string>
<string>460.IBViewBoundsToFrameTransform</string>
<string>461.IBPluginDependency</string>
<string>462.IBPluginDependency</string>
<string>462.IBViewBoundsToFrameTransform</string>
<string>463.IBPluginDependency</string>
<string>467.IBPluginDependency</string>
<string>467.IBViewBoundsToFrameTransform</string>
<string>468.IBPluginDependency</string>
<string>469.IBPluginDependency</string>
<string>469.IBViewBoundsToFrameTransform</string>
<string>470.IBPluginDependency</string>
<string>471.IBPluginDependency</string>
<string>471.IBViewBoundsToFrameTransform</string>
<string>472.IBPluginDependency</string>
<string>472.IBViewBoundsToFrameTransform</string>
<string>473.IBPluginDependency</string>
<string>474.IBPluginDependency</string>
<string>475.IBEditorWindowLastContentRect</string>
<string>475.IBPluginDependency</string>
<string>475.IBWindowTemplateEditedContentRect</string>
<string>475.NSWindowTemplate.visibleAtLaunch</string>
<string>475.editorWindowContentRectSynchronizationRect</string>
<string>476.IBPluginDependency</string>
<string>477.IBPluginDependency</string>
<string>477.IBViewBoundsToFrameTransform</string>
<string>478.IBPluginDependency</string>
<string>478.IBViewBoundsToFrameTransform</string>
<string>479.IBPluginDependency</string>
<string>479.IBViewBoundsToFrameTransform</string>
<string>480.IBPluginDependency</string>
<string>480.IBViewBoundsToFrameTransform</string>
<string>487.IBPluginDependency</string>
<string>488.IBPluginDependency</string>
<string>489.IBPluginDependency</string>
<string>490.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{438, 784}, {480, 360}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{438, 784}, {480, 360}}</string>
<boolean value="NO"/>
<string>{{33, 99}, {480, 360}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>MyTextField</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDQAAAw4IAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>MyTextField</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDQAAAw08AAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDPgAAwxAAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABC1AAAwvQAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDgQAAwvQAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABC1AAAwvQAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDgQAAwvQAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{940, 784}, {480, 360}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{940, 784}, {480, 360}}</string>
<boolean value="NO"/>
<string>{{33, 99}, {480, 360}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDgQAAwvQAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABC1AAAwvQAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDgQAAwvQAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABC1AAAwvQAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">493</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">theWindow</string>
<string key="NS.object.0">NSWindow</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">theWindow</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">theWindow</string>
<string key="candidateClassName">NSWindow</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/AppController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">setUsesNewCode:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">setUsesNewCode:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">setUsesNewCode:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>textField</string>
<string>theOtherWindow</string>
<string>useNewCode</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>NSWindow</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>textField</string>
<string>theOtherWindow</string>
<string>useNewCode</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">textField</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">theOtherWindow</string>
<string key="candidateClassName">NSWindow</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">useNewCode</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">MyTextField</string>
<string key="superclassName">NSTextField</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">NSSwitch</string>
<string key="NS.object.0">{15, 15}</string>
</object>
</data>
</archive>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,103 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index-debug.html
performKeyEquivalentTest
Created by aparajita on May 22, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>performKeyEquivalentTest</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading performKeyEquivalentTest...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
@@ -0,0 +1,77 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index.html
performKeyEquivalentTest
Created by aparajita on May 22, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>performKeyEquivalentTest</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading performKeyEquivalentTest...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
@@ -0,0 +1,23 @@
/*
* AppController.j
* performKeyEquivalentTest
*
* Created by aparajita on May 22, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
var formatter = function(aString, aTitle, aLevel)
{
return aString;
};
function main(args, namedArgs)
{
CPLogRegister(CPLogConsole, nil, formatter);
CPApplicationMain(args, namedArgs);
}
@@ -0,0 +1,150 @@
/*
* AppController.j
* predicateWithFormat
*
* Created by aparajita on May 25, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
@import <Foundation/CPObject.j>
var usesNewCode = NO;
@implementation AppController : CPObject
{
CPWindow theWindow;
CPPopUpButton dataMenu;
CPPopUpButton comparisonMenu;
CPPopUpButton nameMenu;
CPTextField resultsField;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
useNewCode = usesNewCode;
}
- (void)awakeFromCib
{
}
- (BOOL)useNewCode
{
return usesNewCode;
}
- (void)setUseNewCode:(BOOL)flag
{
usesNewCode = flag;
}
- (void)search:(id)sender
{
var results = @"";
try
{
var format = [CPString stringWithFormat:@"SELF %@ %%@", [comparisonMenu titleOfSelectedItem]],
predicate = [CPPredicate predicateWithFormat:format, [nameMenu titleOfSelectedItem]],
data = [[dataMenu titleOfSelectedItem]],
searchResults = [data filteredArrayUsingPredicate:predicate],
results = searchResults.join("\n");
[resultsField setTextColor:[CPColor blackColor]];
}
catch (ex)
{
results = [ex reason];
[resultsField setTextColor:[CPColor redColor]];
}
[resultsField setStringValue:@"Result: " + results];
}
@end
var CPComparisonPredicateModifier,
CPPredicateOperatorType;
@implementation CPComparisonPredicate (test)
- (BOOL)_evaluateValue:lhs rightValue:rhs
{
var leftIsNil = (lhs == nil || [lhs isEqual:[CPNull null]]),
rightIsNil = (rhs == nil || [rhs isEqual:[CPNull null]]);
if ((leftIsNil || rightIsNil) && _type != CPCustomSelectorPredicateOperatorType)
return (leftIsNil == rightIsNil &&
(_type == CPEqualToPredicateOperatorType ||
_type == CPLessThanOrEqualToPredicateOperatorType ||
_type == CPGreaterThanOrEqualToPredicateOperatorType));
var string_compare_options = 0;
// left and right should be casted first [CAST()] following 10.5 rules.
switch (_type)
{
case CPLessThanPredicateOperatorType: return ([lhs compare:rhs] == CPOrderedAscending);
case CPLessThanOrEqualToPredicateOperatorType: return ([lhs compare:rhs] != CPOrderedDescending);
case CPGreaterThanPredicateOperatorType: return ([lhs compare:rhs] == CPOrderedDescending);
case CPGreaterThanOrEqualToPredicateOperatorType: return ([lhs compare:rhs] != CPOrderedAscending);
case CPEqualToPredicateOperatorType: return [lhs isEqual:rhs];
case CPNotEqualToPredicateOperatorType: return (![lhs isEqual:rhs]);
case CPMatchesPredicateOperatorType: var commut = (_options & CPCaseInsensitivePredicateOption) ? "gi":"g";
if (_options & CPDiacriticInsensitivePredicateOption)
{
lhs = lhs.stripDiacritics();
rhs = rhs.stripDiacritics();
}
return (new RegExp(rhs,commut)).test(lhs);
case CPLikePredicateOperatorType: if (_options & CPDiacriticInsensitivePredicateOption)
{
lhs = lhs.stripDiacritics();
rhs = rhs.stripDiacritics();
}
var commut = (_options & CPCaseInsensitivePredicateOption) ? "gi":"g",
reg = new RegExp(rhs.escapeForRegExp(),commut);
return reg.test(lhs);
case CPBeginsWithPredicateOperatorType: var range = usesNewCode ? CPMakeRange(0, MIN([lhs length], [rhs length])) : CPMakeRange(0,[rhs length]);
if (_options & CPCaseInsensitivePredicateOption) string_compare_options |= CPCaseInsensitiveSearch;
if (_options & CPDiacriticInsensitivePredicateOption) string_compare_options |= CPDiacriticInsensitiveSearch;
return ([lhs compare:rhs options:string_compare_options range:range] == CPOrderedSame);
case CPEndsWithPredicateOperatorType: var range = usesNewCode ? CPMakeRange(MAX([lhs length] - [rhs length], 0), MIN([lhs length], [rhs length])) : CPMakeRange([lhs length] - [rhs length],[rhs length]);
if (_options & CPCaseInsensitivePredicateOption) string_compare_options |= CPCaseInsensitiveSearch;
if (_options & CPDiacriticInsensitivePredicateOption) string_compare_options |= CPDiacriticInsensitiveSearch;
return ([lhs compare:rhs options:string_compare_options range:range] == CPOrderedSame);
case CPCustomSelectorPredicateOperatorType: return [lhs performSelector:_customSelector withObject:rhs];
case CPInPredicateOperatorType: var a = lhs; // swap
lhs = rhs;
rhs = a;
case CPContainsPredicateOperatorType: if (![lhs isKindOfClass:[CPString class]])
{
if (![lhs respondsToSelector: @selector(objectEnumerator)])
[CPException raise:CPInvalidArgumentException reason:@"The left/right hand side for a CONTAINS/IN operator must be a collection or a string"];
return [lhs containsObject:rhs];
}
if (_options & CPCaseInsensitivePredicateOption)
string_compare_options |= CPCaseInsensitiveSearch;
if (_options & CPDiacriticInsensitivePredicateOption)
string_compare_options |= CPDiacriticInsensitiveSearch;
return ([lhs rangeOfString:rhs options:string_compare_options].location != CPNotFound);
case CPBetweenPredicateOperatorType: if ([rhs count] < 2)
[CPException raise:CPInvalidArgumentException reason:@"The right hand side for a BETWEEN operator must contain 2 objects"];
return ([lhs compare:rhs[0]] == CPOrderedDescending && [lhs compare:rhs[1]] == CPOrderedAscending);
default: return NO;
}
}
@end
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Main cib file base name</key>
<string>MainMenu.cib</string>
<key>CPBundleName</key>
<string>test</string>
</dict>
</plist>
+94
View File
@@ -0,0 +1,94 @@
/*
* Jakefile
* test
*
* Created by aparajita on May 25, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("test", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "test.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("test");
task.setIdentifier("com.aparajita.test");
task.setVersion("1.0");
task.setAuthor("Victory-Heart Productions");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("test");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
task.setNib2CibFlags("-R Resources/");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["test"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "test", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "test", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "test"));
OS.system(["press", "-f", FILE.join("Build", "Release", "test"), FILE.join("Build", "Deployment", "test")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "test"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "test"), FILE.join("Build", "Desktop", "test", "test.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "test", "test.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "test"));
print("----------------------------");
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,927 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10J869</string>
<string key="IBDocument.InterfaceBuilderVersion">804</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">804</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="372"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="1021">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomObject" id="1014">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1050">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="972006081">
<int key="NSWindowStyleMask">7</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{335, 571}, {571, 179}}</string>
<int key="NSWTFlags">1946157056</int>
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<object class="NSView" key="NSWindowView" id="439893737">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTextField" id="306506021">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{38, 34}, {321, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="786364694">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Result:</string>
<object class="NSFont" key="NSSupport" id="180276567">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="306506021"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
</object>
<object class="NSPopUpButton" id="831737273">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{302, 127}, {100, 26}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="502372116">
<int key="NSCellFlags">-2076049856</int>
<int key="NSCellFlags2">2048</int>
<reference key="NSSupport" ref="180276567"/>
<reference key="NSControlView" ref="831737273"/>
<int key="NSButtonFlags">109199615</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
<object class="NSMenuItem" key="NSMenuItem" id="396781444">
<reference key="NSMenu" ref="438705379"/>
<string key="NSTitle">To</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<int key="NSState">1</int>
<object class="NSCustomResource" key="NSOnImage" id="102193233">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSMenuCheckmark</string>
</object>
<object class="NSCustomResource" key="NSMixedImage" id="364966873">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSMenuMixedState</string>
</object>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="502372116"/>
</object>
<bool key="NSMenuItemRespectAlignment">YES</bool>
<object class="NSMenu" key="NSMenu" id="438705379">
<string key="NSTitle">OtherViews</string>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="396781444"/>
<object class="NSMenuItem" id="435766921">
<reference key="NSMenu" ref="438705379"/>
<string key="NSTitle">om</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="102193233"/>
<reference key="NSMixedImage" ref="364966873"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="502372116"/>
</object>
<object class="NSMenuItem" id="422515943">
<reference key="NSMenu" ref="438705379"/>
<string key="NSTitle">Tomb</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="102193233"/>
<reference key="NSMixedImage" ref="364966873"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="502372116"/>
</object>
<object class="NSMenuItem" id="1055002259">
<reference key="NSMenu" ref="438705379"/>
<string key="NSTitle">boy</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="102193233"/>
<reference key="NSMixedImage" ref="364966873"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="502372116"/>
</object>
</object>
<reference key="NSMenuFont" ref="180276567"/>
</object>
<int key="NSPreferredEdge">1</int>
<bool key="NSUsesItemFromMenu">YES</bool>
<bool key="NSAltersState">YES</bool>
<int key="NSArrowPosition">2</int>
</object>
</object>
<object class="NSPopUpButton" id="226492283">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{153, 127}, {129, 26}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="485690623">
<int key="NSCellFlags">-2076049856</int>
<int key="NSCellFlags2">2048</int>
<reference key="NSSupport" ref="180276567"/>
<reference key="NSControlView" ref="226492283"/>
<int key="NSButtonFlags">109199615</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
<object class="NSMenuItem" key="NSMenuItem" id="241755795">
<reference key="NSMenu" ref="671309887"/>
<string key="NSTitle">beginsWith</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<int key="NSState">1</int>
<reference key="NSOnImage" ref="102193233"/>
<reference key="NSMixedImage" ref="364966873"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="485690623"/>
</object>
<bool key="NSMenuItemRespectAlignment">YES</bool>
<object class="NSMenu" key="NSMenu" id="671309887">
<string key="NSTitle">OtherViews</string>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="241755795"/>
<object class="NSMenuItem" id="573953194">
<reference key="NSMenu" ref="671309887"/>
<string key="NSTitle">endsWith</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="102193233"/>
<reference key="NSMixedImage" ref="364966873"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="485690623"/>
</object>
</object>
<reference key="NSMenuFont" ref="180276567"/>
</object>
<int key="NSPreferredEdge">1</int>
<bool key="NSUsesItemFromMenu">YES</bool>
<bool key="NSAltersState">YES</bool>
<int key="NSArrowPosition">2</int>
</object>
</object>
<object class="NSButton" id="986079495">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{424, 128}, {77, 25}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="820767418">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Search</string>
<reference key="NSSupport" ref="180276567"/>
<reference key="NSControlView" ref="986079495"/>
<int key="NSButtonFlags">-2038152961</int>
<int key="NSButtonFlags2">163</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
<object class="NSPopUpButton" id="148001902">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{32, 127}, {100, 26}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="884253365">
<int key="NSCellFlags">-2076049856</int>
<int key="NSCellFlags2">2048</int>
<reference key="NSSupport" ref="180276567"/>
<reference key="NSControlView" ref="148001902"/>
<int key="NSButtonFlags">109199615</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
<object class="NSMenuItem" key="NSMenuItem" id="17817692">
<reference key="NSMenu" ref="15076045"/>
<string key="NSTitle">To</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<int key="NSState">1</int>
<reference key="NSOnImage" ref="102193233"/>
<reference key="NSMixedImage" ref="364966873"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="884253365"/>
</object>
<bool key="NSMenuItemRespectAlignment">YES</bool>
<object class="NSMenu" key="NSMenu" id="15076045">
<string key="NSTitle">OtherViews</string>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="17817692"/>
<object class="NSMenuItem" id="232326310">
<reference key="NSMenu" ref="15076045"/>
<string key="NSTitle">Tom</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="102193233"/>
<reference key="NSMixedImage" ref="364966873"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="884253365"/>
</object>
<object class="NSMenuItem" id="874646600">
<reference key="NSMenu" ref="15076045"/>
<string key="NSTitle">Tomb</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="102193233"/>
<reference key="NSMixedImage" ref="364966873"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="884253365"/>
</object>
<object class="NSMenuItem" id="358035610">
<reference key="NSMenu" ref="15076045"/>
<string key="NSTitle">Tomboy</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="102193233"/>
<reference key="NSMixedImage" ref="364966873"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="884253365"/>
</object>
</object>
<reference key="NSMenuFont" ref="180276567"/>
</object>
<int key="NSPreferredEdge">1</int>
<bool key="NSUsesItemFromMenu">YES</bool>
<bool key="NSAltersState">YES</bool>
<int key="NSArrowPosition">2</int>
</object>
</object>
<object class="NSButton" id="979095863">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{39, 87}, {109, 18}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="847409339">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Use new code</string>
<reference key="NSSupport" ref="180276567"/>
<reference key="NSControlView" ref="979095863"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">2</int>
<object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSSwitch</string>
</object>
<object class="NSButtonImageSource" key="NSAlternateImage">
<string key="NSImageName">NSSwitch</string>
</object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
</object>
</object>
<string key="NSFrameSize">{571, 179}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSCustomObject" id="635946545">
<string key="NSClassName">AppController</string>
</object>
<object class="NSObjectController" id="680044224">
<object class="NSMutableArray" key="NSDeclaredKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>useNewCode</string>
</object>
<bool key="NSEditable">YES</bool>
<object class="_NSManagedProxy" key="_NSManagedProxy"/>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1021"/>
<reference key="destination" ref="635946545"/>
</object>
<int key="connectionID">451</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">resultsField</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="306506021"/>
</object>
<int key="connectionID">474</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nameMenu</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="831737273"/>
</object>
<int key="connectionID">475</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">search:</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="986079495"/>
</object>
<int key="connectionID">476</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">theWindow</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="972006081"/>
</object>
<int key="connectionID">477</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">comparisonMenu</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="226492283"/>
</object>
<int key="connectionID">484</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">dataMenu</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="148001902"/>
</object>
<int key="connectionID">498</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">content</string>
<reference key="source" ref="680044224"/>
<reference key="destination" ref="635946545"/>
</object>
<int key="connectionID">503</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: selection.useNewCode</string>
<reference key="source" ref="979095863"/>
<reference key="destination" ref="680044224"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="979095863"/>
<reference key="NSDestination" ref="680044224"/>
<string key="NSLabel">value: selection.useNewCode</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">selection.useNewCode</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">505</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1048"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1021"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1014"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1050"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">371</int>
<reference key="object" ref="972006081"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="439893737"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">372</int>
<reference key="object" ref="439893737"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="986079495"/>
<reference ref="226492283"/>
<reference ref="831737273"/>
<reference ref="148001902"/>
<reference ref="979095863"/>
<reference ref="306506021"/>
</object>
<reference key="parent" ref="972006081"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">450</int>
<reference key="object" ref="635946545"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">464</int>
<reference key="object" ref="831737273"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="502372116"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">465</int>
<reference key="object" ref="502372116"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="438705379"/>
</object>
<reference key="parent" ref="831737273"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">466</int>
<reference key="object" ref="438705379"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="396781444"/>
<reference ref="435766921"/>
<reference ref="422515943"/>
<reference ref="1055002259"/>
</object>
<reference key="parent" ref="502372116"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">467</int>
<reference key="object" ref="396781444"/>
<reference key="parent" ref="438705379"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">468</int>
<reference key="object" ref="435766921"/>
<reference key="parent" ref="438705379"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">469</int>
<reference key="object" ref="422515943"/>
<reference key="parent" ref="438705379"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">470</int>
<reference key="object" ref="986079495"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="820767418"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">471</int>
<reference key="object" ref="820767418"/>
<reference key="parent" ref="986079495"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">472</int>
<reference key="object" ref="306506021"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="786364694"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">473</int>
<reference key="object" ref="786364694"/>
<reference key="parent" ref="306506021"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">478</int>
<reference key="object" ref="226492283"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="485690623"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">479</int>
<reference key="object" ref="485690623"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="671309887"/>
</object>
<reference key="parent" ref="226492283"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">480</int>
<reference key="object" ref="671309887"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="573953194"/>
<reference ref="241755795"/>
</object>
<reference key="parent" ref="485690623"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">482</int>
<reference key="object" ref="573953194"/>
<reference key="parent" ref="671309887"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">483</int>
<reference key="object" ref="241755795"/>
<reference key="parent" ref="671309887"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">485</int>
<reference key="object" ref="1055002259"/>
<reference key="parent" ref="438705379"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">491</int>
<reference key="object" ref="148001902"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="884253365"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">492</int>
<reference key="object" ref="884253365"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="15076045"/>
</object>
<reference key="parent" ref="148001902"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">493</int>
<reference key="object" ref="15076045"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="358035610"/>
<reference ref="874646600"/>
<reference ref="232326310"/>
<reference ref="17817692"/>
</object>
<reference key="parent" ref="884253365"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">494</int>
<reference key="object" ref="358035610"/>
<reference key="parent" ref="15076045"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">495</int>
<reference key="object" ref="874646600"/>
<reference key="parent" ref="15076045"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">496</int>
<reference key="object" ref="232326310"/>
<reference key="parent" ref="15076045"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">497</int>
<reference key="object" ref="17817692"/>
<reference key="parent" ref="15076045"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">499</int>
<reference key="object" ref="979095863"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="847409339"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">500</int>
<reference key="object" ref="847409339"/>
<reference key="parent" ref="979095863"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">502</int>
<reference key="object" ref="680044224"/>
<reference key="parent" ref="0"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-3.IBPluginDependency</string>
<string>371.IBEditorWindowLastContentRect</string>
<string>371.IBPluginDependency</string>
<string>371.IBWindowTemplateEditedContentRect</string>
<string>371.NSWindowTemplate.visibleAtLaunch</string>
<string>371.editorWindowContentRectSynchronizationRect</string>
<string>372.IBPluginDependency</string>
<string>464.IBPluginDependency</string>
<string>464.IBViewBoundsToFrameTransform</string>
<string>465.IBPluginDependency</string>
<string>466.IBEditorWindowLastContentRect</string>
<string>466.IBPluginDependency</string>
<string>467.IBPluginDependency</string>
<string>468.IBPluginDependency</string>
<string>469.IBPluginDependency</string>
<string>470.IBPluginDependency</string>
<string>471.IBPluginDependency</string>
<string>472.IBPluginDependency</string>
<string>472.IBViewBoundsToFrameTransform</string>
<string>473.IBPluginDependency</string>
<string>478.IBPluginDependency</string>
<string>478.IBViewBoundsToFrameTransform</string>
<string>479.IBPluginDependency</string>
<string>480.IBEditorWindowLastContentRect</string>
<string>480.IBPluginDependency</string>
<string>482.IBPluginDependency</string>
<string>483.IBPluginDependency</string>
<string>485.IBPluginDependency</string>
<string>491.IBPluginDependency</string>
<string>491.IBViewBoundsToFrameTransform</string>
<string>492.IBPluginDependency</string>
<string>493.IBEditorWindowLastContentRect</string>
<string>493.IBPluginDependency</string>
<string>494.IBPluginDependency</string>
<string>495.IBPluginDependency</string>
<string>496.IBPluginDependency</string>
<string>497.IBPluginDependency</string>
<string>499.IBPluginDependency</string>
<string>500.IBPluginDependency</string>
<string>502.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{441, 973}, {571, 179}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{441, 973}, {571, 179}}</string>
<integer value="1"/>
<string>{{33, 99}, {480, 360}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDlwAAwzQAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{732, 1043}, {122, 83}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCAAAAwiwAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDAgAAwzIAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{560, 1083}, {142, 43}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCLAAAwzEAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{462, 1043}, {122, 83}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">505</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">theWindow</string>
<string key="NS.object.0">NSWindow</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">theWindow</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">theWindow</string>
<string key="candidateClassName">NSWindow</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/AppController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">search:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">search:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">search:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>comparisonMenu</string>
<string>dataMenu</string>
<string>nameMenu</string>
<string>resultsField</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>comparisonMenu</string>
<string>dataMenu</string>
<string>nameMenu</string>
<string>resultsField</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">comparisonMenu</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">dataMenu</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">nameMenu</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">resultsField</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSMenuCheckmark</string>
<string>NSMenuMixedState</string>
<string>NSSwitch</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>{9, 8}</string>
<string>{7, 2}</string>
<string>{15, 15}</string>
</object>
</object>
</data>
</archive>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,103 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index-debug.html
test
Created by aparajita on May 25, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>test</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading test...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
@@ -0,0 +1,77 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index.html
test
Created by aparajita on May 25, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>test</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading test...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
/*
* AppController.j
* test
*
* Created by aparajita on May 25, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
+1 -1
View File
@@ -1280,7 +1280,7 @@ MAN_LINKS = NO
# generate an XML file that captures the structure of
# the code including all documentation.
GENERATE_XML = YES
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+7 -7
View File
@@ -265,7 +265,7 @@ div.contents hr {
}
td.indexkey {
font-family: Consolas, "Lucida Console";
font-family: Consolas, Menlo, "Lucida Console";
border-bottom: 1px solid #eee;
padding: .25em 0 .25em .5em;
}
@@ -275,7 +275,7 @@ table tr.indexkey:first-child td {
}
td.indexvalue {
font-family: Consolas, "Lucida Console";
font-family: Consolas, Menlo, "Lucida Console";
border-bottom: 1px solid #eee;
padding: .25em 0 .25em .5em;
}
@@ -285,7 +285,7 @@ table tr.memlist > td {
}
tr.memlist td {
font-family: Consolas, "Lucida Console";
font-family: Consolas, Menlo, "Lucida Console";
padding: .25em 0;
border-bottom: 1px solid #eee;
}
@@ -425,7 +425,7 @@ hr.footer {
/* @group Member Descriptions */
table.memberdecls {
font-family: Consolas, "Lucida Console";
font-family: Consolas, Menlo, "Lucida Console";
border-spacing: 0px;
padding: 0px;
margin: 0 !important;
@@ -485,7 +485,7 @@ table.memberdecls {
.memname {
white-space: nowrap;
font: bold 105% Consolas, "Lucida Console";
font: bold 105% Consolas, Menlo, "Lucida Console";
margin: .25em 0 .1em .25em;
}
@@ -495,7 +495,7 @@ table.memberdecls {
padding: 6px 15px;
color: #253554;
background-color: #f7f7f7;
font-family: Consolas, "Lucida Console";
font-family: Consolas, Menlo, "Lucida Console";
font-weight: bold;
}
@@ -526,7 +526,7 @@ table.memberdecls {
}
.memdoc dl dd td em {
font-family: Consolas, "Lucida Console";
font-family: Consolas, Menlo, "Lucida Console";
font-weight: bold;
white-space: nowrap;
}
@@ -3,28 +3,188 @@
* __project.name__
*
* Created by __user.name__ on __project.date__.
* Copyright __project.year__, __organization.name__ All rights reserved.
*
* Copyright __project.year__, __organization.name__. All rights reserved.
*
* 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
*/
var ENV = require("system").env,
//===========================================================
// DO NOT REMOVE
//===========================================================
var SYS = require("system"),
ENV = SYS.env,
FILE = require("file"),
task = require("jake").task,
FileList = require("jake").FileList,
OS = require("os");
//===========================================================
// USER CONFIGURABLE VARIABLES
//===========================================================
/*
The directory in which the project will be built. By default
it is built in a "Build" directory within the project directory.
To use your $CAPP_BUILD directory, change the declaration to:
var buildDir = ENV["CAPP_BUILD"];
*/
var buildDir = "Build";
//===========================================================
// AUTOMATICALLY GENERATED
//
// Do not edit! (unless you know what you are doing)
//===========================================================
var stream = require("narwhal/term").stream,
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
CLEAN = require("jake/clean").CLEAN,
CLOBBER = require("jake/clean").CLOBBER,
blend = require("cappuccino/jake").blend,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug";
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
productName = "__project.nameasidentifier__",
debugBlendKitPath = FILE.join("Frameworks", "Debug", "BlendKit"),
releaseBlendKitPath = FILE.join("Frameworks", "BlendKit"),
buildPath = FILE.canonical(FILE.join(buildDir, productName + ".build"));
blend ("__project.nameasidentifier__.blend", function(__project.nameasidentifier__Task)
blend (productName + ".blend", function(themeBlendTask)
{
__project.nameasidentifier__Task.setBuildIntermediatesPath(FILE.join("Build", "__project.nameasidentifier__.build", configuration))
__project.nameasidentifier__Task.setBuildPath(FILE.join("Build", configuration));
themeBlendTask.setBuildIntermediatesPath(FILE.join(buildPath, configuration))
themeBlendTask.setBuildPath(FILE.join(buildDir, configuration));
__project.nameasidentifier__Task.setThemeDescriptors(new FileList("ThemeDescriptors.j"));
__project.nameasidentifier__Task.setIdentifier("com.280n.__project.identifier__");
__project.nameasidentifier__Task.setResources(new FileList("Resources/*"));
themeBlendTask.setThemeDescriptors(new FileList("ThemeDescriptors.j"));
themeBlendTask.setIdentifier("__project.identifier__");
themeBlendTask.setResources(new FileList("Resources/*"));
});
task ("default", ["__project.nameasidentifier__.blend"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
task ("build", ["default"]);
symlinkBlendKit(debugBlendKitPath);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
symlinkBlendKit(releaseBlendKitPath);
});
task ("default", ["release"]);
task ("build", [productName + ".blend"]);
task ("all", ["debug", "release"]);
task ("test", ["debug"], function()
{
OS.system(["open", "index-debug.html"]);
});
task ("test-release", ["release"], function()
{
OS.system(["open", "index.html"]);
});
CLEAN.include(buildPath);
CLOBBER.include(FILE.join(buildDir, "Debug"))
.include(FILE.join(buildDir, "Release"));
task ("help", function()
{
var app = JAKE.application().name();
colorPrint("--------------------------------------------------------------------------", "bold+green");
colorPrint("__project.name__ - Theme Blend", "bold+green");
colorPrint("--------------------------------------------------------------------------", "bold+green");
describeTask(app, "debug", "Builds a debug version at " + FILE.join(buildDir, "Debug", productName));
describeTask(app, "release", "Builds a release version at " + FILE.join(buildDir, "Release", productName));
describeTask(app, "all", "Builds a debug and release version");
describeTask(app, "test", "Builds a debug version, symlinks to the installed BlendKit framework,\nand opens the theme showcase in the default browser");
describeTask(app, "test-release", "Builds a release version, symlinks to the installed BlendKit framework,\nand opens the theme showcase in the default browser");
describeTask(app, "clean", "Removes the intermediate build files");
describeTask(app, "clobber", "Removes the intermediate build files and the built theme");
colorPrint("--------------------------------------------------------------------------", "bold+green");
});
var describeTask = function(application, task, description)
{
colorPrint("\n" + application + " " + task, "violet");
description.split("\n").forEach(function(line)
{
print(" " + line);
});
}
var symlinkBlendKit = function(destinationPath)
{
if (FILE.exists(destinationPath))
return;
var blendKitPath = null,
path = FILE.join(SYS.prefix, "packages", "cappuccino", "Frameworks", "BlendKit");
if (FILE.isDirectory(path))
blendKitPath = path;
if (!blendKitPath)
{
cappBuild = ENV["CAPP_BUILD"];
if (cappBuild)
{
var buildTypes = ["Release", "Debug"];
for (var i = 0; i < buildTypes.length; ++i)
{
var path = FILE.join(cappBuild, buildTypes[i], "BlendKit");
if (FILE.isDirectory(path))
{
blendKitPath = path;
break;
}
}
}
}
if (blendKitPath)
FILE.symlink(blendKitPath, destinationPath);
}
function colorPrint(message, color)
{
var matches = color.match(/(bold(?: |\+))?(.+)/);
if (!matches)
return;
message = "\0" + matches[2] + "(" + message + "\0)";
if (matches[1])
message = "\0bold(" + message + "\0)";
stream.print(message);
}
@@ -3,15 +3,13 @@
* __project.name__
*
* Created by __user.name__ on __project.date__.
* Copyright __project.year__, __organization.name__ All rights reserved.
* Copyright __project.year__, __organization.name__. All rights reserved.
*/
@import <BlendKit/BKThemeDescriptor.j>
@implementation __project.nameasidentifier__ThemeDescriptor : BKThemeDescriptor
{
}
+ (CPString)themeName
{
@@ -21,7 +19,7 @@
+ (CPButton)themedButton
{
var button = [[CPButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 20.0)];
[button setValue:[CPColor blueColor] forThemeAttribute:@"bezel-color"];
[button setValue:[CPColor greenColor] forThemeAttribute:@"bezel-color" inState:CPThemeStateHighlighted];
@@ -29,7 +27,7 @@
[button setValue:[CPColor yellowColor] forThemeAttribute:@"text-color" inState:CPThemeStateHighlighted];
[button setTitle:@"Yikes!"];
return button;
}
@@ -7,7 +7,7 @@
__project.name__
Created by __user.name__ on __project.date__.
Copyright __project.year__, __organization.name__ All rights reserved.
Copyright __project.year__, __organization.name__. All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
@@ -7,7 +7,7 @@
__project.name__
Created by __user.name__ on __project.date__.
Copyright __project.year__, __organization.name__ All rights reserved.
Copyright __project.year__, __organization.name__. All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
@@ -1,9 +1,9 @@
/*
* main.j
* __Product__
* __project.name__
*
* Created by __Me__ on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
* Created by __user.name__ on __project.date__.
* Copyright __project.year__, __organization.name__. All rights reserved.
*/
@import <Foundation/Foundation.j>
+7 -8
View File
@@ -40,18 +40,16 @@ ConverterConversionException = @"ConverterConversionException";
@implementation Converter : CPObject
{
CPString inputPath @accessors(readonly);
CPString outputPath @accessors;
CPString resourcesPath @accessors;
NibFormat format @accessors(readonly);
CPArray themes @accessors(readonly);
CPString inputPath @accessors(readonly);
CPString outputPath @accessors;
CPString resourcesPath @accessors;
NibFormat format @accessors(readonly);
CPArray themes @accessors(readonly);
CPArray userNSClasses @accessors;
}
+ (Converter)sharedConverter
{
if (!SharedConverter)
SharedConverter = [[Converter alloc] init];
return SharedConverter;
}
@@ -61,6 +59,7 @@ ConverterConversionException = @"ConverterConversionException";
if (self)
{
SharedConverter = self;
inputPath = aPath;
format = nibFormat;
themes = themeList;
+67 -4
View File
@@ -1,3 +1,26 @@
/*
* NSClassSwapper.j
* nib2cib
*
* 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 "Converter.j"
var NSClassSwapperClassNames = {},
NSClassSwapperOriginalClassNames = {};
@@ -16,15 +39,38 @@ var _CPCibClassSwapperClassNameKey = @"_CPCibClassSwapperClassNameKey",
if (!swapperClass)
{
var originalClass = objj_lookUpClass(anOriginalClassName);
// If this is a userland NS class, call its KVC methods directly
var nsClass = nil;
if ([[[Converter sharedConverter] userNSClasses] containsObject:aClassName])
nsClass = objj_lookUpClass("NS_" + aClassName);
var originalClass = nsClass || objj_lookUpClass(anOriginalClassName);
swapperClass = objj_allocateClassPair(originalClass, swapperClassName);
objj_registerClassPair(swapperClass);
/*
When calling userland KVC methods, they should think that the class is
the NS class (not the swapper class) so that they are in their userland space,
not in AppKit space. For example, this ensures that bundleForClass:[self class] will work correctly.
We can accomplish this safely by changing the class of self temporarily and sending directly
to self instead of to super. This swizzle is safe because NSClassSwapper and _CPCibClassSwapper
do not add any ivars.
*/
class_addMethod(swapperClass, @selector(initWithCoder:), function(self, _cmd, aCoder)
{
self = objj_msgSendSuper({super_class:originalClass, receiver:self}, _cmd, aCoder);
if (nsClass)
{
// Switch to userland temporarily
self.isa = nsClass;
self = objj_msgSend(self, _cmd, aCoder);
self.isa = swapperClass;
}
else
self = objj_msgSendSuper({super_class:originalClass, receiver:self}, _cmd, aCoder);
if (self)
{
@@ -44,9 +90,26 @@ var _CPCibClassSwapperClassNameKey = @"_CPCibClassSwapperClassNameKey",
class_addMethod(swapperClass, @selector(encodeWithCoder:), function(self, _cmd, aCoder)
{
objj_msgSendSuper({super_class:originalClass, receiver:self}, _cmd, aCoder);
if (nsClass)
{
// Switch to userland temporarily
self.isa = nsClass;
objj_msgSend(self, _cmd, aCoder);
self.isa = swapperClass;
}
else
objj_msgSendSuper({super_class:originalClass, receiver:self}, _cmd, aCoder);
// If this is a custom NS class, lookup its archiver class so that
// the correct class is swapped during unarchiving.
if (nsClass)
{
var classForArchiver = objj_msgSend(nsClass, "classForKeyedArchiver");
if (classForArchiver)
aClassName = [classForArchiver className];
}
// FIXME: map class name as well?
[aCoder encodeObject:aClassName forKey:_CPCibClassSwapperClassNameKey];
[aCoder encodeObject:CP_NSMapClassName(anOriginalClassName) forKey:_CPCibClassSwapperOriginalClassNameKey];
}, "");
+1
View File
@@ -24,4 +24,5 @@
@import "NSExpression.j"
@import "NSDictionary.j"
@import "NSMutableString.j"
@import "NSNull.j"
@import "NSSet.j"
+47 -1
View File
@@ -23,6 +23,7 @@
@import <AppKit/CPCibConnector.j>
@import <AppKit/CPCibControlConnector.j>
@import <AppKit/CPCibOutletConnector.j>
@import <AppKit/CPCibRuntimeAttributesConnector.j>
NIB_CONNECTION_EQUIVALENCY_TABLE = {};
@@ -53,7 +54,8 @@ NIB_CONNECTION_EQUIVALENCY_TABLE = {};
_destination = NIB_CONNECTION_EQUIVALENCY_TABLE[destinationUID];
}
CPLog.debug(@"NSNibConnector: connection: " + [_source description] + " " + [_destination description] + " " + _label);
if (_source && _destination)
CPLog.debug(@"NSNibConnector: connection: " + [_source description] + " " + [_destination description] + " " + _label);
}
return self;
@@ -167,3 +169,47 @@ var NSTransformers = [CPSet setWithObjects:
}
@end
@implementation CPCibRuntimeAttributesConnector (NSCoding)
- (id)NS_initWithCoder:(CPCoder)aCoder
{
self = [super NS_initWithCoder:aCoder];
if (self)
{
_source = [aCoder decodeObjectForKey:@"NSObject"];
_keyPaths = [aCoder decodeObjectForKey:@"NSKeyPaths"];
_values = [aCoder decodeObjectForKey:@"NSValues"];
var count = [_keyPaths count];
CPLog.debug(@"NSNibConnector: runtime attributes connector: " + [_source description]);
while (count--)
{
var value = _values[count],
type = typeof(value) === "boolean" ? "BOOL" : [value className];
CPLog.debug(@" %s (%s): %s", _keyPaths[count], type, value);
}
}
return self;
}
@end
@implementation NSIBUserDefinedRuntimeAttributesConnector : CPCibRuntimeAttributesConnector
- (id)initWithCoder:(CPCoder)aCoder
{
return [self NS_initWithCoder:aCoder];
}
- (Class)classForKeyedArchiver
{
return [CPCibRuntimeAttributesConnector class];
}
@end
+37
View File
@@ -0,0 +1,37 @@
/*
* NSNull.j
* nib2cib
*
* Created by Aparajita Fishman.
* Copyright 2011, 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 <Foundation/CPNull.j>
@implementation NSNull : CPNull
- (id)initWithCoder:(CPCoder)aCoder
{
return [CPNull null];
}
- (Class)classForKeyedArchiver
{
return [CPNull class];
}
@end
+1
View File
@@ -68,6 +68,7 @@ var NSViewAutoresizingMask = 0x3F,
_isHidden = vFlags & NSViewHiddenMask;
_opacity = 1.0;//[aCoder decodeIntForKey:CPViewOpacityKey];
_themeClass = [self themeClass];
_themeAttributes = {};
_themeState = CPThemeStateNormal;
[self _loadThemeAttributes];
+952
View File
@@ -0,0 +1,952 @@
/*
* Nib2Cib.j
* nib2cib
*
* Created by Francisco Tolmasky and Aparajita Fishman.
* Copyright 2008, 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 <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import <BlendKit/BlendKit.j>
@import "NSFoundation.j"
@import "NSAppKit.j"
@import "Nib2CibKeyedUnarchiver.j"
@import "Converter.j"
var FILE = require("file"),
OS = require("os"),
SYS = require("system"),
FileList = require("jake").FileList,
stream = require("narwhal/term").stream,
StaticResource = require("objective-j").StaticResource,
DefaultTheme = "Aristo",
BuildTypes = ["Debug", "Release"],
DefaultFile = "MainMenu",
AllowedStoredOptionsRe = new RegExp("^(defaultTheme|auxThemes|verbosity|quiet|frameworks|format)$");
ArgsRe = /"[^\"]+"|'[^\']+'|\S+/g;
@implementation Nib2Cib : CPObject
{
CPArray commandLineArgs;
JSObject parser;
JSObject nibInfo;
CPString appDirectory;
CPString resourcesDirectory;
CPDictionary infoPlist;
CPArray userNSClasses;
}
- (id)initWithArgs:(CPArray)theArgs
{
self = [super init];
if (self)
{
commandLineArgs = theArgs;
parser = new (require("narwhal/args").Parser)();
nibInfo = {};
appDirectory = @"";
resourcesDirectory = @"";
infoPlist = [CPDictionary dictionary];
userNSClasses = [];
}
return self;
}
- (void)run
{
try
{
var options = [self parseOptionsFromArgs:commandLineArgs];
[self setLogLevel:options.quiet ? -1 : options.verbosity];
if (options.watch)
[self watchWithOptions:options];
else
[self convertWithOptions:options inputFile:nil];
}
catch (anException)
{
CPLog.fatal([self exceptionReason:anException]);
OS.exit(1);
}
}
- (BOOL)convertWithOptions:(JSObject)options inputFile:(CPString)inputFile
{
try
{
inputFile = inputFile || [self getInputFile:options.args];
[self getAppAndResourceDirectoriesFromInputFile:inputFile options:options];
if (options.readStoredOptions)
{
options = [self mergeOptionsWithStoredOptions:options inputFile:inputFile];
[self setLogLevel:options.quiet ? -1 : options.verbosity];
}
if (!options.quiet && options.verbosity > 0)
[self printVersion];
var outputFile = [self getOutputFileFromInputFile:inputFile args:options.args],
configInfo = [self readConfigFile:options.configFile || @"" inputFile:inputFile];
infoPlist = configInfo.plist;
if (infoPlist)
{
var systemFontFace = [infoPlist valueForKey:@"CPSystemFontFace"];
if (systemFontFace)
[CPFont setSystemFontFace:systemFontFace];
var systemFontSize = [infoPlist valueForKey:@"CPSystemFontSize"];
if (systemFontSize)
[CPFont setSystemFontSize:parseFloat(systemFontSize, 10)];
}
var themeList = [self getThemeList:options],
themes = [self loadThemesFromList:themeList];
CPLog.info("\n-------------------------------------------------------------");
CPLog.info("Input : " + inputFile);
CPLog.info("Output : " + outputFile);
CPLog.info("Format : " + ["Auto", "Mac", "iPhone"][options.format]);
CPLog.info("Application : " + appDirectory);
CPLog.info("Resources : " + resourcesDirectory);
CPLog.info("Frameworks : " + (options.frameworks || ""));
CPLog.info("Default theme : " + themeList[0]);
CPLog.info("Aux themes : " + themeList.slice(1).join(", "));
CPLog.info("Config file : " + (configInfo.path || ""));
CPLog.info("System Font : " + [CPFont systemFontSize] + "px " + [CPFont systemFontFace]);
CPLog.info("-------------------------------------------------------------\n");
var converter = [[Converter alloc] initWithInputPath:inputFile
format:options.format
themes:themes];
[converter setOutputPath:outputFile];
[converter setResourcesPath:resourcesDirectory];
var loadFrameworksCallback = function()
{
[self loadNSClassesFromBundle:[CPBundle mainBundle]];
[converter setUserNSClasses:userNSClasses];
[converter convert];
};
[self loadFrameworks:options.frameworks verbosity:options.verbosity callback:loadFrameworksCallback];
return YES;
}
catch (anException)
{
CPLog.fatal([self exceptionReason:anException]);
return NO;
}
}
- (void)watchWithOptions:(JSObject)options
{
var verbosity = options.quiet ? -1 : options.verbosity,
watchDir = options.args[0];
if (!watchDir)
watchDir = FILE.canonical(FILE.isDirectory("Resources") ? "Resources" : ".");
else
{
watchDir = FILE.canonical(watchDir);
if (FILE.basename(watchDir) !== "Resources")
{
var path = FILE.join(watchDir, "Resources");
if (FILE.isDirectory(path))
watchDir = path;
}
}
if (!FILE.isDirectory(watchDir))
[self failWithMessage:@"Cannot find the directory: " + watchDir];
// Turn on info messages
[self setLogLevel:1];
var nibs = new FileList(FILE.join(watchDir, "*.[nx]ib")).items(),
count = nibs.length;
// First time through only IB files with no corresponding cib
// or a cib with an earlier or equal mtime are converted.
while (count--)
{
var nib = nibs[count],
cib = nib.substr(0, nib.length - 4) + ".cib";
if (FILE.exists(cib) && (FILE.mtime(nib) - FILE.mtime(cib)) <= 0)
nibInfo[nib] = FILE.mtime(nib);
}
CPLog.info("Watching: " + CPLogColorize(watchDir, "debug"));
CPLog.info("Press Control-C to stop...");
while (true)
{
var modifiedNibs = [self getModifiedNibsInDirectory:watchDir];
for (var i = 0; i < modifiedNibs.length; ++i)
{
var action = modifiedNibs[i][0],
nib = modifiedNibs[i][1],
label = action === "add" ? "Added" : "Modified",
level = action === "add" ? "info" : "debug";
CPLog.info(">> %s: %s", CPLogColorize(label, level), nib);
// Don't convert an add if there is an existing cib with a later mtime
if (action === "add")
{
var cib = nib.substr(0, nib.length - 4) + ".cib";
if (FILE.exists(cib) && (FILE.mtime(nib) - FILE.mtime(cib)) < 0)
continue;
}
// Let the converter log however the user configured it
[self setLogLevel:verbosity];
var success = [self convertWithOptions:options inputFile:nib];
[self setLogLevel:1];
if (success)
{
if (verbosity > 0)
stream.print();
else
CPLog.warn("Conversion successful");
}
}
OS.sleep(1);
}
}
- (JSObject)parseOptionsFromArgs:(CPArray)theArgs
{
parser.usage("[--watch DIRECTORY] [INPUT_FILE [OUTPUT_FILE]]");
parser.option("--watch", "watch")
.set(true)
.help("Ask nib2cib to watch a directory for changes");
parser.option("-R", "resourcesDir")
.set()
.displayName("directory")
.help("Set the Resources directory, usually unnecessary as it is inferred from the input path");
parser.option("--default-theme", "defaultTheme")
.set()
.displayName("name")
.help("Specify a custom default theme which is not set in your Info.plist");
parser.option("-t", "--theme", "auxThemes")
.push()
.displayName("name")
.help("An additional theme loaded dynamically by your application");
parser.option("--config", "configFile")
.set()
.displayName("path")
.help("A path to an Info.plist file from which the system font and/or size can be retrieved");
parser.option("-v", "--verbose", "verbosity")
.inc()
.help("Increase verbosity level");
parser.option("-q", "--quiet", "quiet")
.set(true)
.help("No output");
parser.option("-F", "--framework", "frameworks")
.push()
.help("Add a framework to load");
parser.option("--no-stored-options", "readStoredOptions")
.set(false)
.def(true)
.help("Do not read stored options");
parser.option("--mac", "format")
.set(NibFormatMac)
.def(NibFormatUndetermined)
.help("Set format to Mac");
parser.option("--version", "showVersion")
.action(function() { [self printVersionAndExit]; })
.help("Show the version of nib2cib and quit");
parser.helpful();
var options = parser.parse(theArgs, null, null, true);
if (options.args.length > 2)
{
parser.printUsage(options);
OS.exit(0);
}
return options;
}
- (JSObject)mergeOptionsWithStoredOptions:(JSObject)options inputFile:(CPString)inputFile
{
// We have to clone options
var userOptions = [self readStoredOptionsAtPath:FILE.join(SYS.env["HOME"], ".nib2cibconfig")],
appOptions = [self readStoredOptionsAtPath:FILE.join(appDirectory, "nib2cib.conf")],
filename = FILE.basename(inputFile, FILE.extension(inputFile)) + ".conf",
fileOptions = [self readStoredOptionsAtPath:FILE.join(FILE.dirname(inputFile), filename)];
// At this point we have an array of args without the initial command in args[0],
// add the command and parse the options.
userOptions = [self parseOptionsFromArgs:[options.command].concat(userOptions)];
appOptions = [self parseOptionsFromArgs:[options.command].concat(appOptions)];
fileOptions = [self parseOptionsFromArgs:[options.command].concat(fileOptions)];
// The increasing order of precedence is: user -> app -> file -> command line
var mergedOptions = userOptions;
[self mergeOptions:appOptions with:mergedOptions];
[self mergeOptions:fileOptions with:mergedOptions];
[self mergeOptions:options with:mergedOptions];
mergedOptions.args = options.args;
return mergedOptions;
}
- (CPArray)readStoredOptionsAtPath:(CPString)path
{
path = FILE.canonical(path);
if (!FILE.isReadable(path))
return [];
var file = FILE.open(path, "r"),
line = file.readLine(),
matches = line.match(ArgsRe) || [];
file.close();
CPLog.debug("Reading stored options: " + path);
if (matches)
{
for (var i = 0; i < matches.length; ++i)
{
var str = matches[i];
if ((str.charAt(0) === '"' && str.substr(-1) === '"') || (str.charAt(0) === "'" && str.substr(-1) === "'"))
matches[i] = str.substr(1, str.length - 2);
}
return matches;
}
else
return [];
}
- (void)printOptions:options
{
for (option in options)
{
var value = options[option];
if (value)
{
var show = value.length !== undefined ? value.length > 0 : !!value;
if (show)
print(option + ": " + value);
}
}
}
// Merges properties in sourceOptions into targetOptions, overriding properties in targetOptions
- (void)mergeOptions:(JSObject)sourceOptions with:(JSObject)targetOptions
{
for (option in sourceOptions)
{
// Make sure only a supported option is given
if (!AllowedStoredOptionsRe.test(option))
continue;
if (sourceOptions.hasOwnProperty(option))
{
var value = sourceOptions[option];
if (value)
{
var copy = value.length !== undefined ? value.length > 0 : !!value;
if (copy)
targetOptions[option] = value;
}
}
}
}
- (void)setLogLevel:(int)level
{
CPLogUnregister(CPLogPrint);
if (level === 0)
CPLogRegister(CPLogPrint, "warn", logFormatter);
else if (level === 1)
CPLogRegister(CPLogPrint, "info", logFormatter);
else if (level > 1)
CPLogRegister(CPLogPrint, null, logFormatter);
}
- (CPString)getInputFile:(CPArray)theArgs
{
var inputFile = theArgs[0] || DefaultFile,
path = "";
if (!/^.+\.[nx]ib$/.test(inputFile))
{
if (path = [self findInputFile:inputFile extension:@".xib"])
inputFile = path;
else if (path = [self findInputFile:inputFile extension:@".nib"])
inputFile = path;
else
[self failWithMessage:@"Cannot find the input file (.xib or .nib): " + FILE.canonical(inputFile)];
}
else if (path = [self findInputFile:inputFile extension:nil])
inputFile = path;
else
[self failWithMessage:@"Could not read the input file: " + FILE.canonical(inputFile)];
return FILE.canonical(inputFile);
}
- (void)findInputFile:(CPString)inputFile extension:(CPString)extension
{
var path = inputFile;
if (extension)
path += extension;
if (FILE.isReadable(path))
return path;
if (FILE.basename(FILE.dirname(inputFile)) !== "Resources" && FILE.isDirectory("Resources"))
{
path = FILE.resolve(path, FILE.join("Resources", FILE.basename(path)));
if (FILE.isReadable(path))
return path;
}
return null;
}
- (void)getAppAndResourceDirectoriesFromInputFile:(CPString)inputFile options:(JSObject)options
{
appDirectory = resourcesDirectory = "";
if (options.resourcesDir)
{
var path = FILE.canonical(options.resourcesDir);
if (!FILE.isDirectory(path))
[self failWithMessage:@"Cannot read resources at: " + path];
resourcesDirectory = path;
}
var parentDir = FILE.dirname(inputFile);
if (FILE.basename(parentDir) === "Resources")
{
appDirectory = FILE.dirname(parentDir);
resourcesDirectory = resourcesDirectory || parentDir;
}
else
{
appDirectory = parentDir;
if (!resourcesDirectory)
{
var path = FILE.join(appDirectory, "Resources");
if (FILE.isDirectory(path))
resourcesDirectory = path;
}
}
}
- (CPString)getOutputFileFromInputFile:(CPString)inputFile args:(CPArray)theArgs
{
var outputFile = null;
if (theArgs.length > 1)
{
outputFile = theArgs[1];
if (!/^.+\.cib$/.test(outputFile))
outputFile += ".cib";
}
else
outputFile = FILE.join(FILE.dirname(inputFile), FILE.basename(inputFile, FILE.extension(inputFile))) + ".cib";
outputFile = FILE.canonical(outputFile);
if (!FILE.isWritable(FILE.dirname(outputFile)))
[self failWithMessage:@"Cannot write the output file at: " + outputFile];
return outputFile;
}
- (void)loadFrameworks:(CPArray)frameworks verbosity:(int)verbosity callback:(JSObject)aCallback
{
if (!frameworks || frameworks.length === 0)
return aCallback();
var returnPath = function(path) { return path; };
frameworks.forEach(function(aFramework)
{
[self setLogLevel:verbosity];
var frameworkPath = nil;
// If it is just a name with no path components, try to locate it
if (aFramework.indexOf("/") === -1)
{
frameworkPath = [self findInCappBuild:aFramework isDirectory:YES callback:returnPath];
if (!frameworkPath)
frameworkPath = [self findInFrameworks:FILE.join(appDirectory, "Frameworks")
path:aFramework
isDirectory:YES
callback:returnPath];
if (!frameworkPath)
frameworkPath = [self findInInstalledFrameworks:aFramework isDirectory:YES callback:returnPath];
}
else
frameworkPath = FILE.canonical(aFramework);
if (!frameworkPath)
[self failWithMessage:@"Cannot find the framework \"" + aFramework + "\""];
CPLog.debug("Loading framework: " + frameworkPath);
try
{
// CPBundle is a bit loquacious with logging, we will defer
// logging its exceptions till later.
[self setLogLevel:-1];
var frameworkBundle = [[CPBundle alloc] initWithPath:frameworkPath];
[frameworkBundle loadWithDelegate:nil];
[self setLogLevel:verbosity];
[self loadNSClassesFromBundle:frameworkBundle];
}
finally
{
[self setLogLevel:verbosity];
}
require("browser/timeout").serviceTimeouts();
});
aCallback();
}
- (void)loadNSClassesFromBundle:(CPBundle)aBundle
{
// See if the framework defines NS classes
var nsClasses = [aBundle objectForInfoDictionaryKey:@"IBClasses"] || [],
bundlePath = [aBundle bundlePath];
for (var i = 0; i < nsClasses.length; ++i)
{
if (userNSClasses.indexOf(nsClasses[i]) >= 0)
continue;
var path = FILE.join(bundlePath, "NS_" + nsClasses[i] + ".j");
objj_importFile(path, YES);
CPLog.debug("Imported NS class: %s", path);
userNSClasses.push(nsClasses[i]);
}
}
- (CPArray)getThemeList:(JSObject)options
{
var defaultTheme = options.defaultTheme;
if (!defaultTheme)
defaultTheme = [infoPlist valueForKey:@"CPDefaultTheme"];
if (!defaultTheme)
defaultTheme = [self getAppKitDefaultThemeName];
var themes = [CPSet setWithObject:defaultTheme];
if (options.auxThemes)
[themes addObjectsFromArray:options.auxThemes];
var auxThemes = infoPlist.valueForKey("CPAuxiliaryThemes");
if (auxThemes)
[themes addObjectsFromArray:auxThemes];
// Now remove the default theme, get the list as an array, and insert the default at the beginning
[themes removeObject:defaultTheme];
var allThemes = [themes allObjects];
[allThemes insertObject:defaultTheme atIndex:0];
return allThemes;
}
// Returns undefined if $CAPP_BUILD is not defined, false if path cannot be found in $CAPP_BUILD
- (id)findInCappBuild:(CPString)path isDirectory:(BOOL)isDirectory callback:(JSObject)callback
{
var cappBuild = SYS.env["CAPP_BUILD"];
if (!cappBuild)
return undefined;
cappBuild = FILE.canonical(cappBuild);
if (FILE.isDirectory(cappBuild))
{
var result = null;
for (var i = 0; i < BuildTypes.length && !result; ++i)
{
var findPath = FILE.join(cappBuild, BuildTypes[i], path);
if ((isDirectory && FILE.isDirectory(findPath)) || (!isDirectory && FILE.exists(findPath)))
result = callback(findPath);
}
return result;
}
else
return false;
}
- (id)findInInstalledFrameworks:(CPString)path isDirectory:(BOOL)isDirectory callback:(JSObject)callback
{
// NOTE: It's safe to use '/' directly in the path, we're guaranteed to be on a Mac
return [self findInFrameworks:FILE.canonical(FILE.join(SYS.prefix, "packages/cappuccino/Frameworks"))
path:path
isDirectory:isDirectory
callback:callback];
}
- (id)findInFrameworks:(CPString)frameworksPath path:(CPString)path isDirectory:(BOOL)isDirectory callback:(JSObject)callback
{
var result = null,
findPath = FILE.join(frameworksPath, "Debug", path);
if ((isDirectory && FILE.isDirectory(findPath)) || (!isDirectory && FILE.exists(findPath)))
result = callback(findPath);
if (!result)
{
findPath = FILE.join(frameworksPath, path);
if ((isDirectory && FILE.isDirectory(findPath)) || (!isDirectory && FILE.exists(findPath)))
result = callback(findPath);
}
return result;
}
- (CPString)getAppKitDefaultThemeName
{
var callback = function(path) { return [self themeNameFromPropertyList:path]; },
themeName = [self findInCappBuild:@"AppKit/Info.plist" isDirectory:NO callback:callback];
if (!themeName)
themeName = [self findInInstalledFrameworks:@"AppKit/Info.plist" isDirectory:NO callback:callback];
return themeName || DefaultTheme;
}
- (CPString)themeNameFromPropertyList:(CPString)path
{
if (!FILE.isReadable(path))
return nil;
var themeName = nil,
plist = CFPropertyList.readPropertyListFromFile(path);
if (plist)
themeName = plist.valueForKey("CPDefaultTheme");
return themeName;
}
- (CPArray)loadThemesFromList:(CPArray)themeList
{
var themes = [];
for (var i = 0; i < themeList.length; ++i)
themes.push([self loadThemeNamed:themeList[i] directory:resourcesDirectory]);
return themes;
}
- (CPTheme)loadThemeNamed:(CPString)themeName directory:(CPString)themeDir
{
if (/^.+\.blend$/.test(themeName))
themeName = themeName.substr(0, themeName.length - ".blend".length);
var blendName = themeName + ".blend",
themePath = "";
if (themeDir)
{
themePath = FILE.join(FILE.canonical(themeDir), blendName);
if (!FILE.isDirectory(themePath))
themePath = themeDir = null;
}
if (!themeDir)
{
var returnPath = function(path) { return path; };
themePath = [self findInCappBuild:blendName isDirectory:YES callback:returnPath];
if (!themePath)
themePath = [self findInInstalledFrameworks:@"AppKit/Resources/" + blendName isDirectory:YES callback:returnPath];
// Last resort, try the cwd
if (!themePath)
{
var path = FILE.canonical(blendName);
if (FILE.isDirectory(path))
themePath = path;
}
}
if (!themePath)
[self failWithMessage:@"Cannot find the theme \"" + themeName + "\""];
return [self readThemeWithName:themeName atPath:themePath];
}
- (CPTheme)readThemeWithName:(CPString)name atPath:(CPString)path
{
var themeBundle = new CFBundle(path);
// By default when we try to load the bundle it will use the CommonJS environment,
// but we want the Browser environment. So we override mostEligibleEnvironment().
themeBundle.mostEligibleEnvironment = function() { return "Browser"; }
themeBundle.load();
var keyedThemes = themeBundle.valueForInfoDictionaryKey("CPKeyedThemes");
if (!keyedThemes)
[self failWithMessage:@"Could not find the keyed themes in the theme: " + path];
var index = keyedThemes.indexOf(name + ".keyedtheme");
if (index < 0)
[self failWithMessage:@"Could not find the main theme data (" + name + ".keyedtheme" + ") in the theme: " + path];
// Load the keyed theme data, making sure to resolve it
var resourcePath = themeBundle.pathForResource(keyedThemes[index]),
themeData = new CFMutableData();
themeData.setRawString(StaticResource.resourceAtURL(new CFURL(resourcePath), true).contents());
var theme = [CPKeyedUnarchiver unarchiveObjectWithData:themeData];
if (!theme)
[self failWithMessage:@"Could not unarchive the theme at: " + path];
CPLog.debug("Loaded theme: " + path);
return theme;
}
- (JSObject)readConfigFile:(CPString)configFile inputFile:(CPString)inputFile
{
var configPath = null,
path;
// First see if the user passed a config file path
if (configFile)
{
path = FILE.canonical(configFile);
if (!FILE.isReadable(path))
[self failWithMessage:@"Cannot find the config file: " + path];
configPath = path;
}
else
{
path = FILE.join(appDirectory, "Info.plist");
if (FILE.isReadable(path))
configPath = path;
}
var plist = null;
if (configPath)
{
var plist = FILE.read(configPath);
if (!plist)
[self failWithMessage:@"Could not read the Info.plist at: " + configPath];
plist = CFPropertyList.propertyListFromString(plist);
if (!plist)
[self failWithMessage:@"Could not parse the Info.plist at: " + configPath];
}
return {path: configPath, plist: plist};
}
- (CPArray)getModifiedNibsInDirectory:(CPString)path
{
var nibs = new FileList(FILE.join(path, "*.[nx]ib")).items(),
count = nibs.length,
newNibInfo = {},
modifiedNibs = [];
while (count--)
{
var nib = nibs[count];
newNibInfo[nib] = FILE.mtime(nib);
if (!nibInfo.hasOwnProperty(nib))
modifiedNibs.push(["add", nib]);
else
{
if (newNibInfo[nib] - nibInfo[nib] !== 0)
modifiedNibs.push(["mod", nib]);
// Remove matching nibs so that we leave
// deleted nibs in nibInfo.
delete nibInfo[nib];
}
}
for (var nib in nibInfo)
if (nibInfo.hasOwnProperty(nib))
CPLog.info(">> %s: %s", CPLogColorize("Deleted", "warn"), nib);
nibInfo = newNibInfo;
return modifiedNibs;
}
- (void)printVersionAndExit
{
[self printVersion];
OS.exit(0);
}
- (void)printVersion
{
/*
There are two usual possibilities for the location of the nib2cib binary.
If we are executing the installed narwhal binary, the location is:
<narwhal>/packages/cappuccino/bin/nib2cib
If we are executing the built binary, the location is:
<CAPP_BUILD>/Debug|Release/CommonJS/cappuccino/bin/nib2cib
Base on these paths we can locate nib2cib's Info.plist.
*/
var path = FILE.dirname(FILE.dirname(FILE.canonical(SYS.args[0]))),
version = null;
if (FILE.basename(path) === "narwhal")
path = FILE.join(path, "packages", "cappuccino");
path = FILE.join(path, "lib", "nib2cib", "Info.plist");
if (FILE.isReadable(path))
{
var plist = FILE.read(path);
if (!plist)
return;
plist = CFPropertyList.propertyListFromString(plist);
if (!plist)
return;
version = plist.valueForKey("CPBundleVersion");
if (version)
stream.print("nib2cib v" + version);
}
if (!version)
stream.print("<No version info available>");
}
- (CPString)exceptionReason:(JSObject)exception
{
if (typeof(exception) === "string")
return exception;
else if (exception.isa && [exception respondsToSelector:@selector(reason)])
return [exception reason];
else
return @"An unknown error occurred";
}
- (void)failWithMessage:(CPString)message
{
[CPException raise:ConverterConversionException reason:message];
}
@end
function logFormatter(aString, aLevel, aTitle)
{
if (aLevel === "info")
return aString;
else
return CPLogColorize(aString, aLevel);
}
+3 -720
View File
@@ -20,728 +20,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import <BlendKit/BlendKit.j>
@import "NSFoundation.j"
@import "NSAppKit.j"
@import "Nib2CibKeyedUnarchiver.j"
@import "Converter.j"
var FILE = require("file"),
OS = require("os"),
SYS = require("system"),
FileList = require("jake").FileList,
stream = require("narwhal/term").stream,
StaticResource = require("objective-j").StaticResource,
DefaultTheme = "Aristo",
BuildTypes = ["Debug", "Release"],
DefaultFile = "MainMenu";
var parser = new (require("narwhal/args").Parser)(),
nibInfo = {},
appDirectory = "",
resourcesDirectory = "";
@import "Nib2Cib.j"
function main(args)
{
try
{
var options = parseOptions(args);
var nib2cib = [[Nib2Cib alloc] initWithArgs:args];
if (options.watch)
watch(options);
else
convert(options);
}
catch (anException)
{
CPLog.fatal(exceptionReason(anException));
OS.exit(1);
}
}
function convert(options, inputFile)
{
try
{
inputFile = inputFile || getInputFile(options.args);
getAppAndResourceDirectoriesFromInputFile(inputFile, options);
var outputFile = getOutputFile(inputFile, options.args),
configInfo = readConfigFile(options.configFile || "", inputFile),
defaultTheme = null;
if (configInfo.plist)
{
var systemFontFace = configInfo.plist.valueForKey("CPSystemFontFace");
if (systemFontFace)
[CPFont setSystemFontFace:systemFontFace];
var systemFontSize = configInfo.plist.valueForKey("CPSystemFontSize");
if (systemFontSize)
[CPFont setSystemFontSize:parseFloat(systemFontSize, 10)];
if (!options.defaultTheme)
defaultTheme = configInfo.plist.valueForKey("CPDefaultTheme");
}
var themeList = getThemeList(defaultTheme || options.defaultTheme, options),
themes = loadThemes(themeList);
CPLog.info("\n-------------------------------------------------------------");
CPLog.info("Input : " + inputFile);
CPLog.info("Output : " + outputFile);
CPLog.info("Format : " + ["Auto", "Mac", "iPhone"][options.format]);
CPLog.info("Application : " + appDirectory);
CPLog.info("Resources : " + resourcesDirectory);
CPLog.info("Frameworks : " + (options.frameworks || ""));
CPLog.info("Default theme : " + themeList[0]);
CPLog.info("Extra themes : " + themeList.slice(1).join(", "));
CPLog.info("Config file : " + (configInfo.path || ""));
CPLog.info("System Font : " + [CPFont systemFontSize] + "px " + [CPFont systemFontFace]);
CPLog.info("-------------------------------------------------------------\n");
var converter = [[Converter alloc] initWithInputPath:inputFile
format:options.format
themes:themes];
[converter setOutputPath:outputFile];
[converter setResourcesPath:resourcesDirectory];
loadFrameworks(options.frameworks, options.verbosity, function()
{
[converter convert];
});
return true;
}
catch (anException)
{
CPLog.fatal(exceptionReason(anException));
return false;
}
}
function watch(options)
{
var verbosity = options.quiet ? -1 : options.verbosity,
watchDir = options.args[0];
if (!watchDir)
watchDir = FILE.canonical(FILE.isDirectory("Resources") ? "Resources" : ".");
else
{
watchDir = FILE.canonical(watchDir);
if (FILE.basename(watchDir) !== "Resources")
{
var path = FILE.join(watchDir, "Resources");
if (FILE.isDirectory(path))
watchDir = path;
}
}
if (!FILE.isDirectory(watchDir))
fail("Cannot find the directory: " + watchDir);
// Turn on info messages
setLogLevel(1);
var nibs = new FileList(FILE.join(watchDir, "*.[nx]ib")).items(),
count = nibs.length;
// First time through only IB files with no corresponding cib
// or a cib with an earlier or equal mtime are converted.
while (count--)
{
var nib = nibs[count],
cib = nib.substr(0, nib.length - 4) + ".cib";
if (FILE.exists(cib) && (FILE.mtime(nib) - FILE.mtime(cib)) <= 0)
nibInfo[nib] = FILE.mtime(nib);
}
CPLog.info("Watching: " + CPLogColorize(watchDir, "debug"));
CPLog.info("Press Control-C to stop...");
while (true)
{
var modifiedNibs = getModifiedNibs(watchDir);
for (var i = 0; i < modifiedNibs.length; ++i)
{
var action = modifiedNibs[i][0],
nib = modifiedNibs[i][1],
label = action === "add" ? "Added" : "Modified",
level = action === "add" ? "info" : "debug";
CPLog.info(">> %s: %s", CPLogColorize(label, level), nib);
// Don't convert an add if there is an existing cib with a later mtime
if (action === "add")
{
var cib = nib.substr(0, nib.length - 4) + ".cib";
if (FILE.exists(cib) && (FILE.mtime(nib) - FILE.mtime(cib)) < 0)
continue;
}
// Let the converter log however the user configured it
setLogLevel(verbosity);
var success = convert(options, nib);
setLogLevel(1);
if (success)
{
if (verbosity > 0)
stream.print();
else
CPLog.warn("Conversion successful");
}
}
OS.sleep(1);
}
}
function parseOptions(args)
{
parser.usage("[--watch DIRECTORY] [INPUT_FILE [OUTPUT_FILE]]");
parser.option("--watch", "watch")
.set(true)
.help("Ask nib2cib to watch a directory for changes");
parser.option("-R", "resourcesDir")
.set()
.displayName("directory")
.help("Set the Resources directory, usually unnecessary as it is inferred from the input path");
parser.option("--default-theme", "defaultTheme")
.set()
.displayName("name")
.help("Specify a custom default theme which is not set in your Info.plist");
parser.option("-t", "--theme", "extraThemes")
.push()
.displayName("name")
.help("An additional theme loaded dynamically by your application");
parser.option("--config", "configFile")
.set()
.displayName("path")
.help("A path to an Info.plist file from which the system font and/or size can be retrieved");
// parser.option("--iphone", "format")
// .set(NibFormatIPhone)
// .help("Set format to iPhone");
parser.option("-v", "--verbose", "verbosity")
.inc()
.help("Increase verbosity level");
parser.option("-q", "--quiet", "quiet")
.set(true)
.help("No output");
parser.option("-F", "framework", "frameworks")
.push()
.help("Add a framework to load");
parser.option("--mac", "format")
.set(NibFormatMac)
.def(NibFormatUndetermined)
.help("Set format to Mac");
parser.option("--version", "showVersion")
.action(printVersionAndExit)
.help("Show the version of nib2cib and quit");
parser.helpful();
var options = parser.parse(args, null, null, true);
if (options.args.length > 2)
{
parser.printUsage(options);
OS.exit(0);
}
setLogLevel(options.quiet ? -1 : options.verbosity);
if (!options.quiet && options.verbosity > 0)
printVersion();
return options;
}
function setLogLevel(level)
{
CPLogUnregister(CPLogPrint);
if (level === 0)
CPLogRegister(CPLogPrint, "warn", logFormatter);
else if (level === 1)
CPLogRegister(CPLogPrint, "info", logFormatter);
else if (level > 1)
CPLogRegister(CPLogPrint, null, logFormatter);
}
function getInputFile(args)
{
var inputFile = args[0] || DefaultFile,
path = "";
if (!/^.+\.[nx]ib$/.test(inputFile))
{
if (path = findInputFile(inputFile, ".xib"))
inputFile = path;
else if (path = findInputFile(inputFile, ".nib"))
inputFile = path;
else
fail("Cannot find the input file (.xib or .nib): " + FILE.canonical(inputFile));
}
else if (path = findInputFile(inputFile))
inputFile = path;
else
fail("Could not read the input file: " + FILE.canonical(inputFile));
return FILE.canonical(inputFile);
}
function findInputFile(inputFile, extension)
{
var path = inputFile;
if (extension)
path += extension;
if (FILE.isReadable(path))
return path;
if (FILE.basename(FILE.dirname(inputFile)) !== "Resources" && FILE.isDirectory("Resources"))
{
path = FILE.resolve(path, FILE.join("Resources", FILE.basename(path)));
if (FILE.isReadable(path))
return path;
}
return null;
}
function getAppAndResourceDirectoriesFromInputFile(inputFile, options)
{
appDirectory = resourcesDirectory = "";
if (options.resourcesDir)
{
var path = FILE.canonical(options.resourcesDir);
if (!FILE.isDirectory(path))
fail("Cannot read resources at: " + path);
resourcesDirectory = path;
}
var parentDir = FILE.dirname(inputFile);
if (FILE.basename(parentDir) === "Resources")
{
appDirectory = FILE.dirname(parentDir);
resourcesDirectory = resourcesDirectory || parentDir;
}
else
{
appDirectory = parentDir;
if (!resourcesDirectory)
{
var path = FILE.join(appDirectory, "Resources");
if (FILE.isDirectory(path))
resourcesDirectory = path;
}
}
}
function getOutputFile(inputFile, args)
{
var outputFile = null;
if (args.length > 1)
{
outputFile = args[1];
if (!/^.+\.cib$/.test(outputFile))
outputFile += ".cib";
}
else
outputFile = FILE.join(FILE.dirname(inputFile), FILE.basename(inputFile, FILE.extension(inputFile))) + ".cib";
outputFile = FILE.canonical(outputFile);
if (!FILE.isWritable(FILE.dirname(outputFile)))
fail("Cannot write the output file at: " + outputFile);
return outputFile;
}
function loadFrameworks(frameworkPaths, verbosity, aCallback)
{
if (!frameworkPaths || frameworkPaths.length === 0)
return aCallback();
frameworkPaths.forEach(function(aFrameworkPath)
{
setLogLevel(verbosity);
CPLog.info("Loading " + aFrameworkPath);
try
{
// CPBundle is a bit loquacious with logging, we will defer
// logging its exceptions till later.
setLogLevel(-1);
var frameworkBundle = [[CPBundle alloc] initWithPath:aFrameworkPath];
[frameworkBundle loadWithDelegate:nil];
}
finally
{
setLogLevel(verbosity);
}
require("browser/timeout").serviceTimeouts();
});
aCallback();
}
function logFormatter(aString, aLevel, aTitle)
{
if (aLevel === "info")
return aString;
else
return CPLogColorize(aString, aLevel);
}
function getThemeList(defaultTheme, options)
{
var themes = [defaultTheme || getAppKitDefaultThemeName()];
if (options.extraThemes)
for (var i = 0; i < options.extraThemes.length; ++i)
if (themes.indexOf(options.extraThemes[i]) < 0)
themes.push(options.extraThemes[i]);
return themes;
}
// Returns undefined if $CAPP_BUILD is not defined, false if path cannot be found in $CAPP_BUILD
function findInCappBuild(path, isDirectory, callback)
{
var cappBuild = SYS.env["CAPP_BUILD"];
if (!cappBuild)
return undefined;
cappBuild = FILE.canonical(cappBuild);
if (FILE.isDirectory(cappBuild))
{
var result = null;
for (var i = 0; i < BuildTypes.length && !result; ++i)
{
var findPath = FILE.join(cappBuild, BuildTypes[i], path);
if ((isDirectory && FILE.isDirectory(findPath)) || (!isDirectory && FILE.exists(findPath)))
result = callback(findPath);
}
return result;
}
else
return false;
}
function findInInstalledFrameworks(path, isDirectory, callback)
{
// NOTE: It's safe to use '/' directly in the path, we're guaranteed to be on a Mac
var frameworks = FILE.canonical(FILE.join(SYS.prefix, "packages/cappuccino/Frameworks")),
result = null,
findPath = FILE.join(frameworks, "Debug", path);
if ((isDirectory && FILE.isDirectory(findPath)) || (!isDirectory && FILE.exists(findPath)))
result = callback(findPath);
if (!result)
{
findPath = FILE.join(frameworks, path);
if ((isDirectory && FILE.isDirectory(findPath)) || (!isDirectory && FILE.exists(findPath)))
result = callback(findPath);
}
return result;
}
function getAppKitDefaultThemeName()
{
var callback = function(path) { return themeNameFromPropertyList(path); },
themeName = findInCappBuild("AppKit/Info.plist", false, callback);
if (!themeName)
themeName = findInInstalledFrameworks("AppKit/Info.plist", false, callback);
return themeName || DefaultTheme;
}
function themeNameFromPropertyList(path)
{
if (!FILE.isReadable(path))
return nil;
var themeName = nil,
plist = CFPropertyList.readPropertyListFromFile(path);
if (plist)
themeName = plist.valueForKey("CPDefaultTheme");
return themeName;
}
function loadThemes(themeList)
{
var themes = [];
for (var i = 0; i < themeList.length; ++i)
themes.push(loadTheme(themeList[i], resourcesDirectory));
return themes;
}
function loadTheme(themeName, themeDir)
{
if (/^.+\.blend$/.test(themeName))
themeName = themeName.substr(0, themeName.length - ".blend".length);
var blendName = themeName + ".blend",
themePath = "";
if (themeDir)
{
themePath = FILE.join(FILE.canonical(themeDir), blendName);
if (!FILE.isDirectory(themePath))
themePath = themeDir = null;
}
if (!themeDir)
{
var returnPath = function(path) { return path; };
themePath = findInCappBuild(blendName, true, returnPath);
if (!themePath)
themePath = findInInstalledFrameworks("AppKit/Resources/" + blendName, true, returnPath);
// Last resort, try the cwd
if (!themePath)
{
var path = FILE.canonical(blendName);
if (FILE.isDirectory(path))
themePath = path;
}
}
if (!themePath)
fail('Cannot find the theme "' + themeName + '"');
return readTheme(themeName, themePath);
}
function readTheme(name, path)
{
var themeBundle = new CFBundle(path);
// By default when we try to load the bundle it will use the CommonJS environment,
// but we want the Browser environment. So we override mostEligibleEnvironment().
themeBundle.mostEligibleEnvironment = function() { return "Browser"; }
themeBundle.load();
var keyedThemes = themeBundle.valueForInfoDictionaryKey("CPKeyedThemes");
if (!keyedThemes)
fail("Could not find the keyed themes in the theme: " + path);
var index = keyedThemes.indexOf(name + ".keyedtheme");
if (index < 0)
fail("Could not find the main theme data (" + name + ".keyedtheme" + ") in the theme: " + path);
// Load the keyed theme data, making sure to resolve it
var resourcePath = themeBundle.pathForResource(keyedThemes[index]),
themeData = new CFMutableData();
themeData.setRawString(StaticResource.resourceAtURL(new CFURL(resourcePath), true).contents());
var theme = [CPKeyedUnarchiver unarchiveObjectWithData:themeData];
if (!theme)
fail("Could not unarchive the theme at: " + path);
CPLog.debug("Loaded theme: " + path);
return theme;
}
function readConfigFile(configFile, inputFile)
{
var configPath = null,
path;
// First see if the user passed a config file path
if (configFile)
{
path = FILE.canonical(configFile);
if (!FILE.isReadable(path))
fail("Cannot find the config file: " + path);
configPath = path;
}
else
{
path = FILE.join(appDirectory, "Info.plist");
if (FILE.isReadable(path))
configPath = path;
}
var plist = null;
if (configPath)
{
var plist = FILE.read(configPath);
if (!plist)
fail("Could not read the Info.plist at: " + configPath);
plist = CFPropertyList.propertyListFromString(plist);
if (!plist)
fail("Could not parse the Info.plist at: " + configPath);
}
return {path: configPath, plist: plist};
}
function getModifiedNibs(path)
{
var nibs = new FileList(FILE.join(path, "*.[nx]ib")).items(),
count = nibs.length,
newNibInfo = {},
modifiedNibs = [];
while (count--)
{
var nib = nibs[count];
newNibInfo[nib] = FILE.mtime(nib);
if (!nibInfo.hasOwnProperty(nib))
modifiedNibs.push(["add", nib]);
else
{
if (newNibInfo[nib] - nibInfo[nib] !== 0)
modifiedNibs.push(["mod", nib]);
// Remove matching nibs so that we leave
// deleted nibs in nibInfo.
delete nibInfo[nib];
}
}
for (var nib in nibInfo)
if (nibInfo.hasOwnProperty(nib))
CPLog.info(">> %s: %s", CPLogColorize("Deleted", "warn"), nib);
nibInfo = newNibInfo;
return modifiedNibs;
}
function printVersionAndExit()
{
printVersion();
OS.exit(0);
}
function printVersion()
{
/*
There are two usual possibilities for the location of the nib2cib binary.
If we are executing the installed narwhal binary, the location is:
<narwhal>/packages/cappuccino/bin/nib2cib
If we are executing the built binary, the location is:
<CAPP_BUILD>/Debug|Release/CommonJS/cappuccino/bin/nib2cib
Base on these paths we can locate nib2cib's Info.plist.
*/
var path = FILE.dirname(FILE.dirname(FILE.canonical(SYS.args[0]))),
version = null;
if (FILE.basename(path) === "narwhal")
path = FILE.join(path, "packages", "cappuccino");
path = FILE.join(path, "lib", "nib2cib", "Info.plist");
if (FILE.isReadable(path))
{
var plist = FILE.read(path);
if (!plist)
return;
plist = CFPropertyList.propertyListFromString(plist);
if (!plist)
return;
version = plist.valueForKey("CPBundleVersion");
if (version)
stream.print("nib2cib v" + version);
}
if (!version)
stream.print("<No version info available>");
}
function exceptionReason(exception)
{
if (typeof(exception) === "string")
return exception;
else if (exception.isa && [exception respondsToSelector:@selector(reason)])
return [exception reason];
else
return "An unknown error occurred";
}
function fail(message)
{
[CPException raise:ConverterConversionException reason:message];
[nib2cib run];
}
+72 -5
View File
@@ -1,6 +1,7 @@
.Dd April 3, 2011
.Os "Cappuccino"
.Dt NIB2CIB 1 "PRM"
.nh
.\"-----------------------------------------------------------------------------------------
.Sh NAME
.\"-----------------------------------------------------------------------------------------
@@ -154,8 +155,15 @@ options, one for each theme that you load.
.Pp
Themes are searched for in the Resources, $CAPP_BUILD/Debug and
$CAPP_BUILD/Release directories.
.Pp
If you have a list of auxiliary themes in your Info.plist using the
.Ar CPAuxiliaryThemes
item,
.Nm
will load them automatically, you do not have to do anything special.
.Nm
.\"-----------------------------------------------------------------------------------------
.Sh "COMMON OPTIONS"
.Sh "OPTIONS"
.\"-----------------------------------------------------------------------------------------
The following options are available in watch mode or single mode:
.Bl -tag -width 4n
@@ -192,7 +200,7 @@ use this option, as
uses the Info.plist in the application directory, which is inferred from
the input file.
.It Fl F
Specify the path of a framework to load before converting. This is only useful if:
Specify the name or path of a framework to load before converting. This is only useful if:
.Bl -dash -width 0n -hang
.It
Your IB files use classes from the framework.
@@ -202,13 +210,33 @@ Those classes need to serialize/deserialize more data than their superclasses.
Those classes implement encodeWithCoder: and initWithCoder:.
.El
.Pp
This option may be used multiple times to load multiple frameworks.
This option may be used multiple times to load multiple frameworks. If the argument
contains a "/" character, it is considered to be a relative or absolute path and
the framework is searched for at that location. Otherwise it is considered a framework
name and is searched for in the following directories:
.Bl -ohang -offset 4n
.It $CAPP_BUILD/Debug
.It $CAPP_BUILD/Release
.It <App>/Frameworks/Debug
.It <App>/Frameworks
.It <narwhal>/packages/cappuccino/Frameworks/Debug
.It <narwhal>/packages/cappuccino/Frameworks
.El
.It Fl \-quiet
Tells
.Nm
to output nothing. This is useful if you are using
.Nm
in a shell script and are only interested in the return value.
in a shell script and are only interested in the return value. Note that this
option overrides the
.Fl v
option.
.It Fl \-no-stored-options
Tells
.Nm
not to read stored options. See
.Sy Stored Options
below for more information.
.It Fl \-version
Prints the current version of
.Nm
@@ -221,7 +249,46 @@ Displays
usage and options.
.El
.\"-----------------------------------------------------------------------------------------
.Ss "Stored Options"
.\"-----------------------------------------------------------------------------------------
To make it easier to use nib2cib in an automated way, you can store command line options
that will apply to converted xibs/nibs. To store command line options, you enter the
options on a single line into a text file. For example, if you always want to set
"MyTheme" as the default theme, you would create a text file with this line:
.Pp
.D1 --default-theme MyTheme
.Pp
If an option takes a parameter and the parameter contains spaces, it must be enclosed in
single or double quotes. You may store options in the following three places, in increasing
order of precedence:
.Bl -ohang -offset 4n
.It Em ~/.nib2cibconfig
nib2cib options that apply to all nibs converted under your user account.
.It Em <app>/nib2cib.conf
nib2cib options that apply to all nibs in <app>/Resources.
.It Em <app>/Resources/<xib-or-nib-basename>.conf
nib2cib options that apply to a specific xib or nib. For example, if the xib
is called MainMenu.xib, the stored options file would be MainMenu.conf.
.El
.Pp
Each of these files is read in the order listed above, and if it exists, its options
are merged with the previous file's options. Options in later files (more specific)
override options in earlier files (more generic). After all of the stored options
are merged, the command line options are merged in. Thus command line options always
override stored options.
.Pp
Using stored options is especially useful if your xibs/nibs use custom themes or
frameworks. By using stored options, you can avoid remembering (or forgetting!) to
specify the theme or framework every time you invoke
.Nm .
.Pp
To prevent
.Nm
from reading stored options, and thus only use command line options, use the
.Fl \-no-stored-options
option on the command line.
.\"-----------------------------------------------------------------------------------------
.Sh "RETURN VALUES"
.\"-----------------------------------------------------------------------------------------
.Nm
returns 0 for a successful conversion and >0 if an error occurred.
returns 0 for a successful conversion and >0 if an error occurred.
+6
View File
@@ -0,0 +1,6 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
content/,\
patch/,\
.
+1
View File
@@ -0,0 +1 @@
+6
View File
@@ -0,0 +1,6 @@
repositories.remote = ["http://release.intalio.com/m2repo"]
#, "http://www.intalio.org/public/maven2", "http://dist.codehaus.org/mule/dependencies/maven2", "http://repository.jboss.com/maven2", "http://repo1.maven.org/maven2", "http://mirrors.ibiblio.org/pub/mirrors/maven2" ]
repositories.release_to[:username] ||= "release"
repositories.release_to[:url] ||= "sftp://release.intalio.com/home/release/m2repo"
repositories.release_to[:permissions] ||= 0664