Remove storyboard specific modifications

This commit is contained in:
Gregory John Casamento 2020-06-22 07:50:17 -04:00
parent 155662d442
commit 34cd60e043
4 changed files with 86 additions and 10 deletions

View file

@ -22,10 +22,11 @@
Boston, MA 02110 USA.
*/
#ifndef _NSSequePerforming_h_GNUSTEP_GUI_INCLUDE
#define _NSSequePerforming_h_GNUSTEP_GUI_INCLUDE
#ifndef _NSSeguePerforming_h_GNUSTEP_GUI_INCLUDE
#define _NSSeguePerforming_h_GNUSTEP_GUI_INCLUDE
#import <Foundation/NSObject.h>
#import <AppKit/NSStoryboardSegue.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
@ -34,7 +35,14 @@ extern "C" {
#endif
@protocol NSSequePerforming
- (void)performSegueWithIdentifier: (NSStoryboardSegueIdentifier)identifier
sender: (id)sender;
- (void)prepareForSegue: (NSStoryboardSegue *)segue
sender: (id)sender;
- (BOOL)shouldPerformSegueWithIdentifier: (NSStoryboardSegueIdentifier)identifier
sender: (id)sender;
@end
#if defined(__cplusplus)
@ -43,5 +51,5 @@ extern "C" {
#endif /* GS_API_MACOSX */
#endif /* _NSSequePerforming_h_GNUSTEP_GUI_INCLUDE */
#endif /* _NSSeguePerforming_h_GNUSTEP_GUI_INCLUDE */

View file

@ -32,9 +32,33 @@
#if defined(__cplusplus)
extern "C" {
#endif
typedef NSString *NSStoryboardSegueIdentifier;
DEFINE_BLOCK_TYPE_NO_ARGS(GSStoryboardSeguePerformHandler, void);
@interface NSStoryboardSegue : NSObject
{
id _sourceController;
id _destinationController;
NSStoryboardSegueIdentifier _identifier;
}
- (id) sourceController;
- (id) destinationController;
- (NSStoryboardSegueIdentifier)identifier;
+ (instancetype)segueWithIdentifier: (NSStoryboardSegueIdentifier)identifier
source: (id)sourceController
destination: (id)destinationController
performHandler: (GSStoryboardSeguePerformHandler)performHandler;
- (instancetype)initWithIdentifier: (NSStoryboardSegueIdentifier)identifier
source: (id)sourceController
destination: (id)destinationController;
- (void)perform;
@end
#if defined(__cplusplus)

View file

@ -169,13 +169,13 @@ static NSArray *XmlReferenceAttributes = nil;
static NSArray *XmlConnectionRecordTags = nil;
static NSArray *XmlBoolDefaultYes = nil;
@interface NSString (XibExtension)
@interface NSString (___XibExtension___)
- (BOOL) hasPrefixedClassName;
@end
@implementation NSString (XibExtension)
@implementation NSString (___XibExtension___)
- (BOOL) hasPrefixedClassName
{
@ -198,7 +198,6 @@ static NSArray *XmlBoolDefaultYes = nil;
// associated class...
XmlTagToObjectClassMap =
[NSDictionary dictionaryWithObjectsAndKeys:
@"NSMutableArray", @"scenes",
@"NSMutableArray", @"objects",
@"NSMutableArray", @"items",
@"NSMutableArray", @"tabViewItems",
@ -225,8 +224,6 @@ static NSArray *XmlBoolDefaultYes = nil;
@"NSWindowTemplate", @"window",
@"NSView", @"tableCellView",
@"IBUserDefinedRuntimeAttribute5", @"userDefinedRuntimeAttribute",
@"GSStoryboardScene", @"scene",
@"GSStoryboardDocument", @"document",
@"NSURL", @"url",
nil];
RETAIN(XmlTagToObjectClassMap);
@ -237,7 +234,7 @@ static NSArray *XmlBoolDefaultYes = nil;
XmlTagsToSkip = [NSArray arrayWithObject: @"dependencies"];
RETAIN(XmlTagsToSkip);
ClassNamePrefixes = [NSArray arrayWithObjects: @"NS", @"IB", @"GS", nil];
ClassNamePrefixes = [NSArray arrayWithObjects: @"NS", @"IB", nil];
RETAIN(ClassNamePrefixes);
XmlReferenceAttributes = [NSArray arrayWithObjects: @"headerView", @"initialItem",

View file

@ -22,9 +22,56 @@
Boston, MA 02110 USA.
*/
#import <AppKit/NSStoryboardSegue.h>
#import "AppKit/NSStoryboardSegue.h"
@implementation NSStoryboardSegue
- (id) sourceController
{
return _sourceController;
}
- (id) destinationController
{
return _destinationController;
}
- (NSStoryboardSegueIdentifier)identifier
{
return _identifier;
}
+ (instancetype)segueWithIdentifier: (NSStoryboardSegueIdentifier)identifier
source: (id)sourceController
destination: (id)destinationController
performHandler: (GSStoryboardSeguePerformHandler)performHandler
{
NSStoryboardSegue *segue = [[NSStoryboardSegue alloc] initWithIdentifier: identifier
source: sourceController
destination: destinationController];
AUTORELEASE(segue);
CALL_BLOCK_NO_ARGS(performHandler);
return segue;
}
- (instancetype)initWithIdentifier: (NSStoryboardSegueIdentifier)identifier
source: (id)sourceController
destination: (id)destinationController
{
self = [super init];
if (self != nil)
{
ASSIGN(_sourceController, sourceController);
ASSIGN(_destinationController, destinationController);
ASSIGN(_identifier, identifier);
}
return self;
}
- (void)perform
{
// TBD...
}
@end