Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Ryan Tolmasky I committed Sep 9, 2008
1 parent c25005d commit 4a858cd
Show file tree
Hide file tree
Showing 40 changed files with 853 additions and 148 deletions.
18 changes: 15 additions & 3 deletions AppKit/AppKit.steam
Expand Up @@ -7,20 +7,32 @@
<key>Targets</key>
<array>
<dict>
<key>name</key>
<key>Name</key>
<string>AppKit</string>
<key>Excluded</key>
<array>
<string>CPOutlineView.j</string>
<string>CPTableColumn.j</string>
<string>CPTableView.j</string>
</array>
<key>Flags</key>
<string>-DPLATFORM_DOM</string>
</dict>
<dict>
<key>Name</key>
<string>AppKit-Rhino</string>
<key>Excluded</key>
<array>
<string>CPOutlineView.j</string>
<string>CPTableColumn.j</string>
<string>CPTableView.j</string>
</array>
</dict>
</array>
<key>Configurations</key>
<array>
<dict>
<key>name</key>
<key>Name</key>
<string>Debug</string>
<key>Settings</key>
<dict>
Expand All @@ -31,7 +43,7 @@
</dict>
</dict>
<dict>
<key>name</key>
<key>Name</key>
<string>Release</string>
<key>Settings</key>
<dict>
Expand Down
10 changes: 8 additions & 2 deletions AppKit/CPTextField.j
Expand Up @@ -210,6 +210,7 @@ var _CPTextFieldSquareBezelColor = nil;

[self setStringValue:@""];

#if PLATFORM(DOM)
var element = [[self class] _inputElement];

element.value = string;
Expand Down Expand Up @@ -244,17 +245,20 @@ var _CPTextFieldSquareBezelColor = nil;
};

[[CPDOMWindowBridge sharedDOMWindowBridge] _propagateCurrentDOMEvent:YES];

#endif

return YES;
}

- (BOOL)resignFirstResponder
{
#if PLATFORM(DOM)
var element = [[self class] _inputElement];

_DOMElement.removeChild(element);
[self setStringValue:element.value];

#endif

return YES;
}

Expand All @@ -272,7 +276,9 @@ var _CPTextFieldSquareBezelColor = nil;
{
[super setFrameSize:aSize];

#if PLATFORM(DOM)
CPDOMDisplayServerSetStyleSize(_DOMTextElement, _frame.size.width - 2.0 * HORIZONTAL_PADDING, _frame.size.height - TOP_PADDING - BOTTOM_PADDING);
#endif
}

- (BOOL)isSelectable
Expand Down
57 changes: 35 additions & 22 deletions AppKit/Cib/CPCustomView.j
Expand Up @@ -22,6 +22,19 @@

import "CPView.j"


var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
CPViewAutoresizesSubviewsKey = @"CPViewAutoresizesSubviews",
CPViewBackgroundColorKey = @"CPViewBackgroundColor",
CPViewBoundsKey = @"CPViewBoundsKey",
CPViewFrameKey = @"CPViewFrameKey",
CPViewHitTestsKey = @"CPViewHitTestsKey",
CPViewIsHiddenKey = @"CPViewIsHiddenKey",
CPViewOpacityKey = @"CPViewOpacityKey",
CPViewSubviewsKey = @"CPViewSubviewsKey",
CPViewSuperviewKey = @"CPViewSuperviewKey",
CPViewWindowKey = @"CPViewWindowKey";

@implementation CPCustomView : CPView
{
CPString _className;
Expand All @@ -43,41 +56,41 @@ var CPCustomViewClassNameKey = @"CPCustomViewClassNameKey";
// FIXME: Should we instead throw an exception?
if (!theClass)
theClass = [CPView class];

// If this is just a "CPView", don't bother with any funny business, just go ahead and create it with initWithCoder:
if (theClass == [CPView class])
self = [[CPView alloc] initWithCoder:aCoder];

return self;
// If not, fall back to initWithFrame:
/*

var frame = [aCoder decodeRectForKey:CPViewFrameKey];

self = [[theClass alloc] initWithFrame:frame];
// If this is just a "CPView", don't bother with any funny business, just go ahead and create it with initWithCoder:
if (theClass == [CPView class])
self = [[CPView alloc] initWithFrame:frame];

if (self)
{
_bounds = [aCoder decodeRectForKey:CPViewBoundsKey];
_window = [aCoder decodeObjectForKey:CPViewWindowKey];
_subviews = [aCoder decodeObjectForKey:CPViewSubviewsKey];
_superview = [aCoder decodeObjectForKey:CPViewSuperviewKey];
{
[self _setWindow:[aCoder decodeObjectForKey:CPViewWindowKey]];

_autoresizingMask = [aCoder decodeIntForKey:CPViewAutoresizingMaskKey];
_autoresizesSubviews = [aCoder decodeBoolForKey:CPViewAutoresizesSubviewsKey];
// Since the object replacement logic hasn't had a chance to kick in yet, we need to do it manually:
var subviews = [aCoder decodeObjectForKey:CPViewSubviewsKey],
index = 0,
count = subviews.length;

// FIXME: UGH!!!!
_index = [aCoder decodeIntForKey:FIXME_indexKey];
for (; index < count; ++index)
{
// This is a bogus superview "CPCustomView".
subviews[index]._superview = nil;

[self addSubview:subviews[index]];
}

_autoresizingMask = [aCoder decodeIntForKey:CPViewAutoresizingMaskKey];
_autoresizesSubviews = [aCoder decodeBoolForKey:CPViewAutoresizesSubviewsKey];

_hitTests = [aCoder decodeObjectForKey:CPViewHitTestsKey];
_isHidden = [aCoder decodeObjectForKey:CPViewIsHiddenKey];
_opacity = [aCoder decodeIntForKey:CPViewOpacityKey];

[self setBackgroundColor:[aCoder decodeObjectForKey:CPViewBackgroundColorKey]];
}

return self;*/
return self;
}

