Objj2 compiler fixes

Compiled all files individually:

- Added missing imports.
- Added @class/@global declarations to break circular dependencies.
- Misc. code cleanup.

Conflicts:
	AppKit/CPWindow/_CPWindow.j
	AppKit/Platform/DOM/CPPlatformWindow+DOM.j
This commit is contained in:
Aparajita Fishman committed 2013-01-23 15:48:55 +07:00
1 parent 64a0fb278b
commit 4f377bcebe
83 files changed
+996 -599

No files matched your search

+1 -1
View File
@@ -28,7 +28,6 @@
@import <Foundation/CPObject.j>
@import <Foundation/CPString.j>
@import "CPApplication.j"
@import "CPButton.j"
@import "CPColor.j"
@import "CPFont.j"
@@ -39,6 +38,7 @@
@class CPCheckBox
@global CPApp
/*
@global
+5 -5
View File
@@ -25,17 +25,17 @@
@import <Foundation/CPBundle.j>
@import "CPCompatibility.j"
@import "CPColorPanel.j"
@import "CPCursor.j"
@import "CPDocumentController.j"
@import "CPEvent.j"
@import "CPMenu.j"
@import "CPResponder.j"
@import "CPDocumentController.j"
@import "CPThemeBlend.j"
@import "CPCibLoading.j"
@import "CPPanel.j"
@import "CPPlatform.j"
@class CPCursor
@class CPColorPanel
@import "CPWindowController.j"
var CPMainCibFile = @"CPMainCibFile",
CPMainCibFileHumanFriendly = @"Main cib file base name",
+3 -2
View File
@@ -24,15 +24,16 @@
@import "CPControl.j"
@import "CPImage.j"
@import "CPScrollView.j"
@import "CPTableView.j"
@import "CPTextField.j"
@import "CPScrollView.j"
@global CPApp
/*!
@ingroup appkit
@class CPBrowser
*/
@implementation CPBrowser : CPControl
{
id _delegate;
+2 -2
View File
@@ -3,7 +3,7 @@
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2008, 280 North, Inc.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,10 +21,10 @@
*/
@import "CPView.j"
@import "CPWindow_Constants.j"
@class CPSplitView
@global CPWindowAbove
@global CPPopUpButtonStatePullsDown
+5 -1
View File
@@ -26,9 +26,13 @@
@import <Foundation/CPKeyedArchiver.j>
@import <Foundation/CPKeyedUnarchiver.j>
@import "CPView.j"
@import "CPCollectionViewItem.j"
@import "CPCompatibility.j"
@import "CPPasteboard.j"
@import "CPView.j"
@class CPClipView
/*!
@ingroup appkit
+12 -12
View File
@@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPApplication.j"
@import "CPButton.j"
@import "CPCookie.j"
@import "CPPanel.j"
@@ -28,17 +27,7 @@
@class CPSlider
CPColorPanelColorDidChangeNotification = @"CPColorPanelColorDidChangeNotification";
var PREVIEW_HEIGHT = 20.0,
TOOLBAR_HEIGHT = 32.0,
SWATCH_HEIGHT = 14.0,
ICON_WIDTH = 32.0,
ICON_PADDING = 12.0;
var SharedColorPanel = nil,
ColorPickerClasses = [];
@global CPApp
/*
A color wheel
@@ -56,6 +45,17 @@ CPSliderColorPickerMode = 2;
CPColorPickerViewWidth = 265;
CPColorPickerViewHeight = 370;
CPColorPanelColorDidChangeNotification = @"CPColorPanelColorDidChangeNotification";
var PREVIEW_HEIGHT = 20.0,
TOOLBAR_HEIGHT = 32.0,
SWATCH_HEIGHT = 14.0,
ICON_WIDTH = 32.0,
ICON_PADDING = 12.0;
var SharedColorPanel = nil,
ColorPickerClasses = [];
/*!
@ingroup appkit
@class CPColorPanel
+2
View File
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
var sRGBColorSpace = nil;
/*!
+1
View File
@@ -24,6 +24,7 @@
@import <Foundation/CPFormatter.j>
@import <Foundation/CPTimer.j>
@import "CPFont.j"
@import "CPShadow.j"
@import "CPView.j"
+1 -3
View File
@@ -23,17 +23,15 @@
@import <Foundation/CPString.j>
@import <Foundation/CPArray.j>
@import "CPApplication.j"
@import "CPAlert.j"
@import "CPResponder.j"
@import "CPSavePanel.j"
@import "CPViewController.j"
@import "CPWindowController.j"
@class CPDocumentController
@class CPAlert
@global CPApp
@global CPWarningAlertStyle
/*
+1
View File
@@ -26,6 +26,7 @@
@import "CPDocument.j"
@import "CPOpenPanel.j"
@import "CPMenuItem.j"
@import "CPWindowController.j"
@global CPApp
+2 -10
View File
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPApplication.j"
@import "CPDragServer_Constants.j"
@import "CPEvent.j"
@import "CPImageView.j"
@import "CPPasteboard.j"
@@ -29,15 +29,7 @@
@class _CPDOMDataTransferPasteboard
CPDragOperationNone = 0;
CPDragOperationCopy = 1 << 1;
CPDragOperationLink = 1 << 1;
CPDragOperationGeneric = 1 << 2;
CPDragOperationPrivate = 1 << 3;
CPDragOperationMove = 1 << 4;
CPDragOperationDelete = 1 << 5;
CPDragOperationEvery = -1;
@global CPApp
#define DRAGGING_WINDOW(anObject) ([anObject isKindOfClass:[CPWindow class]] ? anObject : [anObject window])
+30
View File
@@ -0,0 +1,30 @@
/*
* CPDragServer_Constants.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2008, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
CPDragOperationNone = 0;
CPDragOperationCopy = 1 << 1;
CPDragOperationLink = 1 << 1;
CPDragOperationGeneric = 1 << 2;
CPDragOperationPrivate = 1 << 3;
CPDragOperationMove = 1 << 4;
CPDragOperationDelete = 1 << 5;
CPDragOperationEvery = -1;
+3
View File
@@ -22,6 +22,9 @@
@import <Foundation/CPObject.j>
@import <Foundation/CPGeometry.j>
@import <Foundation/CPObjJRuntime.j>
@import <Foundation/CPString.j>
@import "CPText.j"
@class CPTextField
+2
View File
@@ -24,6 +24,8 @@
@import "CPFont.j"
@global CPApp
CPItalicFontMask = 1 << 0;
CPBoldFontMask = 1 << 1;
CPUnboldFontMask = 1 << 2;
+9
View File
@@ -20,6 +20,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPException.j>
@import <Foundation/CPMutableArray.j>
@import "CoreGraphics/CGColor.j"
@import "CoreGraphics/CGColorSpace.j"
@import "CoreGraphics/CGGradient.j"
@import "CPGraphicsContext.j"
CPGradientDrawsBeforeStartingLocation = kCGGradientDrawsBeforeStartLocation;
CPGradientDrawsAfterEndingLocation = kCGGradientDrawsAfterEndLocation;
+1
View File
@@ -28,6 +28,7 @@
@import <Foundation/CPString.j>
@import <Foundation/CPData.j>
@import "CPCompatibility.j"
CPImageLoadStatusInitialized = 0;
CPImageLoadStatusLoading = 1;
+1
View File
@@ -21,6 +21,7 @@
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPArray.j>
@import "CPEvent.j"
+3
View File
@@ -21,6 +21,9 @@
*/
@import "CPControl.j"
@import "CPWindow_Constants.j"
@global CPApp
CPTickMarkBelow = 0;
CPTickMarkAbove = 1;
-5
View File
@@ -25,15 +25,10 @@
@import <Foundation/CPNotificationCenter.j>
@import <Foundation/CPString.j>
@import "_CPMenuManager.j"
@import "CPApplication.j"
@import "CPClipView.j"
@import "CPMenuItem.j"
@import "CPPanel.j"
@global CPApp
CPMenuDidAddItemNotification = @"CPMenuDidAddItemNotification";
CPMenuDidChangeItemNotification = @"CPMenuDidChangeItemNotification";
CPMenuDidRemoveItemNotification = @"CPMenuDidRemoveItemNotification";
+25 -103
View File
@@ -1,5 +1,29 @@
/*
* _CPMenuBarWindow.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPPanel.j"
@import "_CPMenuWindow.j"
@import "_CPMenuManager.j"
@class _CPMenuView
@global CPMenuDidAddItemNotification
@global CPMenuDidChangeItemNotification
@@ -432,105 +456,3 @@
}
@end
// Unused in AppKit ?
// @implementation _CPMenuBarView : _CPMenuView
// {
// }
//
// - (CGRect)rectForItemAtIndex:(int)anIndex
// {
// return [_menuItemViews[anIndex === CPNotFound ? 0 : anIndex] frame];
// }
//
// - (int)itemIndexAtPoint:(CGPoint)aPoint
// {
// var bounds = [self bounds];
//
// if (!CGRectContainsPoint(bounds, aPoint))
// return CPNotFound;
//
// var x = aPoint.x,
// low = 0,
// high = _visibleMenuItemInfos.length - 1;
//
// while (low <= high)
// {
// var middle = FLOOR(low + (high - low) / 2),
// info = _visibleMenuItemInfos[middle],
// frame = [info.view frame];
//
// if (x < CGRectGetMinX(frame))
// high = middle - 1;
//
// else if (x > CGRectGetMaxX(frame))
// low = middle + 1;
//
// else
// return info.index;
// }
//
// return CPNotFound;
// }
//
// - (void)tile
// {
// var items = [_menu itemArray],
// index = 0,
// count = items.length,
//
// x = MENUBAR_LEFT_MARGIN,
// y = 0.0,
// isLeftAligned = YES;
//
// for (; index < count; ++index)
// {
// var item = items[index];
//
// if ([item isSeparatorItem])
// {
// x = CGRectGetWidth([self frame]) - MENUBAR_RIGHT_MARGIN;
// isLeftAligned = NO;
//
// continue;
// }
//
// if ([item isHidden])
// continue;
//
// var menuItemView = [item _menuItemView],
// frame = [menuItemView frame];
//
// if (isLeftAligned)
// {
// [menuItemView setFrameOrigin:CGPointMake(x, (MENUBAR_HEIGHT - 1.0 - CGRectGetHeight(frame)) / 2.0)];
//
// x += CGRectGetWidth([menuItemView frame]) + MENUBAR_MARGIN;
// }
// else
// {
// [menuItemView setFrameOrigin:CGPointMake(x - CGRectGetWidth(frame), (MENUBAR_HEIGHT - 1.0 - CGRectGetHeight(frame)) / 2.0)];
//
// x = CGRectGetMinX([menuItemView frame]) - MENUBAR_MARGIN;
// }
// }
//
// var bounds = [[self contentView] bounds],
// titleFrame = [_titleField frame];
//
// if ([_iconImageView isHidden])
// [_titleField setFrameOrigin:CGPointMake((CGRectGetWidth(bounds) - CGRectGetWidth(titleFrame)) / 2.0, (CGRectGetHeight(bounds) - CGRectGetHeight(titleFrame)) / 2.0)];
// else
// {
// var iconFrame = [_iconImageView frame],
// iconWidth = CGRectGetWidth(iconFrame),
// totalWidth = iconWidth + CGRectGetWidth(titleFrame);
//
// [_iconImageView setFrameOrigin:CGPointMake((CGRectGetWidth(bounds) - totalWidth) / 2.0, (CGRectGetHeight(bounds) - CGRectGetHeight(iconFrame)) / 2.0)];
// [_titleField setFrameOrigin:CGPointMake((CGRectGetWidth(bounds) - totalWidth) / 2.0 + iconWidth, (CGRectGetHeight(bounds) - CGRectGetHeight(titleFrame)) / 2.0)];
// }
// }
//
// @end
+28 -3
View File
@@ -1,7 +1,32 @@
@import <Foundation/Foundation.j>
@import "CPWindow.j"
@import "CPEvent.j"
/*
* _CPMenuManager.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPNotificationCenter.j>
@import "CPEvent.j"
@import "CPKeyBinding.j"
@class CPWindow
@class _CPMenuWindow
+25 -1
View File
@@ -1,5 +1,29 @@
/*
* _CPMenuWindow.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPClipView.j"
@import "CPImageView.j"
@import "CPWindow.j"
@import "CPView.j"
@import "_CPMenuManager.j"
var _CPMenuWindowPool = [],
_CPMenuWindowPoolCapacity = 5,
+21 -20
View File
@@ -25,31 +25,32 @@
@import <Foundation/CPString.j>
@import "CPImage.j"
@import "CPMenu.j"
@import "CPView.j"
@import "_CPMenuItemView.j"
@class CPMenu
@global CPApp
var CPMenuItemStringRepresentationDictionary = [CPDictionary dictionary];
[CPMenuItemStringRepresentationDictionary setObject:"\u238B" forKey:CPEscapeFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u21E5" forKey:CPTabCharacter];
[CPMenuItemStringRepresentationDictionary setObject:"\u21E4" forKey:CPBackTabCharacter];
[CPMenuItemStringRepresentationDictionary setObject:"\u2423" forKey:CPSpaceFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u23CE" forKey:CPCarriageReturnCharacter];
[CPMenuItemStringRepresentationDictionary setObject:"\u232B" forKey:CPBackspaceCharacter];
[CPMenuItemStringRepresentationDictionary setObject:"\u232B" forKey:CPDeleteFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u2326" forKey:CPDeleteCharacter];
[CPMenuItemStringRepresentationDictionary setObject:"\u21F1" forKey:CPHomeFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u21F2" forKey:CPEndFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u21DE" forKey:CPPageUpFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u21DF" forKey:CPPageDownFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u2191" forKey:CPUpArrowFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u2193" forKey:CPDownArrowFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u2190" forKey:CPLeftArrowFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u2192" forKey:CPRightArrowFunctionKey];
[CPMenuItemStringRepresentationDictionary setObject:"\u2327" forKey:CPClearDisplayFunctionKey];
var CPMenuItemStringRepresentationDictionary = [CPDictionary dictionaryWithObjectsAndKeys:
"\u238B", CPEscapeFunctionKey,
"\u21E5", CPTabCharacter,
"\u21E4", CPBackTabCharacter,
"\u2423", CPSpaceFunctionKey,
"\u23CE", CPCarriageReturnCharacter,
"\u232B", CPBackspaceCharacter,
"\u232B", CPDeleteFunctionKey,
"\u2326", CPDeleteCharacter,
"\u21F1", CPHomeFunctionKey,
"\u21F2", CPEndFunctionKey,
"\u21DE", CPPageUpFunctionKey,
"\u21DF", CPPageDownFunctionKey,
"\u2191", CPUpArrowFunctionKey,
"\u2193", CPDownArrowFunctionKey,
"\u2190", CPLeftArrowFunctionKey,
"\u2192", CPRightArrowFunctionKey,
"\u2327", CPClearDisplayFunctionKey
];
/*!
@ingroup appkit
+24 -1
View File
@@ -1,4 +1,27 @@
@import "CPView.j"
/*
* _CPMenuItemMenuBarView.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPControl.j"
@import "_CPImageAndTextView.j"
@class _CPMenuBarWindow
@class _CPMenuView
+22 -1
View File
@@ -1,3 +1,24 @@
/*
* _CPMenuItemSeparatorView.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPView.j"
@@ -35,4 +56,4 @@
CGContextStrokePath(context);
}
@end
@end
@@ -1,4 +1,28 @@
/*
* _CPMenuItemStandardView.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPControl.j"
@import "CPImageView.j"
@import "_CPImageAndTextView.j"
@implementation _CPMenuItemStandardView : CPView
{
+21
View File
@@ -1,3 +1,24 @@
/*
* _CPMenuItemView.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPControl.j"
+1
View File
@@ -24,6 +24,7 @@
@import <Foundation/CPCountedSet.j>
@import "CPController.j"
@import "CPKeyValueBinding.j"
/*!
@class
+2 -1
View File
@@ -20,10 +20,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPButton.j"
@import "CPTableColumn.j"
@import "CPTableView.j"
@import "CPButton.j"
@global CPApp
CPOutlineViewColumnDidMoveNotification = @"CPOutlineViewColumnDidMoveNotification";
CPOutlineViewColumnDidResizeNotification = @"CPOutlineViewColumnDidResizeNotification";
+1
View File
@@ -22,6 +22,7 @@
@import <Foundation/CPObject.j>
@import <Foundation/CPArray.j>
@import <Foundation/CPData.j>
@import <Foundation/CPDictionary.j>
@import <Foundation/CPPropertyListSerialization.j>
+1
View File
@@ -23,6 +23,7 @@
@import "CGGeometry.j"
@import "CPImageView.j"
@import "CPView.j"
@import "CPWindow_Constants.j"
/*
+2
View File
@@ -25,6 +25,8 @@
@import "CPButton.j"
@global CPApp
/*!
@ingroup appkit
+3
View File
@@ -21,6 +21,9 @@
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPObjJRuntime.j>
@import "CPEvent.j"
@class CPKeyBinding
@@ -22,6 +22,12 @@
@import <Foundation/CPPredicate.j>
@import "CPCheckBox.j"
@import "CPPopUpButton.j"
@import "CPMenuItem.j"
@import "CPTextField.j"
// NOTE: CPDatePicker is not implemented yet
@class CPDatePicker
+2 -20
View File
@@ -24,6 +24,8 @@
@import <Foundation/CPArray.j>
@import <Foundation/CPDictionary.j>
@import <Foundation/CPIndexSet.j>
@import "CPRuleEditor_Constants.j"
@import "CPTextField.j"
@import "CPViewAnimation.j"
@import "CPView.j"
@@ -38,26 +40,6 @@
@global CPCaseInsensitivePredicateOption
@global CPOrPredicateType
CPRuleEditorPredicateLeftExpression = "CPRuleEditorPredicateLeftExpression";
CPRuleEditorPredicateRightExpression = "CPRuleEditorPredicateRightExpression";
CPRuleEditorPredicateComparisonModifier = "CPRuleEditorPredicateComparisonModifier";
CPRuleEditorPredicateOptions = "CPRuleEditorPredicateOptions";
CPRuleEditorPredicateOperatorType = "CPRuleEditorPredicateOperatorType";
CPRuleEditorPredicateCustomSelector = "CPRuleEditorPredicateCustomSelector";
CPRuleEditorPredicateCompoundType = "CPRuleEditorPredicateCompoundType";
CPRuleEditorRowsDidChangeNotification = "CPRuleEditorRowsDidChangeNotification";
CPRuleEditorRulesDidChangeNotification = "CPRuleEditorRulesDidChangeNotification";
CPRuleEditorNestingModeSingle = 0; // Only a single row is allowed. Plus/minus buttons will not be shown
CPRuleEditorNestingModeList = 1; // Allows a single list, with no nesting and no compound rows
CPRuleEditorNestingModeCompound = 2; // Unlimited nesting and compound rows; this is the default
CPRuleEditorNestingModeSimple = 3; // One compound row at the top with subrows beneath it, and no further nesting allowed
CPRuleEditorRowTypeSimple = 0;
CPRuleEditorRowTypeCompound = 1;
var CPRuleEditorItemPBoardType = @"CPRuleEditorItemPBoardType",
itemsContext = "items",
valuesContext = "values",
@@ -0,0 +1,40 @@
/*
* CPRuleEditor_Constants.j
* AppKit
*
* Created by cacaodev.
* Copyright 2011, cacaodev.
*
* 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
*/
CPRuleEditorPredicateLeftExpression = "CPRuleEditorPredicateLeftExpression";
CPRuleEditorPredicateRightExpression = "CPRuleEditorPredicateRightExpression";
CPRuleEditorPredicateComparisonModifier = "CPRuleEditorPredicateComparisonModifier";
CPRuleEditorPredicateOptions = "CPRuleEditorPredicateOptions";
CPRuleEditorPredicateOperatorType = "CPRuleEditorPredicateOperatorType";
CPRuleEditorPredicateCustomSelector = "CPRuleEditorPredicateCustomSelector";
CPRuleEditorPredicateCompoundType = "CPRuleEditorPredicateCompoundType";
CPRuleEditorRowsDidChangeNotification = "CPRuleEditorRowsDidChangeNotification";
CPRuleEditorRulesDidChangeNotification = "CPRuleEditorRulesDidChangeNotification";
CPRuleEditorNestingModeSingle = 0; // Only a single row is allowed. Plus/minus buttons will not be shown
CPRuleEditorNestingModeList = 1; // Allows a single list, with no nesting and no compound rows
CPRuleEditorNestingModeCompound = 2; // Unlimited nesting and compound rows; this is the default
CPRuleEditorNestingModeSimple = 3; // One compound row at the top with subrows beneath it, and no further nesting allowed
CPRuleEditorRowTypeSimple = 0;
CPRuleEditorRowTypeCompound = 1;
@@ -1,9 +1,25 @@
/*
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
//@class _CPPredicateEditorTree;
@import <Foundation/CPObject.j>
@import <Foundation/CPString.j>
@implementation _CPPredicateEditorRowNode : CPObject
{
_CPPredicateEditorTree tree @accessors;
+19 -2
View File
@@ -1,8 +1,25 @@
/*
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPString.j>
@implementation _CPPredicateEditorTree : CPObject
{
CPPredicateEditorRowTemplate template @accessors;
+18 -2
View File
@@ -1,11 +1,27 @@
/*
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPDictionary.j>
@import <Foundation/CPString.j>
@import <Foundation/CPURLConnection.j>
@import <Foundation/CPURLRequest.j>
var LocalizerStringsRegex = new RegExp("\"(.+)\"\\s*=\\s*\"(.+)\"\\s*;\\s*(//.+)?");
+19 -2
View File
@@ -1,10 +1,27 @@
/*
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPBezierPath.j"
@import "CPPopUpButton.j"
@class _CPRuleEditorViewSlice
var GRADIENT_START_COLOR = "#fcfcfc",
GRADIENT_END_COLOR = "#dfdfdf",
BORDER_COLOR = "#BDBDBD";
+16 -2
View File
@@ -1,6 +1,20 @@
/*
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPView.j"
@@ -1,16 +1,27 @@
/*
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
* Created by cacaodev@gmail.com.
* Copyright (c) 2011 Pear, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPRuleEditor_Constants.j"
@import "_CPRuleEditorViewSlice.j"
@import "_CPRuleEditorPopUpButton.j"
@import "CPRuleEditor.j"
@global CPRuleEditorNestingModeCompound
@global CPRuleEditorRowTypeCompound
@global CPRuleEditorNestingModeSingle
@global CPApp
var CONTROL_HEIGHT = 16.,
BUTTON_HEIGHT = 16.;
+2 -3
View File
@@ -25,14 +25,13 @@
#include "../Foundation/Foundation.h"
@import "CPAnimation.j"
@import "CPControl.j"
@import "CPWindow_Constants.j"
@import "CPViewAnimation.j"
@global CPWindowAbove
@global CPWindowBelow
@global CPApp
// CPScroller Constants
CPScrollerNoPart = 0;
CPScrollerDecrementPage = 1;
+3
View File
@@ -21,10 +21,13 @@
*/
@import "CPButton.j"
@import "CPMenu.j"
@import "CPMenuItem.j"
@import "CPTextField.j"
@class CPUserDefaults
@global CPApp
CPSearchFieldRecentsTitleMenuItemTag = 1000;
CPSearchFieldRecentsMenuItemTag = 1001;
+3
View File
@@ -23,7 +23,10 @@
@import <Foundation/CPArray.j>
@import "CPControl.j"
@import "CPWindow_Constants.j"
@import "_CPImageAndTextView.j"
@global CPApp
CPSegmentSwitchTrackingSelectOne = 0;
CPSegmentSwitchTrackingSelectAny = 1;
-1
View File
@@ -24,7 +24,6 @@
@import "CGGeometry.j"
@import "CPImage.j"
@import "CPImageView.j"
@import "CPView.j"
+1
View File
@@ -21,6 +21,7 @@
*/
@import "CPControl.j"
@import "CPWindow_Constants.j"
/*! SLIDER STATES */
+3 -3
View File
@@ -20,10 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPView.j"
@import "CPColorPicker.j"
@class CPSlider
@import "CPSlider.j"
@import "CPTextField.j"
@import "CPView.j"
@global CPColorPickerViewWidth
@global CPColorPickerViewHeight
+1
View File
@@ -21,6 +21,7 @@
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPRunLoop.j>
CPSoundLoadStateEmpty = 0;
CPSoundLoadStateLoading = 1;
+1
View File
@@ -22,6 +22,7 @@
@import <Foundation/CPString.j>
@import "CoreGraphics/CGGeometry.j"
@import "CPPlatformString.j"
+2 -2
View File
@@ -26,11 +26,11 @@
@import <Foundation/CPSortDescriptor.j>
@import <Foundation/CPString.j>
@import "CPTableHeaderView.j"
@import "CPKeyValueBinding.j"
@import "CPTextField.j"
@global CPTableViewColumnDidResizeNotification
@class _CPTableColumnHeaderView
CPTableColumnNoResizing = 0;
CPTableColumnAutoresizingMask = 1 << 0;
+6 -5
View File
@@ -22,14 +22,14 @@
@import <Foundation/CPIndexSet.j>
@import "CPTableColumn.j"
@import "CPTableView.j"
@import "CPView.j"
@import "CPCursor.j"
@import "CPPasteboard.j"
@import "CPTableColumn.j"
@import "CPView.j"
@import "_CPImageAndTextView.j"
@class CPCursor
@class CPTableView
@global CPTableColumnUserResizingMask
@global CPApp
@@ -52,6 +52,7 @@
- (void)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
[self _init];
+17 -9
View File
@@ -23,25 +23,25 @@
@import <Foundation/CPArray.j>
@import <Foundation/CPIndexSet.j>
@import "CPDragServer_Constants.j"
@import "CGGradient.j"
@import "CPControl.j"
@import "CPTableColumn.j"
@import "_CPCornerView.j"
@import "CPScroller.j"
@import "CPCompatibility.j"
@import "CPPasteboard.j"
@import "CPDragServer.j"
@import "CPControl.j"
@import "CPImageView.j"
@import "CPScroller.j"
@import "CPScrollView.j"
@import "CPTableColumn.j"
@import "CPTableHeaderView.j"
@import "_CPCornerView.j"
@class CPScrollView
@class CPButton
@class CPClipView
@class CPUserDefaults
@class CPTableHeaderView
@class CPClipView
@class CPButton
@global CPApp
@global CPTableColumnAutoresizingMask
CPTableViewColumnDidMoveNotification = @"CPTableViewColumnDidMoveNotification";
@@ -4652,6 +4652,14 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
return YES;
}
/*!
@ignore
*/
- (BOOL)needsPanelToBecomeKey
{
return YES;
}
/*!
@ignore
*/
+11 -2
View File
@@ -785,11 +785,20 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
}
/*!
Text fields require panels to become key window, so this returns \c YES.
Text fields require panels to become key window, so this returns \c YES
if the text field is ready to become the first responder as well.
*/
- (BOOL)needsPanelToBecomeKey
{
return YES;
return [self acceptsFirstResponder];
}
/*!
Only text fields that can become first responder accepts first mouse.
*/
- (BOOL)acceptsFirstMouse:(CPEvent)anEvent
{
return [self acceptsFirstResponder];
}
- (void)mouseDown:(CPEvent)anEvent
+3 -1
View File
@@ -31,9 +31,11 @@
@import "CPScrollView.j"
@import "CPTextField.j"
@import "CPTableView.j"
@import "CPWindow.j"
@import "CPWindow_Constants.j"
@import "_CPAutocompleteMenu.j"
@global CPApp
#if PLATFORM(DOM)
var CPTokenFieldDOMInputElement = nil,
+1
View File
@@ -28,6 +28,7 @@
@import "CPPopUpButton.j"
@import "CPToolbarItem.j"
@global CPApp
/*
@global
+3 -1
View File
@@ -23,8 +23,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPDictionary.j>
@import <Foundation/CPNotificationCenter.j>
@import <Foundation/CPString.j>
@import "CPController.j"
@class CPUserDefaults
-1
View File
@@ -22,7 +22,6 @@
@import <Foundation/CPArray.j>
@import "CPApplication.j"
@import "CPCib.j"
@import "CPResponder.j"
+1 -1
View File
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPWindow_Constants.j"
@import "_CPWindow.j"
@import "_CPWindowView.j"
@import "_CPStandardWindowView.j"
@@ -32,4 +33,3 @@
@import "_CPModalWindowView.j"
@import "_CPShadowWindowView.j"
@import "CPDragServer.j"
//@import "CPView.j"
+191
View File
@@ -0,0 +1,191 @@
/*
* CPWindow_Constants.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2008, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
Borderless window mask option.
@global
@class CPWindow
*/
CPBorderlessWindowMask = 0;
/*
Titled window mask option.
@global
@class CPWindow
*/
CPTitledWindowMask = 1 << 0;
/*
Closeable window mask option.
@global
@class CPWindow
*/
CPClosableWindowMask = 1 << 1;
/*
Miniaturizabe window mask option.
@global
@class CPWindow
*/
CPMiniaturizableWindowMask = 1 << 2;
/*
Resizable window mask option.
@global
@class CPWindow
*/
CPResizableWindowMask = 1 << 3;
/*
Textured window mask option.
@global
@class CPWindow
*/
CPTexturedBackgroundWindowMask = 1 << 8;
/*
@global
@class CPWindow
*/
CPBorderlessBridgeWindowMask = 1 << 20;
/*
@global
@class CPWindow
*/
CPHUDBackgroundWindowMask = 1 << 21;
/*!
@global
@class CPWindow
*/
_CPModalWindowMask = 1 << 22;
CPWindowNotSizable = 0;
CPWindowMinXMargin = 1;
CPWindowWidthSizable = 2;
CPWindowMaxXMargin = 4;
CPWindowMinYMargin = 8;
CPWindowHeightSizable = 16;
CPWindowMaxYMargin = 32;
CPBackgroundWindowLevel = -1;
/*
Default level for windows
@group CPWindowLevel
@global
*/
CPNormalWindowLevel = 0;
/*
Floating palette type window
@group CPWindowLevel
@global
*/
CPFloatingWindowLevel = 3;
/*
Submenu type window
@group CPWindowLevel
@global
*/
CPSubmenuWindowLevel = 3;
/*
For a torn-off menu
@group CPWindowLevel
@global
*/
CPTornOffMenuWindowLevel = 3;
/*
For the application's main menu
@group CPWindowLevel
@global
*/
CPMainMenuWindowLevel = 24;
/*
Status window level
@group CPWindowLevel
@global
*/
CPStatusWindowLevel = 25;
/*
Level for a modal panel
@group CPWindowLevel
@global
*/
CPModalPanelWindowLevel = 8;
/*
Level for a pop up menu
@group CPWindowLevel
@global
*/
CPPopUpMenuWindowLevel = 101;
/*
Level for a window being dragged
@group CPWindowLevel
@global
*/
CPDraggingWindowLevel = 500;
/*
Level for the screens saver
@group CPWindowLevel
@global
*/
CPScreenSaverWindowLevel = 1000;
/*
The receiver is placed directly in front of the window specified.
@global
@class CPWindowOrderingMode
*/
CPWindowAbove = 1;
/*
The receiver is placed directly behind the window specified.
@global
@class CPWindowOrderingMode
*/
CPWindowBelow = -1;
/*
The receiver is removed from the screen list and hidden.
@global
@class CPWindowOrderingMode
*/
CPWindowOut = 0;
CPWindowWillCloseNotification = @"CPWindowWillCloseNotification";
CPWindowDidBecomeMainNotification = @"CPWindowDidBecomeMainNotification";
CPWindowDidResignMainNotification = @"CPWindowDidResignMainNotification";
CPWindowDidBecomeKeyNotification = @"CPWindowDidBecomeKeyNotification";
CPWindowDidResignKeyNotification = @"CPWindowDidResignKeyNotification";
CPWindowDidResizeNotification = @"CPWindowDidResizeNotification";
CPWindowDidMoveNotification = @"CPWindowDidMoveNotification";
CPWindowWillBeginSheetNotification = @"CPWindowWillBeginSheetNotification";
CPWindowDidEndSheetNotification = @"CPWindowDidEndSheetNotification";
CPWindowDidMiniaturizeNotification = @"CPWindowDidMiniaturizeNotification";
CPWindowWillMiniaturizeNotification = @"CPWindowWillMiniaturizeNotification";
CPWindowDidDeminiaturizeNotification = @"CPWindowDidDeminiaturizeNotification";
_CPWindowDidChangeFirstResponderNotification = @"_CPWindowDidChangeFirstResponderNotification";
CPWindowShadowStyleStandard = 0;
CPWindowShadowStyleMenu = 1;
CPWindowShadowStylePanel = 2;
CPWindowResizeStyleModern = 0;
CPWindowResizeStyleLegacy = 1;
CPWindowResizeStyle = CPWindowResizeStyleModern;
CPWindowPositionFlexibleRight = 1 << 19;
CPWindowPositionFlexibleLeft = 1 << 20;
CPWindowPositionFlexibleBottom = 1 << 21;
CPWindowPositionFlexibleTop = 1 << 22;
+22
View File
@@ -1,3 +1,25 @@
/*
* _CPDocModalWindowView.j
* AppKit
*
* Created by Ross Boucher.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "_CPWindowView.j"
+2
View File
@@ -20,9 +20,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPButton.j"
@import "CPTextField.j"
@import "_CPTitleableWindowView.j"
@implementation _CPHUDWindowView : _CPTitleableWindowView
{
CPView _toolbarView;
+1
View File
@@ -22,6 +22,7 @@
@import "_CPWindowView.j"
@implementation _CPModalWindowView : _CPWindowView
{
}
+1
View File
@@ -23,6 +23,7 @@
@import "_CPWindowView.j"
@import "CPView.j"
@implementation _CPShadowWindowView : CPView
{
_CPWindowView _windowView @accessors(setter=setWindowView:);
+4 -3
View File
@@ -202,10 +202,11 @@
var theWindow = [self window],
bounds = [self bounds],
width = _CGRectGetWidth(bounds);
width = _CGRectGetWidth(bounds),
headHeight = [self toolbarMaxY];
[_headView setFrameSize:_CGSizeMake(width, [self toolbarMaxY])];
[_dividerView setFrame:_CGRectMake(0.0, _CGRectGetMaxY([_headView frame]), width, 1.0)];
[_headView setFrameSize:_CGSizeMake(width, headHeight)];
[_dividerView setFrame:_CGRectMake(0.0, headHeight, width, 1.0)];
var dividerMaxY = 0,
dividerMinY = 0;
+14 -178
View File
@@ -1,5 +1,5 @@
/*
* CPWindow.j
* _CPWindow.j
* AppKit
*
* Created by Francisco Tolmasky.
@@ -31,6 +31,8 @@
@import "CPScreen.j"
@import "CPEvent.j"
@import "CPView.j"
@import "CPWindow_Constants.j"
@import "_CPWindowView.j"
#if PLATFORM(BROWSER)
@import "CPPlatformWindow+DOM.j"
#endif
@@ -42,176 +44,6 @@
@class CPProgressIndicator
@global CPApp
@global CPWindowPositionFlexibleLeft
@global CPWindowPositionFlexibleRight
@global CPWindowPositionFlexibleTop
@global CPWindowPositionFlexibleBottom
/*
Borderless window mask option.
@global
@class CPWindow
*/
CPBorderlessWindowMask = 0;
/*
Titled window mask option.
@global
@class CPWindow
*/
CPTitledWindowMask = 1 << 0;
/*
Closeable window mask option.
@global
@class CPWindow
*/
CPClosableWindowMask = 1 << 1;
/*
Miniaturizabe window mask option.
@global
@class CPWindow
*/
CPMiniaturizableWindowMask = 1 << 2;
/*
Resizable window mask option.
@global
@class CPWindow
*/
CPResizableWindowMask = 1 << 3;
/*
Textured window mask option.
@global
@class CPWindow
*/
CPTexturedBackgroundWindowMask = 1 << 8;
/*
@global
@class CPWindow
*/
CPBorderlessBridgeWindowMask = 1 << 20;
/*
@global
@class CPWindow
*/
CPHUDBackgroundWindowMask = 1 << 21;
/*!
@global
@class CPWindow
*/
_CPModalWindowMask = 1 << 22;
CPWindowNotSizable = 0;
CPWindowMinXMargin = 1;
CPWindowWidthSizable = 2;
CPWindowMaxXMargin = 4;
CPWindowMinYMargin = 8;
CPWindowHeightSizable = 16;
CPWindowMaxYMargin = 32;
CPBackgroundWindowLevel = -1;
/*
Default level for windows
@group CPWindowLevel
@global
*/
CPNormalWindowLevel = 0;
/*
Floating palette type window
@group CPWindowLevel
@global
*/
CPFloatingWindowLevel = 3;
/*
Submenu type window
@group CPWindowLevel
@global
*/
CPSubmenuWindowLevel = 3;
/*
For a torn-off menu
@group CPWindowLevel
@global
*/
CPTornOffMenuWindowLevel = 3;
/*
For the application's main menu
@group CPWindowLevel
@global
*/
CPMainMenuWindowLevel = 24;
/*
Status window level
@group CPWindowLevel
@global
*/
CPStatusWindowLevel = 25;
/*
Level for a modal panel
@group CPWindowLevel
@global
*/
CPModalPanelWindowLevel = 8;
/*
Level for a pop up menu
@group CPWindowLevel
@global
*/
CPPopUpMenuWindowLevel = 101;
/*
Level for a window being dragged
@group CPWindowLevel
@global
*/
CPDraggingWindowLevel = 500;
/*
Level for the screens saver
@group CPWindowLevel
@global
*/
CPScreenSaverWindowLevel = 1000;
/*
The receiver is removed from the screen list and hidden.
@global
@class CPWindowOrderingMode
*/
CPWindowOut = 0;
/*
The receiver is placed directly in front of the window specified.
@global
@class CPWindowOrderingMode
*/
CPWindowAbove = 1;
/*
The receiver is placed directly behind the window specified.
@global
@class CPWindowOrderingMode
*/
CPWindowBelow = 2;
CPWindowWillCloseNotification = @"CPWindowWillCloseNotification";
CPWindowDidBecomeMainNotification = @"CPWindowDidBecomeMainNotification";
CPWindowDidResignMainNotification = @"CPWindowDidResignMainNotification";
CPWindowDidBecomeKeyNotification = @"CPWindowDidBecomeKeyNotification";
CPWindowDidResignKeyNotification = @"CPWindowDidResignKeyNotification";
CPWindowDidResizeNotification = @"CPWindowDidResizeNotification";
CPWindowDidMoveNotification = @"CPWindowDidMoveNotification";
CPWindowWillBeginSheetNotification = @"CPWindowWillBeginSheetNotification";
CPWindowDidEndSheetNotification = @"CPWindowDidEndSheetNotification";
CPWindowDidMiniaturizeNotification = @"CPWindowDidMiniaturizeNotification";
CPWindowWillMiniaturizeNotification = @"CPWindowWillMiniaturizeNotification";
CPWindowDidDeminiaturizeNotification = @"CPWindowDidDeminiaturizeNotification";
_CPWindowDidChangeFirstResponderNotification = @"_CPWindowDidChangeFirstResponderNotification";
CPWindowShadowStyleStandard = 0;
CPWindowShadowStyleMenu = 1;
CPWindowShadowStylePanel = 2;
CPWindowResizeStyleModern = 0;
CPWindowResizeStyleLegacy = 1;
CPWindowResizeStyle = CPWindowResizeStyleModern;
CPWindowResizeSlop = 3;
var CPWindowSaveImage = nil,
@@ -2203,7 +2035,7 @@ CPTexturedBackgroundWindowMask
if (!(_styleMask & CPClosableWindowMask))
return;
if ([self isFullBridge])
if ([self isFullPlatformWindow])
{
var event = [CPApp currentEvent];
@@ -2214,16 +2046,18 @@ CPTexturedBackgroundWindowMask
}
}
// Only send ONE windowShouldClose: message.
// The Cocoa docs say that if both the delegate and the window implement
// windowShouldClose:, only the delegate receives the message.
if ([_delegate respondsToSelector:@selector(windowShouldClose:)])
{
if (![_delegate windowShouldClose:self])
return;
}
// Only check self is delegate does NOT implement this. This also ensures this when delegate == self (returns true).
else if ([self respondsToSelector:@selector(windowShouldClose:)] && ![self windowShouldClose:self])
return;
else if ([self respondsToSelector:@selector(windowShouldClose:)])
{
if (![self windowShouldClose:self])
return;
}
var documents = [_windowController documents];
@@ -3351,7 +3185,7 @@ var keyViewComparator = function(lhs, rhs, context)
{
// If we are using the new resizing mode, mouse events are valid
// outside the window's frame for non-full platform windows.
var mouseFrame = (!_isFullPlatformWindow && (_styleMask & CPResizableWindowMask) && (CPWindowResizeStyle === CPWindowResizeStyleModern)) ? _CGRectInset(_frame, -CPWindowResizeSlop, -CPWindowResizeSlop) : _frame;
var mouseFrame = (!_isFullPlatformWindow && (_styleMask & CPResizableWindowMask) && (CPWindowResizeStyle === CPWindowResizeStyleModern)) ? _CGRectInset(_frame, -_CPWindowViewResizeSlop, -_CPWindowViewResizeSlop) : _frame;
return _CGRectContainsPoint(mouseFrame, aPoint);
}
@@ -3365,6 +3199,8 @@ var keyViewComparator = function(lhs, rhs, context)
*/
- (void)setFullBridge:(BOOL)shouldBeFullBridge
{
_CPReportLenientDeprecation([self class], _cmd, @selector(setFullPlatformWindow:));
[self setFullPlatformWindow:shouldBeFullBridge];
}
+25 -27
View File
@@ -22,21 +22,16 @@
@import "CPImageView.j"
@import "CPView.j"
@import "CPWindow_Constants.j"
@class CPCursor
@class CPMenu
@class CPPlatformWindow
@global CPApp
@global CPHUDBackgroundWindowMask
@global CPResizableWindowMask
@global CPWindowResizeSlop
@global CPWindowResizeStyle
@global CPWindowResizeStyleLegacy
@global CPWindowResizeStyleModern
var _CPWindowViewCornerResizeRectWidth = 10,
_CPWindowViewResizeRegionNone = -1,
_CPWindowViewResizeRegionTopLeft = 0,
_CPWindowViewResizeRegionTop = 1,
@@ -47,6 +42,9 @@ var _CPWindowViewCornerResizeRectWidth = 10,
_CPWindowViewResizeRegionBottomLeft = 6,
_CPWindowViewResizeRegionLeft = 7;
_CPWindowViewResizeSlop = 3;
@implementation _CPWindowView : CPView
{
unsigned _styleMask;
@@ -246,40 +244,40 @@ var _CPWindowViewCornerResizeRectWidth = 10,
if (isFixedWidth)
{
rect = _CGRectMake(frame.origin.x - CPWindowResizeSlop,
frame.origin.y - CPWindowResizeSlop,
frame.size.width + (CPWindowResizeSlop * 2),
CPWindowResizeSlop * 2);
rect = _CGRectMake(frame.origin.x - _CPWindowViewResizeSlop,
frame.origin.y - _CPWindowViewResizeSlop,
frame.size.width + (_CPWindowViewResizeSlop * 2),
_CPWindowViewResizeSlop * 2);
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionTop;
rect.origin.y = _CGRectGetMaxY(frame) - CPWindowResizeSlop;
rect.origin.y = _CGRectGetMaxY(frame) - _CPWindowViewResizeSlop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottom;
}
else if (isFixedHeight)
{
rect = _CGRectMake(frame.origin.x - CPWindowResizeSlop,
frame.origin.y - CPWindowResizeSlop,
CPWindowResizeSlop * 2,
frame.size.height + (CPWindowResizeSlop * 2));
rect = _CGRectMake(frame.origin.x - _CPWindowViewResizeSlop,
frame.origin.y - _CPWindowViewResizeSlop,
_CPWindowViewResizeSlop * 2,
frame.size.height + (_CPWindowViewResizeSlop * 2));
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionLeft;
rect.origin.x = _CGRectGetMaxX(frame) - CPWindowResizeSlop;
rect.origin.x = _CGRectGetMaxX(frame) - _CPWindowViewResizeSlop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionRight;
}
else
{
rect = _CGRectMake(frame.origin.x - CPWindowResizeSlop,
frame.origin.y - CPWindowResizeSlop,
_CPWindowViewCornerResizeRectWidth + CPWindowResizeSlop,
_CPWindowViewCornerResizeRectWidth + CPWindowResizeSlop);
rect = _CGRectMake(frame.origin.x - _CPWindowViewResizeSlop,
frame.origin.y - _CPWindowViewResizeSlop,
_CPWindowViewCornerResizeRectWidth + _CPWindowViewResizeSlop,
_CPWindowViewCornerResizeRectWidth + _CPWindowViewResizeSlop);
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionTopLeft;
@@ -294,33 +292,33 @@ var _CPWindowViewCornerResizeRectWidth = 10,
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottomRight;
rect.origin.x = frame.origin.x - CPWindowResizeSlop;
rect.origin.x = frame.origin.x - _CPWindowViewResizeSlop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottomLeft;
rect = _CGRectMake(rect.origin.x,
frame.origin.y + _CPWindowViewCornerResizeRectWidth,
CPWindowResizeSlop * 2,
_CPWindowViewResizeSlop * 2,
_CGRectGetHeight(frame) - (_CPWindowViewCornerResizeRectWidth * 2));
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionLeft;
rect.origin.x = _CGRectGetMaxX(frame) - CPWindowResizeSlop;
rect.origin.x = _CGRectGetMaxX(frame) - _CPWindowViewResizeSlop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionRight;
rect = _CGRectMake(frame.origin.x + _CPWindowViewCornerResizeRectWidth,
frame.origin.y - CPWindowResizeSlop,
frame.origin.y - _CPWindowViewResizeSlop,
_CGRectGetWidth(frame) - (_CPWindowViewCornerResizeRectWidth * 2),
CPWindowResizeSlop * 2);
_CPWindowViewResizeSlop * 2);
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionTop;
rect.origin.y = _CGRectGetMaxY(frame) - CPWindowResizeSlop;
rect.origin.y = _CGRectGetMaxY(frame) - _CPWindowViewResizeSlop;
if (_CGRectContainsPoint(rect, aPoint))
return _CPWindowViewResizeRegionBottom;
+1 -1
View File
@@ -23,9 +23,9 @@
@import <Foundation/CPObject.j>
@import <Foundation/CPString.j>
@import "CPCib.j"
@import "CPResponder.j"
@import "CPWindow.j"
@import "CPDocument.j"
@class CPDocument
+1 -1
View File
@@ -29,10 +29,10 @@
@import "_CPCibCustomResource.j"
@import "_CPCibCustomView.j"
@import "_CPCibKeyedUnarchiver.j"
@import "_CPCibObjectData.j"
@import "_CPCibProxyObject.j"
@import "_CPCibWindowTemplate.j"
@class _CPCibObjectData
CPCibOwner = @"CPCibOwner";
CPCibTopLevelObjects = @"CPCibTopLevelObjects";
+1
View File
@@ -24,6 +24,7 @@
@import <Foundation/CPDictionary.j>
@import <Foundation/CPString.j>
@import "CPCib.j"
var CPCibOwner = @"CPCibOwner";
+22
View File
@@ -1,5 +1,27 @@
/*
* _CPCibCustomObject.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2008, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPObjJRuntime.j>
@class CPApplication
+4
View File
@@ -26,6 +26,10 @@
@import <Foundation/CPObject.j>
@import <Foundation/CPString.j>
@import "CPCompatibility.j"
@import "CPImage.j"
@import "CPTheme.j"
@class CPButtonBar
+21
View File
@@ -1,3 +1,24 @@
/*
* _CPCibKeyedUnarchiver.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2008, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPKeyedUnarchiver.j>
+21
View File
@@ -1,3 +1,24 @@
/*
* _CPCibProxyObject.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
+26 -11
View File
@@ -1,19 +1,34 @@
/*
* _CPCibWindowTemplate.j
* AppKit
*
* Created by Francisco Tolmasky.
* Copyright 2008, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPObjJRuntime.j>
@import "CGGeometry.j"
@import "CPWindow.j"
@import "CPView.j"
@import "CPWindow_Constants.j"
@class CPToolbar
@global CPPositionProportionalHorizontal
@global CPPositionProportionalVertical
CPWindowPositionFlexibleRight = 1 << 19;
CPWindowPositionFlexibleLeft = 1 << 20;
CPWindowPositionFlexibleBottom = 1 << 21;
CPWindowPositionFlexibleTop = 1 << 22;
@implementation _CPCibWindowTemplate : CPObject
{
@@ -49,7 +64,7 @@ CPWindowPositionFlexibleTop = 1 << 22;
_windowIsFullPlatformWindow = NO;
_wtFlags = CPPositionProportionalHorizontal | CPPositionProportionalVertical;
_wtFlags = CPWindowPositionFlexibleLeft | CPWindowPositionFlexibleRight | CPWindowPositionFlexibleTop | CPWindowPositionFlexibleBottom;
}
return self;
@@ -101,7 +116,7 @@ CPWindowPositionFlexibleTop = 1 << 22;
}
[theWindow setAutorecalculatesKeyViewLoop:_windowAutorecalculatesKeyViewLoop];
[theWindow setFullBridge:_windowIsFullPlatformWindow];
[theWindow setFullPlatformWindow:_windowIsFullPlatformWindow];
theWindow._positioningMask = _wtFlags;
theWindow._positioningScreenRect = _screenRect;
+1
View File
@@ -21,6 +21,7 @@
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPRunLoop.j>
@import "CABackingStore.j"
+1 -2
View File
@@ -20,11 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPDictionary.j>
@import <Foundation/CPObject.j>
@import "CPKeyBinding.j"
//@import "CPMenu.j"
@import "CPPlatform.j"
//@import "CPEvent.j"
@class CPMenu
+131 -136
View File
@@ -109,34 +109,26 @@
@import <Foundation/CPObject.j>
@import <Foundation/CPRunLoop.j>
@import <Foundation/CPSet.j>
@import <Foundation/CPTimer.j>
@import "CPCursor.j"
@import "CPEvent.j"
@import "CPText.j"
@import "CPCompatibility.j"
@import "CPDOMWindowLayer.j"
@import "CPDragServer_Constants.j"
@import "CPPasteboard.j"
@import "CPPlatform.j"
@import "CPPlatformWindow.j"
@import "CPPlatformWindow+DOMKeys.j"
@import "CPWindow_Constants.j"
@class CPCursor
@class CPDragServer
@class CPPasteboard
@class _CPDOMDataTransferPasteboard
@class _CPToolTip
@global CPDragOperationNone
@global CPDragOperationMove
@global CPDragOperationCopy
@global CPDragOperationLink
@global CPDragOperationPrivate
@global CPDragOperationGeneric
@global CPApp
@global CPStringPboardType
@global CPWindowOut
@global _CPRunModalLoop
@global CPDraggingWindowLevel
@global CPWindowAbove
// List of all open native windows
var PlatformWindows = [CPSet set];
@@ -561,6 +553,7 @@ var resizeTimer = nil;
// FIXME: cpSetFrame?
_DOMWindow.document.write("<!DOCTYPE html><html lang='en'><head></head><body style='background-color:transparent;'></body></html>");
_DOMWindow.document.close();
if (self != [CPPlatformWindow primaryPlatformWindow])
_DOMWindow.document.title = _title;
@@ -681,7 +674,6 @@ var resizeTimer = nil;
- (void)keyEvent:(DOMEvent)aDOMEvent
{
var event,
location = _CGPointMake(aDOMEvent.clientX, aDOMEvent.clientY),
timestamp = [CPEvent currentTimestamp],
sourceElement = aDOMEvent.target || aDOMEvent.srcElement,
windowNumber = [[CPApp keyWindow] windowNumber],
@@ -716,157 +708,160 @@ var resizeTimer = nil;
var isNativePasteEvent = NO,
isNativeCopyOrCutEvent = NO,
overrideCharacters = nil;
overrideCharacters = nil,
charactersIgnoringModifiers = @"";
switch (aDOMEvent.type)
{
case "keydown": // Grab and store the keycode now since it is correct and consistent at this point.
if (aDOMEvent.keyCode in MozKeyCodeToKeyCodeMap)
_keyCode = MozKeyCodeToKeyCodeMap[aDOMEvent.keyCode];
else
_keyCode = aDOMEvent.keyCode;
case "keydown":
// Grab and store the keycode now since it is correct and consistent at this point.
if (aDOMEvent.keyCode in MozKeyCodeToKeyCodeMap)
_keyCode = MozKeyCodeToKeyCodeMap[aDOMEvent.keyCode];
else
_keyCode = aDOMEvent.keyCode;
var characters;
var characters;
// Handle key codes for which String.fromCharCode won't work.
// Refs #1036: In Internet Explorer, both 'which' and 'charCode' are undefined for special keys.
if (aDOMEvent.which === 0 || aDOMEvent.charCode === 0 || (aDOMEvent.which === undefined && aDOMEvent.charCode === undefined))
characters = KeyCodesToUnicodeMap[_keyCode];
// Handle key codes for which String.fromCharCode won't work.
// Refs #1036: In Internet Explorer, both 'which' and 'charCode' are undefined for special keys.
if (aDOMEvent.which === 0 || aDOMEvent.charCode === 0 || (aDOMEvent.which === undefined && aDOMEvent.charCode === undefined))
characters = KeyCodesToUnicodeMap[_keyCode];
if (!characters)
characters = String.fromCharCode(_keyCode).toLowerCase();
if (!characters)
characters = String.fromCharCode(_keyCode).toLowerCase();
overrideCharacters = (modifierFlags & CPShiftKeyMask || _capsLockActive) ? characters.toUpperCase() : characters;
overrideCharacters = (modifierFlags & CPShiftKeyMask || _capsLockActive) ? characters.toUpperCase() : characters;
// check for caps lock state
if (_keyCode === CPKeyCodes.CAPS_LOCK)
_capsLockActive = YES;
// check for caps lock state
if (_keyCode === CPKeyCodes.CAPS_LOCK)
_capsLockActive = YES;
if ([ModifierKeyCodes containsObject:_keyCode])
{
// A modifier key will never fire keypress. We don't need to do any other processing so we just fire it here and break.
event = [CPEvent keyEventWithType:CPFlagsChanged location:location modifierFlags:modifierFlags
timestamp:timestamp windowNumber:windowNumber context:nil
characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:_keyCode];
if ([ModifierKeyCodes containsObject:_keyCode])
{
// A modifier key will never fire keypress. We don't need to do any other processing so we just fire it here and break.
event = [CPEvent keyEventWithType:CPFlagsChanged location:location modifierFlags:modifierFlags
timestamp:timestamp windowNumber:windowNumber context:nil
characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:_keyCode];
break;
}
else if (modifierFlags & (CPControlKeyMask | CPCommandKeyMask))
{
//we are simply going to skip all keypress events that use cmd/ctrl key
//this lets us be consistent in all browsers and send on the keydown
//which means we can cancel the event early enough, but only if sendEvent needs to
break;
}
else if (modifierFlags & (CPControlKeyMask | CPCommandKeyMask))
{
//we are simply going to skip all keypress events that use cmd/ctrl key
//this lets us be consistent in all browsers and send on the keydown
//which means we can cancel the event early enough, but only if sendEvent needs to
var eligibleForCopyPaste = [self _validateCopyCutOrPasteEvent:aDOMEvent flags:modifierFlags];
var eligibleForCopyPaste = [self _validateCopyCutOrPasteEvent:aDOMEvent flags:modifierFlags];
// If this could be a native PASTE event, then we need to further examine it before
// sending a CPEvent. Select our element to see if anything gets pasted in it.
if (characters === "v" && eligibleForCopyPaste)
{
if (!_ignoreNativePastePreparation)
{
_DOMPasteboardElement.select();
_DOMPasteboardElement.value = "";
}
// If this could be a native PASTE event, then we need to further examine it before
// sending a CPEvent. Select our element to see if anything gets pasted in it.
if (characters === "v" && eligibleForCopyPaste)
{
if (!_ignoreNativePastePreparation)
{
_DOMPasteboardElement.select();
_DOMPasteboardElement.value = "";
}
isNativePasteEvent = YES;
}
isNativePasteEvent = YES;
}
// However, of this could be a native COPY event, we need to let the normal event-process take place so it
// can capture our internal Cappuccino pasteboard.
else if ((characters == "c" || characters == "x") && eligibleForCopyPaste)
{
isNativeCopyOrCutEvent = YES;
// However, of this could be a native COPY event, we need to let the normal event-process take place so it
// can capture our internal Cappuccino pasteboard.
else if ((characters == "c" || characters == "x") && eligibleForCopyPaste)
{
isNativeCopyOrCutEvent = YES;
if (_ignoreNativeCopyOrCutEvent)
break;
}
}
else if (CPKeyCodes.firesKeyPressEvent(_keyCode, _lastKey, aDOMEvent.shiftKey, aDOMEvent.ctrlKey, aDOMEvent.altKey))
{
// this branch is taken by events which fire keydown, keypress, and keyup.
// this is the only time we'll ALLOW character keys to propagate (needed for text fields)
StopDOMEventPropagation = NO;
break;
}
else
{
//this branch is taken by "remedial" key events
// In this state we continue to keypress and send the CPEvent
}
if (_ignoreNativeCopyOrCutEvent)
break;
}
}
else if (CPKeyCodes.firesKeyPressEvent(_keyCode, _lastKey, aDOMEvent.shiftKey, aDOMEvent.ctrlKey, aDOMEvent.altKey))
{
// this branch is taken by events which fire keydown, keypress, and keyup.
// this is the only time we'll ALLOW character keys to propagate (needed for text fields)
StopDOMEventPropagation = NO;
break;
}
else
{
//this branch is taken by "remedial" key events
// In this state we continue to keypress and send the CPEvent
}
case "keypress":
// we unconditionally break on keypress events with modifiers,
// because we forced the event to be sent on the keydown
if (aDOMEvent.type === "keypress" && (modifierFlags & (CPControlKeyMask | CPCommandKeyMask)))
break;
// we unconditionally break on keypress events with modifiers,
// because we forced the event to be sent on the keydown
if (aDOMEvent.type === "keypress" && (modifierFlags & (CPControlKeyMask | CPCommandKeyMask)))
break;
var keyCode = _keyCode,
charCode = aDOMEvent.keyCode || aDOMEvent.charCode,
isARepeat = (_charCodes[keyCode] != nil);
var keyCode = _keyCode,
charCode = aDOMEvent.keyCode || aDOMEvent.charCode,
isARepeat = (_charCodes[keyCode] != nil);
_lastKey = keyCode;
_charCodes[keyCode] = charCode;
_lastKey = keyCode;
_charCodes[keyCode] = charCode;
var characters = overrideCharacters;
// Is this a special key?
if (!characters && (aDOMEvent.which === 0 || aDOMEvent.charCode === 0))
characters = KeyCodesToUnicodeMap[charCode];
var characters = overrideCharacters;
// Is this a special key?
if (!characters && (aDOMEvent.which === 0 || aDOMEvent.charCode === 0))
characters = KeyCodesToUnicodeMap[charCode];
if (!characters)
characters = String.fromCharCode(charCode);
if (!characters)
characters = String.fromCharCode(charCode);
var charactersIgnoringModifiers = characters.toLowerCase(); // FIXME: This isn't correct. It SHOULD include Shift.
charactersIgnoringModifiers = characters.toLowerCase(); // FIXME: This isn't correct. It SHOULD include Shift.
// Safari won't send proper capitalization during cmd-key events
if (!overrideCharacters && (modifierFlags & CPCommandKeyMask) && ((modifierFlags & CPShiftKeyMask) || _capsLockActive))
characters = characters.toUpperCase();
// Safari won't send proper capitalization during cmd-key events
if (!overrideCharacters && (modifierFlags & CPCommandKeyMask) && ((modifierFlags & CPShiftKeyMask) || _capsLockActive))
characters = characters.toUpperCase();
event = [CPEvent keyEventWithType:CPKeyDown location:location modifierFlags:modifierFlags
timestamp:timestamp windowNumber:windowNumber context:nil
characters:characters charactersIgnoringModifiers:charactersIgnoringModifiers isARepeat:isARepeat keyCode:charCode];
event = [CPEvent keyEventWithType:CPKeyDown location:location modifierFlags:modifierFlags
timestamp:timestamp windowNumber:windowNumber context:nil
characters:characters charactersIgnoringModifiers:charactersIgnoringModifiers isARepeat:isARepeat keyCode:charCode];
if (isNativePasteEvent)
{
_pasteboardKeyDownEvent = event;
window.setNativeTimeout(function () { [self _checkPasteboardElement] }, 0);
}
if (isNativePasteEvent)
{
_pasteboardKeyDownEvent = event;
window.setNativeTimeout(function () { [self _checkPasteboardElement] }, 0);
}
break;
break;
case "keyup": var keyCode = aDOMEvent.keyCode,
charCode = _charCodes[keyCode];
case "keyup":
var keyCode = aDOMEvent.keyCode,
charCode = _charCodes[keyCode];
_keyCode = -1;
_lastKey = -1;
_charCodes[keyCode] = nil;
_ignoreNativeCopyOrCutEvent = NO;
_ignoreNativePastePreparation = NO;
_keyCode = -1;
_lastKey = -1;
_charCodes[keyCode] = nil;
_ignoreNativeCopyOrCutEvent = NO;
_ignoreNativePastePreparation = NO;
// check for caps lock state
if (keyCode === CPKeyCodes.CAPS_LOCK)
_capsLockActive = NO;
// check for caps lock state
if (keyCode === CPKeyCodes.CAPS_LOCK)
_capsLockActive = NO;
if ([ModifierKeyCodes containsObject:keyCode])
{
// A modifier key will never fire keypress. We don't need to do any other processing so we just fire it here and break.
event = [CPEvent keyEventWithType:CPFlagsChanged location:location modifierFlags:modifierFlags
timestamp:timestamp windowNumber:windowNumber context:nil
characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:_keyCode];
if ([ModifierKeyCodes containsObject:keyCode])
{
// A modifier key will never fire keypress. We don't need to do any other processing so we just fire it here and break.
event = [CPEvent keyEventWithType:CPFlagsChanged location:location modifierFlags:modifierFlags
timestamp:timestamp windowNumber:windowNumber context:nil
characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:_keyCode];
break;
}
break;
}
var characters = KeyCodesToUnicodeMap[charCode] || String.fromCharCode(charCode),
charactersIgnoringModifiers = characters.toLowerCase();
var characters = KeyCodesToUnicodeMap[charCode] || String.fromCharCode(charCode);
charactersIgnoringModifiers = characters.toLowerCase();
if (!(modifierFlags & CPShiftKeyMask) && (modifierFlags & CPCommandKeyMask) && !_capsLockActive)
characters = charactersIgnoringModifiers;
if (!(modifierFlags & CPShiftKeyMask) && (modifierFlags & CPCommandKeyMask) && !_capsLockActive)
characters = charactersIgnoringModifiers;
event = [CPEvent keyEventWithType:CPKeyUp location:location modifierFlags:modifierFlags
timestamp: timestamp windowNumber:windowNumber context:nil
characters:characters charactersIgnoringModifiers:charactersIgnoringModifiers isARepeat:NO keyCode:keyCode];
break;
event = [CPEvent keyEventWithType:CPKeyUp location:location modifierFlags:modifierFlags
timestamp: timestamp windowNumber:windowNumber context:nil
characters:characters charactersIgnoringModifiers:charactersIgnoringModifiers isARepeat:NO keyCode:keyCode];
break;
}
if (event && !isNativePasteEvent)
@@ -898,10 +893,8 @@ var resizeTimer = nil;
characters = cut ? "x" : "c",
timestamp = [CPEvent currentTimestamp], // fake event, might as well use current timestamp
windowNumber = [[CPApp keyWindow] windowNumber],
location = _CGPointMake(aDOMEvent.clientX, aDOMEvent.clientY),
modifierFlags = CPPlatformActionKeyMask;
var event = [CPEvent keyEventWithType:CPKeyDown location:location modifierFlags:modifierFlags
modifierFlags = CPPlatformActionKeyMask,
event = [CPEvent keyEventWithType:CPKeyDown location:location modifierFlags:modifierFlags
timestamp:timestamp windowNumber:windowNumber context:nil
characters:characters charactersIgnoringModifiers:characters isARepeat:NO keyCode:keyCode];
@@ -1393,6 +1386,7 @@ var resizeTimer = nil;
}
var insertionIndex = 0;
if (middle !== undefined)
insertionIndex = _windowLevels[middle] > aLevel ? middle : middle + 1
@@ -1419,6 +1413,7 @@ var resizeTimer = nil;
return [layer removeWindow:aWindow];
var insertionIndex = CPNotFound;
if (otherWindow)
insertionIndex = aPlace === CPWindowAbove ? otherWindow._index + 1 : otherWindow._index;
+2
View File
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPException.j>
/*!
This abstract base class defines the methods that delegates of _CPPopUpList must implement.
+2
View File
@@ -24,6 +24,8 @@
@import "CPView.j"
@import "CPWindow.j"
@global CPApp
_CPToolTipWindowMask = 1 << 27;
var _CPToolTipHeight = 24.0,
+1
View File
@@ -26,6 +26,7 @@
@import "CPImage.j"
@import "CPView.j"
@global CPApp
CPToolbarItemVisibilityPriorityStandard = 0;
CPToolbarItemVisibilityPriorityLow = -1000;
+1 -1
View File
@@ -20,9 +20,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPApplication.j"
@import "_CPToolbarItem.j"
@global CPApp
@implementation _CPToolbarShowColorsItem : CPToolbarItem
{
+1 -1
View File
@@ -87,7 +87,7 @@ var NSBorderlessWindowMask = 0x00,
(_windowStyleMask & NSDocModalWindowMask ? CPDocModalWindowMask : 0) |
(_windowStyleMask & NSHUDBackgroundWindowMask ? CPHUDBackgroundWindowMask : 0);
_windowIsFullPlatformWindow = [aCoder decodeObjectForKey:"NSFrameAutosaveName"] === "CPBorderlessBridgeWindowMask";
_windowIsFullPlatformWindow = [aCoder decodeObjectForKey:@"NSFrameAutosaveName"] === @"CPBorderlessBridgeWindowMask";
/*if (![_windowClass isEqualToString:@"NSPanel"])
_windowRect.origin.y -= [NSMainMenuView menuHeight]; // compensation for the additional menu bar