#ifndef __ExternalModules__ #define __ExternalModules__ /****************************************************************************** File: WorkshopModule.h Contains: This header file contains the traps for calling functions within Image Workshop. Written by: Brian Powell Copyright: © 1994 by Brian Powell, all rights reserved. WARNING: DO NOT ALTER THIS FILE, IT WILL CERTAINLY GAURANTEE THAT YOUR MODULE WILL NOT WORK WITH IMAGE WORKSHOP. ******************************************************************************/ #pragma once // Include the register setup header #ifdef __MWERKS__ #include #include "A4Stuff.h" #include "SetupA4.h" #else #include #include #endif #include // Define typedef struct { double lat; double lon; } LatLon; // Define Image Workshop Constants #define kIWSignature '§PTM' #define kIWImageType 'IM§P' #define kIWCTableType 'CO§P' #define kIWExternals 'EX§P' // Declare our functions typedef struct { pascal CTabHandle (*GetColorTable)(short); pascal void (*SetColorTable)(short, CTabHandle); pascal short (*GetTopImage)(void); pascal void (*PrintImage)(short); pascal void (*CloseImage)(short); pascal void (*GetCurrentLayer)(short); pascal Boolean (*BeginDrawing)(short); pascal void (*EndDrawing)(short); pascal short (*NewImage)(Point*, GWorldPtr); pascal void (*GetGeography)(short, LatLon *, double *, short *); pascal void (*SetGeography)(short, LatLon *, double, short); pascal short (*LoadImage)(StandardFileReply *, short); pascal short (*AddLayer)(short, GWorldPtr); pascal short (*GetCurrentLayerNum)(short); pascal short (*CountLayers)(short); pascal void (*SetCurrentLayer)(short, short); pascal void (*GetSelectionRect)(short, Rect *); pascal void (*BeginTask)(void); pascal void (*EndTask)(void); pascal void (*RedrawImage)(short); //pascal void (*)(); } ExternalFunctions, *ExternalProcPtrs; // Define the error messages enum { kUnexpectedError=1, kCommandNotImplemented }; // Define our command codes enum { kInitCode, kReadFile, kSaveFile, kExecuteCode, kDispose, kProcessTask, kCancelTask }; // Declare our functions here short ModuleInit(ExternalProcPtrs functions, Ptr data1, Ptr data2, Handle *myData); short ModuleRead(ExternalProcPtrs functions, Ptr data1, Ptr data2, Handle *myData); short ModuleSave(ExternalProcPtrs functions, Ptr data1, Ptr data2, Handle *myData); short ModuleExecute(ExternalProcPtrs functions, Ptr data1, Ptr data2, Handle *myData); short ModuleDispose(ExternalProcPtrs functions, Ptr data1, Ptr data2, Handle *myData); short ModuleProcessTask(ExternalProcPtrs functions, Ptr data1, Ptr data2, Handle *myData); short ModuleCancelTask(ExternalProcPtrs functions, Ptr data1, Ptr data2, Handle *myData); #endif