mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-22 06:25:52 +00:00
Merge branch 'master' of https://github.com/cappuccino/cappuccino
This commit is contained in:
commit
02e71c23de
142 files changed
+12399
-4329
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"
|
||||
@@ -103,9 +104,11 @@
|
||||
@import "CPTokenField.j"
|
||||
@import "CPToolbar.j"
|
||||
@import "CPToolbarItem.j"
|
||||
@import "CPTrackingArea.j"
|
||||
@import "CPTreeNode.j"
|
||||
@import "CPUserDefaultsController.j"
|
||||
@import "CPView.j"
|
||||
@import "CPViewAnimator.j"
|
||||
@import "CPViewAnimation.j"
|
||||
@import "CPViewController.j"
|
||||
@import "CPVisualEffectView.j"
|
||||
|
||||
+17
-2
@@ -598,7 +598,8 @@ var CPBoxTypeKey = @"CPBoxTypeKey",
|
||||
CPBoxBorderTypeKey = @"CPBoxBorderTypeKey",
|
||||
CPBoxTitle = @"CPBoxTitle",
|
||||
CPBoxTitlePosition = @"CPBoxTitlePosition",
|
||||
CPBoxTitleView = @"CPBoxTitleView";
|
||||
CPBoxTitleView = @"CPBoxTitleView",
|
||||
CPBoxContentView = @"CPBoxContentView";
|
||||
|
||||
@implementation CPBox (CPCoding)
|
||||
|
||||
@@ -615,7 +616,20 @@ var CPBoxTypeKey = @"CPBoxTypeKey",
|
||||
_titlePosition = [aCoder decodeIntForKey:CPBoxTitlePosition];
|
||||
_titleView = [aCoder decodeObjectForKey:CPBoxTitleView] || [CPTextField labelWithTitle:_title];
|
||||
|
||||
_contentView = [self subviews][0];
|
||||
if (_boxType != CPBoxSeparator)
|
||||
{
|
||||
// FIXME: we have a problem with CIB decoding here.
|
||||
// We should be able to simply add : _contentView = [self subviews][0]
|
||||
// but first box subview seems to be malformed (badly decoded).
|
||||
// For example, when deployed, this view doesn't have its _trackingAreas array initialized.
|
||||
// As a (temporary) workaround, we encode/decode the _contentView property. We then transfer the subview hierarchy
|
||||
// and replace the first (and only) box subview with this _contentView
|
||||
|
||||
_contentView = [aCoder decodeObjectForKey:CPBoxContentView] || [[CPView alloc] initWithFrame:[self bounds]];
|
||||
var malformedContentView = [self subviews][0];
|
||||
[_contentView setSubviews:[malformedContentView subviews]];
|
||||
[self replaceSubview:malformedContentView with:_contentView];
|
||||
}
|
||||
|
||||
[self setAutoresizesSubviews:YES];
|
||||
[_contentView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
|
||||
@@ -635,6 +649,7 @@ var CPBoxTypeKey = @"CPBoxTypeKey",
|
||||
[aCoder encodeObject:_title forKey:CPBoxTitle];
|
||||
[aCoder encodeInt:_titlePosition forKey:CPBoxTitlePosition];
|
||||
[aCoder encodeObject:_titleView forKey:CPBoxTitleView];
|
||||
[aCoder encodeObject:_contentView forKey:CPBoxContentView];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -483,13 +483,12 @@ var CPColorPanelSwatchesCookie = "CPColorPanelSwatchesCookie";
|
||||
];
|
||||
}
|
||||
|
||||
var cookieValue = eval(cookieValue),
|
||||
result = [];
|
||||
var cookieValue = eval(cookieValue);
|
||||
|
||||
for (var i = 0; i < cookieValue.length; i++)
|
||||
result.push([CPColor colorWithHexString:cookieValue[i]]);
|
||||
|
||||
return result;
|
||||
return [cookieValue arrayByApplyingBlock:function(value)
|
||||
{
|
||||
return [CPColor colorWithHexString:value];
|
||||
}];
|
||||
}
|
||||
|
||||
- (CPArray)saveColorList
|
||||
|
||||
+2
-4
@@ -1142,11 +1142,9 @@ var CPComboBoxTextSubview = @"text",
|
||||
// Directly nuke _items, [_items removeAll] will trigger an extra call to setContent
|
||||
_items = [];
|
||||
|
||||
var values = [];
|
||||
|
||||
[anArray enumerateObjectsUsingBlock:function(object)
|
||||
var values = [anArray arrayByApplyingBlock:function(object)
|
||||
{
|
||||
values.push([object description]);
|
||||
return [object description];
|
||||
}];
|
||||
|
||||
[self addItemsWithObjectValues:values];
|
||||
|
||||
@@ -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(' '),
|
||||
|
||||
+14
-1
@@ -27,6 +27,7 @@
|
||||
@import "CPShadow.j"
|
||||
@import "CPView.j"
|
||||
@import "CPKeyValueBinding.j"
|
||||
@import "CPTrackingArea.j"
|
||||
|
||||
@global CPApp
|
||||
|
||||
@@ -200,7 +201,6 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Control Size
|
||||
|
||||
@@ -1056,6 +1056,19 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPControl (CPTrackingArea)
|
||||
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
[self removeAllTrackingAreas];
|
||||
[self addTrackingArea:[[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:self
|
||||
userInfo:nil]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CPControlActionKey = @"CPControlActionKey",
|
||||
CPControlControlSizeKey = @"CPControlControlSizeKey",
|
||||
CPControlControlStateKey = @"CPControlControlStateKey",
|
||||
|
||||
@@ -123,6 +123,9 @@ var currentCursor = nil,
|
||||
|
||||
- (void)set
|
||||
{
|
||||
if (currentCursor === self)
|
||||
return;
|
||||
|
||||
currentCursor = self;
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
@import "CPCompatibility.j"
|
||||
@import "CGGeometry.j"
|
||||
@import "CPText.j"
|
||||
@import "CPTrackingArea.j"
|
||||
|
||||
@class CPTextField
|
||||
@class CPWindow
|
||||
@@ -82,6 +83,8 @@ var _CPEventPeriodicEventPeriod = 0,
|
||||
BOOL _suppressCappuccinoCut;
|
||||
BOOL _suppressCappuccinoPaste;
|
||||
#endif
|
||||
|
||||
CPTrackingArea _trackingArea;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -141,6 +144,27 @@ var _CPEventPeriodicEventPeriod = 0,
|
||||
timestamp:aTimestamp windowNumber:aWindowNumber context:aGraphicsContext eventNumber:anEventNumber clickCount:aClickCount pressure:aPressure];
|
||||
}
|
||||
|
||||
/*!
|
||||
Creates a new mouse tracking event.
|
||||
|
||||
@param anEventType the event type
|
||||
@param aPoint the location of the cursor in the window specified by \c aWindowNumber
|
||||
@param modifierFlags a bitwise combination of the modifiers specified in the CPEvent globals
|
||||
@param aTimestamp the time the event occurred
|
||||
@param aWindowNumber the number of the CPWindow where the event occurred
|
||||
@param aGraphicsContext the graphics context where the event occurred
|
||||
@param anEventNumber a number for this event
|
||||
@param aTrackingArea the tracking area that triggered the event
|
||||
@throws CPInternalInconsistencyException if an invalid event type is provided
|
||||
@return the new mouse event
|
||||
*/
|
||||
+ (id)enterExitEventWithType:(CPEventType)anEventType location:(CGPoint)aPoint modifierFlags:(unsigned)modifierFlags
|
||||
timestamp:(CPTimeInterval)aTimestamp windowNumber:(int)aWindowNumber context:(CPGraphicsContext)aGraphicsContext
|
||||
eventNumber:(int)anEventNumber trackingArea:(CPTrackingArea)aTrackingArea
|
||||
{
|
||||
return [[self alloc] _initEnterExitEventWithType:anEventType location:aPoint modifierFlags:modifierFlags timestamp:aTimestamp windowNumber:aWindowNumber context:aGraphicsContext eventNumber:anEventNumber trackingArea:aTrackingArea];
|
||||
}
|
||||
|
||||
/*!
|
||||
Creates a new custom event.
|
||||
|
||||
@@ -201,6 +225,28 @@ var _CPEventPeriodicEventPeriod = 0,
|
||||
return self;
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
- (id)_initEnterExitEventWithType:(CPEventType)anEventType location:(CGPoint)aPoint modifierFlags:(unsigned)modifierFlags
|
||||
timestamp:(CPTimeInterval)aTimestamp windowNumber:(int)aWindowNumber context:(CPGraphicsContext)aGraphicsContext
|
||||
eventNumber:(int)anEventNumber trackingArea:(CPTrackingArea)aTrackingArea
|
||||
{
|
||||
if ((anEventType != CPMouseEntered) && (anEventType != CPMouseExited) && (anEventType != CPCursorUpdate))
|
||||
[CPException raise:CPInternalInconsistencyException reason:"Invalid event type"];
|
||||
|
||||
if (self = [self _initWithType:anEventType])
|
||||
{
|
||||
_location = CGPointCreateCopy(aPoint);
|
||||
_modifierFlags = modifierFlags;
|
||||
_timestamp = aTimestamp;
|
||||
_context = aGraphicsContext;
|
||||
_eventNumber = anEventNumber;
|
||||
_trackingArea = aTrackingArea;
|
||||
_window = [CPApp windowWithWindowNumber:aWindowNumber];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
- (id)_initKeyEventWithType:(CPEventType)anEventType location:(CGPoint)aPoint modifierFlags:(unsigned int)modifierFlags
|
||||
timestamp:(CPTimeInterval)aTimestamp windowNumber:(int)aWindowNumber context:(CPGraphicsContext)aGraphicsContext
|
||||
@@ -583,6 +629,14 @@ var _CPEventPeriodicEventPeriod = 0,
|
||||
}
|
||||
}
|
||||
|
||||
- (CPTrackingArea)trackingArea
|
||||
{
|
||||
if ((_type !== CPMouseEntered) && (_type !== CPMouseExited) && (_type !== CPCursorUpdate))
|
||||
[CPException raise:CPInternalInconsistencyException format:@"You can't call trackingArea for events of type %#x", _type]
|
||||
|
||||
return _trackingArea;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
function _CPEventFirePeriodEvent()
|
||||
|
||||
+6
-5
@@ -70,11 +70,12 @@ CPGradientDrawsAfterEndingLocation = kCGGradientDrawsAfterEndLocation;
|
||||
{
|
||||
if (self = [super init])
|
||||
{
|
||||
var cgColors = [],
|
||||
count = [someColors count],
|
||||
colorSpace = [aColorSpace CGColorSpace] || CGColorSpaceCreateDeviceRGB;
|
||||
for (var i = 0; i < count; i++)
|
||||
cgColors.push(CGColorCreate(colorSpace, [someColors[i] components]));
|
||||
var colorSpace = [aColorSpace CGColorSpace] || CGColorSpaceCreateDeviceRGB,
|
||||
cgColors = [someColors arrayByApplyingBlock:function(color)
|
||||
{
|
||||
return CGColorCreate(colorSpace, [color components])
|
||||
}];
|
||||
|
||||
_gradient = CGGradientCreateWithColors(colorSpace, cgColors, someLocations);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -43,10 +43,10 @@ function CPDrawTiledRects(
|
||||
if (sides.length != grays.length)
|
||||
[CPException raise:CPInvalidArgumentException reason:@"sides (length: " + sides.length + ") and grays (length: " + grays.length + ") must have the same length."];
|
||||
|
||||
var colors = [];
|
||||
|
||||
for (var i = 0; i < grays.length; ++i)
|
||||
colors.push([CPColor colorWithCalibratedWhite:grays[i] alpha:1.0]);
|
||||
var colors = [grays arrayByApplyingBlock:function(gray)
|
||||
{
|
||||
return [CPColor colorWithCalibratedWhite:gray alpha:1.0];
|
||||
}];
|
||||
|
||||
return CPDrawColorTiledRects(boundsRect, clipRect, sides, colors);
|
||||
}
|
||||
|
||||
@@ -433,6 +433,7 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo
|
||||
[self setUsesLazyFetching:[aCoder decodeBoolForKey:CPObjectControllerUsesLazyFetchingKey]];
|
||||
_isUsingManagedProxy = [aCoder decodeBoolForKey:CPObjectControllerIsUsingManagedProxyKey];
|
||||
_managedProxy = [aCoder decodeObjectForKey:CPObjectControllerManagedProxyKey];
|
||||
|
||||
if (content != nil)
|
||||
[self setContent:content];
|
||||
|
||||
@@ -455,6 +456,7 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo
|
||||
[aCoder encodeBool:[self automaticallyPreparesContent] forKey:CPObjectControllerAutomaticallyPreparesContentKey];
|
||||
[aCoder encodeBool:[self usesLazyFetching] forKey:CPObjectControllerUsesLazyFetchingKey];
|
||||
[aCoder encodeBool:_isUsingManagedProxy forKey:CPObjectControllerIsUsingManagedProxyKey];
|
||||
|
||||
if (_managedProxy)
|
||||
[aCoder encodeObject:_managedProxy forKey:CPObjectControllerManagedProxyKey];
|
||||
}
|
||||
|
||||
@@ -361,15 +361,10 @@ CPPopUpButtonStatePullsDown = CPThemeState("pulls-down");
|
||||
*/
|
||||
- (CPArray)itemTitles
|
||||
{
|
||||
var titles = [],
|
||||
items = [self itemArray],
|
||||
index = 0,
|
||||
count = [items count];
|
||||
|
||||
for (; index < count; ++index)
|
||||
titles.push([items[index] title]);
|
||||
|
||||
return titles;
|
||||
return [[self itemArray] arrayByApplyingBlock:function(item)
|
||||
{
|
||||
return [item title];
|
||||
}];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
@import <Foundation/CPObjJRuntime.j>
|
||||
|
||||
@import "CPEvent.j"
|
||||
@import "CPCursor.j"
|
||||
|
||||
@class CPKeyBinding
|
||||
@class CPMenu
|
||||
@@ -200,6 +201,18 @@ CPDeleteForwardKeyCode = 46;
|
||||
[_nextResponder performSelector:_cmd withObject:anEvent];
|
||||
}
|
||||
|
||||
/*!
|
||||
Notifies the receiver that the mouse entered the receiver's area and that it can adapt the cursor.
|
||||
@param anEvent contains information about the exit
|
||||
*/
|
||||
- (void)cursorUpdate:(CPEvent)anEvent
|
||||
{
|
||||
if (_nextResponder)
|
||||
[_nextResponder performSelector:_cmd withObject:anEvent];
|
||||
else
|
||||
[[CPCursor arrowCursor] set];
|
||||
}
|
||||
|
||||
/*!
|
||||
Notifies the receiver that the mouse scroll wheel has moved.
|
||||
@param anEvent information about the scroll
|
||||
|
||||
@@ -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];
|
||||
|
||||
+26
-20
@@ -26,6 +26,7 @@
|
||||
@import "CPImage.j"
|
||||
@import "CPView.j"
|
||||
@import "CPCursor.j"
|
||||
@import "CPTrackingArea.j"
|
||||
|
||||
@class CPUserDefaults
|
||||
@global CPApp
|
||||
@@ -562,26 +563,6 @@ var ShouldSuppressResizeNotifications = 1,
|
||||
//[[self window] setAcceptsMouseMovedEvents:YES];
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(CPEvent)anEvent
|
||||
{
|
||||
// Tracking code handles cursor by itself.
|
||||
if (_currentDivider == CPNotFound)
|
||||
[self _updateResizeCursor:anEvent];
|
||||
}
|
||||
|
||||
- (void)mouseMoved:(CPEvent)anEvent
|
||||
{
|
||||
if (_currentDivider == CPNotFound)
|
||||
[self _updateResizeCursor:anEvent];
|
||||
}
|
||||
|
||||
- (void)mouseExited:(CPEvent)anEvent
|
||||
{
|
||||
if (_currentDivider == CPNotFound)
|
||||
// FIXME: we should use CPCursor push/pop (if previous currentCursor != arrow).
|
||||
[[CPCursor arrowCursor] set];
|
||||
}
|
||||
|
||||
- (void)_updateResizeCursor:(CPEvent)anEvent
|
||||
{
|
||||
var point = [self convertPoint:[anEvent locationInWindow] fromView:nil];
|
||||
@@ -1205,6 +1186,29 @@ The sum of the views and the sum of the dividers should be equal to the size of
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPSplitView (CPTrackingArea)
|
||||
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
[self removeAllTrackingAreas];
|
||||
|
||||
var options = CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow;
|
||||
|
||||
for (var i = 0; i < _subviews.length - 1; i++)
|
||||
[self addTrackingArea:[[CPTrackingArea alloc] initWithRect:[self effectiveRectOfDividerAtIndex:i]
|
||||
options:options
|
||||
owner:self
|
||||
userInfo:nil]];
|
||||
}
|
||||
|
||||
- (void)cursorUpdate:(CPEvent)anEvent
|
||||
{
|
||||
if (_currentDivider === CPNotFound)
|
||||
[self _updateResizeCursor:anEvent];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation CPSplitView (CPSplitViewDelegate)
|
||||
|
||||
@@ -1376,6 +1380,8 @@ The sum of the views and the sum of the dividers should be equal to the size of
|
||||
[_delegate splitViewDidResizeSubviews:[[CPNotification alloc] initWithName:CPSplitViewDidResizeSubviewsNotification object:self userInfo:userInfo]];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPSplitViewDidResizeSubviewsNotification object:self userInfo:userInfo];
|
||||
|
||||
[self updateTrackingAreas];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+23
-28
@@ -24,6 +24,7 @@
|
||||
@import "CPView.j"
|
||||
@import "CPCursor.j"
|
||||
@import "_CPImageAndTextView.j"
|
||||
@import "CPTrackingArea.j"
|
||||
|
||||
@class CPTableView
|
||||
|
||||
@@ -305,7 +306,9 @@ var CPTableHeaderViewResizeZone = 3.0,
|
||||
self = [super initWithFrame:aFrame];
|
||||
|
||||
if (self)
|
||||
{
|
||||
[self _init];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -456,34 +459,29 @@ var CPTableHeaderViewResizeZone = 3.0,
|
||||
_activeColumn = -1;
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(CPEvent)theEvent
|
||||
@end
|
||||
|
||||
@implementation CPTableHeaderView (CPTrackingArea)
|
||||
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
var location = [theEvent globalLocation];
|
||||
[self removeAllTrackingAreas];
|
||||
|
||||
if (CGPointEqualToPoint(location, _mouseEnterExitLocation))
|
||||
return;
|
||||
var options = CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow;
|
||||
|
||||
_mouseEnterExitLocation = location;
|
||||
if (!_tableView)
|
||||
return;
|
||||
|
||||
[self _updateResizeCursor:theEvent];
|
||||
for (var i = 0; i < _tableView._tableColumns.length; i++)
|
||||
[self addTrackingArea:[[CPTrackingArea alloc] initWithRect:[self _cursorRectForColumn:i]
|
||||
options:options
|
||||
owner:self
|
||||
userInfo:nil]];
|
||||
}
|
||||
|
||||
- (void)mouseMoved:(CPEvent)theEvent
|
||||
- (void)cursorUpdate:(CPEvent)anEvent
|
||||
{
|
||||
[self _updateResizeCursor:theEvent];
|
||||
}
|
||||
|
||||
- (void)mouseExited:(CPEvent)theEvent
|
||||
{
|
||||
var location = [theEvent globalLocation];
|
||||
|
||||
if (CGPointEqualToPoint(location, _mouseEnterExitLocation))
|
||||
return;
|
||||
|
||||
_mouseEnterExitLocation = location;
|
||||
|
||||
// FIXME: we should use CPCursor push/pop (if previous currentCursor != arrow).
|
||||
[[CPCursor arrowCursor] set];
|
||||
[self _updateResizeCursor:anEvent];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -697,6 +695,7 @@ var CPTableHeaderViewResizeZone = 3.0,
|
||||
[[_tableView headerView] setNeedsLayout];
|
||||
|
||||
[[CPCursor arrowCursor] set];
|
||||
[self updateTrackingAreas];
|
||||
}
|
||||
|
||||
- (BOOL)_shouldResizeTableColumn:(CPInteger)aColumnIndex at:(CGPoint)aPoint
|
||||
@@ -762,7 +761,10 @@ var CPTableHeaderViewResizeZone = 3.0,
|
||||
var tableColumn = [[_tableView tableColumns] objectAtIndex:aColumnIndex];
|
||||
|
||||
if ([tableColumn width] != _columnOldWidth)
|
||||
{
|
||||
[_tableView _didResizeTableColumn:tableColumn oldWidth:_columnOldWidth];
|
||||
[self updateTrackingAreas];
|
||||
}
|
||||
|
||||
[tableColumn setDisableResizingPosting:NO];
|
||||
[_tableView setDisableAutomaticResizing:NO];
|
||||
@@ -772,13 +774,6 @@ var CPTableHeaderViewResizeZone = 3.0,
|
||||
|
||||
- (void)_updateResizeCursor:(CPEvent)theEvent
|
||||
{
|
||||
// never get stuck in resize cursor mode (FIXME take out when we turn on tracking rects)
|
||||
if (![_tableView allowsColumnResizing] || ([theEvent type] === CPLeftMouseUp && ![[self window] acceptsMouseMovedEvents]))
|
||||
{
|
||||
[[CPCursor arrowCursor] set];
|
||||
return;
|
||||
}
|
||||
|
||||
var mouseLocation = [self convertPoint:[theEvent locationInWindow] fromView:nil],
|
||||
mouseOverLocation = CGPointMake(MAX(mouseLocation.x - CPTableHeaderViewResizeZone, 0.0), mouseLocation.y),
|
||||
overColumn = [self columnAtPoint:mouseOverLocation];
|
||||
|
||||
+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_)
|
||||
|
||||
@@ -64,12 +64,10 @@
|
||||
*/
|
||||
- (CPArray)themeNames
|
||||
{
|
||||
var names = [];
|
||||
|
||||
for (var i = 0; i < _themes.length; ++i)
|
||||
names.push(_themes[i].substring(0, _themes[i].indexOf(".keyedtheme")));
|
||||
|
||||
return names;
|
||||
return [_themes arrayByApplyingBlock:function(theme)
|
||||
{
|
||||
return theme.substring(0, theme.indexOf(".keyedtheme"));
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)loadWithDelegate:(id)aDelegate
|
||||
|
||||
+4
-5
@@ -459,11 +459,10 @@ var CPToolbarsByIdentifier = nil,
|
||||
/* @ignore */
|
||||
- (id)_itemsWithIdentifiers:(CPArray)identifiers
|
||||
{
|
||||
var items = [];
|
||||
for (var i = 0; i < identifiers.length; i++)
|
||||
[items addObject:[self _itemForItemIdentifier:identifiers[i] willBeInsertedIntoToolbar:NO]];
|
||||
|
||||
return items;
|
||||
return [identifiers arrayByApplyingBlock:function(identifier)
|
||||
{
|
||||
return [self _itemForItemIdentifier:identifier willBeInsertedIntoToolbar:NO];
|
||||
}];
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* CPTrackingArea.j
|
||||
* AppKit
|
||||
*
|
||||
* Created by Didier Korthoudt.
|
||||
* Copyright 2015, Cappuccino Project.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
|
||||
@class CPView
|
||||
|
||||
/* @group CPTrackingAreaOptions */
|
||||
@typedef CPTrackingAreaOptions
|
||||
CPTrackingMouseEnteredAndExited = 1 << 1;
|
||||
CPTrackingMouseMoved = 1 << 2;
|
||||
CPTrackingCursorUpdate = 1 << 3;
|
||||
CPTrackingActiveWhenFirstResponder = 1 << 4;
|
||||
CPTrackingActiveInKeyWindow = 1 << 5;
|
||||
CPTrackingActiveInActiveApp = 1 << 6;
|
||||
CPTrackingActiveAlways = 1 << 7;
|
||||
CPTrackingAssumeInside = 1 << 8;
|
||||
CPTrackingInVisibleRect = 1 << 9;
|
||||
CPTrackingEnabledDuringMouseDrag = 1 << 10;
|
||||
|
||||
var CPTrackingAreaViewRectKey = @"CPTrackinkAreaViewRectKey",
|
||||
CPTrackingAreaOptionsKey = @"CPTrackingAreaOptionsKey",
|
||||
CPTrackingAreaOwnerKey = @"CPTrackingAreaOwnerKey",
|
||||
CPTrackingAreaUserInfoKey = @"CPTrackingAreaUserInfoKey",
|
||||
CPTrackingAreaReferencingViewKey = @"CPTrackingAreaReferencingViewKey",
|
||||
CPTrackingAreaWindowRect = @"CPTrackingAreaWindowRect";
|
||||
|
||||
CPTrackingOwnerImplementsMouseEntered = 1 << 1;
|
||||
CPTrackingOwnerImplementsMouseExited = 1 << 2;
|
||||
CPTrackingOwnerImplementsMouseMoved = 1 << 3;
|
||||
CPTrackingOwnerImplementsCursorUpdate = 1 << 4;
|
||||
|
||||
/*!
|
||||
@ingroup appkit
|
||||
|
||||
A CPTrackingArea defines a region of view that generates mouse-tracking and
|
||||
cursor-update events when the mouse is over that region.
|
||||
*/
|
||||
@implementation CPTrackingArea : CPObject
|
||||
{
|
||||
CGRect _viewRect @accessors(getter=rect);
|
||||
CPTrackingAreaOptions _options @accessors(getter=options);
|
||||
id _owner @accessors(getter=owner);
|
||||
CPDictionary _userInfo @accessors(getter=userInfo);
|
||||
|
||||
CPView _referencingView @accessors(property=view);
|
||||
CGRect _windowRect @accessors(getter=windowRect);
|
||||
|
||||
unsigned _implementedOwnerMethods @accessors(getter=implementedOwnerMethods);
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Initialization
|
||||
|
||||
/*!
|
||||
Initializes and returns an object defining a region of a view to receive mouse-tracking events, mouse-moved events, cursor-update events, or possibly
|
||||
all these events.
|
||||
*/
|
||||
- (CPTrackingArea)initWithRect:(CGRect)aRect options:(CPTrackingAreaOptions)options owner:(id)owner userInfo:(CPDictionary)userInfo
|
||||
{
|
||||
if (owner === nil)
|
||||
[CPException raise:CPInternalInconsistencyException reason:"No owner specified"];
|
||||
|
||||
if (options === 0)
|
||||
[CPException raise:CPInternalInconsistencyException reason:"Invalid CPTrackingArea options"];
|
||||
|
||||
// Check options:
|
||||
// - at least one of CPTrackingMouseEnteredAndExited, CPTrackingMouseMoved, CPTrackingCursorUpdate
|
||||
// - exactly one of CPTrackingActiveWhenFirstResponder, CPTrackingActiveInKeyWindow, CPTrackingActiveInActiveApp, CPTrackingActiveAlways
|
||||
// - no check on CPTrackingAssumeInside, CPTrackingInVisibleRect, CPTrackingEnableDuringMouseDrag
|
||||
|
||||
if (!((options & CPTrackingMouseEnteredAndExited) || (options & CPTrackingMouseMoved) || (options & CPTrackingCursorUpdate)))
|
||||
[CPException raise:CPInternalInconsistencyException reason:"Invalid CPTrackingAreaOptions: must use at least one of [CPTrackingMouseEnteredAndExited | CPTrackingMouseMoved | CPTrackingCursorUpdate]"];
|
||||
|
||||
if ((((options & CPTrackingActiveWhenFirstResponder) > 0) + ((options & CPTrackingActiveInKeyWindow) > 0) + ((options & CPTrackingActiveInActiveApp) > 0) + ((options & CPTrackingActiveAlways) > 0)) !== 1)
|
||||
[CPException raise:CPInternalInconsistencyException reason:"Tracking area options may only specify one of [CPTrackingActiveWhenFirstResponder | CPTrackingActiveInKeyWindow | CPTrackingActiveInActiveApp | CPTrackingActiveAlways]."];
|
||||
|
||||
if (self = [super init])
|
||||
{
|
||||
_viewRect = aRect;
|
||||
_options = options;
|
||||
_owner = owner;
|
||||
_userInfo = userInfo;
|
||||
|
||||
// Cache owner implemented methods
|
||||
|
||||
if ([_owner respondsToSelector:@selector(mouseEntered:)])
|
||||
_implementedOwnerMethods |= CPTrackingOwnerImplementsMouseEntered;
|
||||
|
||||
if ([_owner respondsToSelector:@selector(mouseExited:)])
|
||||
_implementedOwnerMethods |= CPTrackingOwnerImplementsMouseExited;
|
||||
|
||||
if ([_owner respondsToSelector:@selector(mouseMoved:)])
|
||||
_implementedOwnerMethods |= CPTrackingOwnerImplementsMouseMoved;
|
||||
|
||||
if ([_owner respondsToSelector:@selector(cursorUpdate:)])
|
||||
_implementedOwnerMethods |= CPTrackingOwnerImplementsCursorUpdate;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Implementation
|
||||
|
||||
- (void)_updateWindowRect
|
||||
{
|
||||
_windowRect = [_referencingView convertRect:((_options & CPTrackingInVisibleRect) ? [_referencingView visibleRect] : _viewRect) toView:[[_referencingView window] _windowView]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark CPCoding
|
||||
|
||||
@implementation CPTrackingArea (CPCoding)
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
if (self = [super init])
|
||||
{
|
||||
_viewRect = [aCoder decodeObjectForKey:CPTrackingAreaViewRectKey];
|
||||
_options = [aCoder decodeObjectForKey:CPTrackingAreaOptionsKey];
|
||||
_owner = [aCoder decodeObjectForKey:CPTrackingAreaOwnerKey];
|
||||
_userInfo = [aCoder decodeObjectForKey:CPTrackingAreaUserInfoKey];
|
||||
_referencingView = [aCoder decodeObjectForKey:CPTrackingAreaReferencingViewKey];
|
||||
_windowRect = [aCoder decodeObjectForKey:CPTrackingAreaWindowRect];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
[aCoder encodeObject:_viewRect forKey:CPTrackingAreaViewRectKey];
|
||||
[aCoder encodeObject:_options forKey:CPTrackingAreaOptionsKey];
|
||||
[aCoder encodeObject:_owner forKey:CPTrackingAreaOwnerKey];
|
||||
[aCoder encodeObject:_userInfo forKey:CPTrackingAreaUserInfoKey];
|
||||
[aCoder encodeObject:_referencingView forKey:CPTrackingAreaReferencingViewKey];
|
||||
[aCoder encodeObject:_windowRect forKey:CPTrackingAreaWindowRect];
|
||||
}
|
||||
|
||||
@end
|
||||
+209
-12
@@ -32,6 +32,7 @@
|
||||
@import "CPGraphicsContext.j"
|
||||
@import "CPResponder.j"
|
||||
@import "CPTheme.j"
|
||||
@import "CPTrackingArea.j"
|
||||
@import "CPWindow_Constants.j"
|
||||
@import "_CPDisplayServer.j"
|
||||
|
||||
@@ -239,6 +240,12 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
BOOL _allowsVibrancy @accessors(property=allowsVibrancy);
|
||||
CPAppearance _appearance @accessors(getter=appearance);
|
||||
CPAppearance _effectiveAppearance;
|
||||
|
||||
CPMutableArray _trackingAreas @accessors(getter=trackingAreas, copy);
|
||||
BOOL _inhibitUpdateTrackingAreas;
|
||||
|
||||
id _animator;
|
||||
CPDictionary _animationsDictionary;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -352,6 +359,8 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
_registeredDraggedTypes = [CPSet set];
|
||||
_registeredDraggedTypesArray = [];
|
||||
|
||||
_trackingAreas = [];
|
||||
|
||||
_tag = -1;
|
||||
|
||||
_frame = CGRectMakeCopy(aFrame);
|
||||
@@ -383,6 +392,9 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
_DOMImageSizes = [];
|
||||
#endif
|
||||
|
||||
_animator = nil;
|
||||
_animationsDictionary = @{};
|
||||
|
||||
[self _setupViewFlags];
|
||||
[self _loadThemeAttributes];
|
||||
}
|
||||
@@ -800,8 +812,30 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
[aWindow _noteRegisteredDraggedTypes:_registeredDraggedTypes];
|
||||
}
|
||||
|
||||
// View must be removed from the current window viewsWithTrackingAreas
|
||||
if (_window && (_trackingAreas.length > 0))
|
||||
[_window _removeTrackingAreaView:self];
|
||||
|
||||
_window = aWindow;
|
||||
|
||||
if (_window)
|
||||
{
|
||||
var owners;
|
||||
|
||||
if (_trackingAreas.length > 0)
|
||||
{
|
||||
// View must be added to the new window viewsWithTrackingAreas
|
||||
[_window _addTrackingAreaView:self];
|
||||
owners = [self _calcTrackingAreaOwners];
|
||||
}
|
||||
else
|
||||
owners = [self];
|
||||
|
||||
// Notify that view tracking areas should be updated
|
||||
// Cocoa doesn't notify on leaving a window
|
||||
[self _updateTrackingAreasForOwners:owners];
|
||||
}
|
||||
|
||||
var count = [_subviews count];
|
||||
|
||||
while (count--)
|
||||
@@ -994,6 +1028,9 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
|
||||
if (_isSuperviewAClipView)
|
||||
[[self superview] viewFrameChanged:[[CPNotification alloc] initWithName:CPViewFrameDidChangeNotification object:self userInfo:nil]];
|
||||
|
||||
if (!_inhibitUpdateTrackingAreas)
|
||||
[self _updateTrackingAreas];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1064,6 +1101,9 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
|
||||
CPDOMDisplayServerSetStyleLeftTop(_DOMElement, transform, origin.x, origin.y);
|
||||
#endif
|
||||
|
||||
if (!_inhibitUpdateTrackingAreas && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[self _updateTrackingAreas];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1215,6 +1255,9 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
|
||||
if (_isSuperviewAClipView && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[[self superview] viewFrameChanged:[[CPNotification alloc] initWithName:CPViewFrameDidChangeNotification object:self userInfo:nil]];
|
||||
|
||||
if (!_inhibitUpdateTrackingAreas && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[self _updateTrackingAreas];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1261,6 +1304,9 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
|
||||
if (_isSuperviewAClipView)
|
||||
[[self superview] viewBoundsChanged:[[CPNotification alloc] initWithName:CPViewBoundsDidChangeNotification object:self userInfo:nil]];
|
||||
|
||||
if (!_inhibitUpdateTrackingAreas)
|
||||
[self _updateTrackingAreas];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1326,6 +1372,9 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
|
||||
if (_isSuperviewAClipView && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[[self superview] viewBoundsChanged:[[CPNotification alloc] initWithName:CPViewBoundsDidChangeNotification object:self userInfo:nil]];
|
||||
|
||||
if (!_inhibitUpdateTrackingAreas && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[self _updateTrackingAreas];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1367,6 +1416,9 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
|
||||
if (_isSuperviewAClipView && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[[self superview] viewBoundsChanged:[[CPNotification alloc] initWithName:CPViewBoundsDidChangeNotification object:self userInfo:nil]];
|
||||
|
||||
if (!_inhibitUpdateTrackingAreas && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[self _updateTrackingAreas];
|
||||
}
|
||||
|
||||
|
||||
@@ -2638,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];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -3401,6 +3456,141 @@ setBoundsOrigin:
|
||||
*/}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPView (TrackingAreaAdditions)
|
||||
|
||||
- (void)addTrackingArea:(CPTrackingArea)trackingArea
|
||||
{
|
||||
// Consistency check
|
||||
if (!trackingArea || [_trackingAreas containsObjectIdenticalTo:trackingArea])
|
||||
return;
|
||||
|
||||
if ([trackingArea view])
|
||||
[CPException raise:CPInternalInconsistencyException reason:"Tracking area has already been added to another view."];
|
||||
|
||||
[_trackingAreas addObject:trackingArea];
|
||||
[trackingArea setView:self];
|
||||
|
||||
if (_window)
|
||||
[_window _addTrackingArea:trackingArea];
|
||||
|
||||
[trackingArea _updateWindowRect];
|
||||
}
|
||||
|
||||
- (void)removeTrackingArea:(CPTrackingArea)trackingArea
|
||||
{
|
||||
// Consistency check
|
||||
if (!trackingArea)
|
||||
return;
|
||||
|
||||
if (![_trackingAreas containsObjectIdenticalTo:trackingArea])
|
||||
[CPException raise:CPInternalInconsistencyException reason:"Trying to remove unreferenced trackingArea"];
|
||||
|
||||
[self _removeTrackingArea:trackingArea];
|
||||
}
|
||||
|
||||
/*!
|
||||
Invoked automatically when the view’s geometry changes such that its tracking areas need to be recalculated.
|
||||
|
||||
You should override this method to remove out of date tracking areas and add recomputed tracking areas;
|
||||
|
||||
Cocoa calls this on every view, whereas they have tracking area(s) or not.
|
||||
Cappuccino behaves differently :
|
||||
- updateTrackingAreas is called when placing a view in the view hierarchy (that is in a window)
|
||||
- if you have only CPTrackingInVisibleRect tracking areas attached to a view, it will not be called again (until you move the view in the hierarchy)
|
||||
- if you have at least one non-CPTrackingInVisibleRect tracking area attached, it will be called every time the view geometry could be modified
|
||||
You don't have to touch to CPTrackingInVisibleRect tracking areas, they will be automatically updated
|
||||
|
||||
Please note that it is the owner of a tracking area who is called for updateTrackingAreas.
|
||||
But, if a view without any tracking area is inserted in the view hierarchy (that is, in a window), the view is called for updateTrackingAreas.
|
||||
This enables you to use updateTrackingArea to initially attach your tracking areas to the view.
|
||||
*/
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
This utility method is intended for CPView subclasses overriding updateTrackingAreas
|
||||
|
||||
Typical use would be :
|
||||
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
[self removeAllTrackingAreas];
|
||||
|
||||
... add your specific updated tracking areas ...
|
||||
}
|
||||
|
||||
*/
|
||||
- (void)removeAllTrackingAreas
|
||||
{
|
||||
while (_trackingAreas.length > 0)
|
||||
[self _removeTrackingArea:_trackingAreas[0]];
|
||||
}
|
||||
|
||||
// Internal methods
|
||||
|
||||
- (void)_removeTrackingArea:(CPTrackingArea)trackingArea
|
||||
{
|
||||
if (_window)
|
||||
[_window _removeTrackingArea:trackingArea];
|
||||
|
||||
[trackingArea setView:nil];
|
||||
[_trackingAreas removeObjectIdenticalTo:trackingArea];
|
||||
}
|
||||
|
||||
- (void)_updateTrackingAreas
|
||||
{
|
||||
_inhibitUpdateTrackingAreas = YES;
|
||||
|
||||
[self _recursivelyUpdateTrackingAreas];
|
||||
|
||||
_inhibitUpdateTrackingAreas = NO;
|
||||
}
|
||||
|
||||
- (void)_recursivelyUpdateTrackingAreas
|
||||
{
|
||||
[self _updateTrackingAreasForOwners:[self _calcTrackingAreaOwners]];
|
||||
|
||||
for (var i = 0; i < _subviews.length; i++)
|
||||
[_subviews[i] _recursivelyUpdateTrackingAreas];
|
||||
}
|
||||
|
||||
- (CPArray)_calcTrackingAreaOwners
|
||||
{
|
||||
// First search all owners that must be notified
|
||||
// Remark: 99.99% of time, the only owner will be the view itself
|
||||
// In the same time, update the rects of InVisibleRect tracking areas
|
||||
|
||||
var owners = [];
|
||||
|
||||
for (var i = 0; i < _trackingAreas.length; i++)
|
||||
{
|
||||
var trackingArea = _trackingAreas[i];
|
||||
|
||||
if ([trackingArea options] & CPTrackingInVisibleRect)
|
||||
[trackingArea _updateWindowRect];
|
||||
|
||||
else
|
||||
{
|
||||
var owner = [trackingArea owner];
|
||||
|
||||
if (![owners containsObjectIdenticalTo:owner])
|
||||
[owners addObject:owner];
|
||||
}
|
||||
}
|
||||
|
||||
return owners;
|
||||
}
|
||||
|
||||
- (void)_updateTrackingAreasForOwners:(CPArray)owners
|
||||
{
|
||||
for (var i = 0; i < owners.length; i++)
|
||||
[owners[i] updateTrackingAreas];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
@@ -3422,7 +3612,8 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
CPViewScaleKey = @"CPViewScaleKey",
|
||||
CPViewSizeScaleKey = @"CPViewSizeScaleKey",
|
||||
CPViewIsScaledKey = @"CPViewIsScaledKey",
|
||||
CPViewAppearanceKey = @"CPViewAppearanceKey";
|
||||
CPViewAppearanceKey = @"CPViewAppearanceKey",
|
||||
CPViewTrackingAreasKey = @"CPViewTrackingAreasKey";
|
||||
|
||||
@implementation CPView (CPCoding)
|
||||
|
||||
@@ -3450,6 +3641,11 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
|
||||
if (self)
|
||||
{
|
||||
_trackingAreas = [aCoder decodeObjectForKey:CPViewTrackingAreasKey];
|
||||
|
||||
if (!_trackingAreas)
|
||||
_trackingAreas = [];
|
||||
|
||||
// We have to manually check because it may be 0, so we can't use ||
|
||||
_tag = [aCoder containsValueForKey:CPViewTagKey] ? [aCoder decodeIntForKey:CPViewTagKey] : -1;
|
||||
_identifier = [aCoder decodeObjectForKey:CPReuseIdentifierKey];
|
||||
@@ -3607,6 +3803,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
[aCoder encodeSize:[self _hierarchyScaleSize] forKey:CPViewSizeScaleKey];
|
||||
[aCoder encodeBool:_isScaled forKey:CPViewIsScaledKey];
|
||||
[aCoder encodeObject:_appearance forKey:CPViewAppearanceKey];
|
||||
[aCoder encodeObject:_trackingAreas forKey:CPViewTrackingAreasKey];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -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.
|
||||
|
||||
Note: The cib loading system is currently synchronous.
|
||||
this method.
|
||||
|
||||
@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];
|
||||
aHandler(_view, nil);
|
||||
}
|
||||
else
|
||||
{
|
||||
aHandler(nil, anError);
|
||||
}
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
[cib instantiateCibWithExternalNameTable:_cibExternalNameTable];
|
||||
aHandler(_view, nil);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_view = [CPView new];
|
||||
aHandler(_view, nil);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the view that the controller manages.
|
||||
|
||||
|
||||
+489
-50
@@ -36,6 +36,7 @@
|
||||
@import "CPResponder.j"
|
||||
@import "CPScreen.j"
|
||||
@import "CPText.j"
|
||||
@import "CPTrackingArea.j"
|
||||
@import "CPView.j"
|
||||
@import "CPWindow_Constants.j"
|
||||
@import "_CPBorderlessBridgeWindowView.j"
|
||||
@@ -197,7 +198,16 @@ var CPWindowActionMessageKeys = [
|
||||
CPView _contentView;
|
||||
CPView _toolbarView;
|
||||
|
||||
BOOL _handlingTrackingAreaEvent;
|
||||
BOOL _restartHandlingTrackingAreaEvent;
|
||||
CPArray _previousMouseEnteredStack;
|
||||
CPArray _previousCursorUpdateStack;
|
||||
CPArray _mouseEnteredStack;
|
||||
CPArray _cursorUpdateStack;
|
||||
CPArray _queuedEvents;
|
||||
CPArray _trackingAreaViews;
|
||||
id _activeCursorTrackingArea;
|
||||
CPArray _queuedTrackingEvents;
|
||||
CPView _leftMouseDownView;
|
||||
CPView _rightMouseDownView;
|
||||
|
||||
@@ -335,6 +345,17 @@ CPTexturedBackgroundWindowMask
|
||||
|
||||
[self setLevel:CPNormalWindowLevel];
|
||||
|
||||
_handlingTrackingAreaEvent = NO;
|
||||
_restartHandlingTrackingAreaEvent = NO;
|
||||
_trackingAreaViews = [];
|
||||
_previousMouseEnteredStack = [];
|
||||
_previousCursorUpdateStack = [];
|
||||
_mouseEnteredStack = [];
|
||||
_cursorUpdateStack = [];
|
||||
_queuedEvents = [];
|
||||
_queuedTrackingEvents = [];
|
||||
_activeCursorTrackingArea = nil;
|
||||
|
||||
// Create our border view which is the actual root of our view hierarchy.
|
||||
_windowView = [[windowViewClass alloc] initWithFrame:CGRectMake(0.0, 0.0, CGRectGetWidth(_frame), CGRectGetHeight(_frame)) styleMask:aStyleMask];
|
||||
|
||||
@@ -557,6 +578,11 @@ CPTexturedBackgroundWindowMask
|
||||
}
|
||||
}
|
||||
|
||||
- (CPView)_windowView
|
||||
{
|
||||
return _windowView;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the receiver as a full platform window. If you pass YES the CPWindow instance will fill the entire browser content area,
|
||||
otherwise the CPWindow will be a window inside of your browser window which the user can drag around, and resize (if you allow).
|
||||
@@ -1923,6 +1949,9 @@ CPTexturedBackgroundWindowMask
|
||||
|
||||
_leftMouseDownView = nil;
|
||||
|
||||
// If mouseUp ends a drag operation, send delayed events for tracking views under the mouse, then flush delayed events
|
||||
[self _flushTrackingEventQueueForMouseAt:point];
|
||||
|
||||
return;
|
||||
|
||||
case CPLeftMouseDown:
|
||||
@@ -1958,6 +1987,11 @@ CPTexturedBackgroundWindowMask
|
||||
|
||||
case CPLeftMouseDragged:
|
||||
case CPRightMouseDragged:
|
||||
// First, we search for any tracking area requesting CPTrackingEnabledDuringMouseDrag.
|
||||
// At the same time, we update the entered stack.
|
||||
[self _handleTrackingAreaEvent:anEvent];
|
||||
|
||||
// Normal mouseDragged workflow
|
||||
if (!_leftMouseDownView)
|
||||
return [[_windowView hitTest:point] mouseDragged:anEvent];
|
||||
|
||||
@@ -1976,61 +2010,12 @@ CPTexturedBackgroundWindowMask
|
||||
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];
|
||||
[self _handleTrackingAreaEvent:anEvent];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3844,6 +3829,460 @@ var interpolate = function(fromValue, toValue, progress)
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPWindow (TrackingAreaAdditions)
|
||||
|
||||
- (void)_addTrackingAreaView:(CPView)aView
|
||||
{
|
||||
var trackingAreas = [aView trackingAreas];
|
||||
|
||||
for (var i = 0; i < trackingAreas.length; i++)
|
||||
[self _addTrackingArea:trackingAreas[i]];
|
||||
}
|
||||
|
||||
- (void)_removeTrackingAreaView:(CPView)aView
|
||||
{
|
||||
var trackingAreas = [aView trackingAreas];
|
||||
|
||||
for (var i = 0; i < trackingAreas.length; i++)
|
||||
[self _removeTrackingArea:trackingAreas[i]];
|
||||
}
|
||||
|
||||
- (void)_addTrackingArea:(CPTrackingArea)trackingArea
|
||||
{
|
||||
var trackingAreaView = [trackingArea view];
|
||||
|
||||
if (![_trackingAreaViews containsObjectIdenticalTo:trackingAreaView])
|
||||
[_trackingAreaViews addObject:trackingAreaView];
|
||||
|
||||
// If CPTrackingAssumeInside option is set, insert the tracking area in the events management system
|
||||
// in order to have the first event sent only when mouse leaves the tracking area
|
||||
|
||||
[self _insertTrackingArea:trackingArea assumeInside:([trackingArea options] & CPTrackingAssumeInside)];
|
||||
}
|
||||
|
||||
- (void)_removeTrackingArea:(CPTrackingArea)trackingArea
|
||||
{
|
||||
// If mouse is in the tracking area, we remove it from the stack to avoid to fire a future mouseExited event
|
||||
|
||||
[self _purgeTrackingArea:trackingArea];
|
||||
|
||||
var trackingAreaView = [trackingArea view];
|
||||
|
||||
[_trackingAreaViews removeObjectIdenticalTo:trackingAreaView];
|
||||
}
|
||||
|
||||
- (void)_insertTrackingArea:(CPTrackingArea)trackingArea assumeInside:(BOOL)assumeInside
|
||||
{
|
||||
if (_handlingTrackingAreaEvent)
|
||||
_restartHandlingTrackingAreaEvent = YES;
|
||||
|
||||
if (assumeInside)
|
||||
{
|
||||
if (_handlingTrackingAreaEvent)
|
||||
[_mouseEnteredStack addObject:trackingArea];
|
||||
else
|
||||
[_previousMouseEnteredStack addObject:trackingArea];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_purgeTrackingArea:(CPTrackingArea)trackingArea
|
||||
{
|
||||
if (_handlingTrackingAreaEvent)
|
||||
{
|
||||
[_mouseEnteredStack removeObjectIdenticalTo:trackingArea];
|
||||
|
||||
var i = _queuedEvents.length;
|
||||
|
||||
while (i--)
|
||||
if ([_queuedEvents[i] trackingArea] === trackingArea)
|
||||
[_queuedEvents removeObjectAtIndex:i];
|
||||
|
||||
_cursorUpdateStack = [];
|
||||
_activeCursorTrackingArea = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
[_previousMouseEnteredStack removeObjectIdenticalTo:trackingArea];
|
||||
[_previousCursorUpdateStack removeObjectIdenticalTo:trackingArea];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_handleTrackingAreaEvent:(CPEvent)anEvent
|
||||
{
|
||||
_handlingTrackingAreaEvent = YES;
|
||||
|
||||
var point = [anEvent locationInWindow],
|
||||
dragging = ([anEvent type] !== CPMouseMoved);
|
||||
|
||||
do
|
||||
{
|
||||
// Initialize this run
|
||||
_restartHandlingTrackingAreaEvent = NO;
|
||||
|
||||
_mouseEnteredStack = [];
|
||||
_cursorUpdateStack = [];
|
||||
|
||||
// Important remark: we must queue events to avoid running conditions when a view uses a mouse event to modify view hierarchy
|
||||
|
||||
_queuedEvents = [];
|
||||
|
||||
// Handle mouse entering tracking areas (and calc _mouseEnteredStack and _cursorUpdateStack)
|
||||
|
||||
[self _handleMouseMovedAndEnteredEventsForEvent:anEvent atPoint:point dragging:dragging];
|
||||
|
||||
// Handle mouse exiting tracking areas
|
||||
|
||||
[self _handleMouseExitedEventsForEvent:anEvent atPoint:point dragging:dragging];
|
||||
|
||||
// Cursor update
|
||||
|
||||
if (_cursorUpdateStack.length > 0)
|
||||
{
|
||||
[self _handleCursorUpdateEventsForEvent:anEvent atPoint:point dragging:dragging];
|
||||
}
|
||||
else if (!dragging)
|
||||
{
|
||||
// Here, we are outside the window content view tracking area, so let _windowView set the cursor (resize cursor, ...)
|
||||
|
||||
[_windowView setCursorForLocation:point resizing:NO];
|
||||
_activeCursorTrackingArea = nil;
|
||||
}
|
||||
|
||||
// Send all queued events
|
||||
// Important remark : as an event can modify the view hierarchy, the events queue could be modified while processing it
|
||||
|
||||
while (_queuedEvents.length > 0)
|
||||
{
|
||||
var queuedEvent = _queuedEvents[0],
|
||||
trackingArea = [queuedEvent trackingArea],
|
||||
trackingOwner = [trackingArea owner];
|
||||
|
||||
switch ([queuedEvent type])
|
||||
{
|
||||
case CPMouseEntered:
|
||||
[trackingOwner mouseEntered:queuedEvent];
|
||||
break;
|
||||
|
||||
case CPMouseExited:
|
||||
[trackingOwner mouseExited:queuedEvent];
|
||||
break;
|
||||
|
||||
case CPCursorUpdate:
|
||||
[trackingOwner cursorUpdate:queuedEvent];
|
||||
break;
|
||||
}
|
||||
|
||||
if (queuedEvent === _queuedEvents[0])
|
||||
[_queuedEvents removeObjectAtIndex:0];
|
||||
}
|
||||
|
||||
// Prepare for next call
|
||||
|
||||
_previousMouseEnteredStack = _mouseEnteredStack;
|
||||
_previousCursorUpdateStack = _cursorUpdateStack;
|
||||
}
|
||||
while (_restartHandlingTrackingAreaEvent)
|
||||
|
||||
_handlingTrackingAreaEvent = NO;
|
||||
}
|
||||
|
||||
- (void)_handleMouseMovedAndEnteredEventsForEvent:(CPEvent)anEvent atPoint:(CGPoint)point dragging:(BOOL)dragging
|
||||
{
|
||||
var isKeyWindow = [self isKeyWindow];
|
||||
|
||||
for (var i = 0; i < _trackingAreaViews.length; i++)
|
||||
{
|
||||
var aView = _trackingAreaViews[i],
|
||||
trackingAreas = [aView trackingAreas];
|
||||
|
||||
if ([aView isHidden])
|
||||
continue;
|
||||
|
||||
for (var j = 0; j < trackingAreas.length; j++)
|
||||
{
|
||||
var aTrackingArea = trackingAreas[j],
|
||||
trackingOptions = [aTrackingArea options],
|
||||
trackingImplementedMethods = [aTrackingArea implementedOwnerMethods];
|
||||
|
||||
if (!(((trackingOptions & CPTrackingActiveAlways) ||
|
||||
(trackingOptions & CPTrackingActiveInActiveApp) ||
|
||||
((trackingOptions & CPTrackingActiveInKeyWindow) && isKeyWindow) ||
|
||||
((trackingOptions & CPTrackingActiveWhenFirstResponder) && isKeyWindow && (_firstResponder === aView))) &&
|
||||
(CGRectContainsPoint([aTrackingArea windowRect], point))))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
[_mouseEnteredStack addObject:aTrackingArea];
|
||||
|
||||
if ([_previousMouseEnteredStack containsObjectIdenticalTo:aTrackingArea])
|
||||
{
|
||||
// Mouse was already in this rect so it's a mouseMoved
|
||||
|
||||
if (!dragging && (trackingOptions & CPTrackingMouseMoved) && (trackingImplementedMethods & CPTrackingOwnerImplementsMouseMoved))
|
||||
[[aTrackingArea owner] mouseMoved:anEvent];
|
||||
}
|
||||
else if ((trackingOptions & CPTrackingMouseEnteredAndExited) && (trackingImplementedMethods & CPTrackingOwnerImplementsMouseEntered))
|
||||
{
|
||||
var mouseEnteredEvent = [CPEvent enterExitEventWithType:CPMouseEntered
|
||||
location:point
|
||||
modifierFlags:[anEvent modifierFlags]
|
||||
timestamp:[anEvent timestamp]
|
||||
windowNumber:_windowNumber
|
||||
context:nil
|
||||
eventNumber:-1
|
||||
trackingArea:aTrackingArea];
|
||||
|
||||
if (dragging && !(trackingOptions & CPTrackingEnabledDuringMouseDrag))
|
||||
[self _queueTrackingEvent:mouseEnteredEvent];
|
||||
else
|
||||
[_queuedEvents addObject:mouseEnteredEvent];
|
||||
}
|
||||
|
||||
if ((trackingOptions & CPTrackingCursorUpdate) && (trackingImplementedMethods & CPTrackingOwnerImplementsCursorUpdate))
|
||||
[_cursorUpdateStack addObject:aTrackingArea];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_handleMouseExitedEventsForEvent:(CPEvent)anEvent atPoint:(CGPoint)point dragging:(BOOL)dragging
|
||||
{
|
||||
// Search for exited views (were in _previousMouseEnteredStack but no more in _mouseEnteredStack)
|
||||
|
||||
for (var i = 0; i < _previousMouseEnteredStack.length; i++)
|
||||
{
|
||||
var aTrackingArea = _previousMouseEnteredStack[i],
|
||||
trackingOptions = [aTrackingArea options];
|
||||
|
||||
if ([_mouseEnteredStack containsObjectIdenticalTo:aTrackingArea])
|
||||
continue;
|
||||
|
||||
// Mouse is no more in this area so it's a mouseExited
|
||||
|
||||
if ((trackingOptions & CPTrackingMouseEnteredAndExited) && ([aTrackingArea implementedOwnerMethods] & CPTrackingOwnerImplementsMouseExited))
|
||||
{
|
||||
var theView = [aTrackingArea owner],
|
||||
mouseExitedEvent = [CPEvent enterExitEventWithType:CPMouseExited
|
||||
location:point
|
||||
modifierFlags:[anEvent modifierFlags]
|
||||
timestamp:[anEvent timestamp]
|
||||
windowNumber:_windowNumber
|
||||
context:nil
|
||||
eventNumber:-1
|
||||
trackingArea:aTrackingArea];
|
||||
|
||||
if (dragging && !(trackingOptions & CPTrackingEnabledDuringMouseDrag))
|
||||
[self _queueTrackingEvent:mouseExitedEvent];
|
||||
else
|
||||
[_queuedEvents addObject:mouseExitedEvent];
|
||||
}
|
||||
|
||||
// If this is the active cursor area, we reset _previousCursorUpdateStack so a new active area will be computed
|
||||
|
||||
if (aTrackingArea === _activeCursorTrackingArea)
|
||||
{
|
||||
_previousCursorUpdateStack = [];
|
||||
_activeCursorTrackingArea = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_handleCursorUpdateEventsForEvent:(CPEvent)anEvent atPoint:(CGPoint)point dragging:(BOOL)dragging
|
||||
{
|
||||
var overlappingTrackingAreas = [];
|
||||
|
||||
for (var i = 0; i < _cursorUpdateStack.length; i++)
|
||||
{
|
||||
var aTrackingArea = _cursorUpdateStack[i];
|
||||
|
||||
if ((![_previousCursorUpdateStack containsObjectIdenticalTo:aTrackingArea]) || (aTrackingArea === _activeCursorTrackingArea))
|
||||
[overlappingTrackingAreas addObject:aTrackingArea];
|
||||
}
|
||||
|
||||
var frontmostTrackingArea = overlappingTrackingAreas[0],
|
||||
frontmostView = [frontmostTrackingArea view];
|
||||
|
||||
for (var i = 1; i < overlappingTrackingAreas.length; i++)
|
||||
{
|
||||
var aTrackingArea = overlappingTrackingAreas[i],
|
||||
aView = [aTrackingArea view];
|
||||
|
||||
// First, if aView is _windowView, skip to next overlapping tracking area
|
||||
// as _windowView can't be the frontmost view if there's multiple overlapping tracking areas.
|
||||
|
||||
if (aView === _windowView)
|
||||
continue;
|
||||
|
||||
// Then, if frontmostView is _windowView, aView must become frontmostView
|
||||
|
||||
if (frontmostView === _windowView)
|
||||
{
|
||||
frontmostTrackingArea = aTrackingArea;
|
||||
frontmostView = aView;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Next verify if aView is a subview of frontmostView
|
||||
// If so, it's our new frontmost view
|
||||
|
||||
var searchingView = aView;
|
||||
|
||||
while ((searchingView !== _contentView) && ([searchingView superview] !== frontmostView))
|
||||
searchingView = [searchingView superview];
|
||||
|
||||
if (searchingView !== _contentView)
|
||||
{
|
||||
frontmostTrackingArea = aTrackingArea;
|
||||
frontmostView = aView;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// aView is not a subview of frontmostView
|
||||
// Search in view hierarchy which one will be over the other
|
||||
// (this is done by comparing their draw order)
|
||||
|
||||
var firstView = frontmostView,
|
||||
firstSuperview = [firstView superview];
|
||||
|
||||
while (firstView !== _contentView)
|
||||
{
|
||||
var secondView = aView,
|
||||
secondSuperview = [secondView superview];
|
||||
|
||||
while ((secondSuperview !== _contentView) && (firstSuperview !== secondSuperview))
|
||||
{
|
||||
secondView = secondSuperview;
|
||||
secondSuperview = [secondView superview];
|
||||
}
|
||||
|
||||
if (firstSuperview === secondSuperview)
|
||||
break;
|
||||
|
||||
firstView = firstSuperview;
|
||||
firstSuperview = [firstView superview];
|
||||
}
|
||||
|
||||
if (firstSuperview !== secondSuperview)
|
||||
[CPException raise:CPInternalInconsistencyException reason:"Problem with view hierarchy"];
|
||||
|
||||
var firstSuperviewSubviews = [firstSuperview subviews],
|
||||
firstViewIndex = [firstSuperviewSubviews indexOfObject:firstView],
|
||||
secondViewIndex = [firstSuperviewSubviews indexOfObject:secondView];
|
||||
|
||||
if (secondViewIndex > firstViewIndex)
|
||||
{
|
||||
frontmostTrackingArea = aTrackingArea;
|
||||
frontmostView = aView;
|
||||
}
|
||||
}
|
||||
|
||||
if (frontmostTrackingArea !== _activeCursorTrackingArea)
|
||||
{
|
||||
var cursorUpdateEvent = [CPEvent enterExitEventWithType:CPCursorUpdate
|
||||
location:point
|
||||
modifierFlags:[anEvent modifierFlags]
|
||||
timestamp:[anEvent timestamp]
|
||||
windowNumber:_windowNumber
|
||||
context:nil
|
||||
eventNumber:-1
|
||||
trackingArea:frontmostTrackingArea];
|
||||
|
||||
if (dragging)
|
||||
[self _queueTrackingEvent:cursorUpdateEvent];
|
||||
else
|
||||
[_queuedEvents addObject:cursorUpdateEvent];
|
||||
|
||||
_activeCursorTrackingArea = frontmostTrackingArea;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_queueTrackingEvent:(CPEvent)anEvent
|
||||
{
|
||||
// This will put a tracking event in the _queuedTrackingEvents queue.
|
||||
//
|
||||
// We optimize this queue with this policy :
|
||||
// - if mouseEntered, search if queue contains a previous mouseExited for the same tracking area. If so, discard both.
|
||||
// - if mouseExited, search if queue contains a previous mouseEntered for the same tracking area. If so, discard both.
|
||||
//
|
||||
// This is not Cocoa way of doing as it would send every event.
|
||||
// But final result should be the same.
|
||||
|
||||
var eventType = [anEvent type],
|
||||
trackingArea = [anEvent trackingArea];
|
||||
|
||||
switch ([anEvent type])
|
||||
{
|
||||
case CPMouseEntered:
|
||||
for (var i = 0; i < _queuedTrackingEvents.length; i++)
|
||||
{
|
||||
var queuedEvent = _queuedTrackingEvents[i];
|
||||
|
||||
if (([queuedEvent trackingArea] === trackingArea) && ([queuedEvent type] === CPMouseExited))
|
||||
{
|
||||
[_queuedTrackingEvents removeObjectAtIndex:i];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[_queuedTrackingEvents addObject:anEvent];
|
||||
break;
|
||||
|
||||
case CPMouseExited:
|
||||
for (var i = 0; i < _queuedTrackingEvents.length; i++)
|
||||
{
|
||||
var queuedEvent = _queuedTrackingEvents[i];
|
||||
|
||||
if (([queuedEvent trackingArea] === trackingArea) && ([queuedEvent type] === CPMouseEntered))
|
||||
{
|
||||
[_queuedTrackingEvents removeObjectAtIndex:i];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[_queuedTrackingEvents addObject:anEvent];
|
||||
break;
|
||||
|
||||
case CPCursorUpdate:
|
||||
[_queuedTrackingEvents addObject:anEvent];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_flushTrackingEventQueueForMouseAt:(CGPoint)point
|
||||
{
|
||||
for (var i = 0; i < _queuedTrackingEvents.length; i++)
|
||||
{
|
||||
var queuedEvent = _queuedTrackingEvents[i],
|
||||
trackingArea = [queuedEvent trackingArea],
|
||||
trackingOwner = [trackingArea owner];
|
||||
|
||||
switch ([queuedEvent type])
|
||||
{
|
||||
case CPMouseEntered:
|
||||
[trackingOwner mouseEntered:queuedEvent];
|
||||
break;
|
||||
|
||||
case CPMouseExited:
|
||||
[trackingOwner mouseExited:queuedEvent];
|
||||
break;
|
||||
|
||||
case CPCursorUpdate:
|
||||
[trackingOwner updateTrackingAreas];
|
||||
|
||||
if (CGRectContainsPoint([trackingArea windowRect], point))
|
||||
[trackingOwner cursorUpdate:queuedEvent];
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_queuedTrackingEvents = [];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
function _CPWindowFullPlatformWindowSessionMake(aWindowView, aContentRect, hasShadow, aLevel)
|
||||
{
|
||||
return { windowView:aWindowView, contentRect:aContentRect, hasShadow:hasShadow, level:aLevel };
|
||||
|
||||
@@ -353,7 +353,9 @@ _CPWindowViewResizeSlop = 3;
|
||||
if ([theWindow isFullPlatformWindow] ||
|
||||
!(_styleMask & CPResizableWindowMask) ||
|
||||
(CPWindowResizeStyle !== CPWindowResizeStyleModern))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var globalPoint = [theWindow convertBaseToGlobal:aPoint],
|
||||
resizeRegion = isResizing ? _resizeRegion : [self resizeRegionForPoint:globalPoint],
|
||||
@@ -969,3 +971,18 @@ _CPWindowViewResizeSlop = 3;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPWindowView (TrackingAreaAdditions)
|
||||
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
[self removeAllTrackingAreas];
|
||||
|
||||
[self addTrackingArea:[[CPTrackingArea alloc] initWithRect:[self contentRectForFrameRect:[self frame]]
|
||||
options:CPTrackingCursorUpdate | CPTrackingActiveInActiveApp
|
||||
owner:self
|
||||
userInfo:nil]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -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,707 @@
|
||||
@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);
|
||||
|
||||
var updateFrame = function(timestamp)
|
||||
{
|
||||
var width = ROUND(style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveValue.CSS_PX)),
|
||||
height = ROUND(style.getPropertyCSSValue('height').getFloatValue(CSSPrimitiveValue.CSS_PX));
|
||||
|
||||
if (aKeyPath == "frame")
|
||||
{
|
||||
var left = ROUND(style.getPropertyCSSValue('left').getFloatValue(CSSPrimitiveValue.CSS_PX)),
|
||||
top = ROUND(style.getPropertyCSSValue('top').getFloatValue(CSSPrimitiveValue.CSS_PX)),
|
||||
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;
|
||||
})();
|
||||
@@ -1857,11 +1857,10 @@ function CPWindowObjectList()
|
||||
|
||||
function CPWindowList()
|
||||
{
|
||||
var windowObjectList = CPWindowObjectList(),
|
||||
windowList = [];
|
||||
var windowObjectList = CPWindowObjectList();
|
||||
|
||||
for (var i = 0, count = [windowObjectList count]; i < count; i++)
|
||||
windowList.push([windowObjectList[i] windowNumber]);
|
||||
|
||||
return windowList;
|
||||
return [windowObjectList arrayByApplyingBlock:function(windowObject)
|
||||
{
|
||||
return [windowObject windowNumber];
|
||||
}];
|
||||
}
|
||||
@@ -880,6 +880,25 @@ Returns a hash for the object. Unlike Cocoa, the hash value does not take conten
|
||||
return join.call([self _javaScriptArrayCopy], aString);
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns an Array formed by applying a function to each object in the receiver.
|
||||
@param aFunction a function taking two arguments: (element, index).
|
||||
@return an Array containing the transformed elements.
|
||||
*/
|
||||
- (CPArray)arrayByApplyingBlock:(Function/*element, index*/)aFunction
|
||||
{
|
||||
var result = [],
|
||||
count = [self count];
|
||||
|
||||
for (var idx = 0; idx < count; idx++)
|
||||
{
|
||||
var obj = aFunction([self objectAtIndex:idx], idx);
|
||||
[result addObject:obj];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Creating a description of the array
|
||||
|
||||
/*!
|
||||
|
||||
@@ -233,6 +233,19 @@ var concat = Array.prototype.concat,
|
||||
return join.call(self, aString);
|
||||
}
|
||||
|
||||
- (CPArray)arrayByApplyingBlock:(Function/*element, index*/)aFunction
|
||||
{
|
||||
var result = [];
|
||||
|
||||
for (var idx = 0; idx < self.length; idx++)
|
||||
{
|
||||
var obj = aFunction(self[idx], idx);
|
||||
result.push(obj);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)insertObject:(id)anObject atIndex:(CPUInteger)anIndex
|
||||
{
|
||||
if (anIndex > self.length || anIndex < 0)
|
||||
@@ -335,7 +348,6 @@ var concat = Array.prototype.concat,
|
||||
[super addObjectsFromArray:anArray];
|
||||
}
|
||||
|
||||
|
||||
- (id)copy
|
||||
{
|
||||
return slice.call(self, 0);
|
||||
|
||||
@@ -763,13 +763,10 @@
|
||||
- (void)setAttributedString:(CPAttributedString)aString
|
||||
{
|
||||
_string = aString._string;
|
||||
_rangeEntries = [];
|
||||
|
||||
var i = 0,
|
||||
count = aString._rangeEntries.length;
|
||||
|
||||
for (; i < count; i++)
|
||||
_rangeEntries.push(copyRangeEntry(aString._rangeEntries[i]));
|
||||
_rangeEntries = [aString._rangeEntries arrayByApplyingBlock:function(entry)
|
||||
{
|
||||
return copyRangeEntry(entry);
|
||||
}];
|
||||
}
|
||||
|
||||
//Private methods
|
||||
|
||||
@@ -212,15 +212,12 @@ var CPBundlesForURLStrings = { };
|
||||
|
||||
- (CPArray)staticResourceURLs
|
||||
{
|
||||
var staticResourceURLs = [],
|
||||
staticResources = _bundle.staticResources(),
|
||||
index = 0,
|
||||
count = [staticResources count];
|
||||
var staticResources = _bundle.staticResources();
|
||||
|
||||
for (; index < count; ++index)
|
||||
[staticResourceURLs addObject:staticResources[index].URL()];
|
||||
|
||||
return staticResourceURLs;
|
||||
return [staticResources arrayByApplyingBlock:function(resource)
|
||||
{
|
||||
return resource.URL();
|
||||
}];
|
||||
}
|
||||
|
||||
- (CPArray)environments
|
||||
|
||||
+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;
|
||||
|
||||
@@ -1018,14 +1018,13 @@ var CPIndexSetCountKey = @"CPIndexSetCountKey",
|
||||
if (self)
|
||||
{
|
||||
_count = [aCoder decodeIntForKey:CPIndexSetCountKey];
|
||||
_ranges = [];
|
||||
|
||||
var rangeStrings = [aCoder decodeObjectForKey:CPIndexSetRangeStringsKey],
|
||||
index = 0,
|
||||
count = rangeStrings.length;
|
||||
var rangeStrings = [aCoder decodeObjectForKey:CPIndexSetRangeStringsKey];
|
||||
|
||||
for (; index < count; ++index)
|
||||
_ranges.push(CPRangeFromString(rangeStrings[index]));
|
||||
_ranges = [rangeStrings arrayByApplyingBlock:function(range)
|
||||
{
|
||||
return CPRangeFromString(range);
|
||||
}];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
@@ -380,12 +380,10 @@ var _CPKeyedArchiverStringClass = Nil,
|
||||
/* @ignore */
|
||||
- (void)_encodeArrayOfObjects:(CPArray)objects forKey:(CPString)aKey
|
||||
{
|
||||
var i = 0,
|
||||
count = objects.length,
|
||||
references = [];
|
||||
|
||||
for (; i < count; ++i)
|
||||
[references addObject:_CPKeyedArchiverEncodeObject(self, objects[i], NO)];
|
||||
var references = [objects arrayByApplyingBlock:function(object)
|
||||
{
|
||||
return _CPKeyedArchiverEncodeObject(self, object, NO);
|
||||
}];
|
||||
|
||||
[_plistObject setObject:references forKey:aKey];
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -28,3 +28,5 @@
|
||||
@import "_CPAggregateExpression.j"
|
||||
@import "_CPSetExpression.j"
|
||||
@import "_CPSubqueryExpression.j"
|
||||
@import "_CPBlockExpression.j"
|
||||
@import "_CPConditionalExpression.j"
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
@implementation _CPAggregateExpression : CPExpression
|
||||
{
|
||||
CPArray _aggregate;
|
||||
CPArray _aggregate @accessors(getter=collection);
|
||||
}
|
||||
|
||||
- (id)initWithAggregate:(CPArray)collection
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
if (self)
|
||||
_aggregate = collection;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -48,48 +49,30 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (id)collection
|
||||
{
|
||||
return _aggregate;
|
||||
}
|
||||
|
||||
- (id)expressionValueWithObject:(id)object context:(CPDictionary)context
|
||||
{
|
||||
var eval_array = [CPArray array],
|
||||
collection = [_aggregate objectEnumerator],
|
||||
exp;
|
||||
|
||||
while ((exp = [collection nextObject]) !== nil)
|
||||
return [_aggregate arrayByApplyingBlock:function(exp)
|
||||
{
|
||||
var eval = [exp expressionValueWithObject:object context:context];
|
||||
[eval_array addObject:eval];
|
||||
}
|
||||
|
||||
return eval_array;
|
||||
return [exp expressionValueWithObject:object context:context];
|
||||
}];
|
||||
}
|
||||
|
||||
- (CPString)description
|
||||
{
|
||||
var i = 0,
|
||||
count = [_aggregate count],
|
||||
result = "{";
|
||||
{
|
||||
var descriptions = [_aggregate arrayByApplyingBlock:function(exp)
|
||||
{
|
||||
return [exp description];
|
||||
}];
|
||||
|
||||
for (; i < count; i++)
|
||||
result = result + [CPString stringWithFormat:@"%s%s", [[_aggregate objectAtIndex:i] description], (i + 1 < count) ? @", " : @""];
|
||||
|
||||
result = result + "}";
|
||||
|
||||
return result;
|
||||
return "{" + [descriptions componentsJoinedByString:","] + "}" ;
|
||||
}
|
||||
|
||||
- (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)variables
|
||||
{
|
||||
var subst_array = [CPArray array],
|
||||
count = [_aggregate count],
|
||||
i = 0;
|
||||
|
||||
for (; i < count; i++)
|
||||
[subst_array addObject:[[_aggregate objectAtIndex:i] _expressionWithSubstitutionVariables:variables]];
|
||||
var subst_array = [_aggregate arrayByApplyingBlock:function(exp)
|
||||
{
|
||||
return [exp _expressionWithSubstitutionVariables:variables];
|
||||
}];
|
||||
|
||||
return [CPExpression expressionForAggregate:subst_array];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* _CPBlockExpression.j
|
||||
*
|
||||
* Created by cacaodev.
|
||||
* Copyright 2015.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import "_CPExpression.j"
|
||||
|
||||
@implementation _CPBlockExpression : CPExpression
|
||||
{
|
||||
Function _block @accessors(getter=expressionBlock);
|
||||
CPArray _arguments @accessors(getter=arguments);
|
||||
}
|
||||
|
||||
- (id)initWithBlock:(Function)aBlock arguments:(CPArray)arguments
|
||||
{
|
||||
self = [super initWithExpressionType:CPBlockExpressionType];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_block = aBlock;
|
||||
_arguments = arguments;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)object
|
||||
{
|
||||
if (self === object)
|
||||
return YES;
|
||||
|
||||
if (object === nil || object.isa !== self.isa || [object expressionBlock] !== _block || ![[object arguments] isEqual:_arguments])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (id)expressionValueWithObject:(id)object context:(CPDictionary)context
|
||||
{
|
||||
var args = [_arguments arrayByApplyingBlock:function(exp)
|
||||
{
|
||||
return [exp expressionValueWithObject:object context:context];
|
||||
}];
|
||||
|
||||
return _block(object, args, context);
|
||||
}
|
||||
|
||||
- (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)bindings
|
||||
{
|
||||
var args = [_arguments arrayByApplyingBlock:function(exp)
|
||||
{
|
||||
return [exp _expressionWithSubstitutionVariables:bindings];
|
||||
}];
|
||||
|
||||
return [[_CPBlockExpression alloc] initWithBlock:_block arguments:args];
|
||||
}
|
||||
|
||||
- (CPString)description
|
||||
{
|
||||
return [CPString stringWithFormat:@"Block(function, %@)", [_arguments description]];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* _CPConditionalExpression.j
|
||||
*
|
||||
* Created by cacaodev.
|
||||
* Copyright 2015.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
@import "_CPPredicate.j"
|
||||
@import "_CPExpression.j"
|
||||
|
||||
@implementation _CPConditionalExpression : CPExpression
|
||||
{
|
||||
CPPredicate _predicate @accessors(getter=predicate);
|
||||
CPExpression _trueExpression @accessors(getter=trueExpression);
|
||||
CPExpression _falseExpression @accessors(getter=falseExpression);
|
||||
}
|
||||
|
||||
- (id)initWithPredicate:(CPPredicate)aPredicate trueExpression:(CPExpression)trueExpression falseExpression:(CPExpression)falseExpression
|
||||
{
|
||||
self = [super initWithExpressionType:CPConditionalExpressionType];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_predicate = aPredicate;
|
||||
_trueExpression = trueExpression;
|
||||
_falseExpression = falseExpression;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)object
|
||||
{
|
||||
if (self === object)
|
||||
return YES;
|
||||
|
||||
if (object === nil || object.isa !== self.isa || ![[object predicate] isEqual:_predicate] || ![[object trueExpression] isEqual:_trueExpression] || ![[object falseExpression] isEqual:_falseExpression])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (id)expressionValueWithObject:(id)object context:(CPDictionary)context
|
||||
{
|
||||
var eval = [_predicate evaluateWithObject:object substitutionVariables:context],
|
||||
exp = eval ? _trueExpression : _falseExpression;
|
||||
|
||||
return [exp expressionValueWithObject:object context:context];
|
||||
}
|
||||
|
||||
- (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)bindings
|
||||
{
|
||||
var predicate = [_predicate predicateWithSubstitutionVariables:bindings],
|
||||
trueExp = [_trueExpression _expressionWithSubstitutionVariables:bindings],
|
||||
falseExp = [_falseExpression _expressionWithSubstitutionVariables:bindings];
|
||||
|
||||
return [[_CPConditionalExpression alloc] initWithPredicate:predicate trueExpression:trueExp falseExpression:falseExp];
|
||||
}
|
||||
|
||||
- (CPString)description
|
||||
{
|
||||
return [CPString stringWithFormat:@"TERNARY(%@,%@,%@)", [_predicate predicateFormat], [_trueExpression description], [_falseExpression description]];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
@implementation _CPConstantValueExpression : CPExpression
|
||||
{
|
||||
id _value;
|
||||
id _value @accessors(getter=constantValue);
|
||||
}
|
||||
|
||||
- (id)initWithValue:(id)value
|
||||
@@ -51,11 +51,6 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (id)constantValue
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
|
||||
- (id)expressionValueWithObject:(id)object context:(CPDictionary)context
|
||||
{
|
||||
return _value;
|
||||
@@ -66,6 +61,9 @@
|
||||
if ([_value isKindOfClass:[CPString class]])
|
||||
return @"\"" + _value + @"\"";
|
||||
|
||||
if (_value === [CPNull null])
|
||||
return @"nil";
|
||||
|
||||
return [_value description];
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,14 @@ CPIntersectSetExpressionType = 8;
|
||||
An expression that combines two nested expression results by set subtraction.
|
||||
*/
|
||||
CPMinusSetExpressionType = 9;
|
||||
/*!
|
||||
An expression that returns the result of evaluating a block.
|
||||
*/
|
||||
CPBlockExpressionType = 10;
|
||||
/*!
|
||||
An expression that returns an expression that depends on the evaluation of a predicate.
|
||||
*/
|
||||
CPConditionalExpressionType = 11;
|
||||
|
||||
/*!
|
||||
@ingroup foundation
|
||||
@@ -259,6 +267,32 @@ CPMinusSetExpressionType = 9;
|
||||
return [[_CPSubqueryExpression alloc] initWithExpression:expression usingIteratorVariable:variable predicate:predicate];
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns Creates an NSExpression object that will use the Block for evaluating objects.
|
||||
@param aBlock The Block is applied to the object to be evaluated.
|
||||
|
||||
The Block takes three arguments and returns a value:
|
||||
|
||||
evaluatedObject
|
||||
The object to be evaluated.
|
||||
expressions
|
||||
An array of predicate expressions that evaluates to a collection.
|
||||
context
|
||||
A dictionary that the expression can use to store temporary state for one predicate evaluation.
|
||||
|
||||
@discussion Note that context is mutable, and that it can only be accessed during the evaluation of the expression.
|
||||
@param arguments An array containing NSExpression objects that will be used as parameters during the invocation of the block.
|
||||
*/
|
||||
+ (CPExpression)expressionForBlock:(Function)aBlock arguments:(CPArray)args
|
||||
{
|
||||
return [[_CPBlockExpression alloc] initWithBlock:aBlock arguments:args];
|
||||
}
|
||||
|
||||
+ (CPExpression)expressionForConditional:(CPPredicate)aPredicate trueExpression:(CPExpression)trueExpression falseExpression:(CPExpression)falseExpression
|
||||
{
|
||||
return [[_CPConditionalExpression alloc] initWithPredicate:aPredicate trueExpression:trueExpression falseExpression:falseExpression];
|
||||
}
|
||||
|
||||
// Getting Information About an Expression
|
||||
/*!
|
||||
Returns the expression type for the receiver.
|
||||
@@ -316,7 +350,7 @@ CPMinusSetExpressionType = 9;
|
||||
|
||||
/*!
|
||||
Returns the arguments for the receiver.
|
||||
@return The arguments for the receiver—that is, the array of expressions that will be passed as parameters during invocation of the selector on the operand of a function expression.
|
||||
@return The arguments for the receiver—that is, the array of expressions that will be passed as parameters during invocation of the selector on the operand of a function expression or as a parameter of the block of a block expression.
|
||||
This method raises an exception if it is not applicable to the receiver.
|
||||
*/
|
||||
- (CPArray)arguments
|
||||
@@ -337,8 +371,8 @@ CPMinusSetExpressionType = 9;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the predicate in a subquery expression.
|
||||
@return The predicate in a subquery expression..
|
||||
Returns the predicate in a subquery expression or a conditional expression.
|
||||
@return The predicate in a subquery expression or a conditional expression.
|
||||
This method raises an exception if it is not applicable to the receiver.
|
||||
*/
|
||||
- (CPPredicate)predicate
|
||||
@@ -380,6 +414,39 @@ CPMinusSetExpressionType = 9;
|
||||
return nil;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the block of a block expression.
|
||||
@return The block of a block expression.
|
||||
This method raises an exception if it is not applicable to the receiver.
|
||||
*/
|
||||
- (Function)expressionBlock
|
||||
{
|
||||
_CPRaiseInvalidAbstractInvocation(self, _cmd);
|
||||
return nil;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the true expression of a conditional expression.
|
||||
@return The true expression of a conditional expression.
|
||||
This method raises an exception if it is not applicable to the receiver.
|
||||
*/
|
||||
- (CPExpression)trueExpression
|
||||
{
|
||||
_CPRaiseInvalidAbstractInvocation(self, _cmd);
|
||||
return nil;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the false expression of a conditional expression.
|
||||
@return The false expression of a conditional expression.
|
||||
This method raises an exception if it is not applicable to the receiver.
|
||||
*/
|
||||
- (CPExpression)falseExpression
|
||||
{
|
||||
_CPRaiseInvalidAbstractInvocation(self, _cmd);
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)variables
|
||||
{
|
||||
return self;
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
|
||||
@implementation _CPFunctionExpression : CPExpression
|
||||
{
|
||||
CPExpression _operand;
|
||||
CPExpression _operand @accessors(getter=operand);
|
||||
SEL _selector;
|
||||
CPArray _arguments;
|
||||
CPArray _arguments @accessors(getter=arguments);
|
||||
int _argc;
|
||||
int _maxargs;
|
||||
}
|
||||
@@ -88,16 +88,6 @@
|
||||
return [self _function];
|
||||
}
|
||||
|
||||
- (CPArray)arguments
|
||||
{
|
||||
return _arguments;
|
||||
}
|
||||
|
||||
- (CPExpression)operand
|
||||
{
|
||||
return _operand;
|
||||
}
|
||||
|
||||
- (id)expressionValueWithObject:(id)object context:(CPDictionary)context
|
||||
{
|
||||
var target = [_operand expressionValueWithObject:object context:context],
|
||||
@@ -143,11 +133,10 @@
|
||||
- (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)variables
|
||||
{
|
||||
var operand = [[self operand] _expressionWithSubstitutionVariables:variables],
|
||||
args = [CPArray array],
|
||||
i = 0;
|
||||
|
||||
for (; i < _argc; i++)
|
||||
[args addObject:[_arguments[i] _expressionWithSubstitutionVariables:variables]];
|
||||
args = [_arguments arrayByApplyingBlock:function(arg)
|
||||
{
|
||||
return [arg _expressionWithSubstitutionVariables:variables];
|
||||
}];
|
||||
|
||||
return [CPExpression expressionForFunction:operand selectorName:[self _function] arguments:args];
|
||||
}
|
||||
|
||||
@@ -744,16 +744,43 @@
|
||||
|
||||
if (![self scanString:@"," intoString:NULL])
|
||||
CPRaiseParseError(self, @"expression");
|
||||
|
||||
variableExpression = [self parseExpression];
|
||||
|
||||
if (![self scanString:@"," intoString:NULL])
|
||||
CPRaiseParseError(self, @"expression");
|
||||
|
||||
subpredicate = [self parsePredicate];
|
||||
|
||||
if (![self scanString:@")" intoString:NULL])
|
||||
CPRaiseParseError(self, @"predicate");
|
||||
|
||||
return [[_CPSubqueryExpression alloc] initWithExpression:collection usingIteratorExpression:variableExpression predicate:subpredicate];
|
||||
}
|
||||
|
||||
if ([self scanString:@"TERNARY" intoString:NULL])
|
||||
{
|
||||
if (![self scanString:@"(" intoString:NULL])
|
||||
CPRaiseParseError(self, @"expression");
|
||||
|
||||
var predicate = [self parsePredicate],
|
||||
trueExpression,
|
||||
falseExpression;
|
||||
|
||||
if (![self scanString:@"," intoString:NULL])
|
||||
CPRaiseParseError(self, @"predicate");
|
||||
|
||||
trueExpression = [self parseExpression];
|
||||
|
||||
if (![self scanString:@"," intoString:NULL])
|
||||
CPRaiseParseError(self, @"expression");
|
||||
|
||||
falseExpression = [self parseExpression];
|
||||
|
||||
if (![self scanString:@")" intoString:NULL])
|
||||
CPRaiseParseError(self, @"expression");
|
||||
|
||||
return [[_CPSubqueryExpression alloc] initWithExpression:collection usingIteratorExpression:variableExpression predicate:subpredicate];
|
||||
return [CPExpression expressionForConditional:predicate trueExpression:trueExpression falseExpression:falseExpression];
|
||||
}
|
||||
|
||||
if ([self scanString:@"FUNCTION" intoString:NULL])
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
@implementation _CPSetExpression : CPExpression
|
||||
{
|
||||
CPExpression _left;
|
||||
CPExpression _right;
|
||||
CPExpression _left @accessors(getter=leftExpression);
|
||||
CPExpression _right @accessors(getter=rightExpression);
|
||||
}
|
||||
|
||||
- (id)initWithType:(int)type left:(CPExpression)left right:(CPExpression)right
|
||||
@@ -88,16 +88,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (CPExpression)leftExpression
|
||||
{
|
||||
return _left;
|
||||
}
|
||||
|
||||
- (CPExpression)rightExpression
|
||||
{
|
||||
return _right;
|
||||
}
|
||||
|
||||
- (CPString)description
|
||||
{
|
||||
var desc;
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
|
||||
@implementation _CPSubqueryExpression : CPExpression
|
||||
{
|
||||
CPExpression _collection;
|
||||
CPExpression _collection @accessors(getter=collection);
|
||||
CPExpression _variableExpression;
|
||||
CPPredicate _subpredicate;
|
||||
CPPredicate _subpredicate @accessors(getter=predicate);
|
||||
}
|
||||
|
||||
- (id)initWithExpression:(CPExpression)collection usingIteratorVariable:(CPString)variable predicate:(CPPredicate)subpredicate
|
||||
@@ -47,23 +47,25 @@
|
||||
_collection = collection;
|
||||
_variableExpression = variableExpression;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)expressionValueWithObject:(id)object context:(id)context
|
||||
- (id)expressionValueWithObject:(id)object context:(id)aContext
|
||||
{
|
||||
var collection = [_collection expressionValueWithObject:object context:context],
|
||||
count = [collection count],
|
||||
var collection = [_collection expressionValueWithObject:object context:aContext],
|
||||
result = [CPArray array],
|
||||
bindings = @{ [self variable]: [CPExpression expressionForEvaluatedObject] },
|
||||
i = 0;
|
||||
variable = [self variable],
|
||||
context = aContext || @{};
|
||||
|
||||
for (; i < count; i++)
|
||||
if ([context objectForKey:variable] == nil)
|
||||
[context setObject:[CPExpression expressionForEvaluatedObject] forKey:variable];
|
||||
|
||||
[collection enumerateObjectsUsingBlock:function(exp, idx, stop)
|
||||
{
|
||||
var item = [collection objectAtIndex:i];
|
||||
if ([_subpredicate evaluateWithObject:item substitutionVariables:bindings])
|
||||
[result addObject:item];
|
||||
}
|
||||
if ([_subpredicate evaluateWithObject:exp substitutionVariables:context])
|
||||
[result addObject:exp];
|
||||
}];
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -79,21 +81,11 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (CPExpression)collection
|
||||
{
|
||||
return _collection;
|
||||
}
|
||||
|
||||
- (id)copy
|
||||
{
|
||||
return [[_CPSubqueryExpression alloc] initWithExpression:[_collection copy] usingIteratorExpression:[_variableExpression copy] predicate:[_subpredicate copy]];
|
||||
}
|
||||
|
||||
- (CPPredicate)predicate
|
||||
{
|
||||
return _subpredicate;
|
||||
}
|
||||
|
||||
- (CPString)description
|
||||
{
|
||||
return [self predicateFormat];
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
@implementation _CPVariableExpression : CPExpression
|
||||
{
|
||||
CPString _variable;
|
||||
CPString _variable @accessors(getter=variable);
|
||||
}
|
||||
|
||||
- (id)initWithVariable:(CPString)variable
|
||||
@@ -54,11 +54,6 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (CPString)variable
|
||||
{
|
||||
return _variable;
|
||||
}
|
||||
|
||||
- (id)expressionValueWithObject:object context:(CPDictionary)context
|
||||
{
|
||||
var expression = [self _expressionWithSubstitutionVariables:context];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -32,7 +32,7 @@ $BROWSER_FILE = FILE.join("Browser", "Objective-J.js");
|
||||
$BUILD_OBJECTIVE_J = FILE.join($BUILD_CONFIGURATION_DIR, "Objective-J");
|
||||
$BUILD_BROWSER_FILE = FILE.join($BUILD_OBJECTIVE_J, "Objective-J.js");
|
||||
|
||||
$INCLUDE_FLAGS = ["-I" + FILE.cwd()];
|
||||
$INCLUDE_FLAGS = ["'-I" + FILE.cwd() + "'"];
|
||||
$DEBUG_FLAGS = $CONFIGURATION === "Debug" ? ["-DDEBUG=1"] : [""];
|
||||
$OBJECTIVEJ_FILES = new FileList("*.js");
|
||||
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
[](https://travis-ci.org/cappuccino/cappuccino)
|
||||
[](https://travis-ci.org/cappuccino/cappuccino) [](https://gitter.im/cappuccino/cappuccino?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
Welcome to Cappuccino!
|
||||
======================
|
||||
@@ -15,7 +15,7 @@ with the complexities of traditional web technologies like HTML, CSS, or even
|
||||
the DOM. The unpleasantries of building complex cross browser applications are
|
||||
abstracted away for you.
|
||||
|
||||
For more information, see <http://cappuccino-project.org>.
|
||||
For more information, see <http://cappuccino-project.org>. Follow [@cappuccino](https://twitter.com/cappuccino) on Twitter for updates on the project.
|
||||
|
||||
System Requirements
|
||||
-------------------
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
@import <AppKit/CPApplication.j>
|
||||
|
||||
var methodCalled;
|
||||
var updateTrackingAreasCalls,
|
||||
mouseEnteredCalls,
|
||||
mouseExitedCalls,
|
||||
mouseMovedCalls,
|
||||
cursorUpdateCalls,
|
||||
involvedViewForMouseEntered,
|
||||
involvedViewForMouseExited,
|
||||
involvedViewForCursorUpdate;
|
||||
|
||||
@implementation CPViewTest : OJTestCase
|
||||
{
|
||||
@@ -30,6 +38,7 @@ var methodCalled;
|
||||
[view3 setIdentifier:@"view3"];
|
||||
|
||||
methodCalled = [];
|
||||
updateTrackingAreasCalls = 0;
|
||||
|
||||
[super setUp];
|
||||
}
|
||||
@@ -886,6 +895,759 @@ var methodCalled;
|
||||
[self assert:nil equals:[view effectiveAppearance]];
|
||||
}
|
||||
|
||||
// TrackingAreaAdditions
|
||||
|
||||
- (void)testTrackingAreas
|
||||
{
|
||||
var trackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect owner:self userInfo:nil];
|
||||
|
||||
[self assert:0 equals:[[view trackingAreas] count] message:@"Initially, a view has no tracking area"];
|
||||
|
||||
//
|
||||
|
||||
[view addTrackingArea:trackingArea];
|
||||
[self assert:1 equals:[[view trackingAreas] count] message:@"After adding a tracking area"];
|
||||
[self assert:view equals:[trackingArea view] message:@"Tracking area should be linked to view"];
|
||||
|
||||
//
|
||||
|
||||
[view removeTrackingArea:trackingArea];
|
||||
[self assert:0 equals:[[view trackingAreas] count] message:@"After removing the only tracking area"];
|
||||
[self assert:nil equals:[trackingArea view] message:@"Tracking area should be unlinked"];
|
||||
|
||||
//
|
||||
|
||||
[view addTrackingArea:trackingArea];
|
||||
[view addTrackingArea:trackingArea];
|
||||
[view addTrackingArea:trackingArea];
|
||||
[self assert:1 equals:[[view trackingAreas] count] message:@"Adding the same tracking area multiple times should add it once"];
|
||||
[self assert:view equals:[trackingArea view] message:@"Tracking area should be linked to view"];
|
||||
|
||||
var trackingArea2 = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow owner:self userInfo:nil];
|
||||
|
||||
//
|
||||
|
||||
[view addTrackingArea:trackingArea2];
|
||||
[self assert:2 equals:[[view trackingAreas] count] message:@"After adding a second tracking area"];
|
||||
[self assert:view equals:[trackingArea2 view] message:@"Tracking area should be linked to view"];
|
||||
|
||||
//
|
||||
|
||||
[view removeAllTrackingAreas];
|
||||
[self assert:0 equals:[[view trackingAreas] count] message:@"After removing all tracking areas"];
|
||||
[self assert:nil equals:[trackingArea view] message:@"Tracking area should be unlinked"];
|
||||
[self assert:nil equals:[trackingArea2 view] message:@"Tracking area should be unlinked"];
|
||||
|
||||
//
|
||||
|
||||
[view addTrackingArea:trackingArea];
|
||||
|
||||
var contentView = [window contentView];
|
||||
|
||||
[contentView addSubview:view];
|
||||
[self assert:0 equals:updateTrackingAreasCalls message:@"Putting a view with a CPTrackingAreaInVisibleRect in a window should not call updateTrackingAreas"];
|
||||
|
||||
[view removeFromSuperview];
|
||||
|
||||
//
|
||||
|
||||
[view addTrackingArea:trackingArea2];
|
||||
[contentView addSubview:view];
|
||||
[self assert:1 equals:updateTrackingAreasCalls message:@"Putting a view with a non CPTrackingAreaInVisibleRect in a window should call updateTrackingAreas"];
|
||||
|
||||
[view removeAllTrackingAreas];
|
||||
|
||||
//
|
||||
|
||||
var viewTA = [[CPTrackingAreaView alloc] initWithFrame:CGRectMakeZero()];
|
||||
updateTrackingAreasCalls = 0;
|
||||
|
||||
[contentView addSubview:viewTA];
|
||||
[self assert:1 equals:updateTrackingAreasCalls message:@"Putting a view with no tracking areas in a window should call updateTrackingAreas"];
|
||||
|
||||
//
|
||||
|
||||
updateTrackingAreasCalls = 0;
|
||||
|
||||
[viewTA addTrackingArea:trackingArea];
|
||||
[viewTA setFrame:CGRectMake(10, 10, 10, 10)];
|
||||
[self assert:0 equals:updateTrackingAreasCalls message:@"Changing geometry of a view with a CPTrackingAreaInVisibleRect should not call updateTrackingAreas"];
|
||||
|
||||
//
|
||||
|
||||
updateTrackingAreasCalls = 0;
|
||||
|
||||
[viewTA addTrackingArea:trackingArea2];
|
||||
[viewTA setFrame:CGRectMake(20, 20, 20, 20)];
|
||||
[self assert:1 equals:updateTrackingAreasCalls message:@"Changing geometry of a view with a non CPTrackingAreaInVisibleRect should call updateTrackingAreas"];
|
||||
|
||||
//
|
||||
|
||||
var trackingAreaAll = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:CPTrackingMouseEnteredAndExited | CPTrackingMouseMoved | CPTrackingCursorUpdate | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect owner:viewTA userInfo:nil];
|
||||
|
||||
[viewTA removeAllTrackingAreas];
|
||||
[viewTA addTrackingArea:trackingAreaAll];
|
||||
|
||||
// Mouse enters the tracking area
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(21, 21) dragging:NO];
|
||||
|
||||
[self assert:1 equals:mouseEnteredCalls message:@"Mouse entering a tracking area should call mouseEntered"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"Mouse entering a tracking area should not call mouseExited"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"Mouse entering a tracking area should not call mouseMoved"];
|
||||
[self assert:1 equals:cursorUpdateCalls message:@"Mouse entering a tracking area should call cursorUpdate"];
|
||||
|
||||
// Mouse moves in the tracking area
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(22, 22) dragging:NO];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"Mouse moving in a tracking area should not call mouseEntered"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"Mouse moving in a tracking area should not call mouseExited"];
|
||||
[self assert:1 equals:mouseMovedCalls message:@"Mouse moving in a tracking area should call mouseMoved"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"Mouse moving in a tracking area should not call cursorUpdate"];
|
||||
|
||||
// Mouse exits from the tracking area
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(0, 0) dragging:NO];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"Mouse exiting from a tracking area should not call mouseEntered"];
|
||||
[self assert:1 equals:mouseExitedCalls message:@"Mouse exiting from a tracking area should call mouseExited"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"Mouse exiting from a tracking area should not call mouseMoved"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"Mouse exiting from a tracking area should not call cursorUpdate"];
|
||||
|
||||
// Mouse enters the tracking area while dragging
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(21, 21) dragging:YES];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"While dragging, mouse entering a tracking area without CPTrackingEnabledDuringMouseDrag should not call mouseEntered"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"While dragging, mouse entering a tracking area without CPTrackingEnabledDuringMouseDrag should not call mouseExited"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"While dragging, mouse entering a tracking area without CPTrackingEnabledDuringMouseDrag should not call mouseMoved"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"While dragging, mouse entering a tracking area without CPTrackingEnabledDuringMouseDrag should not call cursorUpdate"];
|
||||
|
||||
// Mouse moves in the tracking area while dragging
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(22, 22) dragging:YES];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"While dragging, mouse moving in a tracking area without CPTrackingEnabledDuringMouseDrag should not call mouseEntered"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"While dragging, mouse moving in a tracking area without CPTrackingEnabledDuringMouseDrag should not call mouseExited"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"While dragging, mouse moving in a tracking area without CPTrackingEnabledDuringMouseDrag should not call mouseMoved"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"While dragging, mouse moving in a tracking area without CPTrackingEnabledDuringMouseDrag should not call cursorUpdate"];
|
||||
|
||||
// Mouse exits from the tracking area while dragging
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(0, 0) dragging:YES];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"While dragging, mouse exiting from a tracking area without CPTrackingEnabledDuringMouseDrag should not call mouseEntered"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"While dragging, mouse exiting from a tracking area without CPTrackingEnabledDuringMouseDrag should not call mouseExited"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"While dragging, mouse exiting from a tracking area without CPTrackingEnabledDuringMouseDrag should not call mouseMoved"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"While dragging, mouse exiting from a tracking area without CPTrackingEnabledDuringMouseDrag should not call cursorUpdate"];
|
||||
|
||||
//
|
||||
|
||||
var trackingAreaAllWithDrag = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:CPTrackingMouseEnteredAndExited | CPTrackingMouseMoved | CPTrackingCursorUpdate | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect | CPTrackingEnabledDuringMouseDrag owner:viewTA userInfo:nil];
|
||||
|
||||
[viewTA removeAllTrackingAreas];
|
||||
[viewTA addTrackingArea:trackingAreaAllWithDrag];
|
||||
|
||||
// Mouse enters the tracking area while dragging (option set)
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(21, 21) dragging:YES];
|
||||
|
||||
[self assert:1 equals:mouseEnteredCalls message:@"While dragging, mouse entering a tracking area with CPTrackingEnabledDuringMouseDrag should call mouseEntered"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"While dragging, mouse entering a tracking area with CPTrackingEnabledDuringMouseDrag should not call mouseExited"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"While dragging, mouse entering a tracking area with CPTrackingEnabledDuringMouseDrag should not call mouseMoved"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"While dragging, mouse entering a tracking area with CPTrackingEnabledDuringMouseDrag should not call cursorUpdate"];
|
||||
|
||||
// Mouse moves in the tracking area while dragging (option set)
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(22, 22) dragging:YES];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"While dragging, mouse moving in a tracking area with CPTrackingEnabledDuringMouseDrag should not call mouseEntered"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"While dragging, mouse moving in a tracking area with CPTrackingEnabledDuringMouseDrag should not call mouseExited"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"While dragging, mouse moving in a tracking area with CPTrackingEnabledDuringMouseDrag should not call mouseMoved"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"While dragging, mouse moving in a tracking area with CPTrackingEnabledDuringMouseDrag should not call cursorUpdate"];
|
||||
|
||||
// Mouse exits from the tracking area while dragging (option set)
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(0, 0) dragging:YES];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"While dragging, mouse exiting from a tracking area with CPTrackingEnabledDuringMouseDrag should not call mouseEntered"];
|
||||
[self assert:1 equals:mouseExitedCalls message:@"While dragging, mouse exiting from a tracking area with CPTrackingEnabledDuringMouseDrag should call mouseExited"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"While dragging, mouse exiting from a tracking area with CPTrackingEnabledDuringMouseDrag should not call mouseMoved"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"While dragging, mouse exiting from a tracking area with CPTrackingEnabledDuringMouseDrag should not call cursorUpdate"];
|
||||
|
||||
// Nested views
|
||||
|
||||
var innerViewTA = [[CPTrackingAreaView alloc] initWithFrame:CGRectMake(5, 5, 10, 10)];
|
||||
|
||||
[viewTA addSubview:innerViewTA];
|
||||
|
||||
var innerTrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:CPTrackingMouseEnteredAndExited | CPTrackingMouseMoved | CPTrackingCursorUpdate | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect owner:innerViewTA userInfo:nil];
|
||||
|
||||
[innerViewTA addTrackingArea:innerTrackingArea];
|
||||
|
||||
// Mouse enters outer view
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(21, 21) dragging:NO];
|
||||
|
||||
[self assert:1 equals:mouseEnteredCalls message:@"Mouse entering outer tracking area should call mouseEntered"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"Mouse entering outer tracking area should not call mouseExited"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"Mouse entering outer tracking area should not call mouseMoved"];
|
||||
[self assert:1 equals:cursorUpdateCalls message:@"Mouse entering outer tracking area should call cursorUpdate"];
|
||||
|
||||
// Mouse enters inner view
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(26, 26) dragging:NO];
|
||||
|
||||
[self assert:1 equals:mouseEnteredCalls message:@"Mouse entering inner tracking area should call mouseEntered"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"Mouse entering inner tracking area should not call mouseExited"];
|
||||
[self assert:1 equals:mouseMovedCalls message:@"Mouse entering inner tracking area should call mouseMoved"];
|
||||
[self assert:1 equals:cursorUpdateCalls message:@"Mouse entering inner tracking area should call cursorUpdate"];
|
||||
|
||||
// Mouse moves in inner view
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(27, 27) dragging:NO];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"Mouse moving in inner tracking area should not call mouseEntered"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"Mouse moving in inner tracking area should not call mouseExited"];
|
||||
[self assert:2 equals:mouseMovedCalls message:@"Mouse moving in inner tracking area should call mouseMoved for both views"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"Mouse moving in inner tracking area should not call cursorUpdate"];
|
||||
|
||||
// Mouse leaves inner view but remains in outer view
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(36, 36) dragging:NO];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"Mouse moving from inner to outer tracking area should not call mouseEntered"];
|
||||
[self assert:1 equals:mouseExitedCalls message:@"Mouse moving from inner to outer tracking area should call mouseExited (for inner)"];
|
||||
[self assert:1 equals:mouseMovedCalls message:@"Mouse moving from inner to outer tracking area should call mouseMoved (for outer)"];
|
||||
[self assert:1 equals:cursorUpdateCalls message:@"Mouse moving from inner to outer tracking area should call cursorUpdate (for outer)"];
|
||||
|
||||
[self assert:innerViewTA equals:involvedViewForMouseExited message:@"Inner view should receive mouseExited"];
|
||||
[self assert:viewTA equals:involvedViewForCursorUpdate message:@"Outer view should receive cursorUpdate"];
|
||||
|
||||
// Complex test for cursor update frontmost tracking area detection
|
||||
|
||||
var viewA = [[CPTrackingAreaView alloc] initWithFrame:CGRectMake(0, 30, 40, 40)],
|
||||
viewB = [[CPTrackingAreaView alloc] initWithFrame:CGRectMake(30, 20, 40, 40)],
|
||||
viewC = [[CPTrackingAreaView alloc] initWithFrame:CGRectMake(10, 0, 40, 40)];
|
||||
|
||||
[contentView setSubviews:[CPArray array]];
|
||||
[contentView addSubview:viewA];
|
||||
[contentView addSubview:viewB];
|
||||
[contentView addSubview:viewC];
|
||||
|
||||
var subviewA = [[CPTrackingAreaView alloc] initWithFrame:CGRectMake(20, 0, 20, 20)],
|
||||
subviewB = [[CPTrackingAreaView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)],
|
||||
subviewC = [[CPTrackingAreaView alloc] initWithFrame:CGRectMake(0, 20, 40, 20)];
|
||||
|
||||
[viewA addSubview:subviewA];
|
||||
[viewB addSubview:subviewB];
|
||||
[viewC addSubview:subviewC];
|
||||
|
||||
var options = CPTrackingCursorUpdate | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect,
|
||||
options2 = CPTrackingMouseEnteredAndExited | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect,
|
||||
options3 = CPTrackingCursorUpdate | CPTrackingActiveInActiveApp,
|
||||
viewATrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:viewA userInfo:nil],
|
||||
viewBTrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:viewB userInfo:nil],
|
||||
viewCTrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options2 owner:viewC userInfo:nil],
|
||||
subviewATrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:subviewA userInfo:nil],
|
||||
subviewBTrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:subviewB userInfo:nil],
|
||||
subviewCtrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMake(20, 0, 20, 20) options:options3 owner:subviewC userInfo:nil];
|
||||
|
||||
[viewA addTrackingArea:viewATrackingArea];
|
||||
[viewB addTrackingArea:viewBTrackingArea];
|
||||
[viewC addTrackingArea:viewCTrackingArea];
|
||||
|
||||
[subviewA addTrackingArea:subviewATrackingArea];
|
||||
[subviewB addTrackingArea:subviewBTrackingArea];
|
||||
[subviewC addTrackingArea:subviewCtrackingArea];
|
||||
|
||||
// Step 1
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(5, 25) dragging:NO];
|
||||
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"Step 1 : no cursorUpdate should be called"];
|
||||
[self assert:nil equals:involvedViewForCursorUpdate message:@"Step 1 : no view should be called for cursorUpdate"];
|
||||
|
||||
// Step 2
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(5, 35) dragging:NO];
|
||||
|
||||
[self assert:1 equals:cursorUpdateCalls message:@"Step 2 : 1 cursorUpdate should be called"];
|
||||
[self assert:viewA equals:involvedViewForCursorUpdate message:@"Step 2 : viewA should be called for cursorUpdate"];
|
||||
|
||||
// Step 3
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(15, 35) dragging:NO];
|
||||
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"Step 3 : no cursorUpdate should be called"];
|
||||
[self assert:nil equals:involvedViewForCursorUpdate message:@"Step 3 : no view should be called for cursorUpdate"];
|
||||
|
||||
// Step 4
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(25, 35) dragging:NO];
|
||||
|
||||
[self assert:1 equals:cursorUpdateCalls message:@"Step 4 : 1 cursorUpdate should be called"];
|
||||
[self assert:subviewA equals:involvedViewForCursorUpdate message:@"Step 4 : subviewA should be called for cursorUpdate"];
|
||||
|
||||
// Step 5
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(35, 35) dragging:NO];
|
||||
|
||||
[self assert:1 equals:cursorUpdateCalls message:@"Step 5 : 1 cursorUpdate should be called"];
|
||||
[self assert:subviewC equals:involvedViewForCursorUpdate message:@"Step 5 : subviewC should be called for cursorUpdate"];
|
||||
|
||||
// Step 6
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(45, 35) dragging:NO];
|
||||
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"Step 6 : no cursorUpdate should be called"];
|
||||
[self assert:nil equals:involvedViewForCursorUpdate message:@"Step 6 : no view should be called for cursorUpdate"];
|
||||
|
||||
// Step 7
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(55, 35) dragging:NO];
|
||||
|
||||
[self assert:1 equals:cursorUpdateCalls message:@"Step 7 : 1 cursorUpdate should be called"];
|
||||
[self assert:viewB equals:involvedViewForCursorUpdate message:@"Step 7 : viewB should be called for cursorUpdate"];
|
||||
|
||||
// Step 8
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(75, 35) dragging:NO];
|
||||
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"Step 8 : no cursorUpdate should be called"];
|
||||
[self assert:nil equals:involvedViewForCursorUpdate message:@"Step 8 : no view should be called for cursorUpdate"];
|
||||
|
||||
// Cursor tests
|
||||
|
||||
var viewA = [[CPTrackingAreaViewWithCursorUpdate alloc] initWithFrame:CGRectMake(20, 20, 40, 40)],
|
||||
viewB = [[CPTrackingAreaView alloc] initWithFrame:CGRectMake(10, 10, 80, 80)],
|
||||
viewC = [[CPTrackingAreaViewWithoutCursorUpdate alloc] initWithFrame:CGRectMake(10, 10, 80, 80)];
|
||||
|
||||
[contentView setSubviews:[CPArray array]];
|
||||
[contentView addSubview:viewA];
|
||||
|
||||
var options = CPTrackingCursorUpdate | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect;
|
||||
|
||||
var viewATrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:viewA userInfo:nil],
|
||||
viewBTrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:viewB userInfo:nil],
|
||||
viewCTrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:viewC userInfo:nil];
|
||||
|
||||
[viewA addTrackingArea:viewATrackingArea];
|
||||
[viewB addTrackingArea:viewBTrackingArea];
|
||||
[viewC addTrackingArea:viewCTrackingArea];
|
||||
|
||||
// Step 1.1 : outside the view
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(10, 10) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 1.1 : cursor should be an arrow"];
|
||||
|
||||
// Step 1.2 : inside the view
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(30, 30) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor crosshairCursor] equals:[CPCursor currentCursor] message:@"Step 1.2 : cursor should be a crosshair"];
|
||||
|
||||
// Step 1.3 : outside the view
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(70, 70) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 1.3 : cursor should be an arrow"];
|
||||
|
||||
// Step 1.4 : inside the view with dragging
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(30, 30) dragging:YES];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 1.4 : cursor should be an arrow"];
|
||||
|
||||
// Step 1.5 : mouse up (ends dragging)
|
||||
|
||||
[self mouseUpAtPoint:CGPointMake(30, 30)];
|
||||
|
||||
[self assert:[CPCursor crosshairCursor] equals:[CPCursor currentCursor] message:@"Step 1.5 : cursor should be a crosshair"];
|
||||
|
||||
// Step 1.6 : outside the view with dragging
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(10, 10) dragging:YES];
|
||||
|
||||
[self assert:[CPCursor crosshairCursor] equals:[CPCursor currentCursor] message:@"Step 1.6 : cursor should be a crosshair"];
|
||||
|
||||
// Step 1.7 : mouse up (ends dragging)
|
||||
|
||||
[self mouseUpAtPoint:CGPointMake(10, 10)];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 1.7 : cursor should be an arrow"];
|
||||
|
||||
//
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(1, 1) dragging:NO];
|
||||
|
||||
[viewA removeFromSuperview];
|
||||
[contentView addSubview:viewB];
|
||||
[viewB addSubview:viewA];
|
||||
|
||||
// Step 2.1 : outside the superview
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(5, 5) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 2.1 : cursor should be an arrow"];
|
||||
|
||||
// Step 2.2 : inside the superview / outside the subview
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(15, 15) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 2.2 : cursor should be an arrow"];
|
||||
|
||||
// Step 2.3 : inside the subview
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(35, 35) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor crosshairCursor] equals:[CPCursor currentCursor] message:@"Step 2.3 : cursor should be a crosshair"];
|
||||
|
||||
// Step 2.4 : outside the subview / inside the superview
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(15, 15) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor crosshairCursor] equals:[CPCursor currentCursor] message:@"Step 2.4 : cursor should be a crosshair"];
|
||||
|
||||
// Step 2.5 : outside the superview
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(5, 5) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 2.5 : cursor should be an arrow"];
|
||||
|
||||
//
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(1, 1) dragging:NO];
|
||||
|
||||
[viewA removeFromSuperview];
|
||||
[viewB removeFromSuperview];
|
||||
[contentView addSubview:viewC];
|
||||
[viewC addSubview:viewA];
|
||||
|
||||
// Step 3.1 : outside the superview
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(5, 5) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 3.1 : cursor should be an arrow"];
|
||||
|
||||
// Step 3.2 : inside the superview / outside the subview
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(15, 15) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 3.2 : cursor should be an arrow"];
|
||||
|
||||
// Step 3.3 : inside the subview
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(35, 35) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor crosshairCursor] equals:[CPCursor currentCursor] message:@"Step 3.3 : cursor should be a crosshair"];
|
||||
|
||||
// Step 3.4 : outside the subview / inside the superview
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(15, 15) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 3.4 : cursor should be an arrow"];
|
||||
|
||||
// Step 3.5 : outside the superview
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(5, 5) dragging:NO];
|
||||
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"Step 3.5 : cursor should be an arrow"];
|
||||
|
||||
}
|
||||
|
||||
- (void)testTrackingAreasLiveViewHierarchyModification
|
||||
{
|
||||
// 1. viewB inside viewA with mouseEntered removing itself
|
||||
|
||||
var viewA = [[CPTrackingAreaViewWithCursorUpdate alloc] initWithFrame:CGRectMake(20, 20, 40, 40)]
|
||||
viewB = [[CPTrackingAreaViewLiveRemoval alloc] initWithFrame:CGRectMake(10, 10, 20, 20)];
|
||||
|
||||
[[window contentView] setSubviews:[CPArray arrayWithObject:viewA]];
|
||||
[viewA addSubview:viewB];
|
||||
|
||||
var options = CPTrackingMouseEnteredAndExited | CPTrackingCursorUpdate | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect,
|
||||
viewATrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:viewA userInfo:nil],
|
||||
viewBTrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:viewB userInfo:nil];
|
||||
|
||||
[viewA addTrackingArea:viewATrackingArea];
|
||||
[viewB addTrackingArea:viewBTrackingArea];
|
||||
|
||||
// Step 1.1 : enter viewA
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(25, 25) dragging:NO];
|
||||
|
||||
[self assert:1 equals:mouseEnteredCalls message:@"1.1 There should be one and only one mouseEntered call"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"1.1 There should be no mouseExited call"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"1.1 There should be no mouseMoved call"];
|
||||
[self assert:1 equals:cursorUpdateCalls message:@"1.1 There should be one and only one cursorUpdate call"];
|
||||
|
||||
[self assert:viewA equals:involvedViewForMouseEntered message:@"1.1 viewA should receive mouseEntered"];
|
||||
[self assert:viewA equals:involvedViewForCursorUpdate message:@"1.1 viewA should receive cursorUpdate"];
|
||||
|
||||
// Step 1.2 : enter viewB
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(40, 40) dragging:NO];
|
||||
|
||||
[self assert:1 equals:mouseEnteredCalls message:@"1.2 There should be one and only one mouseEntered call"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"1.2 There should be no mouseExited call"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"1.2 There should be no mouseMoved call"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"1.2 There should be no cursorUpdate call"];
|
||||
|
||||
[self assert:viewB equals:involvedViewForMouseEntered message:@"1.2 viewB should receive mouseEntered"];
|
||||
|
||||
// Step 1.3 : move back to viewA (there should be no more viewB)
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(25, 25) dragging:NO];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"1.3 There should be no mouseEntered call"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"1.3 There should be no mouseExited call"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"1.3 There should be no mouseMoved call"];
|
||||
[self assert:1 equals:cursorUpdateCalls message:@"1.3 There should be one and only one cursorUpdate call"];
|
||||
|
||||
[self assert:viewA equals:involvedViewForCursorUpdate message:@"1.3 viewA should receive cursorUpdate"];
|
||||
|
||||
// Step 1.4 : exit viewA
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(5, 5) dragging:NO];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"1.4 There should be one and only one mouseEntered call"];
|
||||
[self assert:1 equals:mouseExitedCalls message:@"1.4 There should be one and only on mouseExited call"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"1.4 There should be no mouseMoved call"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"1.4 There should be no cursorUpdate call"];
|
||||
|
||||
[self assert:viewA equals:involvedViewForMouseExited message:@"1.4 viewA should receive mouseExited"];
|
||||
|
||||
// 2. viewA with mouseEntered adding viewB inside it. Testing if viewB receive mouseEntered & cursorUpdate
|
||||
|
||||
var viewA = [[CPTrackingAreaViewLiveAddition alloc] initWithFrame:CGRectMake(20, 20, 40, 40)];
|
||||
|
||||
[[window contentView] setSubviews:[CPArray arrayWithObject:viewA]];
|
||||
|
||||
var options = CPTrackingMouseEnteredAndExited | CPTrackingCursorUpdate | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect,
|
||||
viewATrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:viewA userInfo:nil];
|
||||
|
||||
[viewA addTrackingArea:viewATrackingArea];
|
||||
|
||||
// Step 2.1 : enter viewA (then add viewB thus enter also viewB)
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(25, 25) dragging:NO];
|
||||
|
||||
[self assert:2 equals:mouseEnteredCalls message:@"2.1 There should be two mouseEntered calls"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"2.1 There should be no mouseExited call"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"2.1 There should be no mouseMoved call"];
|
||||
[self assert:2 equals:cursorUpdateCalls message:@"2.1 There should be two cursorUpdate calls"];
|
||||
|
||||
[self assert:[[viewA subviews] firstObject] equals:involvedViewForMouseEntered message:@"2.1 viewB should receive mouseEntered"];
|
||||
[self assert:[[viewA subviews] firstObject] equals:involvedViewForCursorUpdate message:@"2.1 viewB should receive cursorUpdate"];
|
||||
[self assert:[CPCursor crosshairCursor] equals:[CPCursor currentCursor] message:@"2.1 Final cursor should be crosshair cursor, determined by viewB"];
|
||||
|
||||
// Step 2.2 : exit viewA (thus also viewB)
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(5, 5) dragging:NO];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"2.2 There should be no mouseEntered calls"];
|
||||
[self assert:2 equals:mouseExitedCalls message:@"2.2 There should be two mouseExited call"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"2.2 There should be no mouseMoved call"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"2.2 There should be no cursorUpdate calls"];
|
||||
|
||||
[self assert:[[viewA subviews] firstObject] equals:involvedViewForMouseExited message:@"2.2 viewB should receive mouseExited"];
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"2.2 Cursor should be an arrow"];
|
||||
|
||||
// 3. viewA with mouseEntered adding viewB inside it BUT with CPTrackingAssumeInside. Testing if viewB receive only cursorUpdate
|
||||
|
||||
var viewA = [[CPTrackingAreaViewLiveAddition2 alloc] initWithFrame:CGRectMake(20, 20, 40, 40)];
|
||||
|
||||
[[window contentView] setSubviews:[CPArray arrayWithObject:viewA]];
|
||||
|
||||
var options = CPTrackingMouseEnteredAndExited | CPTrackingCursorUpdate | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect,
|
||||
viewATrackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:options owner:viewA userInfo:nil];
|
||||
|
||||
[viewA addTrackingArea:viewATrackingArea];
|
||||
|
||||
// Step 3.1 : enter viewA (then add viewB thus enter also viewB)
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(25, 25) dragging:NO];
|
||||
|
||||
[self assert:1 equals:mouseEnteredCalls message:@"3.1 There should be two mouseEntered calls"];
|
||||
[self assert:0 equals:mouseExitedCalls message:@"3.1 There should be no mouseExited call"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"3.1 There should be no mouseMoved call"];
|
||||
[self assert:2 equals:cursorUpdateCalls message:@"3.1 There should be two cursorUpdate calls"];
|
||||
|
||||
[self assert:viewA equals:involvedViewForMouseEntered message:@"3.1 viewB should receive mouseEntered"];
|
||||
[self assert:[[viewA subviews] firstObject] equals:involvedViewForCursorUpdate message:@"3.1 viewB should receive cursorUpdate"];
|
||||
[self assert:[CPCursor crosshairCursor] equals:[CPCursor currentCursor] message:@"3.1 Final cursor should be crosshair cursor, determined by viewB"];
|
||||
|
||||
// Step 3.2 : exit viewA (thus also viewB)
|
||||
|
||||
[self moveMouseAtPoint:CGPointMake(5, 5) dragging:NO];
|
||||
|
||||
[self assert:0 equals:mouseEnteredCalls message:@"3.2 There should be no mouseEntered calls"];
|
||||
[self assert:2 equals:mouseExitedCalls message:@"3.2 There should be two mouseExited call"];
|
||||
[self assert:0 equals:mouseMovedCalls message:@"3.2 There should be no mouseMoved call"];
|
||||
[self assert:0 equals:cursorUpdateCalls message:@"3.2 There should be no cursorUpdate calls"];
|
||||
|
||||
[self assert:[[viewA subviews] firstObject] equals:involvedViewForMouseExited message:@"3.2 viewB should receive mouseExited"];
|
||||
[self assert:[CPCursor arrowCursor] equals:[CPCursor currentCursor] message:@"3.2 Cursor should be an arrow"];
|
||||
}
|
||||
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
updateTrackingAreasCalls++;
|
||||
}
|
||||
|
||||
- (void)resetCounters
|
||||
{
|
||||
mouseEnteredCalls = 0;
|
||||
mouseExitedCalls = 0;
|
||||
mouseMovedCalls = 0;
|
||||
cursorUpdateCalls = 0;
|
||||
|
||||
involvedViewForMouseEntered = nil;
|
||||
involvedViewForMouseExited = nil;
|
||||
involvedViewForCursorUpdate = nil;
|
||||
}
|
||||
|
||||
- (void)moveMouseAtPoint:(CGPoint)aPoint dragging:(BOOL)dragging
|
||||
{
|
||||
var anEvent = [CPEvent mouseEventWithType:(dragging ? CPLeftMouseDragged : CPMouseMoved)
|
||||
location:aPoint
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:[window windowNumber]
|
||||
context:nil
|
||||
eventNumber:-1
|
||||
clickCount:0
|
||||
pressure:0];
|
||||
|
||||
[self resetCounters];
|
||||
|
||||
[[CPApplication sharedApplication] sendEvent:anEvent];
|
||||
}
|
||||
|
||||
- (void)mouseUpAtPoint:(CGPoint)aPoint
|
||||
{
|
||||
var anEvent = [CPEvent mouseEventWithType:CPLeftMouseUp
|
||||
location:aPoint
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:[window windowNumber]
|
||||
context:nil
|
||||
eventNumber:-1
|
||||
clickCount:0
|
||||
pressure:0];
|
||||
|
||||
[self resetCounters];
|
||||
|
||||
[[CPApplication sharedApplication] sendEvent:anEvent];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPTrackingAreaView : CPView
|
||||
|
||||
- (void)mouseEntered:(CPEvent)anEvent
|
||||
{
|
||||
mouseEnteredCalls++;
|
||||
involvedViewForMouseEntered = [[anEvent trackingArea] view];
|
||||
}
|
||||
|
||||
- (void)mouseExited:(CPEvent)anEvent
|
||||
{
|
||||
mouseExitedCalls++;
|
||||
involvedViewForMouseExited = [[anEvent trackingArea] view];
|
||||
}
|
||||
|
||||
- (void)mouseMoved:(CPEvent)anEvent
|
||||
{
|
||||
mouseMovedCalls++;
|
||||
}
|
||||
|
||||
- (void)cursorUpdate:(CPEvent)anEvent
|
||||
{
|
||||
cursorUpdateCalls++;
|
||||
involvedViewForCursorUpdate = [[anEvent trackingArea] view];
|
||||
}
|
||||
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
updateTrackingAreasCalls++;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPTrackingAreaViewWithCursorUpdate : CPTrackingAreaView
|
||||
|
||||
- (void)cursorUpdate:(CPEvent)anEvent
|
||||
{
|
||||
[[CPCursor crosshairCursor] set];
|
||||
[super cursorUpdate:anEvent];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPTrackingAreaViewWithoutCursorUpdate : CPView
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPTrackingAreaViewLiveRemoval : CPTrackingAreaView
|
||||
|
||||
- (void)cursorUpdate:(CPEvent)anEvent
|
||||
{
|
||||
[[CPCursor pointingHandCursor] set];
|
||||
[super cursorUpdate:anEvent];
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(CPEvent)anEvent
|
||||
{
|
||||
[self removeFromSuperview];
|
||||
[super mouseEntered:anEvent];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPTrackingAreaViewLiveAddition : CPTrackingAreaView
|
||||
|
||||
- (void)cursorUpdate:(CPEvent)anEvent
|
||||
{
|
||||
[[CPCursor pointingHandCursor] set];
|
||||
[super cursorUpdate:anEvent];
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(CPEvent)anEvent
|
||||
{
|
||||
var viewB = [[CPTrackingAreaViewWithCursorUpdate alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
|
||||
|
||||
[self addSubview:viewB];
|
||||
|
||||
[viewB addTrackingArea:[[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:CPTrackingMouseEnteredAndExited | CPTrackingCursorUpdate | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect owner:viewB userInfo:nil]];
|
||||
|
||||
[super mouseEntered:anEvent];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPTrackingAreaViewLiveAddition2 : CPTrackingAreaView
|
||||
|
||||
- (void)cursorUpdate:(CPEvent)anEvent
|
||||
{
|
||||
[[CPCursor pointingHandCursor] set];
|
||||
[super cursorUpdate:anEvent];
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(CPEvent)anEvent
|
||||
{
|
||||
var viewB = [[CPTrackingAreaViewWithCursorUpdate alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
|
||||
|
||||
[self addSubview:viewB];
|
||||
|
||||
[viewB addTrackingArea:[[CPTrackingArea alloc] initWithRect:CGRectMakeZero() options:CPTrackingMouseEnteredAndExited | CPTrackingCursorUpdate | CPTrackingActiveInActiveApp | CPTrackingInVisibleRect | CPTrackingAssumeInside owner:viewB userInfo:nil]];
|
||||
|
||||
[super mouseEntered:anEvent];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPLayoutView : CPView
|
||||
|
||||
@@ -705,6 +705,23 @@
|
||||
[self assert:[1, [CPNull null], "3"] equals:anArray];
|
||||
}
|
||||
|
||||
- (void)testArrayByApplyingBlock
|
||||
{
|
||||
var arr = @[@"a", @"b", @"c", @"d"];
|
||||
|
||||
var mapped = [arr arrayByApplyingBlock:function(obj, idx)
|
||||
{
|
||||
return obj + "_" + idx;
|
||||
}];
|
||||
|
||||
[self assert:[mapped count] equals:[arr count]];
|
||||
|
||||
[arr enumerateObjectsUsingBlock:function(obj, idx, stop)
|
||||
{
|
||||
[self assert:mapped[idx] equals:(obj + "_" + idx)];
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation AlwaysEqual : CPObject
|
||||
|
||||
@@ -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
|
||||
@@ -79,6 +79,17 @@
|
||||
|
||||
var expression_minusset = [CPExpression expressionForMinusSet:set with:array];
|
||||
[self assertNotNull:expression_minusset message:"MinusSet Expression should not be nil"];
|
||||
|
||||
var expression_block = [CPExpression expressionForBlock:function(obj, args, bindings)
|
||||
{
|
||||
return obj;
|
||||
} arguments:nil];
|
||||
|
||||
[self assertNotNull:expression_block message:"Block Expression should not be nil"];
|
||||
|
||||
var expression_conditional = [CPExpression expressionForConditional:[CPPredicate predicateWithValue:YES] trueExpression:expression_minusset falseExpression:expression_block];
|
||||
|
||||
[self assertNotNull:expression_conditional message:"Conditional Expression should not be nil"];
|
||||
}
|
||||
|
||||
- (void)testSetExpressionEvaluation
|
||||
@@ -139,14 +150,35 @@
|
||||
{
|
||||
var collection = [CPExpression expressionForKeyPath:@"Record1.Children"],
|
||||
iteratorVariable = @"x",
|
||||
predicate = [CPPredicate predicateWithFormat:@"$x BEGINSWITH 'Kid'"];
|
||||
predicate = [CPPredicate predicateWithFormat:@"$x BEGINSWITH $KidVariable"];
|
||||
|
||||
var expression = [CPExpression expressionForSubquery:collection usingIteratorVariable:iteratorVariable predicate:predicate],
|
||||
eval = [expression expressionValueWithObject:dict context:nil],
|
||||
eval = [expression expressionValueWithObject:dict context:@{"KidVariable":[CPExpression expressionForConstantValue:"Kid"]}],
|
||||
expected = [CPArray arrayWithObjects:"Kid1", "Kid2"];
|
||||
[self assertTrue:([eval isEqual:expected]) message:"'" + [expression predicateFormat] + "' result is "+ eval + "but should be " + expected];
|
||||
}
|
||||
|
||||
- (void)testBlockExpressionEvaluation
|
||||
{
|
||||
var block = function(obj, args, bindings)
|
||||
{
|
||||
return [obj stringByAppendingString:[args componentsJoinedByString:"-"]];
|
||||
};
|
||||
|
||||
var expression = [CPExpression expressionForBlock:block arguments:[[CPExpression expressionForConstantValue:"A"], [CPExpression expressionForConstantValue:"B"]]];
|
||||
|
||||
var eval = [expression expressionValueWithObject:"OBJ" context:@{}];
|
||||
[self assertTrue:([eval isEqual:"OBJA-B"]) message:"'" + [expression description] + "' result is "+ eval + "but should be " + "OBJA-B"];
|
||||
}
|
||||
|
||||
- (void)testConditionalExpressionEvaluation
|
||||
{
|
||||
var expression = [CPExpression expressionForConditional:[CPPredicate predicateWithFormat:"SELF = $variable"] trueExpression:[CPExpression expressionForConstantValue:"TRUE_EXP"] falseExpression:[CPExpression expressionForConstantValue:"FALSE_EXP"]];
|
||||
|
||||
var eval = [expression expressionValueWithObject:"OBJ" context:@{"variable":"OBJ"}];
|
||||
[self assertTrue:([eval isEqual:"TRUE_EXP"]) message:"'" + [expression description] + "' result is "+ eval + "but should be " + "TRUE_EXP"];
|
||||
}
|
||||
|
||||
- (void)testOptions
|
||||
{
|
||||
var pred = [[CPComparisonPredicate alloc] initWithLeftExpression:[CPExpression expressionForConstantValue:@"àa"] rightExpression:[CPExpression expressionForConstantValue:@"aà"] modifier:CPDirectPredicateModifier type:CPLikePredicateOperatorType options:3];
|
||||
@@ -369,8 +401,8 @@
|
||||
[self assertTrue:[predicate evaluateWithObject:nil] message:"Predicate " + predicate + " should be TRUE"];
|
||||
|
||||
// TEST Subquery -- This means: search people who have 2 boys.
|
||||
predicate = [CPPredicate predicateWithFormat: @"SUBQUERY(Record1.Children, $x, $x BEGINSWITH 'Kid')[SIZE] = 2"];
|
||||
[self assertTrue:[predicate evaluateWithObject:dict] message:"Predicate " + predicate + " should evaluate to TRUE"];
|
||||
predicate = [CPPredicate predicateWithFormat: @"SUBQUERY(Record1.Children, $x, $x BEGINSWITH $Begining)[SIZE] = 2"];
|
||||
[self assertTrue:[predicate evaluateWithObject:dict substitutionVariables:@{"Begining":"Kid"}] message:"Predicate " + predicate + " should evaluate to TRUE"];
|
||||
|
||||
// Test Set expressions
|
||||
// Parsing is ok but the evaluation of this predicate will return NO because:
|
||||
@@ -381,6 +413,9 @@
|
||||
predicate = [CPPredicate predicateWithFormat:@"a UNION {'b'} = {'a','b'}"];
|
||||
var left = [[predicate leftExpression] expressionValueWithObject:object context:nil];
|
||||
[self assertTrue:[left isEqualToSet:result] message:"Expression eval " + left + " should be " + result];
|
||||
|
||||
predicate = [CPPredicate predicateWithFormat:@"TERNARY(Record1.Children[SIZE] = 1, 'Single', Record1.Name) = 'John'"];
|
||||
[self assertTrue:[predicate evaluateWithObject:dict] message:"Predicate " + predicate + " should evaluate to TRUE"];
|
||||
}
|
||||
|
||||
- (void)testExpressionAndPredicateIsEqual
|
||||
@@ -439,6 +474,10 @@
|
||||
pred1 = [CPPredicate predicateWithFormat:@"a = 'a' AND b = 'b'"];
|
||||
pred2 = [CPPredicate predicateWithFormat:@"a = 'a' AND b = 'b'"];
|
||||
[self assert:pred1 equals:pred2];
|
||||
|
||||
pred1 = [CPPredicate predicateWithFormat:@"TERNARY(Record1.Children[FIRST] BEGINSWITH Record1.Name, 'SAME', 'DIFFERENT') = 'DIFFERENT'"];
|
||||
pred2 = [CPPredicate predicateWithFormat:@"TERNARY(Record1.Children[FIRST] BEGINSWITH Record1.Name, 'SAME', 'DIFFERENT') = 'DIFFERENT'"];
|
||||
[self assert:pred1 equals:pred2];
|
||||
}
|
||||
|
||||
- (void)testExpressionAndPredicateIsNotEqualToNil
|
||||
@@ -490,6 +529,10 @@
|
||||
|
||||
[self assert:pred1 notEqual:nil];
|
||||
|
||||
pred1 = [CPPredicate predicateWithFormat:@"TERNARY(Record1.Children[FIRST] BEGINSWITH Record1.Name, 'SAME', 'DIFFERENT') = 'DIFFERENT'"];
|
||||
|
||||
[self assert:pred1 notEqual:nil];
|
||||
|
||||
pred1 = [CPPredicate predicateWithFormat:@"$x CONTAINS 'a'"];
|
||||
|
||||
[self assert:pred1 notEqual:nil];
|
||||
@@ -577,6 +620,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testPredicateFormatWithNullGeneratesCorrectString
|
||||
{
|
||||
var predicate1 = [CPPredicate predicateWithFormat:@"value == %@", [CPNull null]],
|
||||
predicate2 = [CPPredicate predicateWithFormat:@"value == null"],
|
||||
predicate3 = [CPPredicate predicateWithFormat:@"value == nil"];
|
||||
|
||||
[self assert:[predicate1 predicateFormat] equals:@"value == nil"];
|
||||
[self assert:[predicate2 predicateFormat] equals:@"value == nil"];
|
||||
[self assert:[predicate3 predicateFormat] equals:@"value == nil"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPObject (PredicateTesting)
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
[arrayController setContent:items];
|
||||
|
||||
var label = [CPTextField labelWithTitle:@"Press buttons to see [Remove First By Object] fails while [Remove First By Index] succeeds"];
|
||||
[label setFrameOrigin:CGPointMake(20, 20)];
|
||||
[label setFrameOrigin:CGPointMake(20, 20)];
|
||||
[contentView addSubview:label];
|
||||
|
||||
var field = [CPTextField textFieldWithStringValue:@"" placeholder:@"" width:100];
|
||||
@@ -65,7 +65,8 @@
|
||||
|
||||
- (void)removeFirstByIndex:(id)sender
|
||||
{
|
||||
[arrayController removeObjectAtArrangedObjectIndex:0];
|
||||
if ([[arrayController contentArray] count])
|
||||
[arrayController removeObjectAtArrangedObjectIndex:0];
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(CPString)keyPath ofObject:(id)object change:(CPDictionary)change context:(id)context
|
||||
|
||||
@@ -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
|
||||
+3
-5
@@ -2,11 +2,9 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CPApplicationDelegateClass</key>
|
||||
<string>AppController</string>
|
||||
<key>Main cib file base name</key>
|
||||
<string>MainMenu.cib</string>
|
||||
<key>CPBundleName</key>
|
||||
<string>CPViewNoDisplayAfterHidingAndResizeBug</string>
|
||||
<key>CPPrincipalClass</key>
|
||||
<string>CPApplication</string>
|
||||
<string>CPAnimatablePropertyContainerTest</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+18
-17
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* CPViewNoDisplayAfterHidingAndResizeBug
|
||||
* CPAnimatablePropertyContainerTest
|
||||
*
|
||||
* Created by You on February 24, 2013.
|
||||
* Copyright 2013, Your Company All rights reserved.
|
||||
* Created by You on December 3, 2012.
|
||||
* Copyright 2012, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
var ENV = require("system").env,
|
||||
@@ -15,21 +15,22 @@ var ENV = require("system").env,
|
||||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
|
||||
OS = require("os");
|
||||
|
||||
app ("CPViewNoDisplayAfterHidingAndResizeBug", function(task)
|
||||
app ("CPAnimatablePropertyContainerTest", function(task)
|
||||
{
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "CPViewNoDisplayAfterHidingAndResizeBug.build", configuration));
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "CPAnimatablePropertyContainerTest.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("CPViewNoDisplayAfterHidingAndResizeBug");
|
||||
task.setIdentifier("com.yourcompany.CPViewNoDisplayAfterHidingAndResizeBug");
|
||||
task.setProductName("CPAnimatablePropertyContainerTest");
|
||||
task.setIdentifier("com.yourcompany.CPAnimatablePropertyContainerTest");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("CPViewNoDisplayAfterHidingAndResizeBug");
|
||||
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");
|
||||
@@ -37,7 +38,7 @@ app ("CPViewNoDisplayAfterHidingAndResizeBug", function(task)
|
||||
task.setCompilerFlags("-O");
|
||||
});
|
||||
|
||||
task ("default", ["CPViewNoDisplayAfterHidingAndResizeBug"], function()
|
||||
task ("default", ["CPAnimatablePropertyContainerTest"], function()
|
||||
{
|
||||
printResults(configuration);
|
||||
});
|
||||
@@ -58,36 +59,36 @@ task ("release", function()
|
||||
|
||||
task ("run", ["debug"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Debug", "CPViewNoDisplayAfterHidingAndResizeBug", "index.html")]);
|
||||
OS.system(["open", FILE.join("Build", "Debug", "CPAnimatablePropertyContainerTest", "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", "CPViewNoDisplayAfterHidingAndResizeBug", "index.html")]);
|
||||
OS.system(["open", FILE.join("Build", "Release", "CPAnimatablePropertyContainerTest", "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "CPViewNoDisplayAfterHidingAndResizeBug"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "CPViewNoDisplayAfterHidingAndResizeBug"), FILE.join("Build", "Deployment", "CPViewNoDisplayAfterHidingAndResizeBug")]);
|
||||
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", "CPViewNoDisplayAfterHidingAndResizeBug"));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPViewNoDisplayAfterHidingAndResizeBug"), FILE.join("Build", "Desktop", "CPViewNoDisplayAfterHidingAndResizeBug", "CPViewNoDisplayAfterHidingAndResizeBug.app"));
|
||||
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", "CPViewNoDisplayAfterHidingAndResizeBug", "CPViewNoDisplayAfterHidingAndResizeBug.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
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, "CPViewNoDisplayAfterHidingAndResizeBug"));
|
||||
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$U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;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 |
+19
-24
@@ -1,38 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!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
|
||||
CPViewNoDisplayAfterHidingAndResizeBug
|
||||
CPAnimatablePropertyContainerTest
|
||||
|
||||
Created by You on February 24, 2013.
|
||||
Copyright 2013, Your Company All rights reserved.
|
||||
Created by You on December 3, 2012.
|
||||
Copyright 2012, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||
|
||||
<!--[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="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" />
|
||||
|
||||
<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" />
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png">
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png">
|
||||
|
||||
<title>CPViewNoDisplayAfterHidingAndResizeBug</title>
|
||||
<title>CPAnimatablePropertyContainerTest</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
|
||||
</script>
|
||||
|
||||
<script src="Frameworks/Debug/Objective-J/Objective-J.js" type="text/javascript" charset="UTF-8"></script>
|
||||
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
objj_msgSend_reset();
|
||||
@@ -40,7 +35,7 @@
|
||||
// DEBUG OPTIONS:
|
||||
|
||||
// Uncomment to enable printing of backtraces on exceptions:
|
||||
//objj_msgSend_decorate(objj_backtrace_decorator);
|
||||
objj_msgSend_decorate(objj_backtrace_decorator);
|
||||
|
||||
// Uncomment to supress exceptions that take place inside a message
|
||||
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
|
||||
@@ -86,14 +81,14 @@
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading CPViewNoDisplayAfterHidingAndResizeBug...</p></div>");
|
||||
"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-project.org/noscript">Show me how to enable JavaScript</a></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>
|
||||
+16
-22
@@ -1,31 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!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
|
||||
CPViewNoDisplayAfterHidingAndResizeBug
|
||||
CPAnimatablePropertyContainerTest
|
||||
|
||||
Created by You on February 24, 2013.
|
||||
Copyright 2013, Your Company All rights reserved.
|
||||
Created by You on December 3, 2012.
|
||||
Copyright 2012, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||
|
||||
<!--[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="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" />
|
||||
|
||||
<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" />
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png">
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png">
|
||||
|
||||
<title>CPViewNoDisplayAfterHidingAndResizeBug</title>
|
||||
<title>CPAnimatablePropertyContainerTest</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
@@ -56,14 +51,14 @@
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading CPViewNoDisplayAfterHidingAndResizeBug...</p></div>");
|
||||
"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-project.org/noscript">Show me how to enable JavaScript</a></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>
|
||||
@@ -80,4 +75,3 @@
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPViewNoDisplayAfterHidingAndResizeBug
|
||||
* CPAnimatablePropertyContainerTest
|
||||
*
|
||||
* Created by You on February 24, 2013.
|
||||
* Copyright 2013, Your Company All rights reserved.
|
||||
* Created by You on December 3, 2012.
|
||||
* Copyright 2012, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
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;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d;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;C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IDd;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
@@ -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;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;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$UID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IDd;2;97E;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;98E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;3;102E;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;3;106E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;111E;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;3;115E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;3;122E;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;3;126E;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;131E;D;K;6;CP$UIDd;3;132E;D;K;6;CP$UIDd;3;133E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;135E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;137E;D;K;6;CP$UIDd;3;138E;D;K;6;CP$UIDd;3;139E;D;K;6;CP$UIDd;3;140E;D;K;6;CP$UIDd;3;141E;D;K;6;CP$UIDd;3;142E;D;K;6;CP$UIDd;3;143E;D;K;6;CP$UIDd;3;144E;D;K;6;CP$UIDd;3;145E;D;K;6;CP$UIDd;3;146E;D;K;6;CP$UIDd;3;147E;D;K;6;CP$UIDd;3;148E;D;K;6;CP$UIDd;3;149E;D;K;6;CP$UIDd;3;150E;D;K;6;CP$UIDd;3;151E;D;K;6;CP$UIDd;3;152E;D;K;6;CP$UIDd;3;153E;D;K;6;CP$UIDd;3;154E;D;K;6;CP$UIDd;3;155E;D;K;6;CP$UIDd;3;156E;D;K;6;CP$UIDd;3;157E;D;K;6;CP$UIDd;3;158E;D;K;6;CP$UIDd;3;159E;D;K;6;CP$UIDd;3;160E;D;K;6;CP$UIDd;3;161E;D;K;6;CP$UIDd;3;162E;D;K;6;CP$UIDd;3;163E;D;K;6;CP$UIDd;3;164E;D;K;6;CP$UIDd;3;165E;D;K;6;CP$UIDd;3;166E;D;K;6;CP$UIDd;3;167E;D;K;6;CP$UIDd;3;168E;D;K;6;CP$UIDd;3;169E;D;K;6;CP$UIDd;3;170E;D;K;6;CP$UIDd;3;171E;D;K;6;CP$UIDd;3;172E;D;K;6;CP$UIDd;3;173E;D;K;6;CP$UIDd;3;174E;D;K;6;CP$UIDd;3;175E;D;K;6;CP$UIDd;3;176E;D;K;6;CP$UIDd;3;177E;D;K;6;CP$UIDd;3;178E;D;K;6;CP$UIDd;3;179E;D;K;6;CP$UIDd;3;180E;D;K;6;CP$UIDd;3;181E;D;K;6;CP$UIDd;3;182E;D;K;6;CP$UIDd;3;183E;D;K;6;CP$UIDd;3;184E;D;K;6;CP$UIDd;3;185E;D;K;6;CP$UIDd;3;186E;D;K;6;CP$UIDd;3;187E;D;K;6;CP$UIDd;3;188E;D;K;6;CP$UIDd;3;189E;D;K;6;CP$UIDd;3;190E;D;K;6;CP$UIDd;3;191E;D;K;6;CP$UIDd;3;192E;D;K;6;CP$UIDd;3;193E;D;K;6;CP$UIDd;3;194E;D;K;6;CP$UIDd;3;195E;D;K;6;CP$UIDd;3;196E;D;K;6;CP$UIDd;3;197E;D;K;6;CP$UIDd;3;198E;D;K;6;CP$UIDd;3;199E;D;K;6;CP$UIDd;3;200E;D;K;6;CP$UIDd;3;201E;D;K;6;CP$UIDd;3;202E;D;K;6;CP$UIDd;3;203E;D;K;6;CP$UIDd;3;204E;D;K;6;CP$UIDd;3;205E;D;K;6;CP$UIDd;3;206E;D;Line 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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CP$UIDd;3;130E;D;K;6;CP$UIDd;3;131E;D;K;6;CP$UIDd;3;132E;D;K;6;CP$UIDd;3;133E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;135E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;137E;D;K;6;CP$UIDd;3;138E;D;K;6;CP$UIDd;3;139E;D;K;6;CP$UIDd;3;140E;D;K;6;CP$UIDd;3;141E;D;K;6;CP$UIDd;3;142E;D;K;6;CP$UIDd;3;143E;D;K;6;CP$UIDd;3;144E;D;K;6;CP$UIDd;3;145E;D;K;6;CP$UIDd;3;146E;D;K;6;CP$UIDd;3;147E;D;K;6;CP$UIDd;3;148E;D;K;6;CP$UIDd;3;149E;D;K;6;CP$UIDd;3;150E;D;K;6;CP$UIDd;3;151E;D;K;6;CP$UIDd;3;152E;D;K;6;CP$UIDd;3;153E;D;K;6;CP$UIDd;3;154E;D;K;6;CP$UIDd;3;155E;D;K;6;CP$UIDd;3;156E;D;K;6;CP$UIDd;3;157E;D;K;6;CP$UIDd;3;158E;D;K;6;CP$UIDd;3;159E;D;K;6;CP$UIDd;3;160E;D;K;6;CP$UIDd;3;161E;D;K;6;CP$UIDd;3;162E;D;K;6;CP$UIDd;3;163E;D;K;6;CP$UIDd;3;164E;D;K;6;CP$UIDd;3;165E;D;K;6;CP$UIDd;3;166E;D;K;6;CP$UIDd;3;167E;D;K;6;CP$UIDd;3;168E;D;K;6;CP$UIDd;3;169E;D;K;6;CP$UIDd;3;170E;D;K;6;CP$UIDd;3;171E;D;K;6;CP$UIDd;3;172E;D;K;6;CP$UIDd;3;173E;D;K;6;CP$UIDd;3;174E;D;K;6;CP$UIDd;3;175E;D;K;6;CP$UIDd;3;176E;D;K;6;CP$UIDd;3;177E;D;K;6;CP$UIDd;3;178E;D;K;6;CP$UIDd;3;179E;D;K;6;CP$UIDd;3;180E;D;K;6;CP$UIDd;3;181E;D;K;6;CP$UIDd;3;182E;D;K;6;CP$UIDd;3;183E;D;K;6;CP$UIDd;3;184E;D;K;6;CP$UIDd;3;185E;D;K;6;CP$UIDd;3;186E;D;K;6;CP$UIDd;3;187E;D;K;6;CP$UIDd;3;188E;D;K;6;CP$UIDd;3;189E;D;K;6;CP$UIDd;3;190E;D;K;6;CP$UIDd;3;191E;D;K;6;CP$UIDd;3;192E;D;K;6;CP$UIDd;3;193E;D;K;6;CP$UIDd;3;194E;D;K;6;CP$UIDd;3;195E;D;K;6;CP$UIDd;3;196E;D;K;6;CP$UIDd;3;197E;D;K;6;CP$UIDd;3;198E;D;K;6;CP$UIDd;3;199E;D;K;6;CP$UIDd;3;200E;D;K;6;CP$UIDd;3;201E;D;K;6;CP$UIDd;3;202E;D;K;6;CP$UIDd;3;203E;D;K;6;CP$UIDd;3;204E;D;K;6;CP$UIDd;3;205E;D;K;6;CP$UIDd;3;206E;D;K;6;CP$UIDd;3;207E;D;Line truncated
|
||||
@@ -5,7 +5,7 @@
|
||||
@import <AppKit/CPCursor.j>
|
||||
|
||||
@implementation CursorTester : CPView
|
||||
{
|
||||
{
|
||||
CPCursor testCursor;
|
||||
CPTextField label;
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
cursor:(CPCursor)aCursor
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
testCursor = aCursor;
|
||||
@@ -26,7 +27,16 @@
|
||||
anOrigin.y,
|
||||
[label frame].size.width,
|
||||
[label frame].size.height)];
|
||||
|
||||
var trackingArea = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:self
|
||||
userInfo:nil];
|
||||
|
||||
[self addTrackingArea:trackingArea];
|
||||
;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -57,7 +67,7 @@
|
||||
yInc = 25,
|
||||
imageCursorTester = [[CursorTester alloc] initWithText:@"Image cursor"
|
||||
origin:CGPointMake(x, y)
|
||||
cursor:[[CPCursor alloc] initWithImage:[[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] resourcePath] + @"spinner.gif"]
|
||||
cursor:[[CPCursor alloc] initWithImage:[[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] resourcePath] + @"spinner.gif"]
|
||||
hotSpot:CGPointMakeZero()]],
|
||||
arrowCursorTester = [[CursorTester alloc] initWithText:@"Arrow cursor"
|
||||
origin:CGPointMake(x, y+=yInc)
|
||||
@@ -110,7 +120,7 @@
|
||||
disappearingItemCursorTester = [[CursorTester alloc] initWithText:@"Disappearing item cursor"
|
||||
origin:CGPointMake(x, y+=yInc)
|
||||
cursor:[CPCursor disappearingItemCursor]];
|
||||
|
||||
|
||||
[contentView addSubview:imageCursorTester];
|
||||
[contentView addSubview:arrowCursorTester];
|
||||
[contentView addSubview:crosshairCursorTester];
|
||||
|
||||
@@ -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;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;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;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UID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E;D;K;6;CP$UIDd;3;166E;D;K;6;CP$UIDd;3;167E;D;K;6;CP$UIDd;3;168E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;169E;D;K;6;CP$UIDd;3;170E;D;K;6;CP$UIDd;3;171E;D;K;6;CP$UIDd;3;172E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;173E;D;K;6;CP$UIDd;3;174E;D;K;6;CP$UIDd;3;175E;D;K;6;CP$UIDd;3;177E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;178E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;179E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;181E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;182E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;183E;D;K;6;CP$UIDd;3;184E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;185E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;186E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;187E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;188E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;189E;D;K;6;CP$UIDd;3;190E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;191E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;192E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;193E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;194E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;195E;D;K;6;CP$UIDd;1;0E;DLine 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;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;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;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;CP$UIDd;3;190E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;191E;D;K;6;CP$UIDd;3;192E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;193E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;194E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;195E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;196E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;197Line truncated
|
||||
@@ -22,14 +22,14 @@ var randomFromTo = function(from, to)
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
CPWindow theWindow;
|
||||
CPTextField dateField1;
|
||||
CPTextField dateField2;
|
||||
CPTextField error1;
|
||||
CPTextField textField;
|
||||
CPTextField error2;
|
||||
CPTextField recordField;
|
||||
CPPopUpButton recordMenu;
|
||||
@outlet CPWindow theWindow;
|
||||
@outlet CPTextField dateField1;
|
||||
@outlet CPTextField dateField2;
|
||||
@outlet CPTextField error1;
|
||||
@outlet CPTextField textField;
|
||||
@outlet CPTextField error2;
|
||||
@outlet CPTextField recordField;
|
||||
@outlet CPPopUpButton recordMenu;
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
@@ -44,17 +44,15 @@ var randomFromTo = function(from, to)
|
||||
name:CPTextFieldDidFocusNotification
|
||||
object:nil];
|
||||
|
||||
[textField setFormatter:[TextFormatter new]];
|
||||
[textField setDelegate:self];
|
||||
|
||||
[error1 setStringValue:@""];
|
||||
[error2 setStringValue:@""];
|
||||
|
||||
[recordField setFormatter:[ContactFormatter new]];
|
||||
[recordField setObjectValue:RecordData[0]];
|
||||
}
|
||||
|
||||
- (void)selectRecord:(id)sender
|
||||
- (@action)selectRecord:(id)sender
|
||||
{
|
||||
var record = RecordData[[sender selectedIndex]];
|
||||
|
||||
@@ -212,7 +210,7 @@ var randomFromTo = function(from, to)
|
||||
else
|
||||
anObject(aString);
|
||||
|
||||
result = error === nil;
|
||||
var result = error === nil;
|
||||
|
||||
CPLog.info("getObjectValue:forString:%s ==> %s", aString, result);
|
||||
return result;
|
||||
|
||||
@@ -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;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ectK;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;85E;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;86E;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;82E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;46E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;87E;Line 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;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;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;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;40E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;52E;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IDd;2;75E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;52E;D;K;6;CP$UIDd;2;72E;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;88E;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;89E;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;82E;K;29;_CPCibConnectorDeLine truncated
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="14F1509" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="1050" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication"/>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="CPFormatter & Friends" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="371">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<rect key="contentRect" x="121" y="350" width="734" height="348"/>
|
||||
@@ -46,7 +46,8 @@
|
||||
<textField verticalHuggingPriority="750" id="480">
|
||||
<rect key="frame" x="96" y="27" width="200" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="name" id="481">
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="481">
|
||||
<customFormatter key="formatter" id="mId-eu-t7h" customClass="ContactFormatter"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -218,6 +219,7 @@
|
||||
<rect key="frame" x="94" y="92" width="271" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="531">
|
||||
<customFormatter key="formatter" id="UbT-e0-gXJ" customClass="TextFormatter"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -321,14 +323,14 @@
|
||||
</window>
|
||||
<customObject id="466" customClass="AppController">
|
||||
<connections>
|
||||
<outlet property="dateField1" destination="456" id="491"/>
|
||||
<outlet property="dateField2" destination="485" id="492"/>
|
||||
<outlet property="error1" destination="520" id="533"/>
|
||||
<outlet property="error2" destination="527" id="534"/>
|
||||
<outlet property="recordField" destination="480" id="482"/>
|
||||
<outlet property="recordMenu" destination="474" id="483"/>
|
||||
<outlet property="textField" destination="524" id="532"/>
|
||||
<outlet property="theWindow" destination="371" id="467"/>
|
||||
<outlet property="dateField1" destination="456" id="lz4-0g-ydh"/>
|
||||
<outlet property="dateField2" destination="485" id="exe-Oy-ny4"/>
|
||||
<outlet property="error1" destination="520" id="9wr-6U-9gD"/>
|
||||
<outlet property="error2" destination="527" id="QYi-1q-7Tc"/>
|
||||
<outlet property="recordField" destination="480" id="1tr-jw-1bL"/>
|
||||
<outlet property="recordMenu" destination="474" id="Sge-xk-1kD"/>
|
||||
<outlet property="textField" destination="524" id="VhF-pp-Tt0"/>
|
||||
<outlet property="theWindow" destination="371" id="Rqw-wR-J4Q"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
</objects>
|
||||
|
||||
@@ -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,47 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPSplitViewDivider
|
||||
*
|
||||
* Created by You on January 12, 2016.
|
||||
* Copyright 2016, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPSplitView splitView;
|
||||
@outlet CPView viewLeft;
|
||||
@outlet CPView viewRight;
|
||||
@outlet CPWindow theWindow;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
[theWindow setFullPlatformWindow:YES];
|
||||
[viewLeft setBackgroundColor:[CPColor grayColor]];
|
||||
[viewRight setBackgroundColor:[CPColor greenColor]];
|
||||
}
|
||||
|
||||
- (@action)clickChangeButton:(id)aSender
|
||||
{
|
||||
if (![viewRight superview])
|
||||
{
|
||||
console.log(@"Add viewRight in splitView");
|
||||
[splitView addSubview:viewRight];
|
||||
}
|
||||
else
|
||||
{
|
||||
console.error(@"Remove viewRight from splitView");
|
||||
[viewRight 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>CPSplitViewDivider</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,184 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* CPSplitViewDivider
|
||||
*
|
||||
* Created by You on January 12, 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 = "CPSplitViewDivider";
|
||||
|
||||
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", "CPSplitViewDivider.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("CPSplitViewDivider");
|
||||
task.setIdentifier("com.yourcompany.CPSplitViewDivider");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("CPSplitViewDivider");
|
||||
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, "CPSplitViewDivider.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", projectName, "CPSplitViewDivider.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;18E;D;K;6;CP$UIDd;2;19E;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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;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;3;122E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;3;125E;D;K;6;CP$UIDd;3;127E;D;K;6;CP$UIDd;3;129E;D;K;6;CP$UIDd;3;127E;D;K;6;CP$UIDd;3;131E;D;K;6;CP$UIDd;3;131E;D;KLine truncated
|
||||
@@ -0,0 +1,330 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="1050" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
|
||||
</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"/>
|
||||
<menu title="AMainMenu" systemMenu="main" id="29" userLabel="MainMenu">
|
||||
<items>
|
||||
<menuItem title="NewApplication" id="56">
|
||||
<menu key="submenu" title="NewApplication" systemMenu="apple" id="57">
|
||||
<items>
|
||||
<menuItem title="About NewApplication" id="58">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="236">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Preferences…" keyEquivalent="," id="129"/>
|
||||
<menuItem isSeparatorItem="YES" id="143">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Quit NewApplication" keyEquivalent="q" id="136">
|
||||
<connections>
|
||||
<action selector="terminate:" target="-3" id="449"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="83">
|
||||
<menu key="submenu" title="File" id="81">
|
||||
<items>
|
||||
<menuItem title="New" keyEquivalent="n" id="82">
|
||||
<connections>
|
||||
<action selector="newDocument:" target="-1" id="373"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open…" keyEquivalent="o" id="72">
|
||||
<connections>
|
||||
<action selector="openDocument:" target="-1" id="374"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open Recent" id="124">
|
||||
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="125">
|
||||
<items>
|
||||
<menuItem title="Clear Menu" id="126">
|
||||
<connections>
|
||||
<action selector="clearRecentDocuments:" target="-1" id="127"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="79">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Close" keyEquivalent="w" id="73">
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="193"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save" keyEquivalent="s" id="75">
|
||||
<connections>
|
||||
<action selector="saveDocument:" target="-1" id="362"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save As…" keyEquivalent="S" id="80">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="saveDocumentAs:" target="-1" id="363"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Revert to Saved" id="112">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="revertDocumentToSaved:" target="-1" id="364"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="217">
|
||||
<menu key="submenu" title="Edit" id="205">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="207">
|
||||
<connections>
|
||||
<action selector="undo:" target="-1" id="223"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="Z" id="215">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="redo:" target="-1" id="231"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="206">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="199">
|
||||
<connections>
|
||||
<action selector="cut:" target="-1" id="228"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="197">
|
||||
<connections>
|
||||
<action selector="copy:" target="-1" id="224"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="203">
|
||||
<connections>
|
||||
<action selector="paste:" target="-1" id="226"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="202">
|
||||
<connections>
|
||||
<action selector="delete:" target="-1" id="235"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="198">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="-1" id="232"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="214">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Find" id="218">
|
||||
<menu key="submenu" title="Find" id="220">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="209">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="241"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="208"/>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="213">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="221"/>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="210">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="-1" id="245"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Spelling and Grammar" id="216">
|
||||
<menu key="submenu" title="Spelling and Grammar" id="200">
|
||||
<items>
|
||||
<menuItem title="Show Spelling…" keyEquivalent=":" id="204">
|
||||
<connections>
|
||||
<action selector="showGuessPanel:" target="-1" id="230"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Spelling" keyEquivalent=";" id="201">
|
||||
<connections>
|
||||
<action selector="checkSpelling:" target="-1" id="225"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Spelling While Typing" id="219">
|
||||
<connections>
|
||||
<action selector="toggleContinuousSpellChecking:" target="-1" id="222"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Grammar With Spelling" id="346">
|
||||
<connections>
|
||||
<action selector="toggleGrammarChecking:" target="-1" id="347"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Substitutions" id="348">
|
||||
<menu key="submenu" title="Substitutions" id="349">
|
||||
<items>
|
||||
<menuItem title="Smart Copy/Paste" tag="1" keyEquivalent="f" id="350">
|
||||
<connections>
|
||||
<action selector="toggleSmartInsertDelete:" target="-1" id="355"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Quotes" tag="2" keyEquivalent="g" id="351">
|
||||
<connections>
|
||||
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="356"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Links" tag="3" keyEquivalent="G" id="354">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticLinkDetection:" target="-1" id="357"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Speech" id="211">
|
||||
<menu key="submenu" title="Speech" id="212">
|
||||
<items>
|
||||
<menuItem title="Start Speaking" id="196">
|
||||
<connections>
|
||||
<action selector="startSpeaking:" target="-1" id="233"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Stop Speaking" id="195">
|
||||
<connections>
|
||||
<action selector="stopSpeaking:" target="-1" id="227"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="View" id="295">
|
||||
<menu key="submenu" title="View" id="296">
|
||||
<items>
|
||||
<menuItem title="Show Toolbar" keyEquivalent="t" id="297">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleToolbarShown:" target="-1" id="366"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Customize Toolbar…" id="298">
|
||||
<connections>
|
||||
<action selector="runToolbarCustomizationPalette:" target="-1" id="365"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="19">
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="24">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="23">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="-1" id="37"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="239">
|
||||
<connections>
|
||||
<action selector="performZoom:" target="-1" id="240"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="92">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Bring All to Front" id="5">
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="-1" id="39"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="103">
|
||||
<menu key="submenu" title="Help" id="106">
|
||||
<items>
|
||||
<menuItem title="NewApplication Help" keyEquivalent="?" id="111">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="-1" id="360"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<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 verticalHuggingPriority="750" id="Gsx-ft-aJB">
|
||||
<rect key="frame" x="197" y="312" width="87" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Change" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="bOX-1N-8BT">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="clickChangeButton:" target="450" id="sfL-HR-WyX"/>
|
||||
</connections>
|
||||
</button>
|
||||
<splitView arrangesAllSubviews="NO" dividerStyle="thin" vertical="YES" id="B7d-St-3f7">
|
||||
<rect key="frame" x="20" y="20" width="440" height="286"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<customView id="oVe-o3-Uc9">
|
||||
<rect key="frame" x="0.0" y="0.0" width="223" height="286"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</customView>
|
||||
<customView id="NAi-Qy-pcK">
|
||||
<rect key="frame" x="224" y="0.0" width="216" height="286"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</customView>
|
||||
</subviews>
|
||||
<holdingPriorities>
|
||||
<real value="250"/>
|
||||
<real value="250"/>
|
||||
</holdingPriorities>
|
||||
</splitView>
|
||||
</subviews>
|
||||
</view>
|
||||
</window>
|
||||
<customObject id="450" customClass="AppController">
|
||||
<connections>
|
||||
<outlet property="splitView" destination="B7d-St-3f7" id="uwZ-9E-YcO"/>
|
||||
<outlet property="theWindow" destination="371" id="459"/>
|
||||
<outlet property="viewLeft" destination="oVe-o3-Uc9" id="l0w-R6-3PR"/>
|
||||
<outlet property="viewRight" destination="NAi-Qy-pcK" id="zEu-xI-Sbh"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,193 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
CPSplitViewDivider
|
||||
|
||||
Created by You on January 12, 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>CPSplitViewDivider</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
|
||||
CPSplitViewDivider
|
||||
|
||||
Created by You on January 12, 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>CPSplitViewDivider</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
|
||||
* CPSplitViewDivider
|
||||
*
|
||||
* Created by You on January 12, 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);
|
||||
}
|
||||
@@ -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;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;28E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;30E;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;31E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;37E;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;44E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;2;52E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;56E;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;60E;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;1;0E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;68E;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;33E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;2;52E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;65E;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;69E;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;70E;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;66E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;71E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;66E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;68E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;72E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;66E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;37E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;73E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;66E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;33E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;74E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;50E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;52E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;75E;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;20E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;59E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;68E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;76E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;60E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;68E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;77E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;62E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;66E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;78E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;64E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$Line 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;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;28E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;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;32E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;50E;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;57E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2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;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;73E;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;74E;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;70E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;75E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;70E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;72E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;76E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;70E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;55E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;77E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;70E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;34E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;78E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;46E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;48E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;79E;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;20E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;62E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;72E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;80E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;63E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;72E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;81E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;65E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;70E;K;23;_CPCibConnectorLabelKeyD;K;6;CLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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();
|
||||
}
|
||||
}
|
||||
Loaded 100 of 142 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user