More dictionary literals.

This commit is contained in:
Alexander Ljungberg committed 2013-02-25 18:27:44 +00:00
1 parent 8bcbeb0aa9
commit 5b05dc92a1
63 files changed
+2583 -417

No files matched your search

+34 -34
View File
@@ -717,40 +717,40 @@ var bottomHeight = 71;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjectsAndKeys:
CGSizeMake(400.0, 110.0), @"size",
CGInsetMake(15, 15, 15, 50), @"content-inset",
6, @"informative-offset",
10, @"button-offset",
CPJustifiedTextAlignment, @"message-text-alignment",
[CPColor blackColor], @"message-text-color",
[CPFont boldSystemFontOfSize:13.0], @"message-text-font",
[CPNull null], @"message-text-shadow-color",
CGSizeMakeZero(), @"message-text-shadow-offset",
CPJustifiedTextAlignment, @"informative-text-alignment",
[CPColor blackColor], @"informative-text-color",
[CPFont systemFontOfSize:12.0], @"informative-text-font",
[CPNull null], @"informative-text-shadow-color",
CGSizeMakeZero(), @"informative-text-shadow-offset",
CGPointMake(15, 12), @"image-offset",
[CPNull null], @"information-image",
[CPNull null], @"warning-image",
[CPNull null], @"error-image",
[CPNull null], @"help-image",
15, @"help-image-left-offset",
[CPNull null], @"help-image-pressed",
0.0, @"suppression-button-y-offset",
0.0, @"suppression-button-x-offset",
3.0, @"default-elements-margin",
[CPColor blackColor], @"suppression-button-text-color",
[CPFont systemFontOfSize:12.0], @"suppression-button-text-font",
[CPNull null], @"suppression-button-text-shadow-color",
0.0, @"suppression-button-text-shadow-offset",
0.0, @"modal-window-button-margin-y",
0.0, @"modal-window-button-margin-x",
0.0, @"standard-window-button-margin-y",
0.0, @"standard-window-button-margin-x"
];
return @{
@"size": CGSizeMake(400.0, 110.0),
@"content-inset": CGInsetMake(15, 15, 15, 50),
@"informative-offset": 6,
@"button-offset": 10,
@"message-text-alignment": CPJustifiedTextAlignment,
@"message-text-color": [CPColor blackColor],
@"message-text-font": [CPFont boldSystemFontOfSize:13.0],
@"message-text-shadow-color": [CPNull null],
@"message-text-shadow-offset": CGSizeMakeZero(),
@"informative-text-alignment": CPJustifiedTextAlignment,
@"informative-text-color": [CPColor blackColor],
@"informative-text-font": [CPFont systemFontOfSize:12.0],
@"informative-text-shadow-color": [CPNull null],
@"informative-text-shadow-offset": CGSizeMakeZero(),
@"image-offset": CGPointMake(15, 12),
@"information-image": [CPNull null],
@"warning-image": [CPNull null],
@"error-image": [CPNull null],
@"help-image": [CPNull null],
@"help-image-left-offset": 15,
@"help-image-pressed": [CPNull null],
@"suppression-button-y-offset": 0.0,
@"suppression-button-x-offset": 0.0,
@"default-elements-margin": 3.0,
@"suppression-button-text-color": [CPColor blackColor],
@"suppression-button-text-font": [CPFont systemFontOfSize:12.0],
@"suppression-button-text-shadow-color": [CPNull null],
@"suppression-button-text-shadow-offset": 0.0,
@"modal-window-button-margin-y": 0.0,
@"modal-window-button-margin-x": 0.0,
@"standard-window-button-margin-y": 0.0,
@"standard-window-button-margin-x": 0.0,
};
}
@end
+10 -9
View File
@@ -78,15 +78,16 @@ CPBelowBottom = 6;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], 1.0, 3.0, CGSizeMakeZero(), 6.0, [CPNull null], CGSizeMakeZero()]
forKeys:[ @"background-color",
@"border-color",
@"border-width",
@"corner-radius",
@"inner-shadow-offset",
@"inner-shadow-size",
@"inner-shadow-color",
@"content-margin"]];
return @{
@"background-color": [CPNull null],
@"border-color": [CPNull null],
@"border-width": 1.0,
@"corner-radius": 3.0,
@"inner-shadow-offset": CGSizeMakeZero(),
@"inner-shadow-size": 6.0,
@"inner-shadow-color": [CPNull null],
@"content-margin": CGSizeMakeZero(),
};
}
+ (id)boxEnclosingView:(CPView)aView
+11 -5
View File
@@ -76,9 +76,10 @@ CPButtonStateMixed = CPThemeState("mixed");
CPButtonStateBezelStyleRounded = CPThemeState("rounded");
// add all future correspondance between bezel styles and theme state here.
var CPButtonBezelStyleStateMap = [CPDictionary dictionaryWithObjectsAndKeys:
CPButtonStateBezelStyleRounded, CPRoundedBezelStyle,
[CPNull null], CPRoundRectBezelStyle];
var CPButtonBezelStyleStateMap = @{
CPRoundedBezelStyle: CPButtonStateBezelStyleRounded,
CPRoundRectBezelStyle: [CPNull null],
};
/// @cond IGNORE
CPButtonDefaultHeight = 25.0;
@@ -150,8 +151,13 @@ CPButtonImageOffset = 3.0;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], 0.0, _CGInsetMakeZero(), _CGInsetMakeZero(), [CPNull null]]
forKeys:[@"image", @"image-offset", @"bezel-inset", @"content-inset", @"bezel-color"]];
return @{
@"image": [CPNull null],
@"image-offset": 0.0,
@"bezel-inset": _CGInsetMakeZero(),
@"content-inset": _CGInsetMakeZero(),
@"bezel-color": [CPNull null],
};
}
/*!
+11 -18
View File
@@ -81,24 +81,17 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[ CGInsetMake(0.0, 0.0, 0.0, 0.0),
CGSizeMakeZero(),
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null]]
forKeys:[ @"resize-control-inset",
@"resize-control-size",
@"resize-control-color",
@"bezel-color",
@"button-bezel-color",
@"button-text-color",
@"button-image-plus",
@"button-image-minus",
@"button-image-action"]];
return @{
@"resize-control-inset": CGInsetMake(0.0, 0.0, 0.0, 0.0),
@"resize-control-size": CGSizeMakeZero(),
@"resize-control-color": [CPNull null],
@"bezel-color": [CPNull null],
@"button-bezel-color": [CPNull null],
@"button-text-color": [CPNull null],
@"button-image-plus": [CPNull null],
@"button-image-minus": [CPNull null],
@"button-image-action": [CPNull null],
};
}
- (id)initWithFrame:(CGRect)aFrame
+7 -2
View File
@@ -60,8 +60,13 @@ var _CPColorWellDidBecomeExclusiveNotification = @"_CPColorWellDidBecomeExclusiv
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[_CGInsetMakeZero(), [CPNull null], _CGInsetMake(3.0, 3.0, 3.0, 3.0), _CGInsetMakeZero(), [CPNull null]]
forKeys:[@"bezel-inset", @"bezel-color", @"content-inset", @"content-border-inset", @"content-border-color"]];
return @{
@"bezel-inset": _CGInsetMakeZero(),
@"bezel-color": [CPNull null],
@"content-inset": _CGInsetMake(3.0, 3.0, 3.0, 3.0),
@"content-border-inset": _CGInsetMakeZero(),
@"content-border-color": [CPNull null],
};
}
- (void)_reverseSetBinding
+4 -1
View File
@@ -60,7 +60,10 @@ var CPComboBoxTextSubview = @"text",
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjectsAndKeys:_CGSizeMake(21.0, 29.0), @"popup-button-size", _CGInsetMake(3.0, 3.0, 3.0, 3.0), @"border-inset"];
return @{
@"popup-button-size": _CGSizeMake(21.0, 29.0),
@"border-inset": _CGInsetMake(3.0, 3.0, 3.0, 3.0),
};
}
+ (Class)_binderClassForBinding:(CPString)aBinding
+16 -25
View File
@@ -112,28 +112,19 @@ var CPControlBlackColor = [CPColor blackColor];
+ (CPDictionary)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[CPLeftTextAlignment,
CPTopVerticalTextAlignment,
CPLineBreakByClipping,
[CPColor blackColor],
[CPFont systemFontOfSize:CPFontCurrentSystemSize],
[CPNull null],
_CGSizeMakeZero(),
CPImageLeft,
CPScaleToFit,
_CGSizeMakeZero(),
_CGSizeMake(-1.0, -1.0)]
forKeys:[@"alignment",
@"vertical-alignment",
@"line-break-mode",
@"text-color",
@"font",
@"text-shadow-color",
@"text-shadow-offset",
@"image-position",
@"image-scaling",
@"min-size",
@"max-size"]];
return @{
@"alignment": CPLeftTextAlignment,
@"vertical-alignment": CPTopVerticalTextAlignment,
@"line-break-mode": CPLineBreakByClipping,
@"text-color": [CPColor blackColor],
@"font": [CPFont systemFontOfSize:CPFontCurrentSystemSize],
@"text-shadow-color": [CPNull null],
@"text-shadow-offset": _CGSizeMakeZero(),
@"image-position": CPImageLeft,
@"image-scaling": CPScaleToFit,
@"min-size": _CGSizeMakeZero(),
@"max-size": _CGSizeMake(-1.0, -1.0),
};
}
+ (void)initialize
@@ -618,7 +609,7 @@ var CPControlBlackColor = [CPColor blackColor];
if ([note object] != self)
return;
[[CPNotificationCenter defaultCenter] postNotificationName:CPControlTextDidBeginEditingNotification object:self userInfo:[CPDictionary dictionaryWithObject:[note object] forKey:"CPFieldEditor"]];
[[CPNotificationCenter defaultCenter] postNotificationName:CPControlTextDidBeginEditingNotification object:self userInfo:@{ "CPFieldEditor": [note object] }];
}
- (void)textDidChange:(CPNotification)note
@@ -627,7 +618,7 @@ var CPControlBlackColor = [CPColor blackColor];
if ([note object] != self)
return;
[[CPNotificationCenter defaultCenter] postNotificationName:CPControlTextDidChangeNotification object:self userInfo:[CPDictionary dictionaryWithObject:[note object] forKey:"CPFieldEditor"]];
[[CPNotificationCenter defaultCenter] postNotificationName:CPControlTextDidChangeNotification object:self userInfo:@{ "CPFieldEditor": [note object] }];
}
- (void)textDidEndEditing:(CPNotification)note
@@ -638,7 +629,7 @@ var CPControlBlackColor = [CPColor blackColor];
[self _reverseSetBinding];
[[CPNotificationCenter defaultCenter] postNotificationName:CPControlTextDidEndEditingNotification object:self userInfo:[CPDictionary dictionaryWithObject:[note object] forKey:"CPFieldEditor"]];
[[CPNotificationCenter defaultCenter] postNotificationName:CPControlTextDidEndEditingNotification object:self userInfo:@{ "CPFieldEditor": [note object] }];
}
/*!
+4 -1
View File
@@ -130,7 +130,10 @@ var CPBindingOperationAnd = 0,
if (self)
{
_source = aSource;
_info = [CPDictionary dictionaryWithObjects:[aDestination, aKeyPath] forKeys:[CPObservedObjectKey, CPObservedKeyPathKey]];
_info = @{
CPObservedObjectKey: aDestination,
CPObservedKeyPathKey: aKeyPath,
};
_suppressedNotifications = {};
_placeholderForMarker = {};
+8 -6
View File
@@ -64,12 +64,14 @@ CPRatingLevelIndicatorStyle = 3;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjectsAndKeys:[CPNull null], @"bezel-color",
[CPNull null], @"color-empty",
[CPNull null], @"color-normal",
[CPNull null], @"color-warning",
[CPNull null], @"color-critical",
1.0, @"spacing"];
return @{
@"bezel-color": [CPNull null],
@"color-empty": [CPNull null],
@"color-normal": [CPNull null],
@"color-warning": [CPNull null],
@"color-critical": [CPNull null],
@"spacing": 1.0,
};
}
- (id)initWithFrame:(CGRect)aFrame
+3 -3
View File
@@ -373,7 +373,7 @@ var _CPMenuBarVisible = NO,
[[CPNotificationCenter defaultCenter]
postNotificationName:CPMenuDidChangeItemNotification
object:self
userInfo:[CPDictionary dictionaryWithObject:[_items indexOfObjectIdenticalTo:aMenuItem] forKey:@"CPMenuItemIndex"]];
userInfo:@{ @"CPMenuItemIndex": [_items indexOfObjectIdenticalTo:aMenuItem] }];
}
// Finding Menu Items
@@ -1136,7 +1136,7 @@ var _CPMenuBarVisible = NO,
[[CPNotificationCenter defaultCenter]
postNotificationName:CPMenuDidAddItemNotification
object:self
userInfo:[CPDictionary dictionaryWithObject:anIndex forKey:@"CPMenuItemIndex"]];
userInfo:@{ @"CPMenuItemIndex": anIndex }];
}
- (void)removeObjectFromItemsAtIndex:(CPUInteger)anIndex
@@ -1150,7 +1150,7 @@ var _CPMenuBarVisible = NO,
[[CPNotificationCenter defaultCenter]
postNotificationName:CPMenuDidRemoveItemNotification
object:self
userInfo:[CPDictionary dictionaryWithObject:anIndex forKey:@"CPMenuItemIndex"]];
userInfo:@{ @"CPMenuItemIndex": anIndex }];
}
@end
+28 -33
View File
@@ -434,39 +434,34 @@ _CPMenuWindowAttachedMenuBackgroundStyle = 2;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[ [CPNull null], [CPNull null], [CPNull null], [CPNull null], CGInsetMake(5.0, 1.0, 1.0, 5.0), 16.0,
[CPNull null], [CPNull null], [CPNull null], 30.0, 10.0, 10.0, 10.0,
[CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], 28.0, [CPNull null], 1.0,
[CPNull null], [CPNull null], [CPNull null]]
forKeys:[ @"menu-window-more-above-image",
@"menu-window-more-below-image",
@"menu-window-pop-up-background-style-color",
@"menu-window-menu-bar-background-style-color",
@"menu-window-margin-inset",
@"menu-window-scroll-indicator-height",
@"menu-bar-window-background-color",
@"menu-bar-window-background-selected-color",
@"menu-bar-window-font",
@"menu-bar-window-height",
@"menu-bar-window-margin",
@"menu-bar-window-left-margin",
@"menu-bar-window-right-margin",
@"menu-bar-text-color",
@"menu-bar-title-color",
@"menu-bar-text-shadow-color",
@"menu-bar-title-shadow-color",
@"menu-bar-highlight-color",
@"menu-bar-highlight-text-color",
@"menu-bar-highlight-text-shadow-color",
@"menu-bar-height",
@"menu-bar-icon-image",
@"menu-bar-icon-image-alpha-value",
@"menu-general-icon-new",
@"menu-general-icon-save",
@"menu-general-icon-open"]];
return @{
@"menu-window-more-above-image": [CPNull null],
@"menu-window-more-below-image": [CPNull null],
@"menu-window-pop-up-background-style-color": [CPNull null],
@"menu-window-menu-bar-background-style-color": [CPNull null],
@"menu-window-margin-inset": CGInsetMake(5.0, 1.0, 1.0, 5.0),
@"menu-window-scroll-indicator-height": 16.0,
@"menu-bar-window-background-color": [CPNull null],
@"menu-bar-window-background-selected-color": [CPNull null],
@"menu-bar-window-font": [CPNull null],
@"menu-bar-window-height": 30.0,
@"menu-bar-window-margin": 10.0,
@"menu-bar-window-left-margin": 10.0,
@"menu-bar-window-right-margin": 10.0,
@"menu-bar-text-color": [CPNull null],
@"menu-bar-title-color": [CPNull null],
@"menu-bar-text-shadow-color": [CPNull null],
@"menu-bar-title-shadow-color": [CPNull null],
@"menu-bar-highlight-color": [CPNull null],
@"menu-bar-highlight-text-color": [CPNull null],
@"menu-bar-highlight-text-shadow-color": [CPNull null],
@"menu-bar-height": 28.0,
@"menu-bar-icon-image": [CPNull null],
@"menu-bar-icon-image-alpha-value": 1.0,
@"menu-general-icon-new": [CPNull null],
@"menu-general-icon-save": [CPNull null],
@"menu-general-icon-open": [CPNull null],
};
}
- (unsigned)numberOfUnhiddenItems
+19 -19
View File
@@ -33,25 +33,25 @@
@global CPApp
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
];
var CPMenuItemStringRepresentationDictionary = @{
CPEscapeFunctionKey: "\u238B",
CPTabCharacter: "\u21E5",
CPBackTabCharacter: "\u21E4",
CPSpaceFunctionKey: "\u2423",
CPCarriageReturnCharacter: "\u23CE",
CPBackspaceCharacter: "\u232B",
CPDeleteFunctionKey: "\u232B",
CPDeleteCharacter: "\u2326",
CPHomeFunctionKey: "\u21F1",
CPEndFunctionKey: "\u21F2",
CPPageUpFunctionKey: "\u21DE",
CPPageDownFunctionKey: "\u21DF",
CPUpArrowFunctionKey: "\u2191",
CPDownArrowFunctionKey: "\u2193",
CPLeftArrowFunctionKey: "\u2190",
CPRightArrowFunctionKey: "\u2192",
CPClearDisplayFunctionKey: "\u2327",
};
/*!
@ingroup appkit
+7 -6
View File
@@ -46,12 +46,13 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], 12.0, 3.0, 4.0]
forKeys:[ @"menu-item-selection-color",
@"menu-item-text-shadow-color",
@"horizontal-margin",
@"submenu-indicator-margin",
@"vertical-margin"]];
return @{
@"menu-item-selection-color": [CPNull null],
@"menu-item-text-shadow-color": [CPNull null],
@"horizontal-margin": 12.0,
@"submenu-indicator-margin": 3.0,
@"vertical-margin": 4.0,
};
}
+ (id)view
+19 -18
View File
@@ -47,24 +47,25 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], 3.0, 17.0, 14.0, 17.0, 4.0, 30.0]
forKeys:[ @"submenu-indicator-color",
@"menu-item-selection-color",
@"menu-item-text-shadow-color",
@"menu-item-text-color",
@"menu-item-default-off-state-image",
@"menu-item-default-off-state-highlighted-image",
@"menu-item-default-on-state-image",
@"menu-item-default-on-state-highlighted-image",
@"menu-item-default-mixed-state-image",
@"menu-item-default-mixed-state-highlighted-image",
@"menu-item-separator-color",
@"left-margin",
@"right-margin",
@"state-column-width",
@"indentation-width",
@"vertical-margin",
@"right-columns-margin"]];
return @{
@"submenu-indicator-color": [CPNull null],
@"menu-item-selection-color": [CPNull null],
@"menu-item-text-shadow-color": [CPNull null],
@"menu-item-text-color": [CPNull null],
@"menu-item-default-off-state-image": [CPNull null],
@"menu-item-default-off-state-highlighted-image": [CPNull null],
@"menu-item-default-on-state-image": [CPNull null],
@"menu-item-default-on-state-highlighted-image": [CPNull null],
@"menu-item-default-mixed-state-image": [CPNull null],
@"menu-item-default-mixed-state-highlighted-image": [CPNull null],
@"menu-item-separator-color": [CPNull null],
@"left-margin": 3.0,
@"right-margin": 17.0,
@"state-column-width": 14.0,
@"indentation-width": 17.0,
@"vertical-margin": 4.0,
@"right-columns-margin": 30.0,
};
}
+ (id)view
+1 -2
View File
@@ -55,8 +55,7 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[]
forKeys:[]];
return @{};
}
// Not used in the Appkit
+3 -3
View File
@@ -1452,7 +1452,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
[[CPNotificationCenter defaultCenter]
postNotificationName:CPOutlineViewItemDidExpandNotification
object:self
userInfo:[CPDictionary dictionaryWithObject:item forKey:"CPObject"]];
userInfo:@{ "CPObject": item }];
}
/*!
@@ -1463,7 +1463,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
[[CPNotificationCenter defaultCenter]
postNotificationName:CPOutlineViewItemWillCollapseNotification
object:self
userInfo:[CPDictionary dictionaryWithObject:item forKey:"CPObject"]];
userInfo:@{ "CPObject": item }];
}
/*!
@@ -1474,7 +1474,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
[[CPNotificationCenter defaultCenter]
postNotificationName:CPOutlineViewItemDidCollapseNotification
object:self
userInfo:[CPDictionary dictionaryWithObject:item forKey:"CPObject"]];
userInfo:@{ "CPObject": item }];
}
- (void)keyDown:(CPEvent)anEvent
+9 -8
View File
@@ -77,14 +77,15 @@ var CPProgressIndicatorSpinningStyleColors = [];
+ (CPDictionary)themeAttributes
{
return [CPDictionary dictionaryWithObjectsAndKeys:
[CPNull null], @"indeterminate-bar-color",
[CPNull null], @"bar-color",
20, @"default-height",
[CPNull null], @"bezel-color",
[CPNull null], @"spinning-mini-gif",
[CPNull null], @"spinning-small-gif",
[CPNull null], @"spinning-regular-gif"];
return @{
@"indeterminate-bar-color": [CPNull null],
@"bar-color": [CPNull null],
@"default-height": 20,
@"bezel-color": [CPNull null],
@"spinning-mini-gif": [CPNull null],
@"spinning-small-gif": [CPNull null],
@"spinning-regular-gif": [CPNull null],
};
}
+ (Class)_binderClassForBinding:(CPString)aBinding
+5 -1
View File
@@ -360,7 +360,11 @@
rootItems = [treeChild children];
}
var row = [CPDictionary dictionaryWithObjectsAndKeys:criteria, @"criteria", values, @"displayValues", rowType, @"rowType"];
var row = @{
@"criteria": criteria,
@"displayValues": values,
@"rowType": rowType,
};
return row;
}
+15 -4
View File
@@ -124,8 +124,16 @@ var CPRuleEditorItemPBoardType = @"CPRuleEditorItemPBoardType",
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null]]
forKeys:[@"alternating-row-colors", @"selected-color", @"slice-top-border-color", @"slice-bottom-border-color", @"slice-last-bottom-border-color", @"font", @"add-image", @"remove-image"]];
return @{
@"alternating-row-colors": [CPNull null],
@"selected-color": [CPNull null],
@"slice-top-border-color": [CPNull null],
@"slice-bottom-border-color": [CPNull null],
@"slice-last-bottom-border-color": [CPNull null],
@"font": [CPNull null],
@"add-image": [CPNull null],
@"remove-image": [CPNull null],
};
}
- (id)initWithFrame:(CGRect)frame
@@ -1387,7 +1395,10 @@ TODO: implement
{
var item = [items objectAtIndex:i],
value = [values objectAtIndex:i],
itemAndValue = [CPDictionary dictionaryWithObjects:[item, value] forKeys:["item", "value"]];
itemAndValue = @{
"item": item,
"value": value,
};
[itemsAndValues addObject:itemAndValue];
}
@@ -2268,7 +2279,7 @@ TODO: implement
- (void)_postRowCountChangedNotificationOfType:(CPString)notificationName indexes:indexes
{
var userInfo = [CPDictionary dictionaryWithObject:indexes forKey:"indexes"];
var userInfo = @{ "indexes": indexes };
[[CPNotificationCenter defaultCenter] postNotificationName:notificationName object:self userInfo:userInfo];
}
@@ -271,7 +271,11 @@ var CONTROL_HEIGHT = 16.,
}
}
repObject = [CPDictionary dictionaryWithObjectsAndKeys:childItem, @"item", childValue, @"value", i, @"indexInCriteria"];
repObject = @{
@"item": childItem,
@"value": childValue,
@"indexInCriteria": i
};
[menuItem setRepresentedObject:repObject];
[menuItems addObject:menuItem];
}
+4 -4
View File
@@ -143,10 +143,10 @@ var CPScrollerStyleGlobal = CPScrollerStyleOverlay,
+ (CPDictionary)themeAttributes
{
return [CPDictionary dictionaryWithJSObject:{
@"bottom-corner-color": [CPColor whiteColor],
@"border-color": [CPColor blackColor]
}];
return @{
@"bottom-corner-color": [CPColor whiteColor],
@"border-color": [CPColor blackColor]
};
}
+ (CGSize)contentSizeForFrameSize:(CGSize)frameSize hasHorizontalScroller:(BOOL)hFlag hasVerticalScroller:(BOOL)vFlag borderType:(CPBorderType)borderType
+21 -17
View File
@@ -110,19 +110,19 @@ CPThemeStateScrollerKnobDark = CPThemeState("scroller-knob-dark");
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithJSObject:{
@"scroller-width": 7.0,
@"knob-slot-color": [CPNull null],
@"decrement-line-color": [CPNull null],
@"increment-line-color": [CPNull null],
@"knob-color": [CPNull null],
@"decrement-line-size":_CGSizeMakeZero(),
@"increment-line-size":_CGSizeMakeZero(),
@"track-inset":_CGInsetMakeZero(),
@"knob-inset": _CGInsetMakeZero(),
@"minimum-knob-length":21.0,
@"track-border-overlay": 9.0
}];
return @{
@"scroller-width": 7.0,
@"knob-slot-color": [CPNull null],
@"decrement-line-color": [CPNull null],
@"increment-line-color": [CPNull null],
@"knob-color": [CPNull null],
@"decrement-line-size":_CGSizeMakeZero(),
@"increment-line-size":_CGSizeMakeZero(),
@"track-inset":_CGInsetMakeZero(),
@"knob-inset": _CGInsetMakeZero(),
@"minimum-knob-length":21.0,
@"track-border-overlay": 9.0
};
}
+ (float)scrollerWidth
@@ -182,8 +182,10 @@ CPThemeStateScrollerKnobDark = CPThemeState("scroller-knob-dark");
_allowFadingOut = YES;
_isMouseOver = NO;
_style = CPScrollerStyleOverlay;
var paramAnimFadeOut = [CPDictionary dictionaryWithObjects:[self, CPViewAnimationFadeOutEffect]
forKeys:[CPViewAnimationTargetKey, CPViewAnimationEffectKey]];
var paramAnimFadeOut = @{
CPViewAnimationTargetKey: self,
CPViewAnimationEffectKey: CPViewAnimationFadeOutEffect,
};
_animationScroller = [[CPViewAnimation alloc] initWithDuration:0.2 animationCurve:CPAnimationEaseInOut];
[_animationScroller setViewAnimations:[paramAnimFadeOut]];
@@ -826,8 +828,10 @@ var CPScrollerControlSizeKey = @"CPScrollerControlSize",
_allowFadingOut = YES;
_isMouseOver = NO;
var paramAnimFadeOut = [CPDictionary dictionaryWithObjects:[self, CPViewAnimationFadeOutEffect]
forKeys:[CPViewAnimationTargetKey, CPViewAnimationEffectKey]];
var paramAnimFadeOut = @{
CPViewAnimationTargetKey: self,
CPViewAnimationEffectKey: CPViewAnimationFadeOutEffect,
};
_animationScroller = [[CPViewAnimation alloc] initWithDuration:0.2 animationCurve:CPAnimationEaseInOut];
[_animationScroller setViewAnimations:[paramAnimFadeOut]];
+2 -3
View File
@@ -69,13 +69,12 @@ var RECENT_SEARCH_PREFIX = @" ";
+ (CPDictionary)themeAttributes
{
return [CPDictionary dictionaryWithJSObject:
{
return @{
@"image-search": [CPNull null],
@"image-find": [CPNull null],
@"image-cancel": [CPNull null],
@"image-cancel-pressed": [CPNull null]
}];
};
}
- (id)initWithFrame:(CGRect)frame
+14 -2
View File
@@ -58,8 +58,20 @@ CPSegmentSwitchTrackingMomentary = 2;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[CPCenterTextAlignment, CPCenterVerticalTextAlignment, CPImageLeft, CPImageScaleNone, _CGInsetMakeZero(), _CGInsetMakeZero(), [CPNull null], [CPNull null], [CPNull null], [CPNull null], 1.0, 24.0]
forKeys:[@"alignment", @"vertical-alignment", @"image-position", @"image-scaling", @"bezel-inset", @"content-inset", @"left-segment-bezel-color", @"right-segment-bezel-color", @"center-segment-bezel-color", @"divider-bezel-color", @"divider-thickness", @"default-height"]];
return @{
@"alignment": CPCenterTextAlignment,
@"vertical-alignment": CPCenterVerticalTextAlignment,
@"image-position": CPImageLeft,
@"image-scaling": CPImageScaleNone,
@"bezel-inset": _CGInsetMakeZero(),
@"content-inset": _CGInsetMakeZero(),
@"left-segment-bezel-color": [CPNull null],
@"right-segment-bezel-color": [CPNull null],
@"center-segment-bezel-color": [CPNull null],
@"divider-bezel-color": [CPNull null],
@"divider-thickness": 1.0,
@"default-height": 24.0,
};
}
- (id)initWithFrame:(CGRect)aRect
+2 -3
View File
@@ -49,11 +49,10 @@ CPThemeStateShadowViewHeavy = CPThemeState("shadowview-style-heavy");
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithJSObject:
{
return @{
@"bezel-color": [CPNull null],
@"content-inset": CGInsetMakeZero()
}];
};
}
+ (CGRect)frameForContentFrame:(CGRect)aFrame withWeight:(CPShadowWeight)aWeight
+6 -2
View File
@@ -51,8 +51,12 @@ CPCircularSlider = 1;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], _CGSizeMakeZero(), 0.0, [CPNull null]]
forKeys:[@"knob-color", @"knob-size", @"track-width", @"track-color"]];
return @{
@"knob-color": [CPNull null],
@"knob-size": _CGSizeMakeZero(),
@"track-width": 0.0,
@"track-color": [CPNull null],
};
}
- (id)initWithFrame:(CGRect)aFrame
+9 -12
View File
@@ -105,16 +105,13 @@ var ShouldSuppressResizeNotifications = 1,
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[1.0,
10.0,
[CPColor grayColor],
[CPNull null],
[CPNull null]]
forKeys:[@"divider-thickness",
@"pane-divider-thickness",
@"pane-divider-color",
@"horizontal-divider-color",
@"vertical-divider-color"]];
return @{
@"divider-thickness": 1.0,
@"pane-divider-thickness": 10.0,
@"pane-divider-color": [CPColor grayColor],
@"horizontal-divider-color": [CPNull null],
@"vertical-divider-color": [CPNull null],
};
}
- (id)initWithFrame:(CGRect)aFrame
@@ -1032,7 +1029,7 @@ The sum of the views and the sum of the dividers should be equal to the size of
var userInfo = nil;
if (_currentDivider !== CPNotFound)
userInfo = [CPDictionary dictionaryWithObject:_currentDivider forKey:@"CPSplitViewDividerIndex"];
userInfo = @{ @"CPSplitViewDividerIndex": _currentDivider };
[[CPNotificationCenter defaultCenter] postNotificationName:CPSplitViewWillResizeSubviewsNotification
object:self
@@ -1044,7 +1041,7 @@ The sum of the views and the sum of the dividers should be equal to the size of
var userInfo = nil;
if (_currentDivider !== CPNotFound)
userInfo = [CPDictionary dictionaryWithObject:_currentDivider forKey:@"CPSplitViewDividerIndex"];
userInfo = @{ @"CPSplitViewDividerIndex": _currentDivider };
[[CPNotificationCenter defaultCenter] postNotificationName:CPSplitViewDidResizeSubviewsNotification
object:self
+6 -2
View File
@@ -269,8 +269,12 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], _CGSizeMakeZero(), _CGSizeMakeZero()]
forKeys:[@"bezel-color-up-button", @"bezel-color-down-button", @"up-button-size", @"down-button-size"]];
return @{
@"bezel-color-up-button": [CPNull null],
@"bezel-color-down-button": [CPNull null],
@"up-button-size": _CGSizeMakeZero(),
@"down-button-size": _CGSizeMakeZero(),
};
}
@end
+1 -1
View File
@@ -560,7 +560,7 @@ CPTableColumnUserResizingMask = 1 << 1;
[[CPNotificationCenter defaultCenter]
postNotificationName:CPTableViewColumnDidResizeNotification
object:[self tableView]
userInfo:[CPDictionary dictionaryWithObjects:[self, oldWidth] forKeys:[@"CPTableColumn", "CPOldWidth"]]];
userInfo:@{ @"CPTableColumn": self, @"CPOldWidth": oldWidth }];
}
@end
+14 -4
View File
@@ -45,8 +45,16 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], CPLeftTextAlignment, CPLineBreakByTruncatingTail, CGInsetMakeZero(), [CPNull null], [CPNull null], [CPNull null], CGSizeMakeZero()]
forKeys:[@"background-color", @"text-alignment", @"line-break-mode", @"text-inset", @"text-color", @"font", @"text-shadow-color", @"text-shadow-offset"]];
return @{
@"background-color": [CPNull null],
@"text-alignment": CPLeftTextAlignment,
@"line-break-mode": CPLineBreakByTruncatingTail,
@"text-inset": CGInsetMakeZero(),
@"text-color": [CPNull null],
@"font": [CPNull null],
@"text-shadow-color": [CPNull null],
@"text-shadow-offset": CGSizeMakeZero(),
};
}
- (void)initWithFrame:(CGRect)frame
@@ -239,8 +247,10 @@ var _CPTableColumnHeaderViewStringValueKey = @"_CPTableColumnHeaderViewStringVal
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPColor grayColor]]
forKeys:[@"background-color", @"divider-color"]];
return @{
@"background-color": [CPNull null],
@"divider-color": [CPColor grayColor],
};
}
- (void)_init
+18 -26
View File
@@ -274,26 +274,18 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
*/
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null],
25.0]
forKeys:[@"alternating-row-colors",
@"grid-color",
@"highlighted-grid-color",
@"selection-color",
@"sourcelist-selection-color",
@"sort-image",
@"sort-image-reversed",
@"selection-radius",
@"image-generic-file",
@"default-row-height"]];
return @{
@"alternating-row-colors": [CPNull null],
@"grid-color": [CPNull null],
@"highlighted-grid-color": [CPNull null],
@"selection-color": [CPNull null],
@"sourcelist-selection-color": [CPNull null],
@"sort-image": [CPNull null],
@"sort-image-reversed": [CPNull null],
@"selection-radius": [CPNull null],
@"image-generic-file": [CPNull null],
@"default-row-height": 25.0,
};
}
- (id)initWithFrame:(CGRect)aFrame
@@ -1029,8 +1021,7 @@ NOT YET IMPLEMENTED
// TODO Only notify when a column drag operation ends, not each time a column reaches a new slot?
[[CPNotificationCenter defaultCenter] postNotificationName:CPTableViewColumnDidMoveNotification
object:self
userInfo:[CPDictionary dictionaryWithObjects:[fromIndex, toIndex]
forKeys:[@"CPOldColumn", @"CPNewColumn"]]];
userInfo:@{ @"CPOldColumn": fromIndex, @"CPNewColumn": toIndex }];
}
/*!
@@ -2355,10 +2346,11 @@ NOT YET IMPLEMENTED
for (var i = 0; i < [columns count]; i++)
{
var column = [columns objectAtIndex:i],
metaData = [CPDictionary dictionaryWithJSObject:{
@"identifier": [column identifier],
@"width": [column width]
}];
metaData = @{
@"identifier": [column identifier],
@"width": [column width]
};
[columnsSetup addObject:metaData];
}
+5 -2
View File
@@ -206,8 +206,11 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[_CGInsetMakeZero(), _CGInsetMake(1.0, 0.0, 0.0, 0.0), [CPNull null]]
forKeys:[@"bezel-inset", @"content-inset", @"bezel-color"]];
return @{
@"bezel-inset": _CGInsetMakeZero(),
@"content-inset": _CGInsetMake(1.0, 0.0, 0.0, 0.0),
@"bezel-color": [CPNull null],
};
}
/* @ignore */
+1 -1
View File
@@ -476,7 +476,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow");
if (aValue === undefined || aValue === nil)
_values = @{};
else
_values = [CPDictionary dictionaryWithObject:aValue forKey:String(CPThemeStateNormal)];
_values = @{ String(CPThemeStateNormal): aValue };
}
- (void)setValue:(id)aValue forState:(CPThemeState)aState
+1 -1
View File
@@ -101,7 +101,7 @@ CPTokenFieldDeleteButtonType = 1;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObject:_CGInsetMakeZero() forKey:@"editor-inset"];
return @{ @"editor-inset": _CGInsetMakeZero() };
}
- (id)initWithFrame:(CGRect)frame
+11 -19
View File
@@ -605,25 +605,17 @@ var _CPToolbarItemInfoMake = function(anIndex, aView, aLabel, aMinWidth)
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[10.0,
20.0,
[CPNull null],
[CPNull null],
_CGInsetMake(4.0, 4.0, 4.0, 10),
59.0,
46.0,
[CPNull null],
CGRectMake(0.0, 0.0, 2.0, 32.0)]
forKeys:[
@"item-margin",
@"extra-item-width",
@"extra-item-extra-image",
@"extra-item-extra-alternate-image",
@"content-inset",
@"regular-size-height",
@"small-size-height",
@"image-item-separator-color",
@"image-item-separator-size"]];
return @{
@"item-margin": 10.0,
@"extra-item-width": 20.0,
@"extra-item-extra-image": [CPNull null],
@"extra-item-extra-alternate-image": [CPNull null],
@"content-inset": _CGInsetMake(4.0, 4.0, 4.0, 10),
@"regular-size-height": 59.0,
@"small-size-height": 46.0,
@"image-item-separator-color": [CPNull null],
@"image-item-separator-size": CGRectMake(0.0, 0.0, 2.0, 32.0),
};
}
- (id)initWithFrame:(CGRect)aFrame
+6 -2
View File
@@ -59,8 +59,12 @@ CPViewAnimationFadeOutEffect = @"CPViewAnimationFadeOutEffect";
For example:
<pre>
var animation = [CPDictionary dictionaryWithObjects:[myViewToAnimate, aStartFrame, anEndFrame, CPViewAnimationFadeInEffect]
forKeys:[CPViewAnimationTargetKey, CPViewAnimationStartFrameKey, CPViewAnimationEndFrameKey, CPViewAnimationEffectKey]];
var animation = @{
CPViewAnimationTargetKey: myViewToAnimate,
CPViewAnimationStartFrameKey: aStartFrame,
CPViewAnimationEndFrameKey: anEndFrame,
CPViewAnimationEffectKey: CPViewAnimationFadeInEffect,
};
</pre>
If you pass nil instead of an array of dictionaries you should later call setViewAnimations:.
+3 -3
View File
@@ -103,7 +103,7 @@ var CPViewControllerCachedCibs;
- (id)initWithCibName:(CPString)aCibNameOrNil bundle:(CPBundle)aCibBundleOrNil owner:(id)anOwner
{
return [self initWithCibName:aCibNameOrNil bundle:aCibBundleOrNil externalNameTable:[CPDictionary dictionaryWithObject:anOwner forKey:CPCibOwner]];
return [self initWithCibName:aCibNameOrNil bundle:aCibBundleOrNil externalNameTable:@{ CPCibOwner: anOwner }];
}
/*!
@@ -128,7 +128,7 @@ var CPViewControllerCachedCibs;
// Don't load the cib until someone actually requests the view. The user may just be intending to use setView:.
_cibName = aCibNameOrNil;
_cibBundle = aCibBundleOrNil || [CPBundle mainBundle];
_cibExternalNameTable = anExternalNameTable || [CPDictionary dictionaryWithObject:self forKey:CPCibOwner];
_cibExternalNameTable = anExternalNameTable || @{ CPCibOwner: self };
_isLoading = NO;
_isLazy = NO;
@@ -298,7 +298,7 @@ var CPViewControllerViewKey = @"CPViewControllerViewKey",
var bundlePath = [aCoder decodeObjectForKey:CPViewControllerBundleKey];
_cibBundle = bundlePath ? [CPBundle bundleWithPath:bundlePath] : [CPBundle mainBundle];
_cibExternalNameTable = [CPDictionary dictionaryWithObject:self forKey:CPCibOwner];
_cibExternalNameTable = @{ CPCibOwner: self };
_isLazy = YES;
}
@@ -34,8 +34,9 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPColor grayColor]]
forKeys:[@"toolbar-background-color"]];
return @{
@"toolbar-background-color": [CPColor grayColor],
};
}
- (void)setShowsResizeIndicator:(BOOL)shouldShowResizeIndicator
+4 -2
View File
@@ -36,8 +36,10 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPColor whiteColor], 8]
forKeys:[ @"body-color", @"height-shadow"]];
return @{
@"body-color": [CPColor whiteColor],
@"height-shadow": 8,
};
}
- (id)initWithFrame:(CGRect)aFrame styleMask:(unsigned)aStyleMask
+6 -8
View File
@@ -56,14 +56,12 @@ var _CPPopoverWindowViewDefaultCursorSize = _CGSizeMake(16, 10),
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null],
[CPNull null],
[CPNull null],
[CPNull null]]
forKeys:[@"background-gradient",
@"background-gradient-hud",
@"stroke-color",
@"stroke-color-hud"]];
return @{
@"background-gradient": [CPNull null],
@"background-gradient-hud": [CPNull null],
@"stroke-color": [CPNull null],
@"stroke-color-hud": [CPNull null],
};
}
/*!
+1 -2
View File
@@ -43,8 +43,7 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[]
forKeys:[]];
return @{};
}
- (void)layoutSubviews
+15 -15
View File
@@ -41,8 +41,7 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[]
forKeys:[]];
return @{};
}
- (id)initWithFrame:(CGRect)aFrame windowView:(_CPWindowView)parentView
@@ -107,19 +106,20 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjectsAndKeys:
[CPNull null], @"gradient-height",
[CPNull null], @"solid-color",
[CPNull null], @"bezel-head-color",
[CPColor blackColor], @"divider-color",
[CPColor whiteColor], @"body-color",
32, @"title-bar-height",
[CPNull null], @"minimize-image-highlighted-button",
[CPNull null], @"minimize-image-button",
[CPNull null], @"close-image-button",
[CPNull null], @"close-image-highlighted-button",
[CPNull null], @"unsaved-image-button",
[CPNull null], @"unsaved-image-highlighted-button"];
return @{
@"gradient-height": [CPNull null],
@"solid-color": [CPNull null],
@"bezel-head-color": [CPNull null],
@"divider-color": [CPColor blackColor],
@"body-color": [CPColor whiteColor],
@"title-bar-height": 32,
@"minimize-image-highlighted-button": [CPNull null],
@"minimize-image-button": [CPNull null],
@"close-image-button": [CPNull null],
@"close-image-highlighted-button": [CPNull null],
@"unsaved-image-button": [CPNull null],
@"unsaved-image-highlighted-button": [CPNull null],
};
}
+ (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
+7 -10
View File
@@ -40,16 +40,13 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPColor colorWithHexString:@"E3E3E3"],
[CPColor colorWithHexString:@"FFFFCA"],
2.0,
1.0,
[CPColor blackColor]]
forKeys:[@"stroke-color",
@"background-color",
@"border-radius",
@"stroke-width",
@"color"]];
return @{
@"stroke-color": [CPColor colorWithHexString:@"E3E3E3"],
@"background-color": [CPColor colorWithHexString:@"FFFFCA"],
@"border-radius": 2.0,
@"stroke-width": 1.0,
@"color": [CPColor blackColor],
};
}
/*! compute the contentView frame from a given window frame
+21 -20
View File
@@ -83,26 +83,27 @@ _CPWindowViewResizeSlop = 3;
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjectsAndKeys:
25, @"title-bar-height",
CGInsetMakeZero(), @"shadow-inset",
5, @"shadow-distance",
[CPColor clearColor], @"window-shadow-color",
CGSizeMakeZero(), @"size-indicator",
[CPNull null], @"resize-indicator",
[CPColor blackColor], @"attached-sheet-shadow-color",
[CPNull null], @"close-image-origin",
[CPNull null], @"close-image-size",
[CPNull null], @"close-image",
[CPNull null], @"close-active-image",
[CPNull null] , @"bezel-color",
[CPColor blackColor], @"title-text-color",
[CPFont systemFontOfSize:CPFontCurrentSystemSize], @"title-font",
[CPNull null], @"title-text-shadow-color",
_CGSizeMakeZero(), @"title-text-shadow-offset",
CPCenterTextAlignment, @"title-alignment",
CPLineBreakByTruncatingTail, @"title-line-break-mode",
CPTopVerticalTextAlignment, @"title-vertical-alignment"];
return @{
@"title-bar-height": 25,
@"shadow-inset": CGInsetMakeZero(),
@"shadow-distance": 5,
@"window-shadow-color": [CPColor clearColor],
@"size-indicator": CGSizeMakeZero(),
@"resize-indicator": [CPNull null],
@"attached-sheet-shadow-color": [CPColor blackColor],
@"close-image-origin": [CPNull null],
@"close-image-size": [CPNull null],
@"close-image": [CPNull null],
@"close-active-image": [CPNull null],
@"bezel-color": [CPNull null],
@"title-text-color": [CPColor blackColor],
@"title-font": [CPFont systemFontOfSize:CPFontCurrentSystemSize],
@"title-text-shadow-color": [CPNull null],
@"title-text-shadow-offset": _CGSizeMakeZero(),
@"title-alignment": CPCenterTextAlignment,
@"title-line-break-mode": CPLineBreakByTruncatingTail,
@"title-vertical-alignment": CPTopVerticalTextAlignment,
};
}
- (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
+1 -1
View File
@@ -144,7 +144,7 @@
if (_window)
return;
[[CPBundle mainBundle] loadCibFile:[self windowCibPath] externalNameTable:[CPDictionary dictionaryWithObject:_cibOwner forKey:CPCibOwner]];
[[CPBundle mainBundle] loadCibFile:[self windowCibPath] externalNameTable:@{ CPCibOwner: _cibOwner }];
}
/*!
+1 -1
View File
@@ -165,7 +165,7 @@ var CPCibObjectDataKey = @"CPCibObjectDataKey";
- (BOOL)instantiateCibWithOwner:(id)anOwner topLevelObjects:(CPArray)topLevelObjects
{
return [self instantiateCibWithExternalNameTable:[CPDictionary dictionaryWithObjects:[anOwner, topLevelObjects] forKeys:[CPCibOwner, CPCibTopLevelObjects]]];
return [self instantiateCibWithExternalNameTable:@{ CPCibOwner: anOwner, CPCibTopLevelObjects: topLevelObjects }];
}
@end
+2 -2
View File
@@ -52,7 +52,7 @@ var CPCibOwner = @"CPCibOwner";
var bundle = anOwner ? [CPBundle bundleForClass:[anOwner class]] : [CPBundle mainBundle],
path = [bundle pathForResource:aName];
return [self loadCibFile:path externalNameTable:[CPDictionary dictionaryWithObject:anOwner forKey:CPCibOwner]];
return [self loadCibFile:path externalNameTable:@{ CPCibOwner: anOwner }];
}
- (CPCib)loadCibFile:(CPString)aFileName externalNameTable:(CPDictionary)aNameTable
@@ -78,7 +78,7 @@ var CPCibOwner = @"CPCibOwner";
var bundle = anOwner ? [CPBundle bundleForClass:[anOwner class]] : [CPBundle mainBundle],
path = [bundle pathForResource:aName];
return [self loadCibFile:path externalNameTable:[CPDictionary dictionaryWithObject:anOwner forKey:CPCibOwner] loadDelegate:aDelegate];
return [self loadCibFile:path externalNameTable:@{ CPCibOwner: anOwner } loadDelegate:aDelegate];
}
- (CPCib)loadCibFile:(CPString)aFileName externalNameTable:(CPDictionary)aNameTable loadDelegate:(id)aDelegate
+2 -2
View File
@@ -46,12 +46,12 @@ var _CPCibCustomResourceClassNameKey = @"_CPCibCustomResourceClassNameKey",
+ (id)imageResourceWithName:(CPString)aResourceName size:(CGSize)aSize
{
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:[CPDictionary dictionaryWithObject:aSize forKey:@"size"]];
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:@{ @"size": aSize }];
}
+ (id)imageResourceWithName:(CPString)aResourceName size:(CGSize)aSize bundleClass:(CPString)aBundleClass
{
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:[CPDictionary dictionaryWithObjects:[aSize, aBundleClass] forKeys:[@"size", @"bundleClass"]]];
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:@{ @"size": aSize, @"bundleClass": aBundleClass }];
}
- (id)initWithClassName:(CPString)aClassName resourceName:(CPString)aResourceName properties:(CPDictionary)properties
+5 -1
View File
@@ -50,7 +50,11 @@
+ (CPDictionary)metricsOfFont:(CPFont)aFont
{
return [CPDictionary dictionaryWithObjectsAndKeys:0, @"ascender", 0, @"descender", 0, @"lineHeight"];
return @{
@"ascender": 0,
@"descender": 0,
@"lineHeight": 0,
};
}
@end
+5 -1
View File
@@ -165,7 +165,11 @@ var DOMFixedWidthSpanElement = nil,
baseline = DOMMetricsImgElement.offsetTop + DOMMetricsImgElement.offsetHeight,
descender = baseline - lineHeight;
return [CPDictionary dictionaryWithObjectsAndKeys:baseline, @"ascender", descender, @"descender", lineHeight, @"lineHeight"];
return @{
@"ascender": baseline,
@"descender": descender,
@"lineHeight": lineHeight,
};
}
@end
+5 -5
View File
@@ -1838,11 +1838,11 @@ var themedButtonValues = nil,
alternatingRowColors = [[CPColor whiteColor], [CPColor colorWithRed:245.0 / 255.0 green:249.0 / 255.0 blue:252.0 / 255.0 alpha:1.0]],
gridColor = [CPColor colorWithHexString:@"cccccc"],
selectionColor = [CPColor colorWithHexString:@"5f83b9"],
sourceListSelectionColor = [CPDictionary dictionaryWithObjects: [CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), [98.0 / 255.0, 143.0 / 210.0, 209.0 / 255.0, 1.0, 46.0 / 255.0, 88.0 / 176.0, 208.0 / 255.0,1.0], [0,1], 2),
[CPColor colorWithCalibratedRed:81.0 / 255.0 green:127.0 / 255.0 blue:200.0 / 255.0 alpha:1.0],
[CPColor colorWithCalibratedRed:34.0 / 255.0 green:63.0 / 255.0 blue:123.0 / 255.0 alpha:1.0]
]
forKeys: [CPSourceListGradient, CPSourceListTopLineColor, CPSourceListBottomLineColor]],
sourceListSelectionColor = @{
CPSourceListGradient: CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), [98.0 / 255.0, 143.0 / 210.0, 209.0 / 255.0, 1.0, 46.0 / 255.0, 88.0 / 176.0, 208.0 / 255.0,1.0], [0,1], 2),
CPSourceListTopLineColor: [CPColor colorWithCalibratedRed:81.0 / 255.0 green:127.0 / 255.0 blue:200.0 / 255.0 alpha:1.0],
CPSourceListBottomLineColor: [CPColor colorWithCalibratedRed:34.0 / 255.0 green:63.0 / 255.0 blue:123.0 / 255.0 alpha:1.0],
},
themedTableViewValues =
[
+5 -8
View File
@@ -1295,19 +1295,16 @@ var themedButtonValues = nil,
alternatingRowColors = [[CPColor whiteColor], [CPColor colorWithRed:245.0 / 255.0 green:249.0 / 255.0 blue:252.0 / 255.0 alpha:1.0]],
gridColor = [CPColor colorWithHexString:@"dce0e2"],
selectionColor = [CPColor colorWithHexString:@"5780d8"],
sourceListSelectionColor = [CPDictionary dictionaryWithObjectsAndKeys:
CGGradientCreateWithColorComponents(
sourceListSelectionColor = @{
CPSourceListGradient: CGGradientCreateWithColorComponents(
CGColorSpaceCreateDeviceRGB(),
[109.0 / 255.0, 150.0 / 255.0, 238.0 / 255.0, 1.0, 72.0 / 255.0, 113.0 / 255.0, 201.0 / 255.0, 1.0],
[0, 1],
2
),
CPSourceListGradient,
[CPColor colorWithCalibratedRed:73.0 / 255.0 green:109.0 / 255.0 blue:187.0 / 255.0 alpha:1.0],
CPSourceListTopLineColor,
[CPColor colorWithCalibratedRed:44.0 / 255.0 green:79.0 / 255.0 blue:155.0 / 255.0 alpha:1.0],
CPSourceListBottomLineColor
],
CPSourceListTopLineColor: [CPColor colorWithCalibratedRed:73.0 / 255.0 green:109.0 / 255.0 blue:187.0 / 255.0 alpha:1.0],
CPSourceListBottomLineColor: [CPColor colorWithCalibratedRed:44.0 / 255.0 green:79.0 / 255.0 blue:155.0 / 255.0 alpha:1.0],
},
themedTableViewValues =
[
+1 -1
View File
@@ -162,7 +162,7 @@ function themeFromCibData(data)
topLevelObjects = [];
[cib _setAwakenCustomResources:NO];
[cib instantiateCibWithExternalNameTable:[CPDictionary dictionaryWithObject:topLevelObjects forKey:CPCibTopLevelObjects]];
[cib instantiateCibWithExternalNameTable:@{ CPCibTopLevelObjects: topLevelObjects }];
var count = topLevelObjects.length,
theme = nil,
+1 -1
View File
@@ -620,7 +620,7 @@
*/
- (void)addAttribute:(CPString)anAttribute value:(id)aValue range:(CPRange)aRange
{
[self addAttributes:[CPDictionary dictionaryWithObject:aValue forKey:anAttribute] range:aRange];
[self addAttributes:@{ anAttribute: aValue } range:aRange];
}
/*!
+2 -2
View File
@@ -165,7 +165,7 @@ var CPObjectAccessorsForClassKey = @"$CPObjectAccessorsForClassKey",
{
[[CPException exceptionWithName:CPUndefinedKeyException
reason:[self _objectDescription] + " is not key value coding-compliant for the key " + aKey
userInfo:[CPDictionary dictionaryWithObjects:[self, aKey] forKeys:[CPTargetObjectUserInfoKey, CPUnknownUserInfoKey]]] raise];
userInfo:@{ CPTargetObjectUserInfoKey: self, CPUnknownUserInfoKey: aKey }] raise];
}
- (void)setValue:(id)aValue forKeyPath:(CPString)aKeyPath
@@ -258,7 +258,7 @@ var CPObjectAccessorsForClassKey = @"$CPObjectAccessorsForClassKey",
{
[[CPException exceptionWithName:CPUndefinedKeyException
reason:[self _objectDescription] + " is not key value coding-compliant for the key " + aKey
userInfo:[CPDictionary dictionaryWithObjects:[self, aKey] forKeys:[CPTargetObjectUserInfoKey, CPUnknownUserInfoKey]]] raise];
userInfo:@{ CPTargetObjectUserInfoKey: self, CPUnknownUserInfoKey: aKey }] raise];
}
- (CPString)_objectDescription
+9 -8
View File
@@ -769,7 +769,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
if (newValue === nil || newValue === undefined)
newValue = [CPNull null];
var changes = [CPDictionary dictionaryWithObject:newValue forKey:CPKeyValueChangeNewKey];
var changes = @{ CPKeyValueChangeNewKey: newValue };
[anObserver observeValueForKeyPath:aPath ofObject:_targetObject change:changes context:aContext];
}
}
@@ -1006,7 +1006,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
if (!aKey)
return;
var changeOptions = [CPDictionary dictionaryWithObject:CPKeyValueChangeSetting forKey:CPKeyValueChangeKindKey];
var changeOptions = @{ CPKeyValueChangeKindKey: CPKeyValueChangeSetting };
[[_CPKVOProxy proxyForObject:self] _sendNotificationsForKey:aKey changeOptions:changeOptions isBefore:YES];
}
@@ -1036,7 +1036,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
if (!aKey)
return;
var changeOptions = [CPDictionary dictionaryWithObjects:[change, indexes] forKeys:[CPKeyValueChangeKindKey, CPKeyValueChangeIndexesKey]];
var changeOptions = @{ CPKeyValueChangeKindKey: change, CPKeyValueChangeIndexesKey: indexes };
[[_CPKVOProxy proxyForObject:self] _sendNotificationsForKey:aKey changeOptions:changeOptions isBefore:YES];
}
@@ -1067,7 +1067,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
return;
var changeKind = _changeKindForSetMutationKind(mutationKind),
changeOptions = [CPDictionary dictionaryWithObject:changeKind forKey:CPKeyValueChangeKindKey];
changeOptions = @{ CPKeyValueChangeKindKey: changeKind };
//set hidden change-dict ivars to support unordered to-many relationships
changeOptions[_CPKeyValueChangeSetMutationObjectsKey] = objects;
changeOptions[_CPKeyValueChangeSetMutationKindKey] = mutationKind;
@@ -1215,10 +1215,11 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
{
var oldValue = [_value valueForKeyPath:_secondPart],
newValue = [_object valueForKeyPath:_firstPart + "." + _secondPart],
pathChanges = [CPDictionary dictionaryWithObjectsAndKeys:
newValue ? newValue : [CPNull null], CPKeyValueChangeNewKey,
oldValue ? oldValue : [CPNull null], CPKeyValueChangeOldKey,
CPKeyValueChangeSetting, CPKeyValueChangeKindKey];
pathChanges = @{
CPKeyValueChangeNewKey: newValue ? newValue : [CPNull null],
CPKeyValueChangeOldKey: oldValue ? oldValue : [CPNull null],
CPKeyValueChangeKindKey: CPKeyValueChangeSetting,
};
[_observer observeValueForKeyPath:_firstPart + "." + _secondPart ofObject:_object change:pathChanges context:_context];
+3 -3
View File
@@ -132,7 +132,7 @@ var _CPKeyedArchiverStringClass = Nil,
_CPKeyedArchiverStringClass = [CPString class];
_CPKeyedArchiverNumberClass = [CPNumber class];
_CPKeyedArchiverNullReference = [CPDictionary dictionaryWithObject:0 forKey:_CPKeyedArchiverUIDKey];
_CPKeyedArchiverNullReference = @{ _CPKeyedArchiverUIDKey: 0 };
}
+ (BOOL)allowsKeyedCoding
@@ -576,7 +576,7 @@ var _CPKeyedArchiverEncodeObject = function(self, anObject, isConditional)
[self._UIDs setObject:classUID forKey:className];
}
[plistObject setObject:[CPDictionary dictionaryWithObject:classUID forKey:_CPKeyedArchiverUIDKey] forKey:_CPKeyedArchiverClassKey];
[plistObject setObject:@{ _CPKeyedArchiverUIDKey: classUID } forKey:_CPKeyedArchiverClassKey];
}
UID = [self._conditionalUIDs objectForKey:GUID];
@@ -595,5 +595,5 @@ var _CPKeyedArchiverEncodeObject = function(self, anObject, isConditional)
}
}
return [CPDictionary dictionaryWithObject:UID forKey:_CPKeyedArchiverUIDKey];
return @{ _CPKeyedArchiverUIDKey: UID };
};
@@ -55,7 +55,7 @@
var collection = [_collection expressionValueWithObject:object context:context],
count = [collection count],
result = [CPArray array],
bindings = [CPDictionary dictionaryWithObject:[CPExpression expressionForEvaluatedObject] forKey:[self variable]],
bindings = @{ [self variable]: [CPExpression expressionForEvaluatedObject] },
i = 0;
for (; i < count; i++)
+9 -3
View File
@@ -1040,7 +1040,7 @@
var arrayController1 = [CPArrayController new],
arrayController2 = [CPArrayController new];
[arrayController2 setContent:[CPDictionary dictionaryWithObject:[1, 2, 3] forKey:@"x"]];
[arrayController2 setContent:@{ @"x": [1, 2, 3] }];
[arrayController1 bind:@"contentArray" toObject:arrayController2 withKeyPath:@"selection.x" options:nil];
// This used to cause a bug where the _CPKVCArray wrapping the selection proxy tried to call 'count' on
@@ -1165,8 +1165,14 @@
if (self)
{
items = [CPMutableArray array];
[items addObject:[CPDictionary dictionaryWithObjectsAndKeys:@"Spacely Sprockets", @"name", [CPArray arrayWithObjects:@"Tom", @"Dick", @"Harry"], @"employees"]];
[items addObject:[CPDictionary dictionaryWithObjectsAndKeys:@"Cogswell Cogs", @"name", [CPArray arrayWithObjects:@"Jane", @"Mary", @"Vic"], @"employees"]];
[items addObject:@{
@"name": @"Spacely Sprockets",
@"employees": [CPArray arrayWithObjects:@"Tom", @"Dick", @"Harry"]
}];
[items addObject:@{
@"name": @"Cogswell Cogs",
@"employees": [CPArray arrayWithObjects:@"Jane", @"Mary", @"Vic"]
}];
}
return self;
+9 -14
View File
@@ -45,17 +45,12 @@
[control unbind:CPValueBinding];
// Set up a new binding with explicit placeholders, different from the default ones.
var options = [CPDictionary dictionaryWithObjects:[
CPOffState,
CPOnState,
CPOnState,
CPMixedState
] forKeys:[
CPMultipleValuesPlaceholderBindingOption,
CPNoSelectionPlaceholderBindingOption,
CPNotApplicablePlaceholderBindingOption,
CPNullPlaceholderBindingOption
]];
var options = @{
CPMultipleValuesPlaceholderBindingOption: CPOffState,
CPNoSelectionPlaceholderBindingOption: CPOnState,
CPNotApplicablePlaceholderBindingOption: CPOnState,
CPNullPlaceholderBindingOption: CPMixedState,
};
[control bind:CPValueBinding toObject:arrayController withKeyPath:@"selection.self" options:options];
@@ -81,13 +76,13 @@
var content =
[
[CPDictionary dictionaryWithObject:YES forKey:@"state"],
[CPDictionary dictionaryWithObject:NO forKey:@"state"]
@{ @"state": YES },
@{ @"state": NO }
],
arrayController = [[CPArrayController alloc] initWithContent:content];
// First test defaults.
[control bind:CPValueBinding toObject:arrayController withKeyPath:@"selection.state" options:[CPDictionary dictionaryWithObject:@"CPNegateBoolean" forKey:CPValueTransformerNameBindingOption]];
[control bind:CPValueBinding toObject:arrayController withKeyPath:@"selection.state" options:@{ CPValueTransformerNameBindingOption: @"CPNegateBoolean" }];
[arrayController setSelectionIndexes:[CPIndexSet indexSetWithIndex:0]];
[self assert:CPOffState equals:[control objectValue] message:"content[0] is negated"]
@@ -105,7 +105,7 @@
{
// Note: this cib will connect 'objectController'. This is only for debugging purposes,
// this code should run with or without that connection.
var cib = [CPBundle loadCibFile:[[CPBundle bundleForClass:CPKeyValueBindingSimpleBindingsTest] pathForResource:"SimpleBindingsAdoption_03.cib"] externalNameTable:[CPDictionary dictionaryWithObject:self forKey:CPCibOwner]];
var cib = [CPBundle loadCibFile:[[CPBundle bundleForClass:CPKeyValueBindingSimpleBindingsTest] pathForResource:"SimpleBindingsAdoption_03.cib"] externalNameTable:@{ CPCibOwner: self }];
// Test the interaction.
[textField setStringValue:@"0.7"];
+10
View File
@@ -0,0 +1,10 @@
{
"folders":
[
{
"path": "/Users/siker/dev/cappuccino",
"folder_exclude_patterns": ["Build", "*.environment", "AppKit/Themes/Aristo/Frameworks"],
"file_exclude_patterns": ["*.cib", "dataURLs.txt", "MHTMLData.txt", "MHTMLPaths.txt"]
}
]
}
File diff suppressed because it is too large. Load diff