Merge branch 'master' of git://github.com/280north/cappuccino

This commit is contained in:
Klaas Pieter Annema
2010-05-26 11:58:49 +02:00
13 changed files with 95 additions and 48 deletions
+1 -1
View File
@@ -581,7 +581,7 @@ var CPSearchFieldSearchImage = nil,
- (void)_sendPartialString
{
[[self target] performSelector:[self action] withObject:self];
[self _sendAction:self];
}
- (void)_searchFieldCancel:(id)sender
+9 -3
View File
@@ -79,11 +79,16 @@ CPTableColumnUserResizingMask = 1 << 1;
[self setHeaderView:header];
var textDataView = [CPTextField new];
[textDataView setLineBreakMode:CPLineBreakByTruncatingTail];
[textDataView setValue:[CPColor colorWithHexString:@"333333"] forThemeAttribute:@"text-color"];
[textDataView setValue:[CPColor colorWithRed:51.0 / 255.0 green:51.0 / 255.0 blue:51.0 / 255.0 alpha:1.0]
forThemeAttribute:"text-color"];
[textDataView setValue:[CPColor whiteColor] forThemeAttribute:@"text-color" inState:CPThemeStateSelectedDataView];
[textDataView setValue:[CPFont boldSystemFontOfSize:12] forThemeAttribute:@"font" inState:CPThemeStateSelectedDataView];
[textDataView setLineBreakMode:CPLineBreakByTruncatingTail];
[textDataView setValue:[CPFont boldSystemFontOfSize:12.0] forThemeAttribute:@"font" inState:CPThemeStateSelectedDataView];
[textDataView setValue:CPCenterVerticalTextAlignment forThemeAttribute:@"vertical-alignment"];
[textDataView setValue:CGInsetMake(0.0, 0.0, 0.0, 5.0) forThemeAttribute:@"content-inset"];
[self setDataView:textDataView];
}
@@ -398,6 +403,7 @@ var CPTableColumnIdentifierKey = @"CPTableColumnIdentifierKey",
CPTableColumnResizingMaskKey = @"CPTableColumnResizingMaskKey",
CPTableColumnIsHiddenkey = @"CPTableColumnIsHiddenKey",
CPSortDescriptorPrototypeKey = @"CPSortDescriptorPrototypeKey";
CPTableColumnIsHiddenkey = @"CPTableColumnIsHiddenKey";
@implementation CPTableColumn (CPCoding)
+9 -7
View File
@@ -42,11 +42,13 @@
- (void)_init
{
_textField = [[_CPImageAndTextView alloc] initWithFrame:CGRectMake(5, 1, CGRectGetWidth([self bounds]) - 10, CGRectGetHeight([self bounds]) - 1)];
_textField = [[_CPImageAndTextView alloc] initWithFrame:
CGRectMake(5.0, 0.0, CGRectGetWidth([self bounds]) - 10.0, CGRectGetHeight([self bounds]))];
[_textField setAutoresizingMask:CPViewWidthSizable|CPViewHeightSizable];
[_textField setLineBreakMode:CPLineBreakByTruncatingTail];
[_textField setTextColor: [CPColor colorWithHexString: @"333333"]];
[_textField setTextColor:[CPColor colorWithRed:51.0 / 255.0 green:51.0 / 255.0 blue:51.0 / 255.0 alpha:1.0]];
[_textField setFont:[CPFont boldSystemFontOfSize:12.0]];
[_textField setAlignment:CPLeftTextAlignment];
[_textField setVerticalAlignment:CPCenterVerticalTextAlignment];
@@ -61,13 +63,13 @@
var themeState = [self themeState];
if(themeState & CPThemeStateSelected && themeState & CPThemeStateHighlighted)
[self setBackgroundColor:[CPColor colorWithPatternImage:CPAppKitImage("tableview-headerview-highlighted-pressed.png", CGSizeMake(1.0, 22.0))]];
[self setBackgroundColor:[CPColor colorWithPatternImage:CPAppKitImage("tableview-headerview-highlighted-pressed.png", CGSizeMake(1.0, 23.0))]];
else if (themeState & CPThemeStateSelected)
[self setBackgroundColor:[CPColor colorWithPatternImage:CPAppKitImage("tableview-headerview-highlighted.png", CGSizeMake(1.0, 22.0))]];
[self setBackgroundColor:[CPColor colorWithPatternImage:CPAppKitImage("tableview-headerview-highlighted.png", CGSizeMake(1.0, 23.0))]];
else if (themeState & CPThemeStateHighlighted)
[self setBackgroundColor:[CPColor colorWithPatternImage:CPAppKitImage("tableview-headerview-pressed.png", CGSizeMake(1.0, 22.0))]];
[self setBackgroundColor:[CPColor colorWithPatternImage:CPAppKitImage("tableview-headerview-pressed.png", CGSizeMake(1.0, 23.0))]];
else
[self setBackgroundColor:[CPColor colorWithPatternImage:CPAppKitImage("tableview-headerview.png", CGSizeMake(1.0, 22.0))]];
[self setBackgroundColor:[CPColor colorWithPatternImage:CPAppKitImage("tableview-headerview.png", CGSizeMake(1.0, 23.0))]];
}
- (void)setStringValue:(CPString)string
@@ -174,7 +176,7 @@ var _CPTableColumnHeaderViewStringValueKey = @"_CPTableColumnHeaderViewStringVal
_columnOldWidth = 0.0;
[self setBackgroundColor:[CPColor colorWithPatternImage:CPAppKitImage("tableview-headerview.png", CGSizeMake(1.0, 22.0))]];
[self setBackgroundColor:[CPColor colorWithPatternImage:CPAppKitImage("tableview-headerview.png", CGSizeMake(1.0, 23.0))]];
}
- (id)initWithFrame:(CGRect)aFrame
+5 -3
View File
@@ -244,7 +244,8 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
_selectionHighlightStyle = CPTableViewSelectionHighlightStyleRegular;
[self setUsesAlternatingRowBackgroundColors:NO];
[self setAlternatingRowBackgroundColors:[[CPColor whiteColor], [CPColor colorWithHexString:@"f5f9fc"]]];
[self setAlternatingRowBackgroundColors:
[[CPColor whiteColor], [CPColor colorWithRed:245.0 / 255.0 green:249.0 / 255.0 blue:252.0 / 255.0 alpha:1.0]]];
_tableColumns = [];
_tableColumnRanges = [];
@@ -3413,9 +3414,10 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey",
_gridColor = [aCoder decodeObjectForKey:CPTableViewGridColorKey] || [CPColor grayColor];
_gridStyleMask = [aCoder decodeIntForKey:CPTableViewGridStyleMaskKey] || CPTableViewGridNone;
_alternatingRowBackgroundColors = [aCoder decodeObjectForKey:CPTableViewAlternatingRowColorsKey];
_usesAlternatingRowBackgroundColors = [aCoder decodeObjectForKey:CPTableViewUsesAlternatingBackgroundKey]
_alternatingRowBackgroundColors =
[[CPColor whiteColor], [CPColor colorWithRed:245.0 / 255.0 green:249.0 / 255.0 blue:252.0 / 255.0 alpha:1.0]];
_headerView = [aCoder decodeObjectForKey:CPTableViewHeaderViewKey];
_cornerView = [aCoder decodeObjectForKey:CPTableViewCornerViewKey];
-14
View File
@@ -20,20 +20,6 @@
return self;
}
- (void)drawRect:(CGRect)aRect
{
var context = [[CPGraphicsContext currentContext] graphicsPort];
CGContextSetStrokeColor(context, [CPColor colorWithHexString:@"dce0e2"]);
var points = [
CGPointMake(aRect.origin.x, aRect.origin.y + 0.5),
CGPointMake(aRect.origin.x, aRect.origin.y + aRect.size.height)
];
CGContextStrokeLineSegments(context, points, 2);
}
- (id)initWithCoder:(CPCoder)aCoder
{
self = [super initWithCoder:aCoder];
+5 -2
View File
@@ -354,9 +354,12 @@ var CPArrayClass = Ni
- (id)decodeBytesForKey:(CPString)aKey
{
// We get the CPData wrapper, then extract the bytes array
var data = [self decodeObjectForKey:aKey],
objectClass = data.isa;
var data = [self decodeObjectForKey:aKey];
if (!data)
return nil;
var objectClass = data.isa;
if (objectClass === CPDataClass)
return data.bytes;
+10 -1
View File
@@ -48,7 +48,16 @@
loadStdev = Math.sqrt(loadStdev / data.length);
launchStdev = Math.sqrt(launchStdev / data.length);
if (window.parent.BCOMM) {
window.parent.BCOMM.finishTest({
loadAvg : loadAvg,
launchAvg : launchAvg,
loadStdev : loadStdev,
launchStdev : launchStdev
});
}
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
File diff suppressed because one or more lines are too long
@@ -2,17 +2,17 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10C540</string>
<string key="IBDocument.InterfaceBuilderVersion">740</string>
<string key="IBDocument.AppKitVersion">1038.25</string>
<string key="IBDocument.HIToolboxVersion">458.00</string>
<string key="IBDocument.SystemVersion">10D573</string>
<string key="IBDocument.InterfaceBuilderVersion">759</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">460.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">740</string>
<string key="NS.object.0">759</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="371"/>
<integer value="489"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -218,9 +218,10 @@
</object>
</object>
<double key="NSRowHeight">23</double>
<int key="NSTvFlags">-694157312</int>
<int key="NSTvFlags">-157286400</int>
<reference key="NSDelegate"/>
<reference key="NSDataSource"/>
<int key="NSGridStyleMask">3</int>
<int key="NSColumnAutoresizingStyle">4</int>
<int key="NSDraggingSourceMaskForLocal">15</int>
<int key="NSDraggingSourceMaskForNonLocal">0</int>
@@ -531,6 +532,7 @@
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
+3 -3
View File
@@ -21,13 +21,13 @@ function cleanup() {
{
var status;
status = OS.system(["capp", "gen", "ToolsTestApp"]);
status = OS.system(["capp", "gen", "ToolsTestApp"].map(OS.enquote).join(" ") + " > /dev/null");
[self assert:status equals:0 message:"capp gen failed"];
status = OS.system(["press", "-f", "ToolsTestApp", "PressTestApp"]);
status = OS.system(["press", "-f", "ToolsTestApp", "PressTestApp"].map(OS.enquote).join(" ") + " > /dev/null");
[self assert:status equals:0 message:"press failed"];
status = OS.system(["flatten", "-f", "ToolsTestApp", "FlattenTestApp"]);
status = OS.system(["flatten", "-f", "ToolsTestApp", "FlattenTestApp"].map(OS.enquote).join(" ") + " > /dev/null");
[self assert:status equals:0 message:"flatten failed"];
}
+26
View File
@@ -32,6 +32,12 @@
if (self)
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self setRecentsAutosaveName:[cell recentsAutosaveName]];
[self setMaximumRecents:[cell maximumRecents]];
[self setSendsWholeSearchString:[cell sendsWholeSearchString]];
[self setSendsSearchStringImmediately:[cell sendsSearchStringImmediately]];
}
return self;
@@ -59,5 +65,25 @@
@implementation NSSearchFieldCell : NSTextFieldCell
{
CPString _recentsAutosaveName @accessors(property=recentsAutosaveName);
int _maximumRecents @accessors(property=maximumRecents);
BOOL _sendsWholeSearchString @accessors(property=sendsWholeSearchString);
BOOL _sendsSearchStringImmediately @accessors(property=sendsSearchStringImmediately);
}
- (id)initWithCoder:(CPCoder)aCoder
{
if (self = [super initWithCoder:aCoder])
{
_recentsAutosaveName = [aCoder decodeObjectForKey:@"NSRecentsAutosaveName"];
_maximumRecents = [aCoder decodeIntForKey:@"NSMaximumRecents"];
_sendsWholeSearchString = [aCoder decodeBoolForKey:@"NSSendsWholeSearchString"] ? YES : NO;
// These bytes don't seem to be used for anything else but the send immediatly flag
_sendsSearchStringImmediately = [aCoder decodeBytesForKey:@"NSSearchFieldFlags"] ? YES: NO;
}
return self;
}
@end
+12 -6
View File
@@ -37,15 +37,21 @@
//var dataViewCell = [aCoder decodeObjectForKey:@"NSDataCell"];
_dataView = [[CPTextField alloc] initWithFrame:CPRectMakeZero()];
[_dataView setValue:[CPColor whiteColor] forThemeAttribute:@"text-color" inState:CPThemeStateSelected];
[_dataView setValue:[CPColor colorWithRed:51.0 / 255.0 green:51.0 / 255.0 blue:51.0 / 255.0 alpha:1.0]
forThemeAttribute:"text-color"];
[_dataView setValue:[CPColor whiteColor] forThemeAttribute:@"text-color" inState:CPThemeStateSelectedDataView];
[_dataView setLineBreakMode:CPLineBreakByTruncatingTail];
[_dataView setValue:[CPFont boldSystemFontOfSize:12.0] forThemeAttribute:@"font" inState:CPThemeStateSelectedDataView];
[_dataView setValue:CPCenterVerticalTextAlignment forThemeAttribute:@"vertical-alignment"];
[_dataView setValue:CGInsetMake(0.0, 0.0, 0.0, 5.0) forThemeAttribute:@"content-inset"];
var headerCell = [aCoder decodeObjectForKey:@"NSHeaderCell"],
headerView = [[_CPTableColumnHeaderView alloc] initWithFrame:CPRectMakeZero()];
[_headerView setStringValue:[headerCell objectValue]];
[_headerView setFont:[headerCell font]];
[self setHeaderView:_headerView];
[headerView setStringValue:[headerCell objectValue]];
[self setHeaderView:headerView];
_width = [aCoder decodeFloatForKey:@"NSWidth"];
_minWidth = [aCoder decodeFloatForKey:@"NSMinWidth"];
+5
View File
@@ -54,6 +54,11 @@
_intercellSpacing = CGSizeMake(0.0, 0.0);//CGSizeMake([aCoder decodeFloatForKey:"NSIntercellSpacingWidth"], [aCoder decodeFloatForKey:"NSIntercellSpacingHeight"]);
_gridColor = [aCoder decodeObjectForKey:@"NSGridColor"];
// Convert xib default to cib default
if ([_gridColor isEqual:[CPColor colorWithRed:127.0 / 255.0 green:127.0 / 255.0 blue:127.0 / 255.0 alpha:1.0]])
_gridColor = [CPColor colorWithRed:229.0 / 255.0 green:229.0 / 255.0 blue:229.0 / 255.0 alpha:1.0];
_gridStyleMask = [aCoder decodeIntForKey:@"NSGridStyleMask"];
_usesAlternatingRowBackgroundColors = (flags & 0x00800000) ? YES : NO;