mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fix nib2cib warnings
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
|
||||
|
||||
@import "Converter.j"
|
||||
@import "Nib2CibKeyedUnarchiver.j"
|
||||
@import "NSFont.j"
|
||||
|
||||
@implementation Converter (Mac)
|
||||
|
||||
@@ -55,9 +57,8 @@
|
||||
|
||||
[object setFrameOrigin:CGPointMake(CGRectGetMinX(frame), superviewHeight - CGRectGetMaxY(frame))];
|
||||
|
||||
var NS_autoresizingMask = [object autoresizingMask];
|
||||
|
||||
autoresizingMask = NS_autoresizingMask & ~(CPViewMaxYMargin | CPViewMinYMargin);
|
||||
var NS_autoresizingMask = [object autoresizingMask],
|
||||
autoresizingMask = NS_autoresizingMask & ~(CPViewMaxYMargin | CPViewMinYMargin);
|
||||
|
||||
if (!(NS_autoresizingMask & (CPViewMaxYMargin | CPViewMinYMargin | CPViewHeightSizable)))
|
||||
autoresizingMask |= CPViewMinYMargin;
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
@import <AppKit/AppKit.j>
|
||||
@import <BlendKit/BlendKit.j>
|
||||
|
||||
@global java
|
||||
|
||||
var FILE = require("file"),
|
||||
OS = require("os"),
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
@import "NSCell.j"
|
||||
@import "NSControl.j"
|
||||
|
||||
@global NIB_CONNECTION_EQUIVALENCY_TABLE
|
||||
|
||||
|
||||
var NSButtonIsBorderedMask = 0x00800000,
|
||||
NSButtonAllowsMixedStateMask = 0x1000000,
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
@import "Converter.j"
|
||||
|
||||
@global CP_NSMapClassName
|
||||
|
||||
var NSClassSwapperClassNames = {},
|
||||
NSClassSwapperOriginalClassNames = {};
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ var NSUnknownColorSpaceModel = -1,
|
||||
break;
|
||||
|
||||
default:
|
||||
CPLog.warn(@"-[%@ %s] unknown color space %d", isa, _cmd, colorSpace);
|
||||
CPLog.warn(@"-[%@ %s] unknown color space %d", self.isa, _cmd, colorSpace);
|
||||
result = [CPColor blackColor];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
@import <AppKit/_CPCibCustomObject.j>
|
||||
|
||||
@global CP_NSMapClassName
|
||||
|
||||
@implementation _CPCibCustomObject (NSCoding)
|
||||
|
||||
@@ -51,4 +52,4 @@
|
||||
return [_CPCibCustomObject class];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
@import <AppKit/_CPCibCustomResource.j>
|
||||
|
||||
@global CP_NSMapClassName
|
||||
|
||||
var FILE = require("file"),
|
||||
imageSize = require("cappuccino/imagesize").imagesize;
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
@import "NSView.j"
|
||||
|
||||
@global CP_NSMapClassName
|
||||
|
||||
|
||||
var _CPCibCustomViewClassNameKey = @"_CPCibCustomViewClassNameKey";
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
@import "NSView.j"
|
||||
|
||||
@global NIB_CONNECTION_EQUIVALENCY_TABLE
|
||||
|
||||
var NSMatrixRadioModeMask = 0x40000000,
|
||||
NSMatrixDrawsBackgroundMask = 0x01000000;
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
|
||||
@import <AppKit/CPObjectController.j>
|
||||
|
||||
@global CP_NSMapClassName
|
||||
|
||||
|
||||
@implementation CPObjectController (NSCoding)
|
||||
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
|
||||
@@ -84,14 +84,14 @@
|
||||
|
||||
if (self)
|
||||
{
|
||||
_objectValue = [aCoder decodeDoubleForKey:@"NSValue"];
|
||||
self._objectValue = [aCoder decodeDoubleForKey:@"NSValue"];
|
||||
|
||||
_minValue = [aCoder decodeDoubleForKey:@"NSMinValue"];
|
||||
_maxValue = [aCoder decodeDoubleForKey:@"NSMaxValue"];
|
||||
_altIncrementValue = [aCoder decodeDoubleForKey:@"NSAltIncValue"];
|
||||
_isVertical = [aCoder decodeBoolForKey:@"NSVertical"];
|
||||
self._minValue = [aCoder decodeDoubleForKey:@"NSMinValue"];
|
||||
self._maxValue = [aCoder decodeDoubleForKey:@"NSMaxValue"];
|
||||
self._altIncrementValue = [aCoder decodeDoubleForKey:@"NSAltIncValue"];
|
||||
self._isVertical = [aCoder decodeBoolForKey:@"NSVertical"];
|
||||
|
||||
_sliderType = [aCoder decodeIntForKey:@"NSSliderType"];
|
||||
self._sliderType = [aCoder decodeIntForKey:@"NSSliderType"];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
@@ -30,14 +30,14 @@ var NSThinDividerStyle = 2;
|
||||
{
|
||||
if (self = [super NS_initWithCoder:aCoder])
|
||||
{
|
||||
_isVertical = [aCoder decodeBoolForKey:@"NSIsVertical"];
|
||||
self._isVertical = [aCoder decodeBoolForKey:@"NSIsVertical"];
|
||||
|
||||
// The possible values appear to be: no value (thick divider), 2 (thin divider) and 3 (pane splitter). For
|
||||
// Cappuccino's purposes we treat thick divider and pane splitter as the same thing since the only difference
|
||||
// seems to be graphical.
|
||||
_isPaneSplitter = [aCoder decodeIntForKey:@"NSDividerStyle"] != NSThinDividerStyle;
|
||||
self._isPaneSplitter = [aCoder decodeIntForKey:@"NSDividerStyle"] != NSThinDividerStyle;
|
||||
|
||||
_autosaveName = [aCoder decodeObjectForKey:@"NSAutosaveName"];
|
||||
self._autosaveName = [aCoder decodeObjectForKey:@"NSAutosaveName"];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
@@ -32,17 +32,17 @@
|
||||
{
|
||||
var cell = [aCoder decodeObjectForKey:@"NSCell"];
|
||||
|
||||
_minValue = [cell minValue];
|
||||
_maxValue = [cell maxValue];
|
||||
_increment = [cell increment];
|
||||
_valueWraps = [cell valueWraps];
|
||||
_autorepeat = [cell autorepeat];
|
||||
_objectValue = [cell objectValue];
|
||||
self._minValue = [cell minValue];
|
||||
self._maxValue = [cell maxValue];
|
||||
self._increment = [cell increment];
|
||||
self._valueWraps = [cell valueWraps];
|
||||
self._autorepeat = [cell autorepeat];
|
||||
self._objectValue = [cell objectValue];
|
||||
|
||||
// Convert Cocoa normal size to Cappuccino normal size.
|
||||
_frame.origin.y += 2;
|
||||
_frame.size.height -= 2;
|
||||
_bounds.size.height -= 2;
|
||||
self._frame.origin.y += 2;
|
||||
self._frame.size.height -= 2;
|
||||
self._bounds.size.height -= 2;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
@import <AppKit/_CPCibWindowTemplate.j>
|
||||
|
||||
@global CP_NSMapClassName
|
||||
|
||||
var NSBorderlessWindowMask = 0x00,
|
||||
NSTitledWindowMask = 0x01,
|
||||
@@ -54,36 +55,36 @@ var NSBorderlessWindowMask = 0x00,
|
||||
if ([aCoder containsValueForKey:@"NSMaxSize"])
|
||||
_maxSize = [aCoder decodeSizeForKey:@"NSMaxSize"];
|
||||
|
||||
_screenRect = [aCoder decodeRectForKey:@"NSScreenRect"]; // screen created on
|
||||
_viewClass = [aCoder decodeObjectForKey:@"NSViewClass"]; // references the toolbar if present (anything else?)
|
||||
_wtFlags = [aCoder decodeIntForKey:@"NSWTFlags"];
|
||||
_windowAutorecalculatesKeyViewLoop = !!(_wtFlags & NSAutorecalculatesKeyViewLoopWTFlag);
|
||||
_windowBacking = [aCoder decodeIntForKey:@"NSWindowBacking"];
|
||||
self._screenRect = [aCoder decodeRectForKey:@"NSScreenRect"]; // screen created on
|
||||
self._viewClass = [aCoder decodeObjectForKey:@"NSViewClass"]; // references the toolbar if present (anything else?)
|
||||
self._wtFlags = [aCoder decodeIntForKey:@"NSWTFlags"];
|
||||
self._windowAutorecalculatesKeyViewLoop = !!(_wtFlags & NSAutorecalculatesKeyViewLoopWTFlag);
|
||||
self._windowBacking = [aCoder decodeIntForKey:@"NSWindowBacking"];
|
||||
|
||||
// Convert NSWindows to CPWindows.
|
||||
_windowClass = CP_NSMapClassName([aCoder decodeObjectForKey:@"NSWindowClass"]);
|
||||
self._windowClass = CP_NSMapClassName([aCoder decodeObjectForKey:@"NSWindowClass"]);
|
||||
|
||||
_windowRect = [aCoder decodeRectForKey:@"NSWindowRect"];
|
||||
_windowStyleMask = [aCoder decodeIntForKey:@"NSWindowStyleMask"];
|
||||
_windowTitle = [aCoder decodeObjectForKey:@"NSWindowTitle"];
|
||||
_windowView = [aCoder decodeObjectForKey:@"NSWindowView"];
|
||||
self._windowRect = [aCoder decodeRectForKey:@"NSWindowRect"];
|
||||
self._windowStyleMask = [aCoder decodeIntForKey:@"NSWindowStyleMask"];
|
||||
self._windowTitle = [aCoder decodeObjectForKey:@"NSWindowTitle"];
|
||||
self._windowView = [aCoder decodeObjectForKey:@"NSWindowView"];
|
||||
|
||||
// Flip Y coordinate
|
||||
_windowRect.origin.y = _screenRect.size.height - _windowRect.origin.y - _windowRect.size.height;
|
||||
self._windowRect.origin.y = self._screenRect.size.height - self._windowRect.origin.y - self._windowRect.size.height;
|
||||
|
||||
if (_windowStyleMask === NSBorderlessWindowMask)
|
||||
_windowStyleMask = CPBorderlessWindowMask;
|
||||
if (self._windowStyleMask === NSBorderlessWindowMask)
|
||||
self._windowStyleMask = CPBorderlessWindowMask;
|
||||
|
||||
else
|
||||
_windowStyleMask = (_windowStyleMask & NSTitledWindowMask ? CPTitledWindowMask : 0) |
|
||||
(_windowStyleMask & NSClosableWindowMask ? CPClosableWindowMask : 0) |
|
||||
(_windowStyleMask & NSMiniaturizableWindowMask ? CPMiniaturizableWindowMask : 0) |
|
||||
(_windowStyleMask & NSResizableWindowMask ? CPResizableWindowMask : 0) |
|
||||
(_windowStyleMask & NSTexturedBackgroundWindowMask ? NSTexturedBackgroundWindowMask : 0) |
|
||||
(_windowStyleMask & NSDocModalWindowMask ? CPDocModalWindowMask : 0) |
|
||||
(_windowStyleMask & NSHUDBackgroundWindowMask ? CPHUDBackgroundWindowMask : 0);
|
||||
self._windowStyleMask = (self._windowStyleMask & NSTitledWindowMask ? CPTitledWindowMask : 0) |
|
||||
(self._windowStyleMask & NSClosableWindowMask ? CPClosableWindowMask : 0) |
|
||||
(self._windowStyleMask & NSMiniaturizableWindowMask ? CPMiniaturizableWindowMask : 0) |
|
||||
(self._windowStyleMask & NSResizableWindowMask ? CPResizableWindowMask : 0) |
|
||||
(self._windowStyleMask & NSTexturedBackgroundWindowMask ? NSTexturedBackgroundWindowMask : 0) |
|
||||
(self._windowStyleMask & NSDocModalWindowMask ? CPDocModalWindowMask : 0) |
|
||||
(self._windowStyleMask & NSHUDBackgroundWindowMask ? CPHUDBackgroundWindowMask : 0);
|
||||
|
||||
_windowIsFullBridge = [aCoder decodeObjectForKey:"NSFrameAutosaveName"] === "CPBorderlessBridgeWindowMask";
|
||||
self._windowIsFullBridge = [aCoder decodeObjectForKey:"NSFrameAutosaveName"] === "CPBorderlessBridgeWindowMask";
|
||||
|
||||
/*if (![_windowClass isEqualToString:@"NSPanel"])
|
||||
_windowRect.origin.y -= [NSMainMenuView menuHeight]; // compensation for the additional menu bar
|
||||
|
||||
@@ -391,6 +391,8 @@ var FILE = require("file"),
|
||||
|
||||
- (void)printOptions:options
|
||||
{
|
||||
var option;
|
||||
|
||||
for (option in options)
|
||||
{
|
||||
var value = options[option];
|
||||
@@ -408,6 +410,8 @@ var FILE = require("file"),
|
||||
// Merges properties in sourceOptions into targetOptions, overriding properties in targetOptions
|
||||
- (void)mergeOptions:(JSObject)sourceOptions with:(JSObject)targetOptions
|
||||
{
|
||||
var option;
|
||||
|
||||
for (option in sourceOptions)
|
||||
{
|
||||
// Make sure only a supported option is given
|
||||
|
||||
Reference in New Issue
Block a user