Merge branch 'master' of https://github.com/cappuccino/cappuccino into objj_compiler2

Conflicts:
	AppKit/CPWindow/CPWindow.j
This commit is contained in:
Martin Carlberg
2013-01-13 22:01:43 +01:00
18 changed files with 5810 additions and 234 deletions
+58 -37
View File
@@ -537,7 +537,7 @@ CPCriticalAlertStyle = 2;
if (_showSuppressionButton)
lastView = _suppressionButton;
else if (_accessoryView)
lastView = _accessoryView
lastView = _accessoryView;
finalSize = [self _layoutButtonsFromView:lastView];
if ([_window styleMask] & CPDocModalWindowMask)
@@ -689,42 +689,63 @@ CPCriticalAlertStyle = 2;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[CGSizeMake(400.0, 110.0), CGInsetMake(15, 15, 15, 50), 6, 10,
CPJustifiedTextAlignment, [CPColor blackColor], [CPFont boldSystemFontOfSize:13.0], [CPNull null], CGSizeMakeZero(),
CPJustifiedTextAlignment, [CPColor blackColor], [CPFont systemFontOfSize:12.0], [CPNull null], CGSizeMakeZero(),
CGPointMake(15, 12),
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
0.0,
0.0,
3.0,
[CPColor blackColor],
[CPFont systemFontOfSize:12.0],
[CPNull null],
0.0
]
forKeys:[@"size", @"content-inset", @"informative-offset", @"button-offset",
@"message-text-alignment", @"message-text-color", @"message-text-font", @"message-text-shadow-color", @"message-text-shadow-offset",
@"informative-text-alignment", @"informative-text-color", @"informative-text-font", @"informative-text-shadow-color", @"informative-text-shadow-offset",
@"image-offset",
@"information-image",
@"warning-image",
@"error-image",
@"help-image",
@"help-image-left-offset",
@"help-image-pressed",
@"suppression-button-y-offset",
@"suppression-button-x-offset",
@"default-elements-margin",
@"suppression-button-text-color",
@"suppression-button-text-font",
@"suppression-button-text-shadow-color",
@"suppression-button-text-shadow-offset"
]];
return [CPDictionary dictionaryWithObjects:[
CGSizeMake(400.0, 110.0),
CGInsetMake(15, 15, 15, 50), 6, 10,
CPJustifiedTextAlignment,
[CPColor blackColor],
[CPFont boldSystemFontOfSize:13.0],
[CPNull null], CGSizeMakeZero(),
CPJustifiedTextAlignment,
[CPColor blackColor],
[CPFont systemFontOfSize:12.0],
[CPNull null], CGSizeMakeZero(),
CGPointMake(15, 12),
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
0.0,
0.0,
3.0,
[CPColor blackColor],
[CPFont systemFontOfSize:12.0],
[CPNull null],
0.0
]
forKeys:[
@"size",
@"content-inset",
@"informative-offset",
@"button-offset",
@"message-text-alignment",
@"message-text-color",
@"message-text-font",
@"message-text-shadow-color",
@"message-text-shadow-offset",
@"informative-text-alignment",
@"informative-text-color",
@"informative-text-font",
@"informative-text-shadow-color",
@"informative-text-shadow-offset",
@"image-offset",
@"information-image",
@"warning-image",
@"error-image",
@"help-image",
@"help-image-left-offset",
@"help-image-pressed",
@"suppression-button-y-offset",
@"suppression-button-x-offset",
@"default-elements-margin",
@"suppression-button-text-color",
@"suppression-button-text-font",
@"suppression-button-text-shadow-color",
@"suppression-button-text-shadow-offset"
]
];
}
@end
+1
View File
@@ -970,6 +970,7 @@ CPRunContinuesResponse = -1002;
[aWindow orderFront:self];
[aSheet setPlatformWindow:[aWindow platformWindow]];
}
[aWindow _attachSheet:aSheet modalDelegate:aModalDelegate didEndSelector:aDidEndSelector contextInfo:aContextInfo];
}
+84 -52
View File
@@ -46,13 +46,44 @@ var CPTextFieldDOMInputElement = nil,
CPTextFieldInputIsActive = NO,
CPTextFieldCachedSelectStartFunction = nil,
CPTextFieldCachedDragFunction = nil,
CPTextFieldBlurFunction = nil,
CPTextFieldBlurHandler = nil,
CPTextFieldInputFunction = nil;
#endif
var CPSecureTextFieldCharacter = "\u2022";
function CPTextFieldBlurFunction(anEvent, owner, domElement, inputElement, resigning, didBlurRef)
{
if (owner && domElement != inputElement.parentNode)
return;
if (!resigning && [[owner window] isKeyWindow])
{
/*
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.
*/
window.setTimeout(function()
{
inputElement.focus();
}, 0.0);
}
CPTextFieldHandleBlur(anEvent, AT_REF(owner));
AT_DEREF(didBlurRef, YES);
return true;
}
function CPTextFieldHandleBlur(anEvent, ownerRef)
{
AT_DEREF(ownerRef, nil);
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
@implementation CPString (CPTextFieldAdditions)
/*!
@@ -188,28 +219,15 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
CPTextFieldDOMInputElement.style.background = "transparent";
CPTextFieldDOMInputElement.style.outline = "none";
CPTextFieldBlurFunction = function(anEvent)
CPTextFieldBlurHandler = function(anEvent)
{
if (CPTextFieldInputOwner && CPTextFieldInputOwner._DOMElement != CPTextFieldDOMInputElement.parentNode)
return;
if (!CPTextFieldInputResigning)
{
[[CPTextFieldInputOwner window] makeFirstResponder:nil];
return;
}
CPTextFieldHandleBlur(anEvent, CPTextFieldDOMInputElement);
CPTextFieldInputDidBlur = YES;
return true;
};
CPTextFieldHandleBlur = function(anEvent)
{
CPTextFieldInputOwner = nil;
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
return CPTextFieldBlurFunction(
anEvent,
CPTextFieldInputOwner,
CPTextFieldInputOwner._DOMElement,
CPTextFieldDOMInputElement,
CPTextFieldInputResigning,
AT_REF(CPTextFieldInputDidBlur));
};
if (CPFeatureIsCompatible(CPInputOnInputEventFeature))
@@ -219,9 +237,16 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
if (!CPTextFieldInputOwner)
return;
var cappEvent = [CPEvent keyEventWithType:CPKeyUp location:_CGPointMakeZero() modifierFlags:0
timestamp:[CPEvent currentTimestamp] windowNumber:[[CPApp keyWindow] windowNumber] context:nil
characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:nil];
var cappEvent = [CPEvent keyEventWithType:CPKeyUp
location:_CGPointMakeZero()
modifierFlags:0
timestamp:[CPEvent currentTimestamp]
windowNumber:[[CPApp keyWindow] windowNumber]
context:nil
characters:nil
charactersIgnoringModifiers:nil
isARepeat:NO
keyCode:nil];
[CPTextFieldInputOwner keyUp:cappEvent];
@@ -231,8 +256,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
CPTextFieldDOMInputElement.oninput = CPTextFieldInputFunction;
}
//FIXME make this not onblur
CPTextFieldDOMInputElement.onblur = CPTextFieldBlurFunction;
// FIXME make this not onblur
CPTextFieldDOMInputElement.onblur = CPTextFieldBlurHandler;
CPTextFieldDOMStandardInputElement = CPTextFieldDOMInputElement;
}
@@ -261,7 +286,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
CPTextFieldDOMPasswordInputElement.style.outline = "none";
CPTextFieldDOMPasswordInputElement.type = "password";
CPTextFieldDOMPasswordInputElement.onblur = CPTextFieldBlurFunction;
CPTextFieldDOMPasswordInputElement.onblur = CPTextFieldBlurHandler;
}
CPTextFieldDOMInputElement = CPTextFieldDOMPasswordInputElement;
@@ -494,12 +519,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
/* @ignore */
- (BOOL)becomeFirstResponder
{
#if PLATFORM(DOM)
// FIXME Why do we care about who's the first responder in a different window?
if (CPTextFieldInputOwner && [CPTextFieldInputOwner window] !== [self window])
[[CPTextFieldInputOwner window] makeFirstResponder:nil];
#endif
// As long as we are the first responder we need to monitor the key status of our window.
[self _setObserveWindowKeyNotifications:YES];
@@ -512,7 +531,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
}
/*!
A text field can be the first responder without necessarily being the focus of keyboard input. For example, it might be the first responder of window A but window B is the main and key window. It's important we don't put a focused input field into a text field in a non key window, even if that field is the first responder, because the key window might also have a first responder text field which the user will expect to receive keyboard input.
A text field can be the first responder without necessarily being the focus of keyboard input. For example, it might be the first responder of window A but window B is the main and key window. It's important we don't put a focused input field into a text field in a non-key window, even if that field is the first responder, because the key window might also have a first responder text field which the user will expect to receive keyboard input.
Since a first responder but non-key window text field can't receive input it should not even look like an active text field (Cocoa has a "slightly active" text field look it uses when another window is the key window, but Cappuccino doesn't today.)
*/
@@ -534,8 +553,10 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
element.value = _stringValue;
element.style.color = [[self currentValueForThemeAttribute:@"text-color"] cssString];
if (CPFeatureIsCompatible(CPInputSetFontOutsideOfDOM))
element.style.font = [font cssString];
element.style.zIndex = 1000;
switch ([self alignment])
@@ -571,35 +592,24 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
element.style.top = topPoint;
var left = _CGRectGetMinX(contentRect);
// If the browser has a built in left padding, compensate for it. We need the input text to be exactly on top of the original text.
if (CPFeatureIsCompatible(CPInput1PxLeftPadding))
left -= 1;
element.style.left = left + "px";
element.style.width = _CGRectGetWidth(contentRect) + "px";
element.style.height = ROUND(lineHeight) + "px";
element.style.lineHeight = ROUND(lineHeight) + "px";
element.style.verticalAlign = @"top";
element.style.verticalAlign = "top";
element.style.cursor = "auto";
_DOMElement.appendChild(element);
// The font change above doesn't work for some browsers if the element isn't already .appendChild'ed.
// The font change above doesn't work for some browsers if the element isn't already appendChild'ed.
if (!CPFeatureIsCompatible(CPInputSetFontOutsideOfDOM))
element.style.font = [font cssString];
window.setTimeout(function()
{
element.focus();
// Select the text if the textfield became first responder through keyboard interaction
if (!_willBecomeFirstResponderByClick)
[self _selectText:self immediately:YES];
_willBecomeFirstResponderByClick = NO;
[self textDidFocus:[CPNotification notificationWithName:CPTextFieldDidFocusNotification object:self userInfo:nil]];
CPTextFieldInputOwner = self;
}, 0.0);
[[[self window] platformWindow] _propagateCurrentDOMEvent:YES];
CPTextFieldInputIsActive = YES;
@@ -612,6 +622,28 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
[[self window] platformWindow]._DOMBodyElement.ondrag = function () {};
[[self window] platformWindow]._DOMBodyElement.onselectstart = function () {};
}
CPTextFieldInputOwner = self;
window.setTimeout(function()
{
/*
setTimeout handlers are not guaranteed to fire in the order they were initiated. This can cause a race condition when several windows with text fields are opened quickly, resulting in several instances of this timeout function being fired, perhaps out of order. So we have to check that by the time this function is fired, CPTextFieldInputOwner has not been changed to another text field in the meantime.
*/
if (CPTextFieldInputOwner !== self)
return;
element.focus();
// Select the text if the textfield became first responder through keyboard interaction
if (!_willBecomeFirstResponderByClick)
[self _selectText:self immediately:YES];
_willBecomeFirstResponderByClick = NO;
[self textDidFocus:[CPNotification notificationWithName:CPTextFieldDidFocusNotification object:self userInfo:nil]];
}, 0.0);
#endif
}
@@ -677,7 +709,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
element.blur();
if (!CPTextFieldInputDidBlur)
CPTextFieldBlurFunction();
CPTextFieldBlurHandler();
CPTextFieldInputDidBlur = NO;
CPTextFieldInputResigning = NO;
+13 -40
View File
@@ -21,6 +21,7 @@
*/
#import "../Foundation/CPRange.h"
#import "../Foundation/Ref.h"
@import <Foundation/CPCharacterSet.j>
@import <Foundation/CPIndexSet.j>
@@ -47,7 +48,7 @@ var CPTokenFieldDOMInputElement = nil,
CPTokenFieldCachedDragFunction = nil,
CPTokenFieldFocusInput = NO,
CPTokenFieldBlurFunction = nil;
CPTokenFieldBlurHandler = nil;
#endif
@@ -71,7 +72,6 @@ var CPScrollDestinationNone = 0,
CPEvent _mouseDownEvent;
BOOL _preventResign;
BOOL _shouldNotifyTarget;
}
@@ -390,9 +390,6 @@ var CPScrollDestinationNone = 0,
- (BOOL)resignFirstResponder
{
if (_preventResign)
return NO;
[self _autocomplete];
// From CPTextField superclass.
@@ -427,7 +424,7 @@ var CPScrollDestinationNone = 0,
element.blur();
if (!CPTokenFieldInputDidBlur)
CPTokenFieldBlurFunction();
CPTokenFieldBlurHandler();
CPTokenFieldInputDidBlur = NO;
CPTokenFieldInputResigning = NO;
@@ -451,7 +448,6 @@ var CPScrollDestinationNone = 0,
- (void)mouseDown:(CPEvent)anEvent
{
_preventResign = YES;
_mouseDownEvent = anEvent;
[self _selectToken:nil byExtendingSelection:NO];
@@ -461,13 +457,11 @@ var CPScrollDestinationNone = 0,
- (void)mouseUp:(CPEvent)anEvent
{
_preventResign = NO;
_mouseDownEvent = nil;
}
- (void)_mouseDownOnToken:(_CPTokenFieldToken)aToken withEvent:(CPEvent)anEvent
{
_preventResign = YES;
_mouseDownEvent = anEvent;
}
@@ -480,8 +474,6 @@ var CPScrollDestinationNone = 0,
// Snap to the token if it's only half visible due to mouse wheel scrolling.
_shouldScrollTo = aToken;
}
_preventResign = NO;
}
// ===========
@@ -652,38 +644,19 @@ var CPScrollDestinationNone = 0,
CPTokenFieldDOMInputElement.style.background = "transparent";
CPTokenFieldDOMInputElement.style.outline = "none";
CPTokenFieldBlurFunction = function(anEvent)
CPTokenFieldBlurHandler = function(anEvent)
{
if (CPTokenFieldInputOwner && [CPTokenFieldInputOwner._tokenScrollView documentView]._DOMElement != CPTokenFieldDOMInputElement.parentNode)
return;
if (CPTokenFieldInputOwner && CPTokenFieldInputOwner._preventResign)
return false;
if (!CPTokenFieldInputResigning && [[CPTokenFieldInputOwner window] isKeyWindow])
{
// If we lost focus somehow but we're not resigning and we're still in the key window, we'll need to take it back.
window.setTimeout(function()
{
CPTokenFieldDOMInputElement.focus();
}, 0.0);
}
CPTokenFieldHandleBlur(anEvent, CPTokenFieldDOMInputElement);
CPTokenFieldInputDidBlur = YES;
return true;
return CPTextFieldBlurFunction(
anEvent,
CPTokenFieldInputOwner,
[CPTokenFieldInputOwner._tokenScrollView documentView]._DOMElement,
CPTokenFieldDOMInputElement,
CPTokenFieldInputResigning,
AT_REF(CPTokenFieldInputDidBlur));
};
CPTokenFieldHandleBlur = function(anEvent)
{
CPTokenFieldInputOwner = nil;
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
};
//FIXME make this not onblur
CPTokenFieldDOMInputElement.onblur = CPTokenFieldBlurFunction;
// FIXME make this not onblur
CPTokenFieldDOMInputElement.onblur = CPTokenFieldBlurHandler;
CPTokenFieldDOMStandardInputElement = CPTokenFieldDOMInputElement;
}
+2 -2
View File
@@ -463,7 +463,7 @@ var CPViewFlags = { },
// We will have to adjust the z-index of all views starting at this index.
var count = _subviews.length;
// dirty the key view loop, in case the window wants to auto recalculate it
// Dirty the key view loop, in case the window wants to auto recalculate it
[[self window] _dirtyKeyViewLoop];
// If this is already one of our subviews, remove it.
@@ -544,7 +544,7 @@ var CPViewFlags = { },
if (!_superview)
return;
// dirty the key view loop, in case the window wants to auto recalculate it
// Dirty the key view loop, in case the window wants to auto recalculate it
[[self window] _dirtyKeyViewLoop];
[_superview willRemoveSubview:self];
+171 -98
View File
@@ -315,6 +315,7 @@ var CPWindowActionMessageKeys = [
CPToolbar _toolbar;
CPResponder _firstResponder;
CPResponder _initialFirstResponder;
BOOL _hasBecomeKeyWindow;
id _delegate;
CPString _title;
@@ -454,7 +455,6 @@ CPTexturedBackgroundWindowMask
// Create a generic content view.
[self setContentView:[[CPView alloc] initWithFrame:_CGRectMakeZero()]];
[self setInitialFirstResponder:[self contentView]];
_firstResponder = self;
@@ -483,7 +483,8 @@ CPTexturedBackgroundWindowMask
_autorecalculatesKeyViewLoop = NO;
_defaultButtonEnabled = YES;
_keyViewLoopIsDirty = YES;
_keyViewLoopIsDirty = NO;
_hasBecomeKeyWindow = NO;
[self setShowsResizeIndicator:_styleMask & CPResizableWindowMask];
@@ -546,14 +547,8 @@ CPTexturedBackgroundWindowMask
- (void)awakeFromCib
{
_keyViewLoopIsDirty = ![self _hasKeyViewLoop];
// If no key view loop has been specified by hand, and we are not intending to auto recalculate,
// set up a default key view loop.
if (_keyViewLoopIsDirty && ![self autorecalculatesKeyViewLoop])
[self recalculateKeyViewLoop];
// At this time we know the final screen (or browser) size and can apply the positioning mask, if any, from the nib.
// At this time we know the final screen (or browser) size
// and can apply the positioning mask, if any, from the nib.
if (_positioningScreenRect)
{
var actualScreenRect = [CPPlatform isBrowser] ? [_platformWindow contentBounds] : [[self screen] visibleFrame],
@@ -595,6 +590,34 @@ CPTexturedBackgroundWindowMask
[self setFrameOrigin:origin];
}
}
/*
Calculate the key view loop if necessary. Note that Cocoa does not call recalculateKeyViewLoop when awaking a nib. If a key view loop was set in the cib, we have to chain it to the content view.
*/
if ([self _hasKeyViewLoop:[_contentView subviews]])
{
var views = [self _viewsSortedByPosition],
count = [views count];
// The first view is the content view.
// Find the first subview that has a next key view.
for (var i = 1; i < count; ++i)
{
var view = views[i];
if ([view nextKeyView])
{
[_contentView setNextKeyView:view];
break;
}
}
}
else
{
// Cooca does NOT call the public method recalculateKeyViewLoop for nibs,
// but it does calculate the loop.
[self _doRecalculateKeyViewLoop];
}
}
- (void)_setWindowView:(CPView)aWindowView
@@ -1089,17 +1112,18 @@ CPTexturedBackgroundWindowMask
var bounds = _CGRectMake(0.0, 0.0, _CGRectGetWidth(_frame), _CGRectGetHeight(_frame));
// During init the initial first responder is set to the contentView
// if it hasn't changed in the mean time we need to update that reference
// to the new contentView
if (_initialFirstResponder === _contentView)
[self setInitialFirstResponder:aView];
_contentView = aView;
[_contentView setFrame:[self contentRectForFrameRect:bounds]];
[_contentView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[_windowView addSubview:_contentView];
/*
If the initial first responder has been set to something other than
the window, set it to the window because it will no longer be valid.
*/
if (_initialFirstResponder && _initialFirstResponder !== self)
_initialFirstResponder = self;
}
/*!
@@ -1445,43 +1469,35 @@ CPTexturedBackgroundWindowMask
- (void)setInitialFirstResponder:(CPView)aView
{
// Before an initial first responder is set, be sure to calculate the key loop
[self _setupFirstResponder:aView];
_initialFirstResponder = aView;
}
- (void)_setupFirstResponder:(CPView)anInitialFirstResponder
- (void)_setupFirstResponder
{
/*
If:
- The key loop is dirty
- The key loop does not auto-recalculate
- No view within the window has become first responder
- No initial first responder has been set
Then calculate the key view loop and set the first responder
to the first view in the loop if no initial responder has been set, since we should
always have an initial first responder and a key loop by default.
When the window is first made the key window, if the first responder is the window, use the initial first responder if there is one. If there is a first responder and it is not the window, ignore the initial first responder.
*/
if (_keyViewLoopIsDirty &&
!_autorecalculatesKeyViewLoop &&
_firstResponder === self &&
_initialFirstResponder === [self contentView])
if (!_hasBecomeKeyWindow)
{
[self recalculateKeyViewLoop];
if (anInitialFirstResponder)
[self makeFirstResponder:anInitialFirstResponder];
else
if (_firstResponder === self)
{
// Make the first key view of the content view the first responder
var firstKeyView = [[self contentView] nextValidKeyView];
if (_initialFirstResponder)
[self makeFirstResponder:_initialFirstResponder];
else
{
// Make the first valid key view the first responder
var view = [_contentView nextValidKeyView];
[self makeFirstResponder:firstKeyView];
if (view)
[self makeFirstResponder:view];
}
return;
}
}
if (_firstResponder)
[self makeFirstResponder:_firstResponder];
}
/*!
@@ -1783,7 +1799,7 @@ CPTexturedBackgroundWindowMask
case CPLeftMouseDown:
case CPRightMouseDown:
_leftMouseDownView = [_windowView hitTest:point] || _windowView;
_leftMouseDownView = [_windowView hitTest:point];
if (_leftMouseDownView != _firstResponder && [_leftMouseDownView acceptsFirstResponder])
[self makeFirstResponder:_leftMouseDownView];
@@ -1891,8 +1907,9 @@ CPTexturedBackgroundWindowMask
}
/*!
Called when the receiver should become the key window. It also sends
the \c -becomeKeyWindow message to the first responder.
Called when the receiver should become the key window. It sends
the \c -becomeKeyWindow message to the first responder if it responds,
and posts \c CPWindowDidBecomeKeyNotification.
*/
- (void)becomeKeyWindow
{
@@ -1901,7 +1918,16 @@ CPTexturedBackgroundWindowMask
if (_firstResponder !== self && [_firstResponder respondsToSelector:@selector(becomeKeyWindow)])
[_firstResponder becomeKeyWindow];
[self _setupFirstResponder:nil];
if (!_hasBecomeKeyWindow)
{
// The first time a window is loaded, if it does not have a key view loop
// established, calculate it now.
if (![self _hasKeyViewLoop:[_contentView subviews]])
[self recalculateKeyViewLoop];
}
[self _setupFirstResponder];
_hasBecomeKeyWindow = YES;
[_windowView noteKeyWindowStateChanged];
@@ -1925,7 +1951,7 @@ CPTexturedBackgroundWindowMask
says it will return YES if there is a "resize bar", but in practice
that is not the same as the resizable mask.
*/
return (_styleMask & CPTitledWindowMask) || [self isFullPlatformWindow];
return (_styleMask & CPTitledWindowMask) || [self isFullPlatformWindow] || _isSheet;
}
/*!
@@ -2498,8 +2524,8 @@ CPTexturedBackgroundWindowMask
- (void)_setAttachedSheetFrameOrigin
{
// Position the sheet above the contentRect.
var attachedSheet = [self attachedSheet];
var contentRect = [[self contentView] frame],
var attachedSheet = [self attachedSheet],
contentRect = [_contentView frame],
sheetFrame = _CGRectMakeCopy([attachedSheet frame]);
sheetFrame.origin.y = _CGRectGetMinY(_frame) + _CGRectGetMinY(contentRect);
@@ -2632,6 +2658,7 @@ CPTexturedBackgroundWindowMask
- (void)animationDidEnd:(id)anim
{
var sheet = _sheetContext["sheet"];
if (anim._window != sheet)
return;
@@ -2660,7 +2687,7 @@ CPTexturedBackgroundWindowMask
sheet._parentView = self;
var originx = frame.origin.x + FLOOR((frame.size.width - sheetFrame.size.width) / 2),
originy = frame.origin.y + [[self contentView] frame].origin.y,
originy = frame.origin.y + [_contentView frame].origin.y,
startFrame = _CGRectMake(originx, originy, sheetFrame.size.width, 0),
endFrame = _CGRectMake(originx, originy, sheetFrame.size.width, sheetFrame.size.height);
@@ -2669,6 +2696,7 @@ CPTexturedBackgroundWindowMask
// if sheet is attached to a modal window, the sheet runs
// as if itself and the parent window are modal
sheet._isModal = NO;
if ([CPApp modalWindow] === self)
{
[CPApp runModalForWindow:sheet];
@@ -2822,7 +2850,7 @@ CPTexturedBackgroundWindowMask
{
// FIXME: should we be starting at the root, in other words _windowView?
// The evidence seems to point to no...
return [[self contentView] performKeyEquivalent:anEvent];
return [_contentView performKeyEquivalent:anEvent];
}
- (void)keyDown:(CPEvent)anEvent
@@ -2868,9 +2896,9 @@ CPTexturedBackgroundWindowMask
}
else
{
// Cocoa sends complete: for the escape key (in stead of the default cancelOperation:)
// This is also the only action that is not sent directly to the first responder, but through doCommandBySelector.
// The difference is that doCommandBySelector: will also send the action to the window and application delegates.
/*
Cocoa sends complete: for the escape key (instead of the default cancelOperation:). This is also the only action that is not sent directly to the first responder, but through doCommandBySelector. The difference is that doCommandBySelector: will also send the action to the window and application delegates.
*/
[[self firstResponder] doCommandBySelector:@selector(complete:)];
}
@@ -2883,23 +2911,86 @@ CPTexturedBackgroundWindowMask
_keyViewLoopIsDirty = YES;
}
- (BOOL)_hasKeyViewLoop
{
var views = allViews(self),
index = [views count];
/*
Recursively traverse an array of views (depth last) until we find one that has a next or previous key view set. Return nil if none can be found.
while (index--)
if ([views[index] nextKeyView])
We don't use _viewsSortedByPosition here because it is wasteful to enumerate the entire view hierarchy when we will probably find a key view at the top level.
*/
- (BOOL)_hasKeyViewLoop:(CPArray)theViews
{
var i,
count = [theViews count];
for (i = 0; i < count; ++i)
{
var view = theViews[i];
if ([view nextKeyView] || [view previousKeyView])
return YES;
}
for (i = 0; i < count; ++i)
{
var subviews = [theViews[i] subviews];
if ([subviews count] && [self _hasKeyViewLoop:subviews])
return YES;
}
return NO;
}
/*!
Recalculates the key view loop, based on geometric position.
Note that the Cocoa documentation says that this method only marks the loop
as dirty, the recalculation is not done until the next or previous key view
of the window is requested. In reality, Cocoa does recalculate the loop
when this method is called.
*/
- (void)recalculateKeyViewLoop
{
var views = allViews(self);
[self _doRecalculateKeyViewLoop];
}
[views sortUsingFunction:keyViewComparator context:nil];
- (CPArray)_viewsSortedByPosition
{
var views = [CPArray arrayWithObject:_contentView];
views = views.concat([self _subviewsSortedByPosition:[_contentView subviews]]);
return views;
}
- (CPArray)_subviewsSortedByPosition:(CPArray)theSubviews
{
/*
We first sort the subviews according to geometric order.
Then we go through each subview, and if it has subviews,
they are sorted and inserted after the superview. This
is done recursively.
*/
theSubviews = [theSubviews copy];
[theSubviews sortUsingFunction:keyViewComparator context:nil];
var sortedViews = [];
for (var i = 0, count = [theSubviews count]; i < count; ++i)
{
var view = theSubviews[i],
subviews = [view subviews];
sortedViews.push(view);
if ([subviews count])
sortedViews = sortedViews.concat([self _subviewsSortedByPosition:subviews]);
}
return sortedViews;
}
- (void)_doRecalculateKeyViewLoop
{
var views = [self _viewsSortedByPosition];
for (var index = 0, count = [views count]; index < count; ++index)
[views[index] setNextKeyView:views[(index + 1) % count]];
@@ -2913,9 +3004,6 @@ CPTexturedBackgroundWindowMask
return;
_autorecalculatesKeyViewLoop = shouldRecalculate;
if (_autorecalculatesKeyViewLoop)
[self _dirtyKeyViewLoop];
}
- (BOOL)autorecalculatesKeyViewLoop
@@ -2925,8 +3013,8 @@ CPTexturedBackgroundWindowMask
- (void)selectNextKeyView:(id)sender
{
if (_keyViewLoopIsDirty && [self autorecalculatesKeyViewLoop])
[self recalculateKeyViewLoop];
if (_keyViewLoopIsDirty)
[self _doRecalculateKeyViewLoop];
var nextValidKeyView = nil;
@@ -2935,21 +3023,20 @@ CPTexturedBackgroundWindowMask
if (!nextValidKeyView)
{
var initialFirstResponder = _initialFirstResponder;
if ([initialFirstResponder acceptsFirstResponder])
nextValidKeyView = initialFirstResponder;
if ([_initialFirstResponder acceptsFirstResponder])
nextValidKeyView = _initialFirstResponder;
else
nextValidKeyView = [initialFirstResponder nextValidKeyView];
nextValidKeyView = [_initialFirstResponder nextValidKeyView];
}
[self makeFirstResponder:nextValidKeyView];
if (nextValidKeyView)
[self makeFirstResponder:nextValidKeyView];
}
- (void)selectPreviousKeyView:(id)sender
{
if (_keyViewLoopIsDirty && [self autorecalculatesKeyViewLoop])
[self recalculateKeyViewLoop];
if (_keyViewLoopIsDirty)
[self _doRecalculateKeyViewLoop];
var previousValidKeyView = nil;
@@ -2958,21 +3045,20 @@ CPTexturedBackgroundWindowMask
if (!previousValidKeyView)
{
var initialFirstResponder = _initialFirstResponder;
if ([initialFirstResponder acceptsFirstResponder])
previousValidKeyView = initialFirstResponder;
if ([_initialFirstResponder acceptsFirstResponder])
previousValidKeyView = _initialFirstResponder;
else
previousValidKeyView = [initialFirstResponder previousValidKeyView];
previousValidKeyView = [_initialFirstResponder previousValidKeyView];
}
[self makeFirstResponder:previousValidKeyView];
if (previousValidKeyView)
[self makeFirstResponder:previousValidKeyView];
}
- (void)selectKeyViewFollowingView:(CPView)aView
{
if (_keyViewLoopIsDirty && [self autorecalculatesKeyViewLoop])
[self recalculateKeyViewLoop];
if (_keyViewLoopIsDirty)
[self _doRecalculateKeyViewLoop];
var nextValidKeyView = [aView nextValidKeyView];
@@ -2982,8 +3068,8 @@ CPTexturedBackgroundWindowMask
- (void)selectKeyViewPrecedingView:(CPView)aView
{
if (_keyViewLoopIsDirty && [self autorecalculatesKeyViewLoop])
[self recalculateKeyViewLoop];
if (_keyViewLoopIsDirty)
[self _doRecalculateKeyViewLoop];
var previousValidKeyView = [aView previousValidKeyView];
@@ -3074,19 +3160,6 @@ CPTexturedBackgroundWindowMask
@end
var allViews = function(aWindow)
{
var views = [CPArray arrayWithObject:[aWindow contentView]];
[views addObjectsFromArray:[[aWindow contentView] subviews]];
// Start from index 1 because index 0 is the contentView and its subviews have already been added
for (var index = 1; index < views.length; ++index)
views = views.concat([views[index] subviews]);
return views;
};
var keyViewComparator = function(lhs, rhs, context)
{
var lhsBounds = [lhs convertRect:[lhs bounds] toView:nil],
+4 -5
View File
@@ -20,12 +20,11 @@
[self assertTrue:!![self window]];
}
- (void)testThatContentViewIsInitialFirstResponder
- (void)testThatNilIsInitialFirstResponder
{
var contentView = [[self window] contentView];
[self assert:contentView
[self assert:nil
equals:[[self window] initialFirstResponder]
message:@"The window's content view must be the initial first responder"];
message:@"The initial first responder must be null"];
}
- (void)testKeyViewLoop
@@ -35,11 +34,11 @@
[textField setFrame:CGRectMake(100.0, 100.0, 100.0, 26.0)];
[contentView addSubview:textField];
[[self window] recalculateKeyViewLoop];
var nextTextField = [CPTextField textFieldWithStringValue:@"" placeholder:@"" width:100];
[nextTextField setFrame:CGRectMake(100.0, 200.0, 100.0, 26.0)];
[contentView addSubview:nextTextField];
[[self window] recalculateKeyViewLoop];
// Test nextKeyView
@@ -0,0 +1,42 @@
/*
* AppController.j
* KeyViewLoopTest
*
* Created by You on January 7, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
@outlet CPWindow keyWindow;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
[keyWindow makeKeyAndOrderFront:self];
}
@end
@implementation MyWindow : CPWindow
- (@action)addField:(id)sender
{
var field = [CPTextField textFieldWithStringValue:@"" placeholder:@"" width:96];
[field setFrameOrigin:CGPointMake(20, 120)];
[[self contentView] addSubview:field];
[sender setEnabled:NO];
}
- (@action)recalc:(id)sender
{
[self recalculateKeyViewLoop];
}
@end
+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>panel</string>
</dict>
</plist>
+94
View File
@@ -0,0 +1,94 @@
/*
* Jakefile
* panel
*
* Created by You on January 7, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("panel", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "panel.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("panel");
task.setIdentifier("com.yourcompany.panel");
task.setVersion("1.0");
task.setAuthor("Your Company");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("panel");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
task.setNib2CibFlags("-R Resources/");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["panel"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "panel", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "panel", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "panel"));
OS.system(["press", "-f", FILE.join("Build", "Release", "panel"), FILE.join("Build", "Deployment", "panel")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "panel"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "panel"), FILE.join("Build", "Desktop", "panel", "panel.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "panel", "panel.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "panel"));
print("----------------------------");
}
@@ -0,0 +1,500 @@
<?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>archiveVersion</key>
<string>1</string>
<key>classes</key>
<dict/>
<key>objectVersion</key>
<string>46</string>
<key>objects</key>
<dict>
<key>18AD4EF5A788E8BE153F3D14</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>sourcecode.c.objc</string>
<key>name</key>
<string>_Users_aparajita_Development_Libs_cappuccino_cappuccino_Tests_Manual_KeyViewLoopTest_AppController.m</string>
<key>path</key>
<string>.XcodeSupport/_Users_aparajita_Development_Libs_cappuccino_cappuccino_Tests_Manual_KeyViewLoopTest_AppController.m</string>
<key>sourceTree</key>
<string>SOURCE_ROOT</string>
</dict>
<key>1BA4419F810882A5F82AFC60</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>?</string>
<key>name</key>
<string>AppController.j</string>
<key>path</key>
<string>AppController.j</string>
<key>sourceTree</key>
<string>SOURCE_ROOT</string>
</dict>
<key>6EEB4B5FBC546F0D38F7CBFC</key>
<dict>
<key>fileRef</key>
<string>18AD4EF5A788E8BE153F3D14</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>7FB3401F89606F501370B1A9</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>sourcecode.c.h</string>
<key>name</key>
<string>_Users_aparajita_Development_Libs_cappuccino_cappuccino_Tests_Manual_KeyViewLoopTest_AppController.h</string>
<key>path</key>
<string>.XcodeSupport/_Users_aparajita_Development_Libs_cappuccino_cappuccino_Tests_Manual_KeyViewLoopTest_AppController.h</string>
<key>sourceTree</key>
<string>SOURCE_ROOT</string>
</dict>
<key>85CB43EBBE11EDBF8A18EA3D</key>
<dict>
<key>children</key>
<array>
<string>F7B045A2B5801CC7BC4C6D50</string>
<string>7FB3401F89606F501370B1A9</string>
<string>18AD4EF5A788E8BE153F3D14</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Classes</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>8AB7432EBD9B62552A16F2F1</key>
<dict>
<key>children</key>
<array>
<string>1BA4419F810882A5F82AFC60</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Sources</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC4488135749D200615446</key>
<dict>
<key>children</key>
<array>
<string>9EEC44CB13574A0B00615446</string>
<string>9EEC4496135749D200615446</string>
<string>85CB43EBBE11EDBF8A18EA3D</string>
<string>8AB7432EBD9B62552A16F2F1</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC448A135749D200615446</key>
<dict>
<key>attributes</key>
<dict>
<key>LastUpgradeCheck</key>
<string>0440</string>
<key>ORGANIZATIONNAME</key>
<string>280 North, Inc.</string>
</dict>
<key>buildConfigurationList</key>
<string>9EEC448D135749D200615446</string>
<key>compatibilityVersion</key>
<string>Xcode 3.2</string>
<key>developmentRegion</key>
<string>English</string>
<key>hasScannedForEncodings</key>
<string>0</string>
<key>isa</key>
<string>PBXProject</string>
<key>knownRegions</key>
<array>
<string>en</string>
</array>
<key>mainGroup</key>
<string>9EEC4488135749D200615446</string>
<key>productRefGroup</key>
<string>9EEC4494135749D200615446</string>
<key>projectDirPath</key>
<string></string>
<key>projectRoot</key>
<string></string>
<key>targets</key>
<array>
<string>9EEC4492135749D200615446</string>
</array>
</dict>
<key>9EEC448D135749D200615446</key>
<dict>
<key>buildConfigurations</key>
<array>
<string>9EEC44C3135749D300615446</string>
<string>9EEC44C4135749D300615446</string>
</array>
<key>defaultConfigurationIsVisible</key>
<string>0</string>
<key>defaultConfigurationName</key>
<string>Release</string>
<key>isa</key>
<string>XCConfigurationList</string>
</dict>
<key>9EEC448F135749D200615446</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array>
<string>6EEB4B5FBC546F0D38F7CBFC</string>
</array>
<key>isa</key>
<string>PBXSourcesBuildPhase</string>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
</dict>
<key>9EEC4490135749D200615446</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array>
<string>9EEC4498135749D200615446</string>
</array>
<key>isa</key>
<string>PBXFrameworksBuildPhase</string>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
</dict>
<key>9EEC4491135749D200615446</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array>
<string>9EEC44CC13574A0B00615446</string>
</array>
<key>isa</key>
<string>PBXResourcesBuildPhase</string>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
</dict>
<key>9EEC4492135749D200615446</key>
<dict>
<key>buildConfigurationList</key>
<string>9EEC44C5135749D300615446</string>
<key>buildPhases</key>
<array>
<string>9EEC448F135749D200615446</string>
<string>9EEC4490135749D200615446</string>
<string>9EEC4491135749D200615446</string>
</array>
<key>buildRules</key>
<array/>
<key>dependencies</key>
<array/>
<key>isa</key>
<string>PBXNativeTarget</string>
<key>name</key>
<string>Another</string>
<key>productName</key>
<string>Another</string>
<key>productReference</key>
<string>9EEC4493135749D200615446</string>
<key>productType</key>
<string>com.apple.product-type.application</string>
</dict>
<key>9EEC4493135749D200615446</key>
<dict>
<key>explicitFileType</key>
<string>wrapper.application</string>
<key>includeInIndex</key>
<string>0</string>
<key>isa</key>
<string>PBXFileReference</string>
<key>path</key>
<string>Another.app</string>
<key>sourceTree</key>
<string>BUILT_PRODUCTS_DIR</string>
</dict>
<key>9EEC4494135749D200615446</key>
<dict>
<key>children</key>
<array>
<string>9EEC4493135749D200615446</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Products</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC4496135749D200615446</key>
<dict>
<key>children</key>
<array>
<string>9EEC4497135749D200615446</string>
<string>9EEC4499135749D300615446</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Frameworks</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC4497135749D200615446</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>wrapper.framework</string>
<key>name</key>
<string>Cocoa.framework</string>
<key>path</key>
<string>System/Library/Frameworks/Cocoa.framework</string>
<key>sourceTree</key>
<string>SDKROOT</string>
</dict>
<key>9EEC4498135749D200615446</key>
<dict>
<key>fileRef</key>
<string>9EEC4497135749D200615446</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>9EEC4499135749D300615446</key>
<dict>
<key>children</key>
<array>
<string>9EEC449A135749D300615446</string>
<string>9EEC449B135749D300615446</string>
<string>9EEC449C135749D300615446</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Other Frameworks</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC449A135749D300615446</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>wrapper.framework</string>
<key>name</key>
<string>AppKit.framework</string>
<key>path</key>
<string>System/Library/Frameworks/AppKit.framework</string>
<key>sourceTree</key>
<string>SDKROOT</string>
</dict>
<key>9EEC449B135749D300615446</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>wrapper.framework</string>
<key>name</key>
<string>CoreData.framework</string>
<key>path</key>
<string>System/Library/Frameworks/CoreData.framework</string>
<key>sourceTree</key>
<string>SDKROOT</string>
</dict>
<key>9EEC449C135749D300615446</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>wrapper.framework</string>
<key>name</key>
<string>Foundation.framework</string>
<key>path</key>
<string>System/Library/Frameworks/Foundation.framework</string>
<key>sourceTree</key>
<string>SDKROOT</string>
</dict>
<key>9EEC44C3135749D300615446</key>
<dict>
<key>buildSettings</key>
<dict>
<key>ARCHS</key>
<string>$(ARCHS_STANDARD_32_64_BIT)</string>
<key>GCC_C_LANGUAGE_STANDARD</key>
<string>gnu99</string>
<key>GCC_OPTIMIZATION_LEVEL</key>
<string>0</string>
<key>GCC_PREPROCESSOR_DEFINITIONS</key>
<string>DEBUG</string>
<key>GCC_SYMBOLS_PRIVATE_EXTERN</key>
<string>NO</string>
<key>GCC_VERSION</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>GCC_WARN_64_TO_32_BIT_CONVERSION</key>
<string>YES</string>
<key>GCC_WARN_ABOUT_RETURN_TYPE</key>
<string>YES</string>
<key>GCC_WARN_UNUSED_VARIABLE</key>
<string>YES</string>
<key>MACOSX_DEPLOYMENT_TARGET</key>
<string>10.6</string>
<key>ONLY_ACTIVE_ARCH</key>
<string>YES</string>
<key>SDKROOT</key>
<string>macosx</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Debug</string>
</dict>
<key>9EEC44C4135749D300615446</key>
<dict>
<key>buildSettings</key>
<dict>
<key>ARCHS</key>
<string>$(ARCHS_STANDARD_32_64_BIT)</string>
<key>GCC_C_LANGUAGE_STANDARD</key>
<string>gnu99</string>
<key>GCC_VERSION</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>GCC_WARN_64_TO_32_BIT_CONVERSION</key>
<string>YES</string>
<key>GCC_WARN_ABOUT_RETURN_TYPE</key>
<string>YES</string>
<key>GCC_WARN_UNUSED_VARIABLE</key>
<string>YES</string>
<key>MACOSX_DEPLOYMENT_TARGET</key>
<string>10.6</string>
<key>SDKROOT</key>
<string>macosx</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Release</string>
</dict>
<key>9EEC44C5135749D300615446</key>
<dict>
<key>buildConfigurations</key>
<array>
<string>9EEC44C6135749D300615446</string>
<string>9EEC44C7135749D300615446</string>
</array>
<key>defaultConfigurationIsVisible</key>
<string>0</string>
<key>defaultConfigurationName</key>
<string>Release</string>
<key>isa</key>
<string>XCConfigurationList</string>
</dict>
<key>9EEC44C6135749D300615446</key>
<dict>
<key>buildSettings</key>
<dict>
<key>ALWAYS_SEARCH_USER_PATHS</key>
<string>NO</string>
<key>COMBINE_HIDPI_IMAGES</key>
<string>YES</string>
<key>COPY_PHASE_STRIP</key>
<string>NO</string>
<key>GCC_DYNAMIC_NO_PIC</key>
<string>NO</string>
<key>GCC_ENABLE_OBJC_EXCEPTIONS</key>
<string>YES</string>
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<string>YES</string>
<key>GCC_PREFIX_HEADER</key>
<string>Another/Another-Prefix.pch</string>
<key>INFOPLIST_FILE</key>
<string>Another/Another-Info.plist</string>
<key>PRODUCT_NAME</key>
<string>$(TARGET_NAME)</string>
<key>WRAPPER_EXTENSION</key>
<string>app</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Debug</string>
</dict>
<key>9EEC44C7135749D300615446</key>
<dict>
<key>buildSettings</key>
<dict>
<key>ALWAYS_SEARCH_USER_PATHS</key>
<string>NO</string>
<key>COMBINE_HIDPI_IMAGES</key>
<string>YES</string>
<key>COPY_PHASE_STRIP</key>
<string>YES</string>
<key>DEBUG_INFORMATION_FORMAT</key>
<string>dwarf-with-dsym</string>
<key>GCC_ENABLE_OBJC_EXCEPTIONS</key>
<string>YES</string>
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<string>YES</string>
<key>GCC_PREFIX_HEADER</key>
<string>Another/Another-Prefix.pch</string>
<key>INFOPLIST_FILE</key>
<string>Another/Another-Info.plist</string>
<key>PRODUCT_NAME</key>
<string>$(TARGET_NAME)</string>
<key>WRAPPER_EXTENSION</key>
<string>app</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Release</string>
</dict>
<key>9EEC44CB13574A0B00615446</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>folder</string>
<key>name</key>
<string>CappuccinoResources</string>
<key>path</key>
<string>Resources</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>9EEC44CC13574A0B00615446</key>
<dict>
<key>fileRef</key>
<string>9EEC44CB13574A0B00615446</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>F7B045A2B5801CC7BC4C6D50</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>sourcecode.c.h</string>
<key>name</key>
<string>xcc_general_include.h</string>
<key>path</key>
<string>.XcodeSupport/xcc_general_include.h</string>
<key>sourceTree</key>
<string>SOURCE_ROOT</string>
</dict>
</dict>
<key>rootObject</key>
<string>9EEC448A135749D200615446</string>
</dict>
</plist>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:KeyViewLoopTest.xcodeproj">
</FileRef>
</Workspace>
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,107 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index-debug.html
KeyViewLoopTest
Created by You on January 7, 2013.
Copyright 2013, Your Company All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>KeyViewLoopTest</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
// the class name of the view that created them. Comment this or set to false to disable.
appkit_tag_dom_elements = true;
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading KeyViewLoopTest...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+77
View File
@@ -0,0 +1,77 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index.html
KeyViewLoopTest
Created by You on January 7, 2013.
Copyright 2013, Your Company All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>KeyViewLoopTest</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading KeyViewLoopTest...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
/*
* AppController.j
* panel
*
* Created by You on January 7, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}