From 52a51f7d797606d885ec74eca6fb1c73a7a1d215 Mon Sep 17 00:00:00 2001 From: Uli Kusterer Date: Sun, 10 Aug 2003 06:41:30 +0200 Subject: [PATCH] Added comments to NuTemplateElement about actions that are forwarded to template elements by the editor. Removed image file export's support for custom extensions, as it returns an NSImage anyway, and saves its TIFFRepresentation, and another extension would only have caused trouble. --- Cocoa/Classes/ResourceDocument.m | 4 ---- Cocoa/Plug-Ins/ResKnifePluginProtocol.h | 5 ----- NuTemplateEditor/NuTemplateElement.h | 10 ++++++++++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Cocoa/Classes/ResourceDocument.m b/Cocoa/Classes/ResourceDocument.m index f54d6db..3be7e14 100644 --- a/Cocoa/Classes/ResourceDocument.m +++ b/Cocoa/Classes/ResourceDocument.m @@ -1045,10 +1045,6 @@ static NSString *RKExportItemIdentifier = @"com.ulikusterer.resknife.toolbar.ex return; theData = [edClass imageForImageFileExport: resource]; - - if( [edClass respondsToSelector:@selector(extensionForImageFileExport:)] ) - extension = [edClass extensionForFileExport]; - panel = [NSSavePanel savePanel]; fName = [[resource name] stringByAppendingFormat: @".%@", extension]; diff --git a/Cocoa/Plug-Ins/ResKnifePluginProtocol.h b/Cocoa/Plug-Ins/ResKnifePluginProtocol.h index f6460f8..c5a054f 100644 --- a/Cocoa/Plug-Ins/ResKnifePluginProtocol.h +++ b/Cocoa/Plug-Ins/ResKnifePluginProtocol.h @@ -41,11 +41,6 @@ functionality: */ image format. This will be a lossy conversion to a TIFF file. */ +(NSImage*) imageForImageFileExport: (id )theRes; -/*! @method extensionForImageFileExport: - @abstract If you implement imageForImageFileExport, return a string here that - provides the proper file extension for your file. By default the - host application substitutes "tiff" here. */ -+(NSString*) extensionForImageFileExport: (id )theRes; @end diff --git a/NuTemplateEditor/NuTemplateElement.h b/NuTemplateEditor/NuTemplateElement.h index 85f313d..a92cf22 100644 --- a/NuTemplateEditor/NuTemplateElement.h +++ b/NuTemplateEditor/NuTemplateElement.h @@ -58,5 +58,15 @@ -(unsigned int) sizeOnDisk; -(void) writeDataTo: (NuTemplateStream*)stream; +/* Apart from these messages, a NuTemplateElement may also implement the IBActions for + the standard edit commands (cut, copy, paste, clear). When an element is selected, + the template editor will forward any calls to these items to the element, if it + implements them, and it will automatically enable the appropriate menu items. It + will also forward validateMenuItem: for the Paste menu item to the element. + + The showCreateResourceSheet: action will also be forwarded to elements by the + template editor. Use this to allow creating new list items or for similar + purposes ("Create New Resource..." is renamed to "Create List Entry" while the + template editor is key). */ @end