mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-18 12:39:22 +00:00
Merge remote-tracking branch 'cappuccino/master' into NEW--CPTextView
This commit is contained in:
commit
373ec8b5a1
96 files changed
+9879
-4851
No files matched your search
@@ -27,6 +27,7 @@
|
||||
@import "CPAccordionView.j"
|
||||
@import "CPAlert.j"
|
||||
@import "CPAnimation.j"
|
||||
@import "CPAnimationContext.j"
|
||||
@import "CPAppearance.j"
|
||||
@import "CPApplication.j"
|
||||
@import "CPArrayController.j"
|
||||
@@ -108,6 +109,7 @@
|
||||
@import "CPTreeNode.j"
|
||||
@import "CPUserDefaultsController.j"
|
||||
@import "CPView.j"
|
||||
@import "CPViewAnimator.j"
|
||||
@import "CPViewAnimation.j"
|
||||
@import "CPViewController.j"
|
||||
@import "CPVisualEffectView.j"
|
||||
|
||||
+41
-23
@@ -132,7 +132,6 @@ var HORIZONTAL_MARGIN = 2;
|
||||
CGSize _storedFrameSize;
|
||||
|
||||
BOOL _uniformSubviewsResizing @accessors(property=uniformSubviewsResizing);
|
||||
BOOL _lockResizing;
|
||||
|
||||
CPInteger _currentDropIndex;
|
||||
CPDragOperation _currentDragOperation;
|
||||
@@ -140,6 +139,14 @@ var HORIZONTAL_MARGIN = 2;
|
||||
_CPCollectionViewDropIndicator _dropView;
|
||||
}
|
||||
|
||||
+ (Class)_binderClassForBinding:(CPString)aBinding
|
||||
{
|
||||
if (aBinding == CPContentBinding)
|
||||
return [_CPCollectionViewContentBinder class];
|
||||
|
||||
return [super _binderClassForBinding:aBinding];
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame
|
||||
{
|
||||
self = [super initWithFrame:aFrame];
|
||||
@@ -182,7 +189,7 @@ var HORIZONTAL_MARGIN = 2;
|
||||
|
||||
_needsMinMaxItemSizeUpdate = YES;
|
||||
_uniformSubviewsResizing = NO;
|
||||
_lockResizing = NO;
|
||||
_inLiveResize = NO;
|
||||
|
||||
_currentDropIndex = -1;
|
||||
_currentDragOperation = CPDragOperationNone;
|
||||
@@ -384,14 +391,7 @@ var HORIZONTAL_MARGIN = 2;
|
||||
_isSelectable = isSelectable;
|
||||
|
||||
if (!_isSelectable)
|
||||
{
|
||||
var index = CPNotFound,
|
||||
itemCount = [_items count];
|
||||
|
||||
// Be wary of invalid selection ranges since setContent: does not clear selection indexes.
|
||||
while ((index = [_selectionIndexes indexGreaterThanIndex:index]) != CPNotFound && index < itemCount)
|
||||
[_items[index] setSelected:NO];
|
||||
}
|
||||
[self _applySelectionToItems:NO];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -445,22 +445,15 @@ var HORIZONTAL_MARGIN = 2;
|
||||
{
|
||||
if (!anIndexSet)
|
||||
anIndexSet = [CPIndexSet indexSet];
|
||||
|
||||
if (!_isSelectable || [_selectionIndexes isEqual:anIndexSet])
|
||||
return;
|
||||
|
||||
var index = CPNotFound,
|
||||
itemCount = [_items count];
|
||||
|
||||
// Be wary of invalid selection ranges since setContent: does not clear selection indexes.
|
||||
while ((index = [_selectionIndexes indexGreaterThanIndex:index]) !== CPNotFound && index < itemCount)
|
||||
[_items[index] setSelected:NO];
|
||||
[self _applySelectionToItems:NO];
|
||||
|
||||
_selectionIndexes = anIndexSet;
|
||||
|
||||
var index = CPNotFound;
|
||||
|
||||
while ((index = [_selectionIndexes indexGreaterThanIndex:index]) !== CPNotFound)
|
||||
[_items[index] setSelected:YES];
|
||||
[self _applySelectionToItems:YES];
|
||||
|
||||
var binderClass = [[self class] _binderClassForBinding:@"selectionIndexes"];
|
||||
[[binderClass getBinding:@"selectionIndexes" forObject:self] reverseSetValueFor:@"selectionIndexes"];
|
||||
@@ -525,14 +518,14 @@ var HORIZONTAL_MARGIN = 2;
|
||||
|
||||
- (void)resizeWithOldSuperviewSize:(CGSize)oldBoundsSize
|
||||
{
|
||||
if (_lockResizing)
|
||||
if (_inLiveResize)
|
||||
return;
|
||||
|
||||
_lockResizing = YES;
|
||||
_inLiveResize = YES;
|
||||
|
||||
[self tile];
|
||||
|
||||
_lockResizing = NO;
|
||||
_inLiveResize = NO;
|
||||
}
|
||||
|
||||
- (void)tile
|
||||
@@ -972,6 +965,20 @@ var HORIZONTAL_MARGIN = 2;
|
||||
return frame;
|
||||
}
|
||||
|
||||
- (void)_applySelectionToItems:(BOOL)select
|
||||
{
|
||||
var numberOfItems = [_items count];
|
||||
|
||||
[_selectionIndexes enumerateIndexesUsingBlock:function(idx, stop)
|
||||
{
|
||||
if (idx < numberOfItems)
|
||||
[[_items objectAtIndex:idx] setSelected:select];
|
||||
else {
|
||||
stop(YES);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPCollectionView (DragAndDrop)
|
||||
@@ -1586,3 +1593,14 @@ var CPCollectionViewMinItemSizeKey = @"CPCollectionViewMinItemSizeK
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPCollectionViewContentBinder : CPBinder
|
||||
{
|
||||
}
|
||||
|
||||
- (void)setValue:(id)aValue forBinding:(CPString)aBinding
|
||||
{
|
||||
[_source setContent:aValue];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -116,7 +116,7 @@ if (typeof window !== "undefined" && window.opera)
|
||||
}
|
||||
|
||||
// Internet Explorer
|
||||
else if (typeof window !== "undefined" && window.attachEvent) // Must follow Opera check.
|
||||
else if (typeof window !== "undefined" && (window.attachEvent || (!(window.ActiveXObject) && "ActiveXObject" in window))) // Must follow Opera check.
|
||||
{
|
||||
PLATFORM_ENGINE = CPInternetExplorerBrowserEngine;
|
||||
|
||||
@@ -369,6 +369,18 @@ function CPBrowserStyleProperty(aProperty)
|
||||
r = candidates[PLATFORM_STYLE_JS_PROPERTIES['transform']] || nil;
|
||||
break;
|
||||
|
||||
case 'animationend':
|
||||
var candidates = {
|
||||
'WebkitAnimation' : 'webkitAnimationEnd',
|
||||
'MozAnimation' : 'animationend',
|
||||
'OAnimation' : 'oAnimationEnd',
|
||||
'msAnimation' : 'MSAnimationEnd',
|
||||
'animation' : 'animationend'
|
||||
};
|
||||
|
||||
r = candidates[PLATFORM_STYLE_JS_PROPERTIES['animation']] || nil;
|
||||
break;
|
||||
|
||||
default:
|
||||
var prefixes = ["Webkit", "Moz", "O", "ms"],
|
||||
strippedProperty = aProperty.split('-').join(' '),
|
||||
|
||||
@@ -192,6 +192,12 @@
|
||||
*/
|
||||
- (void)setEntityName:(CPString)newEntityName
|
||||
{
|
||||
if (!_managedProxy)
|
||||
{
|
||||
_managedProxy = [[_CPManagedProxy alloc] init];
|
||||
_isUsingManagedProxy = YES;
|
||||
}
|
||||
|
||||
[_managedProxy setEntityName:newEntityName];
|
||||
}
|
||||
|
||||
|
||||
+23
-3
@@ -847,7 +847,17 @@ CPPopUpButtonStatePullsDown = CPThemeState("pulls-down");
|
||||
{
|
||||
var count = [aValue count],
|
||||
options = [_info objectForKey:CPOptionsKey],
|
||||
offset = [self _getInsertNullOffset];
|
||||
offset = [self _getInsertNullOffset],
|
||||
selectedBindingInfo = [_source infoForBinding:CPSelectedObjectBinding],
|
||||
selectedObject = nil;
|
||||
|
||||
if (selectedBindingInfo)
|
||||
{
|
||||
var destination = [selectedBindingInfo objectForKey:CPObservedObjectKey],
|
||||
keyPath = [selectedBindingInfo objectForKey:CPObservedKeyPathKey];
|
||||
|
||||
selectedObject = [destination valueForKeyPath:keyPath];
|
||||
}
|
||||
|
||||
if (count + offset != [_source numberOfItems])
|
||||
{
|
||||
@@ -858,9 +868,19 @@ CPPopUpButtonStatePullsDown = CPThemeState("pulls-down");
|
||||
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var item = [[CPMenuItem alloc] initWithTitle:@"" action:NULL keyEquivalent:nil];
|
||||
[self _setValue:[aValue objectAtIndex:i] forItem:item withOptions:options];
|
||||
var item = [[CPMenuItem alloc] initWithTitle:@"" action:NULL keyEquivalent:nil],
|
||||
itemValue = [aValue objectAtIndex:i];
|
||||
|
||||
[self _setValue:itemValue forItem:item withOptions:options];
|
||||
[_source addItem:item];
|
||||
|
||||
// Select this item if it is the one selected by the selected object binding
|
||||
// This is needed if the selected object binding is set before the items
|
||||
// from the content binding
|
||||
if (itemValue === selectedObject)
|
||||
{
|
||||
[_source setSelectedIndex:[_source numberOfItems] - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -471,9 +471,11 @@ CPTransformableAttributeType = 1800;
|
||||
|
||||
var value;
|
||||
if (attributeType >= CPInteger16AttributeType && attributeType <= CPFloatAttributeType)
|
||||
value = [aView intValue];
|
||||
value = [aView floatValue];
|
||||
else if (attributeType == CPBooleanAttributeType)
|
||||
value = [aView state];
|
||||
else if (attributeType == CPDateAttributeType)
|
||||
value = [aView dateValue];
|
||||
else
|
||||
value = [aView stringValue];
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ var CPRuleEditorItemPBoardType = @"CPRuleEditorItemPBoardType",
|
||||
@"slice-top-border-color": [CPNull null],
|
||||
@"slice-bottom-border-color": [CPNull null],
|
||||
@"slice-last-bottom-border-color": [CPNull null],
|
||||
@"font": [CPNull null],
|
||||
@"font": [CPFont systemFontOfSize:12],
|
||||
@"font-color": [CPNull null],
|
||||
@"add-image": [CPNull null],
|
||||
@"remove-image": [CPNull null],
|
||||
|
||||
@@ -366,11 +366,12 @@
|
||||
count = [_ruleOptionViews count],
|
||||
sliceFrame = [self frame],
|
||||
image = [_ruleEditor _imageAdd],
|
||||
imageSize = image ? [image size] : CGSizeMake(0,0),
|
||||
|
||||
buttonFrame = CGRectMake(CGRectGetWidth(sliceFrame) - [image size].width - [self _rowButtonsRightHorizontalPadding], ([_ruleEditor rowHeight] - [image size].height) / 2 - 1, [image size].width, [image size].height);
|
||||
buttonFrame = CGRectMake(CGRectGetWidth(sliceFrame) - imageSize.width - [self _rowButtonsRightHorizontalPadding], ([_ruleEditor rowHeight] - imageSize.height) / 2 - 1, imageSize.width, imageSize.height);
|
||||
|
||||
[_addButton setFrame:buttonFrame];
|
||||
buttonFrame.origin.x -= [image size].width + [self _rowButtonsInterviewHorizontalPadding];
|
||||
buttonFrame.origin.x -= imageSize.width + [self _rowButtonsInterviewHorizontalPadding];
|
||||
[_subtractButton setFrame:buttonFrame];
|
||||
|
||||
if (widthChanged)
|
||||
|
||||
@@ -34,8 +34,7 @@ CPSearchFieldRecentsMenuItemTag = 1001;
|
||||
CPSearchFieldClearRecentsMenuItemTag = 1002;
|
||||
CPSearchFieldNoRecentsMenuItemTag = 1003;
|
||||
|
||||
var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotification",
|
||||
RECENT_SEARCH_PREFIX = @" ";
|
||||
var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotification";
|
||||
|
||||
/*!
|
||||
@ingroup appkit
|
||||
@@ -629,10 +628,10 @@ var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotificat
|
||||
|
||||
for (var recentIndex = 0; recentIndex < countOfRecents; ++recentIndex)
|
||||
{
|
||||
// RECENT_SEARCH_PREFIX is a hack until CPMenuItem -setIndentationLevel works
|
||||
var recentItem = [[CPMenuItem alloc] initWithTitle:RECENT_SEARCH_PREFIX + [_recentSearches objectAtIndex:recentIndex]
|
||||
var recentItem = [[CPMenuItem alloc] initWithTitle:[_recentSearches objectAtIndex:recentIndex]
|
||||
action:itemAction
|
||||
keyEquivalent:[item keyEquivalent]];
|
||||
[recentItem setIndentationLevel:1];
|
||||
[item setTarget:self];
|
||||
[menu addItem:recentItem];
|
||||
}
|
||||
@@ -718,7 +717,7 @@ var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotificat
|
||||
|
||||
- (void)_searchFieldSearch:(id)sender
|
||||
{
|
||||
var searchString = [[sender title] substringFromIndex:[RECENT_SEARCH_PREFIX length]];
|
||||
var searchString = [sender title];
|
||||
|
||||
if ([sender tag] != CPSearchFieldRecentsMenuItemTag)
|
||||
[self _addStringToRecentSearches:searchString];
|
||||
|
||||
@@ -466,9 +466,12 @@ var CPTableHeaderViewResizeZone = 3.0,
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
[self removeAllTrackingAreas];
|
||||
|
||||
|
||||
var options = CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow;
|
||||
|
||||
|
||||
if (!_tableView)
|
||||
return;
|
||||
|
||||
for (var i = 0; i < _tableView._tableColumns.length; i++)
|
||||
[self addTrackingArea:[[CPTrackingArea alloc] initWithRect:[self _cursorRectForColumn:i]
|
||||
options:options
|
||||
|
||||
+17
-11
@@ -644,12 +644,8 @@ NOT YET IMPLEMENTED
|
||||
}];
|
||||
}
|
||||
|
||||
// Reloads the views AND the data
|
||||
- (void)_reloadDataViews
|
||||
- (void)_setupReload
|
||||
{
|
||||
//if (!_dataSource)
|
||||
// return;
|
||||
|
||||
_reloadAllRows = YES;
|
||||
_objectValues = { };
|
||||
_cachedRowHeights = [];
|
||||
@@ -661,11 +657,24 @@ NOT YET IMPLEMENTED
|
||||
|
||||
// This updates the size too.
|
||||
[self noteNumberOfRowsChanged];
|
||||
}
|
||||
|
||||
// Reloads the views AND the data
|
||||
- (void)_reloadDataViews
|
||||
{
|
||||
[self _setupReload];
|
||||
[self setNeedsLayout];
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
// Reloads the views AND the data
|
||||
- (void)_reloadDataViewsSynchronously
|
||||
{
|
||||
[self _setupReload];
|
||||
[self layout];
|
||||
[self display];
|
||||
}
|
||||
|
||||
//Target-action Behavior
|
||||
/*!
|
||||
Sets the message sent to the target when the user double-clicks an
|
||||
@@ -4680,7 +4689,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
{
|
||||
if ([self _sendDelegateShouldEditTableColumn:column row:rowIndex])
|
||||
{
|
||||
[self editColumn:columnIndex row:rowIndex withEvent:nil select:YES];
|
||||
[self editColumn:columnIndex row:rowIndex withEvent:[CPApp currentEvent] select:YES];
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -5303,6 +5312,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
if ([aView isKindOfClass:[CPTextField class]])
|
||||
[aView setBezeled:editingState];
|
||||
}
|
||||
|
||||
/*!
|
||||
Edits the dataview at a given row and column. This method is usually invoked automatically and should rarely be invoked directly
|
||||
The row at supplied rowIndex must be selected otherwise an exception is thrown.
|
||||
@@ -5317,11 +5327,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
if (![self isRowSelected:rowIndex])
|
||||
[[CPException exceptionWithName:@"Error" reason:@"Attempt to edit row " + rowIndex + " when not selected." userInfo:nil] raise];
|
||||
|
||||
[self reloadData];
|
||||
|
||||
// Process all events immediately to make sure table data views are reloaded.
|
||||
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
|
||||
|
||||
[self _reloadDataViewsSynchronously];
|
||||
[self scrollRowToVisible:rowIndex];
|
||||
[self scrollColumnToVisible:columnIndex];
|
||||
|
||||
|
||||
@@ -94,7 +94,8 @@ function CPTextFieldBlurFunction(anEvent, owner, domElement, inputElement, resig
|
||||
inputElement.focus();
|
||||
|
||||
[owner _restorePreviousScrollingOrigin:previousScrollingOrigin];
|
||||
} argument:nil order:0 modes:[CPDefaultRunLoopMode]];
|
||||
}
|
||||
argument:nil order:0 modes:[CPDefaultRunLoopMode]];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -838,6 +839,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
[self _resignFirstKeyResponder];
|
||||
|
||||
_isEditing = NO;
|
||||
|
||||
if ([self isEditable])
|
||||
{
|
||||
[self textDidEndEditing:[CPNotification notificationWithName:CPControlTextDidEndEditingNotification object:self userInfo:@{"CPTextMovement": [self _currentTextMovement]}]];
|
||||
@@ -1213,7 +1215,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
- (void)textDidFocus:(CPNotification)note
|
||||
{
|
||||
// this looks to prevent false propagation of notifications for other objects
|
||||
if ([note object] != self)
|
||||
if ([note object] !== self)
|
||||
return;
|
||||
|
||||
if (_implementedDelegateMethods & CPTextFieldDelegate_controlTextDidFocus_)
|
||||
|
||||
+20
-11
@@ -243,6 +243,9 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
|
||||
CPMutableArray _trackingAreas @accessors(getter=trackingAreas, copy);
|
||||
BOOL _inhibitUpdateTrackingAreas;
|
||||
|
||||
id _animator;
|
||||
CPDictionary _animationsDictionary;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -389,6 +392,9 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
_DOMImageSizes = [];
|
||||
#endif
|
||||
|
||||
_animator = nil;
|
||||
_animationsDictionary = @{};
|
||||
|
||||
[self _setupViewFlags];
|
||||
[self _loadThemeAttributes];
|
||||
}
|
||||
@@ -2684,20 +2690,23 @@ setBoundsOrigin:
|
||||
return _needsLayout;
|
||||
}
|
||||
|
||||
- (void)layout
|
||||
{
|
||||
_needsLayout = NO;
|
||||
|
||||
if (_viewClassFlags & CPViewHasCustomViewWillLayout)
|
||||
[self viewWillLayout];
|
||||
|
||||
if (_viewClassFlags & CPViewHasCustomLayoutSubviews)
|
||||
[self layoutSubviews];
|
||||
|
||||
[self viewDidLayout];
|
||||
}
|
||||
|
||||
- (void)layoutIfNeeded
|
||||
{
|
||||
if (_needsLayout)
|
||||
{
|
||||
_needsLayout = NO;
|
||||
|
||||
if (_viewClassFlags & CPViewHasCustomViewWillLayout)
|
||||
[self viewWillLayout];
|
||||
|
||||
if (_viewClassFlags & CPViewHasCustomLayoutSubviews)
|
||||
[self layoutSubviews];
|
||||
|
||||
[self viewDidLayout];
|
||||
}
|
||||
[self layout];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -149,9 +149,10 @@ var CPViewControllerCachedCibs;
|
||||
|
||||
If you use Interface Builder to create your views, and you initialize the
|
||||
controller using the initWithCibName:bundle: methods, then you MUST NOT override
|
||||
this method. The consequences risk shattering the space-time continuum.
|
||||
this method.
|
||||
|
||||
Note: The cib loading system is currently synchronous.
|
||||
@note When using this method, the cib loading system is synchronous.
|
||||
See the loadViewWithCompletionHandler: method for an asynchronous loading.
|
||||
*/
|
||||
- (void)loadView
|
||||
{
|
||||
@@ -176,6 +177,67 @@ var CPViewControllerCachedCibs;
|
||||
_view = [CPView new];
|
||||
}
|
||||
|
||||
/*!
|
||||
Loads asynchronously the cib and creates the view that the controller manages.
|
||||
|
||||
@param aHandler A function passing the loaded view as the first argument
|
||||
and a network error or nil as the second argument: function(view, error).
|
||||
|
||||
@note If the view has already been loaded, the completion handler is run immediatly
|
||||
and the process is synchronous.
|
||||
*/
|
||||
- (void)loadViewWithCompletionHandler:(Function/*(view, error)*/)aHandler
|
||||
{
|
||||
if (_view)
|
||||
return;
|
||||
|
||||
if (_cibName)
|
||||
{
|
||||
// check if a cib is already cached for the current _cibName
|
||||
var cib = [CPViewControllerCachedCibs objectForKey:_cibName];
|
||||
|
||||
if (!cib)
|
||||
{
|
||||
var cibName = _cibName;
|
||||
|
||||
if (![cibName hasSuffix:@".cib"])
|
||||
cibName = [cibName stringByAppendingString:@".cib"];
|
||||
|
||||
// If aBundle is nil, use mainBundle, but ONLY for searching for the nib, not for resources later.
|
||||
var bundle = _cibBundle || [CPBundle mainBundle],
|
||||
url = [bundle _cibPathForResource:cibName];
|
||||
|
||||
// if the cib isn't cached yet : fetch it and cache it
|
||||
[CPURLConnection sendAsynchronousRequest:[CPURLRequest requestWithURL:url] queue:[CPOperationQueue mainQueue] completionHandler:function(aResponse, aData, anError)
|
||||
{
|
||||
if (anError == nil)
|
||||
{
|
||||
var data = [CPData dataWithRawString:aData],
|
||||
aCib = [[CPCib alloc] _initWithData:data bundle:_cibBundle cibName:_cibName];
|
||||
|
||||
[CPViewControllerCachedCibs setObject:aCib forKey:_cibName];
|
||||
[aCib instantiateCibWithExternalNameTable:_cibExternalNameTable];
|
||||
[self _viewDidLoadWithCompletionHandler:aHandler];
|
||||
}
|
||||
else
|
||||
{
|
||||
aHandler(nil, anError);
|
||||
}
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
[cib instantiateCibWithExternalNameTable:_cibExternalNameTable];
|
||||
[self _viewDidLoadWithCompletionHandler:aHandler];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_view = [CPView new];
|
||||
[self _viewDidLoadWithCompletionHandler:aHandler];
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the view that the controller manages.
|
||||
|
||||
@@ -223,9 +285,16 @@ var CPViewControllerCachedCibs;
|
||||
}
|
||||
|
||||
- (void)_viewDidLoad
|
||||
{
|
||||
[self _viewDidLoadWithCompletionHandler:function() {
|
||||
[self viewDidLoad];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)_viewDidLoadWithCompletionHandler:(Function)aHandler
|
||||
{
|
||||
[self willChangeValueForKey:"isViewLoaded"];
|
||||
[self viewDidLoad];
|
||||
aHandler(_view, nil);
|
||||
_isViewLoaded = YES;
|
||||
[self didChangeValueForKey:"isViewLoaded"];
|
||||
}
|
||||
|
||||
@@ -55,6 +55,18 @@ var CPCibObjectDataKey = @"CPCibObjectDataKey";
|
||||
id _loadDelegate;
|
||||
}
|
||||
|
||||
- (id)_initWithData:(CPData)data bundle:(CPBundle)aBundle cibName:(CPString)aCibName
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
_data = data;
|
||||
_cibName = aCibName;
|
||||
_bundle = aBundle;
|
||||
_awakenCustomResources = YES;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithContentsOfURL:(CPURL)aURL
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
@@ -30,8 +30,10 @@
|
||||
*/
|
||||
@implementation CAAnimation : CPObject
|
||||
{
|
||||
BOOL _isRemovedOnCompletion;
|
||||
id _delegate;
|
||||
BOOL _isRemovedOnCompletion;
|
||||
id _delegate;
|
||||
CAMediaTimingFunction _timingFunction @accessors(property=timingFunction);
|
||||
double _duration @accessors(property=duration);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -47,8 +49,10 @@
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
_isRemovedOnCompletion = YES;
|
||||
_isRemovedOnCompletion = YES;
|
||||
_timingFunction = nil;
|
||||
_duration = 0.0;
|
||||
_delegate = nil;
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -102,7 +106,7 @@
|
||||
- (CAMediaTimingFunction)timingFunction
|
||||
{
|
||||
// Linear Pacing
|
||||
return nil;
|
||||
return _timingFunction;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -127,131 +131,4 @@
|
||||
[anObject addAnimation:self forKey:aKey];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
@implementation CAPropertyAnimation : CAAnimation
|
||||
{
|
||||
CPString _keyPath;
|
||||
|
||||
BOOL _isCumulative;
|
||||
BOOL _isAdditive;
|
||||
}
|
||||
|
||||
+ (id)animationWithKeyPath:(CPString)aKeyPath
|
||||
{
|
||||
var animation = [self animation];
|
||||
|
||||
[animation setKeyPath:aKeyPath];
|
||||
|
||||
return animation;
|
||||
}
|
||||
|
||||
- (void)setKeyPath:(CPString)aKeyPath
|
||||
{
|
||||
_keyPath = aKeyPath;
|
||||
}
|
||||
|
||||
- (CPString)keyPath
|
||||
{
|
||||
return _keyPath;
|
||||
}
|
||||
|
||||
- (void)setCumulative:(BOOL)isCumulative
|
||||
{
|
||||
_isCumulative = isCumulative;
|
||||
}
|
||||
|
||||
- (BOOL)cumulative
|
||||
{
|
||||
return _isCumulative;
|
||||
}
|
||||
|
||||
- (BOOL)isCumulative
|
||||
{
|
||||
return _isCumulative;
|
||||
}
|
||||
|
||||
- (void)setAdditive:(BOOL)isAdditive
|
||||
{
|
||||
_isAdditive = isAdditive;
|
||||
}
|
||||
|
||||
- (BOOL)additive
|
||||
{
|
||||
return _isAdditive;
|
||||
}
|
||||
|
||||
- (BOOL)isAdditive
|
||||
{
|
||||
return _isAdditive;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/*!
|
||||
A CABasicAnimation is a simple animation that moves a
|
||||
CALayer from one point to another over a specified
|
||||
period of time.
|
||||
*/
|
||||
@implementation CABasicAnimation : CAPropertyAnimation
|
||||
{
|
||||
id _fromValue;
|
||||
id _toValue;
|
||||
id _byValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the starting position for the animation.
|
||||
@param aValue the animation starting position
|
||||
*/
|
||||
- (void)setFromValue:(id)aValue
|
||||
{
|
||||
_fromValue = aValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the animation's starting position.
|
||||
*/
|
||||
- (id)fromValue
|
||||
{
|
||||
return _fromValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the ending position for the animation.
|
||||
@param aValue the animation ending position
|
||||
*/
|
||||
- (void)setToValue:(id)aValue
|
||||
{
|
||||
_toValue = aValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the animation's ending position.
|
||||
*/
|
||||
- (id)toValue
|
||||
{
|
||||
return _toValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the optional byValue for animation interpolation.
|
||||
@param aValue the byValue
|
||||
*/
|
||||
- (void)setByValue:(id)aValue
|
||||
{
|
||||
_byValue = aValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the animation's byValue.
|
||||
*/
|
||||
- (id)byValue
|
||||
{
|
||||
return _byValue;
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
@@ -0,0 +1,84 @@
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
@import "CAPropertyAnimation.j"
|
||||
|
||||
/*!
|
||||
A CABasicAnimation is a simple animation that moves a
|
||||
CALayer from one point to another over a specified
|
||||
period of time.
|
||||
*/
|
||||
/*!
|
||||
A CABasicAnimation is a simple animation that moves a
|
||||
CALayer from one point to another over a specified
|
||||
period of time.
|
||||
*/
|
||||
@implementation CABasicAnimation : CAPropertyAnimation
|
||||
{
|
||||
id _fromValue;
|
||||
id _toValue;
|
||||
id _byValue;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
_fromValue = nil;
|
||||
_toValue = nil;
|
||||
_byValue = nil;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the starting position for the animation.
|
||||
@param aValue the animation starting position
|
||||
*/
|
||||
- (void)setFromValue:(id)aValue
|
||||
{
|
||||
_fromValue = aValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the animation's starting position.
|
||||
*/
|
||||
- (id)fromValue
|
||||
{
|
||||
return _fromValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the ending position for the animation.
|
||||
@param aValue the animation ending position
|
||||
*/
|
||||
- (void)setToValue:(id)aValue
|
||||
{
|
||||
_toValue = aValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the animation's ending position.
|
||||
*/
|
||||
- (id)toValue
|
||||
{
|
||||
return _toValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the optional byValue for animation interpolation.
|
||||
@param aValue the byValue
|
||||
*/
|
||||
- (void)setByValue:(id)aValue
|
||||
{
|
||||
_byValue = aValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the animation's byValue.
|
||||
*/
|
||||
- (id)byValue
|
||||
{
|
||||
return _byValue;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,23 @@
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
@import "CAPropertyAnimation.j"
|
||||
|
||||
@implementation CAKeyframeAnimation : CAPropertyAnimation
|
||||
{
|
||||
CPArray _values @accessors(property=values);
|
||||
CPArray _keyTimes @accessors(property=keyTimes);
|
||||
CPArray _timingFunctions @accessors(property=timingFunctions);
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
_values = [CPArray array];
|
||||
_keyTimes = [CPArray array];
|
||||
_timingFunctions = [CPArray array];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,74 @@
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
@import "CAAnimation.j"
|
||||
|
||||
@implementation CAPropertyAnimation : CAAnimation
|
||||
{
|
||||
CPString _keyPath;
|
||||
|
||||
BOOL _isCumulative;
|
||||
BOOL _isAdditive;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
_keyPath = nil;
|
||||
_isCumulative = NO;
|
||||
_isAdditive = NO;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (id)animationWithKeyPath:(CPString)aKeyPath
|
||||
{
|
||||
var animation = [self animation];
|
||||
|
||||
[animation setKeyPath:aKeyPath];
|
||||
|
||||
return animation;
|
||||
}
|
||||
|
||||
- (void)setKeyPath:(CPString)aKeyPath
|
||||
{
|
||||
_keyPath = aKeyPath;
|
||||
}
|
||||
|
||||
- (CPString)keyPath
|
||||
{
|
||||
return _keyPath;
|
||||
}
|
||||
|
||||
- (void)setCumulative:(BOOL)isCumulative
|
||||
{
|
||||
_isCumulative = isCumulative;
|
||||
}
|
||||
|
||||
- (BOOL)cumulative
|
||||
{
|
||||
return _isCumulative;
|
||||
}
|
||||
|
||||
- (BOOL)isCumulative
|
||||
{
|
||||
return _isCumulative;
|
||||
}
|
||||
|
||||
- (void)setAdditive:(BOOL)isAdditive
|
||||
{
|
||||
_isAdditive = isAdditive;
|
||||
}
|
||||
|
||||
- (BOOL)additive
|
||||
{
|
||||
return _isAdditive;
|
||||
}
|
||||
|
||||
- (BOOL)isAdditive
|
||||
{
|
||||
return _isAdditive;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,710 @@
|
||||
@import "CABasicAnimation.j"
|
||||
@import "CAKeyframeAnimation.j"
|
||||
@import "CPView.j"
|
||||
|
||||
@import <Foundation/CPTimer.j>
|
||||
|
||||
@import "jshashtable.j"
|
||||
@import "CSSAnimation.j"
|
||||
|
||||
@typedef HashTable;
|
||||
|
||||
var _CPAnimationContextStack = nil,
|
||||
_animationFlushingObserver = nil,
|
||||
_animationFrameUpdaters = {};
|
||||
|
||||
@implementation CPAnimationContext : CPObject
|
||||
{
|
||||
double _duration @accessors(property=duration);
|
||||
CAMediaTimingFunction _timingFunction @accessors(property=timingFunction);
|
||||
Function _completionHandlerAgent;
|
||||
HashTable _animationsByObject;
|
||||
}
|
||||
|
||||
+ (id)currentContext
|
||||
{
|
||||
var contextStack = [self contextStack],
|
||||
context = [contextStack lastObject];
|
||||
|
||||
if (!context)
|
||||
{
|
||||
context = [[CPAnimationContext alloc] init];
|
||||
|
||||
[contextStack addObject:context];
|
||||
[self _scheduleAnimationContextStackFlush];
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
+ (CPArray)contextStack
|
||||
{
|
||||
if (!_CPAnimationContextStack)
|
||||
_CPAnimationContextStack = [CPArray array];
|
||||
|
||||
return _CPAnimationContextStack;
|
||||
}
|
||||
|
||||
+ (void)runAnimationGroup:(Function/*(CPAnimationContext context)*/)animationsBlock completionHandler:(Function)aCompletionHandler
|
||||
{
|
||||
[CPAnimationContext beginGrouping];
|
||||
|
||||
var context = [CPAnimationContext currentContext];
|
||||
[context setCompletionHandler:aCompletionHandler];
|
||||
|
||||
animationsBlock(context);
|
||||
|
||||
[CPAnimationContext endGrouping];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
_duration = 0.0;
|
||||
_timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
|
||||
_completionHandlerAgent = nil;
|
||||
_animationsByObject = new Hashtable();
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)copy
|
||||
{
|
||||
var context = [[CPAnimationContext alloc] init];
|
||||
[context setDuration:[self duration]];
|
||||
[context setTimingFunction:[self timingFunction]];
|
||||
[context setCompletionHandler:[self completionHandler]];
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
+ (void)_scheduleAnimationContextStackFlush
|
||||
{
|
||||
if (!_animationFlushingObserver)
|
||||
{
|
||||
CPLog.debug("create new observer");
|
||||
_animationFlushingObserver = CFRunLoopObserverCreate(2, true, 0, _animationFlushingObserverCallback,0);
|
||||
CFRunLoopAddObserver([CPRunLoop mainRunLoop], _animationFlushingObserver);
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)beginGrouping
|
||||
{
|
||||
var newContext;
|
||||
|
||||
if ([_CPAnimationContextStack count])
|
||||
{
|
||||
var currentContext = [_CPAnimationContextStack lastObject];
|
||||
newContext = [currentContext copy];
|
||||
}
|
||||
else
|
||||
{
|
||||
newContext = [[CPAnimationContext alloc] init];
|
||||
}
|
||||
|
||||
[_CPAnimationContextStack addObject:newContext];
|
||||
}
|
||||
|
||||
+ (BOOL)endGrouping
|
||||
{
|
||||
if (![_CPAnimationContextStack count])
|
||||
return NO;
|
||||
|
||||
var context = [_CPAnimationContextStack lastObject];
|
||||
[context _flushAnimations];
|
||||
[_CPAnimationContextStack removeLastObject];
|
||||
|
||||
CPLog.debug(_cmd + "context stack =" + _CPAnimationContextStack);
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)_enqueueActionForObject:(id)anObject keyPath:(id)aKeyPath targetValue:(id)aTargetValue animationCompletion:(id)animationCompletion
|
||||
{
|
||||
var resolvedAction = [self _actionForObject:anObject keyPath:aKeyPath targetValue:aTargetValue animationCompletion:animationCompletion];
|
||||
|
||||
if (!resolvedAction)
|
||||
return;
|
||||
|
||||
var animByKeyPath = _animationsByObject.get(anObject);
|
||||
|
||||
if (!animByKeyPath)
|
||||
{
|
||||
var newAnimByKeyPath = @{aKeyPath:resolvedAction};
|
||||
_animationsByObject.put(anObject, newAnimByKeyPath);
|
||||
}
|
||||
else
|
||||
[animByKeyPath setObject:resolvedAction forKey:aKeyPath];
|
||||
}
|
||||
|
||||
- (Object)_actionForObject:(id)anObject keyPath:(CPString)aKeyPath targetValue:(id)aTargetValue animationCompletion:(Function)animationCompletion
|
||||
{
|
||||
var animation,
|
||||
duration,
|
||||
animatedKeyPath,
|
||||
values,
|
||||
keyTimes,
|
||||
timingFunctions,
|
||||
objectId;
|
||||
|
||||
if (!aKeyPath || !anObject || !(animation = [anObject animationForKey:aKeyPath]) || ![animation isKindOfClass:[CAAnimation class]])
|
||||
return nil;
|
||||
|
||||
duration = [animation duration] || [self duration];
|
||||
|
||||
var needsFrameTimer = (aKeyPath == @"frame" || aKeyPath == @"frameSize") &&
|
||||
([anObject hasCustomLayoutSubviews] || [anObject hasCustomDrawRect]) &&
|
||||
(objectId = [anObject UID]);
|
||||
|
||||
if (_completionHandlerAgent)
|
||||
_completionHandlerAgent.increment();
|
||||
|
||||
var completionFunction = function()
|
||||
{
|
||||
if (needsFrameTimer)
|
||||
[self stopFrameUpdaterWithIdentifier:objectId];
|
||||
else if (animationCompletion)
|
||||
animationCompletion();
|
||||
|
||||
if (_completionHandlerAgent)
|
||||
_completionHandlerAgent.decrement();
|
||||
};
|
||||
|
||||
if (![animation isKindOfClass:[CAPropertyAnimation class]] || !(animatedKeyPath = [animation keyPath]))
|
||||
animatedKeyPath = aKeyPath;
|
||||
|
||||
if ([animation isKindOfClass:[CAKeyframeAnimation class]])
|
||||
{
|
||||
values = [animation values];
|
||||
keyTimes = [animation keyTimes];
|
||||
timingFunctions = [animation timingFunctionsControlPoints];
|
||||
}
|
||||
else
|
||||
{
|
||||
var isBasicAnimation = [animation isKindOfClass:[CABasicAnimation class]],
|
||||
fromValue,
|
||||
toValue;
|
||||
|
||||
if (!isBasicAnimation || (fromValue = [animation fromValue]) == nil)
|
||||
fromValue = [anObject valueForKey:animatedKeyPath];
|
||||
|
||||
if (!isBasicAnimation || (toValue = [animation toValue]) == nil)
|
||||
toValue = aTargetValue;
|
||||
|
||||
values = [fromValue, toValue];
|
||||
keyTimes = [0, 1];
|
||||
timingFunctions = isBasicAnimation ? [animation timingFunctionControlPoints] : [_timingFunction controlPoints];
|
||||
}
|
||||
|
||||
return {
|
||||
object:anObject,
|
||||
keypath:animatedKeyPath,
|
||||
values:values,
|
||||
keytimes:keyTimes,
|
||||
duration:duration,
|
||||
timingfunctions:timingFunctions,
|
||||
completion:completionFunction
|
||||
};
|
||||
}
|
||||
|
||||
- (void)_flushAnimations
|
||||
{
|
||||
if (![_CPAnimationContextStack count])
|
||||
return;
|
||||
|
||||
if (_animationsByObject.size() == 0)
|
||||
{
|
||||
if (_completionHandlerAgent)
|
||||
_completionHandlerAgent.fire();
|
||||
}
|
||||
else
|
||||
[self _startAnimations];
|
||||
}
|
||||
|
||||
- (void)_startAnimations
|
||||
{
|
||||
var targetViews = _animationsByObject.keys(),
|
||||
cssAnimations = [],
|
||||
timers = [];
|
||||
|
||||
[targetViews enumerateObjectsUsingBlock:function(targetView, idx, stop)
|
||||
{
|
||||
var animByKeyPath = _animationsByObject.get(targetView);
|
||||
|
||||
[animByKeyPath enumerateKeysAndObjectsUsingBlock:function(aKey, anAction, stop)
|
||||
{
|
||||
[self getAnimations:cssAnimations getTimers:timers forView:targetView usingAction:anAction rootView:targetView cssAnimate:YES];
|
||||
}];
|
||||
|
||||
_animationsByObject.remove(targetView);
|
||||
}];
|
||||
|
||||
// start timers
|
||||
var k = timers.length;
|
||||
while(k--)
|
||||
{
|
||||
CPLog.debug("START TIMER " + timers[k].identifier());
|
||||
timers[k].start();
|
||||
}
|
||||
|
||||
// start css animations
|
||||
var n = cssAnimations.length;
|
||||
while(n--)
|
||||
{
|
||||
CPLog.debug("START ANIMATION " + cssAnimations[n].animationsnames);
|
||||
cssAnimations[n].start();
|
||||
}
|
||||
}
|
||||
|
||||
- (void)getAnimations:(CPArray)cssAnimations getTimers:(CPArray)timers forView:(CPView)aTargetView usingAction:(Object)anAction rootView:(CPView)rootView cssAnimate:(BOOL)needsCSSAnimation
|
||||
{
|
||||
var keyPath = anAction.keypath,
|
||||
isFrameKeyPath = (keyPath == @"frame" || keyPath == @"frameSize"),
|
||||
customLayout = [aTargetView hasCustomLayoutSubviews],
|
||||
customDrawing = [aTargetView hasCustomDrawRect],
|
||||
needsFrameTimer = isFrameKeyPath && (customLayout || customDrawing);
|
||||
|
||||
if (needsCSSAnimation)
|
||||
{
|
||||
var identifier = [aTargetView UID],
|
||||
duration = anAction.duration,
|
||||
timingFunctions = anAction.timingfunctions,
|
||||
properties = [],
|
||||
valueFunctions = [],
|
||||
cssAnimation = nil;
|
||||
|
||||
[cssAnimations enumerateObjectsUsingBlock:function(anim, idx, stop)
|
||||
{
|
||||
if (anim.identifier == identifier)
|
||||
{
|
||||
cssAnimation = anim;
|
||||
stop(YES);
|
||||
}
|
||||
}];
|
||||
|
||||
if (cssAnimation == nil)
|
||||
{
|
||||
var domElement = [aTargetView DOMElementForKeyPath:keyPath];
|
||||
cssAnimation = new CSSAnimation(domElement, identifier);
|
||||
cssAnimations.push(cssAnimation);
|
||||
}
|
||||
|
||||
var css_mapping = [[aTargetView class] cssPropertiesForKeyPath:keyPath];
|
||||
|
||||
[css_mapping enumerateObjectsUsingBlock:function(aDict, anIndex, stop)
|
||||
{
|
||||
var completionFunction = (anIndex == 0) ? anAction.completion : null;
|
||||
var property = [aDict objectForKey:@"property"],
|
||||
getter = [aDict objectForKey:@"value"];
|
||||
|
||||
cssAnimation.addPropertyAnimation(property, getter, duration, anAction.keytimes, anAction.values, timingFunctions, completionFunction);
|
||||
}];
|
||||
|
||||
if (needsFrameTimer)
|
||||
cssAnimation.setRemoveAnimationPropertyOnCompletion(false);
|
||||
}
|
||||
|
||||
if (needsFrameTimer)
|
||||
{
|
||||
var timer = [self addFrameUpdaterWithIdentifier:[rootView UID] forView:aTargetView keyPath:keyPath duration:anAction.duration];
|
||||
|
||||
if (timer)
|
||||
timers.push(timer);
|
||||
}
|
||||
|
||||
var subviews = [aTargetView subviews],
|
||||
count = [subviews count];
|
||||
|
||||
if (count && isFrameKeyPath)
|
||||
{
|
||||
var frameTimerId = [rootView UID],
|
||||
lastIndex = count - 1;
|
||||
|
||||
[subviews enumerateObjectsUsingBlock:function(aSubview, idx, stop)
|
||||
{
|
||||
var action = [self actionFromAction:anAction forAnimatedSubview:aSubview],
|
||||
targetFrame = [action.values lastObject];
|
||||
|
||||
if (CGRectEqualToRect([aSubview frame], targetFrame))
|
||||
return;
|
||||
|
||||
if ([aSubview hasCustomDrawRect])
|
||||
{
|
||||
action.completion = function()
|
||||
{
|
||||
[aSubview setFrame:targetFrame];
|
||||
CPLog.debug(aSubview + " setFrame: ");
|
||||
|
||||
if (idx == lastIndex)
|
||||
[self stopFrameUpdaterWithIdentifier:frameTimerId];
|
||||
};
|
||||
}
|
||||
|
||||
[self getAnimations:cssAnimations getTimers:timers forView:aSubview usingAction:action rootView:rootView cssAnimate:!customLayout];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (Object)actionFromAction:(Object)anAction forAnimatedSubview:(CPView)aView
|
||||
{
|
||||
var targetValue = [anAction.values lastObject],
|
||||
endFrame,
|
||||
values;
|
||||
|
||||
if (anAction.keypath == @"frame")
|
||||
targetValue = targetValue.size;
|
||||
|
||||
endFrame = [aView frameWithNewSuperviewSize:targetValue];
|
||||
values = [[aView frame], endFrame];
|
||||
|
||||
return {
|
||||
object:aView,
|
||||
keypath:"frame",
|
||||
values:values,
|
||||
keytimes:[0, 1],
|
||||
duration:anAction.duration,
|
||||
timingfunctions:anAction.timingFunctions
|
||||
};
|
||||
}
|
||||
|
||||
- (Function)addFrameUpdaterWithIdentifier:(CPString)anIdentifier forView:(CPView)aView keyPath:(CPString)aKeyPath duration:(float)aDuration
|
||||
{
|
||||
var frameUpdater = _animationFrameUpdaters[anIdentifier],
|
||||
result = nil;
|
||||
|
||||
if (frameUpdater == null)
|
||||
{
|
||||
frameUpdater = new FrameUpdater(anIdentifier);
|
||||
_animationFrameUpdaters[anIdentifier] = frameUpdater;
|
||||
result = frameUpdater;
|
||||
}
|
||||
|
||||
frameUpdater.addTarget(aView, aKeyPath, aDuration);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)stopFrameUpdaterWithIdentifier:(CPString)anIdentifier
|
||||
{
|
||||
var frameUpdater = _animationFrameUpdaters[anIdentifier];
|
||||
|
||||
if (frameUpdater)
|
||||
{
|
||||
frameUpdater.stop();
|
||||
delete _animationFrameUpdaters[anIdentifier];
|
||||
}
|
||||
else
|
||||
CPLog.warn("Could not find FrameUpdater with identifier " + anIdentifier);
|
||||
}
|
||||
|
||||
- (void)setCompletionHandler:(Function)aCompletionHandler
|
||||
{
|
||||
if (_completionHandlerAgent)
|
||||
_completionHandlerAgent.invalidate();
|
||||
|
||||
_completionHandlerAgent = aCompletionHandler ? (new CompletionHandlerAgent(aCompletionHandler)) : nil;
|
||||
}
|
||||
|
||||
- (void)completionHandler
|
||||
{
|
||||
if (!_completionHandlerAgent)
|
||||
return nil;
|
||||
|
||||
return _completionHandlerAgent.completionHandler();
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPView (CPAnimationContext)
|
||||
|
||||
- (CGRect)frameWithNewSuperviewSize:(CGSize)newSize
|
||||
{
|
||||
var mask = [self autoresizingMask];
|
||||
|
||||
if (mask == CPViewNotSizable)
|
||||
return _frame;
|
||||
|
||||
var oldSize = _superview._frame.size,
|
||||
newFrame = CGRectMakeCopy(_frame),
|
||||
dX = newSize.width - oldSize.width,
|
||||
dY = newSize.height - oldSize.height,
|
||||
evenFractionX = 1.0 / ((mask & CPViewMinXMargin ? 1 : 0) + (mask & CPViewWidthSizable ? 1 : 0) + (mask & CPViewMaxXMargin ? 1 : 0)),
|
||||
evenFractionY = 1.0 / ((mask & CPViewMinYMargin ? 1 : 0) + (mask & CPViewHeightSizable ? 1 : 0) + (mask & CPViewMaxYMargin ? 1 : 0)),
|
||||
baseX = (mask & CPViewMinXMargin ? _frame.origin.x : 0) +
|
||||
(mask & CPViewWidthSizable ? _frame.size.width : 0) +
|
||||
(mask & CPViewMaxXMargin ? oldSize.width - _frame.size.width - _frame.origin.x : 0),
|
||||
baseY = (mask & CPViewMinYMargin ? _frame.origin.y : 0) +
|
||||
(mask & CPViewHeightSizable ? _frame.size.height : 0) +
|
||||
(mask & CPViewMaxYMargin ? oldSize.height - _frame.size.height - _frame.origin.y : 0);
|
||||
|
||||
|
||||
if (mask & CPViewMinXMargin)
|
||||
newFrame.origin.x += dX * (baseX > 0 ? _frame.origin.x / baseX : evenFractionX);
|
||||
if (mask & CPViewWidthSizable)
|
||||
newFrame.size.width += dX * (baseX > 0 ? _frame.size.width / baseX : evenFractionX);
|
||||
|
||||
if (mask & CPViewMinYMargin)
|
||||
newFrame.origin.y += dY * (baseY > 0 ? _frame.origin.y / baseY : evenFractionY);
|
||||
if (mask & CPViewHeightSizable)
|
||||
newFrame.size.height += dY * (baseY > 0 ? _frame.size.height / baseY : evenFractionY);
|
||||
|
||||
return newFrame;
|
||||
}
|
||||
|
||||
- (BOOL)hasCustomDrawRect
|
||||
{
|
||||
return self._viewClassFlags & 1;
|
||||
}
|
||||
|
||||
- (BOOL)hasCustomLayoutSubviews
|
||||
{
|
||||
return self._viewClassFlags & 2;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CAMediaTimingFunction (Additions)
|
||||
|
||||
- (CPArray)controlPoints
|
||||
{
|
||||
return [_c1x, _c1y, _c2x, _c2y];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CAAnimation (Additions)
|
||||
|
||||
- (CPArray)timingFunctionControlPoints
|
||||
{
|
||||
if (_timingFunction)
|
||||
return [_timingFunction controlPoints];
|
||||
|
||||
return [0, 0, 1, 1];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CAKeyframeAnimation (Additions)
|
||||
|
||||
- (CPArray)timingFunctionsControlPoints
|
||||
{
|
||||
var result = [CPArray array];
|
||||
|
||||
[_timingFunctions enumerateObjectsUsingBlock:function(timingFunction, idx)
|
||||
{
|
||||
[result addObject:[timingFunction controlPoints]];
|
||||
}];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CompletionHandlerAgent = function(aCompletionHandler)
|
||||
{
|
||||
this._completionHandler = aCompletionHandler;
|
||||
this.total = 0;
|
||||
this.valid = true;
|
||||
};
|
||||
|
||||
CompletionHandlerAgent.prototype.completionHandler = function()
|
||||
{
|
||||
return this._completionHandler;
|
||||
};
|
||||
|
||||
CompletionHandlerAgent.prototype.fire = function()
|
||||
{
|
||||
this._completionHandler();
|
||||
};
|
||||
|
||||
CompletionHandlerAgent.prototype.increment = function()
|
||||
{
|
||||
this.total++;
|
||||
};
|
||||
|
||||
CompletionHandlerAgent.prototype.decrement = function()
|
||||
{
|
||||
if (this.total <= 0)
|
||||
return;
|
||||
|
||||
this.total--;
|
||||
|
||||
if (this.valid && this.total == 0)
|
||||
{
|
||||
this.fire();
|
||||
}
|
||||
};
|
||||
|
||||
CompletionHandlerAgent.prototype.invalidate = function()
|
||||
{
|
||||
this.valid = false;
|
||||
};
|
||||
|
||||
var _animationFlushingObserverCallback = function()
|
||||
{
|
||||
CPLog.debug("_animationFlushingObserverCallback");
|
||||
if ([_CPAnimationContextStack count] == 1)
|
||||
{
|
||||
var context = [_CPAnimationContextStack lastObject];
|
||||
[context _flushAnimations];
|
||||
[_CPAnimationContextStack removeLastObject];
|
||||
}
|
||||
|
||||
CPLog.debug("_animationFlushingObserver "+_animationFlushingObserver+" stack:" + [_CPAnimationContextStack count]);
|
||||
|
||||
if (_animationFlushingObserver && ![_CPAnimationContextStack count])
|
||||
{
|
||||
CPLog.debug("removeObserver");
|
||||
CFRunLoopObserverInvalidate([CPRunLoop mainRunLoop], _animationFlushingObserver);
|
||||
_animationFlushingObserver = nil;
|
||||
}
|
||||
};
|
||||
|
||||
CFRunLoopObserver = function(activities, repeats, order, callout, context)
|
||||
{
|
||||
this.activities = activities;
|
||||
this.repeats = repeats;
|
||||
this.order = order;
|
||||
this.callout = callout;
|
||||
this.context = context;
|
||||
|
||||
this.isvalid = true;
|
||||
};
|
||||
|
||||
CFRunLoopObserverCreate = function(activities, repeats, order, callout, context)
|
||||
{
|
||||
return new CFRunLoopObserver(activities, repeats, order, callout, context);
|
||||
};
|
||||
|
||||
CFRunLoopAddObserver = function(runloop, observer, mode)
|
||||
{
|
||||
var observers = runloop._observers;
|
||||
|
||||
if (!observers)
|
||||
observers = (runloop._observers = []);
|
||||
|
||||
if (observers.indexOf(observer) == -1)
|
||||
observers.push(observer);
|
||||
};
|
||||
|
||||
CFRunLoopObserverInvalidate = function(runloop, observer, mode)
|
||||
{
|
||||
CFRunLoopRemoveObserver(runloop, observer, mode);
|
||||
};
|
||||
|
||||
CFRunLoopRemoveObserver = function(runloop, observer, mode)
|
||||
{
|
||||
var observers = runloop._observers;
|
||||
if (observers)
|
||||
{
|
||||
var idx = observers.indexOf(observer);
|
||||
if (idx !== -1)
|
||||
{
|
||||
observers.splice(idx, 1);
|
||||
|
||||
if (observers.length == 0)
|
||||
runloop._observers = nil;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var FrameUpdater = function(anIdentifier)
|
||||
{
|
||||
this._identifier = anIdentifier;
|
||||
this._duration = 0;
|
||||
this._stop = false;
|
||||
this._targets = [];
|
||||
this._callbacks = [];
|
||||
var frameUpdater = this;
|
||||
|
||||
this._updateFunction = function(timestamp)
|
||||
{
|
||||
if (frameUpdater._stop)
|
||||
return;
|
||||
|
||||
if (this._startDate == null)
|
||||
this._startDate = timestamp;
|
||||
|
||||
for (var i = 0; i < frameUpdater._callbacks.length; i++)
|
||||
frameUpdater._callbacks[i]();
|
||||
|
||||
if (timestamp - this._startDate < frameUpdater._duration * 1000)
|
||||
window.requestAnimationFrame(frameUpdater._updateFunction);
|
||||
};
|
||||
};
|
||||
|
||||
FrameUpdater.prototype.start = function()
|
||||
{
|
||||
window.requestAnimationFrame(this._updateFunction);
|
||||
};
|
||||
|
||||
FrameUpdater.prototype.stop = function()
|
||||
{
|
||||
CPLog.debug("stop FrameUpdater with id " + this.identifier());
|
||||
|
||||
this._stop = true;
|
||||
|
||||
var targets = this._targets;
|
||||
|
||||
for (var i = 0; i < targets.length; i++)
|
||||
{
|
||||
CPLog.debug(targets[i] + " Remove animation-name property");
|
||||
targets[i]._DOMElement.style.removeProperty(CPBrowserCSSProperty("animation-name"));
|
||||
}
|
||||
};
|
||||
|
||||
FrameUpdater.prototype.updateFunction = function()
|
||||
{
|
||||
return this._updateFunction;
|
||||
};
|
||||
|
||||
FrameUpdater.prototype.identifier = function()
|
||||
{
|
||||
return this._identifier;
|
||||
};
|
||||
|
||||
FrameUpdater.prototype.addTarget = function(target, keyPath, duration)
|
||||
{
|
||||
var callback = createUpdateFrame(target, keyPath);
|
||||
|
||||
if (callback)
|
||||
{
|
||||
this._duration = MAX(this._duration, duration);
|
||||
this._targets.push(target);
|
||||
this._callbacks.push(callback);
|
||||
}
|
||||
};
|
||||
|
||||
var createUpdateFrame = function(aView, aKeyPath)
|
||||
{
|
||||
if (aKeyPath !== "frame" && aKeyPath !== "frameSize")
|
||||
return nil;
|
||||
|
||||
var style = getComputedStyle(aView._DOMElement),
|
||||
getCSSPropertyValue = function(prop) {
|
||||
return ROUND(parseFloat(style.getPropertyValue(prop)));
|
||||
};
|
||||
|
||||
var updateFrame = function(timestamp)
|
||||
{
|
||||
var width = getCSSPropertyValue("width"),
|
||||
height = getCSSPropertyValue("height");
|
||||
|
||||
if (aKeyPath == "frame")
|
||||
{
|
||||
var left = getCSSPropertyValue("left"),
|
||||
top = getCSSPropertyValue("top"),
|
||||
frame = CGRectMake(left, top, width, height);
|
||||
|
||||
[aView setFrame:frame];
|
||||
}
|
||||
else if (aKeyPath == "frameSize")
|
||||
{
|
||||
[aView setFrameSize:CGSizeMake(width, height)];
|
||||
}
|
||||
|
||||
[[CPRunLoop currentRunLoop] performSelectors];
|
||||
};
|
||||
|
||||
return updateFrame;
|
||||
};
|
||||
@@ -0,0 +1,222 @@
|
||||
|
||||
@import "_CPObjectAnimator.j"
|
||||
@import "CPView.j"
|
||||
|
||||
@implementation CPViewAnimator : _CPObjectAnimator
|
||||
{
|
||||
}
|
||||
|
||||
- (void)viewWillMoveToSuperview:(CPView)aSuperview
|
||||
{
|
||||
var orderInAnim = [self animationForKey:@"CPAnimationTriggerOrderIn"];
|
||||
|
||||
if (orderInAnim && [orderInAnim isKindOfClass:[CAPropertyAnimation class]])
|
||||
{
|
||||
[_target setValue:[orderInAnim fromValue] forKeyPath:[orderInAnim keyPath]];
|
||||
}
|
||||
|
||||
[_target viewWillMoveToSuperview:aSuperview];
|
||||
}
|
||||
|
||||
- (void)viewDidMoveToSuperview
|
||||
{
|
||||
var orderInAnim = [self animationForKey:@"CPAnimationTriggerOrderIn"];
|
||||
|
||||
if (orderInAnim && [orderInAnim isKindOfClass:[CAPropertyAnimation class]])
|
||||
{
|
||||
[self _setTargetValue:YES withKeyPath:@"CPAnimationTriggerOrderIn" fallback:nil completion:function()
|
||||
{
|
||||
[_target setValue:[orderInAnim toValue] forKeyPath:[orderInAnim keyPath]];
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
[_target viewDidMoveToSuperview];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeFromSuperview
|
||||
{
|
||||
[self _setTargetValue:nil withKeyPath:@"CPAnimationTriggerOrderOut" setter:_cmd];
|
||||
}
|
||||
|
||||
- (void)setHidden:(BOOL)shouldHide
|
||||
{
|
||||
if ([_target isHidden] == shouldHide)
|
||||
return;
|
||||
|
||||
if (shouldHide == NO)
|
||||
return [_target setHidden:NO];
|
||||
|
||||
[self _setTargetValue:YES withKeyPath:@"CPAnimationTriggerOrderOut" setter:_cmd];
|
||||
}
|
||||
|
||||
- (void)setAlphaValue:(CGPoint)alphaValue
|
||||
{
|
||||
[self _setTargetValue:alphaValue withKeyPath:@"alphaValue" setter:_cmd];
|
||||
}
|
||||
|
||||
- (void)setBackgroundColor:(CPColor)aColor
|
||||
{
|
||||
[self _setTargetValue:aColor withKeyPath:@"backgroundColor" setter:_cmd];
|
||||
}
|
||||
|
||||
- (void)setFrameOrigin:(CGPoint)aFrameOrigin
|
||||
{
|
||||
[self _setTargetValue:aFrameOrigin withKeyPath:@"frameOrigin" setter:_cmd];
|
||||
}
|
||||
|
||||
- (void)setFrame:(CGRect)aFrame
|
||||
{
|
||||
[self _setTargetValue:aFrame withKeyPath:@"frame" setter:_cmd];
|
||||
}
|
||||
|
||||
- (void)setFrameSize:(CGSize)aFrameSize
|
||||
{
|
||||
[self _setTargetValue:aFrameSize withKeyPath:@"frameSize" setter:_cmd];
|
||||
}
|
||||
|
||||
// Convenience method for the common case where the setter has zero or one argument
|
||||
- (void)_setTargetValue:(id)aTargetValue withKeyPath:(CPString)aKeyPath setter:(SEL)aSelector
|
||||
{
|
||||
var handler = function()
|
||||
{
|
||||
[_target performSelector:aSelector withObject:aTargetValue];
|
||||
};
|
||||
|
||||
[self _setTargetValue:aTargetValue withKeyPath:aKeyPath fallback:handler completion:handler];
|
||||
}
|
||||
|
||||
- (void)_setTargetValue:(id)aTargetValue withKeyPath:(CPString)aKeyPath fallback:(Function)fallback completion:(Function)completion
|
||||
{
|
||||
var animation = [_target animationForKey:aKeyPath],
|
||||
context = [CPAnimationContext currentContext];
|
||||
|
||||
if (!animation || ![animation isKindOfClass:[CAAnimation class]] || (![context duration] && ![animation duration]) || ![_CPObjectAnimator supportsCSSAnimations])
|
||||
{
|
||||
if (fallback)
|
||||
fallback();
|
||||
}
|
||||
else
|
||||
{
|
||||
[context _enqueueActionForObject:_target keyPath:aKeyPath targetValue:aTargetValue animationCompletion:completion];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var transformOrigin = function(start, current)
|
||||
{
|
||||
return "translate(" + (current.x - start.x) + "px," + (current.y - start.y) + "px)";
|
||||
};
|
||||
|
||||
var transformFrameToTranslate = function(start, current)
|
||||
{
|
||||
return transformOrigin(start.origin, current.origin);
|
||||
};
|
||||
|
||||
var transformFrameToWidth = function(start, current)
|
||||
{
|
||||
return current.size.width + "px";
|
||||
};
|
||||
|
||||
var transformFrameToHeight = function(start, current)
|
||||
{
|
||||
return current.size.height + "px";
|
||||
};
|
||||
|
||||
var transformSizeToWidth = function(start, current)
|
||||
{
|
||||
return current.width + "px";
|
||||
};
|
||||
|
||||
var transformSizeToHeight = function(start, current)
|
||||
{
|
||||
return current.height + "px";
|
||||
};
|
||||
|
||||
var DEFAULT_CSS_PROPERTIES = nil;
|
||||
|
||||
@implementation CPView (CPAnimatablePropertyContainer)
|
||||
|
||||
+ (CPDictionary)defaultCSSProperties
|
||||
{
|
||||
if (DEFAULT_CSS_PROPERTIES == nil)
|
||||
{
|
||||
var transformProperty = CPBrowserCSSProperty("transform");
|
||||
|
||||
DEFAULT_CSS_PROPERTIES = @{
|
||||
"backgroundColor" : [@{"property":"background", "value":function(sv, val){return [val cssString];}}],
|
||||
"alphaValue" : [@{"property":"opacity"}],
|
||||
"frame" : [@{"property":transformProperty, "value":transformFrameToTranslate},
|
||||
@{"property":"width", "value":transformFrameToWidth},
|
||||
@{"property":"height", "value":transformFrameToHeight}],
|
||||
"frameOrigin" : [@{"property":transformProperty, "value":transformOrigin}],
|
||||
"frameSize" : [@{"property":"width", "value":transformSizeToWidth},
|
||||
@{"property":"height", "value":transformSizeToHeight}]
|
||||
};
|
||||
}
|
||||
|
||||
return DEFAULT_CSS_PROPERTIES;
|
||||
}
|
||||
|
||||
+ (CPArray)cssPropertiesForKeyPath:(CPString)aKeyPath
|
||||
{
|
||||
return [[self defaultCSSProperties] objectForKey:aKeyPath];
|
||||
}
|
||||
|
||||
+ (Class)animatorClass
|
||||
{
|
||||
var anim_class = CPClassFromString(CPStringFromClass(self) + "Animator");
|
||||
|
||||
if (anim_class)
|
||||
return anim_class;
|
||||
|
||||
return [[self superclass] animatorClass];
|
||||
}
|
||||
|
||||
- (id)animator
|
||||
{
|
||||
if (!_animator)
|
||||
_animator = [[[[self class] animatorClass] alloc] initWithTarget:self];
|
||||
|
||||
return _animator;
|
||||
}
|
||||
|
||||
- (id)DOMElementForKeyPath:(CPString)aKeyPath
|
||||
{
|
||||
return _DOMElement;
|
||||
}
|
||||
|
||||
+ (CAAnimation)defaultAnimationForKey:(CPString)aKey
|
||||
{
|
||||
if ([self cssPropertiesForKeyPath:aKey] !== nil)
|
||||
return [CAAnimation animation];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (CAAnimation)animationForKey:(CPString)aKey
|
||||
{
|
||||
var animations = [self animations],
|
||||
animation = nil;
|
||||
|
||||
if (!animations || !(animation = [animations objectForKey:aKey]))
|
||||
{
|
||||
animation = [[self class] defaultAnimationForKey:aKey];
|
||||
}
|
||||
|
||||
return animation;
|
||||
}
|
||||
|
||||
- (CPDictionary)animations
|
||||
{
|
||||
return _animationsDictionary;
|
||||
}
|
||||
|
||||
- (void)setAnimations:(CPDictionary)animationsDict
|
||||
{
|
||||
_animationsDictionary = [animationsDict copy];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,288 @@
|
||||
|
||||
var ANIMATIONS_GLOBAL_ID = 0,
|
||||
CURRENT_ANIMATIONS = {},
|
||||
|
||||
ANIMATION_END_EVENT_NAME,
|
||||
ANIMATION__PROPERTY,
|
||||
ANIMATION_NAME_PROPERTY,
|
||||
ANIMATION_DURATION_PROPERTY,
|
||||
ANIMATION_TIMING_FUNCTION_PROPERTY,
|
||||
ANIMATION_FILL_MODE_PROPERTY,
|
||||
ANIMATION_KEYFRAMES_RULE;
|
||||
|
||||
var defineCSSProperties = function()
|
||||
{
|
||||
if (this.done)
|
||||
return;
|
||||
|
||||
ANIMATION_END_EVENT_NAME = CPBrowserStyleProperty("animationend"),
|
||||
ANIMATION_PROPERTY = CPBrowserCSSProperty("animation"),
|
||||
ANIMATION_NAME_PROPERTY = CPBrowserCSSProperty("animation-name"),
|
||||
ANIMATION_DURATION_PROPERTY = CPBrowserCSSProperty("animation-duration"),
|
||||
ANIMATION_TIMING_FUNCTION_PROPERTY = CPBrowserCSSProperty("animation-timing-function"),
|
||||
ANIMATION_FILL_MODE_PROPERTY = CPBrowserCSSProperty("animation-fill-mode"),
|
||||
ANIMATION_KEYFRAMES_RULE = "@" + ANIMATION_PROPERTY.substring(0, ANIMATION_PROPERTY.indexOf("animation")) + "keyframes";
|
||||
|
||||
this.done = true;
|
||||
}
|
||||
|
||||
CSSAnimation = function(aTarget/*DOM Element*/, anIdentifier)
|
||||
{
|
||||
defineCSSProperties();
|
||||
|
||||
if (!anIdentifier)
|
||||
anIdentifier = ANIMATIONS_GLOBAL_ID++;
|
||||
|
||||
var animationName = "anim_" + anIdentifier,
|
||||
animation = CURRENT_ANIMATIONS[anIdentifier];
|
||||
|
||||
if (animation)
|
||||
console.warn("Animation "+ anIdentifier + " is already in use. Ignoring.");
|
||||
else
|
||||
{
|
||||
this.target = aTarget;
|
||||
this.identifier = anIdentifier;
|
||||
this.animationName = animationName;
|
||||
this.listener = null;
|
||||
this.styleElement = null;
|
||||
this.propertyanimations = [];
|
||||
this.animationsnames = [];
|
||||
this.animationstimingfunctions = [];
|
||||
this.animationsdurations = [];
|
||||
this.islive = false;
|
||||
this.didBuildDOMElements = false;
|
||||
this.removeAnimationPropertyOnCompletion = true;
|
||||
|
||||
animation = this;
|
||||
CURRENT_ANIMATIONS[anIdentifier] = animation;
|
||||
}
|
||||
|
||||
return animation;
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.addPropertyAnimation = function(propertyName/*String*/, valueFunction/*Function*/, aDuration/*float*/, aKeyTimes/*d, [d]*/, aValues/*Array*/, aTimingFunctions/*[d,d,d,d],[[d,d,d,d]]*/, aCompletionfunction/*Function*/)
|
||||
{
|
||||
if (this.islive)
|
||||
return false;
|
||||
// TODO: If a property already exist, replace its values & valueFunctions.
|
||||
|
||||
var name = this.animationName + "_" + propertyName;
|
||||
|
||||
var animation = {name:name,
|
||||
property:propertyName,
|
||||
valuefunction:valueFunction,
|
||||
keytimes:aKeyTimes,
|
||||
values:aValues,
|
||||
duration:aDuration,
|
||||
completionfunction:aCompletionfunction};
|
||||
|
||||
var animationTimingFunction;
|
||||
if (aTimingFunctions && (aTimingFunctions[0] instanceof Array))
|
||||
{
|
||||
animation.keyframestimingFunctions = aTimingFunctions;
|
||||
// dummy timing function overriden by keyframes timings functions
|
||||
animationTimingFunction = "linear";
|
||||
}
|
||||
else
|
||||
animationTimingFunction = "cubic-bezier(" + aTimingFunctions + ")";
|
||||
|
||||
this.animationstimingfunctions.push(animationTimingFunction);
|
||||
|
||||
this.propertyanimations.push(animation);
|
||||
this.animationsnames.push(name);
|
||||
this.animationsdurations.push(aDuration + "s");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.keyFrames = function()
|
||||
{
|
||||
var keyframesRules = [];
|
||||
|
||||
var count = this.propertyanimations.length;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var animation = this.propertyanimations[i],
|
||||
property = animation.property,
|
||||
valuefunction = animation.valuefunction,
|
||||
keytimes = animation.keytimes,
|
||||
values = animation.values,
|
||||
timingFunctions = animation.keyframestimingFunctions;
|
||||
|
||||
var keyframes = [],
|
||||
keytimescount = keytimes.length,
|
||||
start_value = values[0];
|
||||
|
||||
for (var j = 0; j < keytimescount; j++)
|
||||
{
|
||||
var keytime = keytimes[j],
|
||||
value = values[j],
|
||||
timingFunction;
|
||||
|
||||
if (valuefunction !== nil)
|
||||
value = valuefunction(start_value, value);
|
||||
|
||||
var keyframeContent = property + ": " + value + ";";
|
||||
|
||||
if (timingFunctions && timingFunctions.length && (timingFunction = timingFunctions[j]))
|
||||
{
|
||||
keyframeContent += ANIMATION_TIMING_FUNCTION_PROPERTY + ":cubic-bezier(" + timingFunction + ");";
|
||||
}
|
||||
|
||||
var keyframe = "\t" + Math.round(keytime * 100) + "% {\n\t\t" + keyframeContent + "\n\t}\n";
|
||||
keyframes.push(keyframe);
|
||||
}
|
||||
// TODO ! Add keyframe rule to CPCompatibility
|
||||
var rule = ANIMATION_KEYFRAMES_RULE + " " + animation.name + " {\n" + keyframes.join(" ") + "}\n";
|
||||
keyframesRules.push(rule);
|
||||
}
|
||||
|
||||
return keyframesRules.join("\n");
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.appendKeyFramesRule = function()
|
||||
{
|
||||
var styleElement = this.createKeyFramesStyleElement(),
|
||||
keyframesText = this.keyFrames(),
|
||||
nodeText = document.createTextNode(keyframesText);
|
||||
|
||||
styleElement.appendChild(nodeText);
|
||||
document.head.appendChild(styleElement);
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.createKeyFramesStyleElement = function()
|
||||
{
|
||||
if (!this.styleElement)
|
||||
{
|
||||
var styleElement = document.createElement("style");
|
||||
styleElement.setAttribute("type", "text/css");
|
||||
|
||||
this.styleElement = styleElement;
|
||||
}
|
||||
|
||||
return this.styleElement;
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.endEventListener = function()
|
||||
{
|
||||
var animation = this,
|
||||
animationsNames = this.animationsnames,
|
||||
inFlightAnimationsNames = animationsNames.slice();
|
||||
|
||||
if (!animation.listener)
|
||||
{
|
||||
var AnimationEndListener = function(event)
|
||||
{
|
||||
var idx = inFlightAnimationsNames.indexOf(event.animationName);
|
||||
if (idx !== -1)
|
||||
inFlightAnimationsNames.splice(idx, 1);
|
||||
|
||||
if (inFlightAnimationsNames.length == 0)
|
||||
{
|
||||
for (var i = 0; i < animationsNames.length; i++)
|
||||
{
|
||||
var completion = animation.completionFunctionForAnimationName(animationsNames[i]);
|
||||
if (completion)
|
||||
completion();
|
||||
}
|
||||
|
||||
var eventTarget = event.target,
|
||||
style = eventTarget.style;
|
||||
|
||||
if (animation.removeAnimationPropertyOnCompletion)
|
||||
style.removeProperty(ANIMATION_NAME_PROPERTY);
|
||||
|
||||
style.removeProperty(ANIMATION_DURATION_PROPERTY);
|
||||
style.removeProperty(ANIMATION_FILL_MODE_PROPERTY);
|
||||
style.removeProperty("-webkit-backface-visibility");
|
||||
|
||||
if (animation.animationstimingfunctions.length)
|
||||
style.removeProperty(ANIMATION_TIMING_FUNCTION_PROPERTY);
|
||||
|
||||
removeFromParent(animation.styleElement);
|
||||
|
||||
eventTarget.removeEventListener(ANIMATION_END_EVENT_NAME, AnimationEndListener);
|
||||
animation.listener = null;
|
||||
delete (CURRENT_ANIMATIONS[animation.identifier]);
|
||||
}
|
||||
};
|
||||
|
||||
this.listener = AnimationEndListener;
|
||||
}
|
||||
|
||||
return this.listener;
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.completionFunctionForAnimationName = function(aName)
|
||||
{
|
||||
var propanims = this.propertyanimations,
|
||||
count = propanims.length;
|
||||
|
||||
while (count--)
|
||||
{
|
||||
var anim = propanims[count];
|
||||
if (anim.name == aName)
|
||||
return anim.completionfunction;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.addAnimationEndEventListener = function()
|
||||
{
|
||||
var listener = this.endEventListener();
|
||||
this.target.addEventListener(ANIMATION_END_EVENT_NAME, listener, false);
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.setTargetStyleProperties = function()
|
||||
{
|
||||
var style = this.target.style;
|
||||
|
||||
if (this.animationstimingfunctions.length)
|
||||
style.setProperty(ANIMATION_TIMING_FUNCTION_PROPERTY, this.animationstimingfunctions.join(","));
|
||||
|
||||
style.setProperty(ANIMATION_DURATION_PROPERTY, this.animationsdurations.join(","));
|
||||
|
||||
style.setProperty(ANIMATION_FILL_MODE_PROPERTY, "forwards");
|
||||
|
||||
// http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/css3-animations-the-hiccups-and-bugs-youll-want-to-avoid/
|
||||
style.setProperty("-webkit-backface-visibility", "hidden");
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.buildDOMElements = function()
|
||||
{
|
||||
this.appendKeyFramesRule();
|
||||
|
||||
this.addAnimationEndEventListener();
|
||||
|
||||
this.setTargetStyleProperties();
|
||||
|
||||
this.didBuildDOMElements = true;
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.setRemoveAnimationPropertyOnCompletion = function(flag)
|
||||
{
|
||||
this.removeAnimationPropertyOnCompletion = flag;
|
||||
}
|
||||
|
||||
CSSAnimation.prototype.start = function()
|
||||
{
|
||||
if (this.propertyanimations.length == 0 || this.islive)
|
||||
return false;
|
||||
|
||||
if (!this.didBuildDOMElements)
|
||||
this.buildDOMElements();
|
||||
|
||||
this.target.style.setProperty(ANIMATION_NAME_PROPERTY, this.animationsnames.join(","));
|
||||
|
||||
this.islive = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
var removeFromParent= function(aNode)
|
||||
{
|
||||
var parentNode = aNode.parentNode;
|
||||
if (parentNode)
|
||||
parentNode.removeChild(aNode);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
|
||||
@import <Foundation/CPProxy.j>
|
||||
@import "CPAnimationContext.j"
|
||||
|
||||
var _supportsCSSAnimations = null;
|
||||
|
||||
@protocol CPAnimatablePropertyContainer <CPObject>
|
||||
|
||||
+ (id)defaultAnimationForKey:(CPString)key;
|
||||
- (id)animationForKey:(CPString)key;
|
||||
|
||||
- (id)animator;
|
||||
- (CPDictionary)animations;
|
||||
- (void)setAnimations:(CPDictionary)animations;
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPObjectAnimator : CPProxy
|
||||
{
|
||||
id <CPAnimatablePropertyContainer> _target;
|
||||
}
|
||||
|
||||
+ (BOOL)supportsCSSAnimations
|
||||
{
|
||||
if (_supportsCSSAnimations === null)
|
||||
_supportsCSSAnimations = CPBrowserCSSProperty("animation");
|
||||
|
||||
return _supportsCSSAnimations;
|
||||
}
|
||||
|
||||
- (id)initWithTarget:(id)aTarget
|
||||
{
|
||||
_target = aTarget;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)animator
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)anObject
|
||||
{
|
||||
return [_target isEqual:anObject];
|
||||
}
|
||||
|
||||
- (id)forwardingTargetForSelector:(SEL)aSelector
|
||||
{
|
||||
return _target;
|
||||
}
|
||||
|
||||
- (CPMethodSignature)methodSignatureForSelector:(SEL)aSelector
|
||||
{
|
||||
return [_target methodSignatureForSelector:aSelector];
|
||||
}
|
||||
|
||||
- (void)forwardInvocation:(CPInvocation)anInvocation
|
||||
{
|
||||
var target = [self forwardingTargetForSelector:[anInvocation selector]];
|
||||
[anInvocation invokeWithTarget:target];
|
||||
return;
|
||||
}
|
||||
|
||||
- (void)doesNotRecognizeSelector:(SEL)aSelector
|
||||
{
|
||||
[CPException raise:CPInvalidArgumentException reason:@"Animator does not recognize selector " + CPStringFromSelector(aSelector)];
|
||||
}
|
||||
|
||||
- (CPString)description
|
||||
{
|
||||
return [CPString stringWithFormat:@"%@ Animator Proxy for %@", [self class], _target];
|
||||
}
|
||||
|
||||
- (void)setValue:(id)aTargetValue forKey:(id)aKeyPath
|
||||
{
|
||||
var animation = [_target animationForKey:aKeyPath],
|
||||
context = [CPAnimationContext currentContext];
|
||||
|
||||
if (!animation || ![animation isKindOfClass:[CAAnimation class]] || (![context duration] && ![animation duration]) || ![_CPObjectAnimator supportsCSSAnimations])
|
||||
[_target setValue:aTargetValue forKey:aKeyPath];
|
||||
else
|
||||
{
|
||||
[context _enqueueActionForObject:_target keyPath:aKeyPath targetValue:aTargetValue completionHandler:function()
|
||||
{
|
||||
[_target setValue:aTargetValue forKey:aKeyPath];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,370 @@
|
||||
/**
|
||||
* Copyright 2010 Tim Down.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* jshashtable
|
||||
*
|
||||
* jshashtable is a JavaScript implementation of a hash table. It creates a single constructor function called Hashtable
|
||||
* in the global scope.
|
||||
*
|
||||
* Author: Tim Down <tim@timdown.co.uk>
|
||||
* Version: 2.1
|
||||
* Build date: 21 March 2010
|
||||
* Website: http://www.timdown.co.uk/jshashtable
|
||||
*/
|
||||
|
||||
Hashtable = (function() {
|
||||
var FUNCTION = "function";
|
||||
|
||||
var arrayRemoveAt = (typeof Array.prototype.splice == FUNCTION) ?
|
||||
function(arr, idx) {
|
||||
arr.splice(idx, 1);
|
||||
} :
|
||||
|
||||
function(arr, idx) {
|
||||
var itemsAfterDeleted, i, len;
|
||||
if (idx === arr.length - 1) {
|
||||
arr.length = idx;
|
||||
} else {
|
||||
itemsAfterDeleted = arr.slice(idx + 1);
|
||||
arr.length = idx;
|
||||
for (i = 0, len = itemsAfterDeleted.length; i < len; ++i) {
|
||||
arr[idx + i] = itemsAfterDeleted[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function hashObject(obj) {
|
||||
var hashCode;
|
||||
if (typeof obj == "string") {
|
||||
return obj;
|
||||
} else if (typeof obj.hashCode == FUNCTION) {
|
||||
// Check the hashCode method really has returned a string
|
||||
hashCode = obj.hashCode();
|
||||
return (typeof hashCode == "string") ? hashCode : hashObject(hashCode);
|
||||
} else if (typeof obj.toString == FUNCTION) {
|
||||
return obj.toString();
|
||||
} else {
|
||||
try {
|
||||
return String(obj);
|
||||
} catch (ex) {
|
||||
// For host objects (such as ActiveObjects in IE) that have no toString() method and throw an error when
|
||||
// passed to String()
|
||||
return Object.prototype.toString.call(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function equals_fixedValueHasEquals(fixedValue, variableValue) {
|
||||
return fixedValue.equals(variableValue);
|
||||
}
|
||||
|
||||
function equals_fixedValueNoEquals(fixedValue, variableValue) {
|
||||
return (typeof variableValue.equals == FUNCTION) ?
|
||||
variableValue.equals(fixedValue) : (fixedValue === variableValue);
|
||||
}
|
||||
|
||||
function createKeyValCheck(kvStr) {
|
||||
return function(kv) {
|
||||
if (kv === null) {
|
||||
throw new Error("null is not a valid " + kvStr);
|
||||
} else if (typeof kv == "undefined") {
|
||||
throw new Error(kvStr + " must not be undefined");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var checkKey = createKeyValCheck("key"), checkValue = createKeyValCheck("value");
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
function Bucket(hash, firstKey, firstValue, equalityFunction) {
|
||||
this[0] = hash;
|
||||
this.entries = [];
|
||||
this.addEntry(firstKey, firstValue);
|
||||
|
||||
if (equalityFunction !== null) {
|
||||
this.getEqualityFunction = function() {
|
||||
return equalityFunction;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
var EXISTENCE = 0, ENTRY = 1, ENTRY_INDEX_AND_VALUE = 2;
|
||||
|
||||
function createBucketSearcher(mode) {
|
||||
return function(key) {
|
||||
var i = this.entries.length, entry, equals = this.getEqualityFunction(key);
|
||||
while (i--) {
|
||||
entry = this.entries[i];
|
||||
if ( equals(key, entry[0]) ) {
|
||||
switch (mode) {
|
||||
case EXISTENCE:
|
||||
return true;
|
||||
case ENTRY:
|
||||
return entry;
|
||||
case ENTRY_INDEX_AND_VALUE:
|
||||
return [ i, entry[1] ];
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
function createBucketLister(entryProperty) {
|
||||
return function(aggregatedArr) {
|
||||
var startIndex = aggregatedArr.length;
|
||||
for (var i = 0, len = this.entries.length; i < len; ++i) {
|
||||
aggregatedArr[startIndex + i] = this.entries[i][entryProperty];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Bucket.prototype = {
|
||||
getEqualityFunction: function(searchValue) {
|
||||
return (typeof searchValue.equals == FUNCTION) ? equals_fixedValueHasEquals : equals_fixedValueNoEquals;
|
||||
},
|
||||
|
||||
getEntryForKey: createBucketSearcher(ENTRY),
|
||||
|
||||
getEntryAndIndexForKey: createBucketSearcher(ENTRY_INDEX_AND_VALUE),
|
||||
|
||||
removeEntryForKey: function(key) {
|
||||
var result = this.getEntryAndIndexForKey(key);
|
||||
if (result) {
|
||||
arrayRemoveAt(this.entries, result[0]);
|
||||
return result[1];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
addEntry: function(key, value) {
|
||||
this.entries[this.entries.length] = [key, value];
|
||||
},
|
||||
|
||||
keys: createBucketLister(0),
|
||||
|
||||
values: createBucketLister(1),
|
||||
|
||||
getEntries: function(entries) {
|
||||
var startIndex = entries.length;
|
||||
for (var i = 0, len = this.entries.length; i < len; ++i) {
|
||||
// Clone the entry stored in the bucket before adding to array
|
||||
entries[startIndex + i] = this.entries[i].slice(0);
|
||||
}
|
||||
},
|
||||
|
||||
containsKey: createBucketSearcher(EXISTENCE),
|
||||
|
||||
containsValue: function(value) {
|
||||
var i = this.entries.length;
|
||||
while (i--) {
|
||||
if ( value === this.entries[i][1] ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// Supporting functions for searching hashtable buckets
|
||||
|
||||
function searchBuckets(buckets, hash) {
|
||||
var i = buckets.length, bucket;
|
||||
while (i--) {
|
||||
bucket = buckets[i];
|
||||
if (hash === bucket[0]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function getBucketForHash(bucketsByHash, hash) {
|
||||
var bucket = bucketsByHash[hash];
|
||||
|
||||
// Check that this is a genuine bucket and not something inherited from the bucketsByHash's prototype
|
||||
return ( bucket && (bucket instanceof Bucket) ) ? bucket : null;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
function Hashtable(hashingFunctionParam, equalityFunctionParam) {
|
||||
var that = this;
|
||||
var buckets = [];
|
||||
var bucketsByHash = {};
|
||||
|
||||
var hashingFunction = (typeof hashingFunctionParam == FUNCTION) ? hashingFunctionParam : hashObject;
|
||||
var equalityFunction = (typeof equalityFunctionParam == FUNCTION) ? equalityFunctionParam : null;
|
||||
|
||||
this.put = function(key, value) {
|
||||
checkKey(key);
|
||||
checkValue(value);
|
||||
var hash = hashingFunction(key), bucket, bucketEntry, oldValue = null;
|
||||
|
||||
// Check if a bucket exists for the bucket key
|
||||
bucket = getBucketForHash(bucketsByHash, hash);
|
||||
if (bucket) {
|
||||
// Check this bucket to see if it already contains this key
|
||||
bucketEntry = bucket.getEntryForKey(key);
|
||||
if (bucketEntry) {
|
||||
// This bucket entry is the current mapping of key to value, so replace old value and we're done.
|
||||
oldValue = bucketEntry[1];
|
||||
bucketEntry[1] = value;
|
||||
} else {
|
||||
// The bucket does not contain an entry for this key, so add one
|
||||
bucket.addEntry(key, value);
|
||||
}
|
||||
} else {
|
||||
// No bucket exists for the key, so create one and put our key/value mapping in
|
||||
bucket = new Bucket(hash, key, value, equalityFunction);
|
||||
buckets[buckets.length] = bucket;
|
||||
bucketsByHash[hash] = bucket;
|
||||
}
|
||||
return oldValue;
|
||||
};
|
||||
|
||||
this.get = function(key) {
|
||||
checkKey(key);
|
||||
|
||||
var hash = hashingFunction(key);
|
||||
|
||||
// Check if a bucket exists for the bucket key
|
||||
var bucket = getBucketForHash(bucketsByHash, hash);
|
||||
if (bucket) {
|
||||
// Check this bucket to see if it contains this key
|
||||
var bucketEntry = bucket.getEntryForKey(key);
|
||||
if (bucketEntry) {
|
||||
// This bucket entry is the current mapping of key to value, so return the value.
|
||||
return bucketEntry[1];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
this.containsKey = function(key) {
|
||||
checkKey(key);
|
||||
var bucketKey = hashingFunction(key);
|
||||
|
||||
// Check if a bucket exists for the bucket key
|
||||
var bucket = getBucketForHash(bucketsByHash, bucketKey);
|
||||
|
||||
return bucket ? bucket.containsKey(key) : false;
|
||||
};
|
||||
|
||||
this.containsValue = function(value) {
|
||||
checkValue(value);
|
||||
var i = buckets.length;
|
||||
while (i--) {
|
||||
if (buckets[i].containsValue(value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
this.clear = function() {
|
||||
buckets.length = 0;
|
||||
bucketsByHash = {};
|
||||
};
|
||||
|
||||
this.isEmpty = function() {
|
||||
return !buckets.length;
|
||||
};
|
||||
|
||||
var createBucketAggregator = function(bucketFuncName) {
|
||||
return function() {
|
||||
var aggregated = [], i = buckets.length;
|
||||
while (i--) {
|
||||
buckets[i][bucketFuncName](aggregated);
|
||||
}
|
||||
return aggregated;
|
||||
};
|
||||
};
|
||||
|
||||
this.keys = createBucketAggregator("keys");
|
||||
this.values = createBucketAggregator("values");
|
||||
this.entries = createBucketAggregator("getEntries");
|
||||
|
||||
this.remove = function(key) {
|
||||
checkKey(key);
|
||||
|
||||
var hash = hashingFunction(key), bucketIndex, oldValue = null;
|
||||
|
||||
// Check if a bucket exists for the bucket key
|
||||
var bucket = getBucketForHash(bucketsByHash, hash);
|
||||
|
||||
if (bucket) {
|
||||
// Remove entry from this bucket for this key
|
||||
oldValue = bucket.removeEntryForKey(key);
|
||||
if (oldValue !== null) {
|
||||
// Entry was removed, so check if bucket is empty
|
||||
if (!bucket.entries.length) {
|
||||
// Bucket is empty, so remove it from the bucket collections
|
||||
bucketIndex = searchBuckets(buckets, hash);
|
||||
arrayRemoveAt(buckets, bucketIndex);
|
||||
delete bucketsByHash[hash];
|
||||
}
|
||||
}
|
||||
}
|
||||
return oldValue;
|
||||
};
|
||||
|
||||
this.size = function() {
|
||||
var total = 0, i = buckets.length;
|
||||
while (i--) {
|
||||
total += buckets[i].entries.length;
|
||||
}
|
||||
return total;
|
||||
};
|
||||
|
||||
this.each = function(callback) {
|
||||
var entries = that.entries(), i = entries.length, entry;
|
||||
while (i--) {
|
||||
entry = entries[i];
|
||||
callback(entry[0], entry[1]);
|
||||
}
|
||||
};
|
||||
|
||||
this.putAll = function(hashtable, conflictCallback) {
|
||||
var entries = hashtable.entries();
|
||||
var entry, key, value, thisValue, i = entries.length;
|
||||
var hasConflictCallback = (typeof conflictCallback == FUNCTION);
|
||||
while (i--) {
|
||||
entry = entries[i];
|
||||
key = entry[0];
|
||||
value = entry[1];
|
||||
|
||||
// Check for a conflict. The default behaviour is to overwrite the value for an existing key
|
||||
if ( hasConflictCallback && (thisValue = that.get(key)) ) {
|
||||
value = conflictCallback(key, thisValue, value);
|
||||
}
|
||||
that.put(key, value);
|
||||
}
|
||||
};
|
||||
|
||||
this.clone = function() {
|
||||
var clone = new Hashtable(hashingFunctionParam, equalityFunctionParam);
|
||||
clone.putAll(that);
|
||||
return clone;
|
||||
};
|
||||
}
|
||||
|
||||
return Hashtable;
|
||||
})();
|
||||
+11
-5
@@ -264,8 +264,11 @@ var CPCacheDelegate_cache_willEvictObject_ = 1 << 1;
|
||||
|
||||
// Sort keys by position
|
||||
var sortedKeys = [[_items allKeys] sortedArrayUsingFunction:
|
||||
function(k1, k2) {
|
||||
return [[[_items objectForKey:k1] position] compare:[[_items objectForKey:k2] position]]; }];
|
||||
function(k1, k2)
|
||||
{
|
||||
return [[[_items objectForKey:k1] position] compare:[[_items objectForKey:k2] position]];
|
||||
}
|
||||
];
|
||||
|
||||
// Affect new positions
|
||||
for (var i = 0; i < sortedKeys.length; ++i)
|
||||
@@ -300,8 +303,11 @@ var CPCacheDelegate_cache_willEvictObject_ = 1 << 1;
|
||||
|
||||
// Sort keys by position
|
||||
var sortedKeys = [[_items allKeys] sortedArrayUsingFunction:
|
||||
function(k1, k2) {
|
||||
return [[[_items objectForKey:k1] position] compare:[[_items objectForKey:k2] position]]; }];
|
||||
function(k1, k2)
|
||||
{
|
||||
return [[[_items objectForKey:k1] position] compare:[[_items objectForKey:k2] position]];
|
||||
}
|
||||
];
|
||||
|
||||
// Remove oldest objects until to satisfy the break condition
|
||||
for (var i = 0; i < sortedKeys.length; ++i)
|
||||
@@ -313,7 +319,7 @@ var CPCacheDelegate_cache_willEvictObject_ = 1 << 1;
|
||||
[self _sendDelegateWillEvictObjectForKey:sortedKeys[i]];
|
||||
|
||||
// Remove object
|
||||
[_items removeObjectForKey: sortedKeys[i]];
|
||||
[_items removeObjectForKey:sortedKeys[i]];
|
||||
|
||||
// Invalid cost cache
|
||||
_totalCostCache = -1;
|
||||
|
||||
+260
-253
@@ -399,299 +399,299 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
|
||||
|
||||
- (void)_replaceModifiersForKey:(CPString)aKey
|
||||
{
|
||||
if ([_replacedKeys containsObject:aKey] || ![_nativeClass automaticallyNotifiesObserversForKey:aKey])
|
||||
return;
|
||||
|
||||
[_replacedKeys addObject:aKey];
|
||||
|
||||
var theClass = _nativeClass,
|
||||
KVOClass = _targetObject.isa,
|
||||
capitalizedKey = aKey.charAt(0).toUpperCase() + aKey.substring(1);
|
||||
|
||||
// Attribute and To-One Relationships
|
||||
var setKey_selector = sel_getUid("set" + capitalizedKey + ":"),
|
||||
setKey_method = class_getInstanceMethod(theClass, setKey_selector);
|
||||
|
||||
if (setKey_method)
|
||||
if (![_replacedKeys containsObject:aKey] && [_nativeClass automaticallyNotifiesObserversForKey:aKey])
|
||||
{
|
||||
var setKey_method_imp = setKey_method.method_imp;
|
||||
[_replacedKeys addObject:aKey];
|
||||
|
||||
class_addMethod(KVOClass, setKey_selector, function(self, _cmd, anObject)
|
||||
var theClass = _nativeClass,
|
||||
KVOClass = _targetObject.isa,
|
||||
capitalizedKey = aKey.charAt(0).toUpperCase() + aKey.substring(1);
|
||||
|
||||
// Attribute and To-One Relationships
|
||||
var setKey_selector = sel_getUid("set" + capitalizedKey + ":"),
|
||||
setKey_method = class_getInstanceMethod(theClass, setKey_selector);
|
||||
|
||||
if (setKey_method)
|
||||
{
|
||||
[self willChangeValueForKey:aKey];
|
||||
var setKey_method_imp = setKey_method.method_imp;
|
||||
|
||||
setKey_method_imp(self, _cmd, anObject);
|
||||
|
||||
[self didChangeValueForKey:aKey];
|
||||
}, setKey_method.method_types);
|
||||
}
|
||||
|
||||
// FIXME: Deprecated.
|
||||
var _setKey_selector = sel_getUid("_set" + capitalizedKey + ":"),
|
||||
_setKey_method = class_getInstanceMethod(theClass, _setKey_selector);
|
||||
|
||||
if (_setKey_method)
|
||||
{
|
||||
var _setKey_method_imp = _setKey_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, _setKey_selector, function(self, _cmd, anObject)
|
||||
{
|
||||
[self willChangeValueForKey:aKey];
|
||||
|
||||
_setKey_method_imp(self, _cmd, anObject);
|
||||
|
||||
[self didChangeValueForKey:aKey];
|
||||
}, _setKey_method.method_types);
|
||||
}
|
||||
|
||||
// Ordered To-Many Relationships
|
||||
var insertObject_inKeyAtIndex_selector = sel_getUid("insertObject:in" + capitalizedKey + "AtIndex:"),
|
||||
insertObject_inKeyAtIndex_method =
|
||||
class_getInstanceMethod(theClass, insertObject_inKeyAtIndex_selector),
|
||||
|
||||
insertKey_atIndexes_selector = sel_getUid("insert" + capitalizedKey + ":atIndexes:"),
|
||||
insertKey_atIndexes_method =
|
||||
class_getInstanceMethod(theClass, insertKey_atIndexes_selector),
|
||||
|
||||
removeObjectFromKeyAtIndex_selector = sel_getUid("removeObjectFrom" + capitalizedKey + "AtIndex:"),
|
||||
removeObjectFromKeyAtIndex_method =
|
||||
class_getInstanceMethod(theClass, removeObjectFromKeyAtIndex_selector),
|
||||
|
||||
removeKeyAtIndexes_selector = sel_getUid("remove" + capitalizedKey + "AtIndexes:"),
|
||||
removeKeyAtIndexes_method = class_getInstanceMethod(theClass, removeKeyAtIndexes_selector);
|
||||
|
||||
if ((insertObject_inKeyAtIndex_method || insertKey_atIndexes_method) &&
|
||||
(removeObjectFromKeyAtIndex_method || removeKeyAtIndexes_method))
|
||||
{
|
||||
if (insertObject_inKeyAtIndex_method)
|
||||
{
|
||||
var insertObject_inKeyAtIndex_method_imp = insertObject_inKeyAtIndex_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, insertObject_inKeyAtIndex_selector, function(self, _cmd, anObject, anIndex)
|
||||
class_addMethod(KVOClass, setKey_selector, function(self, _cmd, anObject)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeInsertion
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
[self willChangeValueForKey:aKey];
|
||||
|
||||
insertObject_inKeyAtIndex_method_imp(self, _cmd, anObject, anIndex);
|
||||
setKey_method_imp(self, _cmd, anObject);
|
||||
|
||||
[self didChange:CPKeyValueChangeInsertion
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
}, insertObject_inKeyAtIndex_method.method_types);
|
||||
[self didChangeValueForKey:aKey];
|
||||
}, setKey_method.method_types);
|
||||
}
|
||||
|
||||
if (insertKey_atIndexes_method)
|
||||
// FIXME: Deprecated.
|
||||
var _setKey_selector = sel_getUid("_set" + capitalizedKey + ":"),
|
||||
_setKey_method = class_getInstanceMethod(theClass, _setKey_selector);
|
||||
|
||||
if (_setKey_method)
|
||||
{
|
||||
var insertKey_atIndexes_method_imp = insertKey_atIndexes_method.method_imp;
|
||||
var _setKey_method_imp = _setKey_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, insertKey_atIndexes_selector, function(self, _cmd, objects, indexes)
|
||||
class_addMethod(KVOClass, _setKey_selector, function(self, _cmd, anObject)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeInsertion
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
[self willChangeValueForKey:aKey];
|
||||
|
||||
insertKey_atIndexes_method_imp(self, _cmd, objects, indexes);
|
||||
_setKey_method_imp(self, _cmd, anObject);
|
||||
|
||||
[self didChange:CPKeyValueChangeInsertion
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
}, insertKey_atIndexes_method.method_types);
|
||||
[self didChangeValueForKey:aKey];
|
||||
}, _setKey_method.method_types);
|
||||
}
|
||||
|
||||
if (removeObjectFromKeyAtIndex_method)
|
||||
// Ordered To-Many Relationships
|
||||
var insertObject_inKeyAtIndex_selector = sel_getUid("insertObject:in" + capitalizedKey + "AtIndex:"),
|
||||
insertObject_inKeyAtIndex_method =
|
||||
class_getInstanceMethod(theClass, insertObject_inKeyAtIndex_selector),
|
||||
|
||||
insertKey_atIndexes_selector = sel_getUid("insert" + capitalizedKey + ":atIndexes:"),
|
||||
insertKey_atIndexes_method =
|
||||
class_getInstanceMethod(theClass, insertKey_atIndexes_selector),
|
||||
|
||||
removeObjectFromKeyAtIndex_selector = sel_getUid("removeObjectFrom" + capitalizedKey + "AtIndex:"),
|
||||
removeObjectFromKeyAtIndex_method =
|
||||
class_getInstanceMethod(theClass, removeObjectFromKeyAtIndex_selector),
|
||||
|
||||
removeKeyAtIndexes_selector = sel_getUid("remove" + capitalizedKey + "AtIndexes:"),
|
||||
removeKeyAtIndexes_method = class_getInstanceMethod(theClass, removeKeyAtIndexes_selector);
|
||||
|
||||
if ((insertObject_inKeyAtIndex_method || insertKey_atIndexes_method) &&
|
||||
(removeObjectFromKeyAtIndex_method || removeKeyAtIndexes_method))
|
||||
{
|
||||
var removeObjectFromKeyAtIndex_method_imp = removeObjectFromKeyAtIndex_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, removeObjectFromKeyAtIndex_selector, function(self, _cmd, anIndex)
|
||||
if (insertObject_inKeyAtIndex_method)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeRemoval
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
var insertObject_inKeyAtIndex_method_imp = insertObject_inKeyAtIndex_method.method_imp;
|
||||
|
||||
removeObjectFromKeyAtIndex_method_imp(self, _cmd, anIndex);
|
||||
class_addMethod(KVOClass, insertObject_inKeyAtIndex_selector, function(self, _cmd, anObject, anIndex)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeInsertion
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
|
||||
[self didChange:CPKeyValueChangeRemoval
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
}, removeObjectFromKeyAtIndex_method.method_types);
|
||||
insertObject_inKeyAtIndex_method_imp(self, _cmd, anObject, anIndex);
|
||||
|
||||
[self didChange:CPKeyValueChangeInsertion
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
}, insertObject_inKeyAtIndex_method.method_types);
|
||||
}
|
||||
|
||||
if (insertKey_atIndexes_method)
|
||||
{
|
||||
var insertKey_atIndexes_method_imp = insertKey_atIndexes_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, insertKey_atIndexes_selector, function(self, _cmd, objects, indexes)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeInsertion
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
|
||||
insertKey_atIndexes_method_imp(self, _cmd, objects, indexes);
|
||||
|
||||
[self didChange:CPKeyValueChangeInsertion
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
}, insertKey_atIndexes_method.method_types);
|
||||
}
|
||||
|
||||
if (removeObjectFromKeyAtIndex_method)
|
||||
{
|
||||
var removeObjectFromKeyAtIndex_method_imp = removeObjectFromKeyAtIndex_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, removeObjectFromKeyAtIndex_selector, function(self, _cmd, anIndex)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeRemoval
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
|
||||
removeObjectFromKeyAtIndex_method_imp(self, _cmd, anIndex);
|
||||
|
||||
[self didChange:CPKeyValueChangeRemoval
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
}, removeObjectFromKeyAtIndex_method.method_types);
|
||||
}
|
||||
|
||||
if (removeKeyAtIndexes_method)
|
||||
{
|
||||
var removeKeyAtIndexes_method_imp = removeKeyAtIndexes_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, removeKeyAtIndexes_selector, function(self, _cmd, indexes)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeRemoval
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
|
||||
removeKeyAtIndexes_method_imp(self, _cmd, indexes);
|
||||
|
||||
[self didChange:CPKeyValueChangeRemoval
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
}, removeKeyAtIndexes_method.method_types);
|
||||
}
|
||||
|
||||
// These are optional.
|
||||
var replaceObjectInKeyAtIndex_withObject_selector =
|
||||
sel_getUid("replaceObjectIn" + capitalizedKey + "AtIndex:withObject:"),
|
||||
replaceObjectInKeyAtIndex_withObject_method =
|
||||
class_getInstanceMethod(theClass, replaceObjectInKeyAtIndex_withObject_selector);
|
||||
|
||||
if (replaceObjectInKeyAtIndex_withObject_method)
|
||||
{
|
||||
var replaceObjectInKeyAtIndex_withObject_method_imp =
|
||||
replaceObjectInKeyAtIndex_withObject_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, replaceObjectInKeyAtIndex_withObject_selector,
|
||||
function(self, _cmd, anIndex, anObject)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeReplacement
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
|
||||
replaceObjectInKeyAtIndex_withObject_method_imp(self, _cmd, anIndex, anObject);
|
||||
|
||||
[self didChange:CPKeyValueChangeReplacement
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
}, replaceObjectInKeyAtIndex_withObject_method.method_types);
|
||||
}
|
||||
|
||||
var replaceKeyAtIndexes_withKey_selector =
|
||||
sel_getUid("replace" + capitalizedKey + "AtIndexes:with" + capitalizedKey + ":"),
|
||||
replaceKeyAtIndexes_withKey_method =
|
||||
class_getInstanceMethod(theClass, replaceKeyAtIndexes_withKey_selector);
|
||||
|
||||
if (replaceKeyAtIndexes_withKey_method)
|
||||
{
|
||||
var replaceKeyAtIndexes_withKey_method_imp = replaceKeyAtIndexes_withKey_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, replaceKeyAtIndexes_withKey_selector, function(self, _cmd, indexes, objects)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeReplacement
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
|
||||
replaceObjectInKeyAtIndex_withObject_method_imp(self, _cmd, indexes, objects);
|
||||
|
||||
[self didChange:CPKeyValueChangeReplacement
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
}, replaceKeyAtIndexes_withKey_method.method_types);
|
||||
}
|
||||
}
|
||||
|
||||
if (removeKeyAtIndexes_method)
|
||||
// Unordered To-Many Relationships
|
||||
var addKeyObject_selector = sel_getUid("add" + capitalizedKey + "Object:"),
|
||||
addKeyObject_method = class_getInstanceMethod(theClass, addKeyObject_selector),
|
||||
|
||||
addKey_selector = sel_getUid("add" + capitalizedKey + ":"),
|
||||
addKey_method = class_getInstanceMethod(theClass, addKey_selector),
|
||||
|
||||
removeKeyObject_selector = sel_getUid("remove" + capitalizedKey + "Object:"),
|
||||
removeKeyObject_method = class_getInstanceMethod(theClass, removeKeyObject_selector),
|
||||
|
||||
removeKey_selector = sel_getUid("remove" + capitalizedKey + ":"),
|
||||
removeKey_method = class_getInstanceMethod(theClass, removeKey_selector);
|
||||
|
||||
if ((addKeyObject_method || addKey_method) && (removeKeyObject_method || removeKey_method))
|
||||
{
|
||||
var removeKeyAtIndexes_method_imp = removeKeyAtIndexes_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, removeKeyAtIndexes_selector, function(self, _cmd, indexes)
|
||||
if (addKeyObject_method)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeRemoval
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
var addKeyObject_method_imp = addKeyObject_method.method_imp;
|
||||
|
||||
removeKeyAtIndexes_method_imp(self, _cmd, indexes);
|
||||
class_addMethod(KVOClass, addKeyObject_selector, function(self, _cmd, anObject)
|
||||
{
|
||||
[self willChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueUnionSetMutation
|
||||
usingObjects:[CPSet setWithObject:anObject]];
|
||||
|
||||
[self didChange:CPKeyValueChangeRemoval
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
}, removeKeyAtIndexes_method.method_types);
|
||||
}
|
||||
addKeyObject_method_imp(self, _cmd, anObject);
|
||||
|
||||
// These are optional.
|
||||
var replaceObjectInKeyAtIndex_withObject_selector =
|
||||
sel_getUid("replaceObjectIn" + capitalizedKey + "AtIndex:withObject:"),
|
||||
replaceObjectInKeyAtIndex_withObject_method =
|
||||
class_getInstanceMethod(theClass, replaceObjectInKeyAtIndex_withObject_selector);
|
||||
[self didChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueUnionSetMutation
|
||||
usingObjects:[CPSet setWithObject:anObject]];
|
||||
}, addKeyObject_method.method_types);
|
||||
}
|
||||
|
||||
if (replaceObjectInKeyAtIndex_withObject_method)
|
||||
{
|
||||
var replaceObjectInKeyAtIndex_withObject_method_imp =
|
||||
replaceObjectInKeyAtIndex_withObject_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, replaceObjectInKeyAtIndex_withObject_selector,
|
||||
function(self, _cmd, anIndex, anObject)
|
||||
if (addKey_method)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeReplacement
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
var addKey_method_imp = addKey_method.method_imp;
|
||||
|
||||
replaceObjectInKeyAtIndex_withObject_method_imp(self, _cmd, anIndex, anObject);
|
||||
class_addMethod(KVOClass, addKey_selector, function(self, _cmd, objects)
|
||||
{
|
||||
[self willChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueUnionSetMutation
|
||||
usingObjects:[objects copy]];
|
||||
|
||||
[self didChange:CPKeyValueChangeReplacement
|
||||
valuesAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]
|
||||
forKey:aKey];
|
||||
}, replaceObjectInKeyAtIndex_withObject_method.method_types);
|
||||
}
|
||||
addKey_method_imp(self, _cmd, objects);
|
||||
|
||||
var replaceKeyAtIndexes_withKey_selector =
|
||||
sel_getUid("replace" + capitalizedKey + "AtIndexes:with" + capitalizedKey + ":"),
|
||||
replaceKeyAtIndexes_withKey_method =
|
||||
class_getInstanceMethod(theClass, replaceKeyAtIndexes_withKey_selector);
|
||||
[self didChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueUnionSetMutation
|
||||
usingObjects:[objects copy]];
|
||||
}, addKey_method.method_types);
|
||||
}
|
||||
|
||||
if (replaceKeyAtIndexes_withKey_method)
|
||||
{
|
||||
var replaceKeyAtIndexes_withKey_method_imp = replaceKeyAtIndexes_withKey_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, replaceKeyAtIndexes_withKey_selector, function(self, _cmd, indexes, objects)
|
||||
if (removeKeyObject_method)
|
||||
{
|
||||
[self willChange:CPKeyValueChangeReplacement
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
var removeKeyObject_method_imp = removeKeyObject_method.method_imp;
|
||||
|
||||
replaceObjectInKeyAtIndex_withObject_method_imp(self, _cmd, indexes, objects);
|
||||
class_addMethod(KVOClass, removeKeyObject_selector, function(self, _cmd, anObject)
|
||||
{
|
||||
[self willChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueMinusSetMutation
|
||||
usingObjects:[CPSet setWithObject:anObject]];
|
||||
|
||||
[self didChange:CPKeyValueChangeReplacement
|
||||
valuesAtIndexes:[indexes copy]
|
||||
forKey:aKey];
|
||||
}, replaceKeyAtIndexes_withKey_method.method_types);
|
||||
}
|
||||
}
|
||||
removeKeyObject_method_imp(self, _cmd, anObject);
|
||||
|
||||
// Unordered To-Many Relationships
|
||||
var addKeyObject_selector = sel_getUid("add" + capitalizedKey + "Object:"),
|
||||
addKeyObject_method = class_getInstanceMethod(theClass, addKeyObject_selector),
|
||||
[self didChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueMinusSetMutation
|
||||
usingObjects:[CPSet setWithObject:anObject]];
|
||||
}, removeKeyObject_method.method_types);
|
||||
}
|
||||
|
||||
addKey_selector = sel_getUid("add" + capitalizedKey + ":"),
|
||||
addKey_method = class_getInstanceMethod(theClass, addKey_selector),
|
||||
|
||||
removeKeyObject_selector = sel_getUid("remove" + capitalizedKey + "Object:"),
|
||||
removeKeyObject_method = class_getInstanceMethod(theClass, removeKeyObject_selector),
|
||||
|
||||
removeKey_selector = sel_getUid("remove" + capitalizedKey + ":"),
|
||||
removeKey_method = class_getInstanceMethod(theClass, removeKey_selector);
|
||||
|
||||
if ((addKeyObject_method || addKey_method) && (removeKeyObject_method || removeKey_method))
|
||||
{
|
||||
if (addKeyObject_method)
|
||||
{
|
||||
var addKeyObject_method_imp = addKeyObject_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, addKeyObject_selector, function(self, _cmd, anObject)
|
||||
if (removeKey_method)
|
||||
{
|
||||
[self willChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueUnionSetMutation
|
||||
usingObjects:[CPSet setWithObject:anObject]];
|
||||
var removeKey_method_imp = removeKey_method.method_imp;
|
||||
|
||||
addKeyObject_method_imp(self, _cmd, anObject);
|
||||
class_addMethod(KVOClass, removeKey_selector, function(self, _cmd, objects)
|
||||
{
|
||||
[self willChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueMinusSetMutation
|
||||
usingObjects:[objects copy]];
|
||||
|
||||
[self didChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueUnionSetMutation
|
||||
usingObjects:[CPSet setWithObject:anObject]];
|
||||
}, addKeyObject_method.method_types);
|
||||
}
|
||||
removeKey_method_imp(self, _cmd, objects);
|
||||
|
||||
if (addKey_method)
|
||||
{
|
||||
var addKey_method_imp = addKey_method.method_imp;
|
||||
[self didChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueMinusSetMutation
|
||||
usingObjects:[objects copy]];
|
||||
}, removeKey_method.method_types);
|
||||
}
|
||||
|
||||
class_addMethod(KVOClass, addKey_selector, function(self, _cmd, objects)
|
||||
// intersect<Key>: is optional.
|
||||
var intersectKey_selector = sel_getUid("intersect" + capitalizedKey + ":"),
|
||||
intersectKey_method = class_getInstanceMethod(theClass, intersectKey_selector);
|
||||
|
||||
if (intersectKey_method)
|
||||
{
|
||||
[self willChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueUnionSetMutation
|
||||
usingObjects:[objects copy]];
|
||||
var intersectKey_method_imp = intersectKey_method.method_imp;
|
||||
|
||||
addKey_method_imp(self, _cmd, objects);
|
||||
class_addMethod(KVOClass, intersectKey_selector, function(self, _cmd, aSet)
|
||||
{
|
||||
[self willChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueIntersectSetMutation
|
||||
usingObjects:[aSet copy]];
|
||||
|
||||
[self didChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueUnionSetMutation
|
||||
usingObjects:[objects copy]];
|
||||
}, addKey_method.method_types);
|
||||
}
|
||||
intersectKey_method_imp(self, _cmd, aSet);
|
||||
|
||||
if (removeKeyObject_method)
|
||||
{
|
||||
var removeKeyObject_method_imp = removeKeyObject_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, removeKeyObject_selector, function(self, _cmd, anObject)
|
||||
{
|
||||
[self willChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueMinusSetMutation
|
||||
usingObjects:[CPSet setWithObject:anObject]];
|
||||
|
||||
removeKeyObject_method_imp(self, _cmd, anObject);
|
||||
|
||||
[self didChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueMinusSetMutation
|
||||
usingObjects:[CPSet setWithObject:anObject]];
|
||||
}, removeKeyObject_method.method_types);
|
||||
}
|
||||
|
||||
if (removeKey_method)
|
||||
{
|
||||
var removeKey_method_imp = removeKey_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, removeKey_selector, function(self, _cmd, objects)
|
||||
{
|
||||
[self willChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueMinusSetMutation
|
||||
usingObjects:[objects copy]];
|
||||
|
||||
removeKey_method_imp(self, _cmd, objects);
|
||||
|
||||
[self didChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueMinusSetMutation
|
||||
usingObjects:[objects copy]];
|
||||
}, removeKey_method.method_types);
|
||||
}
|
||||
|
||||
// intersect<Key>: is optional.
|
||||
var intersectKey_selector = sel_getUid("intersect" + capitalizedKey + ":"),
|
||||
intersectKey_method = class_getInstanceMethod(theClass, intersectKey_selector);
|
||||
|
||||
if (intersectKey_method)
|
||||
{
|
||||
var intersectKey_method_imp = intersectKey_method.method_imp;
|
||||
|
||||
class_addMethod(KVOClass, intersectKey_selector, function(self, _cmd, aSet)
|
||||
{
|
||||
[self willChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueIntersectSetMutation
|
||||
usingObjects:[aSet copy]];
|
||||
|
||||
intersectKey_method_imp(self, _cmd, aSet);
|
||||
|
||||
[self didChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueIntersectSetMutation
|
||||
usingObjects:[aSet copy]];
|
||||
}, intersectKey_method.method_types);
|
||||
[self didChangeValueForKey:aKey
|
||||
withSetMutation:CPKeyValueIntersectSetMutation
|
||||
usingObjects:[aSet copy]];
|
||||
}, intersectKey_method.method_types);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1300,6 +1300,10 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
|
||||
if (aKeyPath === _firstPart)
|
||||
{
|
||||
var pathChanges = [CPMutableDictionary dictionaryWithObject:CPKeyValueChangeSetting forKey:CPKeyValueChangeKindKey];
|
||||
var isBeforeFlag = !![changes objectForKey:CPKeyValueChangeNotificationIsPriorKey];
|
||||
|
||||
if (isBeforeFlag)
|
||||
[pathChanges setObject:1 forKey:CPKeyValueChangeNotificationIsPriorKey];
|
||||
|
||||
if (_options & CPKeyValueObservingOptionOld)
|
||||
{
|
||||
@@ -1308,7 +1312,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
|
||||
[pathChanges setObject:oldValue != null ? oldValue : [CPNull null] forKey:CPKeyValueChangeOldKey];
|
||||
}
|
||||
|
||||
if (_options & CPKeyValueObservingOptionNew)
|
||||
if (!isBeforeFlag && (_options & CPKeyValueObservingOptionNew))
|
||||
{
|
||||
var newValue = [_object valueForKeyPath:_firstPart + "." + _secondPart];
|
||||
|
||||
@@ -1317,14 +1321,17 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
|
||||
|
||||
[_observer observeValueForKeyPath:_firstPart + "." + _secondPart ofObject:_object change:pathChanges context:_context];
|
||||
|
||||
//since a has changed, we should remove ourselves as an observer of the old a, and observe the new one
|
||||
if (_value)
|
||||
[_value removeObserver:self forKeyPath:_secondPart];
|
||||
// Nothing has changed yet when doing willChange....
|
||||
if (!isBeforeFlag) {
|
||||
//since a has changed, we should remove ourselves as an observer of the old a, and observe the new one
|
||||
if (_value)
|
||||
[_value removeObserver:self forKeyPath:_secondPart];
|
||||
|
||||
_value = [_object valueForKey:_firstPart];
|
||||
_value = [_object valueForKey:_firstPart];
|
||||
|
||||
if (_value)
|
||||
[_value addObserver:self forKeyPath:_secondPart options:_options context:nil];
|
||||
if (_value)
|
||||
[_value addObserver:self forKeyPath:_secondPart options:_options context:nil];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -61,9 +61,9 @@ CPLocaleLanguageDirectionRightToLeft = @"CPLocaleLanguageDirectionRightTo
|
||||
CPLocaleLanguageDirectionTopToBottom = @"CPLocaleLanguageDirectionTopToBottom";
|
||||
CPLocaleLanguageDirectionBottomToTop = @"CPLocaleLanguageDirectionBottomToTop";
|
||||
|
||||
var countryCodes = [@"DE", @"FR", @"ES", @"GB", @"US"],
|
||||
languageCodes = [@"en", @"de", @"es", @"fr"],
|
||||
availableLocaleIdentifiers = [@"de_DE", @"en_GB", @"en_US", @"es_ES", @"fr_FR"];
|
||||
var countryCodes = [@"DE", @"FR", @"ES", @"GB", @"US", @"SE"],
|
||||
languageCodes = [@"en", @"de", @"es", @"fr", @"sv"],
|
||||
availableLocaleIdentifiers = [@"de_DE", @"en_GB", @"en_US", @"es_ES", @"fr_FR", @"sv_SE"];
|
||||
|
||||
var sharedSystemLocale = nil,
|
||||
sharedCurrentLocale = nil;
|
||||
|
||||
+19
-21
@@ -25,6 +25,8 @@
|
||||
@import "CPObject.j"
|
||||
@import "CPObjJRuntime.j"
|
||||
|
||||
#define CAST_TO_INT(x) ((x) >= 0 ? Math.floor((x)) : Math.ceil((x)))
|
||||
|
||||
var CPNumberUIDs = new CFMutableDictionary();
|
||||
|
||||
/*!
|
||||
@@ -239,6 +241,7 @@ FIXME: Do we need this?
|
||||
{
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -246,35 +249,33 @@ FIXME: Do we need this?
|
||||
{
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (int)intValue
|
||||
{
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
return CAST_TO_INT(self);
|
||||
}
|
||||
|
||||
- (int)integerValue
|
||||
{
|
||||
return CAST_TO_INT(self);
|
||||
}
|
||||
|
||||
- (long long)longLongValue
|
||||
{
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
return CAST_TO_INT(self);
|
||||
}
|
||||
|
||||
- (long)longValue
|
||||
{
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
return CAST_TO_INT(self);
|
||||
}
|
||||
|
||||
- (short)shortValue
|
||||
{
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
return CAST_TO_INT(self);
|
||||
}
|
||||
|
||||
- (CPString)stringValue
|
||||
@@ -289,9 +290,8 @@ FIXME: Do we need this?
|
||||
|
||||
- (unsigned int)unsignedIntValue
|
||||
{
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
// Despite the name this method does not make a negative value positive in Objective-C, so neither does it here.
|
||||
return CAST_TO_INT(self);
|
||||
}
|
||||
/*
|
||||
- (unsigned long long)unsignedLongLongValue
|
||||
@@ -302,16 +302,14 @@ FIXME: Do we need this?
|
||||
*/
|
||||
- (unsigned long)unsignedLongValue
|
||||
{
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
// Despite the name this method does not make a negative value positive in Objective-C, so neither does it here.
|
||||
return CAST_TO_INT(self);
|
||||
}
|
||||
|
||||
- (unsigned short)unsignedShortValue
|
||||
{
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
// Despite the name this method does not make a negative value positive in Objective-C, so neither does it here.
|
||||
return CAST_TO_INT(self);
|
||||
}
|
||||
|
||||
- (CPComparisonResult)compare:(CPNumber)aNumber
|
||||
|
||||
@@ -275,13 +275,13 @@ CPLog(@"Got some class: %@", inst);
|
||||
}
|
||||
|
||||
/*!
|
||||
Tests whether the receiver implements to the provided selector regardless of inheritance.
|
||||
Tests if the receiver implements the provided selector regardless of inheritance.
|
||||
@param aSelector the selector for which to test the receiver
|
||||
@return \c YES if the receiver implements the selector
|
||||
*/
|
||||
- (BOOL)implementsSelector:(SEL)aSelector
|
||||
{
|
||||
var methods = class_copyMethodList(isa),
|
||||
var methods = class_copyMethodList([self class]),
|
||||
count = methods.length;
|
||||
|
||||
while (count--)
|
||||
|
||||
@@ -200,6 +200,7 @@ var CPRunLoopLastNativeRunLoop = 0;
|
||||
|
||||
CPArray _orderedPerforms;
|
||||
int _runLoopInsuranceTimer;
|
||||
CPArray _observers;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -224,6 +225,7 @@ var CPRunLoopLastNativeRunLoop = 0;
|
||||
_timersForModes = {};
|
||||
_nativeTimersForModes = {};
|
||||
_nextTimerFireDatesForModes = {};
|
||||
_observers = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -473,6 +475,19 @@ var CPRunLoopLastNativeRunLoop = 0;
|
||||
else
|
||||
_orderedPerforms = performs;
|
||||
|
||||
if (_observers)
|
||||
{
|
||||
var count = _observers.length;
|
||||
while(count--)
|
||||
{
|
||||
var obs = _observers[count];
|
||||
obs.callout();
|
||||
|
||||
if (!obs.repeats)
|
||||
_observers.splice(count, 1);
|
||||
}
|
||||
}
|
||||
|
||||
_runLoopLock = NO;
|
||||
|
||||
return nextFireDate;
|
||||
|
||||
@@ -731,6 +731,14 @@ var CPStringNull = [CPNull null];
|
||||
return parseInt(self, 10);
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the text as an integer
|
||||
*/
|
||||
- (int)integerValue
|
||||
{
|
||||
return parseInt(self, 10);
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns an the path components of this string. This
|
||||
method assumes that the string's content is a '/'
|
||||
|
||||
+32
-24
@@ -97,6 +97,8 @@ CPURLRequestReturnCacheDataDontLoad = 3;
|
||||
{
|
||||
_cachePolicy = aCachePolicy;
|
||||
_timeoutInterval = aTimeoutInterval;
|
||||
|
||||
[self _updateCacheControlHeader];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -122,31 +124,8 @@ CPURLRequestReturnCacheDataDontLoad = 3;
|
||||
_cachePolicy = CPURLRequestUseProtocolCachePolicy;
|
||||
|
||||
[self setValue:"Thu, 01 Jan 1970 00:00:00 GMT" forHTTPHeaderField:"If-Modified-Since"];
|
||||
|
||||
switch (_cachePolicy)
|
||||
{
|
||||
case CPURLRequestUseProtocolCachePolicy:
|
||||
// TODO: implement everything about cache...
|
||||
[self setValue:"no-cache" forHTTPHeaderField:"Cache-Control"];
|
||||
break;
|
||||
|
||||
case CPURLRequestReturnCacheDataElseLoad:
|
||||
[self setValue:"max-stale=31536000" forHTTPHeaderField:"Cache-Control"];
|
||||
break;
|
||||
|
||||
case CPURLRequestReturnCacheDataDontLoad:
|
||||
[self setValue:"only-if-cached" forHTTPHeaderField:"Cache-Control"];
|
||||
break;
|
||||
|
||||
case CPURLRequestReloadIgnoringLocalCacheData:
|
||||
[self setValue:"no-cache" forHTTPHeaderField:"Cache-Control"];
|
||||
break;
|
||||
|
||||
default:
|
||||
[self setValue:"no-cache" forHTTPHeaderField:"Cache-Control"];
|
||||
}
|
||||
|
||||
[self setValue:"XMLHttpRequest" forHTTPHeaderField:"X-Requested-With"];
|
||||
[self _updateCacheControlHeader];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -181,6 +160,35 @@ CPURLRequestReturnCacheDataDontLoad = 3;
|
||||
[_HTTPHeaderFields setObject:aValue forKey:aField];
|
||||
}
|
||||
|
||||
/*
|
||||
@ignore
|
||||
*/
|
||||
- (void)_updateCacheControlHeader
|
||||
{
|
||||
switch (_cachePolicy)
|
||||
{
|
||||
case CPURLRequestUseProtocolCachePolicy:
|
||||
// TODO: implement everything about cache...
|
||||
[self setValue:"no-cache" forHTTPHeaderField:"Cache-Control"];
|
||||
break;
|
||||
|
||||
case CPURLRequestReturnCacheDataElseLoad:
|
||||
[self setValue:"max-stale=31536000" forHTTPHeaderField:"Cache-Control"];
|
||||
break;
|
||||
|
||||
case CPURLRequestReturnCacheDataDontLoad:
|
||||
[self setValue:"only-if-cached" forHTTPHeaderField:"Cache-Control"];
|
||||
break;
|
||||
|
||||
case CPURLRequestReloadIgnoringLocalCacheData:
|
||||
[self setValue:"no-cache" forHTTPHeaderField:"Cache-Control"];
|
||||
break;
|
||||
|
||||
default:
|
||||
[self setValue:"no-cache" forHTTPHeaderField:"Cache-Control"];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/*
|
||||
|
||||
@@ -209,16 +209,16 @@ Executable.prototype.setCode = function(code)
|
||||
{
|
||||
#endif
|
||||
#if DEBUG
|
||||
// "//@ sourceURL=" at the end lets us name our eval'd files for debuggers, etc.
|
||||
// "//# sourceURL=" at the end lets us name our eval'd files for debuggers, etc.
|
||||
// * WebKit: http://pmuellr.blogspot.com/2009/06/debugger-friendly.html
|
||||
// * Firebug: http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
|
||||
//if (YES) {
|
||||
var absoluteString = this.URL().absoluteString();
|
||||
|
||||
code += "/**/\n//@ sourceURL=" + absoluteString;
|
||||
code += "/**/\n//# sourceURL=" + absoluteString;
|
||||
//} else {
|
||||
// // Firebug only does it for "eval()", not "new Function()". Ugh. Slower.
|
||||
// var functionText = "(function(){"+GET_CODE(aFragment)+"/**/\n})\n//@ sourceURL="+GET_FILE(aFragment).path;
|
||||
// var functionText = "(function(){"+GET_CODE(aFragment)+"/**/\n})\n//# sourceURL="+GET_FILE(aFragment).path;
|
||||
// compiled = eval(functionText);
|
||||
//}
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ Getting Started
|
||||
---------------
|
||||
To get started, download and install the current release version of Cappuccino:
|
||||
|
||||
$ curl https://raw.githubusercontent.com/cappuccino/cappuccino/v0.9.8/bootstrap.sh >/tmp/cappuccino_bootstrap.sh && bash /tmp/cappuccino_bootstrap.sh
|
||||
$ curl https://raw.githubusercontent.com/cappuccino/cappuccino/v0.9.9/bootstrap.sh >/tmp/cappuccino_bootstrap.sh && bash /tmp/cappuccino_bootstrap.sh
|
||||
|
||||
If you'd just like to get started using Cappuccino for your web apps, you are done.
|
||||
|
||||
|
||||
@@ -62,6 +62,49 @@
|
||||
[self assert:[CPIndexSet indexSet] equals:[_collectionView selectionIndexes]];
|
||||
}
|
||||
|
||||
- (void)_testCollectionViewItemIsSelected
|
||||
{
|
||||
var itemPrototype = [[CPCollectionViewItem alloc] init];
|
||||
[_collectionView setItemPrototype:itemPrototype];
|
||||
[_collectionView setContent:[1, 2, 3]];
|
||||
|
||||
[_collectionView setSelectionIndexes:[CPIndexSet indexSetWithIndex:1]];
|
||||
[self assertTrue:[[_collectionView itemAtIndex:1] isSelected]];
|
||||
|
||||
[_collectionView setSelectionIndexes:[CPIndexSet indexSetWithIndex:0]];
|
||||
[self assertTrue:[[_collectionView itemAtIndex:0] isSelected]];
|
||||
// The item is correctly deselected when the selection indexes changes.
|
||||
[self assertFalse:[[_collectionView itemAtIndex:1] isSelected]];
|
||||
}
|
||||
|
||||
- (void)testBindingSupport
|
||||
{
|
||||
var content = [1,2,3];
|
||||
var ac = [[CPArrayController alloc] initWithContent:content];
|
||||
[ac setSelectsInsertedObjects:YES];
|
||||
[_collectionView bind:CPContentBinding toObject:ac withKeyPath:@"arrangedObjects" options:nil];
|
||||
[_collectionView bind:CPSelectionIndexesBinding toObject:ac withKeyPath:@"selectionIndexes" options:nil];
|
||||
|
||||
[self assert:[1,2,3] equals:[_collectionView content]];
|
||||
|
||||
[ac setContent:[6,7]];
|
||||
[self assert:[6,7] equals:[_collectionView content]];
|
||||
|
||||
[ac setSelectionIndexes:[CPIndexSet indexSetWithIndex:1]];
|
||||
[self assert:[CPIndexSet indexSetWithIndex:1] equals:[_collectionView selectionIndexes]];
|
||||
|
||||
[ac insertObject:4 atArrangedObjectIndex:2];
|
||||
[self assert:[CPIndexSet indexSetWithIndex:2] equals:[_collectionView selectionIndexes]];
|
||||
|
||||
// collection view selection is reflected on the array controller selection
|
||||
[_collectionView setSelectionIndexes:[CPIndexSet indexSetWithIndex:0]];
|
||||
[self assert:[CPIndexSet indexSetWithIndex:0] equals:[ac selectionIndexes]];
|
||||
|
||||
// collection view content is reflected on the array controller content
|
||||
//[_collectionView setContent:[8,9]];
|
||||
//[self assert:[8,9] equals:[ac content]];
|
||||
}
|
||||
|
||||
- (void)testSetContentAndSelectionIndexes
|
||||
{
|
||||
// Changing the content does not automatically clear the selection indexes. The previous
|
||||
|
||||
@@ -324,6 +324,36 @@
|
||||
[self assert:2 equals:[[self button] indexOfSelectedItem]];
|
||||
}
|
||||
|
||||
- (void)testSimpleObjectBindingArrayControllerWithLateContent
|
||||
{
|
||||
var arrayController = [[CPArrayController alloc] init],
|
||||
objectController = [[CPObjectController alloc] init],
|
||||
testObject = [CPMutableDictionary dictionary],
|
||||
martin = [CPDictionary dictionaryWithJSObject:{@"name": @"Martin"}],
|
||||
malte = [CPDictionary dictionaryWithJSObject:{@"name": @"Malte"}],
|
||||
johan = [CPDictionary dictionaryWithJSObject:{@"name": @"Johan"}],
|
||||
menuObjects = [martin, malte, johan];
|
||||
|
||||
[testObject setObject:@"I'm a testObject" forKey:@"Who am I"];
|
||||
[objectController setContent:testObject];
|
||||
|
||||
[button bind:CPContentBinding toObject:arrayController withKeyPath:@"arrangedObjects" options:nil];
|
||||
[button bind:CPContentValuesBinding toObject:arrayController withKeyPath:@"arrangedObjects.name" options:nil];
|
||||
[button bind:CPSelectedObjectBinding toObject:objectController withKeyPath:@"selection.xxx" options:nil];
|
||||
|
||||
[testObject setObject:martin forKey:@"xxx"];
|
||||
[arrayController setContent:menuObjects];
|
||||
[self assert:0 equals:[[self button] indexOfSelectedItem]];
|
||||
[arrayController setContent:nil];
|
||||
[testObject setObject:malte forKey:@"xxx"];
|
||||
[arrayController setContent:menuObjects];
|
||||
[self assert:1 equals:[[self button] indexOfSelectedItem]];
|
||||
[arrayController setContent:nil];
|
||||
[testObject setObject:johan forKey:@"xxx"];
|
||||
[arrayController setContent:menuObjects];
|
||||
[self assert:2 equals:[[self button] indexOfSelectedItem]];
|
||||
}
|
||||
|
||||
- (void)testObjectBindingNullPlaceholderOption
|
||||
{
|
||||
var arrayController = [[CPArrayController alloc] init],
|
||||
|
||||
@@ -57,4 +57,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testObjectValueWithRightWildcard
|
||||
{
|
||||
[self _testAttribute:CPDateAttributeType value:[CPDate date]];
|
||||
[self _testAttribute:CPInteger16AttributeType value:2.0];
|
||||
[self _testAttribute:CPDoubleAttributeType value:2.5];
|
||||
[self _testAttribute:CPFloatAttributeType value:2.5];
|
||||
[self _testAttribute:CPStringAttributeType value:@"toto"];
|
||||
[self _testAttribute:CPBooleanAttributeType value:1];
|
||||
}
|
||||
|
||||
- (void)_testAttribute:(int)attr value:(id)value
|
||||
{
|
||||
var leftExp = [CPExpression expressionForKeyPath:@"keypath"],
|
||||
rightExp = [CPExpression expressionForConstantValue:value],
|
||||
predicate = [CPComparisonPredicate predicateWithLeftExpression:leftExp rightExpression:rightExp modifier:0 type:CPEqualToPredicateOperatorType options:0],
|
||||
compound = [[CPCompoundPredicate alloc] initWithType:CPAndPredicateType subpredicates:@[predicate]];
|
||||
|
||||
var t1 = [[CPPredicateEditorRowTemplate alloc] initWithCompoundTypes:[0,1,2]],
|
||||
t2 = [[CPPredicateEditorRowTemplate alloc] initWithLeftExpressions:@[leftExp] rightExpressionAttributeType:attr modifier:0 operators:@[CPEqualToPredicateOperatorType] options:0];
|
||||
|
||||
[_editor setRowTemplates:@[t1, t2]];
|
||||
|
||||
[_editor setObjectValue:compound];
|
||||
[_editor reloadPredicate];
|
||||
[self assert:compound equals:[_editor objectValue]];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPViewControllerTest
|
||||
*
|
||||
* Created by You on May 9, 2016.
|
||||
* Copyright 2016, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPWindow theWindow;
|
||||
@outlet CPViewController viewController;
|
||||
BOOL isViewLoaded;
|
||||
}
|
||||
|
||||
- (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.
|
||||
|
||||
isViewLoaded = NO;
|
||||
// In this case, we want the window from Cib to become our full browser window
|
||||
[theWindow setFullPlatformWindow:YES];
|
||||
}
|
||||
|
||||
- (IBAction)load:(id)sender
|
||||
{
|
||||
[viewController loadViewWithCompletionHandler:function(view, error)
|
||||
{
|
||||
[view setBackgroundColor:[CPColor redColor]];
|
||||
[view setFrameOrigin:CGPointMake(100,100)];
|
||||
[[theWindow contentView] addSubview:view];
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 2014 Nuage Networks
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
// Import this Categories from your application
|
||||
// You can now user -(void)setCucappIdentifier: and -(CPString)cucappIdentifier
|
||||
// to set and get your cucapp IDs.
|
||||
// Then from a test, you can use it as a selector like //CPView[cucappIdentifier="my-button"]
|
||||
|
||||
@import <AppKit/CPResponder.j>
|
||||
@import <AppKit/CPMenuItem.j>
|
||||
|
||||
@implementation CPResponder (cucappAdditions)
|
||||
|
||||
- (void)setCucappIdentifier:(CPString)anIdentifier
|
||||
{
|
||||
self.__cucappIdentifier = anIdentifier;
|
||||
}
|
||||
|
||||
- (CPString)cucappIdentifier
|
||||
{
|
||||
return self.__cucappIdentifier;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPMenuItem (cucappAdditionsMenu)
|
||||
|
||||
- (void)setCucappIdentifier:(CPString)anIdentifier
|
||||
{
|
||||
[[self _menuItemView] setCucappIdentifier:anIdentifier];
|
||||
}
|
||||
|
||||
- (CPString)cucappIdentifier
|
||||
{
|
||||
[[self _menuItemView] cucappIdentifier];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
function load_cucapp_CLI(path)
|
||||
{
|
||||
if (!path)
|
||||
path = "Cucapp/lib/Cucumber.j"
|
||||
|
||||
try {
|
||||
objj_importFile(path, true, function() {
|
||||
[Cucumber stopCucumber];
|
||||
CPLog.debug("Cucapp CLI has been well loaded");
|
||||
_addition_cpapplication_send_event_method();
|
||||
});
|
||||
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
[CPException raise:CPInvalidArgumentException reason:@"Invalid path for the lib Cucumber"];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function load_cucapp_record(path)
|
||||
{
|
||||
if (!path)
|
||||
path = "CuCapp+Record.j"
|
||||
|
||||
try {
|
||||
objj_importFile(path, true, function() {
|
||||
CPLog.debug("Cucapp record has been well loaded");
|
||||
});
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
[CPException raise:CPInvalidArgumentException reason:@"Invalid path for the lib Cucapp+Record.j"];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,591 @@
|
||||
@import <AppKit/CPApplication.j>
|
||||
|
||||
function start_record(path)
|
||||
{
|
||||
[CPWindow start_record];
|
||||
}
|
||||
|
||||
function stop_record()
|
||||
{
|
||||
[CPWindow stop_record];
|
||||
}
|
||||
|
||||
function save_record(fileName)
|
||||
{
|
||||
if (!fileName)
|
||||
fileName = @"record"
|
||||
|
||||
var eventRecords = [CPWindow eventRecords],
|
||||
JSONEvents = [];
|
||||
|
||||
for (var i = 0; i < [eventRecords count]; i++)
|
||||
{
|
||||
var eventRecord = eventRecords[i];
|
||||
[JSONEvents addObject:[eventRecord objectToJSON]];
|
||||
}
|
||||
|
||||
var pom = document.createElement('a');
|
||||
pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(JSON.stringify(JSONEvents, null, 4)));
|
||||
pom.setAttribute('download', fileName + ".json");
|
||||
pom.click();
|
||||
}
|
||||
|
||||
function play_record(file_name, cucumber_path)
|
||||
{
|
||||
if (!cucumber_path)
|
||||
cucumber_path = path = "../../Cucapp/lib/Cucumber.j";
|
||||
|
||||
load_cucapp_CLI(cucumber_path);
|
||||
|
||||
setTimeout(function(){
|
||||
_load_javascript_file(file_name)
|
||||
},1000);
|
||||
}
|
||||
|
||||
function _load_javascript_file(file_name)
|
||||
{
|
||||
var AJAX_req = new XMLHttpRequest();
|
||||
AJAX_req.open( "GET", file_name, true );
|
||||
AJAX_req.setRequestHeader("Content-type", "application/json");
|
||||
|
||||
AJAX_req.onreadystatechange = function()
|
||||
{
|
||||
if (AJAX_req.readyState == 4)
|
||||
{
|
||||
var recordingEvents = JSON.parse(AJAX_req.responseText);
|
||||
|
||||
for (var i = 0; i < [recordingEvents count]; i++)
|
||||
{
|
||||
var recordingEvent = JSON.parse(recordingEvents[i]),
|
||||
type = recordingEvent["event"]["type"];
|
||||
|
||||
if (type == CPLeftMouseDown && i < [recordingEvents count] - 1)
|
||||
{
|
||||
var nextRecordingEvent = JSON.parse(recordingEvents[i + 1]),
|
||||
nextType = nextRecordingEvent["event"]["type"];
|
||||
|
||||
if (nextType == CPMouseMoved)
|
||||
{
|
||||
for (var j = i; j < [recordingEvents count]; j++)
|
||||
{
|
||||
var tmpRecordingEvent = JSON.parse(recordingEvents[j]),
|
||||
tmpType = tmpRecordingEvent["event"]["type"];
|
||||
|
||||
if (tmpType == CPLeftMouseUp)
|
||||
{
|
||||
setTimeout(_simulate_drag_event, recordingEvent["event"]["timestamp"] * 1000, recordingEvent, tmpRecordingEvent);
|
||||
i = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(_simulate_event, recordingEvent["event"]["timestamp"] * 1000, recordingEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AJAX_req.send();
|
||||
}
|
||||
|
||||
function _simulate_drag_event(event1, event2)
|
||||
{
|
||||
var keyView1 = event1["keyView"],
|
||||
valueView1 = event1["valueView"],
|
||||
keyView2 = event2["keyView"],
|
||||
valueView2 = event2["valueView"],
|
||||
locationInWindow1 = CGPointMake(event1["event"]["locationInWindow"]["x"], event1["event"]["locationInWindow"]["y"]);
|
||||
locationInWindow2 = CGPointMake(event2["event"]["locationInWindow"]["x"], event2["event"]["locationInWindow"]["y"]);
|
||||
|
||||
if (keyView1 && valueView1 && keyView2 && valueView2)
|
||||
simulate_dragged_click_view_to_view(keyView1, valueView1, keyView2, valueView2);
|
||||
else if (keyView1 && valueView1)
|
||||
simulate_dragged_click_view_to_point(keyView1, valueView1, locationInWindow1.x, locationInWindow1.y);
|
||||
else
|
||||
simulate_dragged_click_point_to_point(locationInWindow1.x, locationInWindow1.y, locationInWindow2.x, locationInWindow2.y);
|
||||
}
|
||||
|
||||
function _simulate_event(event)
|
||||
{
|
||||
var type = event["event"]["type"],
|
||||
keyView = event["keyView"],
|
||||
valueView = event["valueView"],
|
||||
characters = event["event"]["characters"],
|
||||
deltaX = event["event"]["deltaX"],
|
||||
deltaY = event["event"]["deltaY"],
|
||||
deltaZ = event["event"]["deltaZ"],
|
||||
deltaZ = event["event"]["deltaZ"],
|
||||
locationInWindow = CGPointMake(event["event"]["locationInWindow"]["x"], event["event"]["locationInWindow"]["y"]);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case CPScrollWheel:
|
||||
|
||||
if (keyView && valueView)
|
||||
simulate_scroll_wheel_on_view(keyView, valueView, deltaX, deltaY)
|
||||
|
||||
break;
|
||||
|
||||
case CPLeftMouseDown:
|
||||
|
||||
if (keyView && valueView)
|
||||
simulate_left_click_on_view(keyView, valueView);
|
||||
else
|
||||
simulate_left_click_on_point(locationInWindow.x, locationInWindow.y)
|
||||
|
||||
break;
|
||||
|
||||
case CPRightMouseDown:
|
||||
|
||||
if (keyView && valueView)
|
||||
simulate_right_click_on_view(keyView, valueView);
|
||||
else
|
||||
simulate_right_click_on_point(locationInWindow.x, locationInWindow.y)
|
||||
|
||||
break;
|
||||
|
||||
case CPKeyDown:
|
||||
simulate_keyboard_event(characters);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var eventRecords,
|
||||
recording = NO;
|
||||
|
||||
@implementation CPWindow (cucappRecord)
|
||||
|
||||
+ (CPArray)eventRecords
|
||||
{
|
||||
return eventRecords;
|
||||
}
|
||||
|
||||
+ (void)start_record
|
||||
{
|
||||
eventRecords = [];
|
||||
recording = YES;
|
||||
}
|
||||
|
||||
+ (void)stop_record
|
||||
{
|
||||
recording = NO;
|
||||
}
|
||||
|
||||
/*!
|
||||
Dispatches events that are sent to it from CPApplication.
|
||||
@param anEvent the event to be dispatched
|
||||
*/
|
||||
- (void)sendEvent:(CPEvent)anEvent
|
||||
{
|
||||
var type = [anEvent type],
|
||||
sheet = [self attachedSheet],
|
||||
recordingEvent = [[RecordingEvent alloc] initWithEvent:anEvent];
|
||||
|
||||
if (recordingEvent && type != CPFlagsChanged && type != CPMouseMoved)
|
||||
[eventRecords addObject:recordingEvent];
|
||||
|
||||
// If a sheet is attached events get filtered here.
|
||||
// It is not clear what events should be passed to the view, perhaps all?
|
||||
// CPLeftMouseDown is needed for window moving and resizing to work.
|
||||
// CPMouseMoved is needed for rollover effects on title bar buttons.
|
||||
|
||||
if (sheet)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case CPLeftMouseDown:
|
||||
|
||||
// This is needed when a doubleClick occurs when the sheet is closing or opening
|
||||
if (!_parentWindow)
|
||||
return;
|
||||
|
||||
[recordingEvent setView:_windowView];
|
||||
|
||||
[_windowView mouseDown:anEvent];
|
||||
|
||||
// -dw- if the window is clicked, the sheet should come to front, and become key,
|
||||
// and the window should be immediately behind
|
||||
[sheet makeKeyAndOrderFront:self];
|
||||
|
||||
return;
|
||||
|
||||
case CPMouseMoved:
|
||||
// Allow these through to the parent
|
||||
break;
|
||||
|
||||
default:
|
||||
// Everything else is filtered
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var point = [anEvent locationInWindow];
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case CPFlagsChanged:
|
||||
return [[self firstResponder] flagsChanged:anEvent];
|
||||
|
||||
case CPKeyUp:
|
||||
return [[self firstResponder] keyUp:anEvent];
|
||||
|
||||
case CPKeyDown:
|
||||
if ([anEvent charactersIgnoringModifiers] === CPTabCharacter)
|
||||
{
|
||||
if ([anEvent modifierFlags] & CPShiftKeyMask)
|
||||
[self selectPreviousKeyView:self];
|
||||
else
|
||||
[self selectNextKeyView:self];
|
||||
|
||||
// Make sure the browser doesn't try to do its own tab handling.
|
||||
// This is important or the browser might blur the shared text field or token field input field,
|
||||
// even that we just moved it to a new first responder.
|
||||
[[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO]
|
||||
return;
|
||||
}
|
||||
else if ([anEvent charactersIgnoringModifiers] === CPBackTabCharacter)
|
||||
{
|
||||
var didTabBack = [self selectPreviousKeyView:self];
|
||||
|
||||
if (didTabBack)
|
||||
{
|
||||
// Make sure the browser doesn't try to do its own tab handling.
|
||||
// This is important or the browser might blur the shared text field or token field input field,
|
||||
// even that we just moved it to a new first responder.
|
||||
[[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO]
|
||||
}
|
||||
return didTabBack;
|
||||
}
|
||||
else if ([anEvent charactersIgnoringModifiers] == CPEscapeFunctionKey && [self _processKeyboardUIKey:anEvent])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
[[self firstResponder] keyDown:anEvent];
|
||||
|
||||
// Trigger the default button if needed
|
||||
// FIXME: Is this only applicable in a sheet? See isse: #722.
|
||||
if (![self disableKeyEquivalentForDefaultButton])
|
||||
{
|
||||
var defaultButton = [self defaultButton],
|
||||
keyEquivalent = [defaultButton keyEquivalent],
|
||||
modifierMask = [defaultButton keyEquivalentModifierMask];
|
||||
|
||||
if ([anEvent _triggersKeyEquivalent:keyEquivalent withModifierMask:modifierMask])
|
||||
[[self defaultButton] performClick:self];
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
case CPScrollWheel:
|
||||
[recordingEvent setView:[_windowView hitTest:point]];
|
||||
|
||||
return [[_windowView hitTest:point] scrollWheel:anEvent];
|
||||
|
||||
case CPLeftMouseUp:
|
||||
case CPRightMouseUp:
|
||||
var hitTestedView = _leftMouseDownView,
|
||||
selector = type == CPRightMouseUp ? @selector(rightMouseUp:) : @selector(mouseUp:);
|
||||
|
||||
if (!hitTestedView)
|
||||
hitTestedView = [_windowView hitTest:point];
|
||||
|
||||
[recordingEvent setView:hitTestedView];
|
||||
|
||||
[hitTestedView performSelector:selector withObject:anEvent];
|
||||
|
||||
_leftMouseDownView = nil;
|
||||
|
||||
return;
|
||||
|
||||
case CPLeftMouseDown:
|
||||
case CPRightMouseDown:
|
||||
// This will return _windowView if it is within a resize region
|
||||
_leftMouseDownView = [_windowView hitTest:point];
|
||||
|
||||
[recordingEvent setView:_leftMouseDownView];
|
||||
|
||||
if (_leftMouseDownView !== _firstResponder && [_leftMouseDownView acceptsFirstResponder])
|
||||
[self makeFirstResponder:_leftMouseDownView];
|
||||
|
||||
[CPApp activateIgnoringOtherApps:YES];
|
||||
|
||||
var theWindow = [anEvent window],
|
||||
selector = type == CPRightMouseDown ? @selector(rightMouseDown:) : @selector(mouseDown:);
|
||||
|
||||
if ([theWindow isKeyWindow] || ([theWindow becomesKeyOnlyIfNeeded] && ![_leftMouseDownView needsPanelToBecomeKey]))
|
||||
return [_leftMouseDownView performSelector:selector withObject:anEvent];
|
||||
else
|
||||
{
|
||||
// FIXME: delayed ordering?
|
||||
[self makeKeyAndOrderFront:self];
|
||||
|
||||
if ([_leftMouseDownView acceptsFirstMouse:anEvent])
|
||||
return [_leftMouseDownView performSelector:selector withObject:anEvent];
|
||||
}
|
||||
break;
|
||||
|
||||
case CPLeftMouseDragged:
|
||||
case CPRightMouseDragged:
|
||||
if (!_leftMouseDownView)
|
||||
{
|
||||
[recordingEvent setView:[_windowView hitTest:point]];
|
||||
return [[_windowView hitTest:point] mouseDragged:anEvent];
|
||||
}
|
||||
|
||||
[recordingEvent setView:_leftMouseDownView];
|
||||
|
||||
var selector;
|
||||
|
||||
if (type == CPRightMouseDragged)
|
||||
{
|
||||
selector = @selector(rightMouseDragged:)
|
||||
if (![_leftMouseDownView respondsToSelector:selector])
|
||||
selector = nil;
|
||||
}
|
||||
|
||||
if (!selector)
|
||||
selector = @selector(mouseDragged:)
|
||||
|
||||
return [_leftMouseDownView performSelector:selector withObject:anEvent];
|
||||
|
||||
case CPMouseMoved:
|
||||
[_windowView setCursorForLocation:point resizing:NO];
|
||||
|
||||
// Ignore mouse moves for parents of sheets
|
||||
if (!_acceptsMouseMovedEvents || sheet)
|
||||
return;
|
||||
|
||||
if (!_mouseEnteredStack)
|
||||
_mouseEnteredStack = [];
|
||||
|
||||
var hitTestView = [_windowView hitTest:point];
|
||||
|
||||
if ([_mouseEnteredStack count] && [_mouseEnteredStack lastObject] === hitTestView)
|
||||
return [hitTestView mouseMoved:anEvent];
|
||||
|
||||
var view = hitTestView,
|
||||
mouseEnteredStack = [];
|
||||
|
||||
while (view)
|
||||
{
|
||||
mouseEnteredStack.unshift(view);
|
||||
|
||||
view = [view superview];
|
||||
}
|
||||
|
||||
var deviation = MIN(_mouseEnteredStack.length, mouseEnteredStack.length);
|
||||
|
||||
while (deviation--)
|
||||
if (_mouseEnteredStack[deviation] === mouseEnteredStack[deviation])
|
||||
break;
|
||||
|
||||
var index = deviation + 1,
|
||||
count = _mouseEnteredStack.length;
|
||||
|
||||
if (index < count)
|
||||
{
|
||||
var event = [CPEvent mouseEventWithType:CPMouseExited location:point modifierFlags:[anEvent modifierFlags] timestamp:[anEvent timestamp] windowNumber:_windowNumber context:nil eventNumber:-1 clickCount:1 pressure:0];
|
||||
|
||||
for (; index < count; ++index)
|
||||
[_mouseEnteredStack[index] mouseExited:event];
|
||||
}
|
||||
|
||||
index = deviation + 1;
|
||||
count = mouseEnteredStack.length;
|
||||
|
||||
if (index < count)
|
||||
{
|
||||
var event = [CPEvent mouseEventWithType:CPMouseEntered location:point modifierFlags:[anEvent modifierFlags] timestamp:[anEvent timestamp] windowNumber:_windowNumber context:nil eventNumber:-1 clickCount:1 pressure:0];
|
||||
|
||||
for (; index < count; ++index)
|
||||
[mouseEnteredStack[index] mouseEntered:event];
|
||||
}
|
||||
|
||||
_mouseEnteredStack = mouseEnteredStack;
|
||||
|
||||
[hitTestView mouseMoved:anEvent];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation RecordingEvent : CPObject
|
||||
{
|
||||
CPEvent _event @accessors(property=event);
|
||||
CPString _keyView @accessors(property=keyView);
|
||||
CPString _valueView @accessors(property=valueView);
|
||||
CGPoint _offsetView @accessors(property=offsetView);
|
||||
int _offsetXPercentage @accessors(property=offsetXPercentage);
|
||||
int _offsetYPercentage @accessors(property=offsetYPercentage);
|
||||
}
|
||||
|
||||
- (id)initWithEvent:(CPEvent)anEvent
|
||||
{
|
||||
if (self = [super init])
|
||||
{
|
||||
_event = anEvent;
|
||||
_offsetView = CGPointMakeZero();
|
||||
_keyView = @"";
|
||||
_valueView = @"";
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setView:(CPView)aView
|
||||
{
|
||||
if ([aView respondsToSelector:@selector(cucappIdentifier)])
|
||||
{
|
||||
_keyView = @"cucappIdentifier";
|
||||
_valueView = [aView cucappIdentifier];
|
||||
}
|
||||
else if ([aView respondsToSelector:@selector(identifier)])
|
||||
{
|
||||
_keyView = @"identifier";
|
||||
_valueView = [aView identifier];
|
||||
}
|
||||
else if ([aView respondsToSelector:@selector(title)])
|
||||
{
|
||||
_keyView = @"title";
|
||||
_valueView = [aView title];
|
||||
}
|
||||
else if ([aView respondsToSelector:@selector(placeholderString)])
|
||||
{
|
||||
_keyView = @"placeholderString";
|
||||
_valueView = [aView placeholderString];
|
||||
}
|
||||
else if ([aView respondsToSelector:@selector(text)])
|
||||
{
|
||||
_keyView = @"text";
|
||||
_valueView = [aView text];
|
||||
}
|
||||
else if ([aView respondsToSelector:@selector(tag)])
|
||||
{
|
||||
_keyView = @"tag";
|
||||
_valueView = [aView tag];
|
||||
}
|
||||
else if ([aView respondsToSelector:@selector(label)])
|
||||
{
|
||||
_keyView = @"label";
|
||||
_valueView = [aView label];
|
||||
}
|
||||
else if ([aView respondsToSelector:@selector(objectValue)])
|
||||
{
|
||||
_keyView = @"objectValue";
|
||||
_valueView = [aView objectValue];
|
||||
}
|
||||
|
||||
var globalPoint = [[aView superview] convertPointToBase:[aView frameOrigin]],
|
||||
globalEventPoint = [_event locationInWindow];
|
||||
|
||||
_offsetView = CGPointMake(globalEventPoint.x - globalPoint.x, globalEventPoint.y - globalPoint.y);
|
||||
|
||||
_offsetXPercentage = _offsetView.x * 100 / [aView frameSize].width;
|
||||
_offsetYPercentage = _offsetView.y * 100 / [aView frameSize].height;
|
||||
}
|
||||
|
||||
- (CPString)objectToJSON
|
||||
{
|
||||
var json = {};
|
||||
|
||||
json["keyView"] = _keyView;
|
||||
json["valueView"] = _valueView;
|
||||
json["offsetXPercentage"] = _offsetXPercentage;
|
||||
json["offsetYPercentage"] = _offsetYPercentage;
|
||||
json["offsetView"] = {"x" : _offsetView.x, "y" : _offsetView.y};
|
||||
|
||||
var event = {};
|
||||
event["type"] = [_event type];
|
||||
event["deltaX"] = [_event deltaX];
|
||||
event["deltaY"] = [_event deltaY];
|
||||
event["deltaZ"] = [_event deltaZ];
|
||||
event["characters"] = [_event characters];
|
||||
event["charactersIgnoringModifiers"] = [_event charactersIgnoringModifiers];
|
||||
event["clickCount"] = [_event clickCount];
|
||||
event["modifierFlags"] = [_event modifierFlags];
|
||||
event["locationInWindow"] = {"x" : [_event locationInWindow].x, "y" : [_event locationInWindow].y};
|
||||
event["keyCode"] = [_event keyCode];
|
||||
event["timestamp"] = [_event timestamp];
|
||||
|
||||
json["event"] = event;
|
||||
|
||||
return JSON.stringify(json, null, 4);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation CPApplication (cucappRecord)
|
||||
|
||||
/*!
|
||||
Dispatches events to other objects.
|
||||
@param anEvent the event to dispatch
|
||||
*/
|
||||
- (void)sendEvent:(CPEvent)anEvent
|
||||
{
|
||||
_currentEvent = anEvent;
|
||||
CPEventModifierFlags = [anEvent modifierFlags];
|
||||
|
||||
var theWindow = [anEvent window];
|
||||
|
||||
// Check if this is a candidate for key equivalent...
|
||||
if ([anEvent _couldBeKeyEquivalent] && [self _handleKeyEquivalent:anEvent])
|
||||
// The key equivalent was handled.
|
||||
return;
|
||||
|
||||
if ([anEvent type] == CPMouseMoved)
|
||||
{
|
||||
if (theWindow !== _lastMouseMoveWindow)
|
||||
[_lastMouseMoveWindow _mouseExitedResizeRect];
|
||||
|
||||
_lastMouseMoveWindow = theWindow;
|
||||
}
|
||||
|
||||
/*
|
||||
Event listeners are processed from back to front so that newer event listeners normally take
|
||||
precedence. If during the execution of a callback a new event listener is added, it should
|
||||
be inserted after the current callback but before any higher priority callbacks. This makes
|
||||
repeating event listeners (those that reinsert themselves) stable relative to each other.
|
||||
*/
|
||||
for (var i = _eventListeners.length - 1; i >= 0; i--)
|
||||
{
|
||||
var listener = _eventListeners[i];
|
||||
|
||||
if (listener._mask & (1 << [anEvent type]))
|
||||
{
|
||||
_eventListeners.splice(i, 1);
|
||||
// In case the callback wants to add more listeners.
|
||||
_eventListenerInsertionIndex = i;
|
||||
listener._callback(anEvent);
|
||||
|
||||
var type = [anEvent type],
|
||||
recordingEvent = [[RecordingEvent alloc] initWithEvent:anEvent];
|
||||
|
||||
if (recordingEvent && type != CPFlagsChanged && type != CPMouseMoved)
|
||||
[eventRecords addObject:recordingEvent];
|
||||
|
||||
if (theWindow)
|
||||
[recordingEvent setView:[theWindow._windowView hitTest:[anEvent locationInWindow]]];
|
||||
|
||||
if (listener._dequeue)
|
||||
{
|
||||
// Don't process the event normally and don't send it to any other listener.
|
||||
_eventListenerInsertionIndex = _eventListeners.length;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_eventListenerInsertionIndex = _eventListeners.length;
|
||||
|
||||
if (theWindow)
|
||||
[theWindow sendEvent:anEvent];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,14 @@
|
||||
<?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>CPViewControllerTest</string>
|
||||
<key>CPBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>CPHumanReadableCopyright</key>
|
||||
<string>Copyright © 2016, Your Company All rights reserved.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* CPViewControllerTest
|
||||
*
|
||||
* Created by You on May 9, 2016.
|
||||
* Copyright 2016, Your Company 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"),
|
||||
projectName = "CPViewControllerTest";
|
||||
|
||||
app (projectName, function(task)
|
||||
{
|
||||
ENV["OBJJ_INCLUDE_PATHS"] = "Frameworks";
|
||||
|
||||
if (configuration === "Debug")
|
||||
ENV["OBJJ_INCLUDE_PATHS"] = FILE.join(ENV["OBJJ_INCLUDE_PATHS"], configuration);
|
||||
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "CPViewControllerTest.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("CPViewControllerTest");
|
||||
task.setIdentifier("com.yourcompany.CPViewControllerTest");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("CPViewControllerTest");
|
||||
task.setSources(new FileList("**/*.j").exclude(FILE.join("Build", "**")).exclude(FILE.join("Frameworks", "Source", "**")));
|
||||
task.setResources(new FileList("Resources/**"));
|
||||
task.setIndexFilePath("index.html");
|
||||
task.setInfoPlistPath("Info.plist");
|
||||
|
||||
if (configuration === "Debug")
|
||||
task.setCompilerFlags("-DDEBUG -g");
|
||||
else
|
||||
task.setCompilerFlags("-O2");
|
||||
});
|
||||
|
||||
task ("default", [projectName], function()
|
||||
{
|
||||
printResults(configuration);
|
||||
});
|
||||
|
||||
task ("build", ["default"], function()
|
||||
{
|
||||
updateApplicationSize();
|
||||
});
|
||||
|
||||
task ("debug", function()
|
||||
{
|
||||
configuration = ENV["CONFIGURATION"] = "Debug";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("release", function()
|
||||
{
|
||||
configuration = ENV["CONFIGURATION"] = "Release";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("run", ["debug"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Debug", projectName, "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", projectName, "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", projectName));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", projectName), FILE.join("Build", "Deployment", projectName)]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", projectName));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", projectName), FILE.join("Build", "Desktop", projectName, "CPViewControllerTest.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", projectName, "CPViewControllerTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, projectName));
|
||||
print("----------------------------");
|
||||
}
|
||||
|
||||
function updateApplicationSize()
|
||||
{
|
||||
print("Calculating application file sizes...");
|
||||
|
||||
var contents = FILE.read(FILE.join("Build", configuration, projectName, "Info.plist"), { charset:"UTF-8" }),
|
||||
format = CFPropertyList.sniffedFormatOfString(contents),
|
||||
plist = CFPropertyList.propertyListFromString(contents),
|
||||
totalBytes = {executable:0, data:0, mhtml:0};
|
||||
|
||||
// Get the size of all framework executables and sprite data
|
||||
var frameworksDir = "Frameworks";
|
||||
|
||||
if (configuration === "Debug")
|
||||
frameworksDir = FILE.join(frameworksDir, "Debug");
|
||||
|
||||
var frameworks = FILE.list(frameworksDir);
|
||||
|
||||
frameworks.forEach(function(framework)
|
||||
{
|
||||
if (framework !== "Source")
|
||||
addBundleFileSizes(FILE.join(frameworksDir, framework), totalBytes);
|
||||
});
|
||||
|
||||
// Read in the default theme name, and attempt to get its size
|
||||
var themeName = plist.valueForKey("CPDefaultTheme") || "Aristo2",
|
||||
themePath = nil;
|
||||
|
||||
if (themeName === "Aristo" || themeName === "Aristo2")
|
||||
themePath = FILE.join(frameworksDir, "AppKit", "Resources", themeName + ".blend");
|
||||
else
|
||||
themePath = FILE.join("Frameworks", "Resources", themeName + ".blend");
|
||||
|
||||
if (FILE.isDirectory(themePath))
|
||||
addBundleFileSizes(themePath, totalBytes);
|
||||
|
||||
// Add sizes for the app
|
||||
addBundleFileSizes(FILE.join("Build", configuration, projectName), totalBytes);
|
||||
|
||||
print("Executables: " + totalBytes.executable + ", sprite data: " + totalBytes.data + ", total: " + (totalBytes.executable + totalBytes.data));
|
||||
|
||||
var dict = new CFMutableDictionary();
|
||||
|
||||
dict.setValueForKey("executable", totalBytes.executable);
|
||||
dict.setValueForKey("data", totalBytes.data);
|
||||
dict.setValueForKey("mhtml", totalBytes.mhtml);
|
||||
|
||||
plist.setValueForKey("CPApplicationSize", dict);
|
||||
|
||||
FILE.write(FILE.join("Build", configuration, projectName, "Info.plist"), CFPropertyList.stringFromPropertyList(plist, format), { charset:"UTF-8" });
|
||||
}
|
||||
|
||||
function addBundleFileSizes(bundlePath, totalBytes)
|
||||
{
|
||||
var bundleName = FILE.basename(bundlePath),
|
||||
environment = bundleName === "Foundation" ? "Objj" : "Browser",
|
||||
bundlePath = FILE.join(bundlePath, environment + ".environment");
|
||||
|
||||
if (FILE.isDirectory(bundlePath))
|
||||
{
|
||||
var filename = bundleName + ".sj",
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, filename));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.executable += filePath.size();
|
||||
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, "dataURLs.txt"));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.data += filePath.size();
|
||||
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLData.txt"));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.mhtml += filePath.size();
|
||||
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLPaths.txt"));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.mhtml += filePath.size();
|
||||
}
|
||||
}
|
||||
|
||||
task ("cucumber-test", function()
|
||||
{
|
||||
var SYSTEM = require("system");
|
||||
|
||||
OS.system("ln -s " + SYSTEM.prefix + "/packages/cucapp/Cucapp Cucapp")
|
||||
var code = OS.system("cucumber");
|
||||
OS.system("rm -f Cucapp; rm -f cucumber.html")
|
||||
OS.exit(code);
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;22E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;36E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;37E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;38E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;32E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;39E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;32E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;25E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;40E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;32E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;34E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;41E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;36E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;34E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;42E;E;D;K;10;$classnameS;21;CPCibControlConnectorK;8;$classesA;S;21;CPCibControlConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;29E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;32E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;43E;E;D;K;10;$classnameS;21;CPCibBindingConnectorK;8;$classesA;S;21;CPCibBindingConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;31E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;36E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;44E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;45E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;46E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;48E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;37E;E;D;K;10;$classnameS;20;_CPCibWindowTemplateK;8;$classesA;S;20;_CPCibWindowTemplateS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;24E;K;30;_CPCibWindowTemplateMaxSizeKeyD;K;6;CP$UIDd;2;49E;K;32;_CPCibWindowTemplateViewClassKeyD;K;6;CP$UIDd;1;0E;K;34;_CPCibWindowTemplateWindowClassKeyD;K;6;CP$UIDd;2;50E;K;30;_CPCibWindowTemplateWTFlagsKeyD;K;6;CP$UIDd;2;51E;K;33;_CPCibWindowTemplateWindowRectKeyD;K;6;CP$UIDd;2;52E;K;33;_CPCibWindowTemplateScreenRectKeyD;K;6;CP$UIDd;2;53E;K;30;_CPCibWindowTempatStyleMaskKeyD;K;6;CP$UIDd;2;54E;K;34;_CPCibWindowTemplateWindowTitleKeyD;K;6;CP$UIDd;2;55E;K;33;_CPCibWindowTemplateWindowViewKeyD;K;6;CP$UIDd;2;27E;E;D;K;10;$classnameS;6;CPViewK;8;$classesA;S;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;26E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;56E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;57E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;57E;K;17;CPViewSubviewsKeyD;K;6;CP$UIDd;2;58E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;59E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;2;60E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;2;60E;K;17;CPViewIsScaledKeyD;K;6;Line truncated
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="1050" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="450" id="451"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="371">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="335" y="390" width="480" height="360"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<view key="contentView" id="372">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button identifier="load" verticalHuggingPriority="750" id="B4t-mW-jyS">
|
||||
<rect key="frame" x="20" y="312" width="70" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Load" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="L4T-tk-zIe">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="load:" target="450" id="B2z-4h-JJK"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField identifier="result" horizontalHuggingPriority="251" verticalHuggingPriority="750" id="EwI-DV-COg">
|
||||
<rect key="frame" x="99" y="319" width="163" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="isViewLoaded=" id="w5e-oN-M00">
|
||||
<font key="font" metaFont="system" size="17"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="EPv-VX-kzA" name="displayPatternValue1" keyPath="selection.isViewLoaded" id="BIN-61-0Im">
|
||||
<dictionary key="options">
|
||||
<string key="NSDisplayPattern">isViewLoaded=%{value1}@</string>
|
||||
<string key="NSNoSelectionPlaceholder">NO</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</textField>
|
||||
</subviews>
|
||||
</view>
|
||||
</window>
|
||||
<customObject id="450" customClass="AppController">
|
||||
<connections>
|
||||
<outlet property="theWindow" destination="371" id="459"/>
|
||||
<outlet property="viewController" destination="rLc-A4-CBZ" id="H6z-uM-FBg"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<viewController nibName="ViewController" id="rLc-A4-CBZ"/>
|
||||
<objectController id="EPv-VX-kzA">
|
||||
<connections>
|
||||
<outlet property="content" destination="rLc-A4-CBZ" id="Xfw-zG-Ryt"/>
|
||||
</connections>
|
||||
</objectController>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;18E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;19E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;20E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;18E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;21E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;22E;E;D;K;10;$classnameS;18;_CPCibClassSwapperK;8;$classesA;S;18;_CPCibClassSwapperS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;23E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;24E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;24E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;2;25E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;26E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;2;27E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;2;27E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;2;28E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;22;CPViewTrackingAreasKeyD;K;6;CP$UIDd;2;29E;K;30;_CPCibClassSwapperClassNameKeyD;K;6;CP$UIDd;2;30E;K;38;_CPCibClassSwapperOriginalClassNameKeyD;K;6;CP$UIDd;2;31E;E;S;16;CPViewControllerD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;4;viewS;13;CPApplicationd;1;0S;20;{{0, 0}, {480, 272}}d;2;12S;6;normalS;6;{1, 1}F;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;6;NSViewS;6;CPViewE;K;9;$archiverS;15;CPKeyedArchiverK;8;$versionS;6;100000E;
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSViewController">
|
||||
<connections>
|
||||
<outlet property="view" destination="c22-O7-iKe" id="jmy-2J-skS"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="c22-O7-iKe">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,173 @@
|
||||
# Given the application is lauched
|
||||
Given /^the application is launched$/ do
|
||||
launched = app.gui.command "launched"
|
||||
|
||||
if !launched
|
||||
raise "The application was not launched"
|
||||
end
|
||||
end
|
||||
|
||||
# Given I wait for n seconds
|
||||
Given /^I wait for (\d+) seconds?$/ do |n|
|
||||
sleep(eval("#{n.to_i}"))
|
||||
end
|
||||
|
||||
# When I close the popover
|
||||
When /^I close the popover$/ do
|
||||
step "I hit the key escape"
|
||||
end
|
||||
|
||||
|
||||
# When I hit the key c
|
||||
When /^I hit the key (.*)$/ do |key|
|
||||
step "I hit the mask none and the key #{key}"
|
||||
end
|
||||
|
||||
|
||||
# When I hit the mask shif and the key c
|
||||
When /^I hit the mask (.*) and the key (.*)$/ do |mask, key|
|
||||
simulate_keyboard_event(key, mask)
|
||||
end
|
||||
|
||||
|
||||
# When the keys cucapp
|
||||
When /^I hit the keys (.*)$/ do |keys|
|
||||
step "I hit the mask none and keys #{keys}"
|
||||
end
|
||||
|
||||
|
||||
# When I hit the mask shif and the keys cucapp
|
||||
When /^I hit the mask (.*) and keys (.*)$/ do |mask, keys|
|
||||
simulate_keyboard_event(keys, mask)
|
||||
end
|
||||
|
||||
|
||||
# When I select all
|
||||
When /^I select all$/ do
|
||||
app.gui.simulate_keyboard_event "a", [$CPCommandKeyMask]
|
||||
end
|
||||
|
||||
|
||||
# When I save the document
|
||||
When /^I save the document$/ do
|
||||
app.gui.simulate_keyboard_event "s", [$CPCommandKeyMask]
|
||||
end
|
||||
|
||||
|
||||
# When I (click|right click|double click) on the field with the value cucapp
|
||||
When /^I (click|right click|double click) on the (\w*\-*\w*) with the value (.*)$/ do |click_type, element, value|
|
||||
step "I #{click_type} on the #{element} with the property object-value set to #{value}"
|
||||
end
|
||||
|
||||
|
||||
# When I click on the field with the property cucapp-identifier set to cucapp-identifier-button-add
|
||||
When /^I (click|right click|double click) on the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*)$/ do |click_type, element, property, property_value|
|
||||
step "I #{click_type} with the key mask none on the #{element} with the property #{property} set to #{property_value}"
|
||||
end
|
||||
|
||||
|
||||
# When I click with the mask shift on the field with the property cucapp-identifier set to cucapp-identifier-button-add
|
||||
When /^I (click|right click|double click) with the key mask (.*) on the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*)$/ do |click_type, mask, element, property, property_value|
|
||||
|
||||
type = $mouse_left_click
|
||||
|
||||
if click_type == "right click"
|
||||
type = $mouse_right_click
|
||||
end
|
||||
|
||||
if click_type == "double click"
|
||||
type = $mouse_double_click
|
||||
end
|
||||
|
||||
simulate_click(type, element, property, property_value, mask)
|
||||
end
|
||||
|
||||
|
||||
# When I do a drag and drop from the field with the value cucapp to the field with the value cappuccino
|
||||
When /^I do a drag and drop from the (\w*\-*\w*) with the value (.*) to the (\w*\-*\w*) with the value (.*)$/ do |element, value, second_element, second_value|
|
||||
step "I do a drag and drop from the #{element} with the property object-value set to #{value} to the #{second_element} with the property object-value set to #{second_value}"
|
||||
end
|
||||
|
||||
|
||||
# When I do a drag and drop from the field with the property title set to cucapp to the field with the property title set to cappuccino
|
||||
When /^I do a drag and drop from the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*) to the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*)$/ do |element, property, property_value, second_element, second_property, second_property_value|
|
||||
step "I do a drag and drop with the key mask none from the #{element} with the property #{property} set to #{property_value} to the #{second_element} with the property #{second_property} set to #{second_property_value}"
|
||||
end
|
||||
|
||||
|
||||
# When I do a drag and drop with the key mask shift from the field with the property title set to cucapp to the field with the property title set to cappuccino
|
||||
When /^I do a drag and drop with the key mask (.*) from the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*) to the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*)$/ do |mask, element, property, property_value, second_element, second_property, second_property_value|
|
||||
simulate_drag_and_drop(element, property, property_value, second_element, second_property, second_property_value, mask)
|
||||
end
|
||||
|
||||
|
||||
# When I vertically|horizontally scroll on the field with the value cappuccino
|
||||
When /^I (vertically|horizontally) scroll on the (\w*\-*\w*) with the value (.*)$/ do |direction, element, value|
|
||||
step "When I #{direction} scroll 10 times on the #{element} with the value #{value}"
|
||||
end
|
||||
|
||||
|
||||
# When I vertically|horizontally scroll 10 times on the field with the value cappuccino
|
||||
When /^I (vertically|horizontally) scroll ([0-9]*) times on the (\w*\-*\w*) with the value (.*)$/ do |direction, times, element, value|
|
||||
step "I #{direction} scroll #{times} times on the #{element} with the property object-value set to #{value}"
|
||||
end
|
||||
|
||||
|
||||
# When I vertically|horizontally scroll 10 times on the field with the property title set to cappuccino
|
||||
When /^I (vertically|horizontally) scroll ([0-9]*) times on the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*)$/ do |direction, times, element, property, property_value|
|
||||
step "I #{direction} scroll #{times} times with the key mask none on the #{element} with the property #{property} set to #{property_value}"
|
||||
end
|
||||
|
||||
|
||||
# When I vertically|horizontally scroll 10 times on the field with the property title set to cappuccino
|
||||
When /^I (vertically|horizontally) scroll ([0-9]*) times with the key mask (.*) on the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*)$/ do |direction, times, mask, element, property, property_value|
|
||||
|
||||
vertically = false
|
||||
horizontally = false
|
||||
|
||||
if direction == "vertically"
|
||||
vertically = true
|
||||
end
|
||||
|
||||
if direction == "horizontally"
|
||||
horizontally = true
|
||||
end
|
||||
|
||||
simulate_scroll(element, property, property_value, times, mask, horizontally, vertically)
|
||||
end
|
||||
|
||||
|
||||
# When I select the item name of the pop-up-button with the property cucapp-identifier set to cucappIdentifierPopUpButton
|
||||
When /^I select the item (.*) of the pop-up-button with the property (\w*\-*\w*) set to (.*)$/ do |item_name, property, property_value|
|
||||
select_pop_up_button_item(item_name, property, property_value)
|
||||
end
|
||||
|
||||
|
||||
# Then the field with the property title set to name should be focused
|
||||
Then /^the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*) should be focused$/ do |element, property, property_value|
|
||||
app.gui.is_control_focused(create_xpath(element, property, property_value))
|
||||
end
|
||||
|
||||
|
||||
# Then the field should not have a value
|
||||
Then /^the (\w*\-*\w*) should not have a value$/ do |element|
|
||||
step "the #{element} with the property object-value set to #{value} should have the value #{value}"
|
||||
end
|
||||
|
||||
|
||||
# Then the field with the property cucapp-identifier set to cucapp-identifier-textfield-description should not have a value
|
||||
Then /^the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*) should not have a value$/ do |element, property, property_value|
|
||||
check_value_control(element, property, property_value, nil)
|
||||
end
|
||||
|
||||
|
||||
# Then the field should have the value cucapp
|
||||
Then /^the (\w*\-*\w*) should have the value (.*)$/ do |element, value|
|
||||
step "the #{element} with the property object-value set to #{value} should have the value #{value}"
|
||||
end
|
||||
|
||||
|
||||
# Then the field with the property cucapp-identifier set to cucapp-identifier-textfield-description should have the value cucapp
|
||||
Then /^the (\w*\-*\w*) with the property (\w*\-*\w*) set to (.*) should have the value (.*)$/ do |element, property, property_value, value|
|
||||
check_value_control(element, property, property_value, value)
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
@import <Foundation/Foundation.j>
|
||||
|
||||
@implementation Cucumber (CuCapp)
|
||||
|
||||
- (CPString)valueIsEqual:(CPArray)params
|
||||
{
|
||||
var obj = cucumber_objects[params[0]],
|
||||
value = params[1];
|
||||
|
||||
if (!obj)
|
||||
return '{"result" : "__CUKE_ERROR__"}';
|
||||
|
||||
if ([obj respondsToSelector:@selector(stringValue)] && value === [obj stringValue])
|
||||
return '{"result" : "OK"}';
|
||||
|
||||
return '{"result" : "__CUKE_ERROR__"}';
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,62 @@
|
||||
$cappuccino_control_mappings = {
|
||||
"image-view-text" => "_CPImageAndTextView",
|
||||
"menu-item" => "_CPMenuItemView",
|
||||
"tool-bar-item" => "_CPToolbarItemView",
|
||||
"box" => "CPBox",
|
||||
"button" => "CPButton",
|
||||
"button-bar" => "CPButtonBar",
|
||||
"collection-view" => "CPCollectionView",
|
||||
"combo-box" => "CPComboBox",
|
||||
"control" => "CPControl",
|
||||
"check-box" => "CPCheckBox",
|
||||
"date-picker" => "CPDatePicker",
|
||||
"image-view" => "CPImageView",
|
||||
"level-indicator" => "CPLevelIndicator",
|
||||
"outline-view" => "CPOutlineView",
|
||||
"pop-up-button" => "CPPopUpButton",
|
||||
"predicate-editor" => "CPPredicateEditor",
|
||||
"radio-button" => "CPRadio",
|
||||
"rule-editor" => "CPRuleEditor",
|
||||
"scroller" => "CPScroller",
|
||||
"scroll-view" => "CPScrollView",
|
||||
"search-field" => "CPSearchField",
|
||||
"secure-field" => "CPSecureTextField",
|
||||
"segemented-control" => "CPSegmentedControl",
|
||||
"slider" => "CPSlider",
|
||||
"stepper" => "CPStepper",
|
||||
"tab-view" => "CPTabView",
|
||||
"table" => "CPTableView",
|
||||
"field" => "CPTextField",
|
||||
"token-field" => "CPTokenField",
|
||||
"view" => "CPView",
|
||||
"none" => nil
|
||||
}
|
||||
|
||||
$property_mappings = {
|
||||
"cucapp-identifier" => "cucappIdentifier",
|
||||
"id" => "id",
|
||||
"identifier" => "identifier",
|
||||
"label" => "label",
|
||||
"object-value" => "objectValue",
|
||||
"placeholder" => "placeholderString",
|
||||
"tag" => "tag",
|
||||
"title" => "title",
|
||||
"text" => "text",
|
||||
"none" => nil
|
||||
}
|
||||
|
||||
$key_mappings = {
|
||||
"command" => $CPCommandKeyMask,
|
||||
"shift" => $CPShiftKeyMask,
|
||||
"option" => $CPAlternateKeyMask,
|
||||
"control" => $CPControlKeyMask,
|
||||
"delete" => $CPDeleteCharacter,
|
||||
"escape" => $CPEscapeFunctionKey,
|
||||
"enter" => $CPNewlineCharacter,
|
||||
"left-arrow" => $CPLeftArrowFunctionKey,
|
||||
"right-arrow" => $CPRightArrowFunctionKey,
|
||||
"top-arrow" => $CPTopArrowFunctionKey,
|
||||
"down-arrow" => $CPDownArrowFunctionKey,
|
||||
"tab" => $CPTabCharacter,
|
||||
"none" => nil
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
module Encumber
|
||||
|
||||
class GUI
|
||||
def value_is_equal(xpath, value)
|
||||
|
||||
if !value
|
||||
value = ""
|
||||
end
|
||||
|
||||
result = command 'valueIsEqual', id_for_element(xpath), value
|
||||
raise "Value #{value} not found" if result["result"] != "OK"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
$: << File.join(File.dirname(__FILE__), '..', '..', 'Cucapp')
|
||||
|
||||
require 'cucapp.rb'
|
||||
require 'logger'
|
||||
|
||||
module AppHelper
|
||||
|
||||
def app
|
||||
@app ||= Cucapp.new
|
||||
end
|
||||
|
||||
def log
|
||||
@log ||= ENV['log']
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
World(
|
||||
AppHelper
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
Before do
|
||||
app.reset()
|
||||
end
|
||||
|
||||
After do
|
||||
app.quit()
|
||||
end
|
||||
@@ -0,0 +1,92 @@
|
||||
def check_value_control(element, property, property_value, value)
|
||||
xpath = create_xpath(element, property, property_value)
|
||||
|
||||
app.gui.wait_for xpath
|
||||
app.gui.value_is_equal xpath, value
|
||||
end
|
||||
|
||||
def simulate_keyboard_event(keys, mask)
|
||||
app.gui.simulate_keyboard_events cappuccino_key(keys), [cappuccino_key(mask)]
|
||||
end
|
||||
|
||||
def simulate_click(type, element, property, property_value, mask)
|
||||
xpath = create_xpath(element, property, property_value)
|
||||
|
||||
app.gui.wait_for xpath
|
||||
|
||||
if type == $mouse_double_click
|
||||
app.gui.simulate_double_click xpath, [cappuccino_key(mask)]
|
||||
elsif type == $mouse_right_click
|
||||
app.gui.simulate_right_click xpath, [cappuccino_key(mask)]
|
||||
else
|
||||
app.gui.simulate_left_click xpath, [cappuccino_key(mask)]
|
||||
end
|
||||
end
|
||||
|
||||
def simulate_drag_and_drop(element, property, property_value, second_element, second_property, second_property_value, mask)
|
||||
|
||||
xpath1 = create_xpath(element, property, property_value)
|
||||
xpath2 = create_xpath(second_element, second_property, second_property_value)
|
||||
|
||||
app.gui.simulate_dragged_click_view_to_view xpath1, xpath2, [cappuccino_key(mask)]
|
||||
end
|
||||
|
||||
def simulate_scroll(element, property, property_value, times, mask, horizontal, vertical)
|
||||
xpath = create_xpath(element, property, property_value)
|
||||
delta_x = 0
|
||||
delta_y = 0
|
||||
|
||||
if horizontal
|
||||
delta_x = 1
|
||||
end
|
||||
|
||||
if vertical
|
||||
delta_y = 1
|
||||
end
|
||||
|
||||
for i in 0..times.to_i
|
||||
app.gui.simulate_scroll_wheel xpath, delta_x, delta_y, [cappuccino_key(mask)]
|
||||
end
|
||||
end
|
||||
|
||||
def select_pop_up_button_item(item_name, property, property_value)
|
||||
simulate_click($mouse_left_click, "pop-up-button", property, property_value, [])
|
||||
|
||||
pop_up_button_xpath = create_xpath("pop-up-button", property, property_value)
|
||||
|
||||
pop_up_button_item_xpath = create_xpath("image-view-text", "text", item_name)
|
||||
|
||||
while !app.gui.wait_for_element(pop_up_button_item_xpath, 0.05) && app.gui.pop_up_button_can_scroll_up(pop_up_button_xpath)
|
||||
simulate_keyboard_event("up-arrow", [])
|
||||
end
|
||||
|
||||
while !app.gui.wait_for_element(pop_up_button_item_xpath, 0.05) && app.gui.pop_up_button_can_scroll_down(pop_up_button_xpath)
|
||||
simulate_keyboard_event("down-arrow", [])
|
||||
end
|
||||
|
||||
if not app.gui.wait_for(pop_up_button_item_xpath)
|
||||
raise "Menu item #{item_name} not found !"
|
||||
end
|
||||
|
||||
simulate_click($mouse_left_click, "image-view-text", "text", item_name, [])
|
||||
end
|
||||
|
||||
def cappuccino_key(key)
|
||||
if $key_mappings.has_key?(key)
|
||||
key = $key_mappings[key]
|
||||
end
|
||||
|
||||
return key
|
||||
end
|
||||
|
||||
def create_xpath(element, property, property_value)
|
||||
if !$cappuccino_control_mappings.has_key?(element)
|
||||
raise "Element #{element} not found in the hash cappuccino_control_mappings. You should complete the hash $cappuccino_control_mappings in env.rb"
|
||||
end
|
||||
|
||||
if !$property_mappings.has_key?(property)
|
||||
raise "Property #{property} not found in the hash $property_mappings. You should complete the hash $property_mappings in env.rb"
|
||||
end
|
||||
|
||||
return "//" + $cappuccino_control_mappings[element] + "["+ $property_mappings[property] +"='#{property_value}']"
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
Feature: Test the CPViewController asynchronous loading
|
||||
This test is used to make sure that the isViewLoaded property is true when the loading has ended.
|
||||
|
||||
Scenario: Check if the application is launched
|
||||
Given the application is launched
|
||||
When I click on the button with the property identifier set to load
|
||||
Given I wait for 1 second
|
||||
Then the field with the property identifier set to result should have the value isViewLoaded=true
|
||||
@@ -0,0 +1,204 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
CPViewControllerTest
|
||||
|
||||
Created by You on May 9, 2016.
|
||||
Copyright 2016, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<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>CPViewControllerTest</title>
|
||||
|
||||
<!-- Custom javascript goes here -->
|
||||
<!-- End custom javascript -->
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
|
||||
// The below will tell the compiler to generate debug symbols, type signatures and not inline objj_msgSend functions.
|
||||
// This will affect only Objective-J code that is compiled when loading the application. It will not affect precompiled
|
||||
// code like the Cappuccino frameworks.
|
||||
//
|
||||
// Debug symbols will give each Objective-J method a Javascript function name. Without a name it will be very hard to find
|
||||
// the methods in the debugger.
|
||||
// Type Signatures will give type information to the Objective-J runtime for instance variables and methods.
|
||||
// Inline objj_msgSend will give a speed increase but decorators will not work. Check below on debug options for
|
||||
// more information on decorators.
|
||||
//
|
||||
// Uncomment or comment on the line below to change the flags
|
||||
OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures"/*, "InlineMsgSend"*/];
|
||||
|
||||
var progressBar = null;
|
||||
|
||||
OBJJ_PROGRESS_CALLBACK = function(percent, appSize, path)
|
||||
{
|
||||
percent = percent * 100;
|
||||
|
||||
if (!progressBar)
|
||||
progressBar = document.getElementById("progress-bar");
|
||||
|
||||
if (progressBar)
|
||||
progressBar.style.width = Math.min(percent, 100) + "%";
|
||||
}
|
||||
|
||||
var loadingHTML =
|
||||
'<div id="loading">' +
|
||||
' <div id="loading-text">Loading...</div>' +
|
||||
' <div id="progress-indicator">' +
|
||||
' <span id="progress-bar" style="width:0%"></span>' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
</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:
|
||||
// Decorators will only work when the code is compiled without the compiler option 'InlineMsgSend'. Check above.
|
||||
|
||||
// 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);
|
||||
|
||||
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
|
||||
// the class name of the view that created them. Comment this or set to false to disable.
|
||||
appkit_tag_dom_elements = true;
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
html, body, h1, p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* We need a body wrapper because Cappuccino is unhappy if we change the body element */
|
||||
#cappuccino-body {
|
||||
/* Position it absolutely so it will fill the height without content */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
|
||||
/* Put it at the bottom of the stack so it doesn't interfere with UI */
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#cappuccino-body .container {
|
||||
display: table;
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#cappuccino-body .content {
|
||||
display: table-cell;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#loading {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
}
|
||||
|
||||
#loading-text {
|
||||
height: 1.5em;
|
||||
color: #555;
|
||||
font: normal bold 36px/36px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#progress-indicator {
|
||||
padding: 0px;
|
||||
height: 16px;
|
||||
border: 5px solid #555;
|
||||
border-radius: 18px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#progress-bar {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
left: -1px;
|
||||
display: block;
|
||||
height: 18px;
|
||||
|
||||
/* Compensate for moving the bar left 1px to overlap the indicator border */
|
||||
border-right: 1px solid #555;
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
#noscript {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
padding: 1em 1.5em;
|
||||
border: 5px solid #555;
|
||||
border-radius: 16px;
|
||||
background-color: white;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font: bold 24px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#noscript a {
|
||||
color: #98c0ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="cappuccino-body">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<script type="text/javascript">
|
||||
document.write(loadingHTML);
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<noscript style="position:absolute; top:0; left:0; width:100%; height:100%">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div id="noscript">
|
||||
<p style="font-size:120%; margin-bottom:.75em">JavaScript is required for this site.</p>
|
||||
<p><a href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,166 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index.html
|
||||
CPViewControllerTest
|
||||
|
||||
Created by You on May 9, 2016.
|
||||
Copyright 2016, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<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>CPViewControllerTest</title>
|
||||
|
||||
<!-- Custom javascript goes here -->
|
||||
<!-- End custom javascript -->
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
// The below will tell the compiler to not generate debug symbols but will generate type signatures and inline objj_msgSend functions.
|
||||
// This will affect only Objective-J code that is compiled when loading the application. It will not affect precompiled
|
||||
// code like the Cappuccino frameworks.
|
||||
// Uncomment or comment on the line below to change the flags
|
||||
OBJJ_COMPILER_FLAGS = [/*"IncludeDebugSymbols"*/, "IncludeTypeSignatures", "InlineMsgSend"];
|
||||
|
||||
var progressBar = null;
|
||||
|
||||
OBJJ_PROGRESS_CALLBACK = function(percent, appSize, path)
|
||||
{
|
||||
percent = percent * 100;
|
||||
|
||||
if (!progressBar)
|
||||
progressBar = document.getElementById("progress-bar");
|
||||
|
||||
if (progressBar)
|
||||
progressBar.style.width = Math.min(percent, 100) + "%";
|
||||
}
|
||||
|
||||
var loadingHTML =
|
||||
'<div id="loading">' +
|
||||
' <div id="loading-text">Loading...</div>' +
|
||||
' <div id="progress-indicator">' +
|
||||
' <span id="progress-bar" style="width:0%"></span>' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
html, body, h1, p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* We need a body wrapper because Cappuccino is unhappy if we change the body element */
|
||||
#cappuccino-body {
|
||||
/* Position it absolutely so it will fill the height without content */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
|
||||
/* Put it at the bottom of the stack so it doesn't interfere with UI */
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#cappuccino-body .container {
|
||||
display: table;
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#cappuccino-body .content {
|
||||
display: table-cell;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#loading {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
}
|
||||
|
||||
#loading-text {
|
||||
height: 1.5em;
|
||||
color: #555;
|
||||
font: normal bold 36px/36px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#progress-indicator {
|
||||
padding: 0px;
|
||||
height: 16px;
|
||||
border: 5px solid #555;
|
||||
border-radius: 18px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#progress-bar {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
left: -1px;
|
||||
display: block;
|
||||
height: 18px;
|
||||
|
||||
/* Compensate for moving the bar left 1px to overlap the indicator border */
|
||||
border-right: 1px solid #555;
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
#noscript {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
padding: 1em 1.5em;
|
||||
border: 5px solid #555;
|
||||
border-radius: 16px;
|
||||
background-color: white;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font: bold 24px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#noscript a {
|
||||
color: #98c0ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="cappuccino-body">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<script type="text/javascript">
|
||||
document.write(loadingHTML);
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<noscript style="position:absolute; top:0; left:0; width:100%; height:100%">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div id="noscript">
|
||||
<p style="font-size:120%; margin-bottom:.75em">JavaScript is required for this site.</p>
|
||||
<p><a href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPViewControllerTest
|
||||
*
|
||||
* Created by You on May 9, 2016.
|
||||
* Copyright 2016, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
@@ -265,6 +265,22 @@ var _getCheeseCounter;
|
||||
[self assert:dependantKeyPathTester equals:_lastObject];
|
||||
}
|
||||
|
||||
- (void)testSendNotificationsForMultipleDependantKeyPathsToTheSameObject
|
||||
{
|
||||
var observingTester = [ObservingTester testerWithCheese:@"cheese"],
|
||||
dependantKeyPathTester = [DependantKeyPathsTester testerWithObservingTester:observingTester],
|
||||
anotherDependantKeyPathTester = [DependantKeyPathsTester testerWithObservingTester:observingTester];
|
||||
|
||||
[dependantKeyPathTester addObserver:self forKeyPath:@"observedCheese" options:CPKeyValueObservingOptionNew context:nil];
|
||||
[anotherDependantKeyPathTester addObserver:self forKeyPath:@"observedCheese" options:CPKeyValueObservingOptionNew context:nil];
|
||||
[observingTester setCheese:@"changed cheese"];
|
||||
|
||||
[self assert:@"observedCheese" equals:_lastKeyPath];
|
||||
[self assert:@"observedCheese" equals:_secondLastKeyPath];
|
||||
[self assertTrue:[[dependantKeyPathTester, anotherDependantKeyPathTester] containsObject:_lastObject] message:@"Last observed object must be one of the DependantKeyPathsTester"];
|
||||
[self assertTrue:[[dependantKeyPathTester, anotherDependantKeyPathTester] containsObject:_secondLastObject] message:@"Second last observed object must be one of the DependantKeyPathsTester"];
|
||||
}
|
||||
|
||||
- (void)testOnlyInsertObject_AtKeyIndex_Implemented
|
||||
{
|
||||
var insertSelector = @selector(insertObject:inObjectsAtIndex:),
|
||||
|
||||
@@ -12,4 +12,45 @@
|
||||
[self assertThrows:function () { [34 compare:[CPNull null]] }];
|
||||
}
|
||||
|
||||
- (void)testIntValue
|
||||
{
|
||||
/*
|
||||
For reference:
|
||||
|
||||
[[NSNumber numberWithDouble:3.1] intValue]: 3
|
||||
[[NSNumber numberWithDouble:3.9] intValue]: 3
|
||||
[[NSNumber numberWithDouble:-3.1] intValue]: -3
|
||||
[[NSNumber numberWithDouble:-3.9] intValue]: -3
|
||||
[[NSNumber numberWithDouble:3.1] integerValue]: 3
|
||||
[[NSNumber numberWithDouble:3.9] integerValue]: 3
|
||||
[[NSNumber numberWithDouble:-3.1] integerValue]: -3
|
||||
[[NSNumber numberWithDouble:-3.9] integerValue]: -3
|
||||
*/
|
||||
|
||||
var testStrings = [
|
||||
// [090, 90], // Removed cause Rhino does not support numbers starting with '0'
|
||||
[-1, -1],
|
||||
[3.1415, 3],
|
||||
[3.5415, 3],
|
||||
[-3.1415, -3],
|
||||
[-3.5415, -3],
|
||||
[2.7183, 2],
|
||||
[-0, 0],
|
||||
[00, 0],
|
||||
[-00, 0],
|
||||
[+001, 1],
|
||||
];
|
||||
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
[self assert:[testStrings[i][0] shortValue] equals:testStrings[i][1]];
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
[self assert:[testStrings[i][0] intValue] equals:testStrings[i][1]];
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
[self assert:[testStrings[i][0] longValue] equals:testStrings[i][1]];
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
[self assert:[testStrings[i][0] longLongValue] equals:testStrings[i][1]];
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
[self assert:[testStrings[i][0] integerValue] equals:testStrings[i][1]];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -165,6 +165,25 @@
|
||||
[self assert:[testStrings[i][0] boolValue] equals:testStrings[i][1]];
|
||||
}
|
||||
|
||||
- (void)testintValue
|
||||
{
|
||||
var testStrings = [
|
||||
[" 090", 90],
|
||||
[" -1", -1],
|
||||
[" 3.1415", 3],
|
||||
[" 2.7183", 2],
|
||||
[" -0", 0],
|
||||
[" 00", 0],
|
||||
[" -00", 0],
|
||||
[" +001", 1],
|
||||
];
|
||||
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
[self assert:[testStrings[i][0] intValue] equals:testStrings[i][1]];
|
||||
for (var i = 0; i < testStrings.length; i++)
|
||||
[self assert:[testStrings[i][0] integerValue] equals:testStrings[i][1]];
|
||||
}
|
||||
|
||||
- (void)testCommonPrefixWithString
|
||||
{
|
||||
var testStringsCase = [
|
||||
|
||||
@@ -0,0 +1,533 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPAnimatablePropertyContainerTest
|
||||
*
|
||||
* Created by You on December 3, 2012.
|
||||
* Copyright 2012, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
CPLogRegister(CPLogConsole);
|
||||
|
||||
var ANIMATIONS_NAMES = ["Fade In", "Fade Out", "Background Color", "Frame Origin", "Bounce", "Frame Size", "Frame"];
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPWindow theWindow; //this "outlet" is connected automatically by the Cib
|
||||
|
||||
@outlet CPBox group1Box;
|
||||
@outlet CPBox group2Box;
|
||||
|
||||
@outlet CPView animationSandbox;
|
||||
|
||||
CPView leftView;
|
||||
CPView rightView;
|
||||
|
||||
CPArray animations;
|
||||
|
||||
float duration1 @accessors;
|
||||
float duration2 @accessors;
|
||||
|
||||
CPString message1 @accessors;
|
||||
CPString message2 @accessors;
|
||||
|
||||
CPInteger selectedTimingFunction1 @accessors;
|
||||
CPInteger selectedTimingFunction2 @accessors;
|
||||
|
||||
CPString timingFunction1 @accessors;
|
||||
CPString timingFunction2 @accessors;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
animations = [CPArray array];
|
||||
|
||||
[ANIMATIONS_NAMES enumerateObjectsUsingBlock:function(anim, idx)
|
||||
{
|
||||
var dict = [CPDictionary dictionaryWithObjectsAndKeys:anim, @"name", NO, @"enabled1", NO, @"enabled2"];
|
||||
[animations addObject:dict];
|
||||
}];
|
||||
|
||||
duration1 = 1.0;
|
||||
duration2 = 1.0;
|
||||
|
||||
message1 = @"Done for View 1";
|
||||
message2 = @"Done for View 2";
|
||||
|
||||
timingFunction1 = @"0,1,1,0";
|
||||
timingFunction2 = @"0,1,1,0";
|
||||
|
||||
selectedTimingFunction1 = 1;
|
||||
selectedTimingFunction2 = 1;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (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.
|
||||
|
||||
[[theWindow contentView] setBackgroundColor:[CPColor colorWithRed:1 green:238/255 blue:185/255 alpha:1]];
|
||||
[animationSandbox setBackgroundColor:[CPColor whiteColor]];
|
||||
|
||||
[self revert:nil];
|
||||
// In this case, we want the window from Cib to become our full browser window
|
||||
[theWindow setFullPlatformWindow:YES];
|
||||
}
|
||||
|
||||
- (IBAction)runAnimationsGroup1:(id)sender
|
||||
{
|
||||
[[CPAnimationContext currentContext] setDuration:duration1];
|
||||
[[CPAnimationContext currentContext] setTimingFunction:[self timingFunctionForGroup:1 fromPopUp:selectedTimingFunction1]];
|
||||
[[CPAnimationContext currentContext] setCompletionHandler:[self completionHandlerFromString:message1]];
|
||||
|
||||
[self runAnimationsForGroup:1];
|
||||
}
|
||||
|
||||
- (IBAction)runAnimationsGroup2:(id)sender
|
||||
{
|
||||
[[CPAnimationContext currentContext] setDuration:duration2];
|
||||
[[CPAnimationContext currentContext] setTimingFunction:[self timingFunctionForGroup:2 fromPopUp:selectedTimingFunction2]];
|
||||
[[CPAnimationContext currentContext] setCompletionHandler:[self completionHandlerFromString:message2]];
|
||||
|
||||
[self runAnimationsForGroup:2];
|
||||
}
|
||||
|
||||
- (IBAction)animate:(id)sender
|
||||
{
|
||||
[[CPAnimationContext currentContext] setDuration:duration1];
|
||||
[[CPAnimationContext currentContext] setTimingFunction:[self timingFunctionForGroup:1 fromPopUp:selectedTimingFunction2]];
|
||||
[[CPAnimationContext currentContext] setCompletionHandler:[self completionHandlerFromString:message1]];
|
||||
|
||||
var tag = [sender tag];
|
||||
var width = tag ? 100 : 200;
|
||||
[[sender animator] setFrameSize:CGSizeMake(width, CGRectGetHeight([sender frame]))];
|
||||
|
||||
[sender setTag:(1 - tag)];
|
||||
}
|
||||
|
||||
- (IBAction)runBothGroups:(id)sender
|
||||
{
|
||||
[CPAnimationContext runAnimationGroup:function(context)
|
||||
{
|
||||
[context setDuration:duration1];
|
||||
[context setTimingFunction:[self timingFunctionForGroup:1 fromPopUp:selectedTimingFunction1]];
|
||||
[self runAnimationsForGroup:1];
|
||||
|
||||
} completionHandler:function()
|
||||
{
|
||||
CPLogConsole(message1);
|
||||
}];
|
||||
|
||||
[CPAnimationContext runAnimationGroup:function(context)
|
||||
{
|
||||
[context setDuration:duration2];
|
||||
[context setTimingFunction:[self timingFunctionForGroup:2 fromPopUp:selectedTimingFunction2]];
|
||||
[self runAnimationsForGroup:2];
|
||||
|
||||
} completionHandler:function()
|
||||
{
|
||||
CPLogConsole(message2);
|
||||
}];
|
||||
}
|
||||
|
||||
/*
|
||||
- (IBAction)runInGroups:(id)sender
|
||||
{
|
||||
[CPAnimationContext beginGrouping];
|
||||
|
||||
[[CPAnimationContext currentContext] setDuration:duration1];
|
||||
[[CPAnimationContext currentContext] setTimingFunction:[self timingFunctionFromString:timingFunction1]];
|
||||
[[CPAnimationContext currentContext] setCompletionHandler:[self completionHandlerFromString:message1]];
|
||||
[self runAnimationsForGroup:1];
|
||||
|
||||
[CPAnimationContext endGrouping];
|
||||
|
||||
|
||||
[CPAnimationContext beginGrouping];
|
||||
|
||||
[[CPAnimationContext currentContext] setDuration:duration2];
|
||||
[[CPAnimationContext currentContext] setCompletionHandler:[self completionHandlerFromString:message2]];
|
||||
[self runAnimationsForGroup:2];
|
||||
|
||||
[CPAnimationContext endGrouping];
|
||||
}
|
||||
|
||||
- (IBAction)emptyGroupTest:(id)sender
|
||||
{
|
||||
[CPAnimationContext beginGrouping];
|
||||
|
||||
[[CPAnimationContext currentContext] setDuration:10];
|
||||
[[CPAnimationContext currentContext] setCompletionHandler:function()
|
||||
{
|
||||
CPLogConsole("Context duration is 10s but no animations were set. We run the completionHandler (this message) immediately and return");
|
||||
}];
|
||||
|
||||
[CPAnimationContext endGrouping];
|
||||
}
|
||||
*/
|
||||
- (IBAction)removeFromSuperview:(id)sender
|
||||
{
|
||||
[[leftView animator] removeFromSuperview];
|
||||
[[rightView animator] removeFromSuperview];
|
||||
}
|
||||
|
||||
- (IBAction)revert:(id)sender
|
||||
{
|
||||
[self setupGroup1:nil];
|
||||
[self setupGroup2:nil];
|
||||
}
|
||||
/*
|
||||
- (IBAction)addSubview:(id)sender
|
||||
{
|
||||
[[theWindow contentView] addSubview:];
|
||||
}
|
||||
*/
|
||||
- (void)runAnimationsForGroup:(CPInteger)group
|
||||
{
|
||||
var aView = group == 1 ? leftView : rightView,
|
||||
enabledKey = @"enabled" + group;
|
||||
|
||||
var enabledIndexes = [animations indexesOfObjectsPassingTest:function(obj, idx)
|
||||
{
|
||||
return [obj objectForKey:enabledKey];
|
||||
}];
|
||||
|
||||
if ([enabledIndexes count] == 0)
|
||||
return;
|
||||
|
||||
if ([enabledIndexes containsIndex:0])
|
||||
{
|
||||
[aView setAlphaValue:0];
|
||||
[[aView animator] setAlphaValue:1];
|
||||
}
|
||||
else if ([enabledIndexes containsIndex:1])
|
||||
{
|
||||
[[aView animator] setAlphaValue:0];
|
||||
}
|
||||
|
||||
if ([enabledIndexes containsIndex:2])
|
||||
{
|
||||
[[aView animator] setBackgroundColor:[CPColor magentaColor]];
|
||||
}
|
||||
|
||||
if ([enabledIndexes containsIndex:6])
|
||||
{
|
||||
var frame = CGRectMakeCopy([aView frame]),
|
||||
origin = frame.origin,
|
||||
size = frame.size;
|
||||
|
||||
origin.x += 450;
|
||||
origin.y += 200;
|
||||
|
||||
size.width += 100;
|
||||
size.height += 100;
|
||||
|
||||
[[aView animator] setFrame:frame];
|
||||
return;
|
||||
}
|
||||
|
||||
if ([enabledIndexes containsIndex:4])
|
||||
{
|
||||
[[aView animations] setObject:[self bounceAnimation:aView] forKey:@"frameOrigin"];
|
||||
|
||||
var origin = CGPointMakeCopy([aView frameOrigin]);
|
||||
[[aView animator] setFrameOrigin:origin];
|
||||
}
|
||||
else if ([enabledIndexes containsIndex:3])
|
||||
{
|
||||
[[aView animations] removeObjectForKey:@"frameOrigin"];
|
||||
|
||||
var origin = CGPointMakeCopy([aView frameOrigin]);
|
||||
origin.x +=550;
|
||||
origin.y +=300;
|
||||
[[aView animator] setFrameOrigin:origin];
|
||||
}
|
||||
|
||||
if ([enabledIndexes containsIndex:5])
|
||||
{
|
||||
var size = CGSizeMakeCopy([aView frameSize]);
|
||||
size.width += 300;
|
||||
size.height += 200;
|
||||
[[aView animator] setFrameSize:size];
|
||||
}
|
||||
}
|
||||
|
||||
- (CAMediaTimingFunction)controlsPointsForGroup:(CPInteger)aGroup
|
||||
{
|
||||
var aString = (aGroup == 1) ? timingFunction1 : timingFunction2;
|
||||
|
||||
if (!aString || ![aString length])
|
||||
return nil;
|
||||
|
||||
var controlsPoints = [aString componentsSeparatedByString:@","];
|
||||
|
||||
return [[controlsPoints[0] floatValue], [controlsPoints[1] floatValue], [controlsPoints[2] floatValue], [controlsPoints[3] floatValue]];
|
||||
}
|
||||
|
||||
- (CAMediaTimingFunction)timingFunctionForGroup:(CPInteger)aGroup fromPopUp:(CPInteger)selectedTag
|
||||
{
|
||||
var controlsPoints;
|
||||
|
||||
switch (selectedTag)
|
||||
{
|
||||
case 1: controlsPoints = [0, 0, 1, 1];
|
||||
break;
|
||||
case 2: controlsPoints = [0.42, 0, 1, 1];
|
||||
break;
|
||||
case 3: controlsPoints = [0, 0, 0.58, 1];
|
||||
break;
|
||||
case 4: controlsPoints = [0.42, 0, 0.58, 1];
|
||||
break;
|
||||
case 0: controlsPoints = [self controlsPointsForGroup:aGroup];
|
||||
break;
|
||||
}
|
||||
|
||||
return [CAMediaTimingFunction functionWithControlPoints:controlsPoints[0] :controlsPoints[1] :controlsPoints[2] :controlsPoints[3]];
|
||||
}
|
||||
|
||||
- (Function)completionHandlerFromString:(CPString)aMessage
|
||||
{
|
||||
if (!aMessage || ![aMessage length])
|
||||
return nil;
|
||||
|
||||
var s = new Date();
|
||||
return function()
|
||||
{
|
||||
var e = new Date() - s;
|
||||
CPLogConsole(aMessage + " in " + e + " ms");
|
||||
};
|
||||
}
|
||||
|
||||
- (CAKeyframeAnimation)bounceAnimation:(CPView)aView
|
||||
{
|
||||
var anim = [CAKeyframeAnimation animation],
|
||||
easein = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn],
|
||||
easeout = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
|
||||
|
||||
[anim setKeyTimes:[0, 0.25, 0.5, 0.75, 1]];
|
||||
var origin = CGPointMakeCopy([aView frameOrigin]);
|
||||
[anim setValues:[origin, CGPointMake(origin.x, origin.y + 50), origin, CGPointMake(origin.x, origin.y + 25), origin]];
|
||||
[anim setTimingFunctions:[easeout, easein, easeout, easein]];
|
||||
|
||||
return anim;
|
||||
}
|
||||
|
||||
- (CABasicAnimation)fadeOutAnimation
|
||||
{
|
||||
var animation = [CABasicAnimation animationWithKeyPath:@"alphaValue"];
|
||||
[animation setDuration:0.2];
|
||||
[animation setFromValue:1];
|
||||
[animation setToValue:0];
|
||||
|
||||
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]];
|
||||
|
||||
return animation;
|
||||
}
|
||||
|
||||
- (IBAction)setupGroup1:(id)sender
|
||||
{
|
||||
var contentView = [group1Box contentView];
|
||||
|
||||
var hasSubviews = [[contentView viewWithTag:1000] state] * 2,
|
||||
customLayout = [[contentView viewWithTag:1001] state] * 4,
|
||||
customDraw = [[contentView viewWithTag:1002] state] * 8,
|
||||
customDrawSubviews = [[contentView viewWithTag:1003] state],
|
||||
autoLayout = [[contentView viewWithTag:1004] state],
|
||||
options = hasSubviews | customLayout | customDraw;
|
||||
|
||||
[leftView removeFromSuperview];
|
||||
leftView = [self viewWithOptions:options];
|
||||
|
||||
if (leftView)
|
||||
{
|
||||
[leftView setFrame:CGRectMake(0, 0, 200, 200)];
|
||||
[animationSandbox addSubview:leftView];
|
||||
}
|
||||
|
||||
if (hasSubviews)
|
||||
[self addSubviewsToView:leftView autoLayout:(autoLayout && !customLayout) customDrawSubviews:customDrawSubviews];
|
||||
}
|
||||
|
||||
- (IBAction)setupGroup2:(id)sender
|
||||
{
|
||||
var contentView = [group2Box contentView];
|
||||
|
||||
var hasSubviews = [[contentView viewWithTag:1000] state] * 2,
|
||||
customLayout = [[contentView viewWithTag:1001] state] * 4,
|
||||
customDraw = [[contentView viewWithTag:1002] state] * 8,
|
||||
options = hasSubviews | customLayout | customDraw;
|
||||
|
||||
[rightView removeFromSuperview];
|
||||
rightView = [self viewWithOptions:options];
|
||||
|
||||
if (rightView)
|
||||
{
|
||||
[rightView setFrame:CGRectMake(250, 0, 200, 200)];
|
||||
[animationSandbox addSubview:rightView];
|
||||
}
|
||||
|
||||
if (leftView)
|
||||
[animationSandbox addSubview:leftView];
|
||||
|
||||
if (hasSubviews)
|
||||
[self addSubviewsToView:rightView autoLayout:!customLayout customDrawSubviews:NO];
|
||||
}
|
||||
|
||||
- (void)viewWithOptions:(CPInteger)options
|
||||
{
|
||||
var view = nil,
|
||||
hasSubviews = NO;
|
||||
|
||||
switch (options)
|
||||
{
|
||||
case 0: view = [[ColorView alloc] initWithFrame:CGRectMakeZero()];
|
||||
break;
|
||||
|
||||
case 2: view = [[ColorView alloc] initWithFrame:CGRectMakeZero()];
|
||||
hasSubviews = YES;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 6: view = [[CustomLayoutView alloc] initWithFrame:CGRectMakeZero()];
|
||||
[view setBackgroundColor:[CPColor randomColor]];
|
||||
hasSubviews = YES;
|
||||
break;
|
||||
|
||||
case 12:
|
||||
case 14: view = [[CustomLayoutDrawView alloc] initWithFrame:CGRectMakeZero()];
|
||||
hasSubviews = YES;
|
||||
break;
|
||||
|
||||
case 8: view = [[DrawView alloc] initWithFrame:CGRectMakeZero()];
|
||||
break;
|
||||
|
||||
case 10: view = [[DrawView alloc] initWithFrame:CGRectMakeZero()];
|
||||
hasSubviews = YES;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
var anims = [CPDictionary dictionaryWithObject:[self fadeOutAnimation] forKey:@"CPAnimationTriggerOrderOut"];
|
||||
[view setAnimations:anims];
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
- (void)addSubviewsToView:(CPView)aView autoLayout:(BOOL)autoLayout customDrawSubviews:(BOOL)customDrawSubviews
|
||||
{
|
||||
var subViewClass = customDrawSubviews ? [DrawView class] : [ColorView class];
|
||||
|
||||
for (var i = 0; i < 5; i++)
|
||||
{
|
||||
var view = [[subViewClass alloc] initWithFrame:CGRectMake(50, i * 40, 80, 26)];
|
||||
if (autoLayout)
|
||||
[view setAutoresizingMask:CPViewWidthSizable|CPViewMinYMargin];
|
||||
|
||||
[aView addSubview:view];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ColorView : CPView
|
||||
{
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame
|
||||
{
|
||||
self = [super initWithFrame:aFrame];
|
||||
|
||||
[self setBackgroundColor:[CPColor randomColor]];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation DrawView : CPView
|
||||
{
|
||||
CPColor color @accessors;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame
|
||||
{
|
||||
self = [super initWithFrame:aFrame];
|
||||
|
||||
color = [CPColor randomColor];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)drawRect:(CGRect)aRect
|
||||
{
|
||||
var context = [[CPGraphicsContext currentContext] graphicsPort],
|
||||
bounds = [self bounds];
|
||||
|
||||
CGContextSetLineWidth(context, 2);
|
||||
CGContextSetStrokeColor(context, [CPColor blackColor]);
|
||||
CGContextSetFillColor(context, color);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextFillRect(context, bounds);
|
||||
|
||||
var height = CGRectGetHeight(bounds),
|
||||
width = CGRectGetWidth(bounds);
|
||||
|
||||
CGContextStrokeLineSegments(context, [CGPointMake(10,0), CGPointMake(10, height),
|
||||
CGPointMake(0, 10), CGPointMake(CGRectGetWidth(aRect), 10),
|
||||
CGPointMake(width - 10, 0), CGPointMake(width - 10, height),
|
||||
CGPointMake(0, height - 10), CGPointMake(width, height - 10)], 8);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CustomLayoutView : CPView
|
||||
{
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
var subviews = [self subviews],
|
||||
count = [subviews count] - 1;
|
||||
|
||||
var dx = (CGRectGetWidth([self frame]) - 100) / count,
|
||||
dy = (CGRectGetHeight([self frame]) - 26) / count
|
||||
|
||||
[subviews enumerateObjectsUsingBlock:function(view, idx, stop)
|
||||
{
|
||||
[view setFrameOrigin:CGPointMake(dx * idx, dy * idx)];
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CustomLayoutDrawView : DrawView
|
||||
{
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
var subviews = [self subviews],
|
||||
count = [subviews count] - 1;
|
||||
|
||||
var dx = (CGRectGetWidth([self frame]) - 100) / count,
|
||||
dy = (CGRectGetHeight([self frame]) - 26) / count
|
||||
|
||||
[subviews enumerateObjectsUsingBlock:function(view, idx, stop)
|
||||
{
|
||||
[view setFrameOrigin:CGPointMake(dx * idx, dy * idx)];
|
||||
}];
|
||||
}
|
||||
|
||||
@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>CPAnimatablePropertyContainerTest</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* CPAnimatablePropertyContainerTest
|
||||
*
|
||||
* Created by You on December 3, 2012.
|
||||
* Copyright 2012, Your Company 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 ("CPAnimatablePropertyContainerTest", function(task)
|
||||
{
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "CPAnimatablePropertyContainerTest.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("CPAnimatablePropertyContainerTest");
|
||||
task.setIdentifier("com.yourcompany.CPAnimatablePropertyContainerTest");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("CPAnimatablePropertyContainerTest");
|
||||
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", ["CPAnimatablePropertyContainerTest"], 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", "CPAnimatablePropertyContainerTest", "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", "CPAnimatablePropertyContainerTest", "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "CPAnimatablePropertyContainerTest"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "CPAnimatablePropertyContainerTest"), FILE.join("Build", "Deployment", "CPAnimatablePropertyContainerTest")]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", "CPAnimatablePropertyContainerTest"));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPAnimatablePropertyContainerTest"), FILE.join("Build", "Desktop", "CPAnimatablePropertyContainerTest", "CPAnimatablePropertyContainerTest.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", "CPAnimatablePropertyContainerTest", "CPAnimatablePropertyContainerTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPAnimatablePropertyContainerTest"));
|
||||
print("----------------------------");
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;52E;D;K;6;CP$UIDd;2;53E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;122E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;125E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;127E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;3;129E;D;K;6;CP$UIDd;3;130E;D;K;6;CP$UIDd;3;132E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;137E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;3;137E;D;K;6;CP$UIDd;3;137E;D;K;6;CP$UIDd;3;137E;D;K;6;CP$UIDd;3;137E;D;K;6;CP$UIDd;3;137E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UILine truncated
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,107 @@
|
||||
<!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
|
||||
CPAnimatablePropertyContainerTest
|
||||
|
||||
Created by You on December 3, 2012.
|
||||
Copyright 2012, Your Company 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>CPAnimatablePropertyContainerTest</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);
|
||||
|
||||
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
|
||||
// the class name of the view that created them. Comment this or set to false to disable.
|
||||
appkit_tag_dom_elements = true;
|
||||
</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 CPAnimatablePropertyContainerTest...</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
|
||||
CPAnimatablePropertyContainerTest
|
||||
|
||||
Created by You on December 3, 2012.
|
||||
Copyright 2012, Your Company 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>CPAnimatablePropertyContainerTest</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 CPAnimatablePropertyContainerTest...</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
|
||||
* CPAnimatablePropertyContainerTest
|
||||
*
|
||||
* Created by You on December 3, 2012.
|
||||
* Copyright 2012, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -1 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;108E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;2;91E;D;K;6;CLine truncated
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;2;51E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;52E;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;123E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6Line truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -6,8 +6,7 @@
|
||||
* Copyright 2010, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
var categories = ["firstName", "lastName"],
|
||||
MenuItemPrefix = @" ";
|
||||
var categories = ["firstName", "lastName"];
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@@ -40,18 +39,20 @@ var categories = ["firstName", "lastName"],
|
||||
keyEquivalent:@""
|
||||
atIndex:0];
|
||||
|
||||
var item = [[CPMenuItem alloc] initWithTitle:MenuItemPrefix + @"First Name"
|
||||
var item = [[CPMenuItem alloc] initWithTitle:@"First Name"
|
||||
action:@selector(changeCategory:)
|
||||
keyEquivalent:@""];
|
||||
|
||||
[item setIndentationLevel:1];
|
||||
[item setTarget:self];
|
||||
[item setTag:1];
|
||||
[item setState:CPOnState];
|
||||
[searchMenuTemplate insertItem:item atIndex:1];
|
||||
|
||||
item = [[CPMenuItem alloc] initWithTitle:MenuItemPrefix + @"Last Name"
|
||||
item = [[CPMenuItem alloc] initWithTitle:@"Last Name"
|
||||
action:@selector(changeCategory:)
|
||||
keyEquivalent:@""];
|
||||
|
||||
[item setIndentationLevel:1];
|
||||
[item setTarget:self];
|
||||
[item setTag:2];
|
||||
[item setState:CPOffState];
|
||||
@@ -104,7 +105,7 @@ var categories = ["firstName", "lastName"],
|
||||
- (void)changeCategory:(CPMenuItem)menuItem
|
||||
{
|
||||
searchCategoryIndex = [menuItem tag] - 1;
|
||||
[searchField setPlaceholderString:[[menuItem title] substringFromIndex:[MenuItemPrefix length]]];
|
||||
[searchField setPlaceholderString:[menuItem title]];
|
||||
|
||||
[self _updateSearchMenuTemplate];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPViewController
|
||||
*
|
||||
* Created by You on November 11, 2015.
|
||||
* Copyright 2015, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@implementation Button : CPButton
|
||||
{
|
||||
}
|
||||
|
||||
- (void)mouseDown:(CPEvent)anEvent
|
||||
{
|
||||
[[CPApp delegate] load];
|
||||
[super mouseDown:anEvent];
|
||||
}
|
||||
|
||||
- (void)mouseUp:(CPEvent)anEvent
|
||||
{
|
||||
[[CPApp delegate] removeSubviews];
|
||||
[super mouseUp:anEvent];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPWindow theWindow;
|
||||
@outlet CPView holderView;
|
||||
|
||||
BOOL async @accessors;
|
||||
}
|
||||
|
||||
- (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:NO];
|
||||
|
||||
}
|
||||
|
||||
- (void)load
|
||||
{
|
||||
if (async)
|
||||
[self loadAsync];
|
||||
else
|
||||
[self loadSync];
|
||||
}
|
||||
|
||||
- (void)loadAsync
|
||||
{
|
||||
var vc = [[CPViewController alloc] initWithCibName:@"ViewController" bundle:nil];
|
||||
var vc2 = [[CPViewController alloc] initWithCibName:@"ViewController2" bundle:nil];
|
||||
|
||||
[vc loadViewWithCompletionHandler:function(view1, error)
|
||||
{
|
||||
[view1 setBackgroundColor:[CPColor redColor]];
|
||||
[holderView addSubview:view1];
|
||||
|
||||
[vc2 loadViewWithCompletionHandler:function(view2, error)
|
||||
{
|
||||
[view2 setBackgroundColor:[CPColor greenColor]];
|
||||
[view1 addSubview:view2];
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)loadSync
|
||||
{
|
||||
var vc = [[CPViewController alloc] initWithCibName:@"ViewController" bundle:nil];
|
||||
var vc2 = [[CPViewController alloc] initWithCibName:@"ViewController2" bundle:nil];
|
||||
|
||||
var view1 = [vc view];
|
||||
[view1 setBackgroundColor:[CPColor redColor]];
|
||||
[holderView addSubview:view1];
|
||||
|
||||
var view2 = [vc2 view];
|
||||
[view2 setBackgroundColor:[CPColor greenColor]];
|
||||
[view1 addSubview:view2];
|
||||
}
|
||||
|
||||
- (@action)removeSubviews:(id)sender
|
||||
{
|
||||
[[holderView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,14 @@
|
||||
<?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>CPViewController</string>
|
||||
<key>CPBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>CPHumanReadableCopyright</key>
|
||||
<string>Copyright © 2015, Your Company All rights reserved.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* CPViewController
|
||||
*
|
||||
* Created by You on November 11, 2015.
|
||||
* Copyright 2015, Your Company 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"),
|
||||
projectName = "CPViewController";
|
||||
|
||||
app (projectName, function(task)
|
||||
{
|
||||
ENV["OBJJ_INCLUDE_PATHS"] = "Frameworks";
|
||||
|
||||
if (configuration === "Debug")
|
||||
ENV["OBJJ_INCLUDE_PATHS"] = FILE.join(ENV["OBJJ_INCLUDE_PATHS"], configuration);
|
||||
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "CPViewController.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("CPViewController");
|
||||
task.setIdentifier("com.yourcompany.CPViewController");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("CPViewController");
|
||||
task.setSources(new FileList("**/*.j").exclude(FILE.join("Build", "**")).exclude(FILE.join("Frameworks", "Source", "**")));
|
||||
task.setResources(new FileList("Resources/**"));
|
||||
task.setIndexFilePath("index.html");
|
||||
task.setInfoPlistPath("Info.plist");
|
||||
|
||||
if (configuration === "Debug")
|
||||
task.setCompilerFlags("-DDEBUG -g");
|
||||
else
|
||||
task.setCompilerFlags("-O2");
|
||||
});
|
||||
|
||||
task ("default", [projectName], function()
|
||||
{
|
||||
printResults(configuration);
|
||||
});
|
||||
|
||||
task ("build", ["default"], function()
|
||||
{
|
||||
updateApplicationSize();
|
||||
});
|
||||
|
||||
task ("debug", function()
|
||||
{
|
||||
configuration = ENV["CONFIGURATION"] = "Debug";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("release", function()
|
||||
{
|
||||
configuration = ENV["CONFIGURATION"] = "Release";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("run", ["debug"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Debug", projectName, "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", projectName, "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", projectName));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", projectName), FILE.join("Build", "Deployment", projectName)]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", projectName));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", projectName), FILE.join("Build", "Desktop", projectName, "CPViewController.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", projectName, "CPViewController.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, projectName));
|
||||
print("----------------------------");
|
||||
}
|
||||
|
||||
function updateApplicationSize()
|
||||
{
|
||||
print("Calculating application file sizes...");
|
||||
|
||||
var contents = FILE.read(FILE.join("Build", configuration, projectName, "Info.plist"), { charset:"UTF-8" }),
|
||||
format = CFPropertyList.sniffedFormatOfString(contents),
|
||||
plist = CFPropertyList.propertyListFromString(contents),
|
||||
totalBytes = {executable:0, data:0, mhtml:0};
|
||||
|
||||
// Get the size of all framework executables and sprite data
|
||||
var frameworksDir = "Frameworks";
|
||||
|
||||
if (configuration === "Debug")
|
||||
frameworksDir = FILE.join(frameworksDir, "Debug");
|
||||
|
||||
var frameworks = FILE.list(frameworksDir);
|
||||
|
||||
frameworks.forEach(function(framework)
|
||||
{
|
||||
if (framework !== "Source")
|
||||
addBundleFileSizes(FILE.join(frameworksDir, framework), totalBytes);
|
||||
});
|
||||
|
||||
// Read in the default theme name, and attempt to get its size
|
||||
var themeName = plist.valueForKey("CPDefaultTheme") || "Aristo2",
|
||||
themePath = nil;
|
||||
|
||||
if (themeName === "Aristo" || themeName === "Aristo2")
|
||||
themePath = FILE.join(frameworksDir, "AppKit", "Resources", themeName + ".blend");
|
||||
else
|
||||
themePath = FILE.join("Frameworks", "Resources", themeName + ".blend");
|
||||
|
||||
if (FILE.isDirectory(themePath))
|
||||
addBundleFileSizes(themePath, totalBytes);
|
||||
|
||||
// Add sizes for the app
|
||||
addBundleFileSizes(FILE.join("Build", configuration, projectName), totalBytes);
|
||||
|
||||
print("Executables: " + totalBytes.executable + ", sprite data: " + totalBytes.data + ", total: " + (totalBytes.executable + totalBytes.data));
|
||||
|
||||
var dict = new CFMutableDictionary();
|
||||
|
||||
dict.setValueForKey("executable", totalBytes.executable);
|
||||
dict.setValueForKey("data", totalBytes.data);
|
||||
dict.setValueForKey("mhtml", totalBytes.mhtml);
|
||||
|
||||
plist.setValueForKey("CPApplicationSize", dict);
|
||||
|
||||
FILE.write(FILE.join("Build", configuration, projectName, "Info.plist"), CFPropertyList.stringFromPropertyList(plist, format), { charset:"UTF-8" });
|
||||
}
|
||||
|
||||
function addBundleFileSizes(bundlePath, totalBytes)
|
||||
{
|
||||
var bundleName = FILE.basename(bundlePath),
|
||||
environment = bundleName === "Foundation" ? "Objj" : "Browser",
|
||||
bundlePath = FILE.join(bundlePath, environment + ".environment");
|
||||
|
||||
if (FILE.isDirectory(bundlePath))
|
||||
{
|
||||
var filename = bundleName + ".sj",
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, filename));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.executable += filePath.size();
|
||||
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, "dataURLs.txt"));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.data += filePath.size();
|
||||
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLData.txt"));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.mhtml += filePath.size();
|
||||
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLPaths.txt"));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.mhtml += filePath.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;21E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;37E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;38E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;39E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;37E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;40E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;37E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;28E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;41E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;37E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;24E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;42E;E;D;K;10;$classnameS;21;CPCibControlConnectorK;8;$classesA;S;21;CPCibControlConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;18E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;36E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;37E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;43E;E;D;K;10;$classnameS;21;CPCibBindingConnectorK;8;$classesA;S;21;CPCibBindingConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;32E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;37E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;44E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;45E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;46E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;48E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;38E;E;D;K;10;$classnameS;20;_CPCibWindowTemplateK;8;$classesA;S;20;_CPCibWindowTemplateS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;23E;K;30;_CPCibWindowTemplateMaxSizeKeyD;K;6;CP$UIDd;2;49E;K;32;_CPCibWindowTemplateViewClassKeyD;K;6;CP$UIDd;1;0E;K;34;_CPCibWindowTemplateWindowClassKeyD;K;6;CP$UIDd;2;50E;K;30;_CPCibWindowTemplateWTFlagsKeyD;K;6;CP$UIDd;2;51E;K;33;_CPCibWindowTemplateWindowRectKeyD;K;6;CP$UIDd;2;52E;K;33;_CPCibWindowTemplateScreenRectKeyD;K;6;CP$UIDd;2;53E;K;30;_CPCibWindowTempatStyleMaskKeyD;K;6;CP$UIDd;2;54E;K;34;_CPCibWindowTemplateWindowTitleKeyD;K;6;CP$UIDd;2;55E;K;33;_CPCibWindowTemplateWindowViewKeyD;K;6;CP$UIDd;2;26E;E;D;K;10;$classnameS;6;CPViewK;8;$classesA;S;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;25E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;56E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;57E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;57E;K;17;CPViewSubviewsKeyD;K;6;CP$UIDd;2;58E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;59E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;2;60E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;2;60E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;2;61E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;E;D;K;10;$classnameS;16;_CPCibLine truncated
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9060" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="1050" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9060"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="450" id="451"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="371">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="335" y="390" width="480" height="360"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<view key="contentView" id="372">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<customView id="w9e-Zb-daF">
|
||||
<rect key="frame" x="44" y="20" width="390" height="243"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</customView>
|
||||
<button verticalHuggingPriority="750" id="gT9-6e-KoE" customClass="Button">
|
||||
<rect key="frame" x="38" y="321" width="169" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Load View Controller" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="XTP-0T-Mew">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
<button id="4bJ-Ys-LRV">
|
||||
<rect key="frame" x="211" y="329" width="122" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Asynchronously" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="ecG-wc-Zbu">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="450" name="value" keyPath="async" id="KZD-w9-lYJ"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="3Dg-Pi-Ek1">
|
||||
<rect key="frame" x="42" y="271" width="394" height="36"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="After loading the view controller, you should see a green rectangle inside a red rectangle." id="13V-4j-MGL">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" id="JDH-Sz-h6Z">
|
||||
<rect key="frame" x="375" y="321" width="91" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Remove" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="INI-Ui-HdW">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="removeSubviews:" target="450" id="emQ-aC-AH0"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
</window>
|
||||
<customObject id="450" customClass="AppController">
|
||||
<connections>
|
||||
<outlet property="holderView" destination="w9e-Zb-daF" id="ZG8-xB-3Z1"/>
|
||||
<outlet property="theWindow" destination="371" id="459"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;18E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;19E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;20E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;18E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;21E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;22E;E;D;K;10;$classnameS;18;_CPCibClassSwapperK;8;$classesA;S;18;_CPCibClassSwapperS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;23E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;24E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;24E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;2;25E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;26E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;2;27E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;2;27E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;2;28E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;32;CPDoNotTranslateAutoresizingMaskD;K;6;CP$UIDd;2;28E;K;30;_CPCibClassSwapperClassNameKeyD;K;6;CP$UIDd;2;29E;K;38;_CPCibClassSwapperOriginalClassNameKeyD;K;6;CP$UIDd;2;30E;E;S;16;CPViewControllerD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;4;viewS;13;CPApplicationd;1;0S;20;{{0, 0}, {480, 272}}d;2;12S;6;normalS;6;{1, 1}F;S;6;NSViewS;6;CPViewE;K;9;$archiverS;15;CPKeyedArchiverK;8;$versionS;6;100000E;
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9060" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9060"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSViewController">
|
||||
<connections>
|
||||
<outlet property="view" destination="c22-O7-iKe" id="2OW-O2-sHh"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="c22-O7-iKe">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;18E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;19E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;20E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;18E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;21E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;22E;E;D;K;10;$classnameS;18;_CPCibClassSwapperK;8;$classesA;S;18;_CPCibClassSwapperS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;23E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;24E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;24E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;2;25E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;26E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;2;27E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;2;27E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;2;28E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;32;CPDoNotTranslateAutoresizingMaskD;K;6;CP$UIDd;2;28E;K;30;_CPCibClassSwapperClassNameKeyD;K;6;CP$UIDd;2;29E;K;38;_CPCibClassSwapperOriginalClassNameKeyD;K;6;CP$UIDd;2;30E;E;S;16;CPViewControllerD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;4;viewS;13;CPApplicationd;1;0S;20;{{0, 0}, {268, 165}}d;2;12S;6;normalS;6;{1, 1}F;S;6;NSViewS;6;CPViewE;K;9;$archiverS;15;CPKeyedArchiverK;8;$versionS;6;100000E;
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9060" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9060"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSViewController">
|
||||
<connections>
|
||||
<outlet property="view" destination="c22-O7-iKe" id="2OW-O2-sHh"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="c22-O7-iKe">
|
||||
<rect key="frame" x="0.0" y="0.0" width="268" height="165"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<point key="canvasLocation" x="307" y="363.5"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -1,121 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1070</int>
|
||||
<string key="IBDocument.SystemVersion">11C42</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.17</string>
|
||||
<string key="IBDocument.HIToolboxVersion">567.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">1938</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSWindowTemplate</string>
|
||||
<string>NSView</string>
|
||||
<string>NSCustomObject</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<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="NSWindowTemplate" id="1005">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{196, 240}, {480, 270}}</string>
|
||||
<int key="NSWTFlags">544735232</int>
|
||||
<string key="NSWindowTitle">Window</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<object class="NSView" key="NSWindowView" id="1006">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{480, 270}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords"/>
|
||||
<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">1</int>
|
||||
<reference key="object" ref="1005"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="1006"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="1006"/>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</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="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1.IBWindowTemplateEditedContentRect">{{357, 418}, {480, 270}}</string>
|
||||
<integer value="1" key="1.NSWindowTemplate.visibleAtLaunch"/>
|
||||
<string key="2.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">2</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<bool key="IBDocument.UseAutolayout">YES</bool>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -0,0 +1,193 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
CPViewController
|
||||
|
||||
Created by You on November 11, 2015.
|
||||
Copyright 2015, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<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>CPViewController</title>
|
||||
|
||||
<!-- Custom javascript goes here -->
|
||||
<!-- End custom javascript -->
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
|
||||
// Uncomment below to generate debug symbols, type signatures and inline objj_msgSend functions
|
||||
// OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures", "InlineMsgSend"];
|
||||
|
||||
var progressBar = null;
|
||||
|
||||
OBJJ_PROGRESS_CALLBACK = function(percent, appSize, path)
|
||||
{
|
||||
percent = percent * 100;
|
||||
|
||||
if (!progressBar)
|
||||
progressBar = document.getElementById("progress-bar");
|
||||
|
||||
if (progressBar)
|
||||
progressBar.style.width = Math.min(percent, 100) + "%";
|
||||
}
|
||||
|
||||
var loadingHTML =
|
||||
'<div id="loading">' +
|
||||
' <div id="loading-text">Loading...</div>' +
|
||||
' <div id="progress-indicator">' +
|
||||
' <span id="progress-bar" style="width:0%"></span>' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
</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);
|
||||
|
||||
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
|
||||
// the class name of the view that created them. Comment this or set to false to disable.
|
||||
appkit_tag_dom_elements = true;
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
html, body, h1, p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* We need a body wrapper because Cappuccino is unhappy if we change the body element */
|
||||
#cappuccino-body {
|
||||
/* Position it absolutely so it will fill the height without content */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
|
||||
/* Put it at the bottom of the stack so it doesn't interfere with UI */
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#cappuccino-body .container {
|
||||
display: table;
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#cappuccino-body .content {
|
||||
display: table-cell;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#loading {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
}
|
||||
|
||||
#loading-text {
|
||||
height: 1.5em;
|
||||
color: #555;
|
||||
font: normal bold 36px/36px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#progress-indicator {
|
||||
padding: 0px;
|
||||
height: 16px;
|
||||
border: 5px solid #555;
|
||||
border-radius: 18px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#progress-bar {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
left: -1px;
|
||||
display: block;
|
||||
height: 18px;
|
||||
|
||||
/* Compensate for moving the bar left 1px to overlap the indicator border */
|
||||
border-right: 1px solid #555;
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
#noscript {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
padding: 1em 1.5em;
|
||||
border: 5px solid #555;
|
||||
border-radius: 16px;
|
||||
background-color: white;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font: bold 24px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#noscript a {
|
||||
color: #98c0ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="cappuccino-body">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<script type="text/javascript">
|
||||
document.write(loadingHTML);
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<noscript style="position:absolute; top:0; left:0; width:100%; height:100%">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div id="noscript">
|
||||
<p style="font-size:120%; margin-bottom:.75em">JavaScript is required for this site.</p>
|
||||
<p><a href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,161 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index.html
|
||||
CPViewController
|
||||
|
||||
Created by You on November 11, 2015.
|
||||
Copyright 2015, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<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>CPViewController</title>
|
||||
|
||||
<!-- Custom javascript goes here -->
|
||||
<!-- End custom javascript -->
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
|
||||
var progressBar = null;
|
||||
|
||||
OBJJ_PROGRESS_CALLBACK = function(percent, appSize, path)
|
||||
{
|
||||
percent = percent * 100;
|
||||
|
||||
if (!progressBar)
|
||||
progressBar = document.getElementById("progress-bar");
|
||||
|
||||
if (progressBar)
|
||||
progressBar.style.width = Math.min(percent, 100) + "%";
|
||||
}
|
||||
|
||||
var loadingHTML =
|
||||
'<div id="loading">' +
|
||||
' <div id="loading-text">Loading...</div>' +
|
||||
' <div id="progress-indicator">' +
|
||||
' <span id="progress-bar" style="width:0%"></span>' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
html, body, h1, p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* We need a body wrapper because Cappuccino is unhappy if we change the body element */
|
||||
#cappuccino-body {
|
||||
/* Position it absolutely so it will fill the height without content */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
|
||||
/* Put it at the bottom of the stack so it doesn't interfere with UI */
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#cappuccino-body .container {
|
||||
display: table;
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#cappuccino-body .content {
|
||||
display: table-cell;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#loading {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
}
|
||||
|
||||
#loading-text {
|
||||
height: 1.5em;
|
||||
color: #555;
|
||||
font: normal bold 36px/36px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#progress-indicator {
|
||||
padding: 0px;
|
||||
height: 16px;
|
||||
border: 5px solid #555;
|
||||
border-radius: 18px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#progress-bar {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
left: -1px;
|
||||
display: block;
|
||||
height: 18px;
|
||||
|
||||
/* Compensate for moving the bar left 1px to overlap the indicator border */
|
||||
border-right: 1px solid #555;
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
#noscript {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
padding: 1em 1.5em;
|
||||
border: 5px solid #555;
|
||||
border-radius: 16px;
|
||||
background-color: white;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font: bold 24px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#noscript a {
|
||||
color: #98c0ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="cappuccino-body">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<script type="text/javascript">
|
||||
document.write(loadingHTML);
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<noscript style="position:absolute; top:0; left:0; width:100%; height:100%">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div id="noscript">
|
||||
<p style="font-size:120%; margin-bottom:.75em">JavaScript is required for this site.</p>
|
||||
<p><a href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPViewController
|
||||
*
|
||||
* Created by You on November 11, 2015.
|
||||
* Copyright 2015, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
@@ -224,6 +224,7 @@ var rootItems = [CPArray arrayWithObject:[CPDictionary dictionaryWithObjectsAndK
|
||||
[smartOutlineView reloadData];
|
||||
|
||||
[self saveSmartFolders];
|
||||
[aSheet orderOut:nil];
|
||||
}
|
||||
}
|
||||
// convenience method
|
||||
|
||||
@@ -1 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;92E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;93E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;94E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;89E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;95E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;89E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;51E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;96E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;89E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;45E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;97E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;51E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;90E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDdLine truncated
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;92E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;93E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;94E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;89E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;95E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;89E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;53E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;96E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;89E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;45E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;97E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;53E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;90E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDdLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -38,7 +38,7 @@ PROJECT_NAME = " API"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 0.9.8
|
||||
PROJECT_NUMBER = 0.9.9
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
@@ -796,9 +796,9 @@
|
||||
<rect key="frame" x="18" y="20" width="260" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Copyright © 2012-2015 The Cappuccino Project" id="8lT-Ky-ecV">
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Copyright © 2012-2016 Cappuccino Project." id="8lT-Ky-ecV">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" white="0.5" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2015 cappuccino-project. All rights reserved.</string>
|
||||
<string>Copyright © 2012-2016 Cappuccino Project. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
@@ -56,6 +56,6 @@
|
||||
<key>XCCLastCappuccinoMasterBranchURL</key>
|
||||
<string>https://github.com/cappuccino/cappuccino/archive/master.zip</string>
|
||||
<key>XCCLastCappuccinoReleaseURL</key>
|
||||
<string>https://github.com/cappuccino/cappuccino/archive/0.9.8.zip</string>
|
||||
<string>https://github.com/cappuccino/cappuccino/archive/0.9.9.zip</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -75,7 +75,7 @@ def install_cappuccino_base(env_path):
|
||||
"""
|
||||
Install latest version of Cappuccino Base
|
||||
"""
|
||||
exec_shell("curl https://raw.githubusercontent.com/cappuccino/cappuccino/v0.9.7-1/bootstrap.sh >/tmp/cb.sh")
|
||||
exec_shell("curl https://raw.githubusercontent.com/cappuccino/cappuccino/master/bootstrap.sh >/tmp/cb.sh")
|
||||
exec_shell("bash /tmp/cb.sh --directory '%s/narwhal' --noprompt" % (env_path))
|
||||
exec_shell("rm /tmp/cb.sh")
|
||||
|
||||
|
||||
@@ -203,6 +203,7 @@ var NSButtonIsBorderedMask = 0x00800000,
|
||||
[self setImage:[cell normalImage]];
|
||||
[self setAlternateImage:alternateImage];
|
||||
[self setImagePosition:[cell imagePosition]];
|
||||
[self setImageScaling:[cell imageScaling]];
|
||||
|
||||
[self setEnabled:[cell isEnabled]];
|
||||
|
||||
@@ -417,8 +418,8 @@ var NSButtonIsBorderedMask = 0x00800000,
|
||||
CPImage _alternateImage @accessors(readonly, getter=alternateImage);
|
||||
|
||||
BOOL _allowsMixedState @accessors(readonly, getter=allowsMixedState);
|
||||
BOOL _imagePosition @accessors(readonly, getter=imagePosition);
|
||||
|
||||
int _imagePosition @accessors(readonly, getter=imagePosition);
|
||||
int _imageScaling @accessors(readonly, getter=imageScaling);
|
||||
int _highlightsBy @accessors(readonly, getter=highlightsBy);
|
||||
int _showsStateBy @accessors(readonly, getter=showsStateBy);
|
||||
|
||||
@@ -439,6 +440,7 @@ var NSButtonIsBorderedMask = 0x00800000,
|
||||
|
||||
_isBordered = (buttonFlags & NSButtonIsBorderedMask) ? YES : NO;
|
||||
_bezelStyle = (buttonFlags2 & 0x7) | ((buttonFlags2 & 0x20) >> 2);
|
||||
_imageScaling = (((buttonFlags2 >> 6) & 0x3) + 2) % 4;
|
||||
|
||||
// NSContents/NSAlternateContents for NSButton is actually the title/alternate title
|
||||
_title = [aCoder decodeObjectForKey:@"NSContents"];
|
||||
|
||||
+1
-1
@@ -169,7 +169,7 @@ tmp_zip="/tmp/cappuccino.zip"
|
||||
local_distrib=""
|
||||
|
||||
github_user="cappuccino"
|
||||
github_ref="v0.9.8"
|
||||
github_ref="v0.9.9"
|
||||
|
||||
noprompt=""
|
||||
install_capp=""
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "0.9.8"
|
||||
"version": "0.9.9"
|
||||
}
|
||||
Reference in new issue
Block a user