2003-07-15 04:20:09 +00:00
|
|
|
/* GormDocument.h
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2003-05-23 02:25:34 +00:00
|
|
|
|
2003-03-03 09:15:48 +00:00
|
|
|
#ifndef INCLUDED_GormDocument_h
|
|
|
|
#define INCLUDED_GormDocument_h
|
1999-12-08 15:04:57 +00:00
|
|
|
|
2003-05-23 02:25:34 +00:00
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
#include <Foundation/Foundation.h>
|
2003-08-01 03:20:43 +00:00
|
|
|
#include <GNUstepGUI/GSNibTemplates.h>
|
2005-03-08 05:11:41 +00:00
|
|
|
#include <InterfaceBuilder/InterfaceBuilder.h>
|
2003-05-23 02:25:34 +00:00
|
|
|
|
2004-12-31 13:21:30 +00:00
|
|
|
@class GormClassManager, GormClassEditor, GormObjectProxy, GormFilesOwner;
|
2001-05-08 09:43:11 +00:00
|
|
|
|
1999-12-13 17:01:35 +00:00
|
|
|
/*
|
|
|
|
* Each document has a GormFirstResponder object that is used as a placeholder
|
|
|
|
* for the first responder at any instant.
|
|
|
|
*/
|
2004-03-22 04:20:17 +00:00
|
|
|
@interface GormFirstResponder : NSObject
|
1999-12-20 15:21:26 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
@end
|
1999-12-13 17:01:35 +00:00
|
|
|
|
1999-12-08 15:04:57 +00:00
|
|
|
@interface GormDocument : GSNibContainer <IBDocuments>
|
|
|
|
{
|
2001-05-08 09:43:11 +00:00
|
|
|
GormClassManager *classManager;
|
1999-12-13 17:01:35 +00:00
|
|
|
GormFilesOwner *filesOwner;
|
|
|
|
GormFirstResponder *firstResponder;
|
2004-03-24 20:44:23 +00:00
|
|
|
GormObjectProxy *fontManager;
|
1999-12-08 15:04:57 +00:00
|
|
|
NSString *documentPath;
|
|
|
|
NSMapTable *objToName;
|
1999-12-14 19:55:18 +00:00
|
|
|
NSWindow *window;
|
2001-05-08 09:43:11 +00:00
|
|
|
NSBox *selectionBox;
|
1999-12-14 19:55:18 +00:00
|
|
|
NSScrollView *scrollView;
|
2001-05-08 09:43:11 +00:00
|
|
|
NSScrollView *classesScrollView;
|
2002-11-04 13:52:31 +00:00
|
|
|
NSScrollView *soundsScrollView;
|
2002-11-18 20:54:26 +00:00
|
|
|
NSScrollView *imagesScrollView;
|
2001-05-08 09:43:11 +00:00
|
|
|
id classesView;
|
1999-12-14 19:55:18 +00:00
|
|
|
id objectsView;
|
2002-11-04 13:52:31 +00:00
|
|
|
id soundsView;
|
2002-11-18 20:54:26 +00:00
|
|
|
id imagesView;
|
2000-01-13 21:19:03 +00:00
|
|
|
BOOL hasSetDefaults;
|
2000-01-04 16:25:39 +00:00
|
|
|
BOOL isActive;
|
2004-08-08 17:23:17 +00:00
|
|
|
BOOL isDocumentOpen;
|
1999-12-16 18:06:22 +00:00
|
|
|
NSMenu *savedMenu;
|
2005-04-10 22:21:59 +00:00
|
|
|
NSMenuItem *quitItem; /* Replaced during test-mode */
|
2000-01-03 11:00:14 +00:00
|
|
|
NSMutableArray *savedEditors;
|
2000-02-03 17:04:37 +00:00
|
|
|
NSMutableArray *hidden;
|
2004-05-13 22:48:14 +00:00
|
|
|
NSMutableArray *openEditors;
|
2004-05-20 02:34:03 +00:00
|
|
|
NSToolbar *toolbar;
|
2004-06-03 22:37:14 +00:00
|
|
|
id lastEditor;
|
2004-07-12 04:16:09 +00:00
|
|
|
BOOL isOlderArchive;
|
|
|
|
id filePrefsView;
|
|
|
|
id filePrefsManager;
|
2004-07-21 02:03:59 +00:00
|
|
|
NSWindow *filePrefsWindow;
|
2005-04-10 22:21:59 +00:00
|
|
|
NSMutableArray *resourceManagers;
|
1999-12-08 15:04:57 +00:00
|
|
|
}
|
2005-04-10 22:21:59 +00:00
|
|
|
|
|
|
|
/* Archiving objects */
|
2000-01-03 11:00:14 +00:00
|
|
|
- (void) beginArchiving;
|
|
|
|
- (void) endArchiving;
|
2005-04-10 22:21:59 +00:00
|
|
|
|
|
|
|
/* Handle notifications */
|
1999-12-14 19:55:18 +00:00
|
|
|
- (void) handleNotification: (NSNotification*)aNotification;
|
2005-04-10 22:21:59 +00:00
|
|
|
|
|
|
|
/* Document management */
|
2000-01-04 16:25:39 +00:00
|
|
|
- (BOOL) isActive;
|
2000-01-03 11:00:14 +00:00
|
|
|
- (BOOL) objectIsVisibleAtLaunch: (id)anObject;
|
2003-01-16 04:09:07 +00:00
|
|
|
- (BOOL) objectIsDeferred: (id)anObject;
|
2000-01-04 17:46:26 +00:00
|
|
|
- (id) loadDocument: (NSString*)path;
|
1999-12-08 15:04:57 +00:00
|
|
|
- (id) openDocument: (id)sender;
|
2000-01-04 17:46:26 +00:00
|
|
|
- (id) revertDocument: (id)sender;
|
2003-05-20 03:57:37 +00:00
|
|
|
- (BOOL) saveAsDocument: (id)sender;
|
|
|
|
- (BOOL) saveGormDocument: (id)sender;
|
2000-01-13 21:19:03 +00:00
|
|
|
- (void) setupDefaults: (NSString*)type;
|
1999-12-08 15:04:57 +00:00
|
|
|
- (void) setDocumentActive: (BOOL)flag;
|
2000-01-03 11:00:14 +00:00
|
|
|
- (void) setObject: (id)anObject isVisibleAtLaunch: (BOOL)flag;
|
2003-01-16 04:09:07 +00:00
|
|
|
- (void) setObject: (id)anObject isDeferred: (BOOL)flag;
|
2000-01-04 16:25:39 +00:00
|
|
|
- (NSWindow*) window;
|
2003-05-20 03:57:37 +00:00
|
|
|
- (BOOL) couldCloseDocument;
|
2000-01-04 16:25:39 +00:00
|
|
|
- (BOOL) windowShouldClose: (id)sender;
|
2005-04-10 22:21:59 +00:00
|
|
|
- (BOOL) isTopLevelObject: (id)obj;
|
|
|
|
- (void) closeAllEditors;
|
|
|
|
- (void) createResourceManagers;
|
|
|
|
- (NSArray *) resourceManagers;
|
2005-04-11 00:16:01 +00:00
|
|
|
- (IBResourceManager *) resourceManagerForPasteboard: (NSPasteboard *)pboard;
|
2005-04-22 21:27:14 +00:00
|
|
|
- (void) changeToTopLevelEditorAcceptingTypes: (NSArray *)types
|
|
|
|
andFileType: (NSString *)fileType;
|
2001-05-08 09:43:11 +00:00
|
|
|
|
2005-04-10 22:21:59 +00:00
|
|
|
/* Managing classes */
|
|
|
|
- (GormClassManager*) classManager;
|
2001-05-08 09:43:11 +00:00
|
|
|
- (id) createSubclass: (id)sender;
|
|
|
|
- (id) instantiateClass: (id)sender;
|
2001-07-06 17:10:51 +00:00
|
|
|
- (id) createClassFiles: (id)sender;
|
2003-05-10 21:19:25 +00:00
|
|
|
- (id) addAttributeToClass: (id)sender;
|
|
|
|
- (id) remove: (id)sender;
|
|
|
|
- (id) createClassFiles: (id)sender;
|
|
|
|
- (id) instantiateClass: (id)sender;
|
2004-04-26 05:03:53 +00:00
|
|
|
- (void) selectClass: (NSString *)className;
|
2004-05-19 01:36:37 +00:00
|
|
|
- (BOOL) classIsSelected;
|
2004-12-16 10:38:14 +00:00
|
|
|
- (void) removeAllInstancesOfClass: (NSString *)classNamed;
|
2002-11-04 13:52:31 +00:00
|
|
|
|
2005-04-10 22:21:59 +00:00
|
|
|
/* Sound & Image support */
|
2002-11-04 13:52:31 +00:00
|
|
|
- (id) openSound: (id)sender;
|
2003-01-04 00:17:43 +00:00
|
|
|
- (id) openImage: (id)sender;
|
2002-11-05 05:42:45 +00:00
|
|
|
|
2005-04-10 22:21:59 +00:00
|
|
|
/* Connections */
|
2002-11-13 16:10:22 +00:00
|
|
|
- (void) rebuildObjToNameMapping;
|
2002-11-23 23:33:17 +00:00
|
|
|
- (BOOL) removeConnectionsWithLabel: (NSString *)name
|
2002-11-23 04:45:04 +00:00
|
|
|
forClassNamed: (NSString *)className
|
|
|
|
isAction: (BOOL)action;
|
2002-11-30 00:49:55 +00:00
|
|
|
- (BOOL) removeConnectionsForClassNamed: (NSString *)name;
|
2002-12-05 05:23:08 +00:00
|
|
|
- (BOOL) renameConnectionsForClassNamed: (NSString *)name
|
|
|
|
toName: (NSString *)newName;
|
2003-12-24 02:50:34 +00:00
|
|
|
|
2005-04-10 22:21:59 +00:00
|
|
|
/* class loading */
|
2003-05-10 21:19:25 +00:00
|
|
|
- (id) loadClass: (id)sender;
|
|
|
|
|
2005-04-10 22:21:59 +00:00
|
|
|
/* services/windows menus... */
|
2003-09-28 23:31:35 +00:00
|
|
|
- (void) setServicesMenu: (NSMenu *)menu;
|
|
|
|
- (NSMenu *) servicesMenu;
|
|
|
|
- (void) setWindowsMenu: (NSMenu *)menu;
|
|
|
|
- (NSMenu *) windowsMenu;
|
2004-01-05 03:36:24 +00:00
|
|
|
|
2005-04-10 22:21:59 +00:00
|
|
|
/* first responder/font manager */
|
2004-03-21 15:33:28 +00:00
|
|
|
- (id) fontManager;
|
|
|
|
- (id) firstResponder;
|
2004-12-13 01:58:43 +00:00
|
|
|
|
2005-04-10 22:21:59 +00:00
|
|
|
/*
|
|
|
|
* windowAndRect:forObject: is called by Gorm to determine where it should
|
|
|
|
* draw selection markup
|
|
|
|
*/
|
2004-12-13 01:58:43 +00:00
|
|
|
- (NSWindow*) windowAndRect: (NSRect*)r forObject: (id)object;
|
1999-12-08 15:04:57 +00:00
|
|
|
@end
|
|
|
|
|
2003-01-01 17:50:17 +00:00
|
|
|
@interface GormDocument (MenuValidation)
|
|
|
|
- (BOOL) isEditingObjects;
|
|
|
|
- (BOOL) isEditingImages;
|
|
|
|
- (BOOL) isEditingSounds;
|
|
|
|
- (BOOL) isEditingClasses;
|
|
|
|
@end
|
|
|
|
|
1999-12-08 15:04:57 +00:00
|
|
|
#endif
|