mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-23 14:30:48 +00:00
Merge pull request #27 from gnustep/model_changes
This commit is contained in:
commit
e0b6cd6725
9 changed files with 1928 additions and 20 deletions
|
@ -40,7 +40,7 @@
|
|||
{
|
||||
NSName = "GSXibFileType";
|
||||
NSHumanReadableName = "Cocoa Xib";
|
||||
NSRole = Viewer;
|
||||
NSRole = Editor;
|
||||
NSDocumentClass = GormDocument;
|
||||
NSUnixExtensions = ( "xib" );
|
||||
NSIcon = "GormNib.tiff";
|
||||
|
|
|
@ -97,22 +97,27 @@
|
|||
}
|
||||
return image;
|
||||
}
|
||||
|
||||
- (NSString*) inspectorClassName
|
||||
{
|
||||
return @"GormNotApplicableInspector";
|
||||
}
|
||||
|
||||
- (NSString*) connectInspectorClassName
|
||||
{
|
||||
return @"GormNotApplicableInspector";
|
||||
}
|
||||
|
||||
- (NSString*) sizeInspectorClassName
|
||||
{
|
||||
return @"GormNotApplicableInspector";
|
||||
}
|
||||
|
||||
- (NSString*) classInspectorClassName
|
||||
{
|
||||
return @"GormNotApplicableInspector";
|
||||
}
|
||||
|
||||
- (NSString*) className
|
||||
{
|
||||
return @"FirstResponder";
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns an autoreleast GormXLIFFDocument object;
|
||||
* Returns an autoreleased GormXLIFFDocument object;
|
||||
*/
|
||||
+ (instancetype) xliffWithGormDocument: (GormDocument *)doc;
|
||||
|
||||
|
|
|
@ -232,23 +232,6 @@
|
|||
GormFilePrefsManager *filePrefsManager = [document filePrefsManager];
|
||||
GSNibContainer *container = nil;
|
||||
|
||||
//
|
||||
// If we are a nib, currently, and it's not being saved using the Latest, then
|
||||
// flag an error. NOTE: The next time the gorm container version is
|
||||
// changed, it will be necessary to add to the list here...
|
||||
//
|
||||
if([[document fileType] isEqual: @"GSNibFileType"] &&
|
||||
[[document filePrefsManager] isLatest] == NO)
|
||||
{
|
||||
NSRunAlertPanel(_(@"Incorrect gui version"),
|
||||
_(@"Nibs cannot be converted to gui-0.10.3 and older"),
|
||||
_(@"OK"),
|
||||
nil,
|
||||
nil,
|
||||
nil);
|
||||
return nil;
|
||||
}
|
||||
|
||||
[document prepareConnections];
|
||||
container = [[GSNibContainer alloc] initWithDocument: document];
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ Xib_PRINCIPAL_CLASS = GormXibPlugin
|
|||
|
||||
Xib_OBJC_FILES = GormXibPlugin.m \
|
||||
GormXibWrapperLoader.m \
|
||||
GormXibWrapperBuilder.m \
|
||||
GormXIBModelGenerator.m \
|
||||
|
||||
Xib_RESOURCE_FILES =
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Additional include directories the compiler should search
|
||||
ADDITIONAL_INCLUDE_DIRS += -I../../..
|
||||
ADDITIONAL_INCLUDE_DIRS += -I../../.. -I../.. -I..
|
||||
|
||||
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
|
||||
ADDITIONAL_LIB_DIRS += \
|
||||
|
|
73
GormCore/Plugins/Xib/GormXIBModelGenerator.h
Normal file
73
GormCore/Plugins/Xib/GormXIBModelGenerator.h
Normal file
|
@ -0,0 +1,73 @@
|
|||
/** <title>GormXIBKeyedArchiver</title>
|
||||
|
||||
<abstract>Interface of GormXIBKeyedArchiver</abstract>
|
||||
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
|
||||
Author: Gregory John Casamento <greg.casamento@gmail.com>
|
||||
Date: 2023
|
||||
|
||||
This file is part of the GNUstep GUI 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 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; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef GormXIBModelGenerator_H_INCLUDE
|
||||
#define GormXIBModelGenerator_H_INCLUDE
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@class GormDocument;
|
||||
@class NSMutableDictionary;
|
||||
@class NSString;
|
||||
@class NSData;
|
||||
@class NSMutableArray;
|
||||
@class NSMapTable;
|
||||
|
||||
@interface GormXIBModelGenerator : NSObject
|
||||
{
|
||||
GormDocument *_gormDocument;
|
||||
NSMutableDictionary *_mappingDictionary;
|
||||
NSMutableArray *_allIdentifiers;
|
||||
NSMapTable *_objectToIdentifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an autoreleased GormXIBModelGenerator object;
|
||||
*/
|
||||
+ (instancetype) xibWithGormDocument: (GormDocument *)doc;
|
||||
|
||||
/**
|
||||
* Initialize with GormDocument object to parse the XML from or into.
|
||||
*/
|
||||
- (instancetype) initWithGormDocument: (GormDocument *)doc;
|
||||
|
||||
/**
|
||||
* The data for the XIB document that has been created
|
||||
*/
|
||||
- (NSData *) data;
|
||||
|
||||
/**
|
||||
* Exports XIB file. This method starts the process and calls
|
||||
* another method that recurses through the objects in the model and
|
||||
* maps any properties as appropriate when exporting.
|
||||
*/
|
||||
- (BOOL) exportXIBDocumentWithName: (NSString *)name;
|
||||
|
||||
@end
|
||||
|
||||
#endif // GormXIBModelGenerator_H_INCLUDE
|
1795
GormCore/Plugins/Xib/GormXIBModelGenerator.m
Normal file
1795
GormCore/Plugins/Xib/GormXIBModelGenerator.m
Normal file
File diff suppressed because it is too large
Load diff
51
GormCore/Plugins/Xib/GormXibWrapperBuilder.m
Normal file
51
GormCore/Plugins/Xib/GormXibWrapperBuilder.m
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* GormWrapperBuilder
|
||||
*
|
||||
* Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
* Date: 2006
|
||||
*
|
||||
* This file is part of GNUstep.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
#import <GormCore/GormCore.h>
|
||||
|
||||
#import "GormXIBModelGenerator.h"
|
||||
|
||||
@interface GormXibWrapperBuilder : GormWrapperBuilder
|
||||
@end
|
||||
|
||||
@implementation GormXibWrapperBuilder
|
||||
|
||||
+ (NSString *) fileType
|
||||
{
|
||||
return @"GSXibFileType";
|
||||
}
|
||||
|
||||
- (NSFileWrapper *) buildFileWrapperWithDocument: (GormDocument *)doc
|
||||
{
|
||||
GormXIBModelGenerator *generator = [GormXIBModelGenerator xibWithGormDocument: doc];
|
||||
NSData *data = [generator data];
|
||||
NSFileWrapper *fileWrapper = [[NSFileWrapper alloc] initRegularFileWithContents: data];
|
||||
|
||||
return fileWrapper;
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in a new issue