Commit 57bd4137 authored by Eric Heintzmann's avatar Eric Heintzmann

Import Upstream version 1.2.10

parent 99550d9e
1 ANNOUNCE
**********
This is version 1.2.8 of Gorm.
This is version 1.2.10 of Gorm.
1.1 What is Gorm?
=================
......@@ -12,20 +12,16 @@ GNUstep Object Relationship Modeler).
Gorm is a clone of the NeXTstep `Interface Builder' application for
GNUstep.
1.2 Noteworthy changes in version `1.2.8'
=========================================
1.2 Noteworthy changes in version `1.2.10'
==========================================
Requires: gnustep-gui-0.16.0. It will not compile without this version
of the library. Reason: Nib and Gorm loading were moved to a more
sensible file structure. Additionally, Nib loading was refactored.
* Correction for bug #25401
* Correction for bug#25001.
* Correction for some nib loading issues.
* Correction for bug#25111.
* Limited support for standalone views.
* Fixes for nib encoding to use the proper template class instances.
* Changes to use new headers.
* Fixes for various bugs.
1.3 How can I get support for this software?
============================================
......
2009-06-01 21:21-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Version: 1.2.10
2009-03-24 18:02-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Palettes/0Menus/GormMenuEditor.m: -(void)deleteSelection, remove
arbitrary limitation which prevents removing all items in a menu.
2009-03-19 23:39-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormWrapperLoader.m: Allow handling of wrappers which
are not directories.
* Plugins/Gorm/GormGormWrapperLoader.m: Change logic to accommodate
previous generation of .gorm files which were not packages. Also
correct the code so that a return is not made within the NS_DURING
block.
* Plugins/Nib/GormNibWrapperLoader.m: Do not load if the
wrapper is not a directory.
2009-03-17 01:05-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Plugins/Nib/GormNibWrapperLoader.m: Correct the code so that
return is not called from within an NS_DURING block.
2009-03-16 20:18-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Plugins/Nib/GormNibWrapperLoader.m: Correct compilation error.
2009-03-03 18:17-EST Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormClassInspector.m: Change the cell to scrollable
to allow long action/outlet names.
2009-02-11 09:22-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Palettes/0Menus/GormMenuEditor.m: Revert some changes from
previous modification. Corrects issue with submenus showing up
when they shouldn't.
2009-02-11 01:31-EST Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormDocument.m: Remove call to deprecated method.
* GormCore/GormInternalViewEditor.m: Minor cleanup
* GormObjCHeaderParser/OCMethod.m: Minor cleanup
* Palettes/2Controls/GormNSTextFieldInspector.gorm: Correct issue
with misspelled outlet name.
2009-02-02 17:13-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Palettes/2Controls/GormButtonAttributesInspector.[hm]:
Added code to handle button style.
* Palettes/2Controls/GormNSButtonInspector.gorm: Added button
style popup to the inspector.
2009-02-01 09:20-EST Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormBoxEditor.m
* GormCore/GormInternalViewEditor.m
* GormCore/GormViewWithSubviewsEditor.m: Changes to support
standalone views.
2009-01-31 18:45-EST Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormCustomView.m: Allow addition of plain NSView to
a gorm file.
2009-01-25 09:47-EST Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormViewWindow.m: Change the color used for standalone
views.
2009-01-25 07:54-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Palettes/0Menus/GormNSMenu.m: Fix memory leak.
2009-01-25 07:00-EST Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormFilePrefsManager.m
* GormInfo.plist: Change version to 1.2.9 (SVN) unstable.
2009-01-25 06:50-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Palettes/0Menus/GormMenuEditor.m: Display the in certain situations.
* Palettes/0Menus/GormNSMenu.m: Remove call to setMenu: in
_createWindow since it's not needed and was causing display issues.
* Palettes/0Menus/GormNSMenuView.m: Use new method in NSMenuView
to reduce code duplication. Corrections for bug #25401.
2009-01-06 20:48-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Resources/ClassInformation.plist: Added printDocument: method
to FirstResponder
2009-01-06 Fred Kiefer <FredKiefer@gmx.de>
* GormCore/GormClassManager.m (-nibData): Make sure an action name
of ":" gets ignored.
2008-12-26 13:53-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Version: 1.2.8
......
......@@ -4,6 +4,19 @@
@include version.texi
@end ifset
@section Noteworthy changes in version @samp{1.2.10}
@itemize @bullet
@item Correction for bug #25401
@item Correction for some nib loading issues.
@item Limited support for standalone views.
@item Fixes for various bugs.
@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.2.8}
Requires: gnustep-gui-0.16.0. It will not compile without this version of the library.
......@@ -16,10 +29,6 @@ Reason: Nib and Gorm loading were moved to a more sensible file structure. Addi
@item Changes to use new headers.
@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.2.6}
@itemize @bullet
......
......@@ -173,6 +173,8 @@ Gorm_OBJC_FILES = \
Gorm.m \
main.m
# Gorm_ADDITIONAL_NATIVE_LIBS = m
-include GNUmakefile.preamble
-include GNUmakefile.local
......
......@@ -98,24 +98,6 @@
}
}
- (id) initWithObject: (id)anObject
inDocument: (id<IBDocuments>)aDocument
{
opened = NO;
openedSubeditor = nil;
if ((self = [super initWithObject: anObject
inDocument: aDocument]) == nil)
return nil;
selection = [[NSMutableArray alloc] initWithCapacity: 5];
[self registerForDraggedTypes: [NSArray arrayWithObjects:
IBViewPboardType, GormLinkPboardType, IBFormatterPboardType, nil]];
return self;
}
- (void) makeSelectionVisible: (BOOL) value
{
......
......@@ -715,12 +715,12 @@ shouldEditTableColumn: (NSTableColumn *)aTableColumn
return result;
}
/*
- (void) tableView: (NSTableView *)tableView
willDisplayCell: (id)aCell
forTableColumn: (NSTableColumn *)aTableColumn
row: (int)rowIndex
{
/*
NSString *name = [aCell stringValue];
NSString *className = [self _currentClass];
......@@ -749,8 +749,9 @@ shouldEditTableColumn: (NSTableColumn *)aTableColumn
[aCell setTextColor: [NSColor darkGrayColor]];
}
}
}
*/
[(NSTextFieldCell *)aCell setScrollable: YES];
}
- (BOOL) tableView: (NSTableView *)tv
shouldSelectRow: (int)rowIndex
......
......@@ -1260,8 +1260,8 @@
NSString *actionName = nil;
NSScanner *scanner = [NSScanner scannerWithString: action];
[scanner scanUpToString: @":" intoString: &actionName];
[actionDict setObject: @"id" forKey: actionName];
if ([scanner scanUpToString: @":" intoString: &actionName])
[actionDict setObject: @"id" forKey: actionName];
}
[newInfo setObject: actionDict forKey: @"ACTIONS"];
......@@ -1310,8 +1310,8 @@
NSString *actionName = nil;
NSScanner *scanner = [NSScanner scannerWithString: action];
[scanner scanUpToString: @":" intoString: &actionName];
[actionDict setObject: @"id" forKey: actionName];
if ([scanner scanUpToString: @":" intoString: &actionName])
[actionDict setObject: @"id" forKey: actionName];
}
[newInfo setObject: actionDict forKey: @"ACTIONS"];
......
......@@ -36,6 +36,21 @@
@class GSCustomView;
@interface CustomView : NSView
@end
@implementation CustomView
- (id) initWithFrame: (NSRect)frame
{
if((self = [super initWithFrame: frame]) != nil)
{
// Replace the CustomView with an NSView of the same dimensions.
self = [[NSView alloc] initWithFrame: frame];
}
return self;
}
@end
@implementation GormCustomView
- (id)initWithFrame:(NSRect)frameRect
......@@ -105,83 +120,46 @@
return cls;
}
- (BOOL) classNameIsSet
{
if([className isEqualToString: @"CustomView"] ||
[className isEqualToString: @""] || className == nil)
{
return NO;
}
return YES;
}
/*
- (Class) classForCoder
{
if([self _classNameIsSet])
{
return [NSView class];
}
return [self class];
}
*/
/*
* This needs to be coded like a GSNibItem. How do we make sure this
* tracks changes in GSNibItem coding?
*/
- (void) encodeWithCoder: (NSCoder*)aCoder
{
/*
if([self _classNameIsSet])
if([aCoder allowsKeyedCoding])
{
*/
if([aCoder allowsKeyedCoding])
GormClassManager *classManager = [(id<Gorm>)NSApp classManager];
NSString *extension = nil;
ASSIGNCOPY(extension,[classManager nonCustomSuperClassOf: className]);
[aCoder encodeObject: className forKey: @"NSClassName"];
[aCoder encodeRect: [self frame] forKey: @"NSFrame"];
if(extension != nil)
{
GormClassManager *classManager = [(id<Gorm>)NSApp classManager];
NSString *extension = nil;
ASSIGNCOPY(extension,[classManager nonCustomSuperClassOf: className]);
[aCoder encodeObject: className forKey: @"NSClassName"];
[aCoder encodeRect: [self frame] forKey: @"NSFrame"];
if(extension != nil)
{
[aCoder encodeObject: extension forKey: @"NSExtension"];
}
if([self nextResponder] != nil)
{
[aCoder encodeObject: [self nextResponder] forKey: @"NSNextResponder"];
}
if([self superview] != nil)
{
[aCoder encodeObject: [self superview] forKey: @"NSSuperview"];
}
RELEASE(extension);
[aCoder encodeObject: extension forKey: @"NSExtension"];
}
else
if([self nextResponder] != nil)
{
[aCoder encodeObject: [self stringValue]];
[aCoder encodeRect: _frame];
[aCoder encodeValueOfObjCType: @encode(unsigned int)
at: &_autoresizingMask];
[aCoder encodeObject: [self nextResponder] forKey: @"NSNextResponder"];
}
/*
if([self superview] != nil)
{
[aCoder encodeObject: [self superview] forKey: @"NSSuperview"];
}
RELEASE(extension);
}
else
{
if([aCoder allowsKeyedCoding] == NO)
{
NSView *temp = [[NSView alloc] initWithFrame: [self frame]];
[temp setNextResponder: [self nextResponder]];
[(NSArchiver *)aCoder replaceObject: self withObject: temp];
}
[aCoder encodeObject: [self stringValue]];
[aCoder encodeRect: _frame];
[aCoder encodeValueOfObjCType: @encode(unsigned int)
at: &_autoresizingMask];
}
*/
}
- (id) initWithCoder: (NSCoder*)aCoder
......
......@@ -345,7 +345,6 @@ static NSImage *fileImage = nil;
[toolbar setDelegate: self];
[window setToolbar: toolbar];
RELEASE(toolbar);
[toolbar setUsesStandardBackgroundColor: YES];
[toolbar setSelectedItemIdentifier: @"ObjectsItem"]; // set initial selection.
// set up notifications for window.
......
......@@ -85,7 +85,7 @@ NSString *formatVersion(int version)
+ (int) currentVersion
{
return appVersion(1,2,8);
return appVersion(1,2,10);
}
- (void) awakeFromNib
......
......@@ -64,7 +64,7 @@ static NSImage *horizontalImage;
}
else
{
return @"GormViewEditor";
return @"GormViewWithSubviewsEditor";
}
}
......@@ -139,8 +139,6 @@ static NSImage *horizontalImage;
}
else if ([[superview window] contentView] == _editedObject)
{
// NSRect frame = [_editedObject frame];
// [self setFrame: frame];
[[superview window] setContentView: self];
}
else if ([superview isKindOfClass: [NSClipView class]])
......@@ -649,252 +647,6 @@ static NSImage *horizontalImage;
}
}
- (unsigned) draggingEntered: (id<NSDraggingInfo>)sender
{
NSRect rect = [_editedObject bounds];
NSPoint loc = [sender draggingLocation];
NSPasteboard *dragPb;
NSArray *types;
dragPb = [sender draggingPasteboard];
types = [dragPb types];
loc = [_editedObject convertPoint: loc fromView: nil];
if ([types containsObject: GormLinkPboardType] == YES)
{
return [parent draggingEntered: sender];
}
if (NSMouseInRect(loc, [_editedObject bounds], NO) == NO)
{
return NSDragOperationNone;
}
else
{
rect.origin.x += 3;
rect.origin.y += 2;
rect.size.width -= 5;
rect.size.height -= 5;
[_editedObject lockFocus];
[[NSColor darkGrayColor] set];
NSFrameRectWithWidth(rect, 2);
[_editedObject unlockFocus];
[[self window] flushWindow];
return NSDragOperationCopy;
}
}
- (void) draggingExited: (id<NSDraggingInfo>)sender
{
NSPasteboard *dragPb;
NSArray *types;
NSRect rect;
dragPb = [sender draggingPasteboard];
types = [dragPb types];
if ([types containsObject: GormLinkPboardType] == YES)
{
[parent draggingExited: sender];
return;
}
rect = [_editedObject bounds];
rect.origin.x += 3;
rect.origin.y += 2;
rect.size.width -= 5;
rect.size.height -= 5;
rect.origin.x --;
rect.size.width ++;
rect.size.height ++;
[[self window] disableFlushWindow];
[self displayRect:
[_editedObject convertRect: rect
toView: self]];
[[self window] enableFlushWindow];
[[self window] flushWindow];
}
- (unsigned int) draggingUpdated: (id<NSDraggingInfo>)sender
{
NSPoint loc = [sender draggingLocation];
NSRect rect = [_editedObject bounds];
NSPasteboard *dragPb;
NSArray *types;
dragPb = [sender draggingPasteboard];
types = [dragPb types];
loc = [_editedObject
convertPoint: loc fromView: nil];
if ([types containsObject: GormLinkPboardType] == YES)
{
return [parent draggingUpdated: sender];
}
rect.origin.x += 3;
rect.origin.y += 2;
rect.size.width -= 5;
rect.size.height -= 5;
if (NSMouseInRect(loc, [_editedObject bounds], NO) == NO)
{
[[self window] disableFlushWindow];
rect.origin.x --;
rect.size.width ++;
rect.size.height ++;
[self displayRect:
[_editedObject convertRect: rect
toView: self]];
[[self window] enableFlushWindow];
[[self window] flushWindow];
return NSDragOperationNone;
}
else
{
[_editedObject lockFocus];
[[NSColor darkGrayColor] set];
NSFrameRectWithWidth(rect, 2);
[_editedObject unlockFocus];
[[self window] flushWindow];
return NSDragOperationCopy;
}
}
- (BOOL) prepareForDragOperation: (id<NSDraggingInfo>)sender
{
NSString *dragType;
NSArray *types;
NSPasteboard *dragPb;
dragPb = [sender draggingPasteboard];
types = [dragPb types];
if ([types containsObject: IBViewPboardType] == YES)
{
dragType = IBViewPboardType;
}
else if ([types containsObject: GormLinkPboardType] == YES)
{
dragType = GormLinkPboardType;
return [parent prepareForDragOperation: sender];
}
else
{
dragType = nil;
}
if (dragType == IBViewPboardType)
{
/*
* We can accept views dropped anywhere.
*/
NSPoint loc = [sender draggingLocation];
loc = [_editedObject
convertPoint: loc fromView: nil];
if (NSMouseInRect(loc, [_editedObject bounds], NO) == NO)
{
return NO;
}
return YES;
}
return NO;
}
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
{
NSString *dragType;
NSPasteboard *dragPb;
NSArray *types;
dragPb = [sender draggingPasteboard];
types = [dragPb types];
if ([types containsObject: IBViewPboardType] == YES)
{
dragType = IBViewPboardType;
}
else if ([types containsObject: GormLinkPboardType] == YES)
{
dragType = GormLinkPboardType;
}
else
{
dragType = nil;
}
if (dragType == IBViewPboardType)
{
NSPoint loc = [sender draggingLocation];
NSArray *views;
NSEnumerator *enumerator;
NSView *sub;
/*
* Ask the document to get the dragged views from the pasteboard and add
* them to it's collection of known objects.
*/
views = [document pasteType: IBViewPboardType
fromPasteboard: dragPb
parent: _editedObject];
/*
* Now make all the views subviews of ourself, setting their origin to
* be the point at which they were dropped (converted from window
* coordinates to our own coordinates).
*/
loc = [_editedObject convertPoint: loc fromView: nil];
if (NSMouseInRect(loc, [_editedObject bounds], NO) == NO)
{
// Dropped outside our view frame
NSLog(@"Dropped outside current edit view");
dragType = nil;
return NO;
}
enumerator = [views objectEnumerator];
while ((sub = [enumerator nextObject]) != nil)
{
NSRect rect = [sub frame];
rect.origin = [_editedObject
convertPoint: [sender draggedImageLocation]
fromView: nil];
rect.origin.x = (int) rect.origin.x;
rect.origin.y = (int) rect.origin.y;
rect.size.width = (int) rect.size.width;
rect.size.height = (int) rect.size.height;
[sub setFrame: rect];
[_editedObject addSubview: sub];
{
id editor;
editor = [document editorForObject: sub
inEditor: self
create: YES];
[self selectObjects:
[NSArray arrayWithObject: editor]];
}
}
}
return YES;
}
- (void) pasteInSelection
{
[self pasteInView: _editedObject];
......
......@@ -142,10 +142,11 @@
NSString *objectName = [[(id<IB>)NSApp activeDocument] nameForObject: view];
NSString *title = [NSString stringWithFormat: @"View Window: (%@, %@)",
className, objectName];
NSColor *color = [NSColor lightGrayColor];
[self setTitle: title];
[self setFrame: NSMakeRect(0,0,400,300) display: YES];
[self setBackgroundColor: [NSColor darkGrayColor]];
[self setBackgroundColor: color];
[self setReleasedWhenClosed: NO];
[self setView: view];
}
......
......@@ -30,8 +30,35 @@
@class GormEditorToParent;
/*
@implementation NSView (IBObjectAdditions)
- (NSString*) editorClassName
{
return @"GormViewWithSubviewsEditor";
}
@end
*/
@implementation GormViewWithSubviewsEditor
- (id) initWithObject: (id)anObject
inDocument: (id<IBDocuments>)aDocument
{
opened = NO;
openedSubeditor = nil;
if ((self = [super initWithObject: anObject
inDocument: aDocument]) == nil)
return nil;
selection = [[NSMutableArray alloc] initWithCapacity: 5];
[self registerForDraggedTypes: [NSArray arrayWithObjects:
IBViewPboardType, GormLinkPboardType, IBFormatterPboardType, nil]];
return self;
}
- (void) close
{
if (closed == NO)
......@@ -268,4 +295,248 @@
{
return [selection count];
}
- (unsigned) draggingEntered: (id<NSDraggingInfo>)sender
{
NSRect rect = [_editedObject bounds];
NSPoint loc = [sender draggingLocation];
NSPasteboard *dragPb;
NSArray *types;
dragPb = [sender draggingPasteboard];
types = [dragPb types];