Merge remote-tracking branch 'cappuccino/master' into NEW--CPTextView

This commit is contained in:
daboe01 committed 2016-09-03 09:40:49 +02:00
commit 91c52f8ec8
82 files changed
+1726 -5053

No files matched your search

+1
View File
@@ -31,6 +31,7 @@
@import "CPDragServer_Constants.j"
@import "CPPasteboard.j"
@import "CPView.j"
@import "CPKeyValueBinding.j"
@class _CPCollectionViewDropIndicator
+8
View File
@@ -338,6 +338,14 @@ var _CPEventPeriodicEventPeriod = 0,
return _type;
}
/*!
Returns the subtype of the event.
*/
- (CPEventType)subtype
{
return _subtype;
}
/*!
Returns the event's associated window.
*/
+1 -69
View File
@@ -52,8 +52,7 @@ UTF8PboardType = @"public.utf8-plain-text";
CPImagePboardType = @"CPImagePboardType";
var CPPasteboards = nil,
supportsNativePasteboard = NO;
var CPPasteboards = nil;
/*!
@ingroup appkit
@@ -69,8 +68,6 @@ var CPPasteboards = nil,
unsigned _changeCount;
CPString _stateUID;
CPWebScriptObject _nativePasteboard;
}
/*
@@ -84,9 +81,6 @@ var CPPasteboards = nil,
[self setVersion:1.0];
CPPasteboards = @{};
if (typeof window.cpPasteboardWithName !== "undefined")
supportsNativePasteboard = YES;
}
/*!
@@ -129,12 +123,6 @@ var CPPasteboards = nil,
_provided = @{};
_changeCount = 0;
if (supportsNativePasteboard)
{
_nativePasteboard = window.cpPasteboardWithName(aName);
[self _synchronizePasteboard];
}
}
return self;
@@ -164,15 +152,6 @@ var CPPasteboards = nil,
[_owners setObject:anOwner forKey:type];
}
if (_nativePasteboard)
{
var nativeTypes = [types copy];
if ([types containsObject:CPStringPboardType])
nativeTypes.push(UTF8PboardType);
_nativePasteboard.addTypes_(nativeTypes);
}
return ++_changeCount;
}
@@ -183,12 +162,6 @@ var CPPasteboards = nil,
@return the pasteboard's change count
*/
- (unsigned)declareTypes:(CPArray)types owner:(id)anOwner
{
[self _declareTypes:types owner:anOwner updateNativePasteboard:YES];
}
/*! @ignore */
- (unsigned)_declareTypes:(CPArray)types owner:(id)anOwner updateNativePasteboard:(BOOL)shouldUpdate
{
[_types setArray:types];
@@ -202,16 +175,6 @@ var CPPasteboards = nil,
[_owners setObject:anOwner forKey:_types[count]];
}
if (_nativePasteboard && shouldUpdate)
{
var nativeTypes = [types copy];
if ([types containsObject:CPStringPboardType])
nativeTypes.push(UTF8PboardType);
_nativePasteboard.declareTypes_(nativeTypes);
_changeCount = _nativePasteboard.changeCount();
}
return ++_changeCount;
}
@@ -274,7 +237,6 @@ var CPPasteboards = nil,
*/
- (CPArray)types
{
[self _synchronizePasteboard];
return _types;
}
@@ -313,36 +275,6 @@ var CPPasteboards = nil,
return nil;
}
- (void)_synchronizePasteboard
{
if (_nativePasteboard && _nativePasteboard.changeCount() > _changeCount)
{
var nativeTypes = [_nativePasteboard.types() copy];
if ([nativeTypes containsObject:UTF8PboardType])
nativeTypes.push(CPStringPboardType);
[self _declareTypes:nativeTypes owner:self updateNativePasteboard:NO];
_changeCount = _nativePasteboard.changeCount();
}
}
/*! @ignore
method provided for integration with native pasteboard
*/
- (void)pasteboard:(CPPasteboard)aPasteboard provideDataForType:(CPString)aType
{
if (aType === CPStringPboardType)
{
var string = _nativePasteboard.stringForType_(UTF8PboardType);
[self setString:string forType:CPStringPboardType];
[self setString:string forType:UTF8PboardType];
}
else
[self setString:_nativePasteboard.stringForType_(aType) forType:aType];
}
/*!
Returns the property list for the specified data type
@param aType the requested data type
+13 -17
View File
@@ -5097,14 +5097,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
}
}
else if (!_isViewBased && [aView isKindOfClass:[CPControl class]] && ![aView isKindOfClass:[CPTextField class]])
{
[self getColumn:@ref(column) row:@ref(row) forView:aView];
_editingColumn = column;
_editingRow = row;
[aView addObserver:self forKeyPath:@"objectValue" options:CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew context:"editing"];
}
return aView;
}
@@ -5236,7 +5229,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
if (!_isViewBased)
{
[self _setEditingState:NO forView:textField];
[self _commitDataViewObjectValue:textField];
[self _commitDataViewObjectValue:textField forColumn:_editingColumn andRow:_editingRow];
}
else
[textField setBezeled:NO];
@@ -5286,19 +5279,19 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
The action for any dataview that supports editing. This will only be called when the value was changed.
The table view becomes the first responder after user is done editing a dataview.
*/
- (void)_commitDataViewObjectValue:(id)aDataView
- (void)_commitDataViewObjectValue:(id)aDataView forColumn:(CPInteger)column andRow:(CPInteger)row
{
var editingTableColumn = _tableColumns[_editingColumn];
var editingTableColumn = _tableColumns[column];
if (_implementedDataSourceMethods & CPTableViewDataSource_tableView_setObjectValue_forTableColumn_row_)
[_dataSource tableView:self setObjectValue:[aDataView objectValue] forTableColumn:editingTableColumn row:_editingRow];
[_dataSource tableView:self setObjectValue:[aDataView objectValue] forTableColumn:editingTableColumn row:row];
// Allow the column binding to do a reverse set. Note that we do this even if the data source method above
// is implemented.
[editingTableColumn _reverseSetDataView:aDataView forRow:_editingRow];
[editingTableColumn _reverseSetDataView:aDataView forRow:row];
if (_editingRow !== CPNotFound && _editingColumn !== CPNotFound)
[self reloadDataForRowIndexes:[CPIndexSet indexSetWithIndex:_editingRow] columnIndexes:[CPIndexSet indexSetWithIndex:_editingColumn]];
if (row !== CPNotFound && column !== CPNotFound)
[self _reloadDataForRowIndexes:[CPIndexSet indexSetWithIndex:row] columnIndexes:[CPIndexSet indexSetWithIndex:column]];
}
- (void)_setEditingState:(BOOL)editingState forView:(CPView)aView
@@ -5348,9 +5341,12 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
if (context === "editing" && [object superview] === self)
{
[object removeObserver:self forKeyPath:keyPath];
[self _commitDataViewObjectValue:object];
_editingRow = CPNotFound;
_editingColumn = CPNotFound;
var row,
column;
[self getColumn:@ref(column) row:@ref(row) forView:object];
[self _commitDataViewObjectValue:object forColumn:column andRow:row];
}
}
+10 -20
View File
@@ -77,26 +77,16 @@ function CPTextFieldBlurFunction(anEvent, owner, domElement, inputElement, resig
var ownerWindow = [owner window];
if (!resigning && [ownerWindow isKeyWindow])
if (!resigning && [ownerWindow isKeyWindow] && [ownerWindow firstResponder] === owner)
{
/*
Browsers blur text fields when a click occurs anywhere outside the text field. That is normal for browsers, but in Cocoa the key view retains focus unless the click target accepts first responder. So if we lost focus but were not told to resign and our window is still key, restore focus,
but only if the text field is completely within the browser window. If we restore focus when it
is off screen, the entire body scrolls out of our control.
Previously we had code here which would force the input to regain focus if the input lost focus without the CPTextField having actually lost first responder status. This typically happened because the user clicked away from the input in the browser, without clicking on something that could become the first responder. In the browser, clicking outside of an input blurs it, but in Cocoa and Cappuccino it does not (unless you actually click something that will become the first responder).
That refocusing code has now been removed because we simply prevent the default action on clicks in the browser instead, which combined with the fix in 58d5d7d7, successfully prevents unintentional focus loss in (at least) Safari 9.1.1, Chrome 51 and Safari for iOS 9.3 when you click outside of a text field.
Now we can still lose focus unexpectedly: this is when the 'done' button is tapped on the virtual keyboard of a mobile device. In this case we actually do want to resign first responder status, because that is what the done button should do (and if we did not the keyboard would go away and then immediately come back which looks dumb and isn't what the user wanted).
*/
if ([owner _isWithinUsablePlatformRect])
{
[[CPRunLoop mainRunLoop] performBlock:function()
{
// This will prevent to jump to the focused element
var previousScrollingOrigin = [owner _scrollToVisibleRectAndReturnPreviousOrigin];
inputElement.focus();
[owner _restorePreviousScrollingOrigin:previousScrollingOrigin];
}
argument:nil order:0 modes:[CPDefaultRunLoopMode]];
}
[ownerWindow makeFirstResponder:nil];
}
CPTextFieldHandleBlur(anEvent, @ref(owner));
@@ -403,7 +393,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
else
[self unsetThemeState:CPThemeStateEditable];
// We only allow first responder status if the field is enable, and editable or selectable.
// We only allow first responder status if the field is enabled, and editable or selectable.
if (!(shouldBeEditable && ![self isSelectable]) && [[self window] firstResponder] === self)
[[self window] makeFirstResponder:nil];
@@ -845,7 +835,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
[self _resignFirstKeyResponder];
_isEditing = NO;
if ([self isEditable])
{
[self textDidEndEditing:[CPNotification notificationWithName:CPControlTextDidEndEditingNotification object:self userInfo:@{"CPTextMovement": [self _currentTextMovement]}]];
@@ -1997,7 +1987,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
frame.origin = [wind convertBaseToGlobal:frame.origin];
// Here we restore the the previous scrolling posiition
// Here we restore the previous scrolling posiition
[self _restorePreviousScrollingOrigin:previousScrollingOrigin];
return (CGRectGetMinX(frame) >= CGRectGetMinX(usableRect) &&
+90 -41
View File
@@ -112,6 +112,11 @@ CPViewHeightSizable = 16;
*/
CPViewMaxYMargin = 32;
_CPViewWillAppearNotification = @"CPViewWillAppearNotification";
_CPViewDidAppearNotification = @"CPViewDidAppearNotification";
_CPViewWillDisappearNotification = @"CPViewWillDisappearNotification";
_CPViewDidDisappearNotification = @"CPViewDidDisappearNotification";
CPViewBoundsDidChangeNotification = @"CPViewBoundsDidChangeNotification";
CPViewFrameDidChangeNotification = @"CPViewFrameDidChangeNotification";
@@ -172,6 +177,7 @@ var CPViewHighDPIDrawingEnabled = YES;
CPArray _registeredDraggedTypesArray;
BOOL _isHidden;
BOOL _isHiddenOrHasHiddenAncestor;
BOOL _hitTests;
BOOL _clipsToBounds;
@@ -372,6 +378,7 @@ var CPViewHighDPIDrawingEnabled = YES;
_opacity = 1.0;
_isHidden = NO;
_isHiddenOrHasHiddenAncestor = NO;
_hitTests = YES;
_hierarchyScaleSize = CGSizeMake(1.0 , 1.0);
@@ -402,7 +409,6 @@ var CPViewHighDPIDrawingEnabled = YES;
return self;
}
/*!
Sets the tooltip for the receiver.
@@ -597,8 +603,9 @@ var CPViewHighDPIDrawingEnabled = YES;
// Remove the view from its previous superview.
[aSubview _removeFromSuperview];
[aSubview _postViewWillAppearNotification];
// Set ourselves as the superview.
aSubview._superview = self;
[aSubview _setSuperview:self];
}
if (anIndex === CPNotFound || anIndex >= count)
@@ -623,11 +630,6 @@ var CPViewHighDPIDrawingEnabled = YES;
[aSubview setNextResponder:self];
[aSubview _scaleSizeUnitSquareToSize:[self _hierarchyScaleSize]];
// If the subview is not hidden and one of its ancestors is hidden,
// notify the subview that it is now hidden.
if (![aSubview isHidden] && [self isHiddenOrHasHiddenAncestor])
[aSubview _notifyViewDidHide];
[aSubview viewDidMoveToSuperview];
// Set the subview's window to our own.
@@ -688,6 +690,7 @@ var CPViewHighDPIDrawingEnabled = YES;
[[self window] _dirtyKeyViewLoop];
[_superview willRemoveSubview:self];
[self _postViewWillDisappearNotification];
[_superview._subviews removeObjectIdenticalTo:self];
@@ -697,13 +700,10 @@ var CPViewHighDPIDrawingEnabled = YES;
// If the view is not hidden and one of its ancestors is hidden,
// notify the view that it is now unhidden.
if (!_isHidden && [_superview isHiddenOrHasHiddenAncestor])
[self _notifyViewDidUnhide];
[self _setSuperview:nil];
[self _notifyWindowDidResignKey];
[self _notifyViewDidResignFirstResponder];
_superview = nil;
}
/*!
@@ -1599,10 +1599,8 @@ var CPViewHighDPIDrawingEnabled = YES;
// FIXME: Should we return to visibility? This breaks in FireFox, Opera, and IE.
// _DOMElement.style.visibility = (_isHidden = aFlag) ? "hidden" : "visible";
_isHidden = aFlag;
#if PLATFORM(DOM)
_DOMElement.style.display = _isHidden ? "none" : "block";
_DOMElement.style.display = aFlag ? "none" : "block";
#endif
if (aFlag)
@@ -1622,33 +1620,89 @@ var CPViewHighDPIDrawingEnabled = YES;
while (view = [view superview]);
}
[self _notifyViewDidHide];
[self _postViewWillDisappearNotification];
[self _recursiveGainedHiddenAncestor];
}
else
{
[self setNeedsDisplay:YES];
[self _notifyViewDidUnhide];
[self _postViewWillAppearNotification];
[self _recursiveLostHiddenAncestor];
}
_isHidden = aFlag;
}
- (void)_notifyViewDidHide
- (void)_postViewWillAppearNotification
{
[self viewDidHide];
var count = [_subviews count];
while (count--)
[_subviews[count] _notifyViewDidHide];
[[CPNotificationCenter defaultCenter] postNotificationName:_CPViewWillAppearNotification object:self userInfo:nil];
}
- (void)_notifyViewDidUnhide
- (void)_postViewDidAppearNotification
{
[self viewDidUnhide];
[[CPNotificationCenter defaultCenter] postNotificationName:_CPViewDidAppearNotification object:self userInfo:nil];
}
var count = [_subviews count];
- (void)_postViewWillDisappearNotification
{
[[CPNotificationCenter defaultCenter] postNotificationName:_CPViewWillDisappearNotification object:self userInfo:nil];
}
while (count--)
[_subviews[count] _notifyViewDidUnhide];
- (void)_postViewDidDisappearNotification
{
[[CPNotificationCenter defaultCenter] postNotificationName:_CPViewDidDisappearNotification object:self userInfo:nil];
}
- (void)_setSuperview:(CPView)aSuperview
{
var hasOldSuperview = (_superview !== nil),
hasNewSuperview = (aSuperview !== nil),
oldSuperviewIsHidden = hasOldSuperview && [_superview isHiddenOrHasHiddenAncestor],
newSuperviewIsHidden = hasNewSuperview && [aSuperview isHiddenOrHasHiddenAncestor];
if (!newSuperviewIsHidden && oldSuperviewIsHidden)
[self _recursiveLostHiddenAncestor];
if (newSuperviewIsHidden && !oldSuperviewIsHidden)
[self _recursiveGainedHiddenAncestor];
_superview = aSuperview;
if (hasOldSuperview)
[self _postViewDidDisappearNotification];
if (hasNewSuperview)
[self _postViewDidAppearNotification];
}
- (void)_recursiveLostHiddenAncestor
{
if (_isHiddenOrHasHiddenAncestor)
{
_isHiddenOrHasHiddenAncestor = NO;
[self viewDidUnhide];
}
[_subviews enumerateObjectsUsingBlock:function(view, idx, stop)
{
[view _recursiveLostHiddenAncestor];
}];
}
- (void)_recursiveGainedHiddenAncestor
{
if (!_isHidden)
{
[self viewDidHide];
}
_isHiddenOrHasHiddenAncestor = YES;
[_subviews enumerateObjectsUsingBlock:function(view, idx, stop)
{
[view _recursiveGainedHiddenAncestor];
}];
}
/*!
@@ -1718,12 +1772,7 @@ var CPViewHighDPIDrawingEnabled = YES;
*/
- (BOOL)isHiddenOrHasHiddenAncestor
{
var view = self;
while (view && ![view isHidden])
view = [view superview];
return view !== nil;
return _isHiddenOrHasHiddenAncestor;
}
/*!
@@ -3494,14 +3543,14 @@ setBoundsOrigin:
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.
@@ -3513,16 +3562,16 @@ setBoundsOrigin:
/*!
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
{
@@ -3652,7 +3701,6 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
_window = [aCoder decodeObjectForKey:CPViewWindowKey];
_superview = [aCoder decodeObjectForKey:CPViewSuperviewKey];
// We have to manually add the subviews so that they will receive
// viewWillMoveToSuperview: and viewDidMoveToSuperview:
_subviews = [];
@@ -3707,6 +3755,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
#endif
[self setHidden:[aCoder decodeBoolForKey:CPViewIsHiddenKey]];
_isHiddenOrHasHiddenAncestor = NO;
if ([aCoder containsValueForKey:CPViewOpacityKey])
[self setAlphaValue:[aCoder decodeIntForKey:CPViewOpacityKey]];
+110 -7
View File
@@ -178,10 +178,10 @@ var CPViewControllerCachedCibs;
}
/*!
Loads asynchronously the cib and creates the view that the controller manages.
Asynchronously load the cib and create 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).
@param aHandler a function which will be passed 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.
@@ -213,7 +213,7 @@ var CPViewControllerCachedCibs;
if (anError == nil)
{
var data = [CPData dataWithRawString:aData],
aCib = [[CPCib alloc] _initWithData:data bundle:_cibBundle cibName:_cibName];
aCib = [[CPCib alloc] _initWithData:data bundle:_cibBundle cibName:_cibName];
[CPViewControllerCachedCibs setObject:aCib forKey:_cibName];
[aCib instantiateCibWithExternalNameTable:_cibExternalNameTable];
@@ -286,13 +286,16 @@ var CPViewControllerCachedCibs;
- (void)_viewDidLoad
{
[self _viewDidLoadWithCompletionHandler:function() {
[self viewDidLoad];
}];
[self willChangeValueForKey:"isViewLoaded"];
[self viewDidLoad];
_isViewLoaded = YES;
[self didChangeValueForKey:"isViewLoaded"];
}
- (void)_viewDidLoadWithCompletionHandler:(Function)aHandler
{
[self _registerOrUnregister:YES notificationsForView:_view];
[self willChangeValueForKey:"isViewLoaded"];
aHandler(_view, nil);
_isViewLoaded = YES;
@@ -312,6 +315,79 @@ var CPViewControllerCachedCibs;
}
/*!
Called after the view controller’s view has been loaded into memory is about to be added to the
view hierarchy in the window.
@discussion You can override this method to perform tasks prior to a view controller’s view
getting added to view hierarchy, such as setting the view’s highlight color. This method is called when:
• The view is about to be added to the view hierarchy of the view controller
If you override this method, call this method on super at some point in your implementation in case
a superclass also overrides this method.
The default implementation of this method does nothing.
*/
- (void)viewWillAppear
{
}
/*!
Called when the view controller’s view is fully transitioned onto the screen.
@discussion This method is called after the completion of any drawing and animations
involved in the initial appearance of the view. You can override this method to
perform tasks appropriate for that time, such as work that should not interfere
with the presentation animation, or starting an animation that you want to begin
after the view appears.
If you override this method, call this method on super at some point in your
implementation in case a superclass also overrides this method.
The default implementation of this method does nothing.
*/
- (void)viewDidAppear
{
}
/*!
Called when the view controller’s view is about to be removed from the view hierarchy in the window.
@discussion You can override this method to perform tasks that are to precede the disappearance
of the view controller’s view, such as stopping a continuous animation that you
started in response to the viewDidAppear method call. This method is called when:
• The view is about to be removed from the view hierarchy of the window
If you override this method, call this method on super at some point in your
implementation in case a superclass also overrides this method.
The default implementation of this method does nothing.
*/
- (void)viewWillDisappear
{
}
/*!
Called after the view controller’s view is removed from the view hierarchy in a window.
@discussion You can override this method to perform tasks associated with removing the view
controller’s view from the window’s view hierarchy, such as releasing resources
not needed when the view is not visible or no longer part of the window.
If you override this method, call this method on super at some point in your
implementation in case a superclass also overrides this method.
The default implementation of this method does nothing.
*/
- (void)viewDidDisappear
{
}
/*!
Manually sets the view that the controller manages.
@@ -325,6 +401,9 @@ var CPViewControllerCachedCibs;
{
var willChangeIsViewLoaded = (_isViewLoaded == NO && aView != nil) || (_isViewLoaded == YES && aView == nil);
[self _registerOrUnregister:NO notificationsForView:_view];
[self _registerOrUnregister:YES notificationsForView:aView];
if (willChangeIsViewLoaded)
[self willChangeValueForKey:"isViewLoaded"];
@@ -340,6 +419,30 @@ var CPViewControllerCachedCibs;
return NO;
}
- (void)_registerOrUnregister:(BOOL)shouldRegister notificationsForView:(CPView)aView
{
if (aView === nil)
return;
var center = [CPNotificationCenter defaultCenter],
notifs_to_sel = @{_CPViewWillAppearNotification : @"viewWillAppear",
_CPViewDidAppearNotification : @"viewDidAppear",
_CPViewWillDisappearNotification : @"viewWillDisappear",
_CPViewDidDisappearNotification : @"viewDidDisappear"};
[notifs_to_sel enumerateKeysAndObjectsUsingBlock:function(notif, selString, stop)
{
var selector = CPSelectorFromString(selString);
if ([self implementsSelector:selector])
{
if (shouldRegister)
[center addObserver:self selector:selector name:notif object:aView];
else
[center removeObserver:self name:notif object:aView];
}
}];
}
@end
+3 -5
View File
@@ -308,7 +308,7 @@ CPTexturedBackgroundWindowMask
[self setPlatformWindow:[CPPlatformWindow primaryPlatformWindow]];
else
{
// give zero sized borderless bridge windows a default size if we're not in the browser so they show up in NativeHost.
// give zero sized borderless bridge windows a default size.
if ((aStyleMask & CPBorderlessBridgeWindowMask) && aContentRect.size.width === 0 && aContentRect.size.height === 0)
{
var visibleFrame = [[[CPScreen alloc] init] visibleFrame];
@@ -655,7 +655,6 @@ CPTexturedBackgroundWindowMask
CPBorderlessWindowMask
CPTitledWindowMask
CPClosableWindowMask
CPMiniaturizableWindowMask (NOTE: only available in NativeHost)
CPResizableWindowMask
CPTexturedBackgroundWindowMask
CPBorderlessBridgeWindowMask
@@ -4202,12 +4201,11 @@ var interpolate = function(fromValue, toValue, progress)
{
// This will put a tracking event in the _queuedTrackingEvents queue.
//
// We optimize this queue with this policy :
// 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.
// This is not the Cocoa way of doing as it would send every event, but the final result should be the same.
var eventType = [anEvent type],
trackingArea = [anEvent trackingArea];
+1
View File
@@ -24,6 +24,7 @@
@import "CPCompatibility.j"
@import "CGGeometry.j"
@import "CGPath.j"
@import "CGContextText.j"
@typedef CGContext
+86
View File
@@ -0,0 +1,86 @@
/*
* CGContextText.j
* CoreText
*
* Created by Nicholas Small.
* Copyright 2011, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
kCGTextFill = 0;
kCGTextStroke = 1;
kCGTextFillStroke = 2;
kCGTextInvisible = 3;
function CGContextGetTextMatrix(/* CGContext */ aContext)
{
return aContext._textMatrix;
}
function CGContextSetTextMatrix(/* CGContext */ aContext, /* CGAffineTransform */ aTransform)
{
aContext._textMatrix = aTransform;
}
function CGContextGetTextPosition(/* CGContext */ aContext)
{
return aContext._textPosition || _CGPointMakeZero();
}
function CGContextSetTextPosition(/* CGContext */ aContext, /* float */ x, /* float */ y)
{
aContext._textPosition = CGPointMake(x, y);
}
function CGContextGetFont(/* CGContext */ aContext)
{
return aContext._CPFont;
}
function CGContextSelectFont(/* CGContext */ aContext, /* CPFont */ aFont)
{
aContext.font = [aFont cssString];
aContext._CPFont = aFont;
}
function CGContextSetTextDrawingMode(/* CGContext */ aContext, /* CGTextDrawingMode */ aMode)
{
aContext._textDrawingMode = aMode;
}
function CGContextShowText(/* CGContext */ aContext, /* CPString */ aString)
{
CGContextShowTextAtPoint(aContext, aContext._textPosition.x, aContext._textPosition.y, aString);
}
function CGContextShowTextAtPoint(/* CGContext */ aContext, /* float */ x, /* float */ y, /* CPString */ aString)
{
aContext.textBaseline = @"middle";
aContext.textAlign = @"left";
var mode = aContext._textDrawingMode;
if (!mode && mode !== 0)
mode = kCGTextFill;
var width = aContext.measureText(aString).width;
if (mode === kCGTextFill || mode === kCGTextFillStroke)
aContext.fillText(aString, x, y);
if (mode === kCGTextStroke || mode === kCGTextFillStroke)
aContext.strokeText(aString, x, y);
aContext._textPosition = CGPointMake(x + width, y);
}
+10 -6
View File
@@ -952,8 +952,8 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
timestamp:timestamp windowNumber:windowNumber context:nil eventNumber:-1 clickCount:1 pressure:0];
event._DOMEvent = aDOMEvent;
// We lag 1 event behind without this timeout.
setTimeout(function()
// We lag 1 event behind without this approach
window.requestAnimationFrame(function()
{
if (aDOMEvent.deltaMode !== undefined && aDOMEvent.deltaMode !== 0)
{
@@ -992,10 +992,10 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
_DOMScrollingElement.scrollLeft = 150;
_DOMScrollingElement.scrollTop = 150;
// Is this needed?
//[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
// this is needed to prevent flickering during scrolling
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}, 0);
});
// We hide the dom element after a little bit
// so that other DOM elements such as inputs
@@ -1171,7 +1171,11 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
var touch = aDOMEvent.touches.length ? aDOMEvent.touches[0] : aDOMEvent.changedTouches[0];
newEvent.clientX = touch.clientX;
newEvent.clientY = touch.clientY;
/*
Normally the document can't scroll in Cappuccino: our body element has top:0 and bottom:0 with absolute positioning. So it should always be exactly the height of the viewport. The below handles a special case. iOS scrolls the document when the virtual keyboard is present and it needs to move a text input upwards visually to avoid covering the input with the keyboard. For most purposes we can ignore this, except here. In theory I think we could always apply this (scrollTop should always be 0 on every other device and situation) but let's be defensive and only apply it for touch events to minimise the risk of surprises.
*/
newEvent.clientY = _DOMWindow.document.body.scrollTop + touch.clientY;
newEvent.timestamp = [CPEvent currentTimestamp];
newEvent.target = aDOMEvent.target;
+4 -2
View File
@@ -550,14 +550,16 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
case CPLineBreakByCharWrapping:
case CPLineBreakByWordWrapping:
textStyle.wordWrap = "break-word";
try {
try
{
textStyle.whiteSpace = "pre";
textStyle.whiteSpace = "-o-pre-wrap";
textStyle.whiteSpace = "-pre-wrap";
textStyle.whiteSpace = "-moz-pre-wrap";
textStyle.whiteSpace = "pre-wrap";
}
catch (e) {
catch (e)
{
//internet explorer doesn't like these properties
textStyle.whiteSpace = "pre";
}
-70
View File
@@ -1,70 +0,0 @@
var FILE = require("file");
var OS = require("os");
var NATIVEHOST_SOURCE = FILE.path(module.path).dirname().dirname().dirname().join("support", "NativeHost.app");
exports.buildNativeHost = function(rootPath, buildNative, options) {
options = options || {};
options.index = options.index || "index.html";
rootPath = FILE.path(rootPath);
buildNative = FILE.path(buildNative);
if (buildNative.exists())
buildNative.rmtree();
buildNative.dirname().mkdirs();
// FIXME: Narwhal doesn't preserve permissions
// FILE.copyTree(NATIVEHOST_SOURCE, buildNative);
OS.system(["cp", "-r", NATIVEHOST_SOURCE, buildNative]);
FILE.chmod(buildNative.join("Contents", "MacOS", "NativeHost"), 0755);
var rootBaseName = rootPath.basename();
var buildClientDirectory = buildNative.join("Contents", "Resources", rootBaseName);
FILE.mkdirs(FILE.dirname(buildClientDirectory));
// FILE.copyTree(rootPath, buildClientDirectory);
OS.system(["cp", "-r", rootPath, buildClientDirectory]);
var defaultBundleName = buildNative.basename().match(/^(.*)(\.app)?$/)[1];
function mergePlist(plist, path) {
var otherPlist = CFPropertyList.readPropertyListFromFile(String(path));
otherPlist.keys().forEach(function(key) {
var value = otherPlist.valueForKey(key);
plist.setValueForKey(key, value);
if (key === "CPBundleName")
plist.setValueForKey("CFBundleName", value);
if (key === "CFBundleIconFile") {
var iconPath = rootPath.join("Resources", value);
if (iconPath.isFile())
iconPath.copy(buildNative.join("Contents", "Resources", value));
else
print("Warning: CFBundleIconFile references " + value + " but does not exist in the resources directory.");
}
if (key === "CFBundleExecutable") {
buildNative.join("Contents", "MacOS", "NativeHost").rename(value);
// FIXME:
FILE.chmod(buildNative.join("Contents", "MacOS", value), 0755);
}
});
}
CFPropertyList.modifyPlist(buildNative.join("Contents", "Info.plist"), function(plist) {
plist.setValueForKey("CFBundleName", defaultBundleName);
plist.setValueForKey("NHInitialResource", FILE.join(rootBaseName, options.index));
// merge Cappuccino plist
var cappPlistPath = rootPath.join("Info.plist");
if (cappPlistPath.isFile())
mergePlist(plist, cappPlistPath);
if (options.extraPlistPath)
mergePlist(plist, options.extraPlistPath);
});
}
+5 -2
View File
@@ -19,8 +19,11 @@ For more information, see <http://cappuccino-project.org>. Follow [@cappuccino](
System Requirements
-------------------
To run Cappuccino applications, all you need is a web browser that understands
JavaScript.
To run Cappuccino applications, all you need is a HTML5 compliant web browser.
To develop Cappuccino applications, all you need is a simple text editor and the starter package.
However, Cappuccino's build system and the Xcode integration bring the eases of Cocoa development to web development.
To build Cappuccino itself, please read below. More information is available
here: [Getting and Building the Source](http://wiki.github.com/cappuccino/cappuccino/getting-and-building-the-source>).
-13
View File
@@ -1,13 +0,0 @@
#!/usr/bin/env ruby
puts <<-eos
Building with rake is no longer supported, use "jake" instead.
The commands are all the same (e.g. rake install -> jake install).
If you do not have jake, you can run sudo ./bootstrap.sh to install jake and it's dependencies.
PLEASE remove your Build folder ($CAPP_BUILD if it's set) when switching from rake to jake.
eos
exit(1);
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Main cib file base name</key>
<string>MainMenu.cib</string>
<key>CPBundleName</key>
<string>BundleTest</string>
</dict>
</plist>
@@ -0,0 +1 @@
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;18E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;19E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;20E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;18E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;21E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;22E;E;D;K;10;$classnameS;18;_CPCibClassSwapperK;8;$classesA;S;18;_CPCibClassSwapperS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;23E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;24E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;24E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;2;25E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;26E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;2;27E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;2;27E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;2;28E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;22;CPViewTrackingAreasKeyD;K;6;CP$UIDd;2;29E;K;30;_CPCibClassSwapperClassNameKeyD;K;6;CP$UIDd;2;30E;K;38;_CPCibClassSwapperOriginalClassNameKeyD;K;6;CP$UIDd;2;31E;E;S;16;CPViewControllerD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;4;viewS;13;CPApplicationd;1;0S;20;{{0, 0}, {480, 272}}d;2;12S;6;normalS;6;{1, 1}F;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;6;NSViewS;6;CPViewE;K;9;$archiverS;15;CPKeyedArchiverK;8;$versionS;6;100000E;
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="CPViewController">
<connections>
<outlet property="view" destination="c22-O7-iKe" id="ABk-lK-Kp8"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="c22-O7-iKe">
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
</objects>
</document>
+89
View File
@@ -0,0 +1,89 @@
@import <AppKit/CPViewController.j>
@import <AppKit/CPApplication.j>
var methodsCalled;
@implementation CPViewControllerTest : OJTestCase
{
CPBundle bundle;
}
- (void)setUp
{
bundle = [CPBundle bundleWithPath:@"Tests/AppKit/BundleTest"];
[bundle loadWithDelegate:self];
}
- (void)bundleDidFinishLoading:(CPBundle)aBundle
{
}
- (void)testViewControllerCallbacks
{
methodsCalled = @[];
var expectedResult = @[@"viewDidLoad",
@"viewWillAppear",
@"viewDidAppear",
@"viewWillDisappear",
@"viewDidDisappear"];
[self assertTrue:[bundle isLoaded]];
var viewController = [[ViewController alloc] initWithCibName:@"NSViewController.cib" bundle:bundle];
[self assertNotNull:viewController];
var superview = [[CPView alloc] initWithFrame:CGRectMakeZero()];
var view = [viewController view];
[superview addSubview:view];
[view removeFromSuperview];
[self assert:expectedResult equals:methodsCalled];
// Explicitely change the view.
methodsCalled = [];
expectedResult = @[@"viewWillAppear",
@"viewDidAppear",
@"viewWillDisappear",
@"viewDidDisappear"];
var newView = [[CPView alloc] initWithFrame:CGRectMake(0,0,100,100)];
[viewController setView:newView];
[superview addSubview:newView];
[newView removeFromSuperview];
// Checks that with receive notifs from the new view and not from the old view.
[self assert:expectedResult equals:methodsCalled];
}
@end
@implementation ViewController : CPViewController
{
}
- (void)viewDidLoad
{
[methodsCalled addObject:_cmd];
}
- (void)viewDidAppear
{
[methodsCalled addObject:_cmd];
}
- (void)viewWillAppear
{
[methodsCalled addObject:_cmd];
}
- (void)viewDidDisappear
{
[methodsCalled addObject:_cmd];
}
- (void)viewWillDisappear
{
[methodsCalled addObject:_cmd];
}
@end
+154 -28
View File
@@ -895,70 +895,184 @@ var updateTrackingAreasCalls,
[self assert:nil equals:[view effectiveAppearance]];
}
- (void)testViewDidHideDidUnhide
{
var expectedResult = [@"viewDidHide_view1", @"viewDidUnhide_view1"];
[view1 setHidden:YES];
[view1 setHidden:NO];
[self assert:expectedResult equals:methodCalled];
}
- (void)testAddViewRemoveView
{
var expectedResult = [@"viewWillMoveToSuperview_view2",
@"viewDidMoveToSuperview_view2",
@"viewWillMoveToSuperview_view2",
@"viewDidMoveToSuperview_view2",
@"viewWillMoveToWindow_view2",
@"viewDidMoveToWindow_view2"];
[view1 addSubview:view2];
[view2 removeFromSuperview];
[self assert:expectedResult equals:methodCalled];
}
- (void)testViewGainedHiddenAncestor
{
var expectedResult = [@"viewDidHide_view1",
@"viewWillMoveToSuperview_view3",
@"viewDidMoveToSuperview_view3",
@"viewWillMoveToSuperview_view2",
@"viewDidHide_view2",
@"viewDidHide_view3",
@"viewDidMoveToSuperview_view2"];
[view1 setHidden:YES];
[view2 addSubview:view3];
CPLog.warn("will add view2");
[view1 addSubview:view2];
[self assertTrue: [view2 isHiddenOrHasHiddenAncestor] message:@"Expected " + [view2 identifier] + "isHiddenOrHasHiddenAncestor = YES"];
[self assertTrue: [view3 isHiddenOrHasHiddenAncestor] message:@"Expected isHiddenOrHasHiddenAncestor = YES"];
[self assertFalse:[view2 isHidden]];
[self assertFalse:[view3 isHidden]];
[self assert:expectedResult equals:methodCalled];
}
- (void)testRemoveViewsHiddenByAncestor
{
var expectedResult = @[
@"viewWillMoveToSuperview_view2",
@"viewDidUnhide_view2",
@"viewDidUnhide_view3",
@"viewDidMoveToSuperview_view2",
@"viewWillMoveToWindow_view2",
@"viewWillMoveToWindow_view3",
@"viewDidMoveToWindow_view3",
@"viewDidMoveToWindow_view2"
];
[view1 setHidden:YES];
[view1 addSubview:view2];
[view2 addSubview:view3];
[self assertTrue: [view2 isHiddenOrHasHiddenAncestor] message:@"Expected isHiddenOrHasHiddenAncestor = YES" ];
[self assertFalse:[view2 isHidden]];
[self assertTrue: [view3 isHiddenOrHasHiddenAncestor] message:@"Expected isHiddenOrHasHiddenAncestor = YES" ];
[self assertFalse:[view3 isHidden]];
methodCalled = [];
[view2 removeFromSuperview];
[self assertFalse: [view2 isHiddenOrHasHiddenAncestor] message:@"Expected isHiddenOrHasHiddenAncestor = NO" ];
[self assertFalse: [view3 isHiddenOrHasHiddenAncestor] message:@"Expected isHiddenOrHasHiddenAncestor = NO" ];
[self assert:expectedResult equals:methodCalled];
}
- (void)testRemoveHiddenView
{
var expectedResult = [@"viewWillMoveToSuperview_view2", @"viewDidMoveToSuperview_view2", @"viewWillMoveToWindow_view2", @"viewDidMoveToWindow_view2"];
[view1 addSubview:view2];
[view2 setHidden:YES];
methodCalled = [];
[view2 removeFromSuperview];
[self assertTrue: [view2 isHiddenOrHasHiddenAncestor] message:@"Expected isHiddenOrHasHiddenAncestor = YES" ];
[self assert:expectedResult equals:methodCalled];
}
- (void)testLostHiddenAncestorAfterMovingToNewSuperview
{
var expectedResult = @[
@"viewWillMoveToSuperview_view2",
@"viewDidMoveToSuperview_view2",
@"viewDidHide_view1",
@"viewDidHide_view2",
@"viewWillMoveToSuperview_view2",
@"viewDidUnhide_view2",
@"viewDidMoveToSuperview_view2"
];
[view1 addSubview:view2];
[view1 setHidden:YES];
[view3 addSubview:view2];
[self assert:expectedResult equals:methodCalled];
}
// 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;
@@ -966,17 +1080,17 @@ var updateTrackingAreasCalls,
[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"];
@@ -1048,7 +1162,7 @@ var updateTrackingAreasCalls,
[viewTA removeAllTrackingAreas];
[viewTA addTrackingArea:trackingAreaAllWithDrag];
// Mouse enters the tracking area while dragging (option set)
[self moveMouseAtPoint:CGPointMake(21, 21) dragging:YES];
@@ -1103,7 +1217,7 @@ var updateTrackingAreasCalls,
[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];
@@ -1112,7 +1226,7 @@ var updateTrackingAreasCalls,
[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];
@@ -1121,7 +1235,7 @@ var updateTrackingAreasCalls,
[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"];
@@ -1278,7 +1392,7 @@ var updateTrackingAreasCalls,
[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];
@@ -1292,7 +1406,7 @@ var updateTrackingAreasCalls,
[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];
@@ -1310,7 +1424,7 @@ var updateTrackingAreasCalls,
[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];
@@ -1355,14 +1469,14 @@ var updateTrackingAreasCalls,
[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)]
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]];
@@ -1691,6 +1805,18 @@ var updateTrackingAreasCalls,
[methodCalled addObject:string];
}
- (void)viewDidUnhide
{
var string = _cmd + @"_" + [self identifier];
[methodCalled addObject:string];
}
- (void)viewDidHide
{
var string = _cmd + @"_" + [self identifier];
[methodCalled addObject:string];
}
- (BOOL)acceptsFirstResponder
{
return YES;
+5 -1
View File
@@ -50,6 +50,10 @@
var innerRect = CGRectInset(aRect, CGRectGetWidth(aRect)/2 - 10, CGRectGetHeight(aRect)/2 - 10);
CGContextStrokeRectWithWidth(context, innerRect, 4);
CGContextSetTextPosition(context, innerRect.origin.x + 10, innerRect.origin.x + 10);
CGContextSetFillColor(context, [CPColor blueColor]);
CGContextShowText(context, 'Hello World Canvas!');
[self unlockFocus];
}
@@ -67,7 +71,7 @@
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
[label setStringValue:@"Hello World!"];
[label setStringValue:@"Do you see the Hello World Canvas?"];
[label setFont:[CPFont boldSystemFontOfSize:24.0]];
[label sizeToFit];
+61
View File
@@ -0,0 +1,61 @@
/*
* AppController.j
* MobileTest
*
* Created by You on August 18, 2016.
* Copyright 2016, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "Test1Controller.j"
@import "Test2Controller.j"
@implementation AppController : CPObject
{
@outlet CPWindow theWindow;
@outlet CPButton nextButton;
@outlet CPView testView;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (@action)next:(id)sender
{
[self activateTest:[Test2Controller new]];
[sender setEnabled:NO];
}
- (void)activateTest:aController
{
var viewFrame = [testView frame],
resizingMask = [testView autoresizingMask];
[aController loadViewWithCompletionHandler:function(aView, error)
{
[aView setFrame:viewFrame];
[aView setAutoresizingMask:resizingMask];
[[theWindow contentView] replaceSubview:testView with:aView];
testView = aView;
[theWindow makeFirstResponder:[aView nextValidKeyView]];
}];
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
[self activateTest:[Test1Controller new]];
}
@end
+16
View File
@@ -0,0 +1,16 @@
<?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>MobileTest</string>
<key>CPBundleVersion</key>
<string>1.0</string>
<key>CPHumanReadableCopyright</key>
<string>Copyright © 2016, Your Company All rights reserved.</string>
<key>CPTheme</key>
<string>Aristo2</string>
</dict>
</plist>
+172
View File
@@ -0,0 +1,172 @@
/*
* Jakefile
* MobileTest
*
* Created by You on August 18, 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 = "MobileTest";
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", "MobileTest.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("MobileTest");
task.setIdentifier("com.yourcompany.MobileTest");
task.setVersion("1.0");
task.setAuthor("Your Company");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("MobileTest");
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")
});
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;20E;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;21E;D;K;6;CP$UIDd;2;23E;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;1;0E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;31E;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;23E;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;25E;D;K;6;CP$UIDd;2;30E;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;32E;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;33E;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;31E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;34E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;31E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;30E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;35E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;31E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;26E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;36E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;31E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;23E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;37E;E;D;K;10;$classnameS;21;CPCibControlConnectorK;8;$classesA;S;21;CPCibControlConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;30E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;31E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;38E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;32E;E;D;K;10;$classnameS;20;_CPCibWindowTemplateK;8;$classesA;S;20;_CPCibWindowTemplateS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;22E;K;30;_CPCibWindowTemplateMaxSizeKeyD;K;6;CP$UIDd;2;39E;K;32;_CPCibWindowTemplateViewClassKeyD;K;6;CP$UIDd;1;0E;K;34;_CPCibWindowTemplateWindowClassKeyD;K;6;CP$UIDd;2;40E;K;30;_CPCibWindowTemplateWTFlagsKeyD;K;6;CP$UIDd;2;41E;K;33;_CPCibWindowTemplateWindowRectKeyD;K;6;CP$UIDd;2;42E;K;33;_CPCibWindowTemplateScreenRectKeyD;K;6;CP$UIDd;2;43E;K;30;_CPCibWindowTempatStyleMaskKeyD;K;6;CP$UIDd;2;44E;K;34;_CPCibWindowTemplateWindowTitleKeyD;K;6;CP$UIDd;2;45E;K;33;_CPCibWindowTemplateWindowViewKeyD;K;6;CP$UIDd;2;25E;K;53;_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoopD;K;6;CP$UIDd;2;46E;E;D;K;10;$classnameS;6;CPViewK;8;$classesA;S;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;24E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;47E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;48E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;48E;K;17;CPViewSubviewsKeyD;K;6;CP$UIDd;2;49E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;50E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;2;51E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;2;51E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;2;52E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;22;CPViewTrackingAreasKeyD;K;6;CP$UIDd;2;53E;E;D;K;6;$classD;K;6;CP$UIDd;2;24E;K;27;CPResponderNextResponderKeyD;K;6;CP$UIDd;2;25E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;47E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;54E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;54E;K;17;CPViewSubviewsKeyD;K;6;CP$UIDd;2;55E;K;18;CPViewSuperviewKeyD;K;6;CP$UIDd;2;25E;K;22;CPViewAutoresizLine truncated
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1050" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<connections>
<outlet property="delegate" destination="450" id="451"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="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="375" height="559"/>
<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="375" height="559"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view id="IVa-Dv-gag">
<rect key="frame" x="0.0" y="34" width="375" height="525"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="t8K-kL-NiZ">
<rect key="frame" x="131" y="254" width="112" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Loading..." id="Q4J-cY-xsT">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<button verticalHuggingPriority="750" id="SpI-xM-izr">
<rect key="frame" x="153" y="7" width="69" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Next" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Jek-go-tdA">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="next:" target="450" id="pla-lq-G0N"/>
</connections>
</button>
</subviews>
</view>
<point key="canvasLocation" x="294.5" y="387.5"/>
</window>
<customObject id="450" customClass="AppController">
<connections>
<outlet property="nextButton" destination="SpI-xM-izr" id="peR-nP-CFC"/>
<outlet property="testView" destination="IVa-Dv-gag" id="qa9-HB-DLI"/>
<outlet property="theWindow" destination="371" id="459"/>
</connections>
</customObject>
</objects>
</document>
@@ -0,0 +1 @@
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;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;20E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;30E;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;22E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;28E;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;31E;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;32E;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;22E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;33E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;22E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;26E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;34E;E;D;K;10;$classnameS;21;CPCibBindingConnectorK;8;$classesA;S;21;CPCibBindingConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;26E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;30E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;35E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;36E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;37E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;39E;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;25E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;30E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;40E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;41E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;37E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;42E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;43E;E;D;K;10;$classnameS;6;CPViewK;8;$classesA;S;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;44E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;45E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;45E;K;17;CPViewSubviewsKeyD;K;6;CP$UIDd;2;46E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;2;47E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;48E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;2;49E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;2;49E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;2;50E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;22;CPViewTrackingAreasKeyD;K;6;CP$UIDd;2;51E;E;D;K;10;$classnameS;11;CPTextFieldK;8;$classesA;S;11;CPTextFieldS;9;CPControlS;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;23E;K;27;CPResponderNextResponderKeyD;K;6;CP$UIDd;2;22E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;44E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;52E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;53E;K;18;CPViewSuperviewKeyD;K;6;CP$UIDd;2;22E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;2;54E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;2;55E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;56E;K;6;$afontD;K;6;CP$UIDd;2;58E;K;17;$aline-break-modeD;K;6;CP$UIDd;2;44E;K;11;$aalignmentD;K;6;CP$UIDd;2;59E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;2;49E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;2;49E;K;17;CLine truncated
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1050" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSViewController">
<connections>
<outlet property="view" destination="1uw-bt-qdI" id="dzb-ew-bjQ"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<view id="1uw-bt-qdI">
<rect key="frame" x="0.0" y="0.0" width="375" height="525"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="rCm-w1-9Vy">
<rect key="frame" x="18" y="488" width="339" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="1. The text field below should be the first responder." id="efl-hH-HgI">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="MVy-6a-bmn">
<rect key="frame" x="18" y="357" width="339" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="You typed:" id="gcI-MY-VpS">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="displayPatternValue1" keyPath="selection.field1" id="JO4-tI-gAH">
<dictionary key="options">
<string key="NSDisplayPattern">You typed: %{value1}@</string>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="QQB-7H-iNj">
<rect key="frame" x="20" y="458" width="335" 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="ZN8-1s-rtm">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="p4m-dy-IvJ">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="kvK-Y3-gbr">
<rect key="frame" x="18" y="382" width="339" height="68"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="ifs-XG-wJH">
<font key="font" metaFont="system"/>
<string key="title">2. Using the iOS virtual keyboard, type something and then tap "Done". The text field should resign first responder status. The virtual keyboard should dismiss.</string>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="MTj-IO-Hdd">
<rect key="frame" x="18" y="281" width="339" height="68"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="XEZ-92-TT2">
<font key="font" metaFont="system"/>
<string key="title">It should not be possible to unfocus the field by tapping outside of it. Neither should tab on a hardware keyboard or return on the virtual keyboard cause the field to lose focus.</string>
<color key="textColor" white="0.25" alpha="0.84999999999999998" colorSpace="calibratedWhite"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<connections>
<outlet property="nextKeyView" destination="QQB-7H-iNj" id="rhW-S2-aO8"/>
</connections>
<point key="canvasLocation" x="222.5" y="143"/>
</view>
<objectController automaticallyPreparesContent="YES" id="8b9-mi-3ry">
<declaredKeys>
<string>field1</string>
</declaredKeys>
</objectController>
</objects>
</document>
@@ -0,0 +1 @@
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;28E;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;29E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;46E;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;51E;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;31E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;49E;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;52E;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;53E;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;31E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;54E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;31E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;34E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;55E;E;D;K;10;$classnameS;21;CPCibBindingConnectorK;8;$classesA;S;21;CPCibBindingConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;46E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;51E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;56E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;57E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;58E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;60E;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;40E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;51E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;56E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;57E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;58E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;61E;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;36E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;51E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;56E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;57E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;58E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;62E;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;38E;K;Line truncated
@@ -0,0 +1,251 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1050" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSViewController">
<connections>
<outlet property="view" destination="1uw-bt-qdI" id="dzb-ew-bjQ"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<view id="1uw-bt-qdI">
<rect key="frame" x="0.0" y="0.0" width="375" height="525"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="rCm-w1-9Vy">
<rect key="frame" x="18" y="488" width="339" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" selectable="YES" sendsActionOnEndEditing="YES" title="1. Using iOS, select the bottom text field." id="efl-hH-HgI">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="QQB-7H-iNj">
<rect key="frame" x="20" y="20" width="168" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="ZN8-1s-rtm">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="p4m-dy-IvJ">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="WHn-bp-YXb">
<rect key="frame" x="20" y="52" width="168" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="0o4-mu-lKf">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="Gfb-DD-fKx">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="ieC-jz-hFF">
<rect key="frame" x="20" y="84" width="168" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="HOR-W1-60I">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="k5D-Z5-mwy">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="2Z5-X6-GfO">
<rect key="frame" x="20" y="116" width="168" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="gOY-ut-suP">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="y6S-7u-G3m">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="Za1-xG-Gge">
<rect key="frame" x="20" y="148" width="168" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="Whd-4q-Rij">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="ySP-Nl-D8a">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="YVP-ZC-pGO">
<rect key="frame" x="20" y="180" width="168" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="Fgs-u3-H2A">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="iyO-Wc-v8U">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="jR4-b9-wqI">
<rect key="frame" x="20" y="212" width="168" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="hj2-cr-R0C">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="RbR-Gf-CIt">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="1cZ-8Y-ZWv">
<rect key="frame" x="20" y="244" width="168" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="F2w-Ot-3JD">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="qFE-oq-Yqc">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="71B-ey-AJb">
<rect key="frame" x="20" y="276" width="168" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="qqS-DR-Adh">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="OVX-Dh-zhj">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="kvK-Y3-gbr">
<rect key="frame" x="18" y="446" width="339" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="2. Try to tap other fields while the virtual keyboard is selected. The right field should become selected." id="ifs-XG-wJH">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="4WG-1c-b2Z">
<rect key="frame" x="18" y="404" width="339" height="34"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="3. Tapping the &quot;Do Nothing&quot; button should not cause keyboard focus to be lost." id="iDO-ew-aej">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="MTj-IO-Hdd">
<rect key="frame" x="18" y="362" width="339" height="34"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Cappuccino's hit test should not be confused by the presence of the virtual keyboard." id="XEZ-92-TT2">
<font key="font" metaFont="system"/>
<color key="textColor" white="0.25" alpha="0.84999999999999998" colorSpace="calibratedWhite"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="wQe-i8-b9b">
<rect key="frame" x="125" y="306" width="230" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" enabled="NO" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Disabled" drawsBackground="YES" id="X9c-cC-iMx">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="value" keyPath="selection.field1" id="CMU-yu-TDf">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
</dictionary>
</binding>
</connections>
</textField>
<button verticalHuggingPriority="750" id="gwi-W0-EM0">
<rect key="frame" x="14" y="300" width="109" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Do Nothing" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="a7n-DE-CMc">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="MVy-6a-bmn">
<rect key="frame" x="18" y="337" width="339" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="You typed:" id="gcI-MY-VpS">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="8b9-mi-3ry" name="displayPatternValue1" keyPath="selection.field1" id="JO4-tI-gAH">
<dictionary key="options">
<string key="NSDisplayPattern">You typed: %{value1}@</string>
</dictionary>
</binding>
</connections>
</textField>
</subviews>
<connections>
<outlet property="nextKeyView" destination="QQB-7H-iNj" id="rhW-S2-aO8"/>
</connections>
<point key="canvasLocation" x="222.5" y="142.5"/>
</view>
<objectController automaticallyPreparesContent="YES" id="8b9-mi-3ry">
<declaredKeys>
<string>field1</string>
</declaredKeys>
</objectController>
</objects>
</document>
+19
View File
@@ -0,0 +1,19 @@
@import <AppKit/AppKit.j>
@import "Test1Controller.j"
@implementation Test1Controller : CPViewController
{
}
- (id)init
{
return [super initWithCibName:@"Test1View" bundle:nil];
}
- (void)viewDidLoad
{
CPLog("Loaded %@ view %@", self, [self view]);
}
@end
+19
View File
@@ -0,0 +1,19 @@
@import <AppKit/AppKit.j>
@import "Test1Controller.j"
@implementation Test2Controller : CPViewController
{
}
- (id)init
{
return [super initWithCibName:@"Test2View" bundle:nil];
}
- (void)viewDidLoad
{
CPLog("Loaded %@ view %@", self, [self view]);
}
@end
+204
View File
@@ -0,0 +1,204 @@
<!DOCTYPE html>
<html lang="en">
<!--
index-debug.html
MobileTest
Created by You on August 18, 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>MobileTest</title>
<!-- Custom javascript goes here -->
<!-- End custom javascript -->
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
// The below will tell the compiler to generate debug symbols, type signatures and not inline objj_msgSend functions.
// This will affect only Objective-J code that is compiled when loading the application. It will not affect precompiled
// code like the Cappuccino frameworks.
//
// Debug symbols will give each Objective-J method a Javascript function name. Without a name it will be very hard to find
// the methods in the debugger.
// Type Signatures will give type information to the Objective-J runtime for instance variables and methods.
// Inline objj_msgSend will give a speed increase but decorators will not work. Check below on debug options for
// more information on decorators.
//
// Uncomment or comment on the line below to change the flags
OBJJ_COMPILER_FLAGS = ["IncludeDebugSymbols", "IncludeTypeSignatures"/*, "InlineMsgSend"*/];
var progressBar = null;
OBJJ_PROGRESS_CALLBACK = function(percent, appSize, path)
{
percent = percent * 100;
if (!progressBar)
progressBar = document.getElementById("progress-bar");
if (progressBar)
progressBar.style.width = Math.min(percent, 100) + "%";
}
var loadingHTML =
'<div id="loading">' +
' <div id="loading-text">Loading...</div>' +
' <div id="progress-indicator">' +
' <span id="progress-bar" style="width:0%"></span>' +
' </div>' +
'</div>';
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Decorators will only work when the code is compiled without the compiler option 'InlineMsgSend'. Check above.
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
// the class name of the view that created them. Comment this or set to false to disable.
appkit_tag_dom_elements = true;
</script>
<style type="text/css">
html, body, h1, p {
margin: 0;
padding: 0;
}
/* We need a body wrapper because Cappuccino is unhappy if we change the body element */
#cappuccino-body {
/* Position it absolutely so it will fill the height without content */
position: absolute;
top: 0;
bottom: 0;
width: 100%;
/* Put it at the bottom of the stack so it doesn't interfere with UI */
z-index: 0;
}
#cappuccino-body .container {
display: table;
margin: 0 auto;
height: 100%;
}
#cappuccino-body .content {
display: table-cell;
height: 100%;
vertical-align: top;
}
#loading {
position: relative;
top: 35%;
}
#loading-text {
height: 1.5em;
color: #555;
font: normal bold 36px/36px Arial, sans-serif;
}
#progress-indicator {
padding: 0px;
height: 16px;
border: 5px solid #555;
border-radius: 18px;
background-color: white;
}
#progress-bar {
position: relative;
top: -1px;
left: -1px;
display: block;
height: 18px;
/* Compensate for moving the bar left 1px to overlap the indicator border */
border-right: 1px solid #555;
background-color: #555;
}
#noscript {
position: relative;
top: 35%;
padding: 1em 1.5em;
border: 5px solid #555;
border-radius: 16px;
background-color: white;
color: #555;
text-align: center;
font: bold 24px Arial, sans-serif;
}
#noscript a {
color: #98c0ff;
text-decoration: none;
}
</style>
</head>
<body>
<div id="cappuccino-body">
<div class="container">
<div class="content">
<script type="text/javascript">
document.write(loadingHTML);
</script>
</div>
</div>
<noscript style="position:absolute; top:0; left:0; width:100%; height:100%">
<div class="container">
<div class="content">
<div id="noscript">
<p style="font-size:120%; margin-bottom:.75em">JavaScript is required for this site.</p>
<p><a href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a></p>
</div>
</div>
</div>
</noscript>
</div>
</body>
</html>
+166
View File
@@ -0,0 +1,166 @@
<!DOCTYPE html>
<html lang="en">
<!--
index.html
MobileTest
Created by You on August 18, 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>MobileTest</title>
<!-- Custom javascript goes here -->
<!-- End custom javascript -->
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
// The below will tell the compiler to not generate debug symbols but will generate type signatures and inline objj_msgSend functions.
// This will affect only Objective-J code that is compiled when loading the application. It will not affect precompiled
// code like the Cappuccino frameworks.
// Uncomment or comment on the line below to change the flags
OBJJ_COMPILER_FLAGS = [/*"IncludeDebugSymbols"*/, "IncludeTypeSignatures", "InlineMsgSend"];
var progressBar = null;
OBJJ_PROGRESS_CALLBACK = function(percent, appSize, path)
{
percent = percent * 100;
if (!progressBar)
progressBar = document.getElementById("progress-bar");
if (progressBar)
progressBar.style.width = Math.min(percent, 100) + "%";
}
var loadingHTML =
'<div id="loading">' +
' <div id="loading-text">Loading...</div>' +
' <div id="progress-indicator">' +
' <span id="progress-bar" style="width:0%"></span>' +
' </div>' +
'</div>';
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
html, body, h1, p {
margin: 0;
padding: 0;
}
/* We need a body wrapper because Cappuccino is unhappy if we change the body element */
#cappuccino-body {
/* Position it absolutely so it will fill the height without content */
position: absolute;
top: 0;
bottom: 0;
width: 100%;
/* Put it at the bottom of the stack so it doesn't interfere with UI */
z-index: 0;
}
#cappuccino-body .container {
display: table;
margin: 0 auto;
height: 100%;
}
#cappuccino-body .content {
display: table-cell;
height: 100%;
vertical-align: top;
}
#loading {
position: relative;
top: 35%;
}
#loading-text {
height: 1.5em;
color: #555;
font: normal bold 36px/36px Arial, sans-serif;
}
#progress-indicator {
padding: 0px;
height: 16px;
border: 5px solid #555;
border-radius: 18px;
background-color: white;
}
#progress-bar {
position: relative;
top: -1px;
left: -1px;
display: block;
height: 18px;
/* Compensate for moving the bar left 1px to overlap the indicator border */
border-right: 1px solid #555;
background-color: #555;
}
#noscript {
position: relative;
top: 35%;
padding: 1em 1.5em;
border: 5px solid #555;
border-radius: 16px;
background-color: white;
color: #555;
text-align: center;
font: bold 24px Arial, sans-serif;
}
#noscript a {
color: #98c0ff;
text-decoration: none;
}
</style>
</head>
<body>
<div id="cappuccino-body">
<div class="container">
<div class="content">
<script type="text/javascript">
document.write(loadingHTML);
</script>
</div>
</div>
<noscript style="position:absolute; top:0; left:0; width:100%; height:100%">
<div class="container">
<div class="content">
<div id="noscript">
<p style="font-size:120%; margin-bottom:.75em">JavaScript is required for this site.</p>
<p><a href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a></p>
</div>
</div>
</div>
</noscript>
</div>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
/*
* AppController.j
* CPTextField
*
* Created by Alexander Ljungberg on August 2, 2010.
* Copyright 2010, WireLoad, LLC All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
@@ -142,7 +142,7 @@
[_menuItemView setDirty];
}
// Performs autoenable processing, returns isEnabled to propagate state to NativeHost
// Performs autoenable processing, returns isEnabled to propagate state
- (BOOL)_performAutoenable
{
if ([_menu autoenablesItems])
@@ -162,7 +162,7 @@
}
else
{
// XXX: will toggle state as part of _target check, required to sync stane with NativeHost
// XXX: will toggle state as part of _target check
_isEnabled = isEnabled;
[_menuItemView setDirty];
-5
View File
@@ -1,5 +0,0 @@
.DS_Store
*.mode1v3
*.pbxuser
*.perspectivev3
build
-33
View File
@@ -1,33 +0,0 @@
//
// AppController+MainMenu.m
// NativeHost
//
// Created by Francisco Tolmasky on 9/2/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <WebKit/WebKit.h>
#import "MenuBridge.h"
#import "AppController.h"
@interface NSApplication (MenuMethods)
- (void)setAppleMenu:(NSMenu *)aMenu;
@end
@implementation AppController (MainMenu)
- (void)setMainMenuObject:(WebScriptObject *)aMenuObject
{
NSMenu * mainMenu = [[MenuBridge alloc] initWithMenuObject:aMenuObject];
[NSApp setAppleMenu:[[mainMenu itemArray] objectAtIndex:0]];
[NSApp setMainMenu:mainMenu];
[mainMenu release];
}
@end
@@ -1,26 +0,0 @@
//
// AppController+WebFrameLoadDelegate.m
// NativeHost
//
// Created by Francisco Tolmasky on 7/28/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "AppController.h"
#import "BridgedMethods.h"
@implementation AppController (WebFrameLoadDelegate)
- (void)webView:(WebView *)aWebView didClearWindowObject:(WebScriptObject *)aWindowObject forFrame:(WebFrame *)aFrame
{
if (aWebView == webView)
[GlobalMethods enhanceWindowObject:aWindowObject ofWebView:aWebView];
else
[WindowMethods enhanceWindowObject:aWindowObject ofWebView:aWebView];
}
@end
@@ -1,35 +0,0 @@
//
// AppController+WebPolicyDelegate.m
// NativeHost
//
// Created by Francisco Tolmasky on 5/11/10.
// Copyright 2010 280 North, Inc. All rights reserved.
//
#import "NSURL+Additions.h"
#import "AppController.h"
@implementation AppController (WebPolicyDelegate)
- (void)webView:(WebView *)aWebView decidePolicyForNewWindowAction:(NSDictionary *)actionInformation request:(NSURLRequest *)aRequest newFrameName:(NSString *)aFrameName decisionListener:(id /*< WebPolicyDecisionListener >*/)aListener
{
[[NSWorkspace sharedWorkspace] openURL:[actionInformation objectForKey:WebActionOriginalURLKey]];
[aListener ignore];
}
- (void)webView:(WebView *)aWebView decidePolicyForNavigationAction:(NSDictionary *)aDictionary request:(NSURLRequest *)aRequest frame:(WebFrame *)aWebFrame decisionListener:(id /*<WebPolicyDecisionListener>*/)aDecisionListener
{
NSURL * requestURL = [aRequest URL];
if([aWebView mainFrame] != aWebFrame ||
[[baseURL scheme] isEqualTo:[requestURL scheme]] &&
![baseURL host] || [[baseURL host] isEqualTo:[requestURL host]] &&
![baseURL port] || [[baseURL port] isEqualTo:[requestURL port]])
return [aDecisionListener use];
[[NSWorkspace sharedWorkspace] openURL:[aDictionary objectForKey:WebActionOriginalURLKey]];
[aDecisionListener ignore];
}
@end
@@ -1,32 +0,0 @@
//
// AppController+WebResourceLoadDelegate.m
// NativeHost
//
// Created by Francisco Tolmasky on 7/28/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "AppController.h"
#import "SSCrypto.h"
NSString *authHeader = nil;
@implementation AppController (WebResourceLoadDelegate)
- (NSURLRequest *)webView:(WebView *)aSender resource:(id)anIdentifier willSendRequest:(NSURLRequest *)aRequest redirectResponse:(NSURLResponse *)aRedirectResponse fromDataSource:(WebDataSource *)aDataSource
{
aRequest = [[aRequest mutableCopy] autorelease];
if (!authHeader)
{
NSString *plaintext = [NSString stringWithFormat:@"%@:%@", SERVER_USER, SERVER_PASSWORD];
NSData *data = [plaintext dataUsingEncoding:NSASCIIStringEncoding];
authHeader = [[NSString alloc] initWithFormat:@"Basic %@", [data encodeBase64WithNewlines:NO]];
}
[(NSMutableURLRequest *)aRequest setValue:authHeader forHTTPHeaderField:@"Authorization"];
return aRequest;
}
@end
@@ -1,71 +0,0 @@
//
// AppController+WebUIDelegate.m
// NativeHost
//
// Created by Francisco Tolmasky on 7/28/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "AppController.h"
#import "WebWindow.h"
@implementation AppController (WebUIDelegate)
- (void)webView:(WebView *)aWebView setFrame:(NSRect)aFrame
{
[[aWebView window] setFrame:aFrame display:YES];
}
- (NSRect)webViewFrame:(WebView *)aWebView
{
return [[aWebView window] frame];
}
- (WebView *)webView:(WebView *)aWebView createWebViewWithRequest:(NSURLRequest *)aRequest
{
return [[WebWindow webWindow] webView];
}
- (void)webViewClose:(WebView *)aWebView
{
// Important to call close and not:
// -performClose:, which beeps without the presence of a close button.
// -orderOut:, which doesn't release the window.
[[aWebView window] close];
//[[aWebView window] orderOut:self];
}
- (void)webViewShow:(WebView *)aWebView
{
[[aWebView window] makeKeyAndOrderFront:self];
}
- (NSAttributedString *)loggedOutput;
{
return loggedOutput;
}
- (void)webView:(WebView *)aWebView addMessageToConsole:(NSDictionary *)aDictionary
{
NSString * message = [aDictionary objectForKey:@"message"];
NSAttributedString * attributedString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n", message, nil]];
[loggedOutput appendAttributedString:attributedString];
[attributedString release];
NHLog(@"CONSOLE", message);
}
- (void)webView:(WebView *)aSender runJavaScriptAlertPanelWithMessage:(NSString *)aMessage initiatedByFrame:(WebFrame *)aFrame
{
WebDataSource * dataSource = [aFrame dataSource];
NSString * title = [dataSource pageTitle];
if (![title length])
title = [[[dataSource request] URL] absoluteString];
[[NSAlert alertWithMessageText:title defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"%@", aMessage, nil] runModal];
}
@end
-54
View File
@@ -1,54 +0,0 @@
//
// AppController.h
// NativeHost
//
// Created by Francisco Tolmasky on 6/4/09.
// Copyright 2009 280 North, Inc. All rights reserved.
//
#import <Cocoa/Cocoa.h>
extern int SERVER_PORT;
extern NSString *SERVER_PASSWORD;
extern NSString *SERVER_USER;
@class Server;
@class WebScriptObject;
@interface AppController : NSObject
{
NSWindow * webViewWindow;
WebView * webView;
NSMutableArray * openingFilenames;
NSMutableArray * openingURLStrings;
Server * server;
NSFileHandle * stdinFileHandle;
NSMutableAttributedString * loggedOutput;
NSURL * baseURL;
}
- (void)configureLocalStorage;
- (NSURL *)baseURL;
- (void)startServer;
- (void)startCappuccinoApplication;
- (NSArray *)openingURLStrings;
- (NSView *)keyView;
- (WebView *)webView;
- (WebScriptObject *)windowScriptObject;
@end
@interface AppController (MainMenu)
- (void)setMainMenuObject:(WebScriptObject *)aMenuObject;
@end
void NHLog(NSString *type, NSString *message);
-221
View File
@@ -1,221 +0,0 @@
//
// AppController.m
// NativeHost
//
// Created by Francisco Tolmasky on 6/4/09.
// Copyright 2009 280 North, Inc. All rights reserved.
//
#import "Console.h"
#import "Server.h"
#import "AppController.h"
#import "NSURL+Additions.h"
#import "BridgedMethods.h"
#import "WebWindow.h"
#import "WebScripObject+Objective-J.h"
extern int interactive;
int SERVER_PORT = 9191;
NSString *SERVER_PASSWORD = nil;
NSString *SERVER_USER = nil;
@implementation AppController
- (id)init
{
self = [super init];
if (self)
openingURLStrings = [NSMutableArray new];
return self;
}
- (void)dealloc
{
[webView release];
[webViewWindow release];
[openingURLStrings release];
[super dealloc];
}
- (BOOL)application:(NSApplication *)anApplication openFile:(NSString *)aFilename
{
id canOpenFilesImmediately = [[webView windowScriptObject] evaluateWebScript:@"CPApp && CPApp._finishedLaunching"];
NSString *path = [[[NSURL fileURLWithPath:aFilename] HTTPFileSystemURL] absoluteString];
if ([canOpenFilesImmediately isKindOfClass:[NSNumber class]] && [canOpenFilesImmediately boolValue])
[[webView windowScriptObject] evaluateObjectiveJ:[NSString stringWithFormat:@"[CPApp _openURL:[CPURL URLWithString:\"%@\"]]", path]];
else
[openingURLStrings addObject:path];
return NO;
}
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification
{
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
[defaults registerDefaults:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:@"WebKitDeveloperExtras"]];
[self startServer];
}
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
[self startCappuccinoApplication];
}
- (void)applicationDidResignActive:(NSNotification *)aNotification
{
// FIXME: handle this better.
[[self windowScriptObject] evaluateObjectiveJ:@"[CPApp _willResignActive];"];
[[self windowScriptObject] evaluateObjectiveJ:@"CPApp._isActive = NO;"];
[[self windowScriptObject] evaluateObjectiveJ:@"[CPApp _didResignActive];"];
}
- (void)applicationDidBecomeActive:(NSNotification *)aNotification
{
// FIXME: handle this better.
[[self windowScriptObject] evaluateObjectiveJ:@"[CPApp _willBecomeActive];"];
[[self windowScriptObject] evaluateObjectiveJ:@"CPApp._isActive = YES;"];
[[self windowScriptObject] evaluateObjectiveJ:@"[CPApp _didBecomeActive];"];
}
- (NSArray *)openingURLStrings
{
return openingURLStrings;
}
- (NSView *)keyView
{
return [[[webView mainFrame] frameView] documentView];
}
- (WebView *)webView
{
return webView;
}
- (WebScriptObject *)windowScriptObject
{
return [webView windowScriptObject];
}
- (void)startServer
{
server = [[Server alloc] init];
if (![server start])
exit(0);
if (interactive)
{
stdinFileHandle = [[NSFileHandle fileHandleWithStandardInput] retain];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(didReadStdin:)
name:NSFileHandleReadCompletionNotification
object:stdinFileHandle];
fprintf(stdout, "objj> ");
fflush(stdout);
[stdinFileHandle readInBackgroundAndNotify];
}
}
- (void)didReadStdin:(NSNotification *)aNotification
{
NSString *string = [[NSString alloc] initWithData:[[aNotification userInfo] objectForKey:NSFileHandleNotificationDataItem] encoding:NSASCIIStringEncoding];
NSString *result = [[self windowScriptObject] evaluateObjectiveJReturningString:string];
[string release];
if ([result respondsToSelector:@selector(UTF8String)])
fprintf(stdout, "%s\n", [result UTF8String]);
fprintf(stdout, "objj> ");
fflush(stdout);
[stdinFileHandle readInBackgroundAndNotify];
}
- (NSURL *)baseURL
{
return baseURL;
}
- (void)startCappuccinoApplication
{
NSString *initialURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NHInitialURL"];
BOOL prependServer = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"NHInitialURLPrependServer"] boolValue];
if (!initialURL)
{
NSString *initialResource = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NHInitialResource"];
if (!initialResource)
initialResource = @"Application/index.html";
initialURL = [[NSString stringWithFormat:@"file://%@/%@", [[NSBundle mainBundle] resourcePath], initialResource] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
baseURL = [[NSURL alloc] initWithString:@"file:///"];
}
else if (prependServer)
{
initialURL = [NSString stringWithFormat:@"http://127.0.0.1:%d/%@", SERVER_PORT, initialURL];
baseURL = [[NSURL alloc] initWithString:[NSString stringWithFormat:@"http://127.0.0.1:%d/", SERVER_PORT]];
}
NHLog(@"STARTUP", [initialURL description]);
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:initialURL]]];
}
- (void)applicationWillTerminate:(NSNotification *)aNotification
{
[server stop];
}
- (void)configureLocalStorage
{
WebPreferences *webConfiguration = [WebPreferences standardPreferences];
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *cappBundleName = [mainBundle objectForInfoDictionaryKey:@"CPBundleName"];
NSString *applicationSupportFile = [@"~/Library/Application Support/" stringByExpandingTildeInPath];
NSString *savePath = [NSString pathWithComponents:[NSArray arrayWithObjects:applicationSupportFile, cappBundleName, @"LocalStorage", nil]];
if ([webConfiguration respondsToSelector:@selector(setLocalStorageDatabasePath:)])
[webConfiguration setLocalStorageDatabasePath:savePath];
else
[webConfiguration _setLocalStorageDatabasePath:savePath];
[webView setPreferences:webConfiguration];
}
- (void)awakeFromNib
{
webView = [[WebView alloc] init];
[webView setUIDelegate:self];
[webView setFrameLoadDelegate:self];
[webView setResourceLoadDelegate:self];
[webView setPolicyDelegate:self];
[self configureLocalStorage];
webViewWindow = [[NSWindow alloc] init];
[webViewWindow setContentView:webView];
}
@end
void NHLog(NSString *type, NSString *message)
{
NSArray *lines = [message componentsSeparatedByString:@"\n"];
for (NSString *line in lines)
{
if ([line length] > 0)
NSLog(@"%10@: %@", type, line);
}
}
-18
View File
@@ -1,18 +0,0 @@
//
// Application.h
// NativeHost
//
// Created by Francisco Tolmasky on 10/8/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface Application : NSApplication
{
}
- (void)_reallyTerminate:(id)sender;
@end
-49
View File
@@ -1,49 +0,0 @@
//
// Application.m
// NativeHost
//
// Created by Francisco Tolmasky on 10/8/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "Application.h"
#import "AppController.h"
#import "WebScripObject+Objective-J.h"
#import "WebWindow.h"
@implementation Application
- (void)sendEvent:(NSEvent *)anEvent
{
[WebWindow enableAllWindows];
NSWindow * window = [anEvent window];
if (!window || [window isKindOfClass:[WebWindow class]])
{
NSResponder * firstResponder = window ? [window firstResponder] : [(AppController *)[self delegate] keyView];
switch ([anEvent type])
{
case NSKeyDown: return [firstResponder keyDown:anEvent];
case NSKeyUp: return [firstResponder keyUp:anEvent];
}
}
[super sendEvent:anEvent];
}
- (void)terminate:(id)sender
{
if ([[[self delegate] windowScriptObject] evaluateObjectiveJ:@"(CPApp)"] == [WebUndefined undefined])
[self _reallyTerminate:sender];
else
[[(AppController *)[self delegate] windowScriptObject] evaluateObjectiveJ:@"[CPApp terminate:nil]"];
}
- (void)_reallyTerminate:(id)sender
{
[super terminate:sender];
}
@end
-65
View File
@@ -1,65 +0,0 @@
//
// BridgedMethods.h
// NativeHost
//
// Created by Francisco Tolmasky on 10/16/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface BridgedMethods : NSObject
{
WebView * webView;
}
+ (NSMutableArray *)arrayFromWebScriptObject:(WebScriptObject *)incomingObject;
+ (void)enhanceWindowObject:(WebScriptObject *)aWindowObject ofWebView:(WebView *)aWebView;
@end
@interface GlobalMethods : BridgedMethods
{
}
- (id)isDesktop;
- (id)openingURLStrings;
- (id)setMainMenu:(id)arguments;
- (id)terminate;
- (id)activateIgnoringOtherApps:(NSArray *)arguments;
- (id)deactivate;
- (id)hide;
- (id)hideOtherApplications;
- (id)savePanel:(NSArray *)arguments; // FIXME: This should be implemented in Cappuccino.
- (id)openPanel; // FIXME: This should be implemented in Cappuccino.
- (id)clearRecentDocuments;
- (id)noteNewRecentDocumentPath:(NSArray *)aURL;
- (id)recentDocumentURLs;
- (id)pasteboardWithName:(NSArray *)arguments;
@end
@interface WindowMethods : BridgedMethods
{
}
- (id)miniaturize;
- (id)deminiaturize;
- (id)level;
- (id)setLevel:(NSArray *)arguments;
- (id)hasShadow;
- (id)setHasShadow:(NSArray *)arguments;
- (id)shadowStyle;
- (id)setShadowStyle:(NSArray *)arguments;
- (id)frame;
- (id)setFrame:(NSArray *)arguments;
@end
-345
View File
@@ -1,345 +0,0 @@
//
// BridgedMethods.m
// NativeHost
//
// Created by Francisco Tolmasky on 10/16/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <objc/runtime.h>
#import "Application.h"
#import "AppController.h"
#import "BridgedMethods.h"
#import "NSObject+WebAdditions.h"
#import "NSURL+Additions.h"
#import "WebWindow.h"
#import "WebPasteboardProxy.h"
static NSMutableDictionary * MethodClasses;
@implementation GlobalMethods
- (id)isDesktop
{
return [NSNumber numberWithBool:YES];
}
- (id)openingURLStrings
{
return [(AppController *)[NSApp delegate] openingURLStrings];
}
- (id)setMainMenu:(id)arguments
{
[[NSApp delegate] setMainMenuObject:[arguments objectAtIndex:0]];
return [WebUndefined undefined];
}
- (id)terminate
{
[(Application *)NSApp _reallyTerminate:self];
return [WebUndefined undefined];
}
- (id)activateIgnoringOtherApps:(NSArray *)arguments
{
id argument = [arguments objectAtIndex:0];
[(NSApplication *)NSApp activateIgnoringOtherApps:[argument isKindOfClass:[NSNumber class]] && [(NSNumber *)argument boolValue]];
return [WebUndefined undefined];
}
- (id)deactivate
{
[(NSApplication *)NSApp deactivate];
return [WebUndefined undefined];
}
- (id)hide
{
[NSApp hide:self];
return [WebUndefined undefined];
}
- (id)hideOtherApplications
{
[NSApp hideOtherApplications:self];
return [WebUndefined undefined];
}
- (id)openPanel
{
NSOpenPanel * openPanel = [NSOpenPanel openPanel];
NSInteger result = [openPanel runModal];
NSMutableString * resultObject = [NSMutableString stringWithFormat:@"({ button:%d, URLs:", result];
NSMutableArray * fileSystemURLs = [NSMutableArray array];
for (NSURL * URL in [openPanel URLs])
[fileSystemURLs addObject:[URL HTTPFileSystemURL]];
if (result == NSFileHandlingPanelOKButton)
[resultObject appendString:[NSString stringWithFormat:@"[\"%@\"] })", [fileSystemURLs componentsJoinedByString:@"\", \""]]];
else
[resultObject appendString:@"[] })"];
return [[webView windowScriptObject] evaluateWebScript:resultObject];
}
- (id)savePanel:(NSArray *)arguments
{
NSSavePanel * savePanel = [NSSavePanel savePanel];
WebScriptObject *args = [arguments objectAtIndex:0];
[savePanel setAllowedFileTypes:[BridgedMethods arrayFromWebScriptObject:[args valueForKey:@"allowedFileTypes"]]];
id allowsOtherFileTypes = [args valueForKey:@"allowsOtherFileTypes"];
[savePanel setAllowsOtherFileTypes:allowsOtherFileTypes && [allowsOtherFileTypes webBoolValue]];
id isExtensionHidden = [args valueForKey:@"isExtensionHidden"];
[savePanel setExtensionHidden:isExtensionHidden && [isExtensionHidden webBoolValue]];
id canSelectHiddenExtension = [args valueForKey:@"canSelectHiddenExtension"];
[savePanel setCanSelectHiddenExtension:canSelectHiddenExtension && canSelectHiddenExtension];
id canCreateDirectories = [args valueForKey:@"canCreateDirectories"];
[savePanel setCanCreateDirectories:canCreateDirectories && [canCreateDirectories webBoolValue]];
NSInteger result = [savePanel runModal];
return [[webView windowScriptObject] evaluateWebScript:[NSString stringWithFormat:@"({ button:%d, URL:\"%@\" })", result, [[[savePanel URL] HTTPFileSystemURL] absoluteString]]];
}
- (id)clearRecentDocuments
{
[[NSDocumentController sharedDocumentController] clearRecentDocuments:self];
return [WebUndefined undefined];
}
- (id)noteNewRecentDocumentPath:(NSArray *)arguments
{
if (![arguments count])
return [WebUndefined undefined];
NSString *aURL = [arguments objectAtIndex:0];
NSURL *fileURL = [NSURL fileSystemURLFromHTTPFileSystemString:aURL];
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:fileURL];
return [WebUndefined undefined];
}
- (id)recentDocumentURLs
{
NSArray *existingURLs = [[NSDocumentController sharedDocumentController] recentDocumentURLs];
NSMutableArray *urlsAsStrings = [NSMutableArray array];
for (int i=0, count = [existingURLs count]; i < count; i++)
[urlsAsStrings addObject:[[existingURLs objectAtIndex:i] absoluteString]];
return urlsAsStrings;
}
- (id)pasteboardWithName:(NSArray *)arguments
{
if (![arguments count])
return [WebUndefined undefined];
return [WebPasteboardProxy pasteboardWithName:[arguments objectAtIndex:0]];
}
@end
@implementation WindowMethods
- (id)miniaturize
{
[[webView window] miniaturize:nil];
return [WebUndefined undefined];
}
- (id)deminiaturize
{
[[webView window] deminiaturize:nil];
return [WebUndefined undefined];
}
- (id)level
{
return [NSNumber numberWithInt:[[webView window] level]];
}
- (id)setLevel:(NSArray *)arguments
{
[[webView window] setLevel:[[arguments objectAtIndex:0] intValue]];
return [WebUndefined undefined];
}
- (id)hasShadow
{
return [NSNumber numberWithBool:[[webView window] hasShadow]];
}
- (id)setHasShadow:(NSArray *)arguments
{
[[webView window] setHasShadow:[[arguments objectAtIndex:0] boolValue]];
return [WebUndefined undefined];
}
- (id)frame
{
NSRect frame = [[webView window] frame];
return [[webView windowScriptObject] evaluateWebScript:[NSString stringWithFormat:@"({ origin:{%f, %f}, size:{%f, %f}})", NSMinX(frame), NSMinY(frame), NSWidth(frame), NSHeight(frame)]];
}
- (id)setFrame:(NSArray *)arguments
{
id origin = [[arguments objectAtIndex:0] valueForKey:@"origin"],
size = [[arguments objectAtIndex:0] valueForKey:@"size"];
NSWindow * window = [webView window];
NSScreen * screen = [window screen];
if (!screen)
screen = [NSScreen mainScreen]; // Is this correct?
float height = [[size valueForKey:@"height"] floatValue];
[[webView window] setFrame:NSMakeRect([[origin valueForKey:@"x"] floatValue], NSMaxY([screen frame]) - [[origin valueForKey:@"y"] floatValue] - height, [[size valueForKey:@"width"] floatValue], height) display:YES];
/*
NSLog([webView description]);
NSLog(@"%@ %@", [window screen], NSStringFromRect([window frame]));
NSLog(@"%f - %f - %f = %f", NSMaxY([[window screen] frame]), [[origin valueForKey:@"y"] floatValue], height, NSMaxY([[window screen] frame]) - [[origin valueForKey:@"y"] floatValue] - height);
NSLog(@"FROM: %@", NSStringFromRect(NSMakeRect([[origin valueForKey:@"x"] floatValue], [[origin valueForKey:@"y"] floatValue], [[size valueForKey:@"width"] floatValue], height)));
NSLog(@" TO: %@", NSStringFromRect([[webView window] frame]));
*/
return [WebUndefined undefined];
}
- (id)shadowStyle
{
WebWindow * window = (WebWindow *)[webView window];
return [NSNumber numberWithInt:[window shadowStyle]];
}
- (id)setShadowStyle:(id)arguments
{
int type = [[arguments objectAtIndex:0] intValue];
WebWindow * window = (WebWindow *)[webView window];
[window setShadowStyle:type];
return [WebUndefined undefined];
}
@end
@interface WindowScriptObjectMethod : NSObject
{
WebView * webView;
}
- (id)initWithWebView:(WebView *)aWebView;
@end
@implementation WindowScriptObjectMethod
- (id)initWithWebView:(WebView *)aWebView
{
self = [super init];
if (self)
webView = aWebView;
return self;
}
@end
@implementation BridgedMethods
+ (NSMutableArray *)arrayFromWebScriptObject:(WebScriptObject *)incomingObject
{
if (!incomingObject)
return nil;
NSMutableArray * newItems = [[NSMutableArray alloc] init];
for (int i=0; [incomingObject webScriptValueAtIndex:i]!=[WebUndefined undefined]; i++)
{
id oneItem =[incomingObject webScriptValueAtIndex:i];
[newItems addObject:oneItem];
}
return [newItems autorelease];
}
+ (void)enhanceWindowObject:(WebScriptObject *)aWindowObject ofWebView:(WebView *)aWebView
{
NSDictionary * classMethods = [MethodClasses objectForKey:[self className]];
NSString * key = nil;
NSEnumerator * keyEnumerator = [classMethods keyEnumerator];
while (key = [keyEnumerator nextObject])
[aWindowObject setValue:[(WindowScriptObjectMethod *)[[[classMethods objectForKey:key] alloc] initWithWebView:aWebView] autorelease] forKey:key];
}
+ (void)bridgeMethod:(Method)aMethod dictionary:(NSMutableDictionary *)aDictionary
{
NSString * methodName = NSStringFromSelector(method_getName(aMethod)),
* publicMethodName = [NSString stringWithFormat:@"cp%@", [[NSString stringWithFormat:@"%@%@", [[methodName substringToIndex:1] uppercaseString], [methodName substringFromIndex:1]] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@":"]]];
Class methodClass = objc_allocateClassPair([WindowScriptObjectMethod class], [[NSString stringWithFormat:@"WebScriptObjectMethod_%@", publicMethodName] cString], 0);
class_addMethod(methodClass, @selector(invokeDefaultMethodWithArguments:), method_getImplementation(aMethod), "@@:@");
objc_registerClassPair(methodClass);
[aDictionary setObject:methodClass forKey:publicMethodName];
}
+ (void)initialize
{
if (!MethodClasses)
MethodClasses = [[NSMutableDictionary alloc] init];
NSMutableDictionary * dictionary = [[NSMutableDictionary alloc] init];
[MethodClasses setObject:dictionary forKey:[self className]];
[dictionary release];
unsigned int methodCount = 0;
Method * methods = class_copyMethodList(self, &methodCount);
if (!methods)
return;
int index = 0;
for (; index < methodCount; ++index)
[self bridgeMethod:methods[index] dictionary:dictionary];
free(methods);
methods = NULL;
}
@end
-21
View File
@@ -1,21 +0,0 @@
//
// Console.h
// NativeHost
//
// Created by Francisco Tolmasky on 6/16/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface Console : NSObject
{
NSMutableAttributedString * contents;
}
+ (id)sharedConsole;
- (NSAttributedString *)contents;
@end
-69
View File
@@ -1,69 +0,0 @@
//
// Console.m
// NativeHost
//
// Created by Francisco Tolmasky on 6/16/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "Console.h"
#import "AppController.h"
@implementation Console
+ (id)sharedConsole
{
static Console * console = nil;
if (!console)
console = [[Console alloc] init];
return console;
}
- (id)init
{
self = [super init];
if (self)
contents = [[NSMutableAttributedString alloc] init];
return self;
}
- (void)dealloc
{
[contents release];
[super dealloc];
}
- (NSAttributedString *)contents
{
return contents;
}
- (void)webView:(WebView *)aWebView addMessageToConsole:(NSDictionary *)aDictionary
{
NSString * message = [aDictionary objectForKey:@"message"];
NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n", message, nil]];
[contents appendAttributedString:attrString];
[attrString release];
NHLog(@"CONSOLE", message);
}
- (void)webView:(WebView *)aSender runJavaScriptAlertPanelWithMessage:(NSString *)aMessage initiatedByFrame:(WebFrame *)aFrame
{
WebDataSource * dataSource = [aFrame dataSource];
NSString * title = [dataSource pageTitle];
if (![title length])
title = [[[dataSource request] URL] absoluteString];
[[NSAlert alertWithMessageText:title defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:aMessage, nil] runModal];
}
@end
Binary file not shown.
@@ -1 +0,0 @@
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;19E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;20E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;16E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;18E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;21E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;19E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;22E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;23E;E;S;13;CPApplicationD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;8;delegateS;13;NSFontManagerS;13;AppControllerE;K;9;$archiverS;15;CPKeyedArchiverK;8;$versionS;6;100000E;
-548
View File
@@ -1,548 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10C540</string>
<string key="IBDocument.InterfaceBuilderVersion">732</string>
<string key="IBDocument.AppKitVersion">1038.25</string>
<string key="IBDocument.HIToolboxVersion">458.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">732</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="1021">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomObject" id="1014">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1050">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomObject" id="755631768">
<string key="NSClassName">NSFontManager</string>
</object>
<object class="NSCustomObject" id="810129115">
<string key="NSClassName">AppController</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1050"/>
<reference key="destination" ref="810129115"/>
</object>
<int key="connectionID">519</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1048"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1021"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1014"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1050"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">420</int>
<reference key="object" ref="755631768"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">487</int>
<reference key="object" ref="810129115"/>
<reference key="parent" ref="0"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<string key="NS.key.0">-3.IBPluginDependency</string>
<string key="NS.object.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">677</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">AppController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">NSObject+WebAdditions.h</string>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="462640452">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="559217937">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="185909934">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSFontManager</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="536952554">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSMenu</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="810670176">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="462640452"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="559217937"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="185909934"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="536952554"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="810670176"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebDownload.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebEditingDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebFrameLoadDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebJavaPlugIn.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebPlugin.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebPluginContainer.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebPolicyDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebResourceLoadDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebScriptObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebUIDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSResponder</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">../NativeHost.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>
-30
View File
@@ -1,30 +0,0 @@
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>icon</string>
<key>CFBundleShortVersionString</key>
<string>0.9</string>
<key>CFBundleIdentifier</key>
<string>com.280north.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>NativeHost</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
-45
View File
@@ -1,45 +0,0 @@
require("../../common.jake");
var OS = require("os");
var task = require("jake").task
var stream = require("narwhal/term").stream;
task ("build", function()
{
if (executableExists("xcodebuild"))
{
var args = "-alltargets -configuration Release";
if (xcodebuildHasTenPointFiveSDK())
args = "-sdk macosx10.5 " + args;
else
args = "-sdk macosx " + args;
if (OS.system("xcodebuild " + args))
OS.exit(1);
rm_rf(FILE.join($BUILD_CJS_CAPPUCCINO, "support", "NativeHost.app"));
FILE.mkdirs(FILE.join($BUILD_CJS_CAPPUCCINO, "support"))
cp_r(FILE.join("build", "Release", "NativeHost.app"), FILE.join($BUILD_CJS_CAPPUCCINO, "support", "NativeHost.app"));
}
else
{
print("Building NativeHost requires Xcode.");
}
});
task ("clean", function()
{
if (OS.system("xcodebuild clean"))
OS.exit(1);
});
task ("clobber", function()
{
if (OS.system("xcodebuild clean"))
OS.exit(1);
});
task ("default", ["build"]);
-22
View File
@@ -1,22 +0,0 @@
//
// MenuBridge.h
// NativeHost
//
// Created by Francisco Tolmasky on 9/2/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class WebScriptObject;
@interface MenuBridge : NSMenu
{
WebScriptObject * menuObject;
}
+ (id)menuBridgeWithMenuObject:(WebScriptObject *)aMenuObject;
- (id)initWithMenuObject:(WebScriptObject *)aMenuObject;
@end
-63
View File
@@ -1,63 +0,0 @@
//
// MenuBridge.m
// NativeHost
//
// Created by Francisco Tolmasky on 9/2/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "WebScripObject+Objective-J.h"
#import "MenuItemBridge.h"
#import "MenuBridge.h"
@implementation MenuBridge
+ (id)menuBridgeWithMenuObject:(WebScriptObject *)aMenuObject
{
if (!aMenuObject)
return nil;
static NSMapTable * cache = nil;
if (!cache)
cache = [[NSMapTable mapTableWithStrongToStrongObjects] retain];
MenuBridge * menuBridge = [cache objectForKey:aMenuObject];
if (!menuBridge)
{
menuBridge = [MenuBridge alloc];
[cache setObject:menuBridge forKey:aMenuObject];
[[menuBridge initWithMenuObject:aMenuObject] autorelease];
}
return menuBridge;
}
- (id)initWithMenuObject:(WebScriptObject *)aMenuObject
{
self = [super initWithTitle:[aMenuObject bridgeSelector:@selector(title)]];
if (self)
{
menuObject = aMenuObject;
NSInteger index = 0,
count = [[aMenuObject bridgeSelector:@selector(numberOfItems)] intValue];
for (; index < count; ++index)
[self addItem:[[[MenuItemBridge alloc] initWithMenuItemObject:[aMenuObject bridgeSelector:@selector(itemAtIndex:) withObject:[NSNumber numberWithInt:index]]] autorelease]];
}
return self;
}
- (void)performActionForItemAtIndex:(NSInteger)anIndex
{
[menuObject bridgeSelector:@selector(performActionForItemAtIndex:) withObject:[NSNumber numberWithInt:anIndex]];
}
@end
-24
View File
@@ -1,24 +0,0 @@
//
// ReflectMenuItem.h
// NativeHost
//
// Created by Francisco Tolmasky on 9/2/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class WebScriptObject;
@interface MenuItemBridge : NSMenuItem
{
WebScriptObject * menuItemObject;
}
+ (id)menuItemBridgeWithMenuItemObject:(WebScriptObject *)aMenuItemObject;
- (id)initWithMenuItemObject:(WebScriptObject *)aMenuItemObject;
- (void)updateFromMenuItemObject;
@end
-77
View File
@@ -1,77 +0,0 @@
//
// ReflectMenuItem.m
// NativeHost
//
// Created by Francisco Tolmasky on 9/2/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "WebScripObject+Objective-J.h"
#import "MenuBridge.h"
#import "MenuItemBridge.h"
@implementation MenuItemBridge
+ (id)menuItemBridgeWithMenuItemObject:(WebScriptObject *)aMenuItemObject
{
if (!aMenuItemObject)
return nil;
static NSMapTable * cache = nil;
if (!cache)
cache = [[NSMapTable mapTableWithStrongToStrongObjects] retain];
MenuItemBridge * menuItemBridge = [cache objectForKey:aMenuItemObject];
if (!menuItemBridge)
{
menuItemBridge = [MenuBridge alloc];
[cache setObject:menuItemBridge forKey:aMenuItemObject];
[[menuItemBridge initWithMenuItemObject:aMenuItemObject] autorelease];
}
return menuItemBridge;
}
- (id)initWithMenuItemObject:(WebScriptObject *)aMenuItemObject
{
if ([[aMenuItemObject bridgeSelector:@selector(isSeparatorItem)] boolValue])
return [[NSMenuItem separatorItem] retain];
self = [super init];
if (self)
{
menuItemObject = aMenuItemObject;
[self updateFromMenuItemObject];
}
return self;
}
/*
- (BOOL)isSeparatorItem
{
return [[menuItemObject bridgeSelector:@selector(isSeparatorItem)] boolValue];
}
*/
- (void)updateFromMenuItemObject
{
[self setTitle:[menuItemObject bridgeSelector:@selector(title)]];
[self setSubmenu:[MenuBridge menuBridgeWithMenuObject:[menuItemObject bridgeSelector:@selector(submenu)]]];
[self setKeyEquivalent:[menuItemObject bridgeSelector:@selector(keyEquivalent)]];
[self setKeyEquivalentModifierMask:[[menuItemObject evaluateObjectiveJ:[NSString stringWithFormat:@"(function() { var mask = %u; return (((mask & CPAlphaShiftKeyMask) ? %u : 0) | ((mask & CPShiftKeyMask) ? %u : 0) | ((mask & CPControlKeyMask) ? %u : 0) | ((mask & CPAlternateKeyMask) ? %u : 0) | ((mask & CPCommandKeyMask) ? %u : 0) | ((mask & CPNumericPadKeyMask) ? %u : 0) | ((mask & CPHelpKeyMask) ? %u : 0) | ((mask & CPFunctionKeyMask) ? %u : 0)) }())", [[menuItemObject bridgeSelector:@selector(keyEquivalentModifierMask)] unsignedIntegerValue], NSAlphaShiftKeyMask, NSShiftKeyMask, NSControlKeyMask, NSAlternateKeyMask, NSCommandKeyMask, NSNumericPadKeyMask, NSHelpKeyMask, NSFunctionKeyMask, NSDeviceIndependentModifierFlagsMask]] unsignedIntegerValue]];[self setAction:@selector(bridgeAction:)];
[self setTarget:self];
[self setAction:@selector(bridgeAction:)];
}
// This exists so that the menu items are enabled.
- (void)bridgeAction:(id)aSender
{
}
@end
-16
View File
@@ -1,16 +0,0 @@
//
// NSObject+WebAdditions.h
// NativeHost
//
// Created by Francisco Tolmasky on 11/16/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface NSObject (WebAdditions)
- (BOOL)webBoolValue;
@end
-19
View File
@@ -1,19 +0,0 @@
//
// NSObject+WebAdditions.m
// NativeHost
//
// Created by Francisco Tolmasky on 11/16/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "NSObject+WebAdditions.h"
@implementation NSObject (WebAdditions)
- (BOOL)webBoolValue
{
return [self isKindOfClass:[NSNumber class]] && [(NSNumber *)self boolValue];
}
@end
-17
View File
@@ -1,17 +0,0 @@
//
// NSURL+Additions.h
// NativeHost
//
// Created by Francisco Tolmasky on 6/3/09.
// Copyright 2009 280 North, Inc. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface NSURL (Additions)
- (NSURL *)HTTPFileSystemURL;
+ (NSURL *)fileSystemURLFromHTTPFileSystemString:(NSString *)aString;
@end
-36
View File
@@ -1,36 +0,0 @@
//
// NSURL+Additions.m
// NativeHost
//
// Created by Francisco Tolmasky on 6/3/09.
// Copyright 2009 280 North, Inc. All rights reserved.
//
#import "NSURL+Additions.h"
#import "AppController.h"
@implementation NSURL (Additions)
- (NSURL *)HTTPFileSystemURL
{
if ([[self scheme] caseInsensitiveCompare:@"file"] == NSOrderedSame)
return [[[NSURL alloc] initWithScheme:@"http"
host:[NSString stringWithFormat:@"127.0.0.1:%d", SERVER_PORT]
path:[@"/filesystem/" stringByAppendingString:[self path]]] autorelease];
return [[self copy] autorelease];
}
+ (NSURL *)fileSystemURLFromHTTPFileSystemString:(NSString *)aString
{
NSURL *httpURL = [NSURL URLWithString:aString];
NSString *path = [httpURL path];
NSRange range = [path rangeOfString:@"/filesystem"];
if (range.location == 0 && NSMaxRange(range) < [path length])
path = [path substringFromIndex:[@"/filesystem" length]];
return [[[NSURL alloc] initFileURLWithPath:path] autorelease];
}
@end
@@ -1,424 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
4D55A7941180F1E000B5187D /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4D55A7931180F1BE00B5187D /* icon.icns */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
9E2E533A103B33CB00DF2D13 /* Server.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E2E5339103B33CB00DF2D13 /* Server.m */; };
9E43AC84104DB51400263989 /* WebScripObject+Objective-J.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E43AC83104DB51400263989 /* WebScripObject+Objective-J.m */; };
9E44CA9D0FD798FE00860A54 /* NSURL+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E44CA9C0FD798FE00860A54 /* NSURL+Additions.m */; };
9E4EBB4210892BDE0091C8E9 /* BridgedMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E4EBB4110892BDE0091C8E9 /* BridgedMethods.m */; };
9E52D2F9119B05EF00B831FC /* AppController+WebPolicyDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E52D2F8119B05EF00B831FC /* AppController+WebPolicyDelegate.m */; };
9E535D05104F6F4900C119FA /* AppController+MainMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E535D04104F6F4900C119FA /* AppController+MainMenu.m */; };
9E535D32104F73FB00C119FA /* MenuBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E535D31104F73FB00C119FA /* MenuBridge.m */; };
9E535D37104F761F00C119FA /* MenuItemBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E535D36104F761F00C119FA /* MenuItemBridge.m */; };
9E55CFE50FE8750C007D1D64 /* Console.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E55CFE40FE8750C007D1D64 /* Console.m */; };
9E5D4F0D1090FB6E00E76B38 /* WebWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E5D4F0C1090FB6E00E76B38 /* WebWindow.m */; };
9E9DD6C00FC93C7A0001EF2E /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E9DD6BF0FC93C7A0001EF2E /* WebKit.framework */; };
9EA1BEF7107E7EE500CDE684 /* Application.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EA1BEF6107E7EE500CDE684 /* Application.m */; };
9EB99C960FD8968100AA94A2 /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EB99C950FD8968100AA94A2 /* AppController.m */; };
9EBC421E10B1D07100C2AE33 /* NSObject+WebAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EBC421D10B1D07100C2AE33 /* NSObject+WebAdditions.m */; };
9ED96C8A1020072300D24B9C /* AppController+WebUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ED96C871020072300D24B9C /* AppController+WebUIDelegate.m */; };
9ED96C8B1020072300D24B9C /* AppController+WebFrameLoadDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ED96C881020072300D24B9C /* AppController+WebFrameLoadDelegate.m */; };
9ED96C8C1020072300D24B9C /* AppController+WebResourceLoadDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ED96C891020072300D24B9C /* AppController+WebResourceLoadDelegate.m */; };
AD8D31C6108F98B00008F7C4 /* SSCrypto.m in Sources */ = {isa = PBXBuildFile; fileRef = AD8D31C5108F98B00008F7C4 /* SSCrypto.m */; };
AD8D31C9108F98E40008F7C4 /* libssl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AD8D31C8108F98E40008F7C4 /* libssl.dylib */; };
AD8D31CB108F98EF0008F7C4 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AD8D31CA108F98EF0008F7C4 /* libcrypto.dylib */; };
AD8D350F109040300008F7C4 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD8D350E109040300008F7C4 /* IOKit.framework */; };
ADCCEF6810D43C970055BDFD /* WebPasteboardProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = ADCCEF3310D4370F0055BDFD /* WebPasteboardProxy.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
32CA4F630368D1EE00C91783 /* NativeHost_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeHost_Prefix.pch; sourceTree = "<group>"; };
4D55A7931180F1BE00B5187D /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* NativeHost.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NativeHost.app; sourceTree = BUILT_PRODUCTS_DIR; };
9E2E5338103B33CB00DF2D13 /* Server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Server.h; sourceTree = "<group>"; };
9E2E5339103B33CB00DF2D13 /* Server.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Server.m; sourceTree = "<group>"; };
9E43AC82104DB51400263989 /* WebScripObject+Objective-J.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WebScripObject+Objective-J.h"; sourceTree = "<group>"; };
9E43AC83104DB51400263989 /* WebScripObject+Objective-J.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WebScripObject+Objective-J.m"; sourceTree = "<group>"; };
9E44CA9B0FD798FE00860A54 /* NSURL+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+Additions.h"; sourceTree = "<group>"; };
9E44CA9C0FD798FE00860A54 /* NSURL+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+Additions.m"; sourceTree = "<group>"; };
9E4EBB4010892BDE0091C8E9 /* BridgedMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgedMethods.h; sourceTree = "<group>"; };
9E4EBB4110892BDE0091C8E9 /* BridgedMethods.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BridgedMethods.m; sourceTree = "<group>"; };
9E52D2F8119B05EF00B831FC /* AppController+WebPolicyDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AppController+WebPolicyDelegate.m"; sourceTree = "<group>"; };
9E535D04104F6F4900C119FA /* AppController+MainMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AppController+MainMenu.m"; sourceTree = "<group>"; };
9E535D30104F73FB00C119FA /* MenuBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuBridge.h; sourceTree = "<group>"; };
9E535D31104F73FB00C119FA /* MenuBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuBridge.m; sourceTree = "<group>"; };
9E535D35104F761F00C119FA /* MenuItemBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuItemBridge.h; sourceTree = "<group>"; };
9E535D36104F761F00C119FA /* MenuItemBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuItemBridge.m; sourceTree = "<group>"; };
9E55CFE30FE8750C007D1D64 /* Console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Console.h; sourceTree = "<group>"; };
9E55CFE40FE8750C007D1D64 /* Console.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Console.m; sourceTree = "<group>"; };
9E5D4F0B1090FB6E00E76B38 /* WebWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebWindow.h; sourceTree = "<group>"; };
9E5D4F0C1090FB6E00E76B38 /* WebWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebWindow.m; sourceTree = "<group>"; };
9E9DD6BF0FC93C7A0001EF2E /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
9EA1BEF5107E7EE500CDE684 /* Application.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Application.h; sourceTree = "<group>"; };
9EA1BEF6107E7EE500CDE684 /* Application.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Application.m; sourceTree = "<group>"; };
9EB99C940FD8968100AA94A2 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; };
9EB99C950FD8968100AA94A2 /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = "<group>"; };
9EBC421C10B1D07100C2AE33 /* NSObject+WebAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+WebAdditions.h"; sourceTree = "<group>"; };
9EBC421D10B1D07100C2AE33 /* NSObject+WebAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+WebAdditions.m"; sourceTree = "<group>"; };
9ED96C871020072300D24B9C /* AppController+WebUIDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AppController+WebUIDelegate.m"; sourceTree = "<group>"; };
9ED96C881020072300D24B9C /* AppController+WebFrameLoadDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AppController+WebFrameLoadDelegate.m"; sourceTree = "<group>"; };
9ED96C891020072300D24B9C /* AppController+WebResourceLoadDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AppController+WebResourceLoadDelegate.m"; sourceTree = "<group>"; };
AD8D31C4108F98B00008F7C4 /* SSCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSCrypto.h; sourceTree = "<group>"; };
AD8D31C5108F98B00008F7C4 /* SSCrypto.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSCrypto.m; sourceTree = "<group>"; };
AD8D31C8108F98E40008F7C4 /* libssl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libssl.dylib; path = /usr/lib/libssl.dylib; sourceTree = "<absolute>"; };
AD8D31CA108F98EF0008F7C4 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = /usr/lib/libcrypto.dylib; sourceTree = "<absolute>"; };
AD8D350E109040300008F7C4 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
ADCCEF3210D4370F0055BDFD /* WebPasteboardProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPasteboardProxy.h; sourceTree = "<group>"; };
ADCCEF3310D4370F0055BDFD /* WebPasteboardProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebPasteboardProxy.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
9E9DD6C00FC93C7A0001EF2E /* WebKit.framework in Frameworks */,
AD8D31C9108F98E40008F7C4 /* libssl.dylib in Frameworks */,
AD8D31CB108F98EF0008F7C4 /* libcrypto.dylib in Frameworks */,
AD8D350F109040300008F7C4 /* IOKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
9E535D04104F6F4900C119FA /* AppController+MainMenu.m */,
9ED96C881020072300D24B9C /* AppController+WebFrameLoadDelegate.m */,
9ED96C891020072300D24B9C /* AppController+WebResourceLoadDelegate.m */,
9ED96C871020072300D24B9C /* AppController+WebUIDelegate.m */,
9E52D2F8119B05EF00B831FC /* AppController+WebPolicyDelegate.m */,
9EB99C940FD8968100AA94A2 /* AppController.h */,
9EB99C950FD8968100AA94A2 /* AppController.m */,
9EA1BEF5107E7EE500CDE684 /* Application.h */,
9EA1BEF6107E7EE500CDE684 /* Application.m */,
9E55CFE30FE8750C007D1D64 /* Console.h */,
9E55CFE40FE8750C007D1D64 /* Console.m */,
9E2E5338103B33CB00DF2D13 /* Server.h */,
9E2E5339103B33CB00DF2D13 /* Server.m */,
AD8D31C4108F98B00008F7C4 /* SSCrypto.h */,
AD8D31C5108F98B00008F7C4 /* SSCrypto.m */,
9E5D4F0B1090FB6E00E76B38 /* WebWindow.h */,
9E5D4F0C1090FB6E00E76B38 /* WebWindow.m */,
9E1E34190FCC82A5007F8CA0 /* Bridge */,
);
name = Classes;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
AD8D31CA108F98EF0008F7C4 /* libcrypto.dylib */,
AD8D31C8108F98E40008F7C4 /* libssl.dylib */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
AD8D350E109040300008F7C4 /* IOKit.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
9E9DD6BF0FC93C7A0001EF2E /* WebKit.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* NativeHost.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* NativeHost */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = NativeHost;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
29B97316FDCFA39411CA2CEA /* main.m */,
32CA4F630368D1EE00C91783 /* NativeHost_Prefix.pch */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
4D55A7931180F1BE00B5187D /* icon.icns */,
8D1107310486CEB800E47090 /* Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
9E1E34190FCC82A5007F8CA0 /* Bridge */ = {
isa = PBXGroup;
children = (
9E535DB7104F923E00C119FA /* Menus */,
9E4EBB4010892BDE0091C8E9 /* BridgedMethods.h */,
9E4EBB4110892BDE0091C8E9 /* BridgedMethods.m */,
9EBC421C10B1D07100C2AE33 /* NSObject+WebAdditions.h */,
9EBC421D10B1D07100C2AE33 /* NSObject+WebAdditions.m */,
9E44CA9B0FD798FE00860A54 /* NSURL+Additions.h */,
9E44CA9C0FD798FE00860A54 /* NSURL+Additions.m */,
ADCCEF3210D4370F0055BDFD /* WebPasteboardProxy.h */,
ADCCEF3310D4370F0055BDFD /* WebPasteboardProxy.m */,
9E43AC82104DB51400263989 /* WebScripObject+Objective-J.h */,
9E43AC83104DB51400263989 /* WebScripObject+Objective-J.m */,
);
name = Bridge;
sourceTree = "<group>";
};
9E535DB7104F923E00C119FA /* Menus */ = {
isa = PBXGroup;
children = (
9E535D30104F73FB00C119FA /* MenuBridge.h */,
9E535D31104F73FB00C119FA /* MenuBridge.m */,
9E535D35104F761F00C119FA /* MenuItemBridge.h */,
9E535D36104F761F00C119FA /* MenuItemBridge.m */,
);
name = Menus;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* NativeHost */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "NativeHost" */;
buildPhases = (
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NativeHost;
productInstallPath = "$(HOME)/Applications";
productName = NativeHost;
productReference = 8D1107320486CEB800E47090 /* NativeHost.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0440;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NativeHost" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* NativeHost */;
projectDirPath = "";
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* NativeHost */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
4D55A7941180F1E000B5187D /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9E535D05104F6F4900C119FA /* AppController+MainMenu.m in Sources */,
9ED96C8B1020072300D24B9C /* AppController+WebFrameLoadDelegate.m in Sources */,
9ED96C8C1020072300D24B9C /* AppController+WebResourceLoadDelegate.m in Sources */,
9ED96C8A1020072300D24B9C /* AppController+WebUIDelegate.m in Sources */,
9EB99C960FD8968100AA94A2 /* AppController.m in Sources */,
9EA1BEF7107E7EE500CDE684 /* Application.m in Sources */,
9E4EBB4210892BDE0091C8E9 /* BridgedMethods.m in Sources */,
9E55CFE50FE8750C007D1D64 /* Console.m in Sources */,
8D11072D0486CEB800E47090 /* main.m in Sources */,
9E535D32104F73FB00C119FA /* MenuBridge.m in Sources */,
9E535D37104F761F00C119FA /* MenuItemBridge.m in Sources */,
9EBC421E10B1D07100C2AE33 /* NSObject+WebAdditions.m in Sources */,
9E44CA9D0FD798FE00860A54 /* NSURL+Additions.m in Sources */,
9E2E533A103B33CB00DF2D13 /* Server.m in Sources */,
AD8D31C6108F98B00008F7C4 /* SSCrypto.m in Sources */,
ADCCEF6810D43C970055BDFD /* WebPasteboardProxy.m in Sources */,
9E43AC84104DB51400263989 /* WebScripObject+Objective-J.m in Sources */,
9E5D4F0D1090FB6E00E76B38 /* WebWindow.m in Sources */,
9E52D2F9119B05EF00B831FC /* AppController+WebPolicyDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
089C165DFE840E0CC02AAC07 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
1DDD58150DA1D0A300B32029 /* English */,
);
name = MainMenu.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NativeHost_Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = "ACTIVATION=0";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = Info.plist;
INFOPLIST_PREPROCESS = YES;
INFOPLIST_PREPROCESSOR_DEFINITIONS = "ACTIVATION=0";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = NativeHost;
};
name = Debug;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NativeHost_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = Info.plist;
INFOPLIST_PREPROCESS = YES;
INFOPLIST_PREPROCESSOR_DEFINITIONS = "ACTIVATION=0";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = NativeHost;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_VERSION = 4.2;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SDKROOT = macosx;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "NativeHost" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4B08A954540054247B /* Debug */,
C01FCF4C08A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NativeHost" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
-8
View File
@@ -1,8 +0,0 @@
//
// Prefix header for all source files of the 'NativeHost' target in the 'NativeHost' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
#endif
-116
View File
@@ -1,116 +0,0 @@
/*
Copyright (c) 2003-2006, Septicus Software All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Septicus Software nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//
// SSCrypto.h
//
// Created by Ed Silva on Sat May 31 2003.
// Copyright (c) 2003-2006 Septicus Software. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <openssl/evp.h>
#import <openssl/rand.h>
#import <openssl/rsa.h>
#import <openssl/engine.h>
#import <openssl/sha.h>
#import <openssl/pem.h>
#import <openssl/bio.h>
#import <openssl/err.h>
#import <openssl/ssl.h>
#import <openssl/md5.h>
@interface NSData (HexDump)
- (NSString *)encodeBase64;
- (NSString *)encodeBase64WithNewlines:(BOOL)encodeWithNewlines;
- (NSData *)decodeBase64;
- (NSData *)decodeBase64WithNewLines:(BOOL)decodeWithNewLines;
- (NSString *)hexval;
- (NSString *)hexdump;
@end
@interface SSCrypto : NSObject
{
NSData *symmetricKey;
NSData *cipherText;
NSData *clearText;
NSData *publicKey;
NSData *privateKey;
BOOL isSymmetric;
}
- (id)init;
- (id)initWithSymmetricKey:(NSData *)k;
- (id)initWithPublicKey:(NSData *)pub;
- (id)initWithPrivateKey:(NSData *)priv;
- (id)initWithPublicKey:(NSData *)pub privateKey:(NSData *)priv;
- (BOOL)isSymmetric;
- (void)setIsSymmetric:(BOOL)flag;
- (NSData *)symmetricKey;
- (void)setSymmetricKey:(NSData *)k;
- (NSData *)publicKey;
- (void)setPublicKey:(NSData *)k;
- (NSData *)privateKey;
- (void)setPrivateKey:(NSData *)k;
- (NSData *)clearTextAsData;
- (NSString *)clearTextAsString;
- (void)setClearTextWithData:(NSData *)c;
- (void)setClearTextWithString:(NSString *)c;
- (NSData *)cipherTextAsData;
- (NSString *)cipherTextAsString;
- (void)setCipherText:(NSData *)c;
- (NSData *)decrypt;
- (NSData *)decrypt:(NSString *)cipherName;
- (NSData *)verify;
- (NSData *)encrypt;
- (NSData *)encrypt:(NSString *)cipherName;
- (NSData *)sign;
- (NSData *)digest:(NSString *)digestName;
+ (NSData *)generateRSAPrivateKeyWithLength:(int)length;
+ (NSData *)generateRSAPublicKeyFromPrivateKey:(NSData *)privateKey;
+ (NSData *)getKeyDataWithLength:(int)length;
+ (NSData *)getKeyDataWithLength:(int)length fromPassword:(NSString *)pass withSalt:(NSString *)salt;
+ (NSData *)getKeyDataWithLength:(int)length fromPassword:(NSString *)pass withSalt:(NSString *)salt withIterations:(int)count;
+ (NSData *)getSHA1ForData:(NSData *)d;
+ (NSData *)getMD5ForData:(NSData *)d;
@end
File diff suppressed because it is too large. Load diff
-21
View File
@@ -1,21 +0,0 @@
//
// Server.h
// NativeHost
//
// Created by Francisco Tolmasky on 8/18/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface Server : NSObject
{
NSFileHandle * outputFile;
NSFileHandle * errorFile;
NSTask * process;
}
- (BOOL)start;
- (void)stop;
@end
-193
View File
@@ -1,193 +0,0 @@
//
// Server.m
// NativeHost
//
// Created by Francisco Tolmasky on 8/18/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "Server.h"
#import "AppController.h"
#import <sys/socket.h>
#import <netinet/in.h>
@implementation Server
- (BOOL)start
{
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *serverPath = [mainBundle pathForResource:@"NativeHostServer" ofType:@"" inDirectory:@"Server"];
if (!serverPath)
{
return YES;
}
// find an available port
struct sockaddr_in addr;
int sockfd;
int attempts = 0;
while (SERVER_PORT == 9191 && attempts++ < 5)
{
// Create a socket
sockfd = socket( AF_INET, SOCK_STREAM, 0 );
// Setup its address structure
bzero( &addr, sizeof(struct sockaddr_in));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl( INADDR_ANY );
addr.sin_port = htons( 0 );
// Bind it to an address and port
bind( sockfd, (struct sockaddr *)&addr, sizeof(struct sockaddr));
// Set it listening for connections
listen( sockfd, 5 );
// Find out what port the socket was bound to
socklen_t namelen = sizeof(struct sockaddr_in);
getsockname( sockfd, (struct sockaddr *)&addr, &namelen );
if (addr.sin_port <= 1024)
addr.sin_port = 9191;
else
SERVER_PORT = addr.sin_port;
shutdown(sockfd, 2);
}
if (SERVER_PASSWORD == nil)
{
CFUUIDRef uuidObj = CFUUIDCreate(nil);
SERVER_PASSWORD = (NSString*)CFUUIDCreateString(nil, uuidObj);
CFRelease(uuidObj);
}
if (SERVER_USER == nil)
{
CFUUIDRef uuidObj = CFUUIDCreate(nil);
SERVER_USER = (NSString*)CFUUIDCreateString(nil, uuidObj);
CFRelease(uuidObj);
// usernames can't have "-" in them
SERVER_USER = [[SERVER_USER autorelease] stringByReplacingOccurrencesOfString:@"-" withString:@""];
}
// setup environment variables
NSDictionary *env = [[[NSProcessInfo processInfo] environment] mutableCopy];
[env setValue:[mainBundle resourcePath] forKey:@"NATIVEHOST_RESOURCES"];
[env setValue:[[NSNumber numberWithInt:SERVER_PORT] stringValue] forKey:@"NATIVEHOST_SERVER_PORT"];
[env setValue:SERVER_USER forKey:@"NATIVEHOST_SERVER_USER"];
[env setValue:SERVER_PASSWORD forKey:@"NATIVEHOST_SERVER_PASSWORD"];
// create pipes for stdout and stderr
NSPipe * outputPipe = [NSPipe pipe];
outputFile = [outputPipe fileHandleForReading];
NSPipe * errorPipe = [NSPipe pipe];
errorFile = [errorPipe fileHandleForReading];
// setup the process
process = [[NSTask alloc] init];
[process setLaunchPath:serverPath];
[process setStandardOutput:outputPipe];
[process setStandardError:errorPipe];
[process setEnvironment:env];
[env release];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(serverDidTerminate:)
name:NSTaskDidTerminateNotification
object:process];
[process launch];
BOOL didStartup = NO;
NSData * data = nil;
while (!didStartup && (data = [outputFile availableData]) && [data length])
{
NSString * string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
if (string)
{
NHLog(@"SERVER-OUT", string);
didStartup = [string rangeOfString:@"Jack is starting up"].location != NSNotFound;
[string release];
}
}
NSLog(@"Server has started.");
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(didReadStdOut:)
name:NSFileHandleReadCompletionNotification
object:outputFile];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(didReadStdErr:)
name:NSFileHandleReadCompletionNotification
object:errorFile];
[outputFile readInBackgroundAndNotify];
[errorFile readInBackgroundAndNotify];
return didStartup;
}
- (void)stop
{
[process terminate];
}
- (void)didReadStdOut:(NSNotification *)aNotification
{
NSString * string = [[NSString alloc] initWithData:[[aNotification userInfo] objectForKey:NSFileHandleNotificationDataItem]
encoding:NSASCIIStringEncoding];
NHLog(@"SERVER-OUT", string);
[string release];
[outputFile readInBackgroundAndNotify];
}
- (void)didReadStdErr:(NSNotification *)aNotification
{
NSString * string = [[NSString alloc] initWithData:[[aNotification userInfo] objectForKey:NSFileHandleNotificationDataItem]
encoding:NSASCIIStringEncoding];
NHLog(@"SERVER-ERR", string);
[string release];
[errorFile readInBackgroundAndNotify];
}
- (void)serverDidTerminate:(NSNotification *)note
{
if ([process terminationStatus] != 0)
{
NSString *appName = [[[NSBundle mainBundle] localizedInfoDictionary] objectForKey:@"CFBundleDisplayName"];
if (appName == nil)
appName = [[NSProcessInfo processInfo] processName];
if (SERVER_PORT != 9191 && [self start])
{
NSRunAlertPanel(@"Unexpected Error",
[NSString stringWithFormat:@"%@ was not able to complete the last action you performed. Try again, and report the problem if it continues to occur.", appName],
@"OK", nil, nil);
}
else
{
NSRunAlertPanel(@"Unexpected Error",
[NSString stringWithFormat:@"A fatal error occurred. %@ could not recover and must terminate.", appName],
@"Terminate", nil, nil);
exit(1);
}
}
}
- (void)dealloc
{
[process release];
[super dealloc];
}
@end
-19
View File
@@ -1,19 +0,0 @@
//
// WebPasteboardProxy.h
// NativeHost
//
// Created by Ross Boucher on 12/12/09.
// Copyright 2009 280 North. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface WebPasteboardProxy : NSObject
{
NSPasteboard *pasteboard;
}
+ (id)pasteboardWithName:(NSString *)aName;
@end
-95
View File
@@ -1,95 +0,0 @@
//
// WebPasteboardProxy.m
// NativeHost
//
// Created by Ross Boucher on 12/12/09.
// Copyright 2009 280 North. All rights reserved.
//
#import "WebPasteboardProxy.h"
#import "WebScripObject+Objective-J.h"
#import "BridgedMethods.h"
NSMutableDictionary *WebPasteboardDictionary = nil;
@implementation WebPasteboardProxy
+ (void)initialize
{
WebPasteboardDictionary = [[NSMutableDictionary dictionary] retain];
}
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
{
return NO;
}
+ (id)pasteboardWithName:(NSString *)aName
{
if ([aName isEqual:@"CPGeneralPboard"])
return [self pasteboardWithName:NSGeneralPboard];
id proxy = [WebPasteboardDictionary objectForKey:aName];
if (!proxy)
{
proxy = [[self alloc] initWithPasteboard:[NSPasteboard pasteboardWithName:aName]];
[WebPasteboardDictionary setObject:proxy forKey:aName];
[proxy release];
}
return proxy;
}
- (id)initWithPasteboard:(NSPasteboard *)aPasteboard
{
if (self = [super init])
{
pasteboard = [aPasteboard retain];
}
return self;
}
- (void)dealloc
{
[pasteboard release];
[super dealloc];
}
- (int)changeCount
{
return [pasteboard changeCount];
}
- (void)declareTypes:(WebScriptObject *)args
{
[pasteboard declareTypes:[BridgedMethods arrayFromWebScriptObject:args] owner:self];
}
- (void)addTypes:(WebScriptObject *)args
{
[pasteboard addTypes:[BridgedMethods arrayFromWebScriptObject:args ] owner:self];
}
- (NSArray *)types
{
return [pasteboard types];
}
- (NSString *)stringForType:(NSString *)aType
{
return [pasteboard stringForType:aType];
}
- (void)pasteboard:(NSPasteboard *)aPasteboard provideDataForType:(NSString *)aType
{
NSString *name = aPasteboard == [NSPasteboard generalPasteboard] ? @"CPGeneralPboard" : [aPasteboard name];
NSString *data = [[[NSApp delegate] windowScriptObject] evaluateObjectiveJReturningString:
[NSString stringWithFormat:@"[[CPPasteboard pasteboardWithName:'%@'] stringForType:'%@']", name, aType]
];
[aPasteboard setString:data forType:aType];
}
@end
@@ -1,22 +0,0 @@
//
// WebScripObject+Objective-J.h
// NativeHost
//
// Created by Francisco Tolmasky on 9/1/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface WebScriptObject (ObjectiveJ)
- (id)evaluateObjectiveJ:(NSString *)aString;
- (NSString *)evaluateObjectiveJReturningString:(NSString *)aString;
- (id)bridgeSelector:(SEL)aSelector;
- (id)bridgeSelector:(SEL)aSelector withObject:(id)anObject;
- (id)bridgeSelector:(SEL)aSelector withObjects:(NSArray *)array;
@end
@@ -1,46 +0,0 @@
//
// WebScripObject+Objective-J.m
// NativeHost
//
// Created by Francisco Tolmasky on 9/1/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "WebScripObject+Objective-J.h"
@implementation WebScriptObject (ObjectiveJ)
- (id)evaluateObjectiveJ:(NSString *)aString
{
return [self evaluateWebScript:[NSString stringWithFormat:@"(ObjectiveJ.eval(decodeURIComponent(\"%@\")))", [aString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], nil]];
}
- (NSString *)evaluateObjectiveJReturningString:(NSString *)aString
{
return [self evaluateWebScript:[NSString stringWithFormat:@"String(ObjectiveJ.eval(decodeURIComponent(\"%@\")))", [aString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], nil]];
}
- (id)bridgeSelector:(SEL)aSelector
{
return [self bridgeSelector:aSelector withObjects:nil];
}
- (id)bridgeSelector:(SEL)aSelector withObject:(id)anObject
{
return [self bridgeSelector:aSelector withObjects:[NSArray arrayWithObject:anObject]];
}
- (id)bridgeSelector:(SEL)aSelector withObjects:(NSArray *)objects
{
[self evaluateWebScript:@"objj_object.prototype.__objj_msgSend = function() { return objj_msgSend.apply(null, arguments); }"];
NSArray * arguments = [NSArray arrayWithObjects:self, NSStringFromSelector(aSelector), nil];
if (objects)
arguments = [arguments arrayByAddingObjectsFromArray:objects];
return [self callWebScriptMethod:@"__objj_msgSend" withArguments:arguments];
}
@end
-44
View File
@@ -1,44 +0,0 @@
//
// WebWindow.h
// NativeHost
//
// Created by Francisco Tolmasky on 10/18/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
typedef enum _CPWindowShadowStyle
{
CPStandardWindowShadowStyle = 0,
CPMenuWindowShadowStyle = 1,
CPPanelWindowShadowStyle = 2,
CPCustomWindowShadowStyle = 3
} CPWindowShadowStyle;
@interface WebWindow : NSWindow
{
NSView * leftMouseDownView;
NSView * rightMouseDownView;
WebView * webView;
NSView * shadowView;
BOOL hasShadow;
CPWindowShadowStyle shadowStyle;
}
+ (WebWindow *)webWindow;
- (WebView *)webView;
- (BOOL)hitTest:(NSPoint)aPoint;
- (BOOL)hasShadow;
- (void)setHasShadow:(BOOL)shouldHaveShadow;
- (void)setShadowStyle:(CPWindowShadowStyle)aStyle;
- (CPWindowShadowStyle)shadowStyle;
@end
-515
View File
@@ -1,515 +0,0 @@
//
// WebWindow.m
// NativeHost
//
// Created by Francisco Tolmasky on 10/18/09.
// Copyright 2009 280 North, Inc.. All rights reserved.
//
#import "WebWindow.h"
static NSMutableArray * DisabledWindows;
CFMachPortRef tap_port;
CGEventRef headTapCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon)
{
// It's dangerous to fail in this code: could disable mousedown system-wide. So just try catch it all.
@try
{
if (type == kCGEventLeftMouseDown)
{
CGPoint location = CGEventGetLocation(event);
NSPoint NSLocation = NSMakePoint(location.x, location.y);
for (NSWindow * window in [NSApp windows])
{
if ([window isKindOfClass:[WebWindow class]] && ![(WebWindow *)window hitTest:NSLocation])
{
[window setIgnoresMouseEvents:YES];
[window performSelector:@selector(setIgnoresMouseEvents:) withObject:NO afterDelay:1.0];
[DisabledWindows addObject:window];
}
}
}
else if (type == kCGEventTapDisabledByTimeout)
CGEventTapEnable(tap_port, YES);
}
@catch (NSException * anException)
{
}
return event;
}
@interface WebWindowContentView : NSView
{
}
@end
@implementation WebWindow
+ (void)enableAllWindows
{
[DisabledWindows makeObjectsPerformSelector:@selector(stopIgnoringMouseEvents)];
[DisabledWindows removeAllObjects];
}
+ (void)initialize
{
if (self != [WebWindow class])
return;
DisabledWindows = [[NSMutableArray alloc] init];
//| CGEventMaskBit(kCGEventTapDisabledByTimeout)
tap_port = CGEventTapCreate(kCGSessionEventTap, kCGHeadInsertEventTap,
kCGEventTapOptionDefault,
CGEventMaskBit(kCGEventLeftMouseDown),
headTapCallback, NULL);
if (NULL == tap_port)
{
fprintf(stderr, "Error creating event tap\n");
return;
}
/* Create a run loop source from the tap port, add it to my run loop
* and start executing the loop
*/
CFRunLoopSourceRef tap_source = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, tap_port, 0);
if (NULL == tap_source)
{
fprintf(stderr, "Error converting port to run loop source\n");
if (tap_port != NULL)
CFRelease(tap_port);
return;
}
CFRunLoopAddSource(CFRunLoopGetCurrent(), tap_source, kCFRunLoopCommonModes);
}
- (id)initWithContentRect:(NSRect)aContentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)aBufferingType defer:(BOOL)shouldDeferCreation
{
self = [super initWithContentRect:aContentRect styleMask:NSBorderlessWindowMask backing:aBufferingType defer:shouldDeferCreation];
if (self)
{
id delegate = [NSApp delegate];
shadowView = [[WebWindowContentView alloc] init];
[self setContentView:shadowView];
webView = [[WebView alloc] initWithFrame:NSZeroRect];
[webView setDrawsBackground:NO];
[webView setUIDelegate:delegate];
[webView setFrameLoadDelegate:delegate];
[webView setResourceLoadDelegate:delegate];
[webView setPolicyDelegate:delegate];
[webView setShouldCloseWithWindow:YES];
[shadowView addSubview:webView];
[self setBackgroundColor:[NSColor clearColor]];
[self setOpaque:NO];
[self setIgnoresMouseEvents:NO];
[self setReleasedWhenClosed:YES];
[super setHasShadow:NO];
}
return self;
}
- (void)setFrame:(NSRect)aFrame display:(BOOL)shouldDisplay
{
[webView setFrame:NSMakeRect(33.0, 33.0, NSWidth(aFrame), NSHeight(aFrame))];
[super setFrame:NSInsetRect(aFrame, -33.0, -33.0) display:YES];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResizeNotification object:self];
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidBecomeKeyNotification object:self];
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResignKeyNotification object:self];
[shadowView release];
[webView release];
[super dealloc];
}
- (BOOL)canBecomeKeyWindow
{
// Necessary since this apparently returns NO for borderless windows.
return YES;
}
- (NSView *)webHitTest:(NSPoint)aPoint
{
NSPoint locationInWebView = [[self contentView] convertPoint:aPoint fromView:nil];
return [(NSView *)[self contentView] hitTest:locationInWebView];
}
- (void)sendEvent:(NSEvent *)anEvent
{
NSInteger type = [anEvent type];
if (type == NSLeftMouseDown)
{
NSView * view = [self webHitTest:[anEvent locationInWindow]];
leftMouseDownView = view;
[view mouseDown:anEvent];
}
else if (type == NSLeftMouseDragged)
[leftMouseDownView mouseDragged:anEvent];
else if (type == NSLeftMouseUp)
[leftMouseDownView mouseUp:anEvent];
else if (type == NSRightMouseDown)
{
NSView * view = [self webHitTest:[anEvent locationInWindow]];
rightMouseDownView = view;
[view rightMouseDown:anEvent];
}
else if (type == NSRightMouseDragged)
[rightMouseDownView rightMouseDragged:anEvent];
else if (type == NSRightMouseUp)
[rightMouseDownView rightMouseUp:anEvent];
else
[super sendEvent:anEvent];
// FIXME: other
}
// Override this to avoid the beep from unhandled events.
- (void)keyDown:(NSEvent *)anEvent
{
}
+ (WebWindow *)webWindow
{
return [[WebWindow alloc] initWithContentRect:NSZeroRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
}
- (WebView *)webView
{
return webView;
}
- (void)updateShadow
{
[super setHasShadow:hasShadow && shadowStyle == CPCustomWindowShadowStyle];
[shadowView setNeedsDisplay:YES];
}
- (BOOL)hasShadow
{
return hasShadow;
}
- (void)setHasShadow:(BOOL)shouldHaveShadow
{
if (hasShadow == shouldHaveShadow)
return;
hasShadow = shouldHaveShadow;
[self updateShadow];
}
- (CPWindowShadowStyle)shadowStyle
{
return shadowStyle;
}
- (void)setShadowStyle:(CPWindowShadowStyle)aStyle
{
if (shadowStyle == aStyle)
return;
shadowStyle = aStyle;
[self updateShadow];
}
- (BOOL)hitTest:(NSPoint)aPoint
{
NSInteger windowNumber = [[[webView windowScriptObject] valueForKey:@"cpWindowNumber"] intValue];
#if LOGGING
WebScriptObject * frame = [[[NSApp delegate] windowScriptObject] evaluateWebScript:[NSString stringWithFormat:@"(objj_msgSend(objj_msgSend(CPApp, \"windowWithWindowNumber:\", %d), \"frame\"))", windowNumber]],
* origin = [frame valueForKey:@"origin"],
* size = [frame valueForKey:@"size"];
NSLog(@"(%f, %f) in { %f, %f, %f, %f }", aPoint.x, aPoint.y, [[origin valueForKey:@"x"] floatValue], [[origin valueForKey:@"y"] floatValue], [[size valueForKey:@"width"] floatValue], [[size valueForKey:@"height"] floatValue]);
#endif
return [[[[NSApp delegate] windowScriptObject] evaluateWebScript:[NSString stringWithFormat:@"(CGRectContainsPoint(objj_msgSend(objj_msgSend(CPApp, \"windowWithWindowNumber:\", %d), \"frame\"), CGPointMake(%f, %f)))", windowNumber, aPoint.x, aPoint.y]] boolValue];
}
- (void)stopIgnoringMouseEvents
{
[self setIgnoresMouseEvents:NO];
}
- (void)becomeKeyWindow
{
[super becomeKeyWindow];
[self updateShadow];
}
- (void)resignKeyWindow
{
[super resignKeyWindow];
[self updateShadow];
}
@end
@interface NSImage (Additions)
- (void)drawInRect:(NSRect)aRect slices:(CGFloat [])slices;
@end
@implementation NSImage (Additions)
- (void)drawInRect:(NSRect)aRect slices:(CGFloat [])slices
{
NSRect imageBounds = NSMakeRect(0.0, 0.0, [self size].width, [self size].height);
[self drawInRect:NSMakeRect(0.0, 0.0, slices[0], slices[1])
fromRect:NSMakeRect(0.0, 0.0, slices[0], slices[1])
operation:NSCompositeSourceOver
fraction:1.0];
[self drawInRect:NSMakeRect(NSMaxX(aRect) - slices[2], 0.0, slices[2], slices[1])
fromRect:NSMakeRect(NSMaxX(imageBounds) - slices[2], 0.0, slices[2], slices[1])
operation:NSCompositeSourceOver
fraction:1.0];
[self drawInRect:NSMakeRect(0.0, NSMaxY(aRect) - slices[3], slices[0], slices[3])
fromRect:NSMakeRect(0.0, NSMaxY(imageBounds) - slices[3], slices[0], slices[3])
operation:NSCompositeSourceOver
fraction:1.0];
[self drawInRect:NSMakeRect(NSMaxX(aRect) - slices[2], NSMaxY(aRect) - slices[3], slices[2], slices[3])
fromRect:NSMakeRect(NSMaxX(imageBounds) - slices[2], NSMaxY(imageBounds) - slices[3], slices[2], slices[3])
operation:NSCompositeSourceOver
fraction:1.0];
[self drawInRect:NSMakeRect(slices[0], 0.0, NSWidth(aRect) - slices[0] - slices[2], slices[1])
fromRect:NSMakeRect(slices[0], 0.0, 1.0, slices[1])
operation:NSCompositeSourceOver
fraction:1.0];
[self drawInRect:NSMakeRect(0.0, slices[1], slices[0], NSHeight(aRect) - slices[1] - slices[3])
fromRect:NSMakeRect(0.0, slices[1], slices[0], 1.0)
operation:NSCompositeSourceOver
fraction:1.0];
[self drawInRect:NSMakeRect(NSMaxX(aRect) - slices[2], slices[1], slices[2], NSHeight(aRect) - slices[1] - slices[3])
fromRect:NSMakeRect(NSMaxX(imageBounds) - slices[2], slices[1], slices[2], 1.0)
operation:NSCompositeSourceOver
fraction:1.0];
[self drawInRect:NSMakeRect(slices[0], NSMaxY(aRect) - slices[3], NSWidth(aRect) - slices[0] - slices[2], slices[3])
fromRect:NSMakeRect(slices[0], NSMaxY(imageBounds) - slices[3], 1.0, slices[3])
operation:NSCompositeSourceOver
fraction:1.0];
}
@end
@implementation WebWindowContentView : NSView
{
}
static float OUTlINE_HORIZONTAL_INSET = 33.0;
static float OUTlINE_VERTICAL_INSET = 33.0;
- (void)drawStandardActiveShadowInRect:(NSRect)aRect
{
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
CGRect bounds = CGRectInset(*(CGRect *)&aRect, OUTlINE_HORIZONTAL_INSET - 0.5, OUTlINE_VERTICAL_INSET - 0.5);
CGColorRef shadowColor = CGColorCreateGenericGray(0.0, 0.8);
CGContextSetShadowWithColor (context, CGSizeMake(0.0, -10.0), 100.0, shadowColor);
CGColorRelease(shadowColor);
CGColorRef fillColor = CGColorCreateGenericGray(1.0, 1.0);
CGColorRef strokeColor = CGColorCreateGenericGray(0.0, 0.2);
CGContextSetFillColorWithColor(context, fillColor);
CGContextSetStrokeColorWithColor(context, strokeColor);
CGColorRelease(fillColor);
CGColorRelease(strokeColor);
CGContextBeginPath(context);
CGContextAddArc(context, CGRectGetMinX(bounds) + 5.0, CGRectGetMaxY(bounds) - 5.0, 5.0, M_PI, M_PI_2, YES);
CGContextAddArc(context, CGRectGetMaxX(bounds) - 5.0, CGRectGetMaxY(bounds) - 5.0, 5.0, M_PI_2, 0, YES);
CGContextAddLineToPoint(context, CGRectGetMaxX(bounds), CGRectGetMinY(bounds));
CGContextAddLineToPoint(context, CGRectGetMinX(bounds), CGRectGetMinY(bounds));
CGContextClosePath(context);
CGContextDrawPath(context, kCGPathFillStroke);
}
- (void)drawStandardInactiveShadowInRect:(NSRect)aRect
{
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
CGRect bounds = CGRectInset(*(CGRect *)&aRect, OUTlINE_HORIZONTAL_INSET - 0.5, OUTlINE_VERTICAL_INSET - 0.5);
CGColorRef shadowColor = CGColorCreateGenericGray(0.0, 0.5);
CGContextSetShadowWithColor (context, CGSizeMake(0.0, -10.0), 40.0, shadowColor);
CGColorRelease(shadowColor);
CGColorRef fillColor = CGColorCreateGenericGray(1.0, 1.0);
CGColorRef strokeColor = CGColorCreateGenericGray(0.0, 0.2);
CGContextSetFillColorWithColor(context, fillColor);
CGContextSetStrokeColorWithColor(context, strokeColor);
CGColorRelease(fillColor);
CGColorRelease(strokeColor);
CGContextBeginPath(context);
CGContextAddArc(context, CGRectGetMinX(bounds) + 5.0, CGRectGetMaxY(bounds) - 5.0, 5.0, M_PI, M_PI_2, YES);
CGContextAddArc(context, CGRectGetMaxX(bounds) - 5.0, CGRectGetMaxY(bounds) - 5.0, 5.0, M_PI_2, 0, YES);
CGContextAddLineToPoint(context, CGRectGetMaxX(bounds), CGRectGetMinY(bounds));
CGContextAddLineToPoint(context, CGRectGetMinX(bounds), CGRectGetMinY(bounds));
CGContextClosePath(context);
CGContextDrawPath(context, kCGPathFillStroke);
}
- (void)drawMenuShadowInRect:(NSRect)aRect
{
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
CGRect bounds = CGRectInset(*(CGRect *)&aRect, OUTlINE_HORIZONTAL_INSET - 0.5, OUTlINE_VERTICAL_INSET - 0.5);
CGColorRef shadowColor = CGColorCreateGenericGray(0.0, 0.5);
CGContextSetShadowWithColor (context, CGSizeMake(0.0, -10.0), 30.0, shadowColor);
CGColorRelease(shadowColor);
CGColorRef fillColor = CGColorCreateGenericGray(1.0, 1.0);
CGColorRef strokeColor = CGColorCreateGenericGray(0.0, 0.2);
CGContextSetFillColorWithColor(context, fillColor);
CGContextSetStrokeColorWithColor(context, strokeColor);
CGColorRelease(fillColor);
CGColorRelease(strokeColor);
CGContextBeginPath(context);
CGContextAddArc(context, CGRectGetMinX(bounds) + 3.0, CGRectGetMaxY(bounds) - 3.0, 2.0, M_PI, M_PI_2, YES);
CGContextAddArc(context, CGRectGetMaxX(bounds) - 3.0, CGRectGetMaxY(bounds) - 3.0, 2.0, M_PI_2, 0, YES);
CGContextAddArc(context, CGRectGetMaxX(bounds) - 3.0, CGRectGetMinY(bounds) + 3.0, 2.0, 0, 3 * M_PI_2, YES);
CGContextAddArc(context, CGRectGetMinX(bounds) + 3.0, CGRectGetMinY(bounds) + 3.0, 2.0, 3 * M_PI_2, M_PI, YES);
CGContextClosePath(context);
CGContextDrawPath(context, kCGPathFill);//Stroke);
/*
CGContextBeginPath(context);
CGContextAddArc(context, CGRectGetMinX(bounds) + 3.0, CGRectGetMaxY(bounds) - 3.0, 2.0, M_PI, M_PI_2, YES);
CGContextAddArc(context, CGRectGetMaxX(bounds) - 3.0, CGRectGetMaxY(bounds) - 3.0, 2.0, M_PI_2, 0, YES);
CGContextAddArc(context, CGRectGetMaxX(bounds) - 3.0, CGRectGetMinY(bounds) + 3.0, 2.0, 0, 3 * M_PI_2, YES);
CGContextAddArc(context, CGRectGetMinX(bounds) + 3.0, CGRectGetMinY(bounds) + 3.0, 2.0, 3 * M_PI_2, M_PI, YES);
CGContextClosePath(context);
CGContextSetFillColorWithColor(context, CGColorGetConstantColor(kCGColorClear));
CGContextSetBlendMode(context, kCGBlendModeCopy);
CGContextDrawPath(context, kCGPathFill);
*/
}
- (NSImage *)shadowImageWithSelector:(SEL)aSelector
{
static NSMutableDictionary * images = nil;
if (!images)
images = [[NSMutableDictionary alloc] init];
NSString * name = NSStringFromSelector(aSelector);
NSImage * image = [images objectForKey:name];
if (!image)
{
image = [[NSImage alloc] initWithSize:NSMakeSize(100.0, 100.0)];
[image lockFocus];
objc_msgSend(self, aSelector, NSMakeRect(0.0, 0.0, 100.0, 100.0));
[image unlockFocus];
[images setObject:image forKey:name];
[image release];
}
return image;
}
- (void)drawShadowWithSelector:(SEL)aSelector inRect:(NSRect)aRect
{
CGFloat slices[] = { 40.0, 49.0, 40.0, 49.0 };
if (NSWidth(aRect) > 100.0 || NSHeight(aRect) > 100.0)
[[self shadowImageWithSelector:aSelector] drawInRect:aRect slices:slices];
else
objc_msgSend(self, aSelector, aRect);
}
- (void)drawRect:(NSRect)aRect
{
WebWindow * window = (WebWindow *)[self window];
NSRect bounds = [self bounds];
if (![window hasShadow])
return;
if ([window shadowStyle] == CPStandardWindowShadowStyle)
if ([window isKeyWindow])
return [self drawShadowWithSelector:@selector(drawStandardActiveShadowInRect:) inRect:bounds];
else
return [self drawShadowWithSelector:@selector(drawStandardInactiveShadowInRect:) inRect:bounds];
if ([window shadowStyle] == CPMenuWindowShadowStyle)
return [self drawShadowWithSelector:@selector(drawMenuShadowInRect:) inRect:bounds];
}
@end
Binary file not shown.
-23
View File
@@ -1,23 +0,0 @@
//
// main.m
// NativeHost
//
// Created by Francisco Tolmasky on 5/24/09.
// Copyright 280 North, Inc. 2009. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Application.h"
int interactive = 0;
int main(int argc, char *argv[])
{
if (argc > 1 && strcmp(argv[1], "-i") == 0) {
interactive = 1;
}
[Application sharedApplication];
return NSApplicationMain(argc, (const char **) argv);
}
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14F6a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<development version="6300" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@@ -55,6 +55,12 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW">
<connections>
<action selector="openPreferences:" target="Voe-Tx-rLC" id="s5c-ub-L21"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="aLw-oG-Lg7"/>
<menuItem title="Hide XcodeCapp" keyEquivalent="h" id="sRE-41-LaW">
<connections>
<action selector="hide:" target="-1" id="fqN-rY-k4W"/>
@@ -72,12 +78,6 @@
<action selector="unhideAllApplications:" target="-1" id="Zvz-1V-oYp"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="aLw-oG-Lg7"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW">
<connections>
<action selector="openPreferences:" target="Voe-Tx-rLC" id="s5c-ub-L21"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Quit XcodeCapp" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
@@ -380,7 +380,6 @@
<tableView appearanceType="vibrantLight" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="72" rowSizeStyle="automatic" viewBased="YES" id="Mss-Tu-7kR">
<rect key="frame" x="0.0" y="0.0" width="263" height="0.0"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
@@ -404,7 +403,6 @@
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" id="nss-wl-6TY">
<rect key="frame" x="17" y="49" width="223" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" sendsActionOnEndEditing="YES" title="Table View Cell" id="HCp-It-Jhp">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -417,16 +415,13 @@
<view key="contentView">
<rect key="frame" x="0.0" y="0.0" width="10" height="10"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
</view>
<animations/>
<color key="borderColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</box>
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="MsY-oY-iIn">
<rect key="frame" x="-12" y="-2" width="279" height="5"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
@@ -434,7 +429,6 @@
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="PN4-Zx-XTz">
<rect key="frame" x="17" y="36" width="223" height="11"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" controlSize="mini" lineBreakMode="truncatingMiddle" sendsActionOnEndEditing="YES" title="Label" id="gK0-ds-ocu">
<font key="font" metaFont="miniSystem"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
@@ -448,7 +442,6 @@
<button toolTip="Open In Xcode" verticalHuggingPriority="750" id="0Kk-a1-H2b">
<rect key="frame" x="144" y="0.0" width="33" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<animations/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="open-in-xcode" imagePosition="overlaps" alignment="center" controlSize="small" imageScaling="proportionallyDown" inset="2" id="21c-Zh-TSt">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
@@ -457,7 +450,6 @@
<button toolTip="Switch listening mode" verticalHuggingPriority="750" id="PoH-Du-Pas">
<rect key="frame" x="0.0" y="0.0" width="33" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<animations/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="run" imagePosition="overlaps" alignment="center" controlSize="small" imageScaling="proportionallyDown" inset="2" id="WLR-K6-Jof">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
@@ -466,7 +458,6 @@
<button toolTip="Reset the project" verticalHuggingPriority="750" id="7pJ-O0-Sk5">
<rect key="frame" x="180" y="0.0" width="33" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<animations/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="resync" imagePosition="overlaps" alignment="center" controlSize="small" imageScaling="proportionallyDown" inset="2" id="0lw-E5-col">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
@@ -475,7 +466,6 @@
<button toolTip="Open in Finder" verticalHuggingPriority="750" id="vsI-jy-i4m">
<rect key="frame" x="36" y="0.0" width="33" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<animations/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="open-in-finder" imagePosition="overlaps" alignment="center" controlSize="small" imageScaling="proportionallyDown" inset="2" id="wlx-b2-lHy">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
@@ -484,7 +474,6 @@
<button toolTip="Edit in Code Editor" verticalHuggingPriority="750" id="rTo-y9-fQU">
<rect key="frame" x="72" y="0.0" width="33" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<animations/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="open-in-editor" imagePosition="overlaps" alignment="center" controlSize="small" imageScaling="proportionallyDown" inset="2" id="VDo-2A-vaS">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
@@ -493,19 +482,16 @@
<button toolTip="Open Terminal in Project" verticalHuggingPriority="750" id="dz5-I3-w2h">
<rect key="frame" x="108" y="0.0" width="33" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<animations/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="open-in-terminal" imagePosition="overlaps" alignment="center" controlSize="small" imageScaling="proportionallyDown" inset="2" id="Mwt-yg-Jeo">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
</buttonCell>
</button>
</subviews>
<animations/>
</customView>
<customView id="kNu-ud-1j8" customClass="YRKSpinningProgressIndicator">
<rect key="frame" x="244" y="28" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<animations/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="maxValue">
<integer key="value" value="1"/>
@@ -513,7 +499,6 @@
</userDefinedRuntimeAttributes>
</customView>
</subviews>
<animations/>
<connections>
<outlet property="boxStatus" destination="kpw-qm-NQG" id="wgF-TG-b72"/>
<outlet property="buttonOpenInEditor" destination="rTo-y9-fQU" id="9Wd-NB-CiJ"/>
@@ -537,19 +522,15 @@
</connections>
</tableView>
</subviews>
<animations/>
<nil key="backgroundColor"/>
</clipView>
<animations/>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="GIE-ju-XbD">
<rect key="frame" x="1" y="119" width="223" height="15"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="pb5-AF-zGg">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller>
</scrollView>
<box autoresizesSubviews="NO" transparent="YES" title="Box" boxType="custom" borderType="line" titlePosition="noTitle" id="atN-bp-ONR">
@@ -562,7 +543,6 @@
<button verticalHuggingPriority="750" id="7QO-xa-9rT">
<rect key="frame" x="0.0" y="-2" width="35" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="NSAddTemplate" imagePosition="overlaps" alignment="center" imageScaling="proportionallyDown" inset="2" id="ari-l9-Qyx">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -574,7 +554,6 @@
<button verticalHuggingPriority="750" id="5qE-h2-muz">
<rect key="frame" x="34" y="-2" width="35" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" imageScaling="proportionallyDown" inset="2" id="Wwg-4A-3Ad">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -589,14 +568,11 @@
</connections>
</button>
</subviews>
<animations/>
</view>
<animations/>
<color key="borderColor" red="1" green="1" blue="1" alpha="0.41999999999999998" colorSpace="calibratedRGB"/>
<color key="fillColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</box>
</subviews>
<animations/>
</customView>
<customView id="87a-A4-dGN">
<rect key="frame" x="264" y="0.0" width="599" height="634"/>
@@ -616,7 +592,6 @@
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="QMT-Ui-fxI">
<rect key="frame" x="-1" y="-3" width="613" height="5"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
@@ -624,7 +599,6 @@
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" id="krM-95-waf">
<rect key="frame" x="14" y="24" width="580" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" focusRingType="none" title="Project Name" id="ylH-C3-MHM">
<font key="font" metaFont="system"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
@@ -637,7 +611,6 @@
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="0c3-NS-t4n">
<rect key="frame" x="14" y="8" width="580" height="14"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" title="Project Path" id="NvI-dv-Vcf">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" red="0.76319916294850176" green="0.76061204714189667" blue="0.76578627875510685" alpha="1" colorSpace="calibratedRGB"/>
@@ -648,9 +621,7 @@
</connections>
</textField>
</subviews>
<animations/>
</view>
<animations/>
<color key="borderColor" red="0.96862745098039216" green="0.50588235294117645" blue="0.16470588235294117" alpha="1" colorSpace="calibratedRGB"/>
<color key="fillColor" red="0.34509803921568627" green="0.34509803921568627" blue="0.34509803921568627" alpha="1" colorSpace="calibratedRGB"/>
</box>
@@ -664,7 +635,6 @@
<button verticalHuggingPriority="750" id="sNm-EJ-c40">
<rect key="frame" x="18" y="2" width="147" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="square" title="Settings" bezelStyle="shadowlessSquare" alignment="center" refusesFirstResponder="YES" imageScaling="proportionallyDown" inset="2" id="Fel-8z-zmY">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -681,7 +651,6 @@
<button verticalHuggingPriority="750" id="E4i-Ez-bfl">
<rect key="frame" x="227" y="2" width="147" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="square" title="Errors &amp; Warnings" bezelStyle="shadowlessSquare" alignment="center" refusesFirstResponder="YES" imageScaling="proportionallyDown" inset="2" id="x1c-0h-XNs">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -698,7 +667,6 @@
<button verticalHuggingPriority="750" id="UCo-MK-pOT">
<rect key="frame" x="432" y="2" width="147" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="square" title="Operations" bezelStyle="shadowlessSquare" alignment="center" refusesFirstResponder="YES" imageScaling="proportionallyDown" inset="2" id="ZxW-hd-KKo">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -715,22 +683,18 @@
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="0Lp-Tm-YXi">
<rect key="frame" x="0.0" y="-2" width="599" height="5"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
</subviews>
<animations/>
</view>
<animations/>
<color key="borderColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.93725490196078431" alpha="1" colorSpace="calibratedRGB"/>
<color key="fillColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</box>
<tabView drawsBackground="NO" type="noTabsNoBorder" id="00d-fn-q41">
<rect key="frame" x="0.0" y="0.0" width="599" height="562"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<font key="font" metaFont="system"/>
<tabViewItems/>
<connections>
@@ -738,13 +702,10 @@
</connections>
</tabView>
</subviews>
<animations/>
</customView>
</subviews>
<animations/>
</customView>
</subviews>
<animations/>
<holdingPriorities>
<real value="250"/>
<real value="250"/>
@@ -754,7 +715,6 @@
</connections>
</splitView>
</subviews>
<animations/>
</view>
<connections>
<outlet property="initialFirstResponder" destination="Mss-Tu-7kR" id="fe9-ry-0ar"/>
@@ -772,7 +732,6 @@
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="3j4-r5-Ybe">
<rect key="frame" x="74" y="64" width="149" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="XcodeCapp" id="qvL-bN-A9R">
<font key="font" metaFont="systemBold" size="15"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -782,7 +741,6 @@
<textField verticalHuggingPriority="750" id="vIx-Hh-v8Z">
<rect key="frame" x="117" y="42" width="63" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Version 4.0" id="WUW-Ut-m7V">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
@@ -795,7 +753,6 @@
<textField verticalHuggingPriority="750" id="IH1-cn-Xc9">
<rect key="frame" x="18" y="20" width="260" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Copyright © 2012-2016 Cappuccino Project." id="8lT-Ky-ecV">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" white="0.5" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
@@ -805,11 +762,9 @@
<imageView id="Q2t-aL-TDg">
<rect key="frame" x="107" y="89" width="82" height="82"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="logo" id="zF2-py-kAi"/>
</imageView>
</subviews>
<animations/>
</view>
<point key="canvasLocation" x="-218" y="94.5"/>
</window>
@@ -826,7 +781,6 @@
<button toolTip="If this is checked, when a Cappuccino project is opened, the project’s Xcode support project will be opened automatically" id="QGE-Iy-i46">
<rect key="frame" x="18" y="96" width="321" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="Automatically open Projects in Xcode" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="VNE-DB-5fX">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -843,7 +797,6 @@
<textField verticalHuggingPriority="750" id="Llm-fD-60A">
<rect key="frame" x="18" y="70" width="186" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Maximum parallel operations:" id="feI-Ow-URM">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -853,7 +806,6 @@
<popUpButton verticalHuggingPriority="750" id="9up-BP-tRE">
<rect key="frame" x="229" y="65" width="111" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<popUpButtonCell key="cell" type="push" title="20" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="UjK-Ie-IaQ" id="niA-cT-acm">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@@ -875,7 +827,6 @@
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="axH-wD-X4l">
<rect key="frame" x="18" y="20" width="321" height="42"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="NZb-FO-ea5">
<font key="font" metaFont="smallSystem"/>
<string key="title">This represents the number of operations XcodeCapp can do in parallel. Decrease the this value if you encounter slugginesh or over CPU usage.</string>
@@ -884,7 +835,6 @@
</textFieldCell>
</textField>
</subviews>
<animations/>
</view>
<point key="canvasLocation" x="-156.5" y="-126"/>
</window>
@@ -902,13 +852,11 @@
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" id="9iO-X5-hpo">
<rect key="frame" x="26" y="75" width="186" height="186"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="logo" id="1zG-V8-6bF"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="lpR-ul-R4k">
<rect key="frame" x="40" y="42" width="158" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="XcodeCapp" id="Oar-AW-2i5">
<font key="font" metaFont="system" size="18"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -918,7 +866,6 @@
<textField verticalHuggingPriority="750" id="fUL-eL-YkQ">
<rect key="frame" x="18" y="20" width="203" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Version 4.0" id="unR-NY-aap">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" white="0.31343064259999998" alpha="1" colorSpace="calibratedWhite"/>
@@ -929,12 +876,9 @@
</connections>
</textField>
</subviews>
<animations/>
</customView>
</subviews>
<animations/>
</view>
<animations/>
<color key="borderColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="fillColor" red="0.98039221759999995" green="0.98039221759999995" blue="0.98039221759999995" alpha="1" colorSpace="deviceRGB"/>
<point key="canvasLocation" x="310.5" y="-302.5"/>
@@ -953,7 +897,6 @@
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="FVR-yM-GAZ">
<rect key="frame" x="40" y="116" width="354" height="5"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
@@ -968,7 +911,6 @@
<button focusRingType="none" id="wQo-c7-sD7">
<rect key="frame" x="14" y="15" width="27" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSAddTemplate" imagePosition="only" alignment="center" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="o7j-4e-NNJ">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -978,21 +920,17 @@
</connections>
</button>
</subviews>
<animations/>
</view>
<animations/>
<color key="borderColor" red="0.97254901960784312" green="0.50196078431372548" blue="0.15686274509803921" alpha="1" colorSpace="calibratedRGB"/>
<color key="fillColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</box>
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" style="spinning" id="vPH-Iq-Ray">
<rect key="frame" x="201" y="40" width="32" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
</progressIndicator>
<button focusRingType="none" id="wdl-kS-DYD">
<rect key="frame" x="124" y="150" width="186" height="186"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="logo" imagePosition="only" alignment="center" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="OC7-Ci-3pt">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -1002,12 +940,9 @@
</connections>
</button>
</subviews>
<animations/>
</customView>
</subviews>
<animations/>
</view>
<animations/>
<color key="borderColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="fillColor" red="0.98039221759999995" green="0.98039221759999995" blue="0.98039221759999995" alpha="1" colorSpace="deviceRGB"/>
<connections>
@@ -90,10 +90,15 @@ NSString * const XCCNib2CibDidEndNotification = @"XCCNib2C
}
- (NSDictionary*)_launchTaskWithCommand:(NSString*)aCommand arguments:(NSArray*)arguments
{
return [self _launchTaskWithCommand:aCommand arguments:arguments currentDirectoryPath:nil];
}
- (NSDictionary*)_launchTaskWithCommand:(NSString*)aCommand arguments:(NSArray*)arguments currentDirectoryPath:(NSString *)aDirectory
{
NSLog(@"Running processing task: %@ on file: %@", aCommand, self.sourcePath);
self->task = [self->taskLauncher taskWithCommand:aCommand arguments:arguments];
self->task = [self->taskLauncher taskWithCommand:aCommand arguments:arguments currentDirectoryPath:aDirectory];
[self _updateOperationInformation];
@@ -125,7 +130,7 @@ NSString * const XCCNib2CibDidEndNotification = @"XCCNib2C
[self dispatchNotificationName:XCCNib2CibDidStartNotification];
NSArray *arguments = @[@"--no-colors", self.sourcePath];
NSDictionary *result = [self _launchTaskWithCommand:@"nib2cib" arguments:arguments];
NSDictionary *result = [self _launchTaskWithCommand:@"nib2cib" arguments:arguments currentDirectoryPath:self.cappuccinoProject.projectPath];
int code = [result[@"status"] intValue];
if (code != 0)
@@ -82,18 +82,6 @@ task ("deploy", ["release"], function()
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, "__project.nameasidentifier__.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", projectName, "__project.nameasidentifier__.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
+6 -1
View File
@@ -204,7 +204,10 @@ var FILE = require("file"),
[self loadThemesFromList:themeList];
[self loadFrameworks:options.frameworks verbosity:options.verbosity];
[self loadNSClassesFromBundle:[CPBundle mainBundle]];
var mainBundle = [CPBundle mainBundle];
[mainBundle loadWithDelegate:nil];
[self loadNSClassesFromBundle:mainBundle];
var frameworkList = [];
@@ -230,6 +233,8 @@ var FILE = require("file"),
CPLog.info("Aux themes : " + themeList.slice(1).join(", "));
CPLog.info("Config file : " + (configInfo.path || ""));
CPLog.info("System Font : " + [CPFont systemFontSize] + "px " + [CPFont systemFontFace]);
CPLog.info("NSClasses : " + userNSClasses);
CPLog.info("-------------------------------------------------------------\n");
var converter = [[Converter alloc] initWithInputPath:inputPath outputPath:outputPath];