@end
2 changes: 0 additions & 2 deletions AppKit/Platform/Platform.h
Expand Up @@ -21,5 +21,3 @@
*/

#define PLATFORM(FEATURE) (defined( PLATFORM_##FEATURE ) && PLATFORM_##FEATURE)

#define PLATFORM_DOM 1
10 changes: 8 additions & 2 deletions AppKit/build.xml
Expand Up @@ -16,7 +16,13 @@

<steam>
<arguments>
<arg line = "-f AppKit.steam -c ${Configuration}" />
<arg line = "-f AppKit.steam -c ${Configuration} -t AppKit" />
</arguments>
</steam>

<steam>
<arguments>
<arg line = "-f AppKit.steam -c ${Configuration} -t AppKit-Rhino" />
</arguments>
</steam>

Expand All @@ -33,7 +39,7 @@
</copy>

<copy todir = "${Build.Cappuccino.Tools.Lib.Frameworks}/AppKit">
<fileset dir = "${Build}/${Configuration}/AppKit" />
<fileset dir = "${Build}/${Configuration}/AppKit-Rhino" />
</copy>

<copy todir = "${Build.Cappuccino.Starter.Frameworks}/AppKit" >
Expand Down
8 changes: 4 additions & 4 deletions Foundation/Foundation.steam
Expand Up @@ -2,19 +2,19 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<key>Name</key>
<string>Foundation</string>
<key>Targets</key>
<array>
<dict>
<key>name</key>
<key>Name</key>
<string>Foundation</string>
</dict>
</array>
<key>Configurations</key>
<array>
<dict>
<key>name</key>
<key>Name</key>
<string>Debug</string>
<key>Settings</key>
<dict>
Expand All @@ -25,7 +25,7 @@
</dict>
</dict>
<dict>
<key>name</key>
<key>Name</key>
<string>Release</string>
<key>Settings</key>
<dict>
Expand Down
2 changes: 2 additions & 0 deletions Tools/Install/install-tools
Expand Up @@ -27,11 +27,13 @@ mkdir -p $INSTALL_DIR/share

cp -fR objj/ $INSTALL_DIR/share/objj

ln -sf $INSTALL_DIR/share/objj/bin/nib2cib $INSTALL_DIR/bin/nib2cib
ln -sf $INSTALL_DIR/share/objj/bin/objj $INSTALL_DIR/bin/objj
ln -sf $INSTALL_DIR/share/objj/bin/objjc $INSTALL_DIR/bin/objjc
ln -sf $INSTALL_DIR/share/objj/bin/steam $INSTALL_DIR/bin/steam
ln -sf $INSTALL_DIR/share/objj/bin/bake $INSTALL_DIR/bin/bake

chmod +x $INSTALL_DIR/bin/nib2cib
chmod +x $INSTALL_DIR/bin/objj
chmod +x $INSTALL_DIR/bin/objjc
chmod +x $INSTALL_DIR/bin/steam
Expand Down
25 changes: 25 additions & 0 deletions Tools/NibApp/AppController.j
@@ -0,0 +1,25 @@

import <Foundation/CPObject.j>
import <AppKit/CPCib.j>


@implementation AppController : CPObject
{
}

- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var cib = [[CPCib alloc] initWithContentsOfURL:@"MainMenu.cib"],
x = [cib instantiateCibWithExternalNameTable:nil];

[x setBackgroundColor:[CPColor blueColor]];

var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];

[contentView addSubview:x];

[theWindow orderFront:self];
}

@end
1 change: 1 addition & 0 deletions Tools/NibApp/Frameworks
File renamed without changes.
File renamed without changes.

0 comments on commit 4a858cd

Please sign in to comment.