mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Updated files to get rid of warnings. Also added GNUmakefile.preamble with the
-Werror option so that future warnings will be treated as errors. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@16685 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2795d5b995
commit
70d53d483a
16 changed files with 244 additions and 165 deletions
22
ChangeLog
22
ChangeLog
|
@ -1,4 +1,24 @@
|
|||
2003-05-09 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
2003-05-10 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GNUmakefile.preamble: Added to provide the -Werror parameter to
|
||||
prevent any more warnings in the future.
|
||||
* GModelDecoder.m: Corrected code to eliminate warnings.
|
||||
* Gorm.m: Corrected code to eliminate warnings.
|
||||
* GormControlEditor.m: Corrected code to eliminate warnings.
|
||||
* GormDocument.h: Added some of the methods which were being
|
||||
used from outside of the class, but were never actually declared.
|
||||
* GormDocument.m: Corrected code to eliminate warnings.
|
||||
* GormGenericEditor.m: Corrected code to eliminate warnings.
|
||||
* GormImageEditor.m: Corrected code to eliminate warnings.
|
||||
* GormInternalViewEditor.m: Corrected code to eliminate warnings.
|
||||
* GormObjectEditor.m: Corrected code to eliminate warnings.
|
||||
* GormPrivate.h: Moved declarations of editor class methods around
|
||||
to prevent warnings.
|
||||
* GormSoundEditor.m: Corrected code to eliminate warnings.
|
||||
* GormViewEditor.m: Corrected code to eliminate warnings.
|
||||
* GormViewWithContentViewEditor.m: Corrected code to eliminate warnings.
|
||||
|
||||
2003-05-10 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormDocument.m: Further improved the fix to the problem found
|
||||
yesterday. The custom class code was issuing a RELEASE call to
|
||||
|
|
|
@ -131,7 +131,6 @@ static BOOL gormFileOwnerDecoded;
|
|||
{
|
||||
id extension;
|
||||
id realObject;
|
||||
id label;
|
||||
|
||||
theClass = RETAIN([unarchiver decodeStringWithName: @"className"]);
|
||||
extension = [unarchiver decodeObjectWithName: @"extension"];
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# GNUmakefile: main makefile for GNUstep Object Relationship Modeller
|
||||
#
|
||||
# Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999,2002,2003 Free Software Foundation, Inc.
|
||||
#
|
||||
# Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
# Date: 2003
|
||||
# Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
# Date: 1999
|
||||
#
|
||||
|
|
27
GNUmakefile.preamble
Normal file
27
GNUmakefile.preamble
Normal file
|
@ -0,0 +1,27 @@
|
|||
# GNUmakefile: main makefile for GNUstep Object Relationship Modeller
|
||||
#
|
||||
# Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
#
|
||||
# Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
# Date: 2003
|
||||
#
|
||||
# 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA
|
||||
#
|
||||
|
||||
ADDITIONAL_OBJCFLAGS+= -Wall \
|
||||
-Werror
|
||||
|
50
Gorm.m
50
Gorm.m
|
@ -644,7 +644,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
|
||||
- (id) close: (id)sender
|
||||
{
|
||||
NSWindow *window = [(id)[self activeDocument] window];
|
||||
NSWindow *window = [(GormDocument *)[self activeDocument] window];
|
||||
|
||||
[window setReleasedWhenClosed: YES];
|
||||
[window performClose: self];
|
||||
|
@ -656,7 +656,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
if ([[selectionOwner selection] count] == 0
|
||||
|| [selectionOwner respondsToSelector: @selector(copySelection)] == NO)
|
||||
return nil;
|
||||
[selectionOwner copySelection];
|
||||
[(GormGenericEditor *)selectionOwner copySelection];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -672,7 +672,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
|
||||
- (id) createSubclass: (id)sender
|
||||
{
|
||||
return [(id)[self activeDocument] createSubclass: sender];
|
||||
return [(GormDocument *)[self activeDocument] createSubclass: sender];
|
||||
}
|
||||
|
||||
- (id) cut: (id)sender
|
||||
|
@ -681,8 +681,8 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
|| [selectionOwner respondsToSelector: @selector(copySelection)] == NO
|
||||
|| [selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
|
||||
return nil;
|
||||
[selectionOwner copySelection];
|
||||
[selectionOwner deleteSelection];
|
||||
[(GormGenericEditor *)selectionOwner copySelection];
|
||||
[(GormGenericEditor *)selectionOwner deleteSelection];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -691,7 +691,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
if ([[selectionOwner selection] count] < 2
|
||||
|| [selectionOwner respondsToSelector: @selector(groupSelectionInSplitView)] == NO)
|
||||
return nil;
|
||||
[(id)selectionOwner groupSelectionInSplitView];
|
||||
[(GormGenericEditor *)selectionOwner groupSelectionInSplitView];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -699,7 +699,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
{
|
||||
if ([selectionOwner respondsToSelector: @selector(groupSelectionInBox)] == NO)
|
||||
return nil;
|
||||
[(id)selectionOwner groupSelectionInBox];
|
||||
[(GormGenericEditor *)selectionOwner groupSelectionInBox];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -707,7 +707,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
{
|
||||
if ([selectionOwner respondsToSelector: @selector(groupSelectionInScrollView)] == NO)
|
||||
return nil;
|
||||
[(id)selectionOwner groupSelectionInScrollView];
|
||||
[(GormGenericEditor *)selectionOwner groupSelectionInScrollView];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -716,7 +716,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
NSLog(@"ungroup: selectionOwner %@", selectionOwner);
|
||||
if ([selectionOwner respondsToSelector: @selector(ungroup)] == NO)
|
||||
return nil;
|
||||
[(id)selectionOwner ungroup];
|
||||
[(GormGenericEditor *)selectionOwner ungroup];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -738,7 +738,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
if ([[selectionOwner selection] count] == 0
|
||||
|| [selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
|
||||
return nil;
|
||||
[selectionOwner deleteSelection];
|
||||
[(GormGenericEditor *)selectionOwner deleteSelection];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -867,17 +867,17 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
{
|
||||
// Call the current document and create the class
|
||||
// descibed by the header
|
||||
return [(id)[self activeDocument] loadClass: sender];
|
||||
return [(GormDocument *)[self activeDocument] loadClass: sender];
|
||||
}
|
||||
|
||||
- (id) addAttributeToClass: (id)sender
|
||||
{
|
||||
return [(id)[self activeDocument] addAttributeToClass: sender];
|
||||
return [(GormDocument *)[self activeDocument] addAttributeToClass: sender];
|
||||
}
|
||||
|
||||
- (id) remove: (id)sender
|
||||
{
|
||||
return [(id)[self activeDocument] remove: sender];
|
||||
return [(GormDocument *)[self activeDocument] remove: sender];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -890,7 +890,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
|
||||
- (id) createClassFiles: (id)sender
|
||||
{
|
||||
return [(id)[self activeDocument] createClassFiles: sender];
|
||||
return [(GormDocument *)[self activeDocument] createClassFiles: sender];
|
||||
}
|
||||
|
||||
|
||||
|
@ -958,10 +958,6 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
|
||||
- (void) finishLaunching
|
||||
{
|
||||
NSMenu *aMenu;
|
||||
NSMenu *modulesMenu;
|
||||
NSMenu *windowsMenu;
|
||||
NSMenuItem *menuItem;
|
||||
NSBundle *bundle;
|
||||
NSString *path;
|
||||
|
||||
|
@ -1124,7 +1120,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
|
||||
- (id) instantiateClass: (id)sender
|
||||
{
|
||||
return [(id)[self activeDocument] instantiateClass: sender];
|
||||
return [(GormDocument *)[self activeDocument] instantiateClass: sender];
|
||||
}
|
||||
|
||||
- (BOOL) isConnecting
|
||||
|
@ -1154,17 +1150,17 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
|
||||
- (void) loadSound: (id) sender
|
||||
{
|
||||
[(id)[self activeDocument] openSound: sender];
|
||||
[(GormDocument *)[self activeDocument] openSound: sender];
|
||||
}
|
||||
|
||||
- (void) loadImage: (id) sender
|
||||
{
|
||||
[(id)[self activeDocument] openImage: sender];
|
||||
[(GormDocument *)[self activeDocument] openImage: sender];
|
||||
}
|
||||
|
||||
- (id) miniaturize: (id)sender
|
||||
{
|
||||
NSWindow *window = [(id)[self activeDocument] window];
|
||||
NSWindow *window = [(GormDocument *)[self activeDocument] window];
|
||||
|
||||
[window miniaturize: self];
|
||||
return nil;
|
||||
|
@ -1270,13 +1266,13 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
{
|
||||
if ([selectionOwner respondsToSelector: @selector(pasteInSelection)] == NO)
|
||||
return nil;
|
||||
[selectionOwner pasteInSelection];
|
||||
[(GormGenericEditor *)selectionOwner pasteInSelection];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) revertToSaved: (id)sender
|
||||
{
|
||||
id doc = [(id)[self activeDocument] revertDocument: sender];
|
||||
id doc = [(GormDocument *)[self activeDocument] revertDocument: sender];
|
||||
|
||||
if (doc != nil)
|
||||
{
|
||||
|
@ -1288,7 +1284,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
|
||||
- (id) save: (id)sender
|
||||
{
|
||||
[(id)[self activeDocument] saveDocument: sender];
|
||||
[(GormDocument *)[self activeDocument] saveDocument: sender];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -1309,7 +1305,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
|
||||
- (id) saveAs: (id)sender
|
||||
{
|
||||
[(id)[self activeDocument] saveAsDocument: sender];
|
||||
[(GormDocument *)[self activeDocument] saveAsDocument: sender];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -1321,7 +1317,7 @@ static NSButtonType _buttonTypeForObject( id button )
|
|||
|
||||
- (id<IBSelectionOwners>) selectionOwner
|
||||
{
|
||||
return selectionOwner;
|
||||
return (id<IBSelectionOwners>)selectionOwner;
|
||||
}
|
||||
|
||||
- (id) selectedObject
|
||||
|
|
|
@ -459,18 +459,18 @@
|
|||
BOOL rightEmpty = YES;
|
||||
BOOL topEmpty = YES;
|
||||
BOOL bottomEmpty = YES;
|
||||
float bestLeftPosition;
|
||||
float bestRightPosition;
|
||||
float bestTopPosition;
|
||||
float bestBottomPosition;
|
||||
float leftStart;
|
||||
float rightStart;
|
||||
float topStart;
|
||||
float bottomStart;
|
||||
float leftEnd;
|
||||
float rightEnd;
|
||||
float topEnd;
|
||||
float bottomEnd;
|
||||
float bestLeftPosition = 0;
|
||||
float bestRightPosition = 0;
|
||||
float bestTopPosition = 0;
|
||||
float bestBottomPosition = 0;
|
||||
float leftStart = 0;
|
||||
float rightStart = 0;
|
||||
float topStart = 0;
|
||||
float bottomStart = 0;
|
||||
float leftEnd = 0;
|
||||
float rightEnd = 0;
|
||||
float topEnd = 0;
|
||||
float bottomEnd = 0;
|
||||
NSSize minSize;
|
||||
NSMutableArray *bests;
|
||||
|
||||
|
|
|
@ -108,6 +108,10 @@
|
|||
- (id) editClass: (id)sender;
|
||||
- (id) createClassFiles: (id)sender;
|
||||
- (void) changeCurrentClass: (id)sender;
|
||||
- (id) addAttributeToClass: (id)sender;
|
||||
- (id) remove: (id)sender;
|
||||
- (id) createClassFiles: (id)sender;
|
||||
- (id) instantiateClass: (id)sender;
|
||||
|
||||
// sound & image support
|
||||
- (id) openSound: (id)sender;
|
||||
|
@ -122,6 +126,9 @@
|
|||
- (BOOL) removeConnectionsForClassNamed: (NSString *)name;
|
||||
- (BOOL) renameConnectionsForClassNamed: (NSString *)name
|
||||
toName: (NSString *)newName;
|
||||
// class loading
|
||||
- (id) loadClass: (id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@interface GormDocument (MenuValidation)
|
||||
|
|
|
@ -299,7 +299,6 @@ static NSImage *classesImage = nil;
|
|||
// image support
|
||||
- (GormImage *)_createImagePlaceHolder: (NSString *)path
|
||||
{
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
||||
NSString *name = [[path lastPathComponent] stringByDeletingPathExtension];
|
||||
return TEST_AUTORELEASE([[GormImage alloc] initWithName: name path: path]);
|
||||
}
|
||||
|
@ -486,8 +485,6 @@ static NSImage *classesImage = nil;
|
|||
|
||||
- (void) _selectClassWithObject: (id)obj
|
||||
{
|
||||
GormClassManager *cm = [self classManager];
|
||||
|
||||
if ([obj respondsToSelector: @selector(className)])
|
||||
{
|
||||
[self _selectClass: [obj className]];
|
||||
|
@ -1137,7 +1134,7 @@ static NSImage *classesImage = nil;
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (void) editor: (id<IBEditors>)anEditor didCloseForObject: (id)anObject
|
||||
- (void) editor: (id<IBEditors,IBSelectionOwners>)anEditor didCloseForObject: (id)anObject
|
||||
{
|
||||
NSArray *links;
|
||||
|
||||
|
@ -1166,8 +1163,8 @@ static NSImage *classesImage = nil;
|
|||
/*
|
||||
* Make sure that this editor is not the selection owner.
|
||||
*/
|
||||
// if ([(id)NSApp selectionOwner] == anEditor)
|
||||
if ([(id<IBSelectionOwners>)NSApp selectionOwner] == anEditor)
|
||||
if ([(Gorm *)NSApp selectionOwner] ==
|
||||
anEditor)
|
||||
{
|
||||
[self resignSelectionForEditor: anEditor];
|
||||
}
|
||||
|
@ -1229,7 +1226,7 @@ static NSImage *classesImage = nil;
|
|||
NSDebugLog(@"WARNING anEditor = editor");
|
||||
}
|
||||
[editor activate];
|
||||
RELEASE((id)editor);
|
||||
RELEASE((NSObject *)editor);
|
||||
return editor;
|
||||
}
|
||||
else if ([links count] == 0)
|
||||
|
@ -2515,7 +2512,6 @@ static NSImage *classesImage = nil;
|
|||
|
||||
- (void) saveAsDocument: (id)sender
|
||||
{
|
||||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
NSSavePanel *sp;
|
||||
int result;
|
||||
|
||||
|
@ -2765,7 +2761,7 @@ static NSImage *classesImage = nil;
|
|||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
NSDebugLog(@"setSelectionFromEditor %@", anEditor);
|
||||
if ([(id)anEditor respondsToSelector: @selector(window)])
|
||||
if ([(NSObject *)anEditor respondsToSelector: @selector(window)])
|
||||
{
|
||||
[[anEditor window] makeFirstResponder: anEditor];
|
||||
}
|
||||
|
|
|
@ -43,10 +43,9 @@
|
|||
if ([theEvent modifierFlags] & NSControlKeyMask)
|
||||
{
|
||||
NSPoint loc = [theEvent locationInWindow];
|
||||
NSString *name;
|
||||
int r, c;
|
||||
int pos;
|
||||
id obj;
|
||||
int r = 0, c = 0;
|
||||
int pos = 0;
|
||||
id obj = nil;
|
||||
|
||||
loc = [self convertPoint: loc fromView: nil];
|
||||
[self getRow: &r column: &c forPoint: loc];
|
||||
|
@ -94,14 +93,43 @@
|
|||
[self closeSubeditors];
|
||||
}
|
||||
|
||||
// Stubbed out methods... Since this is an abstract class, some methods need to be
|
||||
// provided so that compilation will occur cleanly and to give a warning if called.
|
||||
- (void) closeSubeditors
|
||||
{
|
||||
}
|
||||
|
||||
- (void) resetObject: (id)object
|
||||
{
|
||||
}
|
||||
|
||||
- (id) initWithObject: (id)anObject inDocument: (id<IBDocuments>)aDocument
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL) acceptsTypeFromArray: (NSArray*)types
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) makeSelectionVisible: (BOOL)flag
|
||||
{
|
||||
}
|
||||
|
||||
- (void) deactivate
|
||||
{
|
||||
}
|
||||
|
||||
- (void) copySelection
|
||||
{
|
||||
}
|
||||
|
||||
- (void) pasteInSelection
|
||||
{
|
||||
}
|
||||
// end of stubbed methods...
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(objects);
|
||||
|
|
|
@ -255,11 +255,6 @@ static NSMapTable *docMap = 0;
|
|||
NSPoint lastLocation = [theEvent locationInWindow];
|
||||
NSEvent* lastEvent = theEvent;
|
||||
NSPoint initialLocation;
|
||||
BOOL done = NO;
|
||||
NSRect rect;
|
||||
id aCell, previousCell = nil;
|
||||
NSRect previousRect;
|
||||
BOOL mouseUpInCell = NO, onCell;
|
||||
|
||||
/*
|
||||
* Pathological case -- ignore mouse down
|
||||
|
@ -370,7 +365,6 @@ static NSMapTable *docMap = 0;
|
|||
{
|
||||
id filesArray;
|
||||
id data;
|
||||
id unarchiver;
|
||||
|
||||
if ( [[[NSPasteboard pasteboardWithName: NSDragPboard] types]
|
||||
containsObject: NSFilenamesPboardType])
|
||||
|
@ -386,13 +380,13 @@ static NSMapTable *docMap = 0;
|
|||
for (i = 0; i < count; i ++ )
|
||||
{
|
||||
id placeHolder =
|
||||
[document _createImagePlaceHolder: [filesArray objectAtIndex: i]];
|
||||
[(GormDocument *)document _createImagePlaceHolder: [filesArray objectAtIndex: i]];
|
||||
NSLog(@"here1 %@", [filesArray objectAtIndex: i]);
|
||||
if (placeHolder)
|
||||
{
|
||||
NSLog(@"here %@", [filesArray objectAtIndex: i]);
|
||||
[self addObject: placeHolder];
|
||||
[document addImage:
|
||||
[(GormDocument *)document addImage:
|
||||
[[[filesArray objectAtIndex: i]
|
||||
lastPathComponent]
|
||||
stringByDeletingPathExtension]];
|
||||
|
@ -401,8 +395,9 @@ static NSMapTable *docMap = 0;
|
|||
}
|
||||
// NSLog(@"filesArray %@", filesArray);
|
||||
// NSLog(@"filesArray %@", [filesArray class]);
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) prepareForDragOperation: (id<NSDraggingInfo>)sender
|
||||
|
|
|
@ -89,7 +89,8 @@ static NSImage *horizontalImage;
|
|||
{
|
||||
NSEnumerator *enumerator;
|
||||
NSView *sub;
|
||||
NSView *superview = [_editedObject superview];
|
||||
id superview = [_editedObject superview];
|
||||
// NSView *superview = [_editedObject superview];
|
||||
|
||||
// NSLog(@"ac %@ %@ %@", self, _editedObject, superview);
|
||||
|
||||
|
@ -198,7 +199,8 @@ static NSImage *horizontalImage;
|
|||
{
|
||||
if (activated == YES)
|
||||
{
|
||||
NSView *superview = [self superview];
|
||||
id superview = [self superview];
|
||||
// NSView *superview = [self superview];
|
||||
|
||||
[self deactivateSubeditors];
|
||||
|
||||
|
@ -447,8 +449,8 @@ static NSImage *horizontalImage;
|
|||
// get the view we are on
|
||||
{
|
||||
NSPoint mouseDownPoint;
|
||||
NSView *result;
|
||||
GormViewEditor *theParent;
|
||||
NSView *result = nil;
|
||||
GormViewEditor *theParent = nil;
|
||||
|
||||
mouseDownPoint = [self
|
||||
convertPoint: [theEvent locationInWindow]
|
||||
|
@ -532,7 +534,7 @@ static NSImage *horizontalImage;
|
|||
NSEvent *e;
|
||||
unsigned eventMask;
|
||||
NSDate *future = [NSDate distantFuture];
|
||||
BOOL first = YES;
|
||||
// BOOL first = YES;
|
||||
NSRect oldRect = NSZeroRect;
|
||||
NSPoint p, oldp;
|
||||
NSRect r;
|
||||
|
@ -592,8 +594,8 @@ static NSImage *horizontalImage;
|
|||
|
||||
{
|
||||
NSRect wr;
|
||||
NSCachedImageRep *tableRep =
|
||||
[[verticalImage representations]objectAtIndex:0];
|
||||
//NSCachedImageRep *tableRep =
|
||||
// [[verticalImage representations]objectAtIndex:0];
|
||||
wr = [self convertRect: r
|
||||
toView: nil];
|
||||
|
||||
|
|
|
@ -309,9 +309,9 @@ static NSMapTable *docMap = 0;
|
|||
{
|
||||
NSPoint loc = [theEvent locationInWindow];
|
||||
NSString *name;
|
||||
int r, c;
|
||||
int pos;
|
||||
id obj;
|
||||
int r = 0, c = 0;
|
||||
int pos = 0;
|
||||
id obj = nil;
|
||||
|
||||
loc = [self convertPoint: loc fromView: nil];
|
||||
[self getRow: &r column: &c forPoint: loc];
|
||||
|
|
|
@ -108,7 +108,7 @@ extern NSString *GormLinkPboardType;
|
|||
GormClassManager *classManager;
|
||||
GormInspectorsManager *inspectorsManager;
|
||||
GormPalettesManager *palettesManager;
|
||||
id selectionOwner;
|
||||
id<IBSelectionOwners> selectionOwner;
|
||||
NSMutableArray *documents;
|
||||
BOOL isConnecting;
|
||||
BOOL isTesting;
|
||||
|
@ -191,28 +191,19 @@ extern NSString *GormLinkPboardType;
|
|||
NSPasteboard *dragPb;
|
||||
NSString *dragType;
|
||||
}
|
||||
@end
|
||||
// selection methods...
|
||||
- (void) selectObjects: (NSArray*)objects;
|
||||
- (BOOL) wantsSelection;
|
||||
- (void) copySelection;
|
||||
- (void) deleteSelection;
|
||||
- (void) pasteInSelection;
|
||||
- (void) refreshCells;
|
||||
- (void) closeSubeditors;
|
||||
|
||||
// private methods...
|
||||
@interface GormGenericEditor (PrivateMethods)
|
||||
- (void) groupSelectionInScrollView;
|
||||
@end
|
||||
|
||||
@interface GormObjectEditor : GormGenericEditor <IBEditors, IBSelectionOwners>
|
||||
{
|
||||
// NSMutableArray *objects;
|
||||
// id<IBDocuments> document;
|
||||
// id selected;
|
||||
// NSPasteboard *dragPb;
|
||||
// NSString *dragType;
|
||||
}
|
||||
// + (GormObjectEditor*) editorForDocument: (id<IBDocuments>)aDocument;
|
||||
- (NSWindow*) window;
|
||||
- (void) addObject: (id)anObject;
|
||||
- (void) draggedImage: (NSImage*)i endedAt: (NSPoint)p deposited: (BOOL)f;
|
||||
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag;
|
||||
- (void) refreshCells;
|
||||
- (void) removeObject: (id)anObject;
|
||||
- (BOOL) acceptsTypeFromArray: (NSArray*)types;
|
||||
- (BOOL) activate;
|
||||
- (id) initWithObject: (id)anObject inDocument: (id<IBDocuments>)aDocument;
|
||||
- (void) close;
|
||||
|
@ -222,18 +213,39 @@ extern NSString *GormLinkPboardType;
|
|||
- (void) deleteSelection;
|
||||
- (id<IBDocuments>) document;
|
||||
- (id) editedObject;
|
||||
- (void) makeSelectionVisible: (BOOL)flag;
|
||||
- (id<IBEditors>) openSubeditorForObject: (id)anObject;
|
||||
- (void) orderFront;
|
||||
- (void) pasteInSelection;
|
||||
- (NSRect) rectForObject: (id)anObject;
|
||||
- (void) resetObject: (id)anObject;
|
||||
- (void) selectObjects: (NSArray*)objects;
|
||||
- (BOOL) wantsSelection;
|
||||
- (NSWindow*) window;
|
||||
@end
|
||||
|
||||
@interface GormSoundEditor : GormGenericEditor <IBEditors, IBSelectionOwners>
|
||||
// private methods...
|
||||
@interface GormGenericEditor (PrivateMethods)
|
||||
- (void) groupSelectionInScrollView;
|
||||
- (void) groupSelectionInSplitView;
|
||||
- (void) groupSelectionInBox;
|
||||
- (void) ungroup;
|
||||
- (void) setEditor: (id)anEditor forDocument: (id<IBDocuments>)doc;
|
||||
- (id) changeSelection: (id)sender;
|
||||
@end
|
||||
|
||||
@interface GormObjectEditor : GormGenericEditor // <IBEditors, IBSelectionOwners>
|
||||
{
|
||||
// NSMutableArray *objects;
|
||||
// id<IBDocuments> document;
|
||||
// id selected;
|
||||
// NSPasteboard *dragPb;
|
||||
// NSString *dragType;
|
||||
}
|
||||
// + (GormObjectEditor*) editorForDocument: (id<IBDocuments>)aDocument;
|
||||
- (void) draggedImage: (NSImage*)i endedAt: (NSPoint)p deposited: (BOOL)f;
|
||||
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag;
|
||||
- (BOOL) acceptsTypeFromArray: (NSArray*)types;
|
||||
- (void) makeSelectionVisible: (BOOL)flag;
|
||||
- (void) resetObject: (id)anObject;
|
||||
@end
|
||||
|
||||
@interface GormSoundEditor : GormGenericEditor // <IBEditors, IBSelectionOwners>
|
||||
{
|
||||
// NSMutableArray *objects;
|
||||
// id<IBDocuments> document;
|
||||
|
@ -243,30 +255,17 @@ extern NSString *GormLinkPboardType;
|
|||
}
|
||||
// don't redeclare methods already declared in protocols.
|
||||
+ (GormSoundEditor*) editorForDocument: (id<IBDocuments>)aDocument;
|
||||
- (void) addObject: (id)anObject;
|
||||
- (void) draggedImage: (NSImage*)i endedAt: (NSPoint)p deposited: (BOOL)f;
|
||||
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag;
|
||||
- (void) refreshCells;
|
||||
- (void) removeObject: (id)anObject;
|
||||
- (void) closeSubeditors;
|
||||
- (BOOL) containsObject: (id)anObject;
|
||||
- (void) copySelection;
|
||||
- (void) deleteSelection;
|
||||
- (id<IBEditors>) openSubeditorForObject: (id)anObject;
|
||||
- (void) pasteInSelection;
|
||||
- (NSRect) rectForObject: (id)anObject;
|
||||
@end
|
||||
|
||||
@interface GormImageEditor : GormGenericEditor <IBEditors, IBSelectionOwners>
|
||||
@interface GormImageEditor : GormGenericEditor // <IBEditors, IBSelectionOwners>
|
||||
{
|
||||
}
|
||||
// don't redeclare methods already declared in protocols.
|
||||
- (void) draggedImage: (NSImage*)i endedAt: (NSPoint)p deposited: (BOOL)f;
|
||||
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag;
|
||||
- (void) refreshCells;
|
||||
- (void) copySelection;
|
||||
- (void) deleteSelection;
|
||||
- (void) pasteInSelection;
|
||||
@end
|
||||
|
||||
|
||||
|
@ -314,6 +313,7 @@ extern NSString *GormLinkPboardType;
|
|||
|
||||
@interface NSObject (GormAdditions)
|
||||
- (id) allocSubstitute;
|
||||
- (NSImage *) imageForViewer;
|
||||
@end
|
||||
|
||||
// we don't use the actual sound since we don't want to read the entire sound into
|
||||
|
@ -360,6 +360,12 @@ extern NSString *GormLinkPboardType;
|
|||
- (NSString *)inspectorClassName;
|
||||
@end
|
||||
|
||||
@interface GormDocument (PrivateMethodsForImagesAndSounds)
|
||||
- (GormImage *)_createImagePlaceHolder: (NSString *)path;
|
||||
- (GormSound *)_createSoundPlaceHolder: (NSString *)path;
|
||||
- (void) addImage: (NSString*) path;
|
||||
@end
|
||||
|
||||
/*
|
||||
* Functions for drawing knobs etc.
|
||||
*/
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
|
||||
#include "GormPrivate.h"
|
||||
#include <AppKit/NSSound.h>
|
||||
|
||||
NSString *GormSoundPboardType = @"GormSoundPboardType";
|
||||
|
||||
|
@ -305,11 +306,6 @@ static NSMapTable *docMap = 0;
|
|||
NSPoint lastLocation = [theEvent locationInWindow];
|
||||
NSEvent* lastEvent = theEvent;
|
||||
NSPoint initialLocation;
|
||||
BOOL done = NO;
|
||||
NSRect rect;
|
||||
id aCell, previousCell = nil;
|
||||
NSRect previousRect;
|
||||
BOOL mouseUpInCell = NO, onCell;
|
||||
|
||||
/*
|
||||
* Pathological case -- ignore mouse down
|
||||
|
@ -580,8 +576,8 @@ static NSMapTable *docMap = 0;
|
|||
|
||||
- (void) resetObject: (id)anObject
|
||||
{
|
||||
NSString *name = nil; // [document nameForObject: anObject];
|
||||
GormInspectorsManager *mgr = [(Gorm*)NSApp inspectorsManager];
|
||||
// NSString *name = nil; // [document nameForObject: anObject];
|
||||
// GormInspectorsManager *mgr = [(Gorm*)NSApp inspectorsManager];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -591,12 +587,14 @@ static NSMapTable *docMap = 0;
|
|||
- (id) initWithName: (NSString *)aName
|
||||
path: (NSString *)aPath
|
||||
{
|
||||
NSSound *sound = [[NSSound alloc] initWithContentsOfFile: aPath
|
||||
byReference: YES];
|
||||
[super init];
|
||||
ASSIGN(name, aName);
|
||||
ASSIGN(path, aPath);
|
||||
#warning "we want to store the sound somewhere"
|
||||
[[[NSSound alloc] initWithContentsOfFile: aPath
|
||||
byReference: YES] setName: aName];
|
||||
|
||||
//#warning "we want to store the sound somewhere"
|
||||
[(NSSound *)sound setName: aName];
|
||||
isSystemSound = NO;
|
||||
isInWrapper = NO;
|
||||
return self;
|
||||
|
|
|
@ -532,18 +532,18 @@ static BOOL currently_displaying = NO;
|
|||
BOOL rightEmpty = YES;
|
||||
BOOL topEmpty = YES;
|
||||
BOOL bottomEmpty = YES;
|
||||
float bestLeftPosition;
|
||||
float bestRightPosition;
|
||||
float bestTopPosition;
|
||||
float bestBottomPosition;
|
||||
float leftStart;
|
||||
float rightStart;
|
||||
float topStart;
|
||||
float bottomStart;
|
||||
float leftEnd;
|
||||
float rightEnd;
|
||||
float topEnd;
|
||||
float bottomEnd;
|
||||
float bestLeftPosition = 0;
|
||||
float bestRightPosition = 0;
|
||||
float bestTopPosition = 0;
|
||||
float bestBottomPosition = 0;
|
||||
float leftStart = 0;
|
||||
float rightStart = 0;
|
||||
float topStart = 0;
|
||||
float bottomStart = 0;
|
||||
float leftEnd = 0;
|
||||
float rightEnd = 0;
|
||||
float topEnd = 0;
|
||||
float bottomEnd = 0;
|
||||
|
||||
NSMutableArray *bests;
|
||||
if (gpi->hintInitialized == NO)
|
||||
|
@ -832,14 +832,14 @@ static BOOL currently_displaying = NO;
|
|||
BOOL rightEmpty = YES;
|
||||
BOOL topEmpty = YES;
|
||||
BOOL bottomEmpty = YES;
|
||||
float leftStart;
|
||||
float rightStart;
|
||||
float topStart;
|
||||
float bottomStart;
|
||||
float leftEnd;
|
||||
float rightEnd;
|
||||
float topEnd;
|
||||
float bottomEnd;
|
||||
float leftStart = 0;
|
||||
float rightStart = 0;
|
||||
float topStart = 0;
|
||||
float bottomStart = 0;
|
||||
float leftEnd = 0;
|
||||
float rightEnd = 0;
|
||||
float topEnd = 0;
|
||||
float bottomEnd = 0;
|
||||
|
||||
if (gpi->hintInitialized == NO)
|
||||
{
|
||||
|
@ -870,7 +870,7 @@ static BOOL currently_displaying = NO;
|
|||
|
||||
{
|
||||
BOOL empty = YES;
|
||||
float bestPosition;
|
||||
float bestPosition = 0;
|
||||
NSMutableArray *leftBests;
|
||||
NSMutableArray *rightBests;
|
||||
minimum = 6;
|
||||
|
@ -957,7 +957,7 @@ static BOOL currently_displaying = NO;
|
|||
|
||||
{
|
||||
BOOL empty = YES;
|
||||
float bestPosition;
|
||||
float bestPosition = 0;
|
||||
NSMutableArray *bottomBests;
|
||||
NSMutableArray *topBests;
|
||||
minimum = 6;
|
||||
|
@ -1409,15 +1409,13 @@ static BOOL currently_displaying = NO;
|
|||
}
|
||||
else if ([types containsObject: GormImagePboardType] == YES)
|
||||
{
|
||||
NSData *data;
|
||||
NSString *name;
|
||||
NSString *name;
|
||||
name = [dragPb stringForType: GormImagePboardType];
|
||||
[(id)_editedObject setImage: [NSImage imageNamed: name]];
|
||||
return YES;
|
||||
}
|
||||
else if ([types containsObject: GormSoundPboardType] == YES)
|
||||
{
|
||||
NSData *data;
|
||||
NSString *name;
|
||||
name = [dragPb stringForType: GormSoundPboardType];
|
||||
NSLog(@"sound drag'n'dropping is not currently working, please fix it");
|
||||
|
@ -1511,6 +1509,11 @@ static BOOL currently_displaying = NO;
|
|||
[self unlockFocus];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) acceptsTypeFromArray: (NSArray*)types
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@
|
|||
NSEnumerator *enumerator;
|
||||
NSRect oldMovingFrame;
|
||||
NSRect suggestedFrame;
|
||||
GormPlacementInfo *gpi;
|
||||
GormPlacementInfo *gpi = nil;
|
||||
BOOL shouldUpdateSelection = YES;
|
||||
BOOL mouseDidMove = NO;
|
||||
|
||||
|
@ -828,12 +828,12 @@
|
|||
|
||||
- (void) groupSelectionInSplitView
|
||||
{
|
||||
NSEnumerator *enumerator;
|
||||
GormViewEditor *subview;
|
||||
NSSplitView *splitView;
|
||||
NSEnumerator *enumerator = nil;
|
||||
GormViewEditor *subview = nil;
|
||||
NSSplitView *splitView = nil;
|
||||
NSRect rect = NSZeroRect;
|
||||
GormViewEditor *editor;
|
||||
NSView *superview;
|
||||
GormViewEditor *editor = nil;
|
||||
NSView *superview = nil;
|
||||
|
||||
if ([selection count] < 2)
|
||||
{
|
||||
|
@ -881,12 +881,12 @@
|
|||
|
||||
- (void) groupSelectionInBox
|
||||
{
|
||||
NSEnumerator *enumerator;
|
||||
GormViewEditor *subview;
|
||||
NSBox *box;
|
||||
NSEnumerator *enumerator = nil;
|
||||
GormViewEditor *subview = nil;
|
||||
NSBox *box = nil;
|
||||
NSRect rect = NSZeroRect;
|
||||
GormViewEditor *editor;
|
||||
NSView *superview;
|
||||
GormViewEditor *editor = nil;
|
||||
NSView *superview = nil;
|
||||
|
||||
if ([selection count] < 1)
|
||||
{
|
||||
|
@ -933,13 +933,13 @@
|
|||
|
||||
- (void) groupSelectionInScrollView
|
||||
{
|
||||
NSEnumerator *enumerator;
|
||||
GormViewEditor *subview;
|
||||
NSView *view;
|
||||
NSScrollView *scrollView;
|
||||
NSEnumerator *enumerator = nil;
|
||||
GormViewEditor *subview = nil;
|
||||
NSView *view = nil;
|
||||
NSScrollView *scrollView = nil;
|
||||
NSRect rect = NSZeroRect;
|
||||
GormViewEditor *editor;
|
||||
NSView *superview;
|
||||
GormViewEditor *editor = nil;
|
||||
NSView *superview = nil;
|
||||
|
||||
if ([selection count] < 1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue