mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 00:31:00 +00:00
Add version of GSStoryboaddKeyedUnarchiver
This commit is contained in:
parent
d3661d974c
commit
2ae0dbc0da
6 changed files with 90 additions and 3 deletions
|
@ -346,6 +346,7 @@ GSToolTips.m \
|
||||||
GSToolbarView.m \
|
GSToolbarView.m \
|
||||||
GSToolbarCustomizationPalette.m \
|
GSToolbarCustomizationPalette.m \
|
||||||
GSStandardWindowDecorationView.m \
|
GSStandardWindowDecorationView.m \
|
||||||
|
GSStoryboardKeyedUnarchiver.m \
|
||||||
GSWindowDecorationView.m \
|
GSWindowDecorationView.m \
|
||||||
GSPrinting.m \
|
GSPrinting.m \
|
||||||
GSPrintOperation.m \
|
GSPrintOperation.m \
|
||||||
|
|
43
Source/GSStoryboardKeyedUnarchiver.h
Normal file
43
Source/GSStoryboardKeyedUnarchiver.h
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/* Definition of class GSStoryboardKeyedUnarchiver
|
||||||
|
Copyright (C) 2024 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
By: Gregory John Casamento
|
||||||
|
Date: 14-05-2024
|
||||||
|
|
||||||
|
This file is part of the GNUstep Library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free
|
||||||
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02110 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _GSStoryboardKeyedUnarchiver_h_GNUSTEP_GUI_INCLUDE
|
||||||
|
#define _GSStoryboardKeyedUnarchiver_h_GNUSTEP_GUI_INCLUDE
|
||||||
|
|
||||||
|
#import "GSXib5KeyedUnarchiver.h"
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@interface GSStoryboardKeyedUnarchiver : GSXib5KeyedUnarchiver
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _GSStoryboardKeyedUnarchiver_h_GNUSTEP_GUI_INCLUDE */
|
||||||
|
|
30
Source/GSStoryboardKeyedUnarchiver.m
Normal file
30
Source/GSStoryboardKeyedUnarchiver.m
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
/* Implementation of class GSStoryboardKeyedUnarchiver
|
||||||
|
Copyright (C) 2024 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
By: Gregory John Casamento
|
||||||
|
Date: 14-05-2024
|
||||||
|
|
||||||
|
This file is part of the GNUstep Library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free
|
||||||
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02110 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "GSStoryboardKeyedUnarchiver.h"
|
||||||
|
|
||||||
|
@implementation GSStoryboardKeyedUnarchiver
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
GSXibElement *_orderedObjects;
|
GSXibElement *_orderedObjects;
|
||||||
GSXibElement *_flattenedProperties;
|
GSXibElement *_flattenedProperties;
|
||||||
GSXibElement *_runtimeAttributes;
|
GSXibElement *_runtimeAttributes;
|
||||||
|
GSXibElement *_scenes;
|
||||||
NSMutableDictionary *_orderedObjectsDict;
|
NSMutableDictionary *_orderedObjectsDict;
|
||||||
NSArray *_resources;
|
NSArray *_resources;
|
||||||
}
|
}
|
||||||
|
|
|
@ -747,6 +747,11 @@ static NSArray *XmlBoolDefaultYes = nil;
|
||||||
@"connectionRecords", @"key",
|
@"connectionRecords", @"key",
|
||||||
nil]];
|
nil]];
|
||||||
|
|
||||||
|
_scenes = [[GSXibElement alloc] initWithType: @"array"
|
||||||
|
andAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
|
@"scenes", @"key",
|
||||||
|
nil]];
|
||||||
|
|
||||||
// objectRecords...
|
// objectRecords...
|
||||||
[_objectRecords setElement: _orderedObjects forKey: @"orderedObjects"];
|
[_objectRecords setElement: _orderedObjects forKey: @"orderedObjects"];
|
||||||
|
|
||||||
|
|
|
@ -35,10 +35,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Foundation/NSXMLDocument.h>
|
#import <Foundation/NSXMLDocument.h>
|
||||||
|
|
||||||
#import "GNUstepGUI/GSXibKeyedUnarchiver.h"
|
#import "GNUstepGUI/GSXibKeyedUnarchiver.h"
|
||||||
#import "GNUstepGUI/GSXibElement.h"
|
#import "GNUstepGUI/GSXibElement.h"
|
||||||
#import "GNUstepGUI/GSNibLoading.h"
|
#import "GNUstepGUI/GSNibLoading.h"
|
||||||
|
|
||||||
#import "GSXib5KeyedUnarchiver.h"
|
#import "GSXib5KeyedUnarchiver.h"
|
||||||
|
#import "GSStoryboardKeyedUnarchiver.h"
|
||||||
|
|
||||||
@implementation GSXibKeyedUnarchiver
|
@implementation GSXibKeyedUnarchiver
|
||||||
|
|
||||||
|
@ -49,6 +52,7 @@
|
||||||
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData: data
|
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData: data
|
||||||
options: 0
|
options: 0
|
||||||
error: NULL];
|
error: NULL];
|
||||||
|
|
||||||
if (document == nil)
|
if (document == nil)
|
||||||
{
|
{
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -63,6 +67,7 @@
|
||||||
return [documentNodes count] != 0;
|
return [documentNodes count] != 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// We now default to checking XIB 5 versions
|
// We now default to checking XIB 5 versions
|
||||||
return YES;
|
return YES;
|
||||||
#endif
|
#endif
|
||||||
|
@ -75,6 +80,7 @@
|
||||||
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData: data
|
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData: data
|
||||||
options: 0
|
options: 0
|
||||||
error: NULL];
|
error: NULL];
|
||||||
|
|
||||||
if (document == nil)
|
if (document == nil)
|
||||||
{
|
{
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -82,15 +88,16 @@
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Test to see if this is an Xcode 5 XIB...
|
// Test to see if this is an Xcode 5 XIB...
|
||||||
NSArray *nodes = [document nodesForXPath: @"/scene" error: NULL];
|
NSArray *nodes = [document nodesForXPath: @"/scenes" error: NULL];
|
||||||
|
|
||||||
// Need at LEAST ONE scene node...we should find something a bit more
|
// Need at LEAST ONE scene node...we should find something a bit more
|
||||||
// specific to check here...
|
// specific to check here...
|
||||||
return [nodes count] != 0;
|
return [nodes count] != 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// We now default to checking XIB 5 versions
|
// We now default to checking XIB 5 versions
|
||||||
return YES;
|
return NO;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +107,7 @@
|
||||||
|
|
||||||
if ([self checkStoryboard: data])
|
if ([self checkStoryboard: data])
|
||||||
{
|
{
|
||||||
unarchiver = [[GSXib5KeyedUnarchiver alloc] initForReadingWithData: data];
|
unarchiver = [[GSStoryboardKeyedUnarchiver alloc] initForReadingWithData: data];
|
||||||
}
|
}
|
||||||
else if ([self checkXib5: data])
|
else if ([self checkXib5: data])
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue