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 //-------------------------------------------------------------------------------
00146 typedef SPAPI intptr_t (*MainAppWindowProc) (void);     //64bits - API
00147 
00148 //-------------------------------------------------------------------------------
00149 //  TickCount.  Gets the tick count as 60 ticks per second.  Mac and Win.
00150 //-------------------------------------------------------------------------------
00156 typedef SPAPI uint32 (*HostTickCountProc) (void);       //64bits - API
00157 
00158 //-------------------------------------------------------------------------------
00159 //  GetPluginName.  Returns the name of the plugins specified by pluginRef.
00160 //-------------------------------------------------------------------------------
00161 
00171 typedef SPAPI SPErr (*PluginNameProc) (SPPluginRef pluginRef, ASZString *pluginName);
00172 
00173 //-------------------------------------------------------------------------------
00174 //  UI hooks suite version 1.
00175 //-------------------------------------------------------------------------------
00176 
00178 #define kPSUIHooksSuiteVersion1     1  
00182 typedef struct 
00183     {
00184     ProcessEventProc                processEvent;   
00185     DisplayPixelsProc               displayPixels;  
00186     ProgressProc                    progressBar;    
00187     TestAbortProc                   testAbort;      
00188     MainAppWindowProc               MainAppWindow;  
00189     HostSetCursorProc               SetCursor;      
00190     HostTickCountProc               TickCount;      
00191     PluginNameProc                  GetPluginName;  
00193     } PSUIHooksSuite1;
00194 
00195 //-------------------------------------------------------------------------------
00196 //  SetPluginMenuEntry.  Sets the menu entry for the Last Filter, Undo, Redo, and
00197 //  History state for only the last filter event.  (Have to set it again on each
00198 //  invocation, if you want it to persist.)  Pass the SPPluginRef to the current
00199 //  plug-in only.
00200 //
00201 //  New in version 2.
00202 //-------------------------------------------------------------------------------
00203 
00217 typedef SPAPI SPErr (*SetPluginMenuEntryProc)
00218     (
00219     const SPPluginRef self,         /* Reference to calling (active) filter plug-in. */
00220     const ASZString menuEntry,      /* String to display in Undo, Redo, Last Filter, and History. */
00221     const DescriptorEventID eventID /* Event ID to use for any descriptor returned. */
00222     );
00223 
00224 //-------------------------------------------------------------------------------
00225 //  UI hooks suite version 2.
00226 //-------------------------------------------------------------------------------
00227 
00229 #define kPSUIHooksSuiteVersion2     2  
00233 typedef struct 
00234     {
00235     ProcessEventProc                processEvent;        
00236     DisplayPixelsProc               displayPixels;       
00237     ProgressProc                    progressBar;         
00238     TestAbortProc                   testAbort;           
00239     MainAppWindowProc               MainAppWindow;       
00240     HostSetCursorProc               SetCursor;           
00241     HostTickCountProc               TickCount;           
00242     PluginNameProc                  GetPluginName;       
00243     SetPluginMenuEntryProc          SetPluginMenuEntry;  
00245     } PSUIHooksSuite2;
00246     
00247 //-------------------------------------------------------------------------------
00248 //  GetLocalizedFileName.  Given a ZString, returns the "localized" version of
00249 //  the string using the run-time filename localization support added for Elements 3.
00250 //  If no localized name is found, kPSNoLocalizedNameError is returned. Photoshop always
00251 //  returns kSPUnimplementedError
00252 //
00253 //  New in version 3.
00254 //-------------------------------------------------------------------------------
00255 
00267 typedef SPAPI SPErr (*GetLocalizedFileNameProc)
00268     (
00269     const ASZString inOriginalString,       /* String for which a localized version is requested. */
00270     ASZString *outLocalizedString           /* Returned localized string. */
00271     );
00272     
00273 //-------------------------------------------------------------------------------
00274 //  UI hooks suite version 3.
00275 //-------------------------------------------------------------------------------
00276 
00278 #define kPSUIHooksSuiteVersion3     3     
00282 typedef struct 
00283     {
00284     ProcessEventProc                processEvent;             
00285     DisplayPixelsProc               displayPixels;            
00286     ProgressProc                    progressBar;              
00287     TestAbortProc                   testAbort;                
00288     MainAppWindowProc               MainAppWindow;            
00289     HostSetCursorProc               SetCursor;                
00290     HostTickCountProc               TickCount;                
00291     PluginNameProc                  GetPluginName;            
00292     SetPluginMenuEntryProc          SetPluginMenuEntry;       
00293     GetLocalizedFileNameProc        GetLocalizedFileName;     
00295     } PSUIHooksSuite3;
00296 
00297 //-------------------------------------------------------------------------------
00298 //  MainAppRootWindow.  Returns Windows application frame HWND, NULL on Mac.
00299 //-------------------------------------------------------------------------------
00306 typedef SPAPI intptr_t (*MainAppRootWindowProc) (void);     //64bits - API
00307 
00308 
00309 //-------------------------------------------------------------------------------
00310 //  UI hooks suite version 4.
00311 //-------------------------------------------------------------------------------
00312 
00314 #define kPSUIHooksSuiteVersion4     4     
00318 typedef struct 
00319     {
00320     ProcessEventProc                processEvent;             
00321     DisplayPixelsProc               displayPixels;            
00322     ProgressProc                    progressBar;              
00323     TestAbortProc                   testAbort;                
00324     MainAppWindowProc               MainAppWindow;            
00325     HostSetCursorProc               SetCursor;                
00326     HostTickCountProc               TickCount;                
00327     PluginNameProc                  GetPluginName;            
00328     SetPluginMenuEntryProc          SetPluginMenuEntry;       
00329     GetLocalizedFileNameProc        GetLocalizedFileName;     
00330     MainAppRootWindowProc           MainAppRootWindow;        
00332     } PSUIHooksSuite4;
00333 
00334 //-------------------------------------------------------------------------------
00335 //  C++ wrapper.
00336 //-------------------------------------------------------------------------------
00337 #ifdef __cplusplus
00338 }
00339 #endif
00340 
00341 //-------------------------------------------------------------------------------
00342 #endif  // PIUIHooksSuite