Update to use GormAppDelegate instead of overriding NSApplication

This commit is contained in:
Gregory John Casamento 2023-06-17 12:14:48 -04:00
parent e57e4124d0
commit db7a2e3969
52 changed files with 390 additions and 376 deletions

View file

@ -4,10 +4,27 @@
Actions = (
"alignSelectedObjects:",
"arrangeSelectedObjects:",
"endTesting:",
"exportStrings:",
"groupSelectionInView:",
"groupSelectionInBox:",
"groupSelectionInMatrix:",
"groupSelectionInSplitView:",
"groupSelectionInView:",
"inspector:",
"loadImage:",
"loadPallete:",
"loadSound:",
"newAction11:",
"newAction12:",
"newAction13:",
"newAction14:",
"ungroup:",
"orderFrontFontPanel:",
"palettes:",
"preferencesPanel:",
"selectAllItems:",
"setName:",
"testinterface:",
"translate:"
);
Super = NSObject;
@ -55,6 +72,32 @@
);
Super = NSApplication;
};
GormAppDelegate = {
Actions = (
"copy:",
"cut:",
"delete:",
"endTesting:",
"groupSelectionInBox:",
"groupSelectionInSplitView:",
"inspector:",
"loadImage:",
"loadPallete:",
"loadSound:",
"ungroup:",
"palettes:",
"paste:",
"preferencesPanel:",
"selectAllItems:",
"setName:",
"testinterface:"
);
Outlets = (
gormMenu,
guideLineMenuItem
);
Super = NSObject;
};
GormDocumentController = {
Actions = (
);

View file

@ -66,8 +66,6 @@ Gorm_PRINCIPAL_CLASS=Gorm
Gorm_APPLICATION_ICON=Gorm.tiff
Gorm_RESOURCE_FILES = \
GormInfo.plist \
Resources/ClassInformation.plist \
Resources/VersionProfiles.plist \
Resources/Defaults.plist \
Palettes/0Menus/0Menus.palette \
Palettes/1Windows/1Windows.palette \
@ -115,7 +113,7 @@ Gorm_LANGUAGES = \
Gorm_HEADERS =
Gorm_OBJC_FILES = \
Gorm.m \
GormAppDelegate.m \
main.m
-include GNUmakefile.preamble

View file

@ -0,0 +1,39 @@
/* All rights reserved */
#import <AppKit/AppKit.h>
#include <GormCore/GormCore.h>
#include <GormCore/GormPrefs.h>
#include <GNUstepBase/GSObjCRuntime.h>
@interface GormAppDelegate : NSObject <IB, GormAppDelegate, GormServer>
{
IBOutlet id gormMenu;
IBOutlet id guideLineMenuItem;
GormPrefController *preferencesController;
GormClassManager *classManager;
GormInspectorsManager *inspectorsManager;
GormPalettesManager *palettesManager;
GormPluginManager *pluginManager;
id<IBSelectionOwners> selectionOwner;
BOOL isConnecting;
BOOL isTesting;
id testContainer;
NSMenu *mainMenu; // saves the main menu...
NSMenu *servicesMenu; // saves the services menu...
NSMenu *classMenu; // so we can set it for the class view
NSDictionary *menuLocations;
NSImage *linkImage;
NSImage *sourceImage;
NSImage *targetImage;
NSImage *gormImage;
NSImage *testingImage;
id connectSource;
id connectDestination;
NSMutableArray *testingWindows;
NSSet *topObjects;
}
@end

View file

@ -1,81 +1,13 @@
/* Gorm.m
*
* Copyright (C) 1999, 2003 Free Software Foundation, Inc.
*
* Author: Richard Frith-Macdonald <richard@brainstrom.co.uk>
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
* Date: 1999, 2003, 2004
*
* 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.
*/
/* All rights reserved */
#import <AppKit/AppKit.h>
#import "GormAppDelegate.h"
#include <GormCore/GormCore.h>
#include <GormPrefs/GormPrefs.h>
#include <GNUstepBase/GSObjCRuntime.h>
@interface Gorm : NSApplication <IB, Gorm>
{
GormPrefController *preferencesController;
GormClassManager *classManager;
GormInspectorsManager *inspectorsManager;
GormPalettesManager *palettesManager;
GormPluginManager *pluginManager;
id<IBSelectionOwners> selectionOwner;
BOOL isConnecting;
BOOL isTesting;
id testContainer;
id gormMenu;
NSMenu *mainMenu; // saves the main menu...
NSMenu *servicesMenu; // saves the services menu...
NSMenu *classMenu; // so we can set it for the class view
NSMenuItem *guideLineMenuItem;
NSDictionary *menuLocations;
NSImage *linkImage;
NSImage *sourceImage;
NSImage *targetImage;
NSImage *gormImage;
NSImage *testingImage;
id connectSource;
id connectDestination;
NSMutableArray *testingWindows;
NSSet *topObjects;
}
// handle notifications the object recieves.
- (void) handleNotification: (NSNotification*)aNotification;
@end
// Handle server protocol methods...
@interface Gorm (GormServer) <GormServer>
@end
@implementation Gorm
- (id<IBDocuments>) activeDocument
{
return [[NSDocumentController sharedDocumentController] currentDocument];
}
/*
NSApplication override to make Inspector's shortcuts available globally
*/
@implementation NSApplication (GormPrivateMethods)
// NSApplication override to make Inspector's shortcuts available globally
- (void) sendEvent: (NSEvent *)theEvent
{
if ([theEvent type] == NSKeyDown)
@ -90,12 +22,58 @@
[super sendEvent: theEvent];
}
- (void) arrangeInFront: (id)sender
{
if([self isTestingInterface] == NO)
{
[NSApp arrangeInFront: sender];
}
}
@end
*/
@implementation GormAppDelegate
// Methods to support external apps adding and deleting
// classes from the current document...
- (void) addClass: (NSDictionary *) dict
{
GormDocument *doc = (GormDocument *)[self activeDocument];
GormClassManager *cm = [doc classManager];
NSArray *outlets = [dict objectForKey: @"outlets"];
NSArray *actions = [dict objectForKey: @"actions"];
NSString *className = [dict objectForKey: @"className"];
NSString *superClassName = [dict objectForKey: @"superClassName"];
// If the class is known, delete it before proceeding.
if([cm isKnownClass: className])
{
[cm removeClassNamed: className];
}
// Add the class to the class manager.
[cm addClassNamed: className
withSuperClassNamed: superClassName
withActions: actions
withOutlets: outlets];
}
- (void) deleteClass: (NSString *) className
{
GormDocument *doc = (GormDocument *)[self activeDocument];
GormClassManager *cm = [doc classManager];
[cm removeClassNamed: className];
}
/*
NSApp
GormAppDelegate
*/
- (id) init
{
self = [super init];
if (self != nil)
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
@ -156,15 +134,6 @@
}
}
/*
* load the interface...
*/
if(![NSBundle loadNibNamed: @"Gorm" owner: self])
{
NSLog(@"Failed to load interface");
exit(-1);
}
/*
* Make sure the palettes/plugins managers exist, so that the
* editors and inspectors provided in the standard palettes
@ -173,11 +142,6 @@
[self palettesManager];
[self pluginManager];
/*
* set the delegate.
*/
[self setDelegate: self];
/*
* Start the server
*/
@ -187,10 +151,10 @@
NSLog(@"Could not register GormServer");
}
}
return self;
}
- (void) dealloc
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
@ -202,11 +166,11 @@
[super dealloc];
}
- (void) stop: (id)sender
- (IBAction) stop: (id)sender
{
if(isTesting == NO)
{
[super stop: sender];
// [super stop: sender];
}
else
{
@ -225,14 +189,15 @@
return NO;
}
- (void) applicationOpenUntitledFile: (id)sender
- (void) applicationOpenUntitledFile: (NSApplication *)sender
{
GormDocumentController *dc = [NSDocumentController sharedDocumentController];
// open a new document and build an application type document by default...
[dc newDocument: sender];
}
- (void) applicationDidFinishLaunching: (NSApplication*)sender
- (void) applicationDidFinishLaunching: (NSNotification *)n
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@ -246,7 +211,7 @@
}
}
- (void) applicationWillTerminate: (NSApplication*)sender
- (void) applicationWillTerminate: (NSNotification *)n
{
[[NSUserDefaults standardUserDefaults]
setBool: [[[self inspectorsManager] panel] isVisible]
@ -256,7 +221,7 @@
forKey: @"ShowPalettes"];
}
- (BOOL) applicationShouldTerminateAfterLastWindowClosed: (id)sender
- (BOOL) applicationShouldTerminateAfterLastWindowClosed: (NSApplication *)sender
{
if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) ==
NSWindows95InterfaceStyle)
@ -273,10 +238,16 @@
return YES;
}
}
else
{
return NO;
}
return NO;
}
// Gorm specific methods...
- (id<IBDocuments>) activeDocument
{
return [[NSDocumentController sharedDocumentController] currentDocument];
}
- (GormClassManager*) classManager
@ -430,7 +401,7 @@
}
/** Info Menu Actions */
- (void) preferencesPanel: (id) sender
- (IBAction) preferencesPanel: (id) sender
{
if(! preferencesController)
{
@ -441,7 +412,7 @@
}
/** Document Menu Actions */
- (void) close: (id)sender
- (IBAction) close: (id)sender
{
GormDocument *document = (GormDocument *)[self activeDocument];
if([document canCloseDocument])
@ -450,30 +421,22 @@
}
}
- (void) debug: (id) sender
- (IBAction) debug: (id) sender
{
[[self activeDocument] performSelector: @selector(printAllEditors)];
}
- (void) loadSound: (id) sender
- (IBAction) loadSound: (id) sender
{
[(GormDocument *)[self activeDocument] openSound: sender];
}
- (void) loadImage: (id) sender
- (IBAction) loadImage: (id) sender
{
[(GormDocument *)[self activeDocument] openImage: sender];
}
- (void) arrangeInFront: (id)sender
{
if([self isTestingInterface] == NO)
{
[super arrangeInFront: sender];
}
}
- (void) testInterface: (id)sender
- (IBAction) testInterface: (id)sender
{
if (isTesting == YES)
{
@ -497,7 +460,7 @@
// which windows were open when testing started...
testingWindows = [[NSMutableArray alloc] init];
en = [[self windows] objectEnumerator];
en = [[NSApp windows] objectEnumerator];
while((obj = [en nextObject]) != nil)
{
if([obj isVisible])
@ -508,7 +471,7 @@
// set here, so that beginArchiving and endArchiving do not use templates.
isTesting = YES;
[self setApplicationIconImage: testingImage];
[NSApp setApplicationIconImage: testingImage];
archiver = [[NSArchiver alloc] init];
[activeDoc deactivateEditors];
[archiver encodeClassName: @"GormCustomView"
@ -551,7 +514,7 @@
defaults = [NSUserDefaults standardUserDefaults];
menuLocations = [[defaults objectForKey: @"NSMenuLocations"] copy];
[defaults removeObjectForKey: @"NSMenuLocations"];
servicesMenu = [self servicesMenu];
servicesMenu = [NSApp servicesMenu];
testContainer = [NSUnarchiver unarchiveObjectWithData: data];
if (testContainer != nil)
@ -559,7 +522,7 @@
NSMutableDictionary *nameTable = [testContainer nameTable];
NSMenu *aMenu = [nameTable objectForKey: @"NSMenu"];
[self setMainMenu: aMenu];
[NSApp setMainMenu: aMenu];
// initialize the context.
RETAIN(testContainer);
topObjects = [testContainer topLevelObjects];
@ -581,11 +544,11 @@
[testMenu addItemWithTitle: _(@"Quit Test")
action: @selector(deferredEndTesting:)
keyEquivalent: @"q"];
[self setMainMenu: testMenu]; // released, when the menu is reset in endTesting.
[NSApp setMainMenu: testMenu]; // released, when the menu is reset in endTesting.
}
else
{
NSMenu *testMenu = [self mainMenu];
NSMenu *testMenu = [NSApp mainMenu];
NSString *newTitle = [[testMenu title] stringByAppendingString: @" (Gorm)"];
NSArray *items = findAll(testMenu);
NSEnumerator *en = [items objectEnumerator];
@ -621,9 +584,9 @@
}
// so we don't get the warning...
[self setServicesMenu: nil];
[[self mainMenu] display];
en = [[self windows] objectEnumerator];
[NSApp setServicesMenu: nil];
[[NSApp mainMenu] display];
en = [[NSApp windows] objectEnumerator];
while((obj = [en nextObject]) != nil)
{
if([obj isVisible])
@ -660,7 +623,7 @@
/** Edit Menu Actions */
- (void) copy: (id)sender
- (IBAction) copy: (id)sender
{
if ([[selectionOwner selection] count] == 0
|| [selectionOwner respondsToSelector: @selector(copySelection)] == NO)
@ -675,7 +638,7 @@
}
- (void) cut: (id)sender
- (IBAction) cut: (id)sender
{
if ([[selectionOwner selection] count] == 0
|| [selectionOwner respondsToSelector: @selector(copySelection)] == NO
@ -691,7 +654,7 @@
[(id<IBSelectionOwners,IBEditors>)selectionOwner deleteSelection];
}
- (void) paste: (id)sender
- (IBAction) paste: (id)sender
{
if ([selectionOwner respondsToSelector: @selector(pasteInSelection)] == NO)
return;
@ -705,7 +668,7 @@
}
- (void) delete: (id)sender
- (IBAction) delete: (id)sender
{
if ([[selectionOwner selection] count] == 0
|| [selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
@ -719,7 +682,7 @@
[(id<IBSelectionOwners,IBEditors>)selectionOwner deleteSelection];
}
- (void) selectAll: (id)sender
- (IBAction) selectAll: (id)sender
{
if ([[selectionOwner selection] count] == 0
|| [selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
@ -734,13 +697,13 @@
}
/*
- (void) selectAllItems: (id)sender
- (IBAction) selectAllItems: (id)sender
{
return;
}
*/
- (void) setName: (id)sender
- (IBAction) setName: (id)sender
{
GormSetNameController *panel;
int returnPanel;
@ -767,7 +730,7 @@
}
}
- (void) guideline: (id) sender
- (IBAction) guideline: (id) sender
{
[[NSNotificationCenter defaultCenter] postNotificationName: GormToggleGuidelineNotification
object:nil];
@ -784,7 +747,7 @@
}
- (void) orderFrontFontPanel: (id) sender
- (IBAction) orderFrontFontPanel: (id) sender
{
NSFontPanel *fontPanel = [NSFontPanel sharedFontPanel];
GormFontViewController *gfvc =
@ -795,7 +758,7 @@
/** Grouping */
- (void) groupSelectionInSplitView: (id)sender
- (IBAction) groupSelectionInSplitView: (id)sender
{
if ([[selectionOwner selection] count] < 2
|| [selectionOwner respondsToSelector: @selector(groupSelectionInSplitView)] == NO)
@ -804,35 +767,35 @@
[(GormGenericEditor *)selectionOwner groupSelectionInSplitView];
}
- (void) groupSelectionInBox: (id)sender
- (IBAction) groupSelectionInBox: (id)sender
{
if ([selectionOwner respondsToSelector: @selector(groupSelectionInBox)] == NO)
return;
[(GormGenericEditor *)selectionOwner groupSelectionInBox];
}
- (void) groupSelectionInView: (id)sender
- (IBAction) groupSelectionInView: (id)sender
{
if ([selectionOwner respondsToSelector: @selector(groupSelectionInView)] == NO)
return;
[(GormGenericEditor *)selectionOwner groupSelectionInView];
}
- (void) groupSelectionInScrollView: (id)sender
- (IBAction) groupSelectionInScrollView: (id)sender
{
if ([selectionOwner respondsToSelector: @selector(groupSelectionInScrollView)] == NO)
return;
[(GormGenericEditor *)selectionOwner groupSelectionInScrollView];
}
- (void) groupSelectionInMatrix: (id)sender
- (IBAction) groupSelectionInMatrix: (id)sender
{
if ([selectionOwner respondsToSelector: @selector(groupSelectionInMatrix)] == NO)
return;
[(GormGenericEditor *)selectionOwner groupSelectionInMatrix];
}
- (void) ungroup: (id)sender
- (IBAction) ungroup: (id)sender
{
// NSLog(@"ungroup: selectionOwner %@", selectionOwner);
if ([selectionOwner respondsToSelector: @selector(ungroup)] == NO)
@ -842,58 +805,58 @@
/** Classes actions */
- (void) createSubclass: (id)sender
- (IBAction) createSubclass: (id)sender
{
[(GormDocument *)[self activeDocument] createSubclass: sender];
}
- (void) loadClass: (id)sender
- (IBAction) loadClass: (id)sender
{
// Call the current document and create the class
// descibed by the header
[(GormDocument *)[self activeDocument] loadClass: sender];
}
- (void) createClassFiles: (id)sender
- (IBAction) createClassFiles: (id)sender
{
[(GormDocument *)[self activeDocument] createClassFiles: sender];
}
- (void) instantiateClass: (id)sender
- (IBAction) instantiateClass: (id)sender
{
[(GormDocument *)[self activeDocument] instantiateClass: sender];
}
- (void) addAttributeToClass: (id)sender
- (IBAction) addAttributeToClass: (id)sender
{
[(GormDocument *)[self activeDocument] addAttributeToClass: sender];
}
- (void) remove: (id)sender
- (IBAction) remove: (id)sender
{
[(GormDocument *)[self activeDocument] remove: sender];
}
/** Palettes Actions... */
- (void) inspector: (id) sender
- (IBAction) inspector: (id) sender
{
[[[self inspectorsManager] panel] makeKeyAndOrderFront: self];
}
- (void) palettes: (id) sender
- (IBAction) palettes: (id) sender
{
[[[self palettesManager] panel] makeKeyAndOrderFront: self];
}
- (void) loadPalette: (id) sender
- (IBAction) loadPalette: (id) sender
{
[[self palettesManager] openPalette: sender];
}
/** Testing methods... */
- (void) deferredEndTesting: (id) sender
- (IBAction) deferredEndTesting: (id) sender
{
[[NSRunLoop currentRunLoop]
performSelector: @selector(endTesting:)
@ -906,13 +869,9 @@
NSEventTrackingRunLoopMode, nil]];
}
- (id) endTesting: (id)sender
- (IBAction) endTesting: (id)sender
{
if (isTesting == NO)
{
return nil;
}
else
if (isTesting)
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSUserDefaults *defaults;
@ -938,7 +897,7 @@
* Make sure any peripheral windows: font panels, etc. which are brought
* up by the interface being tested are also closed.
*/
e = [[self windows] objectEnumerator];
e = [[NSApp windows] objectEnumerator];
while ((val = [e nextObject]) != nil)
{
if ([testingWindows containsObject: val] == NO &&
@ -957,12 +916,12 @@
DESTROY(menuLocations);
}
[self setMainMenu: mainMenu];
[self setApplicationIconImage: gormImage];
[NSApp setMainMenu: mainMenu];
[NSApp setApplicationIconImage: gormImage];
NS_DURING
{
[self setServicesMenu: servicesMenu];
[NSApp setServicesMenu: servicesMenu];
}
NS_HANDLER
{
@ -985,11 +944,11 @@
// deallocate
RELEASE(testContainer);
return self;
}
}
// end of menu actions...
- (void) handleNotification: (NSNotification*)notification
{
NSString *name = [notification name];
@ -1376,49 +1335,13 @@
return classMenu;
}
- (void) print: (id) sender
- (IBAction) print: (id) sender
{
[[self keyWindow] print: sender];
[[NSApp keyWindow] print: sender];
}
- (void) selectAllItems: (id)sender
- (IBAction) selectAllItems: (id)sender
{
}
@end
@implementation Gorm (GormServer)
// Methods to support external apps adding and deleting
// classes from the current document...
- (void) addClass: (NSDictionary *) dict
{
GormDocument *doc = (GormDocument *)[self activeDocument];
GormClassManager *cm = [doc classManager];
NSArray *outlets = [dict objectForKey: @"outlets"];
NSArray *actions = [dict objectForKey: @"actions"];
NSString *className = [dict objectForKey: @"className"];
NSString *superClassName = [dict objectForKey: @"superClassName"];
// If the class is known, delete it before proceeding.
if([cm isKnownClass: className])
{
[cm removeClassNamed: className];
}
// Add the class to the class manager.
[cm addClassNamed: className
withSuperClassNamed: superClassName
withActions: actions
withOutlets: outlets];
}
- (void) deleteClass: (NSString *) className
{
GormDocument *doc = (GormDocument *)[self activeDocument];
GormClassManager *cm = [doc classManager];
[cm removeClassNamed: className];
}
@end

View file

@ -1,7 +1,9 @@
{
NSIcon = "Gorm.tiff";
NSMainNibFile = "Gorm.gorm";
NSPrincipalClass = "NSApplication";
NSRole = "Editor";
NSTypes = (
{
NSName = "GSGormFileType";
@ -48,10 +50,11 @@
NSIcon = "GormPalette.tiff";
}
);
ApplicationDescription = "[GNUstep | Graphical] Object Relationship Modeller";
ApplicationIcon = "Gorm.tiff";
ApplicationName = "Gorm";
ApplicationRelease = "Gorm 1.3.1 (Release)";
ApplicationRelease = "Gorm 1.4.0 (Unrelease)";
Authors = ("Gregory John Casamento <greg.casamento@gmail.com>",
"Adam Fedor <fedor@gnu.org>",
"Richard Frith-Macdonald <rfm@gnu.org>",
@ -60,6 +63,6 @@
"Sergii Stoian <stoyan255@gmail.com>");
Copyright = "Copyright (C) 1999-2022 FSF";
CopyrightDescription = "Released under the GNU General Public License 3.0";
NSBuildVersion = "1.3.1 Jan 15 2022";
NSBuildVersion = "1.4.0 (Unreleased)";
GSDesktopInstallationDomain=SYSTEM;
}

View file

@ -79,7 +79,7 @@
}
else if ( sender == menuType )
{
GormDocument *doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
GormDocument *doc = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
int tag = [[menuType selectedCell] tag];
switch ( tag )
@ -129,7 +129,7 @@
if ( object == nil )
return;
doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
doc = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
[titleText setStringValue: [object title]];
[autoenable setState: ([object realAutoenablesItems]?NSOnState:NSOffState)];
@ -157,7 +157,7 @@
/* delegate method used for menu title */
- (void)controlTextDidChange:(NSNotification *)aNotification
{
GormDocument *doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
GormDocument *doc = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
[object setTitle: [titleText stringValue]];
[doc touch];
}

View file

@ -202,11 +202,11 @@
[NSArray arrayWithObject: GormLinkPboardType]
owner: self];
[pb setString: name forType: GormLinkPboardType];
[NSApp displayConnectionBetween: item and: nil];
[NSApp startConnecting];
[[NSApp delegate] displayConnectionBetween: item and: nil];
[[NSApp delegate] startConnecting];
isLinkSource = YES;
[self dragImage: [NSApp linkImage]
[self dragImage: [[NSApp delegate] linkImage]
at: dragPoint
offset: NSZeroSize
event: theEvent
@ -249,7 +249,7 @@
* in order to avoid excessive amounts of drawing.
*/
[NSEvent startPeriodicEventsAfterDelay: 0.1 withPeriod: 0.05];
e = [NSApp nextEventMatchingMask: eventMask
e = [[NSApp delegate] nextEventMatchingMask: eventMask
untilDate: future
inMode: NSEventTrackingRunLoopMode
dequeue: YES];
@ -299,7 +299,7 @@
[[self window] flushWindow];
}
}
e = [NSApp nextEventMatchingMask: eventMask
e = [[NSApp delegate] nextEventMatchingMask: eventMask
untilDate: future
inMode: NSEventTrackingRunLoopMode
dequeue: YES];
@ -415,7 +415,7 @@
isClosed = YES;
[[NSNotificationCenter defaultCenter] removeObserver: self];
if ([(id<IB>)NSApp selectionOwner] == self)
if ([(id<IB>)[NSApp delegate] selectionOwner] == self)
{
[document resignSelectionForEditor: self];
}
@ -570,11 +570,11 @@
{
item = [edited itemAtIndex: pos];
}
if (item == [NSApp connectSource])
if (item == [[NSApp delegate] connectSource])
{
item = nil;
}
[NSApp displayConnectionBetween: [NSApp connectSource] and: item];
[[NSApp delegate] displayConnectionBetween: [[NSApp delegate] connectSource] and: item];
return NSDragOperationLink;
}
else
@ -587,7 +587,7 @@
{
if (dragType == GormLinkPboardType)
{
[NSApp displayConnectionBetween: [NSApp connectSource]
[[NSApp delegate] displayConnectionBetween: [[NSApp delegate] connectSource]
and: nil];
}
}
@ -833,8 +833,8 @@ void _attachAll(NSMenu *menu, id document)
{
id item = [edited itemAtIndex: pos];
[NSApp displayConnectionBetween: [NSApp connectSource] and: item];
[NSApp startConnecting];
[[NSApp delegate] displayConnectionBetween: [[NSApp delegate] connectSource] and: item];
[[NSApp delegate] startConnecting];
}
}
else
@ -1057,7 +1057,7 @@ static BOOL done_editing;
while (!done_editing)
{
NSEventType eType;
e = [NSApp nextEventMatchingMask: eventMask
e = [[NSApp delegate] nextEventMatchingMask: eventMask
untilDate: future
inMode: NSEventTrackingRunLoopMode
dequeue: YES];

View file

@ -62,7 +62,7 @@
- (void) setObject: (id)anObject
{
GormDocument *doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
GormDocument *doc = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
ASSIGN(object, nil); // remove reference to old object...
[super setObject: anObject];
@ -87,7 +87,7 @@
- (void) updateMenuType: (id)sender
{
BOOL flag;
GormDocument *doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
GormDocument *doc = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
// look at the values passed back in the matrix.
flag = ([[menuType cellAtRow: 0 column: 0] state] == NSOnState) ? YES : NO; // windows menu...
@ -155,7 +155,7 @@
- (void)controlTextDidChange:(NSNotification *)aNotification
{
id o = [aNotification object];
id<IBDocuments> doc = [(id<IB>)NSApp activeDocument];
id<IBDocuments> doc = [(id<IB>)[NSApp delegate] activeDocument];
if (o == titleText)
{

View file

@ -121,14 +121,14 @@
/* visible at launch time */
else if ( sender == visibleButton )
{
GormDocument *doc = (GormDocument*)[(id<IB>)NSApp activeDocument];
GormDocument *doc = (GormDocument*)[(id<IB>)[NSApp delegate] activeDocument];
[doc setObject: object isVisibleAtLaunch: [visibleButton state]];
}
/* deferred */
else if ( sender == deferredButton )
{
GormDocument *doc = (GormDocument*)[(id<IB>)NSApp activeDocument];
GormDocument *doc = (GormDocument*)[(id<IB>)[NSApp delegate] activeDocument];
[doc setObject: object isDeferred: [deferredButton state]];
}
@ -176,7 +176,7 @@
if ( object == nil )
return;
doc = (GormDocument*)[(id<IB>)NSApp activeDocument];
doc = (GormDocument*)[(id<IB>)[NSApp delegate] activeDocument];
/* Title */
[[titleForm cellAtIndex: 0] setStringValue: [object title] ];

View file

@ -295,7 +295,7 @@ static NSRect oldFrame;
{
[_EO setTitle: [[aNotification object] string]];
[_EO setNeedsDisplay: NO];
[[(id<Gorm>)NSApp inspectorsManager] updateSelection];
[[(id<GormAppDelegate>)[NSApp delegate] inspectorsManager] updateSelection];
}
- (void) textDidEndEditing: (NSNotification *)aNotification
@ -359,7 +359,7 @@ static NSRect oldFrame;
while (!done_editing)
{
NSEventType eType;
e = [NSApp nextEventMatchingMask: eventMask
e = [[NSApp delegate] nextEventMatchingMask: eventMask
untilDate: future
inMode: NSEventTrackingRunLoopMode
dequeue: YES];

View file

@ -73,7 +73,7 @@
- (void) ok: (id)sender
{
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
id<IBDocuments> document = [(id<IB>)[NSApp delegate] activeDocument];
id parent = [document parentOfObject: object];
if ([parent respondsToSelector: @selector(cellSize)])
@ -108,7 +108,7 @@
{
if (anObject != nil && anObject != object)
{
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
id<IBDocuments> document = [(id<IB>)[NSApp delegate] activeDocument];
id parent = [document parentOfObject: anObject];
ASSIGN(object, anObject);

View file

@ -56,7 +56,7 @@ NSUInteger colsStepperValue;
- (void) _displayObject: (id)obj resize: (BOOL)resize
{
id document = [(id<IB>)NSApp documentForObject: obj];
id document = [(id<IB>)[NSApp delegate] documentForObject: obj];
id editor = [document editorForObject: obj create: NO];
NSRect eoFrame = [editor frame];
@ -103,7 +103,7 @@ NSUInteger colsStepperValue;
- (void) _refreshCellsComparingWithOldCells: (NSArray *)oldCells
{
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
id<IBDocuments> document = [(id<IB>)[NSApp delegate] activeDocument];
NSArray *newCells = [[self object] cells];
NSUInteger newCount = [newCells count];
NSUInteger oldCount = [oldCells count];

View file

@ -121,7 +121,7 @@
{
int i;
NSTabViewItem *newTabItem;
id document = [(id<IB>)NSApp documentForObject: object];
id document = [(id<IB>)[NSApp delegate] documentForObject: object];
for (i=([object numberOfTabViewItems]+1);i<=newNumber;i++)
{
@ -139,7 +139,7 @@
for (i=([object numberOfTabViewItems]-1);i>=newNumber;i--)
{
id item = [object tabViewItemAtIndex:i];
id document = [(id<IB>)NSApp documentForObject: item];
id document = [(id<IB>)[NSApp delegate] documentForObject: item];
[object selectFirstTabViewItem: self];
[object removeTabViewItem: item];

View file

@ -71,7 +71,7 @@
- (NSString *)_getCellClassName
{
id cell = [[self object] dataCell];
NSString *customClassName = [[(id<Gorm>)NSApp classManager] customClassForObject: cell];
NSString *customClassName = [[(id<GormAppDelegate>)[NSApp delegate] classManager] customClassForObject: cell];
NSString *result = nil;
if(customClassName == nil)
@ -150,8 +150,8 @@
/* set Button */
else if (sender == setButton || sender == cellTable)
{
id classManager = [(id<Gorm>)NSApp classManager];
id<IBDocuments> doc = [(id<IB>)NSApp activeDocument];
id classManager = [(id<GormAppDelegate>)[NSApp delegate] classManager];
id<IBDocuments> doc = [(id<IB>)[NSApp delegate] activeDocument];
id cell = nil;
int i = [cellTable selectedRow];
NSArray *list = [classManager allSubclassesOf: @"NSCell"];
@ -231,7 +231,7 @@
if ( object == nil )
return;
list = [[(id<Gorm>)NSApp classManager] allSubclassesOf: @"NSCell"];
list = [[(id<GormAppDelegate>)[NSApp delegate] classManager] allSubclassesOf: @"NSCell"];
cellClassName = [self _getCellClassName];
index = [list indexOfObject: cellClassName];
@ -310,7 +310,7 @@
// replace by an NSBrowser ?
- (NSInteger) numberOfRowsInTableView: (NSTableView *)tv
{
NSArray *list = [[(id<Gorm>)NSApp classManager] allSubclassesOf: @"NSCell"];
NSArray *list = [[(id<GormAppDelegate>)[NSApp delegate] classManager] allSubclassesOf: @"NSCell"];
return [list count];
}
@ -318,7 +318,7 @@
objectValueForTableColumn: (NSTableColumn *)tc
row: (NSInteger)rowIndex
{
NSArray *list = [[(id<Gorm>)NSApp classManager] allSubclassesOf: @"NSCell"];
NSArray *list = [[(id<GormAppDelegate>)[NSApp delegate] classManager] allSubclassesOf: @"NSCell"];
id value = nil;
if([list count] > 0)
{

View file

@ -310,10 +310,10 @@ static NSText *_textObject;
[NSArray arrayWithObject: GormLinkPboardType]
owner: self];
[pb setString: name forType: GormLinkPboardType];
[NSApp displayConnectionBetween: col and: nil];
[NSApp startConnecting];
[[NSApp delegate] displayConnectionBetween: col and: nil];
[[NSApp delegate] startConnecting];
[self dragImage: [NSApp linkImage]
[self dragImage: [[NSApp delegate] linkImage]
at: dragPoint
offset: NSZeroSize
event: theEvent
@ -465,7 +465,7 @@ static NSText *_textObject;
}
}
[NSApp displayConnectionBetween: [NSApp connectSource]
[[NSApp delegate] displayConnectionBetween: [[NSApp delegate] connectSource]
and: destination];
return NSDragOperationLink;
}

View file

@ -370,7 +370,7 @@ int defaultDateFormatIndex = 3;
if([obj respondsToSelector: @selector(setFormatter:)])
{
// Touch the document...
[[(id<IB>)NSApp activeDocument] touch];
[[(id<IB>)[NSApp delegate] activeDocument] touch];
[obj setFormatter: formatter];
RETAIN(formatter);

View file

@ -59,12 +59,12 @@ extern NSArray *predefinedDateFormats;
NSDateFormatter *fmtr;
// Set the document as modifed...
[[(id<IB>)NSApp activeDocument] touch];
[[(id<IB>)[NSApp delegate] activeDocument] touch];
if (sender == detachButton)
{
[[object cell] setFormatter: nil];
[[(id<IB>)NSApp activeDocument] setSelectionFromEditor: nil];
[[(id<IB>)[NSApp delegate] activeDocument] setSelectionFromEditor: nil];
}
else
{

View file

@ -79,12 +79,12 @@ extern NSArray *predefinedNumberFormats;
NSNumberFormatter *fmtr = [cell formatter];
// Mark as changed...
[[(id<IB>)NSApp activeDocument] touch];
[[(id<IB>)[NSApp delegate] activeDocument] touch];
if (sender == detachButton)
{
[cell setFormatter: nil];
[[(id<IB>)NSApp activeDocument] setSelectionFromEditor: nil];
[[(id<IB>)[NSApp delegate] activeDocument] setSelectionFromEditor: nil];
}
else
{

View file

@ -116,7 +116,7 @@
if (destination == nil)
destination = _editedObject;
[NSApp displayConnectionBetween: [NSApp connectSource]
[[NSApp delegate] displayConnectionBetween: [[NSApp delegate] connectSource]
and: destination];
return NSDragOperationLink;
}

View file

@ -121,7 +121,7 @@ NSImage *browserImage = nil;
[outlineView setIndentationPerLevel: 10];
[outlineView setAttributeOffset: 30];
[outlineView setRowHeight: 18];
[outlineView setMenu: [(id<Gorm>)NSApp classMenu]];
[outlineView setMenu: [(id<GormAppDelegate>)[NSApp delegate] classMenu]];
[outlineView setBackgroundColor: color];
// add the table columns...

View file

@ -18,7 +18,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@ -84,7 +84,7 @@ NSNotificationCenter *nc = nil;
@implementation GormOutletDataSource
- (NSInteger) numberOfRowsInTableView: (NSTableView *)tv
{
NSArray *list = [[(id<Gorm>)NSApp classManager] allOutletsForClassNamed: [inspector _currentClass]];
NSArray *list = [[(id<GormAppDelegate>)[NSApp delegate] classManager] allOutletsForClassNamed: [inspector _currentClass]];
return [list count];
}
@ -92,7 +92,7 @@ NSNotificationCenter *nc = nil;
objectValueForTableColumn: (NSTableColumn *)tc
row: (NSInteger)rowIndex
{
NSArray *list = [[(id<Gorm>)NSApp classManager] allOutletsForClassNamed: [inspector _currentClass]];
NSArray *list = [[(id<GormAppDelegate>)[NSApp delegate] classManager] allOutletsForClassNamed: [inspector _currentClass]];
id value = nil;
if([list count] > 0)
{
@ -106,12 +106,12 @@ objectValueForTableColumn: (NSTableColumn *)tc
forTableColumn: (NSTableColumn *)tc
row: (NSInteger)rowIndex
{
id classManager = [(id<Gorm>)NSApp classManager];
id classManager = [(id<GormAppDelegate>)[NSApp delegate] classManager];
NSString *currentClass = [inspector _currentClass];
NSArray *list = [classManager allOutletsForClassNamed: currentClass];
NSString *name = [list objectAtIndex: rowIndex];
NSString *formattedOutlet = formatOutlet( (NSString *)anObject );
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
GormDocument *document = (GormDocument *)[(id <IB>)[NSApp delegate] activeDocument];
if(![name isEqual: formattedOutlet])
{
@ -144,7 +144,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
@implementation GormActionDataSource
- (NSInteger) numberOfRowsInTableView: (NSTableView *)tv
{
NSArray *list = [[(id<Gorm>)NSApp classManager] allActionsForClassNamed: [inspector _currentClass]];
NSArray *list = [[(id<GormAppDelegate>)[NSApp delegate] classManager] allActionsForClassNamed: [inspector _currentClass]];
return [list count];
}
@ -152,7 +152,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
objectValueForTableColumn: (NSTableColumn *)tc
row: (NSInteger)rowIndex
{
NSArray *list = [[(id<Gorm>)NSApp classManager] allActionsForClassNamed: [inspector _currentClass]];
NSArray *list = [[(id<GormAppDelegate>)[NSApp delegate] classManager] allActionsForClassNamed: [inspector _currentClass]];
return [list objectAtIndex: rowIndex];
}
@ -161,12 +161,12 @@ objectValueForTableColumn: (NSTableColumn *)tc
forTableColumn: (NSTableColumn *)tc
row: (NSInteger)rowIndex
{
id classManager = [(id<Gorm>)NSApp classManager];
id classManager = [(id<GormAppDelegate>)[NSApp delegate] classManager];
NSString *currentClass = [inspector _currentClass];
NSArray *list = [classManager allActionsForClassNamed: currentClass];
NSString *name = [list objectAtIndex: rowIndex];
NSString *formattedAction = formatAction( (NSString *)anObject );
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
GormDocument *document = (GormDocument *)[(id <IB>)[NSApp delegate] activeDocument];
if(![name isEqual: formattedAction])
{
@ -199,7 +199,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
@implementation GormClassesDataSource
- (NSInteger) numberOfRowsInTableView: (NSTableView *)tv
{
NSArray *list = [[(id<Gorm>)NSApp classManager] allClassNames];
NSArray *list = [[(id<GormAppDelegate>)[NSApp delegate] classManager] allClassNames];
return [list count];
}
@ -207,7 +207,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
objectValueForTableColumn: (NSTableColumn *)tc
row: (NSInteger)rowIndex
{
NSArray *list = [[(id<Gorm>)NSApp classManager] allClassNames];
NSArray *list = [[(id<GormAppDelegate>)[NSApp delegate] classManager] allClassNames];
id value = nil;
if([list count] > 0)
{
@ -353,7 +353,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
{
NS_DURING
{
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
GormDocument *document = (GormDocument *)[(id <IB>)[NSApp delegate] activeDocument];
if(document != nil)
{
NSString *className = [self _currentClass];
@ -383,7 +383,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
{
NS_DURING
{
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
GormDocument *document = (GormDocument *)[(id <IB>)[NSApp delegate] activeDocument];
if(document != nil)
{
NSString *className = [self _currentClass];
@ -419,7 +419,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
BOOL removed = NO;
BOOL isCustom = [classManager isCustomClass: className];
NSString *name = nil;
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
GormDocument *document = (GormDocument *)[(id <IB>)[NSApp delegate] activeDocument];
if(document != nil)
{
@ -469,7 +469,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
NSArray *list = [classManager allOutletsForClassNamed: className];
BOOL removed = NO;
NSString *name = nil;
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
GormDocument *document = (GormDocument *)[(id <IB>)[NSApp delegate] activeDocument];
if(document != nil)
{
@ -536,7 +536,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
{
NSString *newParent = [list objectAtIndex: row];
NSString *name = [self _currentClass];
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
GormDocument *document = (GormDocument *)[(id <IB>)[NSApp delegate] activeDocument];
// if it's a custom class, let it go, if not do nothing.
if(document != nil)
@ -592,7 +592,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
{
NSString *name = [self _currentClass];
NSString *newName = [sender stringValue];
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
GormDocument *document = (GormDocument *)[(id <IB>)[NSApp delegate] activeDocument];
BOOL flag = NO;
// check to see if the user wants to do this and rename the connections.
@ -656,7 +656,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
if([anObject isKindOfClass: [GormClassProxy class]])
{
[super setObject: anObject];
ASSIGN(classManager, [(id<Gorm>)NSApp classManager]);
ASSIGN(classManager, [(id<GormAppDelegate>)[NSApp delegate] classManager]);
ASSIGN(currentClass, [object className]);
outletsCount = [[classManager allOutletsForClassNamed: currentClass] count];
@ -684,7 +684,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
- (void) handleNotification: (NSNotification *)notification
{
if([notification object] == classManager &&
[(id<IB>)NSApp activeDocument] != nil)
[(id<IB>)[[NSApp delegate] delegate] activeDocument] != nil)
{
[self _refreshView];
}

View file

@ -106,7 +106,7 @@
}
else
{
GormPalettesManager *palettesManager = [(id<Gorm>)NSApp palettesManager];
GormPalettesManager *palettesManager = [(id<GormAppDelegate>)[NSApp delegate] palettesManager];
NSDictionary *importedClasses = [palettesManager importedClasses];
NSEnumerator *en = [importedClasses objectEnumerator];
NSDictionary *description = nil;

View file

@ -214,7 +214,7 @@
if ([con isKindOfClass: [NSNibControlConnector class]] == YES)
{
RELEASE(actions);
actions = RETAIN([[(id<Gorm>)NSApp classManager]
actions = RETAIN([[(id<GormAppDelegate>)[NSApp delegate] classManager]
allActionsForObject: [con destination]]);
break;
}
@ -227,13 +227,13 @@
if (con == nil) // && [actions containsObject: [currentConnector label]] == NO)
{
RELEASE(actions);
actions = RETAIN([[(id<Gorm>)NSApp classManager]
allActionsForObject: [NSApp connectDestination]]);
actions = RETAIN([[(id<GormAppDelegate>)[NSApp delegate] classManager]
allActionsForObject: [[NSApp delegate] connectDestination]]);
if ([actions count] > 0)
{
con = [[NSNibControlConnector alloc] init];
[con setSource: object];
[con setDestination: [NSApp connectDestination]];
[con setDestination: [[NSApp delegate] connectDestination]];
[con setLabel: [actions objectAtIndex: 0]];
AUTORELEASE(con);
}
@ -277,7 +277,7 @@
RELEASE(currentConnector);
currentConnector = [[NSNibOutletConnector alloc] init];
[currentConnector setSource: object];
[currentConnector setDestination: [NSApp connectDestination]];
[currentConnector setDestination: [[NSApp delegate] connectDestination]];
[currentConnector setLabel: title];
}
}
@ -286,7 +286,7 @@
*/
[oldBrowser loadColumnZero];
[oldBrowser selectRow: index inColumn: 0];
[NSApp displayConnectionBetween: object
[[NSApp delegate] displayConnectionBetween: object
and: [currentConnector destination]];
}
else
@ -314,7 +314,7 @@
RELEASE(currentConnector);
currentConnector = [[NSNibControlConnector alloc] init];
[currentConnector setSource: object];
[currentConnector setDestination: [NSApp connectDestination]];
[currentConnector setDestination: [[NSApp delegate] connectDestination]];
[currentConnector setLabel: title];
[oldBrowser loadColumnZero];
}
@ -331,10 +331,10 @@
if ([title hasPrefix: label] == YES)
{
NSString *name;
id dest = [NSApp connectDestination];
id dest = [[NSApp delegate] connectDestination];
dest = [con destination];
name = [[(id<IB>)NSApp activeDocument] nameForObject: dest];
name = [[(id<IB>)[NSApp delegate] activeDocument] nameForObject: dest];
name = [label stringByAppendingFormat: @" (%@)", name];
if ([title isEqual: name] == YES)
{
@ -350,7 +350,7 @@
path = [@"/target" stringByAppendingString: path];
}
[newBrowser setPath: path];
[NSApp displayConnectionBetween: object
[[NSApp delegate] displayConnectionBetween: object
and: [con destination]];
break;
}
@ -456,11 +456,11 @@ selectCellWithString: (NSString*)title
{
NSString *label;
NSString *name;
id dest = [NSApp connectDestination];
id dest = [[NSApp delegate] connectDestination];
label = [[connectors objectAtIndex: row] label];
dest = [[connectors objectAtIndex: row] destination];
name = [[(id<IB>)NSApp activeDocument] nameForObject: dest];
name = [[(id<IB>)[NSApp delegate] activeDocument] nameForObject: dest];
name = [label stringByAppendingFormat: @" (%@)", name];
[aCell setStringValue: name];
@ -507,7 +507,7 @@ selectCellWithString: (NSString*)title
{
id con = currentConnector;
[[(id<IB>)NSApp activeDocument] removeConnector: con];
[[(id<IB>)[NSApp delegate] activeDocument] removeConnector: con];
[connectors removeObject: con];
[oldBrowser loadColumnZero];
}
@ -529,7 +529,7 @@ selectCellWithString: (NSString*)title
{
if ([con isKindOfClass: [NSNibControlConnector class]])
{
[[(id<IB>)NSApp activeDocument] removeConnector: con];
[[(id<IB>)[NSApp delegate] activeDocument] removeConnector: con];
[connectors removeObjectIdenticalTo: con];
break;
}
@ -539,14 +539,14 @@ selectCellWithString: (NSString*)title
[self _selectAction: [currentConnector label]];
}
[connectors addObject: currentConnector];
[[(id<IB>)NSApp activeDocument] addConnector: currentConnector];
[[(id<IB>)[NSApp delegate] activeDocument] addConnector: currentConnector];
/*
* When we establish a connection, we want to highlight it in
* the browser so the user can see it has been done.
*/
dest = [currentConnector destination];
path = [[(id<IB>)NSApp activeDocument] nameForObject: dest];
path = [[(id<IB>)[NSApp delegate] activeDocument] nameForObject: dest];
path = [[currentConnector label] stringByAppendingFormat: @" (%@)", path];
path = [@"/" stringByAppendingString: path];
[oldBrowser loadColumnZero];
@ -576,15 +576,15 @@ selectCellWithString: (NSString*)title
* Create list of existing connections for selected object.
*/
connectors = [[NSMutableArray alloc] init];
array = [[(id<IB>)NSApp activeDocument] connectorsForSource: object
array = [[(id<IB>)[NSApp delegate] activeDocument] connectorsForSource: object
ofClass: [NSNibControlConnector class]];
[connectors addObjectsFromArray: array];
array = [[(id<IB>)NSApp activeDocument] connectorsForSource: object
array = [[(id<IB>)[NSApp delegate] activeDocument] connectorsForSource: object
ofClass: [NSNibOutletConnector class]];
[connectors addObjectsFromArray: array];
RELEASE(outlets);
outlets = RETAIN([[(id<Gorm>)NSApp classManager] allOutletsForObject: object]);
outlets = RETAIN([[(id<GormAppDelegate>)[NSApp delegate] classManager] allOutletsForObject: object]);
DESTROY(actions);
[oldBrowser loadColumnZero];
@ -592,7 +592,7 @@ selectCellWithString: (NSString*)title
/*
* See if we can do initial selection based on pre-existing connections.
*/
if ([NSApp isConnecting] == YES)
if ([[NSApp delegate] isConnecting] == YES)
{
id dest = [currentConnector destination];
unsigned row;
@ -626,7 +626,7 @@ selectCellWithString: (NSString*)title
if ([currentConnector isKindOfClass: [NSNibControlConnector class]] == YES &&
[NSApp isConnecting] == NO)
[[NSApp delegate] isConnecting] == NO)
{
[newBrowser setPath: @"/target"];
[newBrowser sendAction];
@ -644,7 +644,7 @@ selectCellWithString: (NSString*)title
}
else
{
GormDocument *active = (GormDocument *)[(id<IB>)NSApp activeDocument];
GormDocument *active = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
id src = [currentConnector source];
id dest = [currentConnector destination];

View file

@ -133,8 +133,8 @@
NSMutableArray *classes = nil;
[super setObject: anObject];
_document = [(id<IB>)NSApp activeDocument];
_classManager = [(id<Gorm>)NSApp classManager];
_document = [(id<IB>)[NSApp delegate] activeDocument];
_classManager = [(id<GormAppDelegate>)[NSApp delegate] classManager];
// get the information...
NSDebugLog(@"Current selection %@", [self object]);

View file

@ -99,7 +99,7 @@
- (Class) bestPossibleSuperClass
{
Class cls = [NSView class];
GormClassManager *classManager = [(id<Gorm>)NSApp classManager];
GormClassManager *classManager = [(id<GormAppDelegate>)[NSApp delegate] classManager];
if([classManager isSuperclass: @"NSView" linkedToClass: className])
{
@ -127,7 +127,7 @@
{
if([aCoder allowsKeyedCoding])
{
GormClassManager *classManager = [(id<Gorm>)NSApp classManager];
GormClassManager *classManager = [(id<GormAppDelegate>)[NSApp delegate] classManager];
NSString *extension = nil;
ASSIGNCOPY(extension,[classManager nonCustomSuperClassOf: className]);
@ -248,7 +248,7 @@
- (Class) bestPossibleSuperClass
{
Class cls = [NSView class];
GormClassManager *classManager = [(id<Gorm>)NSApp classManager];
GormClassManager *classManager = [(id<GormAppDelegate>)[NSApp delegate] classManager];
if([classManager isSuperclass: @"NSOpenGLView" linkedToClass: theClass] ||
[theClass isEqual: @"NSOpenGLView"])
@ -279,7 +279,7 @@
id obj;
Class cls;
NSUInteger mask;
GormClassManager *classManager = [(id<Gorm>)NSApp classManager];
GormClassManager *classManager = [(id<GormAppDelegate>)[NSApp delegate] classManager];
[aCoder decodeValueOfObjCType: @encode(id) at: &theClass];
theFrame = [aCoder decodeRect];

View file

@ -934,7 +934,7 @@ static NSImage *fileImage = nil;
{
[selectionBox setContentView: scrollView];
[toolbar setSelectedItemIdentifier: @"ObjectsItem"];
if (![NSApp isConnecting])
if (![[NSApp delegate] isConnecting])
[self setSelectionFromEditor: objectsView];
}
break;
@ -954,7 +954,7 @@ static NSImage *fileImage = nil;
break;
case 3: // classes
{
NSArray *selection = [[(id<IB>)NSApp selectionOwner] selection];
NSArray *selection = [[(id<IB>)[NSApp delegate] selectionOwner] selection];
[selectionBox setContentView: classesView];
// if something is selected, in the object view.
@ -1554,7 +1554,7 @@ static NSImage *fileImage = nil;
/*
* Make sure that this editor is not the selection owner.
*/
if ([(id<IB>)NSApp selectionOwner] ==
if ([(id<IB>)[NSApp delegate] selectionOwner] ==
(id<IBSelectionOwners>)anEditor)
{
[self resignSelectionForEditor: anEditor];
@ -1740,7 +1740,7 @@ static void _real_close(GormDocument *self,
}
else if ([name isEqual: IBWillBeginTestingInterfaceNotification] && isDocumentOpen)
{
if ([(id<IB>)NSApp activeDocument] == self)
if ([(id<IB>)[NSApp delegate] activeDocument] == self)
{
NSEnumerator *enumerator;
id obj;
@ -1752,7 +1752,7 @@ static void _real_close(GormDocument *self,
[[self window] orderOut: self];
}
[[NSApp mainMenu] close]; // close the menu during test...
[[[NSApp delegate] mainMenu] close]; // close the menu during test...
enumerator = [nameTable objectEnumerator];
while ((obj = [enumerator nextObject]) != nil)
@ -1783,7 +1783,7 @@ static void _real_close(GormDocument *self,
NSEnumerator *enumerator;
id obj;
[[NSApp mainMenu] display]; // bring the menu back...
[[[NSApp delegate] mainMenu] display]; // bring the menu back...
enumerator = [hidden objectEnumerator];
while ((obj = [enumerator nextObject]) != nil)
@ -2427,12 +2427,12 @@ static void _real_close(GormDocument *self,
id obj;
// stop all connection activities.
[(id<Gorm>)NSApp stopConnecting];
[(id<GormAppDelegate>)[NSApp delegate] stopConnecting];
enumerator = [nameTable objectEnumerator];
if (flag)
{
GormDocument *document = (GormDocument*)[(id<IB>)NSApp activeDocument];
GormDocument *document = (GormDocument*)[(id<IB>)[NSApp delegate] activeDocument];
// set the current document active and unset the old one.
[document setDocumentActive: NO];
@ -2491,7 +2491,7 @@ static void _real_close(GormDocument *self,
NSDebugLog(@"setSelectionFromEditor %@", anEditor);
ASSIGN(lastEditor, anEditor);
[(id<Gorm>)NSApp stopConnecting]; // cease any connection
[(id<GormAppDelegate>)[NSApp delegate] stopConnecting]; // cease any connection
if ([(NSObject *)anEditor respondsToSelector: @selector(window)])
{
[[anEditor window] makeKeyWindow];
@ -3306,7 +3306,7 @@ static void _real_close(GormDocument *self,
*/
- (void) arrangeSelectedObjects: (id)sender
{
NSArray *selection = [[(id<IB>)NSApp selectionOwner] selection];
NSArray *selection = [[(id<IB>)[NSApp delegate] selectionOwner] selection];
NSInteger tag = [sender tag];
NSEnumerator *en = [selection objectEnumerator];
id v = nil;
@ -3338,7 +3338,7 @@ static void _real_close(GormDocument *self,
*/
- (void) alignSelectedObjects: (id)sender
{
NSArray *selection = [[(id<IB>)NSApp selectionOwner] selection];
NSArray *selection = [[(id<IB>)[NSApp delegate] selectionOwner] selection];
NSInteger tag = [sender tag];
NSEnumerator *en = [selection objectEnumerator];
id v = nil;

View file

@ -184,7 +184,7 @@ NSString *formatVersion(NSInteger version)
NSMutableDictionary *dict =
[NSMutableDictionary dictionary];
NSRect docLocation =
[[(GormDocument *)[(id<IB>)NSApp activeDocument] window] frame];
[[(GormDocument *)[(id<IB>)[NSApp delegate] activeDocument] window] frame];
NSRect screenRect = [[NSScreen mainScreen] frame];
NSString *stringRect = [NSString stringWithFormat: @"%d %d %d %d %d %d %d %d",
(int)docLocation.origin.x, (int)docLocation.origin.y,

View file

@ -177,13 +177,13 @@
addObserver: self
selector: @selector(_classAdded:)
name: GormDidAddClassNotification
object: [(id<Gorm>)NSApp classManager]];
object: [(id<GormAppDelegate>)[NSApp delegate] classManager]];
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(_classDeleted:)
name: GormDidDeleteClassNotification
object: [(id<Gorm>)NSApp classManager]];
object: [(id<GormAppDelegate>)[NSApp delegate] classManager]];
}
return self;
}
@ -193,11 +193,11 @@
// filter the classes to view only when a custom view is selected.
if([anObject isKindOfClass: [GormCustomView class]])
{
ASSIGN(classes, AUTORELEASE([[[(id<Gorm>)NSApp classManager] allSubclassesOf: @"NSView"] mutableCopy]));
ASSIGN(classes, AUTORELEASE([[[(id<GormAppDelegate>)[NSApp delegate] classManager] allSubclassesOf: @"NSView"] mutableCopy]));
}
else
{
ASSIGN(classes, AUTORELEASE([[[(id<Gorm>)NSApp classManager] allClassNames] mutableCopy]));
ASSIGN(classes, AUTORELEASE([[[(id<GormAppDelegate>)[NSApp delegate] classManager] allClassNames] mutableCopy]));
}
// remove the first responder, since we don't want the user to choose this.
@ -214,11 +214,11 @@
/*
* Create list of existing connections for selected object.
*/
array = [[(id<IB>)NSApp activeDocument] connectorsForSource: object
array = [[(id<IB>)[NSApp delegate] activeDocument] connectorsForSource: object
ofClass: [NSNibOutletConnector class]];
if ([array count] > 0)
hasConnections = YES;
array = [[(id<IB>)NSApp activeDocument] connectorsForDestination: object
array = [[(id<IB>)[NSApp delegate] activeDocument] connectorsForDestination: object
ofClass: [NSNibControlConnector class]];
if ([array count] > 0)
hasConnections = YES;
@ -250,7 +250,7 @@
else
{
NSArray *array;
id doc = [(id<IB>)NSApp activeDocument];
id doc = [(id<IB>)[NSApp delegate] activeDocument];
unsigned i;
array = [doc connectorsForSource: object

View file

@ -27,7 +27,7 @@
- (void) ok: (id)sender
{
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
id<IBDocuments> document = [(id<IB>)[NSApp delegate] activeDocument];
NSArray *cons = [document connectorsForDestination: object
ofClass: [NSIBHelpConnector class]];
NSIBHelpConnector *con = nil;
@ -67,7 +67,7 @@
- (void) revert: (id)sender
{
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
id<IBDocuments> document = [(id<IB>)[NSApp delegate] activeDocument];
NSArray *cons = [document connectorsForDestination: object
ofClass: [NSIBHelpConnector class]];

View file

@ -80,7 +80,7 @@ static NSMapTable *docMap = 0;
NSMutableArray *list = [NSMutableArray array];
NSEnumerator *en;
id obj;
GormPalettesManager *palettesManager = [(id<Gorm>)NSApp palettesManager];
GormPalettesManager *palettesManager = [(id<GormAppDelegate>)[NSApp delegate] palettesManager];
// add all of the system objects...
[list addObjectsFromArray: systemImagesList()];

View file

@ -184,7 +184,7 @@
- (void) updateSelection
{
if ([NSApp isConnecting] == YES)
if ([[NSApp delegate] isConnecting] == YES)
{
[popup selectItemAtIndex: 1];
[popup setNeedsDisplay: YES];
@ -273,10 +273,10 @@
- (void) setCurrentInspector: (id)anObj
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSArray *selection = [[(id<IB>)NSApp selectionOwner] selection];
NSArray *selection = [[(id<IB>)[NSApp delegate] selectionOwner] selection];
unsigned count = [selection count];
id obj = [selection lastObject];
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
id<IBDocuments> document = [(id<IB>)[NSApp delegate] activeDocument];
NSView *newView = nil;
NSView *oldView = nil;
NSString *newInspector = nil;

View file

@ -129,9 +129,9 @@ static NSUInteger defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (NSInteger)otherWin
{
id<IBDocuments> document = [(id<IB>)NSApp documentForObject: self];
id<IBDocuments> document = [(id<IB>)[NSApp delegate] documentForObject: self];
[super orderWindow: place relativeTo: otherWin];
if([NSApp isConnecting] == NO)
if([[NSApp delegate] isConnecting] == NO)
{
id editor = [document editorForObject: self create: NO];

View file

@ -138,9 +138,9 @@ static NSUInteger defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (NSInteger)otherWin
{
id<IBDocuments> document = [(id<IB>)NSApp documentForObject: self];
id<IBDocuments> document = [(id<IB>)[NSApp delegate] documentForObject: self];
[super orderWindow: place relativeTo: otherWin];
if([NSApp isConnecting] == NO)
if([[NSApp delegate] isConnecting] == NO)
{
id editor = [document editorForObject: self create: NO];

View file

@ -252,7 +252,8 @@ static NSMapTable *docMap = 0;
NSInteger r, c;
int pos;
id obj = nil;
id delegate = [NSApp delegate];
loc = [self convertPoint: loc fromView: nil];
[self getRow: &r column: &c forPoint: loc];
pos = r * [self numberOfColumns] + c;
@ -260,12 +261,12 @@ static NSMapTable *docMap = 0;
{
obj = [objects objectAtIndex: pos];
}
if (obj == [NSApp connectSource])
if (obj == [delegate connectSource])
{
return NSDragOperationNone; /* Can't drag an object onto itsself */
}
[NSApp displayConnectionBetween: [NSApp connectSource] and: obj];
[delegate displayConnectionBetween: [delegate connectSource] and: obj];
if (obj != nil)
{
return NSDragOperationLink;
@ -467,10 +468,10 @@ static NSMapTable *docMap = 0;
[pb declareTypes: [NSArray arrayWithObject: GormLinkPboardType]
owner: self];
[pb setString: name forType: GormLinkPboardType];
[NSApp displayConnectionBetween: obj and: nil];
[NSApp startConnecting];
[[NSApp delegate] displayConnectionBetween: obj and: nil];
[[NSApp delegate] startConnecting];
[self dragImage: [NSApp linkImage]
[self dragImage: [[NSApp delegate] linkImage]
at: loc
offset: NSZeroSize
event: theEvent
@ -507,8 +508,8 @@ static NSMapTable *docMap = 0;
}
else
{
[NSApp displayConnectionBetween: [NSApp connectSource] and: obj];
[NSApp startConnecting];
[[NSApp delegate] displayConnectionBetween: [NSApp connectSource] and: obj];
[[NSApp delegate] startConnecting];
return YES;
}
}
@ -564,7 +565,7 @@ static NSMapTable *docMap = 0;
- (void) resetObject: (id)anObject
{
NSString *name = [document nameForObject: anObject];
GormInspectorsManager *mgr = [(id<Gorm>)NSApp inspectorsManager];
GormInspectorsManager *mgr = [(id<GormAppDelegate>)[NSApp delegate] inspectorsManager];
if ([name isEqual: @"NSOwner"] == YES)
{

View file

@ -197,7 +197,7 @@ selectCellWithString: (NSString*)title
}
else
{
id o = [[(id<IB>)NSApp activeDocument] objectForName: v];
id o = [[(id<IB>)[NSApp delegate] activeDocument] objectForName: v];
if (o != nil)
{

View file

@ -124,7 +124,7 @@ static NSImage *dragImage = nil;
if (f == NO && ([type isEqual: IBWindowPboardType] == YES ||
[type isEqual: IBMenuPboardType] == YES))
{
id<IBDocuments> active = [(id<IB>)NSApp activeDocument];
id<IBDocuments> active = [(id<IB>)[NSApp delegate] activeDocument];
if (active != nil)
{
@ -185,7 +185,7 @@ static NSImage *dragImage = nil;
NSPoint dragPoint = [theEvent locationInWindow];
NSWindow *w = [self window];
NSView *view;
GormDocument *active = (GormDocument *)[(id<IB>)NSApp activeDocument];
GormDocument *active = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
NSRect rect;
NSString *type;
id obj;

View file

@ -90,7 +90,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
- (void) addAction: (id)sender
{
[[(id<Gorm>)NSApp palettesManager] openPalette: self];
[[(id<GormAppDelegate>)[NSApp delegate] palettesManager] openPalette: self];
[table reloadData];
}

View file

@ -90,7 +90,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
- (void) addAction: (id)sender
{
[[(id<Gorm>)NSApp pluginManager] openPlugin: self];
[[(id<GormAppDelegate>)[NSApp delegate] pluginManager] openPlugin: self];
[table reloadData];
}

View file

@ -214,7 +214,7 @@ static BOOL _isInInterfaceBuilder = NO;
NSImage *image = [super imageForViewer];
if([theClass isEqual: @"NSFontManager"])
{
NSBundle *bundle = [NSBundle bundleForClass: [self bundle]];
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
NSString *path = [bundle pathForImageResource: @"GormFontManager"];
image = [[NSImage alloc] initWithContentsOfFile: path];
}

View file

@ -27,9 +27,16 @@
#include <Foundation/Foundation.h>
@class GormClassManager, GormPalettesManager, GormInspectorsManager, NSString, NSMenu, GormPluginManager;
@class GormClassManager;
@class GormInspectorsManager;
@class GormPalettesManager;
@class GormPluginManager;
@class NSMenu;
@class NSString;
@protocol GormAppDelegate
@protocol Gorm
// Connections
- (id) connectSource;
- (id) connectDestination;
@ -38,37 +45,37 @@
- (void) stopConnecting;
// preferences
- (void) preferencesPanel: (id) sender;
- (IBAction) preferencesPanel: (id) sender;
// Cut/Paste operations
- (void) copy: (id)sender;
- (void) cut: (id)sender;
- (void) paste: (id)sender;
- (void) delete: (id)sender;
- (void) selectAllItems: (id)sender;
- (void) setName: (id)sender;
- (IBAction) copy: (id)sender;
- (IBAction) cut: (id)sender;
- (IBAction) paste: (id)sender;
- (IBAction) delete: (id)sender;
- (IBAction) selectAllItems: (id)sender;
- (IBAction) setName: (id)sender;
// palettes/inspectors.
- (void) inspector: (id) sender;
- (void) palettes: (id) sender;
- (void) loadPalette: (id) sender;
- (IBAction) inspector: (id) sender;
- (IBAction) palettes: (id) sender;
- (IBAction) loadPalette: (id) sender;
- (GormPalettesManager*) palettesManager;
- (GormInspectorsManager*) inspectorsManager;
- (GormPluginManager*) pluginManager;
// testing the interface
- (void) testInterface: (id)sender;
- (id) endTesting: (id)sender;
- (IBAction) testInterface: (id)sender;
- (IBAction) endTesting: (id)sender;
// sound & images
- (void) loadSound: (id) sender;
- (void) loadImage: (id) sender;
- (IBAction) loadSound: (id) sender;
- (IBAction) loadImage: (id) sender;
// grouping/layout
- (void) groupSelectionInSplitView: (id)sender;
- (void) groupSelectionInBox: (id)sender;
- (void) groupSelectionInScrollView: (id)sender;
- (void) ungroup: (id)sender;
- (IBAction) groupSelectionInSplitView: (id)sender;
- (IBAction) groupSelectionInBox: (id)sender;
- (IBAction) groupSelectionInScrollView: (id)sender;
- (IBAction) ungroup: (id)sender;
// added for classes support
- (GormClassManager*) classManager;

View file

@ -80,7 +80,7 @@ static NSMapTable *docMap = 0;
NSMutableArray *list = [NSMutableArray array];
NSEnumerator *en;
id obj;
GormPalettesManager *palettesManager = [(id<Gorm>)NSApp palettesManager];
GormPalettesManager *palettesManager = [(id<GormAppDelegate>)[NSApp delegate] palettesManager];
// add all of the system objects...
[list addObjectsFromArray: systemSoundsList()];

View file

@ -115,7 +115,7 @@ NSImage *mVLine = nil;
{
if (control == sizeForm)
{
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
id<IBDocuments> document = [(id<IB>)[NSApp delegate] activeDocument];
NSRect rect;
// Update the document as edited...
@ -190,7 +190,7 @@ NSImage *mVLine = nil;
- (void) setAutosize: (id)sender
{
unsigned mask = [sender tag];
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
id<IBDocuments> document = [(id<IB>)[NSApp delegate] activeDocument];
[document touch];
if ([sender state] == NSOnState)
{

View file

@ -138,7 +138,7 @@
if((self = [super init]) != nil)
{
NSString *className = NSStringFromClass([view class]);
NSString *objectName = [[(id<IB>)NSApp activeDocument] nameForObject: view];
NSString *objectName = [[(id<IB>)[NSApp delegate] activeDocument] nameForObject: view];
NSString *title = [NSString stringWithFormat: @"Standalone View Window: (%@, %@)",
className, objectName];
NSColor *color = [NSColor lightGrayColor];
@ -173,7 +173,7 @@
- (void) activateEditorForView
{
id editor = [[(id<IB>)NSApp activeDocument] editorForObject: _view create: YES];
id editor = [[(id<IB>)[NSApp delegate] activeDocument] editorForObject: _view create: YES];
// NSArray *subviews = [_view subviews];
// NSEnumerator *en = [subviews objectEnumerator];
// id sub = nil;
@ -183,7 +183,7 @@
/*
while((sub = [en nextObject]) != nil)
{
editor = [[(id<IB>)NSApp activeDocument] editorForObject: sub create: YES];
editor = [[(id<IB>)[NSApp delegate] activeDocument] editorForObject: sub create: YES];
[editor activate];
}
*/

View file

@ -211,7 +211,7 @@
[[NSNotificationCenter defaultCenter] removeObserver: self];
[self makeSelectionVisible: NO];
if ([(id<IB>)NSApp selectionOwner] == self)
if ([(id<IB>)[NSApp delegate] selectionOwner] == self)
{
[document resignSelectionForEditor: self];
}

View file

@ -62,7 +62,7 @@
if(result == NO)
{
id object = [(GormDocument *)[(id<IB>)NSApp activeDocument] lastEditor];
id object = [(GormDocument *)[(id<IB>)[NSApp delegate] activeDocument] lastEditor];
NS_DURING
{
if(object != nil)

View file

@ -221,7 +221,7 @@
NSString *gormPath = @"objects.gorm";
NSString *classesPath = @"data.classes";
NSString *infoPath = @"data.info";
GormPalettesManager *palettesManager = [(id<Gorm>)NSApp palettesManager];
GormPalettesManager *palettesManager = [(id<GormAppDelegate>)[NSApp delegate] palettesManager];
NSDictionary *substituteClasses = [palettesManager substituteClasses];
NSEnumerator *en = [substituteClasses keyEnumerator];
NSString *subClassName = nil;

View file

@ -374,7 +374,7 @@
NSString *ownerClass, *key = nil;
BOOL repairFile = [[NSUserDefaults standardUserDefaults]
boolForKey: @"GormRepairFileOnLoad"];
GormPalettesManager *palettesManager = [(id<Gorm>)NSApp palettesManager];
GormPalettesManager *palettesManager = [(id<GormAppDelegate>)[NSApp delegate] palettesManager];
NSDictionary *substituteClasses = [palettesManager substituteClasses];
NSEnumerator *en = [substituteClasses keyEnumerator];
NSString *subClassName = nil;

View file

@ -340,7 +340,7 @@
NSString *nibPath = @"keyedobjects.nib";
NSString *classesPath = @"classes.nib";
NSString *infoPath = @"info.nib";
GormPalettesManager *palettesManager = [(id<Gorm>)NSApp palettesManager];
GormPalettesManager *palettesManager = [(id<GormAppDelegate>)[NSApp delegate] palettesManager];
NSDictionary *substituteClasses = [palettesManager substituteClasses];
NSEnumerator *en = [substituteClasses keyEnumerator];
NSString *subClassName = nil;

View file

@ -67,7 +67,7 @@
NSData *classes = nil;
NSKeyedUnarchiver *u = nil;
NSString *key = nil;
GormPalettesManager *palettesManager = [(id<Gorm>)NSApp palettesManager];
GormPalettesManager *palettesManager = [(id<GormAppDelegate>)[NSApp delegate] palettesManager];
NSDictionary *substituteClasses = [palettesManager substituteClasses];
NSString *subClassName = nil;
NSDictionary *fileWrappers = nil;

View file

@ -81,7 +81,7 @@
NS_DURING
{
GormPalettesManager *palettesManager = [(id<Gorm>)NSApp palettesManager];
GormPalettesManager *palettesManager = [(id<GormAppDelegate>)[NSApp delegate] palettesManager];
NSDictionary *substituteClasses = [palettesManager substituteClasses];
NSString *subClassName = nil;
GormClassManager *classManager = [doc classManager];