mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 19:21:16 +00:00
Fix formatting to GNUstep and add some pragma comments
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@40312 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b532d9e83e
commit
ee842f0a0e
1 changed files with 370 additions and 351 deletions
|
@ -574,9 +574,6 @@ didStartElement: (NSString*)elementName
|
||||||
NSString *key = [attributes objectForKey: @"key"];
|
NSString *key = [attributes objectForKey: @"key"];
|
||||||
NSString *ref = [attributes objectForKey: @"id"];
|
NSString *ref = [attributes objectForKey: @"id"];
|
||||||
|
|
||||||
// FIXME: We should use proper memory management here
|
|
||||||
AUTORELEASE(element);
|
|
||||||
|
|
||||||
if ([@"array" isEqualToString: [currentElement type]])
|
if ([@"array" isEqualToString: [currentElement type]])
|
||||||
{
|
{
|
||||||
// For arrays
|
// For arrays
|
||||||
|
@ -602,6 +599,8 @@ didStartElement: (NSString*)elementName
|
||||||
|
|
||||||
// Set as current element being processed...
|
// Set as current element being processed...
|
||||||
currentElement = element;
|
currentElement = element;
|
||||||
|
|
||||||
|
AUTORELEASE(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,90 +629,8 @@ didStartElement: (NSString*)elementName
|
||||||
#pragma mark - Decoding method(s)...
|
#pragma mark - Decoding method(s)...
|
||||||
// All this code should eventually move into their respective initWithCoder class
|
// All this code should eventually move into their respective initWithCoder class
|
||||||
// methods - however note - there are a couple that may be duplicated...
|
// methods - however note - there are a couple that may be duplicated...
|
||||||
- (id) decodeIntercellSpacingHeightForElement: (GSXib5Element*)element
|
|
||||||
{
|
|
||||||
element = (GSXib5Element*)[element elementForKey: @"intercellSpacing"];
|
|
||||||
return [element attributeForKey: @"height"];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) decodeIntercellSpacingWidthForElement: (GSXib5Element*)element
|
|
||||||
{
|
|
||||||
element = (GSXib5Element*)[element elementForKey: @"intercellSpacing"];
|
|
||||||
return [element attributeForKey: @"width"];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) decodeColumnAutoresizingStyleForElement: (GSXib5Element*)element
|
|
||||||
{
|
|
||||||
NSString *style = [element attributeForKey: @"columnAutoresizingStyle"];
|
|
||||||
NSUInteger value = NSTableViewUniformColumnAutoresizingStyle;
|
|
||||||
|
|
||||||
if ([@"none" isEqualToString: style])
|
|
||||||
value = NSTableViewNoColumnAutoresizing;
|
|
||||||
else if ([@"firstColumnOnly" isEqualToString: style])
|
|
||||||
value = NSTableViewFirstColumnOnlyAutoresizingStyle;
|
|
||||||
else if ([@"lastColumnOnly" isEqualToString: style])
|
|
||||||
value = NSTableViewLastColumnOnlyAutoresizingStyle;
|
|
||||||
else if ([@"sequential" isEqualToString: style])
|
|
||||||
value = NSTableViewSequentialColumnAutoresizingStyle;
|
|
||||||
else if ([@"reverseSequential" isEqualToString: style])
|
|
||||||
value = NSTableViewReverseSequentialColumnAutoresizingStyle;
|
|
||||||
|
|
||||||
#if defined(DEBUG_XIB5)
|
|
||||||
NSWarnMLog(@"value: %lu", value);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return [NSNumber numberWithUnsignedInteger: value];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) decodeWindowStyleMaskForElement: (GSXib5Element*)element
|
|
||||||
{
|
|
||||||
NSDictionary *attributes = [element attributes];
|
|
||||||
|
|
||||||
if (attributes)
|
|
||||||
{
|
|
||||||
NSUInteger mask = 0;
|
|
||||||
|
|
||||||
if ([[attributes objectForKey: @"titled"] boolValue])
|
|
||||||
mask |= NSTitledWindowMask;
|
|
||||||
if ([[attributes objectForKey: @"closable"] boolValue])
|
|
||||||
mask |= NSClosableWindowMask;
|
|
||||||
if ([[attributes objectForKey: @"miniaturizable"] boolValue])
|
|
||||||
mask |= NSMiniaturizableWindowMask;
|
|
||||||
if ([[attributes objectForKey: @"resizable"] boolValue])
|
|
||||||
mask |= NSResizableWindowMask;
|
|
||||||
|
|
||||||
#if defined(DEBUG_XIB5)
|
|
||||||
NSWarnMLog(@"mask: %lu", mask);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return [NSNumber numberWithUnsignedInteger: mask];
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) decodeTableColumnResizingMaskForElement: (GSXib5Element*)element
|
|
||||||
{
|
|
||||||
NSDictionary *attributes = [element attributes];
|
|
||||||
|
|
||||||
if (attributes)
|
|
||||||
{
|
|
||||||
NSUInteger mask = NSTableColumnNoResizing;
|
|
||||||
|
|
||||||
if ([[attributes objectForKey: @"resizeWithTable"] boolValue])
|
|
||||||
mask |= NSTableColumnAutoresizingMask;
|
|
||||||
if ([[attributes objectForKey: @"userResizable"] boolValue])
|
|
||||||
mask |= NSTableColumnUserResizingMask;
|
|
||||||
|
|
||||||
#if defined(DEBUG_XIB5)
|
|
||||||
NSWarnMLog(@"mask: %lu", mask);
|
|
||||||
#endif
|
|
||||||
return [NSNumber numberWithUnsignedInteger: mask];
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
#pragma mark - NSView...
|
||||||
- (id) decodeAutoresizingMaskForElement: (GSXib5Element*)element
|
- (id) decodeAutoresizingMaskForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSDictionary *attributes = [element attributes];
|
NSDictionary *attributes = [element attributes];
|
||||||
|
@ -744,87 +661,42 @@ didStartElement: (NSString*)elementName
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) decodeModifierMaskForElement: (GSXib5Element*)element
|
- (id) decodeViewFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
|
Class class = NSClassFromString([element attributeForKey: @"class"]);
|
||||||
id object = nil;
|
id object = nil;
|
||||||
NSDictionary *attributes = [[element elementForKey: @"keyEquivalentModifierMask"] attributes];
|
|
||||||
|
|
||||||
if (attributes == nil)
|
if ([class isSubclassOfClass: [NSView class]] == NO)
|
||||||
{
|
{
|
||||||
// Seems that Apple decided to omit this attribute IF Control key alone
|
NSWarnMLog(@"called for a class that is NOT a sub-class of NSView - class: %@", NSStringFromClass(class));
|
||||||
// is applied. If this key is present WITH NO setting then that NULL
|
|
||||||
// value is used for the modifier mask...
|
|
||||||
object = [NSNumber numberWithUnsignedInteger: NSCommandKeyMask];
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If the modifier mask element is present then no modifier attributes
|
typedef union _GSvFlagsUnion
|
||||||
// equates to no key modifiers applied...
|
{
|
||||||
NSUInteger mask = 0;
|
GSvFlags flags;
|
||||||
|
uint32_t value;
|
||||||
|
} GSvFlagsUnion;
|
||||||
|
|
||||||
if ([[attributes objectForKey:@"option"] boolValue])
|
GSvFlagsUnion mask = { { 0 } };
|
||||||
{
|
NSDictionary *attributes = [element attributes];
|
||||||
mask |= NSAlternateKeyMask;
|
GSXib5Element *autoresizingMask = (GSXib5Element*)[element elementForKey: @"autoresizingMask"];
|
||||||
}
|
|
||||||
if ([[attributes objectForKey:@"alternate"] boolValue])
|
|
||||||
{
|
|
||||||
mask |= NSAlternateKeyMask;
|
|
||||||
}
|
|
||||||
if ([[attributes objectForKey:@"command"] boolValue])
|
|
||||||
{
|
|
||||||
mask |= NSCommandKeyMask;
|
|
||||||
}
|
|
||||||
if ([[attributes objectForKey:@"control"] boolValue])
|
|
||||||
{
|
|
||||||
mask |= NSControlKeyMask;
|
|
||||||
}
|
|
||||||
if ([[attributes objectForKey:@"shift"] boolValue])
|
|
||||||
{
|
|
||||||
mask |= NSShiftKeyMask;
|
|
||||||
}
|
|
||||||
if ([[attributes objectForKey:@"numeric"] boolValue])
|
|
||||||
{
|
|
||||||
mask |= NSNumericPadKeyMask;
|
|
||||||
}
|
|
||||||
if ([[attributes objectForKey:@"help"] boolValue])
|
|
||||||
{
|
|
||||||
mask |= NSHelpKeyMask;
|
|
||||||
}
|
|
||||||
if ([[attributes objectForKey:@"function"] boolValue])
|
|
||||||
{
|
|
||||||
mask |= NSFunctionKeyMask;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(DEBUG_XIB5)
|
mask.flags.autoresizingMask = [[self decodeAutoresizingMaskForElement: autoresizingMask] unsignedIntegerValue];
|
||||||
NSWarnMLog(@"mask: %lu", mask);
|
mask.flags.isHidden = [[attributes objectForKey: @"hidden"] boolValue];
|
||||||
#endif
|
mask.flags.autoresizesSubviews = YES;
|
||||||
|
|
||||||
object = [NSNumber numberWithUnsignedInteger: mask];
|
if ([attributes objectForKey: @"autoresizesSubviews"])
|
||||||
|
mask.flags.autoresizesSubviews = [[attributes objectForKey: @"autoresizesSubviews"] boolValue];
|
||||||
|
|
||||||
|
// Return value...
|
||||||
|
object = [NSNumber numberWithUnsignedInt: mask.value];
|
||||||
}
|
}
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) decodeTableViewGridLinesForElement: (GSXib5Element*)element
|
#pragma mark - NSClipView...
|
||||||
{
|
|
||||||
NSUInteger mask = NSTableViewGridNone;
|
|
||||||
NSDictionary *attributes = [element attributes];
|
|
||||||
|
|
||||||
if ([[attributes objectForKey: @"dashed"] boolValue])
|
|
||||||
mask |= NSTableViewDashedHorizontalGridLineMask;
|
|
||||||
else if ([[attributes objectForKey: @"horizontal"] boolValue])
|
|
||||||
mask |= NSTableViewSolidHorizontalGridLineMask;
|
|
||||||
|
|
||||||
if ([[attributes objectForKey: @"vertical"] boolValue])
|
|
||||||
mask |= NSTableViewSolidHorizontalGridLineMask;
|
|
||||||
|
|
||||||
#if defined(DEBUG_XIB5)
|
|
||||||
NSWarnMLog(@"mask: %p", mask);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return [NSNumber numberWithUnsignedInteger: mask];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) decodeClipViewDocumentViewForElement: (GSXib5Element*)element
|
- (id) decodeClipViewDocumentViewForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSArray *subviews = [self decodeObjectForKey: @"subviews"];
|
NSArray *subviews = [self decodeObjectForKey: @"subviews"];
|
||||||
|
@ -837,6 +709,7 @@ didStartElement: (NSString*)elementName
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSWindow...
|
||||||
- (id) decodeWindowTemplateFlagsForElement: (GSXib5Element*)element
|
- (id) decodeWindowTemplateFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSDictionary *attributes = [element attributes];
|
NSDictionary *attributes = [element attributes];
|
||||||
|
@ -886,6 +759,34 @@ didStartElement: (NSString*)elementName
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) decodeWindowStyleMaskForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
NSDictionary *attributes = [element attributes];
|
||||||
|
|
||||||
|
if (attributes)
|
||||||
|
{
|
||||||
|
NSUInteger mask = 0;
|
||||||
|
|
||||||
|
if ([[attributes objectForKey: @"titled"] boolValue])
|
||||||
|
mask |= NSTitledWindowMask;
|
||||||
|
if ([[attributes objectForKey: @"closable"] boolValue])
|
||||||
|
mask |= NSClosableWindowMask;
|
||||||
|
if ([[attributes objectForKey: @"miniaturizable"] boolValue])
|
||||||
|
mask |= NSMiniaturizableWindowMask;
|
||||||
|
if ([[attributes objectForKey: @"resizable"] boolValue])
|
||||||
|
mask |= NSResizableWindowMask;
|
||||||
|
|
||||||
|
#if defined(DEBUG_XIB5)
|
||||||
|
NSWarnMLog(@"mask: %lu", mask);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return [NSNumber numberWithUnsignedInteger: mask];
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSForm/NSMatrix...
|
||||||
- (id)decodeMatrixFlagsForElement: (GSXib5Element*)element
|
- (id)decodeMatrixFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSString *mode = [element attributeForKey: @"mode"];
|
NSString *mode = [element attributeForKey: @"mode"];
|
||||||
|
@ -1020,6 +921,7 @@ didStartElement: (NSString*)elementName
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSSlider...
|
||||||
- (id)decodeSliderCellTickMarkPositionForElement: (GSXib5Element*)element
|
- (id)decodeSliderCellTickMarkPositionForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSUInteger value = NSTickMarkBelow; // Default...
|
NSUInteger value = NSTickMarkBelow; // Default...
|
||||||
|
@ -1039,21 +941,6 @@ didStartElement: (NSString*)elementName
|
||||||
return [NSNumber numberWithUnsignedInteger: value];
|
return [NSNumber numberWithUnsignedInteger: value];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)decodeColumnResizingTypeForElement: (GSXib5Element*)element
|
|
||||||
{
|
|
||||||
NSUInteger value = NSBrowserNoColumnResizing; // Default...
|
|
||||||
NSString *columnResizingType = [element attributeForKey: @"columnResizingType"];
|
|
||||||
|
|
||||||
if ([@"user" isEqualToString: columnResizingType])
|
|
||||||
value = NSBrowserUserColumnResizing;
|
|
||||||
else if ([@"auto" isEqualToString: columnResizingType])
|
|
||||||
value = NSBrowserAutoColumnResizing;
|
|
||||||
else if (columnResizingType)
|
|
||||||
NSWarnMLog(@"unknown column resizing type: %@", columnResizingType);
|
|
||||||
|
|
||||||
return [NSNumber numberWithUnsignedInteger: value];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)decodeSliderCellTypeForElement: (GSXib5Element*)element
|
- (id)decodeSliderCellTypeForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSUInteger value = NSCircularSlider; // Default...
|
NSUInteger value = NSCircularSlider; // Default...
|
||||||
|
@ -1082,6 +969,7 @@ didStartElement: (NSString*)elementName
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSMenu/NSMenuItem...
|
||||||
- (id)decodePullsDownForElement: (GSXib5Element*)element
|
- (id)decodePullsDownForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSString *pullsDown = [element attributeForKey: @"pullsDown"];
|
NSString *pullsDown = [element attributeForKey: @"pullsDown"];
|
||||||
|
@ -1135,18 +1023,6 @@ didStartElement: (NSString*)elementName
|
||||||
return [NSNumber numberWithUnsignedInteger: index];
|
return [NSNumber numberWithUnsignedInteger: index];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)decodeCellPrototypeForElement: (GSXib5Element*)element
|
|
||||||
{
|
|
||||||
id object = [[NSBrowserCell alloc] initTextCell: @"BrowserItem"];
|
|
||||||
|
|
||||||
[object setType: NSPushInCell];
|
|
||||||
[object setWraps: NO];
|
|
||||||
[object sendActionOn: NSLeftMouseUpMask];
|
|
||||||
[object setEnabled: YES];
|
|
||||||
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)decodeTitleCellForElement: (GSXib5Element*)element
|
- (id)decodeTitleCellForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
id object = nil;
|
id object = nil;
|
||||||
|
@ -1190,6 +1066,68 @@ didStartElement: (NSString*)elementName
|
||||||
return [NSNumber numberWithUnsignedInteger: value];
|
return [NSNumber numberWithUnsignedInteger: value];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) decodeModifierMaskForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
id object = nil;
|
||||||
|
NSDictionary *attributes = [[element elementForKey: @"keyEquivalentModifierMask"] attributes];
|
||||||
|
|
||||||
|
if (attributes == nil)
|
||||||
|
{
|
||||||
|
// Seems that Apple decided to omit this attribute IF Control key alone
|
||||||
|
// is applied. If this key is present WITH NO setting then that NULL
|
||||||
|
// value is used for the modifier mask...
|
||||||
|
object = [NSNumber numberWithUnsignedInteger: NSCommandKeyMask];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If the modifier mask element is present then no modifier attributes
|
||||||
|
// equates to no key modifiers applied...
|
||||||
|
NSUInteger mask = 0;
|
||||||
|
|
||||||
|
if ([[attributes objectForKey:@"option"] boolValue])
|
||||||
|
{
|
||||||
|
mask |= NSAlternateKeyMask;
|
||||||
|
}
|
||||||
|
if ([[attributes objectForKey:@"alternate"] boolValue])
|
||||||
|
{
|
||||||
|
mask |= NSAlternateKeyMask;
|
||||||
|
}
|
||||||
|
if ([[attributes objectForKey:@"command"] boolValue])
|
||||||
|
{
|
||||||
|
mask |= NSCommandKeyMask;
|
||||||
|
}
|
||||||
|
if ([[attributes objectForKey:@"control"] boolValue])
|
||||||
|
{
|
||||||
|
mask |= NSControlKeyMask;
|
||||||
|
}
|
||||||
|
if ([[attributes objectForKey:@"shift"] boolValue])
|
||||||
|
{
|
||||||
|
mask |= NSShiftKeyMask;
|
||||||
|
}
|
||||||
|
if ([[attributes objectForKey:@"numeric"] boolValue])
|
||||||
|
{
|
||||||
|
mask |= NSNumericPadKeyMask;
|
||||||
|
}
|
||||||
|
if ([[attributes objectForKey:@"help"] boolValue])
|
||||||
|
{
|
||||||
|
mask |= NSHelpKeyMask;
|
||||||
|
}
|
||||||
|
if ([[attributes objectForKey:@"function"] boolValue])
|
||||||
|
{
|
||||||
|
mask |= NSFunctionKeyMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(DEBUG_XIB5)
|
||||||
|
NSWarnMLog(@"mask: %lu", mask);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
object = [NSNumber numberWithUnsignedInteger: mask];
|
||||||
|
}
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSBox...
|
||||||
- (id)decodeBoxTypeForElement: (GSXib5Element*)element
|
- (id)decodeBoxTypeForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSString *boxType = [element attributeForKey: @"boxType"];
|
NSString *boxType = [element attributeForKey: @"boxType"];
|
||||||
|
@ -1240,6 +1178,7 @@ didStartElement: (NSString*)elementName
|
||||||
return [NSNumber numberWithUnsignedInteger: value];
|
return [NSNumber numberWithUnsignedInteger: value];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSFont...
|
||||||
- (id)decodeFontSizeForElement: (GSXib5Element*)element
|
- (id)decodeFontSizeForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSDictionary *attributes = [element attributes];
|
NSDictionary *attributes = [element attributes];
|
||||||
|
@ -1307,6 +1246,7 @@ didStartElement: (NSString*)elementName
|
||||||
return [NSNumber numberWithInteger: style];
|
return [NSNumber numberWithInteger: style];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSProgressIndicator...
|
||||||
- (id) decodeProgressIndicatorFlagsForElement: (GSXib5Element*)element
|
- (id) decodeProgressIndicatorFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
|
@ -1330,6 +1270,7 @@ didStartElement: (NSString*)elementName
|
||||||
return [NSNumber numberWithInt: flags];
|
return [NSNumber numberWithInt: flags];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSTextView...
|
||||||
- (id) decodeTextViewFlagsForElement: (GSXib5Element*)element
|
- (id) decodeTextViewFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
|
@ -1399,6 +1340,7 @@ didStartElement: (NSString*)elementName
|
||||||
return AUTORELEASE(object);
|
return AUTORELEASE(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSColor...
|
||||||
- (id) decodeColorSpaceForElement: (GSXib5Element*)element
|
- (id) decodeColorSpaceForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
// <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
// <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
@ -1506,6 +1448,7 @@ didStartElement: (NSString*)elementName
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSScrollView/NSScroller...
|
||||||
- (id) decodeScrollerFlagsForElement: (GSXib5Element*)element
|
- (id) decodeScrollerFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSUInteger mask = NSBezelBorder; // Default...
|
NSUInteger mask = NSBezelBorder; // Default...
|
||||||
|
@ -1640,6 +1583,7 @@ didStartElement: (NSString*)elementName
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSTableView...
|
||||||
- (id) decodeTableViewFlagsForElement: (GSXib5Element*)element
|
- (id) decodeTableViewFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
typedef union _GSTableViewFlagsUnion
|
typedef union _GSTableViewFlagsUnion
|
||||||
|
@ -1672,6 +1616,84 @@ didStartElement: (NSString*)elementName
|
||||||
return [NSNumber numberWithUnsignedInteger: mask.value];
|
return [NSNumber numberWithUnsignedInteger: mask.value];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) decodeTableViewGridLinesForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
NSUInteger mask = NSTableViewGridNone;
|
||||||
|
NSDictionary *attributes = [element attributes];
|
||||||
|
|
||||||
|
if ([[attributes objectForKey: @"dashed"] boolValue])
|
||||||
|
mask |= NSTableViewDashedHorizontalGridLineMask;
|
||||||
|
else if ([[attributes objectForKey: @"horizontal"] boolValue])
|
||||||
|
mask |= NSTableViewSolidHorizontalGridLineMask;
|
||||||
|
|
||||||
|
if ([[attributes objectForKey: @"vertical"] boolValue])
|
||||||
|
mask |= NSTableViewSolidHorizontalGridLineMask;
|
||||||
|
|
||||||
|
#if defined(DEBUG_XIB5)
|
||||||
|
NSWarnMLog(@"mask: %p", mask);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return [NSNumber numberWithUnsignedInteger: mask];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) decodeIntercellSpacingHeightForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
element = (GSXib5Element*)[element elementForKey: @"intercellSpacing"];
|
||||||
|
return [element attributeForKey: @"height"];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) decodeIntercellSpacingWidthForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
element = (GSXib5Element*)[element elementForKey: @"intercellSpacing"];
|
||||||
|
return [element attributeForKey: @"width"];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) decodeColumnAutoresizingStyleForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
NSString *style = [element attributeForKey: @"columnAutoresizingStyle"];
|
||||||
|
NSUInteger value = NSTableViewUniformColumnAutoresizingStyle;
|
||||||
|
|
||||||
|
if ([@"none" isEqualToString: style])
|
||||||
|
value = NSTableViewNoColumnAutoresizing;
|
||||||
|
else if ([@"firstColumnOnly" isEqualToString: style])
|
||||||
|
value = NSTableViewFirstColumnOnlyAutoresizingStyle;
|
||||||
|
else if ([@"lastColumnOnly" isEqualToString: style])
|
||||||
|
value = NSTableViewLastColumnOnlyAutoresizingStyle;
|
||||||
|
else if ([@"sequential" isEqualToString: style])
|
||||||
|
value = NSTableViewSequentialColumnAutoresizingStyle;
|
||||||
|
else if ([@"reverseSequential" isEqualToString: style])
|
||||||
|
value = NSTableViewReverseSequentialColumnAutoresizingStyle;
|
||||||
|
|
||||||
|
#if defined(DEBUG_XIB5)
|
||||||
|
NSWarnMLog(@"value: %lu", value);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return [NSNumber numberWithUnsignedInteger: value];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) decodeTableColumnResizingMaskForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
NSDictionary *attributes = [element attributes];
|
||||||
|
|
||||||
|
if (attributes)
|
||||||
|
{
|
||||||
|
NSUInteger mask = NSTableColumnNoResizing;
|
||||||
|
|
||||||
|
if ([[attributes objectForKey: @"resizeWithTable"] boolValue])
|
||||||
|
mask |= NSTableColumnAutoresizingMask;
|
||||||
|
if ([[attributes objectForKey: @"userResizable"] boolValue])
|
||||||
|
mask |= NSTableColumnUserResizingMask;
|
||||||
|
|
||||||
|
#if defined(DEBUG_XIB5)
|
||||||
|
NSWarnMLog(@"mask: %lu", mask);
|
||||||
|
#endif
|
||||||
|
return [NSNumber numberWithUnsignedInteger: mask];
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSTabView...
|
||||||
- (id) decodeTabViewFlagsForElement: (GSXib5Element*)element
|
- (id) decodeTabViewFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
GSTabViewTypeFlagsUnion mask = { { 0 } };
|
GSTabViewTypeFlagsUnion mask = { { 0 } };
|
||||||
|
@ -1728,6 +1750,7 @@ didStartElement: (NSString*)elementName
|
||||||
return [NSNumber numberWithUnsignedInteger: mask.value];
|
return [NSNumber numberWithUnsignedInteger: mask.value];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSTableView/NSTabView...
|
||||||
- (id) decodeTViewFlagsForElement: (GSXib5Element*)element
|
- (id) decodeTViewFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSString *classname = [element attributeForKey: @"class"];
|
NSString *classname = [element attributeForKey: @"class"];
|
||||||
|
@ -1742,6 +1765,7 @@ didStartElement: (NSString*)elementName
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSBrowser...
|
||||||
- (id) decodeBrowserFlagsForElement: (GSXib5Element*)element
|
- (id) decodeBrowserFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSUInteger mask = 0;
|
NSUInteger mask = 0;
|
||||||
|
@ -1774,6 +1798,34 @@ didStartElement: (NSString*)elementName
|
||||||
return [NSNumber numberWithUnsignedInt: mask];
|
return [NSNumber numberWithUnsignedInt: mask];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id)decodeCellPrototypeForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
id object = [[NSBrowserCell alloc] initTextCell: @"BrowserItem"];
|
||||||
|
|
||||||
|
[object setType: NSPushInCell];
|
||||||
|
[object setWraps: NO];
|
||||||
|
[object sendActionOn: NSLeftMouseUpMask];
|
||||||
|
[object setEnabled: YES];
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)decodeColumnResizingTypeForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
NSUInteger value = NSBrowserNoColumnResizing; // Default...
|
||||||
|
NSString *columnResizingType = [element attributeForKey: @"columnResizingType"];
|
||||||
|
|
||||||
|
if ([@"user" isEqualToString: columnResizingType])
|
||||||
|
value = NSBrowserUserColumnResizing;
|
||||||
|
else if ([@"auto" isEqualToString: columnResizingType])
|
||||||
|
value = NSBrowserAutoColumnResizing;
|
||||||
|
else if (columnResizingType)
|
||||||
|
NSWarnMLog(@"unknown column resizing type: %@", columnResizingType);
|
||||||
|
|
||||||
|
return [NSNumber numberWithUnsignedInteger: value];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSCell...
|
||||||
- (id) decodeClipViewFlagsForElement: (GSXib5Element*)element
|
- (id) decodeClipViewFlagsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
Class class = NSClassFromString([element attributeForKey: @"class"]);
|
Class class = NSClassFromString([element attributeForKey: @"class"]);
|
||||||
|
@ -1808,41 +1860,6 @@ didStartElement: (NSString*)elementName
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) decodeViewFlagsForElement: (GSXib5Element*)element
|
|
||||||
{
|
|
||||||
Class class = NSClassFromString([element attributeForKey: @"class"]);
|
|
||||||
id object = nil;
|
|
||||||
|
|
||||||
if ([class isSubclassOfClass: [NSView class]] == NO)
|
|
||||||
{
|
|
||||||
NSWarnMLog(@"called for a class that is NOT a sub-class of NSView - class: %@", NSStringFromClass(class));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
typedef union _GSvFlagsUnion
|
|
||||||
{
|
|
||||||
GSvFlags flags;
|
|
||||||
uint32_t value;
|
|
||||||
} GSvFlagsUnion;
|
|
||||||
|
|
||||||
GSvFlagsUnion mask = { { 0 } };
|
|
||||||
NSDictionary *attributes = [element attributes];
|
|
||||||
GSXib5Element *autoresizingMask = (GSXib5Element*)[element elementForKey: @"autoresizingMask"];
|
|
||||||
|
|
||||||
mask.flags.autoresizingMask = [[self decodeAutoresizingMaskForElement: autoresizingMask] unsignedIntegerValue];
|
|
||||||
mask.flags.isHidden = [[attributes objectForKey: @"hidden"] boolValue];
|
|
||||||
mask.flags.autoresizesSubviews = YES;
|
|
||||||
|
|
||||||
if ([attributes objectForKey: @"autoresizesSubviews"])
|
|
||||||
mask.flags.autoresizesSubviews = [[attributes objectForKey: @"autoresizesSubviews"] boolValue];
|
|
||||||
|
|
||||||
// Return value...
|
|
||||||
object = [NSNumber numberWithUnsignedInt: mask.value];
|
|
||||||
}
|
|
||||||
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) decodeCellContentsForElement: (GSXib5Element*)element
|
- (id) decodeCellContentsForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
Class class = NSClassFromString([element attributeForKey: @"class"]);
|
Class class = NSClassFromString([element attributeForKey: @"class"]);
|
||||||
|
@ -2075,6 +2092,71 @@ didStartElement: (NSString*)elementName
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) decodeCellNormalImageForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
Class class = NSClassFromString([element attributeForKey: @"class"]);
|
||||||
|
id object = nil;
|
||||||
|
|
||||||
|
if ([class isSubclassOfClass: [NSCell class]])
|
||||||
|
{
|
||||||
|
if ([element attributeForKey: @"image"])
|
||||||
|
{
|
||||||
|
object = [NSImage imageNamed: [element attributeForKey: @"image"]];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSString *type = [element attributeForKey: @"type"];
|
||||||
|
|
||||||
|
if ([@"radio" isEqualToString: type])
|
||||||
|
{
|
||||||
|
object = [NSImage imageNamed: @"NSRadioButton"];
|
||||||
|
}
|
||||||
|
else if ([@"check" isEqualToString: type])
|
||||||
|
{
|
||||||
|
object = [NSImage imageNamed: @"NSSwitch"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if defined(DEBUG_XIB5)
|
||||||
|
NSWarnMLog(@"object: %@", object);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) decodeCellAlternateImageForElement: (GSXib5Element*)element
|
||||||
|
{
|
||||||
|
Class class = NSClassFromString([element attributeForKey: @"class"]);
|
||||||
|
id object = nil;
|
||||||
|
|
||||||
|
if ([class isSubclassOfClass: [NSCell class]])
|
||||||
|
{
|
||||||
|
if ([element attributeForKey: @"alternateImage"])
|
||||||
|
{
|
||||||
|
object = [NSImage imageNamed: [element attributeForKey: @"alternateImage"]];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSString *type = [element attributeForKey: @"type"];
|
||||||
|
|
||||||
|
if ([@"radio" isEqualToString: type])
|
||||||
|
{
|
||||||
|
object = [NSImage imageNamed: @"NSRadioButton"];
|
||||||
|
}
|
||||||
|
else if ([@"check" isEqualToString: type])
|
||||||
|
{
|
||||||
|
object = [NSImage imageNamed: @"NSSwitch"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if defined(DEBUG_XIB5)
|
||||||
|
NSWarnMLog(@"object: %@", object);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSButton...
|
||||||
- (id) decodeButtonFlags1ForElement: (GSXib5Element*)element
|
- (id) decodeButtonFlags1ForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
NSNumber *value = nil;
|
NSNumber *value = nil;
|
||||||
|
@ -2224,69 +2306,6 @@ didStartElement: (NSString*)elementName
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) decodeCellNormalImageForElement: (GSXib5Element*)element
|
|
||||||
{
|
|
||||||
Class class = NSClassFromString([element attributeForKey: @"class"]);
|
|
||||||
id object = nil;
|
|
||||||
|
|
||||||
if ([class isSubclassOfClass: [NSCell class]])
|
|
||||||
{
|
|
||||||
if ([element attributeForKey: @"image"])
|
|
||||||
{
|
|
||||||
object = [NSImage imageNamed: [element attributeForKey: @"image"]];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NSString *type = [element attributeForKey: @"type"];
|
|
||||||
|
|
||||||
if ([@"radio" isEqualToString: type])
|
|
||||||
{
|
|
||||||
object = [NSImage imageNamed: @"NSRadioButton"];
|
|
||||||
}
|
|
||||||
else if ([@"check" isEqualToString: type])
|
|
||||||
{
|
|
||||||
object = [NSImage imageNamed: @"NSSwitch"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#if defined(DEBUG_XIB5)
|
|
||||||
NSWarnMLog(@"object: %@", object);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) decodeCellAlternateImageForElement: (GSXib5Element*)element
|
|
||||||
{
|
|
||||||
Class class = NSClassFromString([element attributeForKey: @"class"]);
|
|
||||||
id object = nil;
|
|
||||||
|
|
||||||
if ([class isSubclassOfClass: [NSCell class]])
|
|
||||||
{
|
|
||||||
if ([element attributeForKey: @"alternateImage"])
|
|
||||||
{
|
|
||||||
object = [NSImage imageNamed: [element attributeForKey: @"alternateImage"]];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NSString *type = [element attributeForKey: @"type"];
|
|
||||||
|
|
||||||
if ([@"radio" isEqualToString: type])
|
|
||||||
{
|
|
||||||
object = [NSImage imageNamed: @"NSRadioButton"];
|
|
||||||
}
|
|
||||||
else if ([@"check" isEqualToString: type])
|
|
||||||
{
|
|
||||||
object = [NSImage imageNamed: @"NSSwitch"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#if defined(DEBUG_XIB5)
|
|
||||||
NSWarnMLog(@"object: %@", object);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) decodeButtonStateForElement: (GSXib5Element*)element
|
- (id) decodeButtonStateForElement: (GSXib5Element*)element
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue