mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-09 04:07:12 +00:00
Merge branch 'master' into documentation
This commit is contained in:
@@ -53,9 +53,11 @@ import "CPSecureTextField.j"
|
||||
import "CPSegmentedControl.j"
|
||||
import "CPShadow.j"
|
||||
import "CPSlider.j"
|
||||
import "CPSplitView.j"
|
||||
import "CPTextField.j"
|
||||
import "CPToolbar.j"
|
||||
import "CPToolbarItem.j"
|
||||
import "CPView.j"
|
||||
import "CPWebView.j"
|
||||
import "CPWindow.j"
|
||||
import "CPWindowController.j"
|
||||
|
||||
+2
-2
@@ -34,12 +34,12 @@
|
||||
<dict>
|
||||
<key>Name</key>
|
||||
<string>Debug</string>
|
||||
<key>Flags</key>
|
||||
<string>-DDEBUG</string>
|
||||
<key>Settings</key>
|
||||
<dict>
|
||||
<key>PREPROCESS</key>
|
||||
<true/>
|
||||
<key>FLAGS</key>
|
||||
<string>-DDEBUG</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
|
||||
@@ -211,7 +211,7 @@ ACTUAL_FRAME_RATE = 0;
|
||||
- (void)startAnimation
|
||||
{
|
||||
// If we're already animating, or our delegate stops us, animate.
|
||||
if (_timer || _delegate && ![_delegate animationShouldStart:self])
|
||||
if (_timer || _delegate && [_delegate respondsToSelector:@selector(animationShouldStart)] && ![_delegate animationShouldStart:self])
|
||||
return;
|
||||
|
||||
_progress = 0.0;
|
||||
@@ -258,7 +258,8 @@ ACTUAL_FRAME_RATE = 0;
|
||||
window.clearTimeout(_timer);
|
||||
_timer = nil;
|
||||
|
||||
[_delegate animationDidStop:self];
|
||||
if ([_delegate respondsToSelector:@selector(animationDidStop:)])
|
||||
[_delegate animationDidStop:self];
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+2
-2
@@ -200,7 +200,7 @@ var CPDocumentUntitledCount = 0;
|
||||
- (CPData)dataOfType:(CPString)aType error:({CPError})anError
|
||||
{
|
||||
[CPException raise:CPUnsupportedMethodException
|
||||
reason:"This method must be overridden by the document"];
|
||||
reason:"dataOfType:error: must be overridden by the document subclass."];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -215,7 +215,7 @@ var CPDocumentUntitledCount = 0;
|
||||
- (void)readFromData:(CPData)aData ofType:(CPString)aType error:(CPError)anError
|
||||
{
|
||||
[CPException raise:CPUnsupportedMethodException
|
||||
reason:"This method must be overridden by the document"];
|
||||
reason:"readFromData:ofType: must be overridden by the document subclass."];
|
||||
}
|
||||
|
||||
// Creating and managing window controllers
|
||||
|
||||
@@ -100,18 +100,18 @@ var CPSharedDocumentController = nil;
|
||||
*/
|
||||
- (void)openUntitledDocumentOfType:(CPString)aType display:(BOOL)shouldDisplay
|
||||
{
|
||||
var document = [self makeUntitledDocumentOfType:aType error:nil];
|
||||
var theDocument = [self makeUntitledDocumentOfType:aType error:nil];
|
||||
|
||||
if (document)
|
||||
[self addDocument:document];
|
||||
if (theDocument)
|
||||
[self addDocument:theDocument];
|
||||
|
||||
if (shouldDisplay)
|
||||
{
|
||||
[document makeWindowControllers];
|
||||
[document showWindows];
|
||||
[theDocument makeWindowControllers];
|
||||
[theDocument showWindows];
|
||||
}
|
||||
|
||||
return document;
|
||||
return theDocument;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -137,9 +137,11 @@ var CPSharedDocumentController = nil;
|
||||
var result = [self documentForURL:anAbsoluteURL];
|
||||
|
||||
if (!result)
|
||||
// FIXME: type(!)
|
||||
result = [self makeDocumentWithContentsOfURL:anAbsoluteURL ofType:[[_documentTypes objectAtIndex:0] objectForKey:@"CPBundleTypeName"] delegate:self didReadSelector:@selector(document:didRead:contextInfo:) contextInfo:nil];
|
||||
|
||||
{
|
||||
var type = [self typeForContentsOfURL:anAbsoluteURL error:anError];
|
||||
|
||||
result = [self makeDocumentWithContentsOfURL:anAbsoluteURL ofType:type delegate:self didReadSelector:@selector(document:didRead:contextInfo:) contextInfo:[CPDictionary dictionaryWithObject:shouldDisplay forKey:@"shouldDisplay"]];
|
||||
}
|
||||
else if (shouldDisplay)
|
||||
[result showWindows];
|
||||
|
||||
@@ -200,6 +202,9 @@ var CPSharedDocumentController = nil;
|
||||
|
||||
[self addDocument:aDocument];
|
||||
[aDocument makeWindowControllers];
|
||||
|
||||
if ([aContextInfo objectForKey:@"shouldDisplay"])
|
||||
[aDocument showWindows];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -240,6 +245,34 @@ var CPSharedDocumentController = nil;
|
||||
[_documents removeObjectIdenticalTo:aDocument];
|
||||
}
|
||||
|
||||
- (CPString)defaultType
|
||||
{
|
||||
return [_documentTypes[0] objectForKey:@"CPBundleTypeName"];
|
||||
}
|
||||
|
||||
- (CPString)typeForContentsOfURL:(CPURL)anAbsoluteURL error:(CPError)outError
|
||||
{
|
||||
var index = 0,
|
||||
count = _documentTypes.length,
|
||||
|
||||
extension = [[anAbsoluteURL pathExtension] lowercaseString];
|
||||
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
var documentType = _documentTypes[index],
|
||||
extensions = [documentType objectForKey:@"CFBundleTypeExtensions"],
|
||||
extensionIndex = 0,
|
||||
extensionCount = extensions.length;
|
||||
|
||||
for (; extensionIndex < extensionCount; ++extensionIndex)
|
||||
if ([extensions[extensionIndex] lowercaseString] == extension)
|
||||
return [documentType objectForKey:@"CPBundleTypeName"];
|
||||
}
|
||||
|
||||
// FIXME?
|
||||
return [self defaultType];//nil;
|
||||
}
|
||||
|
||||
// Managing Document Types
|
||||
|
||||
/* @ignore */
|
||||
|
||||
+10
-3
@@ -20,10 +20,11 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
import <Foundation/CPObject.j>
|
||||
import <Foundation/CPString.j>
|
||||
import <Foundation/CPBundle.j>
|
||||
import <Foundation/CPNotificationCenter.j>
|
||||
import <Foundation/CPObject.j>
|
||||
import <Foundation/CPRunLoop.j>
|
||||
import <Foundation/CPString.j>
|
||||
|
||||
import "CPGeometry.j"
|
||||
|
||||
@@ -35,6 +36,8 @@ CPImageLoadStatusInvalidData = 4;
|
||||
CPImageLoadStatusUnexpectedEOF = 5;
|
||||
CPImageLoadStatusReadError = 6;
|
||||
|
||||
CPImageDidLoadNotification = @"CPImageDidLoadNotification";
|
||||
|
||||
@implementation CPBundle (CPImageAdditions)
|
||||
|
||||
- (CPString)pathForResource:(CPString)aFilename
|
||||
@@ -219,7 +222,11 @@ CPImageLoadStatusReadError = 6;
|
||||
// FIXME: IE is wrong on image sizes????
|
||||
if (!_size || (_size.width == -1 && _size.height == -1))
|
||||
_size = CGSizeMake(_image.width, _image.height);
|
||||
|
||||
|
||||
[[CPNotificationCenter defaultCenter]
|
||||
postNotificationName:CPImageDidLoadNotification
|
||||
object:self];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(imageDidLoad:)])
|
||||
[_delegate imageDidLoad:self];
|
||||
|
||||
|
||||
+35
-16
@@ -20,8 +20,10 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
import "CPImage.j"
|
||||
import <Foundation/CPNotificationCenter.j>
|
||||
|
||||
import "CPControl.j"
|
||||
import "CPImage.j"
|
||||
import "CPShadowView.j"
|
||||
|
||||
#include "Platform/Platform.h"
|
||||
@@ -110,20 +112,35 @@ var LEFT_SHADOW_INSET = 3.0,
|
||||
if (_image == anImage)
|
||||
return;
|
||||
|
||||
var center = [CPNotificationCenter defaultCenter];
|
||||
|
||||
if (_image)
|
||||
[center removeObserver:self name:CPImageDidLoadNotification object:_image];
|
||||
|
||||
_image = anImage;
|
||||
|
||||
_DOMImageElement.src = [anImage filename];
|
||||
|
||||
var size = [_image size];
|
||||
|
||||
if (_imageScaling == CPScaleNone && _image)
|
||||
if (size && size.width == -1 && size.height == -1)
|
||||
{
|
||||
var size = [_image size];
|
||||
[center addObserver:self selector:@selector(imageDidLoad:) name:CPImageDidLoadNotification object:_image];
|
||||
|
||||
_DOMImageElement.width = 0;
|
||||
_DOMImageElement.height = 0;
|
||||
|
||||
_DOMImageElement.width = ROUND(size.width);
|
||||
_DOMImageElement.height = ROUND(size.height);
|
||||
[_shadowView setHidden:YES];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
[self hideOrDisplayContents];
|
||||
[self tile];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)imageDidLoad:(CPNotification)aNotification
|
||||
{
|
||||
[self hideOrDisplayContents];
|
||||
|
||||
[self tile];
|
||||
}
|
||||
|
||||
@@ -181,13 +198,6 @@ var LEFT_SHADOW_INSET = 3.0,
|
||||
{
|
||||
CPDOMDisplayServerSetStyleLeftTop(_DOMImageElement, NULL, 0.0, 0.0);
|
||||
}
|
||||
else if (_imageScaling == CPScaleNone && _image)
|
||||
{
|
||||
var size = [_image size];
|
||||
|
||||
_DOMImageElement.width = ROUND(size.width);
|
||||
_DOMImageElement.height = ROUND(size.height);
|
||||
}
|
||||
|
||||
[self tile];
|
||||
}
|
||||
@@ -240,7 +250,7 @@ var LEFT_SHADOW_INSET = 3.0,
|
||||
{
|
||||
if (!_image)
|
||||
return;
|
||||
|
||||
|
||||
var bounds = [self bounds],
|
||||
x = 0.0,
|
||||
y = 0.0,
|
||||
@@ -260,6 +270,9 @@ var LEFT_SHADOW_INSET = 3.0,
|
||||
{
|
||||
var size = [_image size];
|
||||
|
||||
if (size.width == -1 && size.height == -1)
|
||||
return;
|
||||
|
||||
if (_imageScaling == CPScaleProportionally)
|
||||
{
|
||||
// The max size it can be is size.width x size.height, so only
|
||||
@@ -289,6 +302,12 @@ var LEFT_SHADOW_INSET = 3.0,
|
||||
height = size.height;
|
||||
}
|
||||
|
||||
if (_imageScaling == CPScaleNone)
|
||||
{
|
||||
_DOMImageElement.width = ROUND(size.width);
|
||||
_DOMImageElement.height = ROUND(size.height);
|
||||
}
|
||||
|
||||
var x = (boundsWidth - width) / 2.0,
|
||||
y = (boundsHeight - height) / 2.0;
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ var CPResponderNextResponderKey = @"CPResponderNextResponderKey";
|
||||
*/
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [self init];
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
_nextResponder = [aCoder decodeObjectForKey:CPResponderNextResponderKey];
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
|
||||
import "CPControl.j"
|
||||
|
||||
var CPSliderHorizontalKnobImage = nil
|
||||
var CPSliderHorizontalKnobImage = nil,
|
||||
CPSliderHorizontalBarLeftImage = nil,
|
||||
CPSliderHorizontalBarRightImage = nil,
|
||||
CPSliderHorizontalBarCenterImage = nil;
|
||||
|
||||
@@ -0,0 +1,512 @@
|
||||
/*
|
||||
* CPSplitView.j
|
||||
* AppKit
|
||||
*
|
||||
* Created by Thomas Robinson.
|
||||
* 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 "CPImage.j"
|
||||
import "CPView.j"
|
||||
|
||||
#include "CoreGraphics/CGGeometry.h"
|
||||
#include "Platform/Platform.h"
|
||||
#include "Platform/DOM/CPDOMDisplayServer.h"
|
||||
|
||||
|
||||
CPSplitViewDidResizeSubviewsNotification = @"CPSplitViewDidResizeSubviewsNotification";
|
||||
CPSplitViewWillResizeSubviewsNotification = @"CPSplitViewWillResizeSubviewsNotification";
|
||||
|
||||
var CPSplitViewHorizontalImage = nil,
|
||||
CPSplitViewVerticalImage = nil;
|
||||
|
||||
@implementation CPSplitView : CPView
|
||||
{
|
||||
id _delegate;
|
||||
BOOL _isVertical;
|
||||
BOOL _isPaneSplitter;
|
||||
|
||||
int _currentDivider;
|
||||
float _initialOffset;
|
||||
|
||||
CPString _originComponent;
|
||||
CPString _sizeComponent;
|
||||
|
||||
CPArray _DOMDividerElements;
|
||||
CPString _dividerImagePath;
|
||||
int _drawingDivider;
|
||||
}
|
||||
|
||||
/*
|
||||
@ignore
|
||||
*/
|
||||
//+ (void)initialize
|
||||
//{
|
||||
// if (self != [CPSplitView class])
|
||||
// return;
|
||||
//
|
||||
// var bundle = [CPBundle bundleForClass:self];
|
||||
//
|
||||
// CPSplitViewHorizontalImage = [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPSplitView/CPSplitViewHorizontal.png"] size:CPSizeMake(5.0, 10.0)];
|
||||
// CPSplitViewVerticalImage = [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPSplitView/CPSplitViewVertical.png"] size:CPSizeMake(10.0, 5.0)];
|
||||
//}
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame
|
||||
{
|
||||
if (self = [super initWithFrame:aFrame])
|
||||
{
|
||||
_currentDivider = CPNotFound;
|
||||
|
||||
_DOMDividerElements = [];
|
||||
|
||||
[self _setVertical:YES];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (float)dividerThickness
|
||||
{
|
||||
return _isPaneSplitter ? 1.0 : 10.0;
|
||||
}
|
||||
|
||||
- (BOOL)isVertical
|
||||
{
|
||||
return _isVertical;
|
||||
}
|
||||
|
||||
- (void)setVertical:(BOOL)flag
|
||||
{
|
||||
[self _setVertical:flag];
|
||||
|
||||
[self adjustSubviews];
|
||||
}
|
||||
|
||||
- (void)_setVertical:(BOOL)flag
|
||||
{
|
||||
_isVertical = flag;
|
||||
|
||||
_originComponent = [self isVertical] ? "x" : "y";
|
||||
_sizeComponent = [self isVertical] ? "width" : "height";
|
||||
_dividerImagePath = [self isVertical] ? [CPSplitViewVerticalImage filename] : [CPSplitViewHorizontalImage filename];
|
||||
}
|
||||
|
||||
- (BOOL)isPaneSplitter
|
||||
{
|
||||
return _isPaneSplitter;
|
||||
}
|
||||
|
||||
- (void)setIsPaneSplitter:(BOOL)shouldBePaneSplitter
|
||||
{
|
||||
if (_isPaneSplitter == shouldBePaneSplitter)
|
||||
return;
|
||||
|
||||
_isPaneSplitter = shouldBePaneSplitter;
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
_DOMDividerElements = [];
|
||||
#endif
|
||||
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
- (void)didAddSubview:(CPView)subview
|
||||
{
|
||||
[self adjustSubviews];
|
||||
}
|
||||
|
||||
- (void)adjustSubviews
|
||||
{
|
||||
var frame = [self frame],
|
||||
dividerThickness = [self dividerThickness];
|
||||
|
||||
[self _postNotificationWillResize];
|
||||
|
||||
var eachSize = ROUND((frame.size[_sizeComponent] - dividerThickness * (_subviews.length - 1)) / _subviews.length),
|
||||
index = 0,
|
||||
count = _subviews.length;
|
||||
|
||||
if ([self isVertical])
|
||||
for (; index < count; ++index)
|
||||
[_subviews[index] setFrame:CGRectMake(ROUND((eachSize + dividerThickness) * index), 0, eachSize, frame.size.height)];
|
||||
else
|
||||
for (; index < count; ++index)
|
||||
[_subviews[index] setFrame:CGRectMake(0, ROUND((eachSize + dividerThickness) * index), frame.size.width, eachSize)];
|
||||
|
||||
[self setNeedsDisplay:YES];
|
||||
|
||||
[self _postNotificationDidResize];
|
||||
}
|
||||
|
||||
- (BOOL)isSubviewCollapsed:(CPView)subview
|
||||
{
|
||||
return [subview frame].size[_sizeComponent] < 1 ? YES : NO;
|
||||
}
|
||||
|
||||
- (CGRect)rectOfDividerAtIndex:(int)aDivider
|
||||
{
|
||||
var frame = [_subviews[aDivider] frame],
|
||||
rect = CGRectMakeZero();
|
||||
|
||||
rect.size = [self frame].size;
|
||||
|
||||
rect.size[_sizeComponent] = [self dividerThickness];
|
||||
rect.origin[_originComponent] = frame.origin[_originComponent] + frame.size[_sizeComponent];
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
- (CGRect)effectiveRectOfDividerAtIndex:(int)aDivider
|
||||
{
|
||||
var realRect = [self rectOfDividerAtIndex:aDivider];
|
||||
|
||||
var padding = 2;
|
||||
|
||||
realRect.size[_sizeComponent] += padding * 2;
|
||||
realRect.origin[_originComponent] -= padding;
|
||||
|
||||
return realRect;
|
||||
}
|
||||
|
||||
- (void)drawRect:(CGRect)rect
|
||||
{
|
||||
var count = [_subviews count] - 1;
|
||||
|
||||
while (count--)
|
||||
[self drawDividerInRect:[self rectOfDividerAtIndex:count]];
|
||||
}
|
||||
|
||||
- (void)drawDividerInRect:(CGRect)aRect
|
||||
{
|
||||
#if PLATFORM(DOM)
|
||||
if (!_DOMDividerElements[_drawingDivider])
|
||||
{
|
||||
_DOMDividerElements[_drawingDivider] = document.createElement("div");
|
||||
_DOMDividerElements[_drawingDivider].style.cursor = "move";
|
||||
_DOMDividerElements[_drawingDivider].style.position = "absolute";
|
||||
_DOMDividerElements[_drawingDivider].style.backgroundRepeat = "repeat";
|
||||
|
||||
CPDOMDisplayServerAppendChild(_DOMElement, _DOMDividerElements[_drawingDivider]);
|
||||
|
||||
if (_isPaneSplitter)
|
||||
{
|
||||
_DOMDividerElements[_drawingDivider].style.backgroundColor = "#A5A5A5";
|
||||
_DOMDividerElements[_drawingDivider].style.backgroundImage = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
_DOMDividerElements[_drawingDivider].style.backgroundColor = "";
|
||||
_DOMDividerElements[_drawingDivider].style.backgroundImage = "url('"+_dividerImagePath+"')";
|
||||
}
|
||||
}
|
||||
|
||||
CPDOMDisplayServerSetStyleLeftTop(_DOMDividerElements[_drawingDivider], NULL, _CGRectGetMinX(aRect), _CGRectGetMinY(aRect));
|
||||
CPDOMDisplayServerSetStyleSize(_DOMDividerElements[_drawingDivider], _CGRectGetWidth(aRect), _CGRectGetHeight(aRect));
|
||||
#endif
|
||||
}
|
||||
|
||||
- (BOOL)cursorAtPoint:(CPPoint)aPoint hitDividerAtIndex:(int)anIndex
|
||||
{
|
||||
var frame = [_subviews[anIndex] frame],
|
||||
startPosition = frame.origin[_originComponent] + frame.size[_sizeComponent],
|
||||
effectiveRect = [self effectiveRectOfDividerAtIndex:anIndex],
|
||||
additionalRect = null;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:)])
|
||||
effectiveRect = [_delegate splitView:self effectiveRect:effectiveRect forDrawnRect:effectiveRect ofDividerAtIndex:anIndex];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(splitView:additionalEffectiveRectOfDividerAtIndex:)])
|
||||
additionalRect = [_delegate splitView:self additionalEffectiveRectOfDividerAtIndex:anIndex];
|
||||
|
||||
return CGRectContainsPoint(effectiveRect, aPoint) || (additionalRect && CGRectContainsPoint(additionalRect, aPoint));
|
||||
}
|
||||
|
||||
- (CPView)hitTest:(CGPoint)aPoint
|
||||
{
|
||||
if ([self isHidden] || ![self hitTests] || !CGRectContainsPoint([self frame], aPoint))
|
||||
return nil;
|
||||
|
||||
var point = [self convertPoint:aPoint fromView:[self superview]];
|
||||
|
||||
var count = [_subviews count] - 1;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
if ([self cursorAtPoint:point hitDividerAtIndex:i])
|
||||
return self;
|
||||
}
|
||||
|
||||
return [super hitTest:aPoint];
|
||||
}
|
||||
|
||||
/*
|
||||
Tracks the divider.
|
||||
@param anEvent the input event
|
||||
*/
|
||||
- (void)trackDivider:(CPEvent)anEvent
|
||||
{
|
||||
var type = [anEvent type];
|
||||
|
||||
if (type == CPLeftMouseUp)
|
||||
{
|
||||
if (_currentDivider != CPNotFound)
|
||||
{
|
||||
_currentDivider = CPNotFound;
|
||||
[self _postNotificationDidResize];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == CPLeftMouseDown)
|
||||
{
|
||||
var point = [self convertPoint:[anEvent locationInWindow] fromView:nil];
|
||||
|
||||
_currentDivider = CPNotFound;
|
||||
var count = [_subviews count] - 1;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var frame = [_subviews[i] frame],
|
||||
startPosition = frame.origin[_originComponent] + frame.size[_sizeComponent];
|
||||
|
||||
if ([self cursorAtPoint:point hitDividerAtIndex:i])
|
||||
{
|
||||
if ([anEvent clickCount] == 2 &&
|
||||
[_delegate respondsToSelector:@selector(splitView:canCollapseSubview:)] &&
|
||||
[_delegate respondsToSelector:@selector(splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:)])
|
||||
{
|
||||
var minPosition = [self minPossiblePositionOfDividerAtIndex:i],
|
||||
maxPosition = [self maxPossiblePositionOfDividerAtIndex:i];
|
||||
|
||||
if ([_delegate splitView:self canCollapseSubview:_subviews[i]] && [_delegate splitView:self shouldCollapseSubview:_subviews[i] forDoubleClickOnDividerAtIndex:i])
|
||||
{
|
||||
if ([self isSubviewCollapsed:_subviews[i]])
|
||||
[self setPosition:(minPosition + (maxPosition - minPosition) / 2) ofDividerAtIndex:i];
|
||||
else
|
||||
[self setPosition:minPosition ofDividerAtIndex:i];
|
||||
}
|
||||
else if ([_delegate splitView:self canCollapseSubview:_subviews[i+1]] && [_delegate splitView:self shouldCollapseSubview:_subviews[i+1] forDoubleClickOnDividerAtIndex:i])
|
||||
{
|
||||
if ([self isSubviewCollapsed:_subviews[i+1]])
|
||||
[self setPosition:(minPosition + (maxPosition - minPosition) / 2) ofDividerAtIndex:i];
|
||||
else
|
||||
[self setPosition:maxPosition ofDividerAtIndex:i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentDivider = i;
|
||||
_initialOffset = startPosition - point[_originComponent];
|
||||
|
||||
[self _postNotificationWillResize];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (type == CPLeftMouseDragged && _currentDivider != CPNotFound)
|
||||
{
|
||||
var point = [self convertPoint:[anEvent locationInWindow] fromView:nil];
|
||||
|
||||
[self setPosition:(point[_originComponent] + _initialOffset) ofDividerAtIndex:_currentDivider];
|
||||
}
|
||||
|
||||
[CPApp setTarget:self selector:@selector(trackDivider:) forNextEventMatchingMask:CPLeftMouseDraggedMask | CPLeftMouseUpMask untilDate:nil inMode:nil dequeue:YES];
|
||||
}
|
||||
|
||||
- (void)mouseDown:(CPEvent)anEvent
|
||||
{
|
||||
[self trackDivider:anEvent];
|
||||
}
|
||||
|
||||
- (float)maxPossiblePositionOfDividerAtIndex:(int)dividerIndex
|
||||
{
|
||||
var frame = [_subviews[dividerIndex + 1] frame];
|
||||
|
||||
if (dividerIndex + 1 < [_subviews count] - 1)
|
||||
return frame.origin[_originComponent] + frame.size[_sizeComponent] - [self dividerThickness];
|
||||
else
|
||||
return [self frame].size[_sizeComponent] - [self dividerThickness];
|
||||
}
|
||||
|
||||
- (float)minPossiblePositionOfDividerAtIndex:(int)dividerIndex
|
||||
{
|
||||
var frame = [_subviews[dividerIndex - 1] frame];
|
||||
|
||||
if (dividerIndex > 0)
|
||||
return frame.origin[_originComponent] + frame.size[_sizeComponent] + [self dividerThickness];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void)setPosition:(float)position ofDividerAtIndex:(int)dividerIndex
|
||||
{
|
||||
// not sure where this should override other positions?
|
||||
if ([_delegate respondsToSelector:@selector(splitView:constrainSplitPosition:ofSubviewAt:)])
|
||||
position = [_delegate splitView:self constrainSplitPosition:position ofSubviewAt:dividerIndex];
|
||||
|
||||
var proposedMax = [self maxPossiblePositionOfDividerAtIndex:dividerIndex],
|
||||
proposedMin = [self minPossiblePositionOfDividerAtIndex:dividerIndex],
|
||||
actualMax = proposedMax,
|
||||
actualMin = proposedMin;
|
||||
|
||||
if([_delegate respondsToSelector:@selector(splitView:constrainMinCoordinate:ofSubviewAt:)])
|
||||
actualMin = [_delegate splitView:self constrainMinCoordinate:proposedMin ofSubviewAt:dividerIndex];
|
||||
|
||||
if([_delegate respondsToSelector:@selector(splitView:constrainMaxCoordinate:ofSubviewAt:)])
|
||||
actualMax = [_delegate splitView:self constrainMaxCoordinate:proposedMax ofSubviewAt:dividerIndex];
|
||||
|
||||
var frame = [self frame],
|
||||
viewA = _subviews[dividerIndex],
|
||||
frameA = [viewA frame],
|
||||
viewB = _subviews[dividerIndex+1],
|
||||
frameB = [viewB frame];
|
||||
|
||||
var realPosition = MAX(MIN(position, actualMax), actualMin);
|
||||
|
||||
if (position < proposedMin + (actualMin - proposedMin) / 2)
|
||||
if ([_delegate respondsToSelector:@selector(splitView:canCollapseSubview:)])
|
||||
if ([_delegate splitView:self canCollapseSubview:viewA])
|
||||
realPosition = proposedMin;
|
||||
|
||||
frameA.size[_sizeComponent] = realPosition - frameA.origin[_originComponent];
|
||||
[_subviews[dividerIndex] setFrame:frameA];
|
||||
|
||||
frameB.size[_sizeComponent] = frameB.origin[_originComponent] + frameB.size[_sizeComponent] - realPosition - [self dividerThickness];
|
||||
frameB.origin[_originComponent] = realPosition + [self dividerThickness];
|
||||
[_subviews[dividerIndex+1] setFrame:frameB];
|
||||
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
- (void)resizeSubviewsWithOldSize:(CPSize)oldSize
|
||||
{
|
||||
if ([_delegate respondsToSelector:@selector(splitView:resizeSubviewsWithOldSize:)])
|
||||
{
|
||||
[_delegate splitView:self resizeSubviewsWithOldSize:oldSize];
|
||||
return;
|
||||
}
|
||||
|
||||
[self _postNotificationWillResize];
|
||||
|
||||
var frame = [self frame];
|
||||
|
||||
var index = 0,
|
||||
count = [_subviews count],
|
||||
dividerThickness = [self dividerThickness];
|
||||
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
var view = _subviews[index],
|
||||
newFrame = CGRectCreateCopy(frame);
|
||||
|
||||
if (index + 1 == count)
|
||||
newFrame.size[_sizeComponent] = frame.size[_sizeComponent] - newFrame.origin[_originComponent];
|
||||
else
|
||||
newFrame.size[_sizeComponent] = frame.size[_sizeComponent] * ([view frame].size[_sizeComponent] / oldSize[_sizeComponent]);
|
||||
|
||||
frame.origin[_originComponent] += newFrame.size[_sizeComponent] + dividerThickness;
|
||||
|
||||
[view setFrame:newFrame];
|
||||
}
|
||||
|
||||
[self setNeedsDisplay:YES];
|
||||
|
||||
[self _postNotificationDidResize];
|
||||
}
|
||||
|
||||
- (void)setDelegate:(id)delegate
|
||||
{
|
||||
if ([_delegate respondsToSelector:@selector(splitViewDidResizeSubviews:)])
|
||||
[[CPNotificationCenter defaultCenter] removeObserver:_delegate name:CPSplitViewDidResizeSubviewsNotification object:self];
|
||||
if ([_delegate respondsToSelector:@selector(splitViewWillResizeSubviews:)])
|
||||
[[CPNotificationCenter defaultCenter] removeObserver:_delegate name:CPSplitViewWillResizeSubviewsNotification object:self];
|
||||
|
||||
_delegate = delegate;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(splitViewDidResizeSubviews:)])
|
||||
[[CPNotificationCenter defaultCenter] addObserver:_delegate
|
||||
selector:@selector(splitViewDidResizeSubviews:)
|
||||
name:CPSplitViewDidResizeSubviewsNotification
|
||||
object:self];
|
||||
if ([_delegate respondsToSelector:@selector(splitViewWillResizeSubviews:)])
|
||||
[[CPNotificationCenter defaultCenter] addObserver:_delegate
|
||||
selector:@selector(splitViewWillResizeSubviews:)
|
||||
name:CPSplitViewWillResizeSubviewsNotification
|
||||
object:self];
|
||||
}
|
||||
|
||||
- (void)_postNotificationWillResize
|
||||
{
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPSplitViewWillResizeSubviewsNotification object:self];
|
||||
}
|
||||
|
||||
- (void)_postNotificationDidResize
|
||||
{
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPSplitViewDidResizeSubviewsNotification object:self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CPSplitViewDelegateKey = "CPSplitViewDelegateKey",
|
||||
CPSplitViewIsVerticalKey = "CPSplitViewIsVerticalKey",
|
||||
CPSplitViewIsPaneSplitterKey = "CPSplitViewIsPaneSplitterKey";
|
||||
|
||||
@implementation CPSplitView (CPCoding)
|
||||
|
||||
/*
|
||||
Initializes the split view by unarchiving data from <code>aCoder</code>.
|
||||
@param aCoder the coder containing the archived <objj>CPSplitView</objj>.
|
||||
*/
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super initWithCoder:aCoder];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_currentDivider = CPNotFound;
|
||||
|
||||
_DOMDividerElements = [];
|
||||
|
||||
_delegate = [aCoder decodeObjectForKey:CPSplitViewDelegateKey];;
|
||||
|
||||
_isPaneSplitter = [aCoder decodeBoolForKey:CPSplitViewIsPaneSplitterKey];
|
||||
[self _setVertical:[aCoder decodeBoolForKey:CPSplitViewIsVerticalKey]];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/*
|
||||
Archives this split view into the provided coder.
|
||||
@param aCoder the coder to which the button's instance data will be written.
|
||||
*/
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
[super encodeWithCoder:aCoder];
|
||||
|
||||
[aCoder encodeConditionalObject:_delegate forKey:CPSplitViewDelegateKey];
|
||||
|
||||
[aCoder encodeBool:_isVertical forKey:CPSplitViewIsVerticalKey];
|
||||
[aCoder encodeBool:_isPaneSplitter forKey:CPSplitViewIsPaneSplitterKey];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
// FIXME: once +initialize is fixed for superclasses, remove this and uncomment +initialize
|
||||
var bundle = [CPBundle bundleForClass:CPSplitView];
|
||||
CPSplitViewHorizontalImage = [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPSplitView/CPSplitViewHorizontal.png"] size:CPSizeMake(5.0, 10.0)];
|
||||
CPSplitViewVerticalImage = [[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPSplitView/CPSplitViewVertical.png"] size:CPSizeMake(10.0, 5.0)];
|
||||
+62
-25
@@ -105,6 +105,7 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
BOOL _isSelectable;
|
||||
|
||||
id _value;
|
||||
id _placeholderString;
|
||||
|
||||
CPLineBreakMode _lineBreakMode;
|
||||
#if PLATFORM(DOM)
|
||||
@@ -140,11 +141,12 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
- (id)initWithFrame:(CGRect)aFrame
|
||||
{
|
||||
self = [super initWithFrame:aFrame];
|
||||
|
||||
|
||||
if (self)
|
||||
{
|
||||
_value = @"";
|
||||
|
||||
_placeholderString = @"";
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
_DOMTextElement = document.createElement("div");
|
||||
_DOMTextElement.style.position = "absolute";
|
||||
@@ -167,8 +169,7 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
// Setting the Bezel Style
|
||||
/*
|
||||
Sets whether the textfield will have a bezeled border.
|
||||
@param shouldBeBezeled <code>YES</code> means the textfield
|
||||
will draw a bezeled border
|
||||
@param shouldBeBezeled <code>YES</code> means the textfield will draw a bezeled border
|
||||
*/
|
||||
- (void)setBezeled:(BOOL)shouldBeBezeled
|
||||
{
|
||||
@@ -181,8 +182,7 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns <code>YES</code> if the textfield draws a
|
||||
bezeled border.
|
||||
Returns <code>YES</code> if the textfield draws a bezeled border.
|
||||
*/
|
||||
- (BOOL)isBezeled
|
||||
{
|
||||
@@ -213,8 +213,7 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
|
||||
/*
|
||||
Sets whether the textfield will have a border drawn.
|
||||
@param shouldBeBordered <code>YES</code> makes the
|
||||
textfield draw a border
|
||||
@param shouldBeBordered <code>YES</code> makes the textfield draw a border
|
||||
*/
|
||||
- (void)setBordered:(BOOL)shouldBeBordered
|
||||
{
|
||||
@@ -227,8 +226,7 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns <code>YES</code> if the textfield has
|
||||
a border.
|
||||
Returns <code>YES</code> if the textfield has a border.
|
||||
*/
|
||||
- (BOOL)isBordered
|
||||
{
|
||||
@@ -264,11 +262,13 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
[self setBackgroundColor:nil];
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
- (BOOL)acceptsFirstResponder
|
||||
{
|
||||
return _isEditable;
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
- (BOOL)becomeFirstResponder
|
||||
{
|
||||
var string = [self stringValue];
|
||||
@@ -283,12 +283,12 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
element.style.font = _DOMElement.style.font;
|
||||
element.style.zIndex = 1000;
|
||||
element.style.width = CGRectGetWidth([self bounds]) - 3.0 + "px";
|
||||
// element.style.left = _DOMTextElement.style.left;
|
||||
// element.style.top = _DOMTextElement.style.top;
|
||||
//element.style.left = _DOMTextElement.style.left;
|
||||
//element.style.top = _DOMTextElement.style.top;
|
||||
|
||||
_DOMElement.appendChild(element);
|
||||
window.setTimeout(function() { element.focus(); }, 0.0);
|
||||
// element.onblur = function() { objj_debug_print_backtrace(); }
|
||||
//element.onblur = function() { objj_debug_print_backtrace(); }
|
||||
//element.select();
|
||||
|
||||
element.onkeypress = function(aDOMEvent)
|
||||
@@ -309,12 +309,17 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
}
|
||||
};
|
||||
|
||||
// If current value is the placeholder value, remove it to allow user to update.
|
||||
if ([_value lowercaseString] == [[self placeholderString] lowercaseString])
|
||||
[self setStringValue:@""];
|
||||
|
||||
[[CPDOMWindowBridge sharedDOMWindowBridge] _propagateCurrentDOMEvent:YES];
|
||||
#endif
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
- (BOOL)resignFirstResponder
|
||||
{
|
||||
#if PLATFORM(DOM)
|
||||
@@ -322,19 +327,25 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
|
||||
_DOMElement.removeChild(element);
|
||||
[self setStringValue:element.value];
|
||||
#endif
|
||||
|
||||
// If textfield has no value, then display the placeholderValue
|
||||
if (!_value)
|
||||
[self setStringValue:[self placeholderString]];
|
||||
|
||||
#endif
|
||||
return YES;
|
||||
}
|
||||
|
||||
/*
|
||||
Sets whether or not the receiver text field can be edited
|
||||
*/
|
||||
- (void)setEditable:(BOOL)shouldBeEditable
|
||||
{
|
||||
_isEditable = shouldBeEditable;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns <code>YES</code> if the textfield is currently
|
||||
editable by the user.
|
||||
Returns <code>YES</code> if the textfield is currently editable by the user.
|
||||
*/
|
||||
- (BOOL)isEditable
|
||||
{
|
||||
@@ -351,8 +362,7 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns <code>YES</code> if the field's text is
|
||||
selectable by the user.
|
||||
Returns <code>YES</code> if the field's text is selectable by the user.
|
||||
*/
|
||||
- (BOOL)isSelectable
|
||||
{
|
||||
@@ -360,8 +370,7 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
}
|
||||
|
||||
/*
|
||||
Sets whether the field's text is selectable
|
||||
by the user.
|
||||
Sets whether the field's text is selectable by the user.
|
||||
@param aFlag <code>YES</code> makes the text selectable
|
||||
*/
|
||||
- (void)setSelectable:(BOOL)aFlag
|
||||
@@ -432,7 +441,7 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
return [[self class] _inputElement].value;
|
||||
#endif
|
||||
|
||||
return [self stringValue];
|
||||
return [super stringValue];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -457,6 +466,23 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
Returns the receiver's placeholder string
|
||||
*/
|
||||
- (CPString)placeholderString
|
||||
{
|
||||
return _placeholderString;
|
||||
}
|
||||
|
||||
/*
|
||||
Sets a placeholder string for the receiver. The placeholder is displayed until editing begins,
|
||||
and after editing ends, if the text field has an empty string value
|
||||
*/
|
||||
-(void)setPlaceholderString:(CPString)aStringValue
|
||||
{
|
||||
_placeholderString = aStringValue;
|
||||
}
|
||||
|
||||
/*
|
||||
Adjusts the text field's size in the application.
|
||||
*/
|
||||
@@ -469,6 +495,19 @@ var _CPTextFieldSquareBezelColor = nil;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
Select all the text in the CPTextField.
|
||||
*/
|
||||
- (void)selectText:(id)sender
|
||||
{
|
||||
#if PLATFORM(DOM)
|
||||
var element = [[self class] _inputElement];
|
||||
|
||||
if (element.parentNode == _DOMElement && ([self isEditable] || [self isSelectable]))
|
||||
element.select();
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CPTextFieldIsSelectableKey = @"CPTextFieldIsSelectableKey",
|
||||
@@ -520,10 +559,8 @@ var CPTextFieldIsSelectableKey = @"CPTextFieldIsSelectableKey",
|
||||
}
|
||||
|
||||
/*
|
||||
Encodes the data of this textfield into the
|
||||
provided coder.
|
||||
@param aCoder the coder into which the data
|
||||
will be written
|
||||
Encodes the data of this textfield into the provided coder.
|
||||
@param aCoder the coder into which the data will be written
|
||||
*/
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
|
||||
+29
-4
@@ -122,6 +122,8 @@ var DOMElementPrototype = nil,
|
||||
|
||||
CPGraphicsContext _graphicsContext;
|
||||
|
||||
int _tag;
|
||||
|
||||
CGRect _frame;
|
||||
CGRect _bounds;
|
||||
CGAffineTransform _boundsTransform;
|
||||
@@ -193,6 +195,11 @@ var DOMElementPrototype = nil,
|
||||
_CPViewNotificationCenter = [CPNotificationCenter defaultCenter];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithFrame:CGRectMakeZero()];
|
||||
}
|
||||
|
||||
/*
|
||||
Initializes the receiver for usage with the specified bounding rectangle
|
||||
@return the initialized view
|
||||
@@ -208,6 +215,8 @@ var DOMElementPrototype = nil,
|
||||
|
||||
_subviews = [];
|
||||
|
||||
_tag = -1;
|
||||
|
||||
_frame = _CGRectMakeCopy(aFrame);
|
||||
_bounds = _CGRectMake(0.0, 0.0, width, height);
|
||||
|
||||
@@ -398,7 +407,7 @@ var DOMElementPrototype = nil,
|
||||
|
||||
[aSubview removeFromSuperview];
|
||||
|
||||
[aView _insertSubview:aView atIndex:index];
|
||||
[self _insertSubview:aView atIndex:index];
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
@@ -498,6 +507,11 @@ var DOMElementPrototype = nil,
|
||||
return enclosingMenuItem;*/
|
||||
}
|
||||
|
||||
- (int)tag
|
||||
{
|
||||
return _tag;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns whether the view is flipped.
|
||||
@return <code>YES</code> if the view is flipped. <code>NO</code>, otherwise.
|
||||
@@ -1699,6 +1713,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
CPViewOpacityKey = @"CPViewOpacityKey",
|
||||
CPViewSubviewsKey = @"CPViewSubviewsKey",
|
||||
CPViewSuperviewKey = @"CPViewSuperviewKey",
|
||||
CPViewTagKey = @"CPViewTagKey",
|
||||
CPViewWindowKey = @"CPViewWindowKey";
|
||||
|
||||
@implementation CPView (CPCoding)
|
||||
@@ -1718,13 +1733,19 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
_DOMElement = DOMElementPrototype.cloneNode(false);
|
||||
#endif
|
||||
|
||||
// Also decode these "early".
|
||||
_frame = [aCoder decodeRectForKey:CPViewFrameKey];
|
||||
_bounds = [aCoder decodeRectForKey:CPViewBoundsKey];
|
||||
|
||||
self = [super initWithCoder:aCoder];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_frame = [aCoder decodeRectForKey:CPViewFrameKey];
|
||||
_bounds = [aCoder decodeRectForKey:CPViewBoundsKey];
|
||||
|
||||
_tag = -1;
|
||||
|
||||
if ([aCoder containsValueForKey:CPViewTagKey])
|
||||
_tag = [aCoder decodeIntForKey:CPViewTagKey];
|
||||
|
||||
_window = [aCoder decodeObjectForKey:CPViewWindowKey];
|
||||
_subviews = [aCoder decodeObjectForKey:CPViewSubviewsKey];
|
||||
_superview = [aCoder decodeObjectForKey:CPViewSuperviewKey];
|
||||
@@ -1750,6 +1771,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
CPDOMDisplayServerAppendChild(_DOMElement, _subviews[index]._DOMElement);
|
||||
//_subviews[index]._superview = self;
|
||||
}
|
||||
#endif
|
||||
_displayHash = [self hash];
|
||||
@@ -1768,6 +1790,9 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
{
|
||||
[super encodeWithCoder:aCoder];
|
||||
|
||||
if (_tag != -1)
|
||||
[aCoder encodeInt:_tag forKey:CPViewTagKey];
|
||||
|
||||
[aCoder encodeRect:_frame forKey:CPViewFrameKey];
|
||||
[aCoder encodeRect:_bounds forKey:CPViewBoundsKey];
|
||||
|
||||
|
||||
+10
-3
@@ -269,7 +269,9 @@ var CPWindowSaveImage = nil,
|
||||
CPURL _representedURL;
|
||||
|
||||
// Bridge Support
|
||||
#if PLATFORM(DOM)
|
||||
DOMElement _DOMElement;
|
||||
#endif
|
||||
CPDOMWindowBridge _bridge;
|
||||
unsigned _autoresizingMask;
|
||||
|
||||
@@ -364,7 +366,8 @@ CPTexturedBackgroundWindowMask
|
||||
[self setContentView:[[CPView alloc] initWithFrame:CGRectMakeZero()]];
|
||||
|
||||
_firstResponder = self;
|
||||
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
_DOMElement = document.createElement("div");
|
||||
|
||||
_DOMElement.style.position = "absolute";
|
||||
@@ -375,7 +378,8 @@ CPTexturedBackgroundWindowMask
|
||||
CPDOMDisplayServerSetStyleSize(_DOMElement, 1, 1);
|
||||
|
||||
CPDOMDisplayServerAppendChild(_DOMElement, _windowView._DOMElement);
|
||||
|
||||
#endif
|
||||
|
||||
[self setBridge:aBridge];
|
||||
|
||||
[self setNextResponder:CPApp];
|
||||
@@ -854,12 +858,15 @@ CPTexturedBackgroundWindowMask
|
||||
[_shadowView setBackgroundColor:_CPWindowShadowColor];
|
||||
[_shadowView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
CPDOMDisplayServerInsertBefore(_DOMElement, _shadowView._DOMElement, _windowView._DOMElement);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#if PLATFORM(DOM)
|
||||
CPDOMDisplayServerRemoveChild(_DOMElement, _shadowView._DOMElement);
|
||||
|
||||
#endif
|
||||
_shadowView = nil;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-14
@@ -25,8 +25,10 @@ import <Foundation/CPURLConnection.j>
|
||||
import <Foundation/CPURLRequest.j>
|
||||
|
||||
import "CPCustomView.j"
|
||||
import "_CPCibCustomObject.j"
|
||||
import "_CPCibKeyedUnarchiver.j"
|
||||
import "_CPCibObjectData.j"
|
||||
|
||||
import "_CPCibWindowTemplate.j"
|
||||
|
||||
CPCibOwner = @"CPCibOwner",
|
||||
CPCibTopLevelObjects = @"CPCibTopLevelObjects";
|
||||
@@ -50,26 +52,16 @@ var CPCibObjectDataKey = @"CPCibObjectDataKey";
|
||||
|
||||
- (BOOL)instantiateCibWithExternalNameTable:(CPDictionary)anExternalNameTable
|
||||
{
|
||||
var unarchiver = [[CPKeyedUnarchiver alloc] initForReadingWithData:_data],
|
||||
var unarchiver = [[_CPCibKeyedUnarchiver alloc] initForReadingWithData:_data],
|
||||
objectData = [unarchiver decodeObjectForKey:CPCibObjectDataKey];
|
||||
|
||||
if (!objectData || ![objectData isKindOfClass:[_CPCibObjectData class]])
|
||||
return NO;
|
||||
|
||||
[objectData establishConnectionsWithExternalNameTable:anExternalNameTable];
|
||||
|
||||
var owner = [anExternalNameTable objectForKey:CPCibOwner],
|
||||
topLevelObjects = [anExternalNameTable objectForKey:CPCibTopLevelObjects];
|
||||
|
||||
var objects = unarchiver._objects,
|
||||
count = [objects count];
|
||||
|
||||
// The order in which objects receive the awakeFromCib message is not guaranteed.
|
||||
while (count--)
|
||||
{
|
||||
var object = objects[count];
|
||||
|
||||
if ([object isMemberOfClass:[CPView class]])
|
||||
return object;
|
||||
}
|
||||
/*
|
||||
// [objectData establishConnectionsWithOwner:owner topLevelObjects:topLevelObjects];
|
||||
// [objectData cibInstantiateWithOwner:owner topLevelObjects:topLevelObjects];
|
||||
|
||||
+41
-42
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* CPCustomView.j
|
||||
* _CPCibCustomView.j
|
||||
* AppKit
|
||||
*
|
||||
* Created by Francisco Tolmasky.
|
||||
@@ -22,76 +22,75 @@
|
||||
|
||||
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";
|
||||
|
||||
/* @ignore */
|
||||
|
||||
@implementation CPCustomView : CPView
|
||||
@implementation _CPCibCustomView : CPView
|
||||
{
|
||||
CPString _className;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CPCustomViewClassNameKey = @"CPCustomViewClassNameKey";
|
||||
var _CPCibCustomViewClassNameKey = @"_CPCibCustomViewClassNameKey";
|
||||
|
||||
@implementation CPCustomView (CPCoding)
|
||||
@implementation _CPCibCustomView (CPCoding)
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
_className = [aCoder decodeObjectForKey:CPCustomViewClassNameKey];
|
||||
self = [super initWithCoder:aCoder];
|
||||
|
||||
if (self)
|
||||
_className = [aCoder decodeObjectForKey:_CPCibCustomViewClassNameKey];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
[super encodeWithCoder:aCoder];
|
||||
|
||||
[aCoder encodeObject:_className forKey:_CPCibCustomViewClassNameKey];
|
||||
}
|
||||
|
||||
- (id)_cibInstantiate
|
||||
{
|
||||
var theClass = CPClassFromString(_className);
|
||||
|
||||
// If we don't have this class, just use CPView.
|
||||
// FIXME: Should we instead throw an exception?
|
||||
if (!theClass)
|
||||
theClass = [CPView class];
|
||||
|
||||
var frame = [aCoder decodeRectForKey:CPViewFrameKey];
|
||||
|
||||
// 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];
|
||||
{
|
||||
CPLog("Unknown class \"" + _className + "\" in cib file, using CPView instead.");
|
||||
|
||||
if (self)
|
||||
{
|
||||
[self _setWindow:[aCoder decodeObjectForKey:CPViewWindowKey]];
|
||||
theClass = [CPView class];
|
||||
}
|
||||
|
||||
var view = [[theClass alloc] initWithFrame:[self frame]];
|
||||
|
||||
if (view)
|
||||
{
|
||||
[view setBounds:[self bounds]];
|
||||
|
||||
// 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],
|
||||
var subviews = [self subviews],
|
||||
index = 0,
|
||||
count = subviews.length;
|
||||
|
||||
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];
|
||||
[view addSubview:subviews[index]];
|
||||
|
||||
[view setAutoresizingMask:[self autoresizingMask]];
|
||||
[view setAutoresizesSubviews:[self autoresizesSubviews]];
|
||||
|
||||
[self setBackgroundColor:[aCoder decodeObjectForKey:CPViewBackgroundColorKey]];
|
||||
[view setHitTests:[self hitTests]];
|
||||
[view setHidden:[self isHidden]];
|
||||
[view setAlphaValue:[self alphaValue]];
|
||||
|
||||
[view setBackgroundColor:[self backgroundColor]];
|
||||
}
|
||||
|
||||
return self;
|
||||
return view;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
|
||||
import <Foundation/CPObject.j>
|
||||
import <Foundation/CPKeyValueCoding.j>
|
||||
|
||||
|
||||
var _CPCibConnectorSourceKey = @"_CPCibConnectorSourceKey",
|
||||
_CPCibConnectorDestinationKey = @"_CPCibConnectorDestinationKey",
|
||||
_CPCibConnectorLabelKey = @"_CPCibConnectorLabelKey";
|
||||
|
||||
@implementation _CPCibConnector : CPObject
|
||||
{
|
||||
id _source;
|
||||
id _destination;
|
||||
CPString _label;
|
||||
}
|
||||
|
||||
- (void)replaceObject:(id)anObject withObject:(id)anotherObject
|
||||
{
|
||||
if (_source == anObject)
|
||||
_source = anotherObject;
|
||||
|
||||
else if (_destination == anObject)
|
||||
_destination = anotherObject;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPCibConnector (CPCoding)
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_source = [aCoder decodeObjectForKey:_CPCibConnectorSourceKey];
|
||||
_destination = [aCoder decodeObjectForKey:_CPCibConnectorDestinationKey];
|
||||
_label = [aCoder decodeObjectForKey:_CPCibConnectorLabelKey];
|
||||
|
||||
#if DEBUG
|
||||
CPLog("Connection from " + [_source description] + " to " + [_destination description] + " and label " + _label + " decoded.");
|
||||
#endif
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
[aCoder encodeObject:_source forKey:_CPCibConnectorSourceKey];
|
||||
[aCoder encodeObject:_destination forKey:_CPCibConnectorDestinationKey];
|
||||
[aCoder encodeObject:_label forKey:_CPCibConnectorLabelKey];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPCibControlConnector : _CPCibConnector
|
||||
{
|
||||
}
|
||||
|
||||
- (void)establishConnection
|
||||
{
|
||||
#if DEBUG
|
||||
CPLog('[' + [_source description] + " setTarget: " + [_destination description] + ']');
|
||||
CPLog('[' + [_source description] + " setAction: " + _label + ']');
|
||||
#endif
|
||||
|
||||
var selectorName = _label;
|
||||
|
||||
if (![selectorName hasSuffix:@":"])
|
||||
selectorName += ':';
|
||||
|
||||
var selector = CPSelectorFromString(selectorName);
|
||||
|
||||
if (!selector)
|
||||
[CPException
|
||||
raise:CPInvalidArgumentException
|
||||
reason:@"-[" + [self className] + ' ' + _cmd + @"] selector " + selectorName + @" does not exist."];
|
||||
|
||||
if ([_source respondsToSelector:@selector(setAction:)])
|
||||
objj_msgSend(_source, @selector(setAction:), selector);
|
||||
|
||||
else
|
||||
[CPException
|
||||
raise:CPInvalidArgumentException
|
||||
reason:@"-[" + [self className] + ' ' + _cmd + @"] " + [_source description] + " does not respond to setAction:"];
|
||||
|
||||
if ([_source respondsToSelector:@selector(setTarget:)])
|
||||
objj_msgSend(_source, @selector(setTarget:), _destination);
|
||||
|
||||
else
|
||||
[CPException
|
||||
raise:CPInvalidArgumentException
|
||||
reason:@"-[" + [self className] + ' ' + _cmd + @"] " + [_source description] + " does not respond to setTarget:"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPCibOutletConnector : _CPCibConnector
|
||||
{
|
||||
}
|
||||
|
||||
- (void)establishConnection
|
||||
{
|
||||
#if DEBUG
|
||||
CPLog([_source description] + " setValue: " + [_destination description] + " forKey: " + _label);
|
||||
#endif
|
||||
|
||||
[_source setValue:_destination forKey:_label];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
import <Foundation/CPObject.j>
|
||||
|
||||
|
||||
var _CPCibCustomObjectClassName = @"_CPCibCustomObjectClassName";
|
||||
|
||||
@implementation _CPCibCustomObject : CPObject
|
||||
{
|
||||
CPString _className;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPCibCustomObject (CPCoding)
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
_className = [aCoder decodeObjectForKey:_CPCibCustomObjectClassName];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
[aCoder encodeObject:_className forKey:_CPCibCustomObjectClassName];
|
||||
}
|
||||
|
||||
- (id)_cibInstantiate
|
||||
{
|
||||
var theClass = CPClassFromString(_className);
|
||||
|
||||
if (!theClass)
|
||||
CPLog("Unknown class \"" + _className + "\" in cib file");
|
||||
|
||||
return [[theClass alloc] init];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
import <Foundation/CPKeyedUnarchiver.j>
|
||||
|
||||
|
||||
@implementation _CPCibKeyedUnarchiver : CPKeyedUnarchiver
|
||||
{
|
||||
}
|
||||
|
||||
- (id)initForReadingWithData:(CPData)data
|
||||
{
|
||||
self = [super initForReadingWithData:data];
|
||||
|
||||
if (self)
|
||||
[self setDelegate:self];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)unarchiver:(CPKeyedUnarchiver)aKeyedUnarchiver didDecodeObject:(id)anObject
|
||||
{
|
||||
if ([anObject respondsToSelector:@selector(_cibInstantiate)])
|
||||
return [anObject _cibInstantiate];
|
||||
|
||||
return anObject;
|
||||
}
|
||||
|
||||
- (void)replaceObjectAtUID:(int)aUID withObject:(id)anObject
|
||||
{
|
||||
_objects[aUID] = anObject;
|
||||
}
|
||||
|
||||
- (id)objectAtUID:(int)aUID
|
||||
{
|
||||
return _objects[aUID];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -24,47 +24,51 @@ import <Foundation/CPArray.j>
|
||||
import <Foundation/CPObject.j>
|
||||
import <Foundation/CPString.j>
|
||||
|
||||
import "CPCib.j"
|
||||
import "_CPCibConnector.j"
|
||||
|
||||
|
||||
@implementation _CPCibObjectData : CPObject
|
||||
{
|
||||
CPArray _namesKeys;
|
||||
CPArray _namesValues;
|
||||
CPArray _namesKeys;
|
||||
CPArray _namesValues;
|
||||
|
||||
CPArray _accessibilityConnectors;
|
||||
CPArray _accessibilityOidsKeys;
|
||||
CPArray _accessibilityOidsValues;
|
||||
CPArray _accessibilityConnectors;
|
||||
CPArray _accessibilityOidsKeys;
|
||||
CPArray _accessibilityOidsValues;
|
||||
|
||||
CPArray _classesKeys;
|
||||
CPArray _classesValues;
|
||||
CPArray _classesKeys;
|
||||
CPArray _classesValues;
|
||||
|
||||
CPArray _connections;
|
||||
CPArray _connections;
|
||||
|
||||
id _fontManager;
|
||||
id _fontManager;
|
||||
|
||||
CPString _framework;
|
||||
CPString _framework;
|
||||
|
||||
int _nextOid;
|
||||
int _nextOid;
|
||||
|
||||
CPArray _objectsKeys;
|
||||
CPArray _objectsValues;
|
||||
CPArray _objectsKeys;
|
||||
CPArray _objectsValues;
|
||||
|
||||
CPArray _oidKeys;
|
||||
CPArray _oidValues;
|
||||
CPArray _oidKeys;
|
||||
CPArray _oidValues;
|
||||
|
||||
CPCustomObject _rootObject;
|
||||
_CPCibCustomObject _fileOwner;
|
||||
|
||||
CPSet _visibleWindows;
|
||||
CPSet _visibleWindows;
|
||||
}
|
||||
/*
|
||||
|
||||
- (CPArray)topLevelObjects
|
||||
{
|
||||
var count = [_objectsValues count];
|
||||
var count = [_objectsValues count],
|
||||
topLevelObjects = [];
|
||||
|
||||
while (count--)
|
||||
{
|
||||
var eachObject = _objectsValues[count];
|
||||
|
||||
if(eachObject == _fileOwner)
|
||||
if (eachObject == _fileOwner)
|
||||
{
|
||||
var anObject = _objectsKeys[count];
|
||||
|
||||
@@ -75,7 +79,6 @@ import <Foundation/CPString.j>
|
||||
|
||||
return topLevelObjects;
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
|
||||
@@ -103,7 +106,7 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
|
||||
_CPCibObjectDataOidKeysKey = @"_CPCibObjectDataOidKeysKey",
|
||||
_CPCibObjectDataOidValuesKey = @"_CPCibObjectDataOidValuesKey",
|
||||
|
||||
_CPCibObjectDataRootObjectKey = @"_CPCibObjectDataRootObjectKey",
|
||||
_CPCibObjectDataFileOwnerKey = @"_CPCibObjectDataFileOwnerKey",
|
||||
_CPCibObjectDataVisibleWindowsKey = @"_CPCibObjectDataVisibleWindowsKey";
|
||||
|
||||
@implementation _CPCibObjectData (CPCoding)
|
||||
@@ -125,7 +128,6 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
|
||||
_classesValues = [aCoder decodeObjectForKey:_CPCibObjectDataClassesValuesKey];
|
||||
|
||||
_connections = [aCoder decodeObjectForKey:_CPCibObjectDataConnectionsKey];
|
||||
|
||||
//id _fontManager;
|
||||
|
||||
_framework = [aCoder decodeObjectForKey:_CPCibObjectDataFrameworkKey];
|
||||
@@ -138,7 +140,7 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
|
||||
_oidKeys = [aCoder decodeObjectForKey:_CPCibObjectDataOidKeysKey];
|
||||
_oidValues = [aCoder decodeObjectForKey:_CPCibObjectDataOidValuesKey];
|
||||
|
||||
_rootObject = [aCoder decodeObjectForKey:_CPCibObjectDataRootObjectKey];
|
||||
_fileOwner = [aCoder decodeObjectForKey:_CPCibObjectDataFileOwnerKey];
|
||||
|
||||
// CPSet _visibleWindows;
|
||||
}
|
||||
@@ -172,10 +174,25 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
|
||||
[aCoder encodeObject:_oidKeys forKey:_CPCibObjectDataOidKeysKey];
|
||||
[aCoder encodeObject:_oidValues forKey:_CPCibObjectDataOidValuesKey];
|
||||
|
||||
[aCoder encodeObject:_rootObject forKey:_CPCibObjectDataRootObjectKey];
|
||||
[aCoder encodeObject:_fileOwner forKey:_CPCibObjectDataFileOwnerKey];
|
||||
// CPCustomObject _fileOwner;
|
||||
|
||||
// CPSet _visibleWindows;
|
||||
}
|
||||
|
||||
- (void)establishConnectionsWithExternalNameTable:(CPDictionary)anExternalNameTable
|
||||
{
|
||||
var index = 0,
|
||||
count = _connections.length,
|
||||
cibOwner = [anExternalNameTable objectForKey:CPCibOwner];
|
||||
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
var connection = _connections[index];
|
||||
|
||||
[connection replaceObject:_fileOwner withObject:cibOwner];
|
||||
[connection establishConnection];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
|
||||
import <Foundation/CPObject.j>
|
||||
|
||||
|
||||
var _CPCibWindowTemplateMinSizeKey = @"_CPCibWindowTemplateMinSizeKey",
|
||||
_CPCibWindowTemplateMaxSizeKey = @"_CPCibWindowTemplateMaxSizeKey",
|
||||
|
||||
_CPCibWindowTemplateViewClassKey = @"_CPCibWindowTemplateWindowClassKey",
|
||||
|
||||
_CPCibWindowTemplateWindowRectKey = @"_CPCibWindowTemplateWindowRectKey",
|
||||
_CPCibWindowTemplateWindowStyleMaskKey = @"_CPCibWindowTempatStyleMaskKey",
|
||||
_CPCibWindowTemplateWindowTitleKey = @"_CPCibWindowTemplateWindowTitleKey",
|
||||
_CPCibWindowTemplateWindowViewKey = @"_CPCibWindowTemplateWindowViewKey";
|
||||
|
||||
@implementation _CPCibWindowTemplate : CPObject
|
||||
{
|
||||
CGSize _minSize;
|
||||
CGSize _maxSize;
|
||||
//CGSize _screenRect;
|
||||
|
||||
CPString _viewClass;
|
||||
//unsigned _wtFlags;
|
||||
CPString _windowClass;
|
||||
CGRect _windowRect;
|
||||
unsigned _windowStyleMask;
|
||||
|
||||
CPString _windowTitle;
|
||||
CPView _windowView;
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_minSize = [aCoder decodeSizeForKey:_CPCibWindowTemplateMinSizeKey];
|
||||
_maxSize = [aCoder decodeSizeForKey:_CPCibWindowTemplateMaxSizeKey];
|
||||
|
||||
_viewClass = [aCoder decodeObjectForKey:_CPCibWindowTemplateViewClassKey];
|
||||
|
||||
_windowClass = [aCoder decodeObjectForKey:_CPCibWindowTemplateViewClassKey];
|
||||
_windowRect = [aCoder decodeRectForKey:_CPCibWindowTemplateWindowRectKey];
|
||||
_windowStyleMask = [aCoder decodeIntForKey:_CPCibWindowTemplateWindowStyleMaskKey];
|
||||
|
||||
_windowTitle = [aCoder decodeObjectForKey:_CPCibWindowTemplateWindowTitleKey];
|
||||
_windowView = [aCoder decodeObjectForKey:_CPCibWindowTemplateWindowViewKey];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
[aCoder encodeSize:_minSize forKey:_CPCibWindowTemplateMinSizeKey];
|
||||
[aCoder encodeSize:_maxSize forKey:_CPCibWindowTemplateMaxSizeKey];
|
||||
|
||||
[aCoder encodeObject:_viewClass forKey:_CPCibWindowTemplateViewClassKey];
|
||||
|
||||
[aCoder encodeObject:_windowClass forKey:_CPCibWindowTemplateViewClassKey];
|
||||
[aCoder encodeRect:_windowRect forKey:_CPCibWindowTemplateWindowRectKey];
|
||||
[aCoder encodeInt:_windowStyleMask forKey:_CPCibWindowTemplateWindowStyleMaskKey];
|
||||
|
||||
[aCoder encodeObject:_windowTitle forKey:_CPCibWindowTemplateWindowTitleKey];
|
||||
[aCoder encodeObject:_windowView forKey:_CPCibWindowTemplateWindowViewKey];
|
||||
}
|
||||
|
||||
- (id)_cibInstantiate
|
||||
{
|
||||
var windowClass = CPClassFromString(_windowClass);
|
||||
|
||||
/* if (!windowClass)
|
||||
[NSException raise:NSInvalidArgumentException format:@"Unable to locate NSWindow class %@, using NSWindow",_windowClass];
|
||||
class=[NSWindow class];*/
|
||||
|
||||
var theWindow = [[windowClass alloc] initWithContentRect:_windowRect styleMask:CPHUDBackgroundWindowMask | CPClosableWindowMask];//styleMask:_windowStyleMask];
|
||||
// alert(CPStringFromRect(_windowRect));
|
||||
// alert(CPStringFromSize(_minSize));
|
||||
// alert(CPStringFromSize(_maxSize));
|
||||
//[theWindow setMinSize:_minSize];
|
||||
//[theWindow setMaxSize:_maxSize];
|
||||
[theWindow setLevel:CPFloatingWindowLevel];
|
||||
|
||||
//[result setHidesOnDeactivate:(_wtFlags&0x80000000)?YES:NO];
|
||||
[theWindow setTitle:_windowTitle];
|
||||
|
||||
// FIXME: we can't autoresize yet...
|
||||
[_windowView setAutoresizesSubviews:NO];
|
||||
|
||||
[theWindow setContentView:_windowView];
|
||||
|
||||
[_windowView setAutoresizesSubviews:YES];
|
||||
|
||||
return theWindow;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -133,7 +133,7 @@ CPDOMDisplayServerViewsContext = {};
|
||||
CPDOMDisplayServerInstructions[index++] = nil;
|
||||
|
||||
break;
|
||||
}}catch(e) { alert("here?" + instruction) }
|
||||
}}catch(e) { CPLog("here?" + instruction) }
|
||||
}
|
||||
|
||||
CPDOMDisplayServerInstructionCount = 0;
|
||||
@@ -155,7 +155,7 @@ CPDOMDisplayServerViewsContext = {};
|
||||
[view displayIfNeeded];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[CPDOMDisplayRunLoop performSelector:@selector(run) target:CPDOMDisplayServer argument:nil order:0 modes:[CPDefaultRunLoopMode]];
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 144 B |
Binary file not shown.
|
After Width: | Height: | Size: 133 B |
@@ -62,7 +62,7 @@ var _CPWindowViewResizeIndicatorImage = nil;
|
||||
{
|
||||
_resizeIndicatorOffset = CGSizeMake(0.0, 0.0);
|
||||
|
||||
[self setShowsResizeIndicator:((_styleMask & CPBorderlessWindowMask) || (_styleMask & CPBorderlessBridgeWindowMask)) && (_styleMask & CPResizableWindowMask)];
|
||||
[self setShowsResizeIndicator:!(_styleMask & CPBorderlessBridgeWindowMask) && (_styleMask & CPResizableWindowMask)];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
@@ -56,6 +56,8 @@ CPJSONPConnectionCallbacks = {};
|
||||
{
|
||||
[_delegate connection:self didReceiveData:data];
|
||||
[self removeScriptTag];
|
||||
|
||||
[[CPRunLoop currentRunLoop] performSelectors];
|
||||
};
|
||||
|
||||
if(shouldStartImmediately)
|
||||
|
||||
+160
-38
@@ -22,7 +22,15 @@
|
||||
|
||||
import "CPObject.j"
|
||||
|
||||
@implementation CPObject(CPKeyValueCoding)
|
||||
|
||||
var CPObjectAccessorsForClass = nil,
|
||||
CPObjectModifiersForClass = nil;
|
||||
|
||||
CPUndefinedKeyException = @"CPUndefinedKeyException";
|
||||
CPTargetObjectUserInfoKey = @"CPTargetObjectUserInfoKey";
|
||||
CPUnknownUserInfoKey = @"CPUnknownUserInfoKey";
|
||||
|
||||
@implementation CPObject (CPKeyValueCoding)
|
||||
|
||||
+ (BOOL)accessInstanceVariablesDirectly
|
||||
{
|
||||
@@ -32,14 +40,42 @@ import "CPObject.j"
|
||||
/* @ignore */
|
||||
+ (SEL)_accessorForKey:(CPString)aKey
|
||||
{
|
||||
var capitalizedKey = aKey.charAt(0).toUpperCase() + aKey.substr(1),
|
||||
selector = CPSelectorFromString("get" + capitalizedKey);
|
||||
if (!CPObjectAccessorsForClass)
|
||||
CPObjectAccessorsForClass = [CPDictionary dictionary];
|
||||
|
||||
if ([self instancesRespondToSelector:selector] ||
|
||||
var hash = [isa hash],
|
||||
selector = nil,
|
||||
accessors = [CPObjectAccessorsForClass objectForKey:hash];
|
||||
|
||||
if (accessors)
|
||||
{
|
||||
selector = [accessors objectForKey:aKey];
|
||||
|
||||
if (selector)
|
||||
return selector == [CPNull null] ? nil : selector;
|
||||
}
|
||||
else
|
||||
{
|
||||
accessors = [CPDictionary dictionary];
|
||||
|
||||
[CPObjectAccessorsForClass setObject:accessors forKey:hash];
|
||||
}
|
||||
|
||||
var capitalizedKey = aKey.charAt(0).toUpperCase() + aKey.substr(1);
|
||||
|
||||
if ([self instancesRespondToSelector:selector = CPSelectorFromString("get" + capitalizedKey)] ||
|
||||
[self instancesRespondToSelector:selector = CPSelectorFromString(aKey)] ||
|
||||
[self instancesRespondToSelector:selector = CPSelectorFromString("_"+aKey)] ||
|
||||
[self instancesRespondToSelector:selector = CPSelectorFromString("is" + capitalizedKey)])
|
||||
[self instancesRespondToSelector:selector = CPSelectorFromString("is" + capitalizedKey)] ||
|
||||
[self instancesRespondToSelector:selector = CPSelectorFromString("_get" + capitalizedKey)] ||
|
||||
[self instancesRespondToSelector:selector = CPSelectorFromString("_" + aKey)] ||
|
||||
[self instancesRespondToSelector:selector = CPSelectorFromString("_is" + capitalizedKey)])
|
||||
{
|
||||
[accessors setObject:selector forKey:aKey];
|
||||
|
||||
return selector;
|
||||
}
|
||||
|
||||
[accessors setObject:[CPNull null] forKey:aKey];
|
||||
|
||||
return nil;
|
||||
}
|
||||
@@ -47,22 +83,68 @@ import "CPObject.j"
|
||||
/* @ignore */
|
||||
+ (SEL)_modifierForKey:(CPString)aKey
|
||||
{
|
||||
var selector = CPSelectorFromString("set" + aKey.charAt(0).toUpperCase() + aKey.substr(1) + ':');
|
||||
if (!CPObjectModifiersForClass)
|
||||
CPObjectModifiersForClass = [CPDictionary dictionary];
|
||||
|
||||
var hash = [isa hash],
|
||||
selector = nil,
|
||||
modifiers = [CPObjectModifiersForClass objectForKey:hash];
|
||||
|
||||
if (modifiers)
|
||||
{
|
||||
selector = [modifiers objectForKey:aKey];
|
||||
|
||||
if (selector)
|
||||
return selector == [CPNull null] ? nil : selector;
|
||||
}
|
||||
else
|
||||
{
|
||||
modifiers = [CPDictionary dictionary];
|
||||
|
||||
[CPObjectModifiersForClass setObject:modifiers forKey:hash];
|
||||
}
|
||||
|
||||
if (selector)
|
||||
return selector == [CPNull null] ? nil : selector;
|
||||
|
||||
if ([self instancesRespondToSelector:selector])
|
||||
var capitalizedKey = aKey.charAt(0).toUpperCase() + aKey.substr(1) + ':';
|
||||
|
||||
if ([self instancesRespondToSelector:selector = CPSelectorFromString("set" + capitalizedKey)] ||
|
||||
[self instancesRespondToSelector:selector = CPSelectorFromString("_set" + capitalizedKey)])
|
||||
{
|
||||
[modifiers setObject:selector forKey:aKey];
|
||||
|
||||
return selector;
|
||||
|
||||
}
|
||||
|
||||
[modifiers setObject:[CPNull null] forKey:aKey];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
- (CPString)_ivarForKey:(CPString)aKey
|
||||
{
|
||||
var ivar,
|
||||
isKey = "is" + aKey.charAt(0).toUpperCase() + aKey.substr(1);
|
||||
var ivar = '_' + aKey;
|
||||
|
||||
if (typeof self[ivar] != "undefined")
|
||||
return ivar;
|
||||
|
||||
if (self[ivar = "_" + aKey] != undefined || self[ivar = "_" + isKey] != undefined ||
|
||||
self[ivar = aKey] != undefined || self[ivar = isKey] != undefined) ;
|
||||
var isKey = "is" + aKey.charAt(0).toUpperCase() + aKey.substr(1);
|
||||
|
||||
ivar = '_' + isKey;
|
||||
|
||||
if (typeof self[ivar] != "undefined")
|
||||
return ivar;
|
||||
|
||||
ivar = aKey;
|
||||
|
||||
if (typeof self[ivar] != "undefined")
|
||||
return ivar;
|
||||
|
||||
ivar = isKey;
|
||||
|
||||
if (typeof self[ivar] != "undefined")
|
||||
return ivar;
|
||||
|
||||
return nil;
|
||||
@@ -70,35 +152,62 @@ import "CPObject.j"
|
||||
|
||||
- (id)valueForKey:(CPString)aKey
|
||||
{
|
||||
var ivar,
|
||||
theClass = [self class],
|
||||
selector = [theClass _accessorForKey:aKey]
|
||||
var selector = [isa _accessorForKey:aKey];
|
||||
|
||||
if (selector)
|
||||
return [self performSelector:selector];
|
||||
else if([theClass accessInstanceVariablesDirectly] && (ivar = [self _ivarForKey:aKey]))
|
||||
return self[ivar];
|
||||
else
|
||||
return [self valueForUndefinedKey:aKey];
|
||||
return objj_msgSend(self, selector);
|
||||
|
||||
if([isa accessInstanceVariablesDirectly])
|
||||
{
|
||||
var ivar = [self _ivarForKey:aKey];
|
||||
|
||||
if (ivar)
|
||||
return self[ivar];
|
||||
}
|
||||
|
||||
return [self valueForUndefinedKey:aKey];
|
||||
}
|
||||
|
||||
- (id)valueForKeyPath:(CPString)aKeyPath
|
||||
{
|
||||
var i = 0,
|
||||
keys = aKeyPath.split("."),
|
||||
var keys = aKeyPath.split("."),
|
||||
|
||||
index = 0,
|
||||
count = keys.length,
|
||||
|
||||
value = self;
|
||||
|
||||
for(; i<count; ++i)
|
||||
value = [value valueForKey:keys[i]];
|
||||
for(; index < count; ++index)
|
||||
value = [value valueForKey:keys[index]];
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
- (CPDictionary)dictionaryWithValuesForKeys:(CPArray)keys
|
||||
{
|
||||
var index = 0,
|
||||
count = keys.length,
|
||||
dictionary = [CPDictionary dictionary];
|
||||
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
var key = keys[index],
|
||||
value = [self valueForKey:key];
|
||||
|
||||
if (value === nil)
|
||||
[dictionary setObject:[CPNull null] forKey:key];
|
||||
else
|
||||
[dictionary setObject:value forKey:key];
|
||||
}
|
||||
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
- (id)valueForUndefinedKey:(CPString)aKey
|
||||
{
|
||||
alert("IMPLEMENT EXCEPTIONS, also, valueForKey died.");
|
||||
// CPException.raise(CPUndefinedKeyException, "[<"+this.classObject().name()+" "+this+"> valueForKey()]: this class is not key value coding-compliant for the key "+aKey+".]");
|
||||
[[CPException exceptionWithName:CPUndefinedKeyException
|
||||
reason:[self description] + " is not key value coding-compliant for the key " + aKey
|
||||
userInfo:[CPDictionary dictionaryWithObjects:[self, aKey] forKeys:[CPTargetObjectUserInfoKey, CPUnknownUserInfoKey]]] raise];
|
||||
}
|
||||
|
||||
- (void)setValue:(id)aValue forKeyPath:(CPString)aKeyPath
|
||||
@@ -118,22 +227,35 @@ import "CPObject.j"
|
||||
|
||||
- (void)setValue:(id)aValue forKey:(CPString)aKey
|
||||
{
|
||||
var ivar,
|
||||
theClass = [self class],
|
||||
selector = [theClass _modifierForKey:aKey];
|
||||
var selector = [isa _modifierForKey:aKey];
|
||||
|
||||
if (selector)
|
||||
[self performSelector:selector withObject:aValue];
|
||||
else if([theClass accessInstanceVariablesDirectly] && (ivar = [self _ivarForKey:aKey]))
|
||||
self[ivar] = aValue;
|
||||
else
|
||||
[self setValue:aValue forUndefinedKey:aKey];
|
||||
return objj_msgSend(self, selector, aValue);
|
||||
|
||||
if([isa accessInstanceVariablesDirectly])
|
||||
{
|
||||
var ivar = [self _ivarForKey:aKey];
|
||||
|
||||
if (ivar)
|
||||
{
|
||||
[self willChangeValueForKey:aKey];
|
||||
|
||||
self[ivar] = aValue;
|
||||
|
||||
[self didChangeValueForKey:aKey];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
[self setValue:aValue forUndefinedKey:aKey];
|
||||
}
|
||||
|
||||
- (void)setValue:(id)aValue forUndefinedKey:(CPString)aKey
|
||||
{
|
||||
alert("IMPLEMENT EXCEPTIONS, also, setValueForKey died.");
|
||||
// CPException.raise(CPUndefinedKeyException, "[<"+this.className()+" "+this+"> setValueForKey()]: this class is not key value coding-compliant for the key "+aKey+".]");
|
||||
[[CPException exceptionWithName:CPUndefinedKeyException
|
||||
reason:[self description] + " is not key value coding-compliant for the key " + aKey
|
||||
userInfo:[CPDictionary dictionaryWithObjects:[self, aKey] forKeys:[CPTargetObjectUserInfoKey, CPUnknownUserInfoKey]]] raise];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* CPKeyValueCoding.j
|
||||
* Foundation
|
||||
*
|
||||
* 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 "CPObject.j"
|
||||
|
||||
|
||||
@implementation CPObject (KeyValueObserving)
|
||||
|
||||
- (void)willChangeValueForKey:(CPString)aKey
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)didChangeValueForKey:(CPString)aKey
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+8
-43
@@ -2,7 +2,7 @@
|
||||
* CPLog.j
|
||||
* Foundation
|
||||
*
|
||||
* Created by Francisco Tolmasky.
|
||||
* Created by Thomas Robinson.
|
||||
* Copyright 2008, 280 North, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@@ -34,8 +34,6 @@ for (var i = 0; i < CPLogLevels.length; i++)
|
||||
var _CPLogRegistrations = {};
|
||||
|
||||
// helpers:
|
||||
var _randomInteger = function(max) { return Math.round(Math.random() * (typeof(max) != "undefined" ? max : (1 << 30))); }
|
||||
var _randomArrayElement = function(element) { return element[_randomInteger(element.length)]; }
|
||||
|
||||
var _CPFormatLogMessage = function(aString, aLevel, aTitle)
|
||||
{
|
||||
@@ -375,44 +373,11 @@ var _CPLogInitPopup = function(logWindow)
|
||||
}, false);
|
||||
}
|
||||
|
||||
// CPLogServer sends log messages to the server
|
||||
//var _CPLogServerBatch = true;
|
||||
//var _CPLogServerSessionID = _randomInteger();
|
||||
//function CPLogServer(aString, aLevel, aTitle)
|
||||
//{
|
||||
// var entry = { title: aTitle, message: aString, level: aLevel, timestamp: new Date().getTime() }
|
||||
//
|
||||
// if (_CPLogServerBatch)
|
||||
// {
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//function _CPLogServerSubmit()
|
||||
//{
|
||||
//
|
||||
//}
|
||||
|
||||
// Testing purposes:
|
||||
|
||||
var lorem = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas fermentum, elit non lobortis cursus, orci velit suscipit est, id mollis turpis mi eget orci. Ut aliquam sollicitudin metus. Mauris at sapien sed sapien congue iaculis. Nulla lorem urna, bibendum id, laoreet iaculis, nonummy eget, massa. Phasellus ullamcorper commodo velit.";
|
||||
|
||||
function CPLogTest(n) {
|
||||
for(var i=0;i<n;i++) {
|
||||
var start = _randomInteger(lorem.length);
|
||||
var length = _randomInteger(lorem.length-start);
|
||||
CPLog(lorem.substring(start, start+length), _randomArrayElement(CPLogLevels));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (NO)
|
||||
// override toString on Objective-J objects so we print the actual description of the object instead of [Object object]
|
||||
objj_object.prototype.toString = function()
|
||||
{
|
||||
if (window.open)
|
||||
CPLogRegister(CPLogPopup);
|
||||
else if (typeof print != undefined)
|
||||
CPLogRegister(CPLogPrint);
|
||||
}
|
||||
if (this.isa && class_getInstanceMethod(this.isa, "description") != NULL)
|
||||
return [this description]
|
||||
else
|
||||
return String(this) + " (-description not implemented)";
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ var _CPNotificationCenterPostNotification = function(/* CPNotificationCenter */
|
||||
while (key = [keys nextObject])
|
||||
{
|
||||
var observers = [_objectObservers objectForKey:key],
|
||||
count = observers.length;
|
||||
count = observers ? observers.length : 0;
|
||||
|
||||
while (count--)
|
||||
if ([observers[count] observer] == anObserver)
|
||||
@@ -231,7 +231,7 @@ var _CPNotificationCenterPostNotification = function(/* CPNotificationCenter */
|
||||
observers.splice(count, 1);
|
||||
}
|
||||
|
||||
if (observers.length == 0)
|
||||
if (!observers || observers.length == 0)
|
||||
removedKeys.push(key);
|
||||
}
|
||||
}
|
||||
@@ -239,7 +239,7 @@ var _CPNotificationCenterPostNotification = function(/* CPNotificationCenter */
|
||||
{
|
||||
var key = [anObject hash],
|
||||
observers = [_objectObservers objectForKey:key];
|
||||
count = observers.length;
|
||||
count = observers ? observers.length : 0;
|
||||
|
||||
while (count--)
|
||||
if ([observers[count] observer] == anObserver)
|
||||
@@ -251,7 +251,7 @@ var _CPNotificationCenterPostNotification = function(/* CPNotificationCenter */
|
||||
observers.splice(count, 1)
|
||||
}
|
||||
|
||||
if (observers.length == 0)
|
||||
if (!observers || observers.length == 0)
|
||||
removedKeys.push(key);
|
||||
}
|
||||
|
||||
|
||||
@@ -469,7 +469,7 @@ CPNumericSearch
|
||||
*/
|
||||
- (CPString)pathExtension
|
||||
{
|
||||
return substr(lastIndexOf('.')+1);
|
||||
return substr(lastIndexOf('.') + 1);
|
||||
}
|
||||
|
||||
- (CPString)lastPathComponent
|
||||
|
||||
@@ -33,6 +33,7 @@ import "CPJSONPConnection.j"
|
||||
import "CPKeyedArchiver.j"
|
||||
import "CPKeyedUnarchiver.j"
|
||||
import "CPKeyValueCoding.j"
|
||||
import "CPKeyValueObserving.j"
|
||||
import "CPLog.j"
|
||||
import "CPNotification.j"
|
||||
import "CPNotificationCenter.j"
|
||||
|
||||
@@ -159,7 +159,7 @@ function class_copyIvarList(/*Class*/ aClass)
|
||||
|
||||
//#define class_copyIvarList(aClass) (aClass.ivars.slice(0))
|
||||
|
||||
function class_addMethod(/*Class*/ aClass, /*SEL*/ aName, /*IMP*/ anImplementation, /*String*/types)
|
||||
function class_addMethod(/*Class*/ aClass, /*SEL*/ aName, /*IMP*/ anImplementation, /*String*/aType)
|
||||
{
|
||||
if (aClass.method_hash[aName])
|
||||
return NO;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
Requires objj be installed, as well as ojunit, located at http://github.com/280north/ojunit
|
||||
|
||||
Run individual tests using a command similar to the following:
|
||||
|
||||
objj ojunit/OJTestRunnerText.j cappuccino/Tests/Foundation/CPDateTest.j
|
||||
@@ -5,21 +5,25 @@ import <AppKit/CPCib.j>
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
CPWindow _window;
|
||||
CPWindow _secondWindow;
|
||||
CPView _view;
|
||||
}
|
||||
|
||||
- (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],
|
||||
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
|
||||
contentView = [theWindow contentView];
|
||||
|
||||
[contentView addSubview:x];
|
||||
|
||||
|
||||
[cib instantiateCibWithExternalNameTable:[CPDictionary dictionaryWithObject:self forKey:CPCibOwner]];
|
||||
|
||||
[_view setBackgroundColor:[CPColor blueColor]];
|
||||
|
||||
[contentView addSubview:_view];
|
||||
[theWindow orderFront:self];
|
||||
|
||||
[_secondWindow orderFront:self];
|
||||
}
|
||||
|
||||
@end
|
||||
Generated
+29
@@ -2,6 +2,35 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBClasses</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSObject</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>window</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>AppController</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>secondWindow</key>
|
||||
<string>id</string>
|
||||
<key>view</key>
|
||||
<string>id</string>
|
||||
<key>window</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IBVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
|
||||
Generated
+1
-1
@@ -11,7 +11,7 @@
|
||||
<integer>1</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9E17</string>
|
||||
<string>9F33</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
|
||||
BIN
Binary file not shown.
+326
-67
@@ -2,22 +2,23 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.01">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">9E17</string>
|
||||
<string key="IBDocument.SystemVersion">9F33</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">629</string>
|
||||
<string key="IBDocument.AppKitVersion">949.33</string>
|
||||
<string key="IBDocument.AppKitVersion">949.34</string>
|
||||
<string key="IBDocument.HIToolboxVersion">352.00</string>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="1"/>
|
||||
<integer value="13"/>
|
||||
<integer value="1" id="9"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string id="432113897">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string id="878848921">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSCustomObject" id="1001">
|
||||
<string key="NSClassName">NSObject</string>
|
||||
<string key="NSClassName" id="1051880339">NSObject</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1003">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
@@ -40,8 +41,8 @@
|
||||
<object class="NSButtonCell" key="NSCell" id="428923890">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Round Rect Button</string>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSContents" id="498285202">Round Rect Button</string>
|
||||
<object class="NSFont" key="NSSupport" id="1028390566">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">1.200000e+01</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
@@ -88,10 +89,119 @@
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="728415824">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{196, 240}, {480, 270}}</string>
|
||||
<int key="NSWTFlags">603979776</int>
|
||||
<string key="NSWindowTitle" id="988560763">Window</string>
|
||||
<string key="NSWindowClass" id="620584816">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<object class="NSView" key="NSWindowView" id="882339348">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSButton" id="111855648">
|
||||
<reference key="NSNextResponder" ref="882339348"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{145, 113}, {154, 19}}</string>
|
||||
<reference key="NSSuperview" ref="882339348"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="823598869">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">yikes!</string>
|
||||
<reference key="NSSupport" ref="1028390566"/>
|
||||
<reference key="NSControlView" ref="111855648"/>
|
||||
<int key="NSButtonFlags">-2038152961</int>
|
||||
<int key="NSButtonFlags2">164</int>
|
||||
<reference key="NSAlternateContents" ref="729400536"/>
|
||||
<reference key="NSKeyEquivalent" ref="729400536"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="380597285">
|
||||
<reference key="NSNextResponder" ref="882339348"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{0, 251}, {154, 19}}</string>
|
||||
<reference key="NSSuperview" ref="882339348"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="401652134">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<reference key="NSContents" ref="498285202"/>
|
||||
<reference key="NSSupport" ref="1028390566"/>
|
||||
<reference key="NSControlView" ref="380597285"/>
|
||||
<int key="NSButtonFlags">-2038152961</int>
|
||||
<int key="NSButtonFlags2">164</int>
|
||||
<reference key="NSAlternateContents" ref="729400536"/>
|
||||
<reference key="NSKeyEquivalent" ref="729400536"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{480, 270}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="901839919">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{196, 240}, {480, 270}}</string>
|
||||
<int key="NSWTFlags">603979776</int>
|
||||
<reference key="NSWindowTitle" ref="988560763"/>
|
||||
<reference key="NSWindowClass" ref="620584816"/>
|
||||
<nil key="NSViewClass"/>
|
||||
<object class="NSView" key="NSWindowView" id="872041560">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{480, 270}</string>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label" id="508157406">view</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="1005"/>
|
||||
</object>
|
||||
<int key="connectionID">20</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label" id="752515934">window</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="728415824"/>
|
||||
</object>
|
||||
<int key="connectionID">21</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">orderFront:</string>
|
||||
<reference key="source" ref="728415824"/>
|
||||
<reference key="destination" ref="376826387"/>
|
||||
</object>
|
||||
<int key="connectionID">22</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">orderOut:</string>
|
||||
<reference key="source" ref="728415824"/>
|
||||
<reference key="destination" ref="111855648"/>
|
||||
</object>
|
||||
<int key="connectionID">24</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -160,6 +270,68 @@
|
||||
<reference key="object" ref="955868276"/>
|
||||
<reference key="parent" ref="1050330329"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">12</int>
|
||||
<reference key="object" ref="728415824"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="882339348"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1002"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">13</int>
|
||||
<reference key="object" ref="882339348"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="111855648"/>
|
||||
<reference ref="380597285"/>
|
||||
</object>
|
||||
<reference key="parent" ref="728415824"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">14</int>
|
||||
<reference key="object" ref="901839919"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="872041560"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1002"/>
|
||||
<string key="objectName">Francisco</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">15</int>
|
||||
<reference key="object" ref="872041560"/>
|
||||
<reference key="parent" ref="901839919"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">16</int>
|
||||
<reference key="object" ref="111855648"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="823598869"/>
|
||||
</object>
|
||||
<reference key="parent" ref="882339348"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">17</int>
|
||||
<reference key="object" ref="823598869"/>
|
||||
<reference key="parent" ref="111855648"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">25</int>
|
||||
<reference key="object" ref="380597285"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="401652134"/>
|
||||
</object>
|
||||
<reference key="parent" ref="882339348"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">26</int>
|
||||
<reference key="object" ref="401652134"/>
|
||||
<reference key="parent" ref="380597285"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -174,21 +346,45 @@
|
||||
<string>1.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>10.IBPluginDependency</string>
|
||||
<string>11.IBPluginDependency</string>
|
||||
<string>12.IBPluginDependency</string>
|
||||
<string>12.IBWindowTemplateEditedContentRect</string>
|
||||
<string>12.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>12.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>13.IBPluginDependency</string>
|
||||
<string>14.IBPluginDependency</string>
|
||||
<string>14.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>15.IBPluginDependency</string>
|
||||
<string>16.IBPluginDependency</string>
|
||||
<string>17.IBPluginDependency</string>
|
||||
<string>25.IBPluginDependency</string>
|
||||
<string>26.IBPluginDependency</string>
|
||||
<string>8.IBPluginDependency</string>
|
||||
<string>9.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="432113897"/>
|
||||
<reference ref="432113897"/>
|
||||
<reference ref="432113897"/>
|
||||
<reference ref="432113897"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<string>{628, 654}</string>
|
||||
<string>{{319, 416}, {480, 272}}</string>
|
||||
<string id="682767821">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<reference ref="682767821"/>
|
||||
<string id="32298658">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<reference ref="32298658"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<string id="347871574">{{196, 240}, {480, 270}}</string>
|
||||
<reference ref="9"/>
|
||||
<reference ref="347871574"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="9"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
<reference ref="878848921"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
@@ -211,11 +407,41 @@
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">11</int>
|
||||
<int key="maxID">26</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<reference key="className" ref="1051880339"/>
|
||||
<nil key="superclassName"/>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSMutableArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="508157406"/>
|
||||
<reference ref="752515934"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string id="769725644">id</string>
|
||||
<reference ref="769725644"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<reference key="minorKey" ref="729400536"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
@@ -223,57 +449,90 @@
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<object class="NSMutableData" key="IBDocument.RunnableNib">
|
||||
<bytes key="NS.bytes">YnBsaXN0MDDUAAEAAgADAAQABQAGAAkAClgkdmVyc2lvblQkdG9wWSRhcmNoaXZlclgkb2JqZWN0cxIA
|
||||
AYag0QAHAAhdSUIub2JqZWN0ZGF0YYABXxAPTlNLZXllZEFyY2hpdmVyrxA/AAsADAAxADUANgA7ADwA
|
||||
QABEAEcASwBUAGwAbQB1AHYAeQCJAIoAjgCYAAsAmQCfALMAtgC3AL8AwgDHAMgAywALAJ0AzADPANIA
|
||||
0wDVAN4A6ADyAPMA9AD1APYA9wD4APkA/AD/AQkBEwEUARUBFgCrARcBG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
|
||||
CoUKhwqJCooKjAqOCqcK4AroCv4LEwseCykLNAtCC18LaAtqC2wLbgtwC3ILdAt9C4YLhwuIC5kLmwud
|
||||
C6cLsAu5C8YLzwvaC+ML7gv3DAAMDQwSDBsMHQw6DDwMPgxADEIMRAxGDEgMSgxMDE4MUAxSDFQMVgxf
|
||||
DGEMYwxxDHoMfwyIDIoMpwypDKsMrQyvDLEMswy1DLcMuQy7DL0MvwzBDMMMzAzODO8M8QzzDPUM9wz5
|
||||
DPsM/Qz/DQENAw0FDQcNCQ0LDQ0NFg0YDTkNOw09DT8NQQ1DDUUNRw1JDUsNTQ1PDVENUw1VDVcNZA2O
|
||||
DaINrA24DcQN0w31DgEOEw4gDkgObA6JDqAOqQ6rDqwOtQ63DrgOwQ7DDuwO7g7wDvIO9A72DvgO+g78
|
||||
Dv4PAA8CDwQPBg8IDwoPDA8ODxAPEg8bDx0PRg9ID0oPTA9OD1APUg9UD1YPWA9aD1wPXg9gD2IPZA9m
|
||||
D2gPag9sD24PcA9yD3QPdg94D3oPgw+FD4cPiQ+LD40Pjw+RD5MPnA+eD58PqA+qD6sPtA+2D7cPwA/F
|
||||
AAAAAAAAAgIAAAAAAAAB7gAAAAAAAAAAAAAAAAAAD9Q</bytes>
|
||||
</object>
|
||||
</data>
|
||||
</archive>
|
||||
|
||||
@@ -12,6 +12,8 @@ import <AppKit/AppKit.j>
|
||||
import "AppController.j"
|
||||
|
||||
|
||||
CPLogRegister(CPLogPopup);
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
|
||||
Binary file not shown.
@@ -23,9 +23,24 @@
|
||||
import "NSButton.j"
|
||||
import "NSCell.j"
|
||||
import "NSControl.j"
|
||||
import "NSCustomObject.j"
|
||||
import "NSCustomView.j"
|
||||
import "NSFont.j"
|
||||
import "NSIBObjectData.j"
|
||||
import "NSNibConnector.j"
|
||||
import "NSResponder.j"
|
||||
import "NSSlider.j"
|
||||
import "NSView.j"
|
||||
import "NSWindowTemplate.j"
|
||||
import "NSSplitView.j"
|
||||
|
||||
function CP_NSMapClassName(aClassName)
|
||||
{
|
||||
if (aClassName == @"NSView")
|
||||
return "CPView";
|
||||
|
||||
if (aClassName == @"NSWindow")
|
||||
return @"CPWindow";
|
||||
|
||||
return aClassName;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ import "NSControl.j"
|
||||
|
||||
[self setBezelStyle:[cell bezelStyle]];
|
||||
[self setBordered:[cell isBordered]];
|
||||
|
||||
// FIXME
|
||||
_sendActionOn = CPLeftMouseUpMask;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
import <AppKit/_CPCibCustomObject.j>
|
||||
|
||||
|
||||
@implementation _CPCibCustomObject (NSCoding)
|
||||
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self){
|
||||
_className = [aCoder decodeObjectForKey:@"NSClassName"];
|
||||
print(":::"+_className);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSCustomObject : _CPCibCustomObject
|
||||
{
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{print("i-nit form coder");
|
||||
return [self NS_initWithCoder:aCoder];
|
||||
}
|
||||
|
||||
- (Class)classForKeyedArchiver
|
||||
{
|
||||
return [_CPCibCustomObject class];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -25,6 +25,8 @@ import <AppKit/CPCustomView.j>
|
||||
import "NSView.j"
|
||||
|
||||
|
||||
var _CPCibCustomViewClassNameKey = @"_CPCibCustomViewClassNameKey";
|
||||
|
||||
@implementation NSCustomView : CPView
|
||||
{
|
||||
CPString _className;
|
||||
@@ -44,20 +46,13 @@ import "NSView.j"
|
||||
{
|
||||
[super encodeWithCoder:aCoder];
|
||||
|
||||
[aCoder encodeObject:_NSCustomViewMapClassName(_className) forKey:@"CPCustomViewClassNameKey"];
|
||||
[aCoder encodeObject:CP_NSMapClassName(_className) forKey:_CPCibCustomViewClassNameKey];
|
||||
}
|
||||
|
||||
- (CPString)classForKeyedArchiver
|
||||
{
|
||||
return [CPCustomView class];
|
||||
return [_CPCibCustomView class];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
function _NSCustomViewMapClassName(aClassName)
|
||||
{
|
||||
if (aClassName == @"NSView")
|
||||
return "CPView";
|
||||
|
||||
return aClassName;
|
||||
}
|
||||
|
||||
@@ -73,9 +73,9 @@ import <AppKit/_CPCibObjectData.j>
|
||||
//_accessibilityConnectors = [aCoder decodeObjectForKey:@"NSAccessibilityConnectors"];
|
||||
//_accessibilityOidsKeys = [aCoder decodeObjectForKey:@"NSAccessibilityOidsKeys"];
|
||||
//_accessibilityOidsValues = [aCoder decodeObjectForKey:@"NSAccessibilityOidsValues"];
|
||||
|
||||
_classesKeys = [aCoder decodeObjectForKey:@"NSClassesKeys"];
|
||||
_classesValues = [aCoder decodeObjectForKey:@"NSClassesValues"];
|
||||
|
||||
_classesKeys = [aCoder decodeObjectForKey:@"NSClassesKeys"];print("d");
|
||||
_classesValues = [aCoder decodeObjectForKey:@"NSClassesValues"];print("e");
|
||||
|
||||
_connections = [aCoder decodeObjectForKey:@"NSConnections"];
|
||||
|
||||
@@ -90,7 +90,7 @@ import <AppKit/_CPCibObjectData.j>
|
||||
_oidKeys = [aCoder decodeObjectForKey:@"NSOidsKeys"];
|
||||
_oidValues = [aCoder decodeObjectForKey:@"NSOidsValues"];
|
||||
|
||||
_rootObject = [aCoder decodeObjectForKey:@"NSRoot"];
|
||||
_fileOwner = [aCoder decodeObjectForKey:@"NSRoot"];
|
||||
_visibleWindows = [aCoder decodeObjectForKey:@"NSVisibleWindows"];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
import <AppKit/_CPCibConnector.j>
|
||||
|
||||
|
||||
@implementation _CPCibConnector (NSCoding)
|
||||
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_source = [aCoder decodeObjectForKey:@"NSSource"];
|
||||
_destination = [aCoder decodeObjectForKey:@"NSDestination"];
|
||||
_label = [aCoder decodeObjectForKey:@"NSLabel"];
|
||||
#if DEBUG
|
||||
CPLog(@"Connection: " + [_source description] + " " + [_destination description] + " " + _label);
|
||||
#endif
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSNibConnector : _CPCibConnector
|
||||
{
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
return [[_CPCibConnector alloc] NS_initWithCoder:aCoder];
|
||||
}
|
||||
|
||||
- (Class)classForKeyedArchiver
|
||||
{
|
||||
return [_CPCibConnector class];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSNibControlConnector : _CPCibControlConnector
|
||||
{
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
return [[_CPCibControlConnector alloc] NS_initWithCoder:aCoder];
|
||||
}
|
||||
|
||||
- (Class)classForKeyedArchiver
|
||||
{
|
||||
return [_CPCibControlConnector class];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSNibOutletConnector : _CPCibOutletConnector
|
||||
{
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
return [[_CPCibOutletConnector alloc] NS_initWithCoder:aCoder];
|
||||
}
|
||||
|
||||
- (Class)classForKeyedArchiver
|
||||
{
|
||||
return [_CPCibOutletConnector class];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* NSSplitView.j
|
||||
* nib2cib
|
||||
*
|
||||
* Created by Thomas Robinson.
|
||||
* 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 <AppKit/CPSplitView.j>
|
||||
|
||||
|
||||
@implementation CPSplitView (CPCoding)
|
||||
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
if (self = [super NS_initWithCoder:aCoder])
|
||||
{
|
||||
_isVertical = [aCoder decodeBoolForKey:@"NSIsVertical"];
|
||||
_isPaneSplitter = [aCoder decodeIntForKey:@"NSDividerStyle"] == 2 ? YES : NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSSplitView : CPSplitView
|
||||
{
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
return [self NS_initWithCoder:aCoder];
|
||||
}
|
||||
|
||||
- (Class)classForKeyedArchiver
|
||||
{
|
||||
return [CPSplitView class];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -41,6 +41,11 @@ import <AppKit/CPView.j>
|
||||
|
||||
if (self)
|
||||
{
|
||||
_tag = -1;
|
||||
|
||||
if([aCoder containsValueForKey:@"NSTag"])
|
||||
_tag = [aCoder decodeIntForKey:@"NSTag"];
|
||||
|
||||
_bounds = CGRectMake(0.0, 0.0, CGRectGetWidth(_frame), CGRectGetHeight(_frame));
|
||||
|
||||
_window = [aCoder decodeObjectForKey:@"NSWindow"];
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
import <AppKit/_CPCibWindowTemplate.j>
|
||||
|
||||
|
||||
@implementation _CPCibWindowTemplate (NSCoding)
|
||||
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_minSize = [aCoder decodeSizeForKey:@"NSMinSize"];
|
||||
_maxSize = [aCoder decodeSizeForKey:@"NSMaxSize"];
|
||||
_screenRect = [aCoder decodeRectForKey:@"NSScreenRect"]; // screen created on
|
||||
_viewClass = [aCoder decodeObjectForKey:@"NSViewClass"];
|
||||
_wtFlags = [aCoder decodeIntForKey:@"NSWTFlags"];
|
||||
_windowBacking = [aCoder decodeIntForKey:@"NSWindowBacking"];
|
||||
|
||||
// Convert NSWindows to CPWindows.
|
||||
_windowClass = CP_NSMapClassName([aCoder decodeObjectForKey:@"NSWindowClass"]);
|
||||
|
||||
_windowRect = [aCoder decodeRectForKey:@"NSWindowRect"];
|
||||
_windowStyleMask = [aCoder decodeIntForKey:@"NSWindowStyleMask"];
|
||||
_windowTitle = [aCoder decodeObjectForKey:@"NSWindowTitle"];
|
||||
_windowView = [aCoder decodeObjectForKey:@"NSWindowView"];
|
||||
|
||||
/*
|
||||
_windowRect.origin.y -= _screenRect.size.height - [[NSScreen mainScreen] frame].size.height;
|
||||
if (![_windowClass isEqualToString:@"NSPanel"])
|
||||
_windowRect.origin.y -= [NSMainMenuView menuHeight]; // compensation for the additional menu bar
|
||||
*/
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSWindowTemplate : _CPCibWindowTemplate
|
||||
{
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
return [self NS_initWithCoder:aCoder];
|
||||
}
|
||||
|
||||
- (Class)classForKeyedArchiver
|
||||
{
|
||||
return [_CPCibWindowTemplate class];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -30,6 +30,7 @@ import "NSAppKit.j"
|
||||
importClass(java.io.FileWriter);
|
||||
importClass(java.io.BufferedWriter);
|
||||
|
||||
CPLogRegister(CPLogPrint);
|
||||
|
||||
function exec(command)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user