Commit af70c013 authored by Eric Heintzmann's avatar Eric Heintzmann

Import Upstream version 1.1.0

parent e711ab26
1 ANNOUNCE
**********
This is version 1.0.8 of Gorm.
This is version 1.1.0 of Gorm.
1.1 What is Gorm?
=================
......@@ -12,14 +12,27 @@ GNUstep Object Relationship Modeler).
Gorm is a clone of the NeXTstep `Interface Builder' application for
GNUstep.
1.2 Noteworthy changes in version `1.0.8'
1.2 Noteworthy changes in version `1.1.0'
=========================================
This is a bugfix release.
* Changed Gorm architecture to use NSDocument classes.
* Correction for bug#16587.
* Abstracted model loading mechanism. This was done by implementing
a set of "Loader" and "Builder" classes which handle filling in
the data structures in Gorm and exporting them to external formats.
* Correction for handling non-string identifiers in tableviews.
* Implemented GormNibWrapperLoader and GormNibWrapperBuilder for
reading and writing Cocoa NIB files.
* Implemented GormGormWrapperLoader and GormGormWrapperBuilder for
reading and writing GNUstep Gorm files
* Implemented GormGModelWrapperLoader for reading GNUstep gmodel
files.
* Updated icon
* A number of bugs have been addressed in this release.
1.3 How can I get support for this software?
============================================
......
This diff is collapsed.
......@@ -3,6 +3,23 @@
@ifset TEXT-ONLY
@include version.texi
@end ifset
@section Noteworthy changes in version @samp{1.1.0}
@itemize @bullet
@item Changed Gorm architecture to use NSDocument classes.
@item Abstracted model loading mechanism. This was done by implementing a set of ``Loader'' and ``Builder'' classes which handle filling in the data structures in Gorm and exporting them to external formats.
@item Implemented GormNibWrapperLoader and GormNibWrapperBuilder for reading and writing Cocoa NIB files.
@item Implemented GormGormWrapperLoader and GormGormWrapperBuilder for reading and writing GNUstep Gorm files
@item Implemented GormGModelWrapperLoader for reading GNUstep gmodel files.
@item Updated icon
@item A number of bugs have been addressed in this release.
@end itemize
@ifclear ANNOUNCE-ONLY
@c ====================================================================
@c Keep the next line just below the list of changes in most recent version.
@section Noteworthy changes in version @samp{1.0.8}
This is a bugfix release.
......@@ -11,9 +28,6 @@ This is a bugfix release.
@item Correction for bug#16587.
@item Correction for handling non-string identifiers in tableviews.
@end itemize
@ifclear ANNOUNCE-ONLY
@c ====================================================================
@c Keep the next line just below the list of changes in most recent version.
@section Noteworthy changes in version @samp{1.0.6}
......
{
"## Comment" = "Do NOT change this file, Gorm maintains it";
FirstResponder = {
Actions = (
"arrangeSelectedObjects:",
"exportStrings:",
"alignSelectedObjects:",
"orderFrontFontPanel:",
"translate:"
);
Super = NSObject;
};
Gorm = {
Actions = (
"editClass:",
"createSubclass:",
"testInterface:",
"setName:",
"selectAllItems:",
"saveAs:",
"saveAll:",
"save:",
"revertToSaved:",
"paste:",
"palettes:",
"open:",
"loadSound:",
"loadPalette:",
"newGormDocument:",
"inspector:",
"infoPanel:",
"endTesting:",
"delete:",
"cut:",
"copy:",
"newPalette:",
"newInspector:",
"newEmpty:",
"close:",
"miniaturize:",
"debug:",
"loadImage:",
"orderFrontFontPanel:",
"ungroup:",
"groupSelectionInScrollView:",
"groupSelectionInBox:",
"groupSelectionInSplitView:",
"remove:",
"addAttributeToClass:",
"instantiateClass:",
"createClassFiles:",
"loadClass:",
"preferencesPanel:",
"guideline:",
"translate:",
"exportStrings:",
"arrangeSelectedObjects:",
"alignSelectedObjects:"
);
Outlets = (
gormMenu,
guideLineMenuItem
);
Super = NSApplication;
};
}
\ No newline at end of file
{"## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = {Actions = ("arrangeSelectedObjects:", "exportStrings:", "alignSelectedObjects:", "orderFrontFontPanel:", "translate:"); Super = NSObject; }; Gorm = {Actions = ("editClass:", "createSubclass:", "testInterface:", "setName:", "selectAllItems:", "paste:", "palettes:", "loadSound:", "loadPalette:", "inspector:", "infoPanel:", "endTesting:", "delete:", "cut:", "copy:", "close:", "miniaturize:", "debug:", "loadImage:", "orderFrontFontPanel:", "ungroup:", "groupSelectionInScrollView:", "groupSelectionInBox:", "groupSelectionInSplitView:", "remove:", "addAttributeToClass:", "instantiateClass:", "createClassFiles:", "loadClass:", "preferencesPanel:", "guideline:"); Outlets = (gormMenu, guideLineMenuItem); Super = NSApplication; }; GormDocumentController = {Actions = (); Outlets = (); Super = NSDocumentController; }; }
\ No newline at end of file
{
"## Comment" = "Do NOT change this file, Gorm maintains it";
FirstResponder = {
Actions = (
"selectArchiveType:"
);
Super = NSObject;
};
GSNibContainer = {
Actions = (
);
Outlets = (
);
Super = NSObject;
};
GormDocument = {
Actions = (
);
Outlets = (
selectionBox,
window,
filePrefsView,
filePrefsManager,
filePrefsWindow
);
Super = GSNibContainer;
};
GormFilePrefsManager = {
Actions = (
"showIncompatibilities:",
"selectTargetVersion:",
"selectArchiveType:"
);
Outlets = (
showIncompatibilities,
targetVersion,
gormAppVersion,
archiveType,
iwindow,
itable
);
Super = NSObject;
};
}
\ No newline at end of file
{"## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = {Actions = ("selectArchiveType:"); Super = NSObject; }; GSNibContainer = {Actions = (); Outlets = (); Super = NSObject; }; GormDocument = {Actions = (); Outlets = (selectionBox, filePrefsView, filePrefsManager, filePrefsWindow); Super = NSDocument; }; GormFilePrefsManager = {Actions = ("showIncompatibilities:", "selectTargetVersion:", "selectArchiveType:"); Outlets = (showIncompatibilities, targetVersion, gormAppVersion, archiveType, iwindow, itable); Super = NSObject; }; }
\ No newline at end of file
......@@ -29,7 +29,12 @@ GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT)
include $(GNUSTEP_MAKEFILES)/common.make
PACKAGE_NAME=Gorm
CVS_MODULE_NAME = gorm
SVN_MODULE_NAME = gorm
SVN_BASE_URL = svn+ssh://svn.gna.org/svn/gnustep/apps
PACKAGE_NAME=gorm
include ./Version
#
......
This diff is collapsed.
......@@ -48,6 +48,7 @@ GormCore_HEADER_FILES = \
GormCustomClassInspector.h \
GormCustomView.h \
GormDocument.h \
GormDocumentController.h \
GormFilePrefsManager.h \
GormFilesOwner.h \
GormFontViewController.h \
......@@ -85,13 +86,14 @@ GormCore_HEADER_FILES = \
GormViewWithContentViewEditor.h \
GormViewWithSubviewsEditor.h \
GormWindowEditor.h \
GormWrapperBuilder.h \
GormWrapperLoader.h \
NSCell+GormAdditions.h \
NSColorWell+GormExtensions.h \
NSFontManager+GormExtensions.h \
NSView+GormExtensions.h
GormCore_OBJC_FILES = \
GModelDecoder.m \
GormBoxEditor.m \
GormClassEditor.m \
GormClassInspector.m \
......@@ -102,17 +104,23 @@ GormCore_OBJC_FILES = \
GormCustomClassInspector.m \
GormCustomView.m \
GormDocument.m \
GormDocumentController.m \
GormFilePrefsManager.m \
GormFilesOwner.m \
GormFontViewController.m \
GormFunctions.m \
GormGenericEditor.m \
GormGormWrapperBuilder.m \
GormGormWrapperLoader.m \
GormGModelWrapperLoader.m \
GormImage.m \
GormImageEditor.m \
GormImageInspector.m \
GormInspectorsManager.m \
GormInternalViewEditor.m \
GormMatrixEditor.m \
GormNibWrapperBuilder.m \
GormNibWrapperLoader.m \
GormNSSplitViewInspector.m \
GormObjectEditor.m \
GormObjectInspector.m \
......@@ -137,6 +145,8 @@ GormCore_OBJC_FILES = \
GormViewWithContentViewEditor.m \
GormViewWithSubviewsEditor.m \
GormWindowEditor.m \
GormWrapperBuilder.m \
GormWrapperLoader.m \
NSCell+GormAdditions.m \
NSColorWell+GormExtensions.m \
NSFontManager+GormExtensions.m \
......
......@@ -230,7 +230,14 @@
{
if (contentViewEditor)
{
return [contentViewEditor destroyAndListSubviews];
if([contentViewEditor respondsToSelector: @selector(destroyAndListSubviews)])
{
return [contentViewEditor destroyAndListSubviews];
}
else
{
return nil;
}
}
else
{
......
......@@ -107,8 +107,8 @@
- (NSString *) customClassForObject: (id)object;
- (NSString *) customClassForName: (NSString *)name;
- (void) setCustomClass: (NSString *)className
forName: (NSString *)object;
- (void) removeCustomClassForName: (NSString *) object;
forName: (NSString *)name;
- (void) removeCustomClassForName: (NSString *)name;
- (NSMutableDictionary *) customClassMap;
- (void) setCustomClassMap: (NSMutableDictionary *)dict;
- (BOOL) isCustomClassMapEmpty;
......@@ -124,8 +124,14 @@
/* Loading and saving */
- (BOOL) saveToFile: (NSString *)path;
- (NSData *) data;
- (NSData *) nibData;
- (BOOL) loadFromFile: (NSString *)path;
- (BOOL) loadCustomClasses: (NSString *)path;
- (BOOL) loadCustomClassesWithData: (NSData *)data;
- (BOOL) loadCustomClassesWithDict: (NSDictionary *)dict;
- (BOOL) loadNibFormatCustomClassesWithData: (NSData *)data;
- (BOOL) loadNibFormatCustomClassesWithDict: (NSDictionary *)dict;
@end
#endif
......@@ -1161,14 +1161,165 @@
return [dictForClass objectForKey: @"Super"];
}
- (BOOL) saveToFile: (NSString *)path
- (NSData *) nibData
{
NSMutableDictionary *ci;
NSEnumerator *enumerator;
id key;
NSMutableDictionary *dict = nil;
NSMutableArray *classes = nil;
NSEnumerator *enumerator = nil;
NSMutableArray *cats = [NSMutableArray arrayWithArray: categoryClasses];
id name = nil;
// save all custom classes....
ci = AUTORELEASE([[NSMutableDictionary alloc] initWithCapacity: 0]);
dict = [NSMutableDictionary dictionary];
[dict setObject: @"1" forKey: @"IBVersion"];
classes = [NSMutableArray array];
// build IBClasses...
enumerator = [customClasses objectEnumerator];
while ((name = [enumerator nextObject]) != nil)
{
NSDictionary *classInfo;
NSMutableDictionary *newInfo;
id obj;
id extraObj;
// get the info...
classInfo = [classInformation objectForKey: name];
newInfo = [[NSMutableDictionary alloc] init];
[newInfo setObject: name forKey: @"CLASS"];
// superclass...
obj = [classInfo objectForKey: @"Super"];
if (obj != nil)
{
[newInfo setObject: obj forKey: @"SUPERCLASS"];
}
// outlets...
obj = [classInfo objectForKey: @"Outlets"];
extraObj = [classInfo objectForKey: @"ExtraOutlets"];
if (obj && extraObj)
{
obj = [obj arrayByAddingObjectsFromArray: extraObj];
}
else if (extraObj)
{
obj = extraObj;
}
if (obj != nil && [obj count] > 0)
{
NSMutableDictionary *outletDict = [NSMutableDictionary dictionary];
NSEnumerator *oen = [obj objectEnumerator];
id outlet = nil;
while((outlet = [oen nextObject]) != nil)
{
[outletDict setObject: @"id" forKey: outlet];
}
[newInfo setObject: outletDict forKey: @"OUTLETS"];
}
// actions...
obj = [classInfo objectForKey: @"Actions"];
extraObj = [classInfo objectForKey: @"ExtraActions"];
if (obj && extraObj)
{
obj = [obj arrayByAddingObjectsFromArray: extraObj];
}
else if (extraObj)
{
obj = extraObj;
}
if (obj != nil && [obj count] > 0)
{
NSMutableDictionary *actionDict = [NSMutableDictionary dictionary];
NSEnumerator *aen = [obj objectEnumerator];
id action = nil;
while((action = [aen nextObject]) != nil)
{
NSString *actionName = nil;
NSScanner *scanner = [NSScanner scannerWithString: action];
[scanner scanUpToString: @":" intoString: &actionName];
[actionDict setObject: @"id" forKey: actionName];
}
[newInfo setObject: actionDict forKey: @"ACTIONS"];
}
[newInfo setObject: @"ObjC" forKey: @"LANGUAGE"];
[classes addObject: newInfo];
}
// Save all categories on existing, non-custom classes....
// Always save the FirstResponder....
if([cats containsObject: @"FirstResponder"] == NO)
{
[cats addObject: @"FirstResponder"];
}
enumerator = [cats objectEnumerator];
while((name = [enumerator nextObject]) != nil)
{
NSDictionary *classInfo;
NSMutableDictionary *newInfo;
id obj;
// get the info...
classInfo = [classInformation objectForKey: name];
newInfo = [NSMutableDictionary dictionary];
[newInfo setObject: name forKey: @"CLASS"];
// superclass...
obj = [classInfo objectForKey: @"Super"];
if (obj != nil)
{
[newInfo setObject: obj forKey: @"SUPERCLASS"];
}
// actions...
obj = [classInfo objectForKey: @"ExtraActions"];
if (obj != nil && [obj count] > 0)
{
NSMutableDictionary *actionDict = [NSMutableDictionary dictionary];
NSEnumerator *aen = [obj objectEnumerator];
id action = nil;
while((action = [aen nextObject]) != nil)
{
NSString *actionName = nil;
NSScanner *scanner = [NSScanner scannerWithString: action];
[scanner scanUpToString: @":" intoString: &actionName];
[actionDict setObject: @"id" forKey: actionName];
}
[newInfo setObject: actionDict forKey: @"ACTIONS"];
}
[newInfo setObject: @"ObjC" forKey: @"LANGUAGE"];
[classes addObject: newInfo];
}
[dict setObject: classes forKey: @"IBClasses"];
return [NSPropertyListSerialization dataFromPropertyList: dict
format: NSPropertyListOpenStepFormat
errorDescription: NULL];
}
- (NSData *) data
{
NSMutableDictionary *ci = nil;
NSEnumerator *enumerator = nil;
id key = nil;
// save all custom classes....
ci = [NSMutableDictionary dictionary];
enumerator = [customClasses objectEnumerator];
while ((key = [enumerator nextObject]) != nil)
{
......@@ -1232,7 +1383,7 @@
// get the info...
classInfo = [classInformation objectForKey: key];
newInfo = [[NSMutableDictionary alloc] init];
newInfo = [NSMutableDictionary dictionary];
[ci setObject: newInfo forKey: key];
// superclass...
......@@ -1254,12 +1405,14 @@
[ci setObject: @"Do NOT change this file, Gorm maintains it"
forKey: @"## Comment"];
/*
[ci setObject: [NSNumber numberWithInt: [[ci description] hash]]
forKey: @"hashValue"];
*/
return [NSPropertyListSerialization dataFromPropertyList: ci
format: NSPropertyListOpenStepFormat
errorDescription: NULL];
}
return [ci writeToFile: path atomically: YES];
- (BOOL) saveToFile: (NSString *)path
{
return [[self data] writeToFile: path atomically: YES];
}
- (BOOL) loadFromFile: (NSString *)path
......@@ -1280,8 +1433,7 @@
/*
* Convert property-list data into a mutable structure.
*/
RELEASE(classInformation);
classInformation = [[NSMutableDictionary alloc] init];
ASSIGN(classInformation, [[NSMutableDictionary alloc] init]);
// iterate over all entries..
enumerator = [dict keyEnumerator];
......@@ -1327,15 +1479,68 @@
return YES;
}
- (BOOL) loadNibFormatCustomClassesWithDict: (NSDictionary *)dict
{
NSArray *classes = [dict objectForKey: @"IBClasses"];
NSEnumerator *en = [classes objectEnumerator];
BOOL result = NO;
id cls = nil;
while((cls = [en nextObject]) != nil)
{
NSString *className = [cls objectForKey: @"CLASS"];
NSString *superClass = [cls objectForKey: @"SUPERCLASS"];
NSDictionary *actionDict = [cls objectForKey: @"ACTIONS"];
NSDictionary *outletDict = [cls objectForKey: @"OUTLETS"];
NSMutableArray *actions = [NSMutableArray array];
NSArray *outlets = [outletDict allKeys];
NSEnumerator *aen = [actionDict keyEnumerator];
id action = nil;
//
// Convert action format.
//
while((action = [aen nextObject]) != nil)
{
NSString *aname = [action stringByAppendingString: @":"];
[actions addObject: aname];
}
//
// If the class is known, add the actions/outlets, if it's
// not, then add all of the information.
//
if([self isKnownClass: className])
{
[self addActions: actions forClassNamed: className];
[self addOutlets: outlets forClassNamed: className];
result = YES;
}
else
{
result = [self addClassNamed: className
withSuperClassNamed: superClass
withActions: actions
withOutlets: outlets];
}
}
return result;
}
- (BOOL) loadNibFormatCustomClassesWithData: (NSData *)data
{
NSString *dictString = AUTORELEASE([[NSString alloc] initWithData: data encoding: NSASCIIStringEncoding]);
NSDictionary *dict = [dictString propertyList];
return [self loadNibFormatCustomClassesWithDict: dict];
}
// this method will load the custom classes and merge them with the
// Class information loaded at initialization time.
- (BOOL) loadCustomClasses: (NSString *)path
{
NSMutableDictionary *dict;
NSEnumerator *en;
id key;
// int hash;
// int hashDict;
NSMutableDictionary *dict;
BOOL result = NO;
NSDebugLog(@"Load custom classes from file %@",path);
......@@ -1351,18 +1556,29 @@
NSLog(@"Default classes file not loaded");
return NO;
}
/*
// Hash value to prevent tampering. This value stops someone from
// being able to manually modify the file.
hash = [[dict objectForKey: @"hashValue"] intValue];
[dict removeObjectForKey: @"hashValue"];
hashDict = [[dict description] hash];
if(hash != hashDict && hash != 0)
if([path isEqualToString: @"data.classes"])
{
result = [self loadCustomClassesWithDict: dict];
}
else if([path isEqualToString: @"classes.nib"])
{
NSLog(@"WARNING: The data.classes file has been tampered with");
result = [self loadNibFormatCustomClassesWithDict: dict];
}
*/
return result;
}
- (BOOL) loadCustomClassesWithData: (NSData *)data
{
NSString *dictString = AUTORELEASE([[NSString alloc] initWithData: data encoding: NSASCIIStringEncoding]);
NSDictionary *dict = [dictString propertyList];
return [self loadCustomClassesWithDict: dict];
}
- (BOOL) loadCustomClassesWithDict: (NSDictionary *)dict
{
NSEnumerator *en = nil;
id key = nil;
// Iterate over the set of classes, if it's in the classInformation
// list, it's a category, if it's not it's a custom class.
......@@ -1771,14 +1987,14 @@
}
- (void) setCustomClass: (NSString *)className
forName: (NSString *)object
forName: (NSString *)name
{
[customClassMap setObject: className forKey: object];
[customClassMap setObject: className forKey: name];
}
- (void) removeCustomClassForName: (NSString *)object
- (void) removeCustomClassForName: (NSString *)name
{
[customClassMap removeObjectForKey: object];
[customClassMap removeObjectForKey: name];
}
- (NSMutableDictionary *) customClassMap
......
......@@ -29,6 +29,7 @@
@interface GormCustomView : NSTextField
{
NSString *className;
}
- (void) setClassName: (NSString *)aName;
......
......@@ -32,6 +32,7 @@
#include <AppKit/NSNibLoading.h>
#include <GNUstepGUI/GSNibTemplates.h>
#include <GNUstepGUI/GSNibCompatibility.h>
@class GSCustomView;
......@@ -53,6 +54,12 @@
return self;
}
- (void) dealloc
{
RELEASE(className);
[super dealloc];
}
- (NSString*) inspectorClassName
{
return @"GormFilesOwnerInspector";
......@@ -65,12 +72,36 @@
- (void) setClassName: (NSString *)aName
{
ASSIGN(className, aName);
[self setStringValue: aName];
}
- (NSString *) className
{
return [self stringValue];
return className;
}
- (Class) bestPossibleSuperClass
{
Class cls = [NSView class];
GormClassManager *classManager = [(id<Gorm>)NSApp classManager];
if([classManager isSuperclass: @"NSView" linkedToClass: className])
{
NSString *superClass = [classManager nonCustomSuperClassOf: className];
// get the superclass if one exists...
if(superClass != nil)
{
cls = NSClassFromString(superClass);
if(cls == nil)
{
cls = [NSView class];
}
}
}
return cls;
}
/*
......@@ -79,46 +110,116 @@
*/
- (void) encodeWithCoder: (NSCoder*)aCoder
{