2001-10-19 19:41:13 +00:00
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import <Carbon/Carbon.h> // Actually I only need CarbonCore.framework
|
2002-02-14 23:24:53 +00:00
|
|
|
|
2002-03-31 12:00:02 +00:00
|
|
|
@class ResourceWindowController, ResourceDataSource, Resource;
|
2001-10-19 19:41:13 +00:00
|
|
|
|
|
|
|
@interface ResourceDocument : NSDocument
|
|
|
|
{
|
2002-02-23 03:40:24 +00:00
|
|
|
IBOutlet ResourceDataSource *dataSource;
|
|
|
|
IBOutlet NSWindow *mainWindow;
|
|
|
|
IBOutlet NSOutlineView *outlineView;
|
2001-10-19 19:41:13 +00:00
|
|
|
|
2002-04-30 23:44:23 +00:00
|
|
|
NSMutableDictionary *toolbarItems;
|
2001-10-19 19:41:13 +00:00
|
|
|
NSMutableArray *resources;
|
2002-03-21 04:02:26 +00:00
|
|
|
HFSUniStr255 *fork; // name of fork to save to, usually empty string (data fork) or 'RESOURCE_FORK' as returned from FSGetResourceForkName()
|
2008-07-31 20:27:55 +00:00
|
|
|
NSData *creator;
|
|
|
|
NSData *type;
|
|
|
|
BOOL _createFork; // file had no existing resource map when opened
|
2001-10-19 19:41:13 +00:00
|
|
|
}
|
|
|
|
|
2008-07-31 20:27:55 +00:00
|
|
|
- (BOOL)readFork:(NSString *)forkName asStreamFromFile:(FSRef *)fileRef;
|
|
|
|
- (BOOL)readResourceMap:(SInt16)fileRefNum;
|
|
|
|
- (BOOL)writeResourceMap:(SInt16)fileRefNum;
|
|
|
|
- (BOOL)writeForkStreamsToFile:(NSString *)fileName;
|
|
|
|
|
|
|
|
- (IBAction)exportResources:(id)sender;
|
|
|
|
- (void)exportResource:(Resource *)resource;
|
|
|
|
- (void)exportPanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;
|
|
|
|
|
2002-02-23 03:40:24 +00:00
|
|
|
- (void)setupToolbar:(NSWindowController *)windowController;
|
2002-02-06 20:57:56 +00:00
|
|
|
|
2002-02-07 03:45:43 +00:00
|
|
|
- (IBAction)showCreateResourceSheet:(id)sender;
|
2002-04-27 18:17:47 +00:00
|
|
|
- (IBAction)showSelectTemplateSheet:(id)sender;
|
2002-03-31 12:00:02 +00:00
|
|
|
- (IBAction)openResources:(id)sender;
|
|
|
|
- (IBAction)openResourcesInTemplate:(id)sender;
|
|
|
|
- (IBAction)openResourcesAsHex:(id)sender;
|
|
|
|
- (void)openResourceUsingEditor:(Resource *)resource;
|
|
|
|
- (void)openResource:(Resource *)resource usingTemplate:(NSString *)templateName;
|
|
|
|
- (void)openResourceAsHex:(Resource *)resource;
|
2002-02-07 03:45:43 +00:00
|
|
|
- (IBAction)playSound:(id)sender;
|
2002-02-12 04:01:47 +00:00
|
|
|
- (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)finished;
|
2002-02-07 03:45:43 +00:00
|
|
|
|
2002-11-13 03:35:54 +00:00
|
|
|
- (IBAction)copy:(id)sender;
|
|
|
|
- (IBAction)paste:(id)sender;
|
|
|
|
- (void)pasteResources:(NSArray *)pastedResources;
|
|
|
|
- (void)overwritePasteSheetDidDismiss:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;
|
2002-02-14 23:24:53 +00:00
|
|
|
- (IBAction)clear:(id)sender;
|
2002-11-13 03:35:54 +00:00
|
|
|
- (void)deleteResourcesSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;
|
2002-05-31 17:31:41 +00:00
|
|
|
- (void)deleteSelectedResources;
|
2002-02-14 23:24:53 +00:00
|
|
|
|
|
|
|
- (void)resourceNameWillChange:(NSNotification *)notification;
|
|
|
|
- (void)resourceIDWillChange:(NSNotification *)notification;
|
|
|
|
- (void)resourceTypeWillChange:(NSNotification *)notification;
|
|
|
|
- (void)resourceAttributesWillChange:(NSNotification *)notification;
|
|
|
|
|
2002-02-23 03:40:24 +00:00
|
|
|
- (NSWindow *)mainWindow;
|
2001-10-19 19:41:13 +00:00
|
|
|
- (ResourceDataSource *)dataSource;
|
2002-02-23 03:40:24 +00:00
|
|
|
- (NSOutlineView *)outlineView;
|
2002-02-12 01:24:53 +00:00
|
|
|
- (NSArray *)resources; // return the array as non-mutable
|
2001-10-19 19:41:13 +00:00
|
|
|
|
2008-07-31 20:27:55 +00:00
|
|
|
- (NSData *)creator;
|
|
|
|
- (NSData *)type;
|
2002-03-31 12:00:02 +00:00
|
|
|
- (IBAction)creatorChanged:(id)sender;
|
|
|
|
- (IBAction)typeChanged:(id)sender;
|
2008-07-31 20:27:55 +00:00
|
|
|
- (BOOL)setCreator:(NSData *)newCreator;
|
|
|
|
- (BOOL)setType:(NSData *)newType;
|
|
|
|
- (BOOL)setCreator:(NSData *)newCreator andType:(NSData *)newType;
|
2002-03-31 12:00:02 +00:00
|
|
|
|
|
|
|
@end
|