mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-04 11:50:42 +00:00
Move NSCustomObject5 functionality to NSCustomObject
This commit is contained in:
parent
53452e411e
commit
a383b12aef
4 changed files with 33 additions and 56 deletions
|
@ -217,6 +217,7 @@ typedef struct _GSWindowTemplateFlags
|
||||||
NSString *_className;
|
NSString *_className;
|
||||||
NSString *_extension;
|
NSString *_extension;
|
||||||
id _object;
|
id _object;
|
||||||
|
NSString *_userLabel;
|
||||||
}
|
}
|
||||||
- (void) setClassName: (NSString *)name;
|
- (void) setClassName: (NSString *)name;
|
||||||
- (NSString *)className;
|
- (NSString *)className;
|
||||||
|
@ -224,6 +225,7 @@ typedef struct _GSWindowTemplateFlags
|
||||||
- (NSString *)extension;
|
- (NSString *)extension;
|
||||||
- (void) setRealObject: (id)obj;
|
- (void) setRealObject: (id)obj;
|
||||||
- (id) realObject;
|
- (id) realObject;
|
||||||
|
- (NSString *) userLabel;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface NSCustomView : NSView <GSNibLoading>
|
@interface NSCustomView : NSView <GSNibLoading>
|
||||||
|
|
|
@ -49,14 +49,6 @@
|
||||||
- (NSRange) decodeRangeForKey: (NSString*)key;
|
- (NSRange) decodeRangeForKey: (NSString*)key;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface NSCustomObject5 : NSCustomObject
|
|
||||||
{
|
|
||||||
NSString *_userLabel;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString*) userLabel;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface IBActionConnection5 : IBActionConnection
|
@interface IBActionConnection5 : IBActionConnection
|
||||||
{
|
{
|
||||||
NSString *trigger;
|
NSString *trigger;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Author: Gregory John Casamento
|
Author: Gregory John Casamento
|
||||||
Date: 2003, 2005
|
Date: 2003, 2005, 2020
|
||||||
Author: Fred Kiefer
|
Author: Fred Kiefer
|
||||||
Date: 2003, 2010
|
Date: 2003, 2010
|
||||||
|
|
||||||
|
@ -958,6 +958,9 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation NSCustomObject
|
@implementation NSCustomObject
|
||||||
|
|
||||||
|
static NSString *ApplicationClass = nil;
|
||||||
|
|
||||||
- (void) setClassName: (NSString *)name
|
- (void) setClassName: (NSString *)name
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(_className, name);
|
ASSIGNCOPY(_className, name);
|
||||||
|
@ -995,6 +998,27 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
|
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
|
||||||
ASSIGN(_extension, [coder decodeObjectForKey: @"NSExtension"]);
|
ASSIGN(_extension, [coder decodeObjectForKey: @"NSExtension"]);
|
||||||
ASSIGN(_object, [coder decodeObjectForKey: @"NSObject"]);
|
ASSIGN(_object, [coder decodeObjectForKey: @"NSObject"]);
|
||||||
|
|
||||||
|
// If we've not set the general application class yet...
|
||||||
|
if (_className && (ApplicationClass == nil) &&
|
||||||
|
([NSClassFromString(_className) isKindOfClass: [NSApplication class]]))
|
||||||
|
{
|
||||||
|
ASSIGNCOPY(ApplicationClass, _className);
|
||||||
|
}
|
||||||
|
|
||||||
|
_userLabel = [coder decodeObjectForKey: @"userLabel"];
|
||||||
|
|
||||||
|
// Override this one type...
|
||||||
|
if (_userLabel)
|
||||||
|
{
|
||||||
|
if ([@"Application" isEqualToString: _userLabel])
|
||||||
|
{
|
||||||
|
if (ApplicationClass == nil)
|
||||||
|
ASSIGN(_className, @"NSApplication");
|
||||||
|
else
|
||||||
|
ASSIGN(_className, ApplicationClass);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1022,6 +1046,11 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) userLabel
|
||||||
|
{
|
||||||
|
return _userLabel;
|
||||||
|
}
|
||||||
|
|
||||||
- (id) nibInstantiate
|
- (id) nibInstantiate
|
||||||
{
|
{
|
||||||
if (_object == nil)
|
if (_object == nil)
|
||||||
|
|
|
@ -60,52 +60,6 @@
|
||||||
|
|
||||||
#define DEBUG_XIB5 0
|
#define DEBUG_XIB5 0
|
||||||
|
|
||||||
@implementation NSCustomObject5
|
|
||||||
|
|
||||||
static NSString *ApplicationClass = nil;
|
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
|
||||||
{
|
|
||||||
self = [super initWithCoder: coder];
|
|
||||||
|
|
||||||
if (self)
|
|
||||||
{
|
|
||||||
// If we've not set the general application class yet...
|
|
||||||
if (_className && (ApplicationClass == nil) &&
|
|
||||||
([NSClassFromString(_className) isKindOfClass: [NSApplication class]]))
|
|
||||||
{
|
|
||||||
ASSIGNCOPY(ApplicationClass, _className);
|
|
||||||
}
|
|
||||||
|
|
||||||
_userLabel = [coder decodeObjectForKey: @"userLabel"];
|
|
||||||
|
|
||||||
// Override this one type...
|
|
||||||
if (_userLabel)
|
|
||||||
{
|
|
||||||
if ([@"Application" isEqualToString: _userLabel])
|
|
||||||
{
|
|
||||||
if (ApplicationClass == nil)
|
|
||||||
ASSIGN(_className, @"NSApplication");
|
|
||||||
else
|
|
||||||
ASSIGN(_className, ApplicationClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *) userLabel
|
|
||||||
{
|
|
||||||
return _userLabel;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *) description
|
|
||||||
{
|
|
||||||
return [[super description] stringByAppendingFormat: @"%@ - %@", _userLabel, _className];
|
|
||||||
}
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation IBActionConnection5
|
@implementation IBActionConnection5
|
||||||
|
|
||||||
- (instancetype) initWithCoder: (NSCoder *)coder
|
- (instancetype) initWithCoder: (NSCoder *)coder
|
||||||
|
@ -292,7 +246,7 @@ static NSArray *XmlBoolDefaultYes = nil;
|
||||||
@"NSMutableArray", @"rowTemplates",
|
@"NSMutableArray", @"rowTemplates",
|
||||||
@"NSSegmentItem", @"segment",
|
@"NSSegmentItem", @"segment",
|
||||||
@"NSCell", @"customCell",
|
@"NSCell", @"customCell",
|
||||||
@"NSCustomObject5", @"customObject",
|
@"NSCustomObject", @"customObject",
|
||||||
@"IBOutletConnection5", @"outlet",
|
@"IBOutletConnection5", @"outlet",
|
||||||
@"IBActionConnection5", @"action",
|
@"IBActionConnection5", @"action",
|
||||||
@"NSNibBindingConnector", @"binding",
|
@"NSNibBindingConnector", @"binding",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue