Integrate XIB loading methods used in Gorm.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34055 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2011-10-25 09:06:01 +00:00
parent a47199291f
commit 6aafb3c0e6
3 changed files with 71 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2011-10-25 Fred Kiefer <FredKiefer@gmx.de>
* Headers/Additions/GNUstepGUI/GSXibLoading.h,
* Source/GSXibLoader.m: Integrate method used in Gorm.
2011-10-24 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBox.m (-initWithCoder:): Rearrange order of keyed

View file

@ -71,6 +71,10 @@
id source;
id destination;
}
- (NSString *) label;
- (id) source;
- (id) destination;
- (NSNibConnector *) nibConnector;
- (id) nibInstantiate;
- (void) establishConnection;
@end
@ -96,6 +100,7 @@
IBConnection *connection;
int connectionID;
}
- (IBConnection *) connection;
@end
@interface IBToolTipAttribute: NSObject
@ -114,6 +119,7 @@
id parent;
}
- (id) object;
- (id) parent;
- (NSInteger) objectID;
@end
@ -137,6 +143,8 @@
int maxID;
}
- (id) nibInstantiate;
- (NSEnumerator *) connectionRecordEnumerator;
- (NSEnumerator *) objectRecordEnumerator;
@end
@interface GSXibElement: NSObject

View file

@ -211,6 +211,44 @@
[super dealloc];
}
- (NSString *) label
{
return label;
}
- (id) source
{
return source;
}
- (id) destination
{
return destination;
}
- (NSNibConnector *) nibConnector
{
NSString *tag = [self label];
NSRange colonRange = [tag rangeOfString: @":"];
unsigned int location = colonRange.location;
NSNibConnector *result = nil;
if(location == NSNotFound)
{
result = [[NSNibOutletConnector alloc] init];
}
else
{
result = [[NSNibControlConnector alloc] init];
}
[result setDestination: [self destination]];
[result setSource: [self source]];
[result setLabel: [self label]];
return result;
}
- (id) nibInstantiate
{
if ([source respondsToSelector: @selector(nibInstantiate)])
@ -351,6 +389,11 @@
[super dealloc];
}
- (IBConnection *) connection
{
return connection;
}
- (id) nibInstantiate
{
ASSIGN(connection, [connection nibInstantiate]);
@ -447,6 +490,11 @@
return object;
}
- (id) parent
{
return parent;
}
- (NSInteger) objectID
{
return objectID;
@ -548,6 +596,16 @@
[super dealloc];
}
- (NSEnumerator *) connectionRecordEnumerator
{
return [connectionRecords objectEnumerator];
}
- (NSEnumerator *) objectRecordEnumerator
{
return [[objectRecords orderedObjects] objectEnumerator];
}
- (id) nibInstantiate
{
NSEnumerator *en;