PIUIHooksSuite.h

Go to the documentation of this file.
00001 // ADOBE SYSTEMS INCORPORATED
00002 // Copyright  1993 - 2005 Adobe Systems Incorporated
00003 // All Rights Reserved
00004 //
00005 // NOTICE:  Adobe permits you to use, modify, and distribute this
00006 // file in accordance with the terms of the Adobe license agreement
00007 // accompanying it.  If you have received this file from a source
00008 // other than Adobe, then your use, modification, or distribution
00009 // of it requires the prior written permission of Adobe.
00059 #ifndef __PIUIHooksSuite__
00060 #define __PIUIHooksSuite__
00061 
00062 #if PRAGMA_ONCE
00063 #pragma once
00064 #endif
00065 
00066 //-------------------------------------------------------------------------------
00067 //  Includes.
00068 //-------------------------------------------------------------------------------
00069 #include "PIGeneral.h"
00070 #include "PIActions.h"
00071 #include "SPTypes.h"
00072 
00073 //-------------------------------------------------------------------------------
00074 //  C++ wrapper.
00075 //-------------------------------------------------------------------------------
00076 #ifdef __cplusplus
00077 extern "C" {
00078 #endif
00079 
00080 //-------------------------------------------------------------------------------
00081 //  UI hooks suite.
00082 //-------------------------------------------------------------------------------
00083 
00085 #define kPSUIHooksSuite             "Photoshop UIHooks Suite for Plug-ins"
00086 
00087 //-------------------------------------------------------------------------------
00088 //  Error codes.
00089 //-------------------------------------------------------------------------------
00092 #define kPSCursorError              '!cur'     
00093 #define kPSNoLocalizedNameError     '!LoC'        // close defgroup, because I don't want CursorIDs to appear in it.
00096 
00097 //-------------------------------------------------------------------------------
00098 //  SetCursor.  Sets cursor to some popular Photoshop cursors.  Mac and Win.
00099 //-------------------------------------------------------------------------------
00100 
00104 // Cursor IDs:
00105 #define kPICursorNone               NULL
00106 #define kPICursorArrow              "Photoshop Cursor Arrow"
00107 #define kPICursorWatch              "Photoshop Cursor Watch"
00108 #define kPICursorWatchContinue      "Photoshop Cursor Watch Continue"
00109 #define kPICursorMove               "Photoshop Cursor Move"
00110 #define kPICursorHand               "Photoshop Cursor Hand"
00111 #define kPICursorGrab               "Photoshop Cursor Grab"
00112 #define kPICursorZoomIn             "Photoshop Cursor Zoom In"
00113 #define kPICursorZoomOut            "Photoshop Cursor Zoom Out"
00114 #define kPICursorZoomLimit          "Photoshop Cursor Zoom Limit"
00115 #define kPICursorPencil             "Photoshop Cursor Pencil"
00116 #define kPICursorEyedropper         "Photoshop Cursor Eyedropper"
00117 #define kPICursorEyedropperPlus     "Photoshop Cursor Eyedropper Plus"
00118 #define kPICursorEyedropperMinus    "Photoshop Cursor Eyedropper Minus"
00119 #define kPICursorBucket             "Photoshop Cursor Bucket"
00120 #define kPICursorCrosshair          "Photoshop Cursor Crosshair"
00121 #define kPICursorType               "Photoshop Cursor Type"
00122 #define kPICursorPathArrow          "Photoshop Cursor Path Arrow"
00123 
00126 typedef const char* PICursor_t;    
00135 typedef SPAPI SPErr (*HostSetCursorProc) (const PICursor_t cursorID);
00136     
00137 //-------------------------------------------------------------------------------
00138 //  MainAppWindow.  Returns Windows parent window HWND, NULL on Mac.
00139 //-------------------------------------------------------------------------------
00145 typedef SPAPI intptr_t (*MainAppWindowProc) (void);     //64bits - API
00146 
00147 //-------------------------------------------------------------------------------
00148 //  TickCount.  Gets the tick count as 60 ticks per second.  Mac and Win.
00149 //-------------------------------------------------------------------------------
00155 typedef SPAPI uint32 (*HostTickCountProc) (void);       //64bits - API
00156 
00157 //-------------------------------------------------------------------------------
00158 //  GetPluginName.  Returns the name of the plugins specified by pluginRef.
00159 //-------------------------------------------------------------------------------
00160 
00170 typedef SPAPI SPErr (*PluginNameProc) (SPPluginRef pluginRef, ASZString *pluginName);
00171 
00172 //-------------------------------------------------------------------------------
00173 //  UI hooks suite version 1.
00174 //-------------------------------------------------------------------------------
00175 
00177 #define kPSUIHooksSuiteVersion1     1  
00181 typedef struct 
00182     {
00183     ProcessEventProc                processEvent;   
00184     DisplayPixelsProc               displayPixels;  
00185     ProgressProc                    progressBar;    
00186     TestAbortProc                   testAbort;      
00187     MainAppWindowProc               MainAppWindow;  
00188     HostSetCursorProc               SetCursor;      
00189     HostTickCountProc               TickCount;      
00190     PluginNameProc                  GetPluginName;  
00192     } PSUIHooksSuite1;
00193 
00194 //-------------------------------------------------------------------------------
00195 //  SetPluginMenuEntry.  Sets the menu entry for the Last Filter, Undo, Redo, and
00196 //  History state for only the last filter event.  (Have to set it again on each
00197 //  invocation, if you want it to persist.)  Pass the SPPluginRef to the current
00198 //  plug-in only.
00199 //
00200 //  New in version 2.
00201 //-------------------------------------------------------------------------------
00202 
00216 typedef SPAPI SPErr (*SetPluginMenuEntryProc)
00217     (
00218     const SPPluginRef self,         /* Reference to calling (active) filter plug-in. */
00219     const ASZString menuEntry,      /* String to display in Undo, Redo, Last Filter, and History. */
00220     const DescriptorEventID eventID /* Event ID to use for any descriptor returned. */
00221     );
00222 
00223 //-------------------------------------------------------------------------------
00224 //  UI hooks suite version 2.
00225 //-------------------------------------------------------------------------------
00226 
00228 #define kPSUIHooksSuiteVersion2     2  
00232 typedef struct 
00233     {
00234     ProcessEventProc                processEvent;        
00235     DisplayPixelsProc               displayPixels;       
00236     ProgressProc                    progressBar;         
00237     TestAbortProc                   testAbort;           
00238     MainAppWindowProc               MainAppWindow;       
00239     HostSetCursorProc               SetCursor;           
00240     HostTickCountProc               TickCount;           
00241     PluginNameProc                  GetPluginName;       
00242     SetPluginMenuEntryProc          SetPluginMenuEntry;  
00244     } PSUIHooksSuite2;
00245     
00246 //-------------------------------------------------------------------------------
00247 //  GetLocalizedFileName.  Given a ZString, returns the "localized" version of
00248 //  the string using the run-time filename localization support added for Elements 3.
00249 //  If no localized name is found, kPSNoLocalizedNameError is returned. Photoshop always
00250 //  returns kSPUnimplementedError
00251 //
00252 //  New in version 3.
00253 //-------------------------------------------------------------------------------
00254 
00266 typedef SPAPI SPErr (*GetLocalizedFileNameProc)
00267     (
00268     const ASZString inOriginalString,       /* String for which a localized version is requested. */
00269     ASZString *outLocalizedString           /* Returned localized string. */
00270     );
00271     
00272 //-------------------------------------------------------------------------------
00273 //  UI hooks suite version 3.
00274 //-------------------------------------------------------------------------------
00275 
00277 #define kPSUIHooksSuiteVersion3     3     
00281 typedef struct 
00282     {
00283     ProcessEventProc                processEvent;             
00284     DisplayPixelsProc               displayPixels;            
00285     ProgressProc                    progressBar;              
00286     TestAbortProc                   testAbort;                
00287     MainAppWindowProc               MainAppWindow;            
00288     HostSetCursorProc               SetCursor;                
00289     HostTickCountProc               TickCount;                
00290     PluginNameProc                  GetPluginName;            
00291     SetPluginMenuEntryProc          SetPluginMenuEntry;       
00292     GetLocalizedFileNameProc        GetLocalizedFileName;     
00294     } PSUIHooksSuite3;
00295 
00296 //-------------------------------------------------------------------------------
00297 //  C++ wrapper.
00298 //-------------------------------------------------------------------------------
00299 #ifdef __cplusplus
00300 }
00301 #endif
00302 
00303 //-------------------------------------------------------------------------------
00304 #endif  // PIUIHooksSuite