00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __SPAccess__
00021 #define __SPAccess__
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "SPTypes.h"
00031 #include "SPPlugs.h"
00032 #include "SPMData.h"
00033
00034 #if defined(MAC_ENV) && !defined(IOS_ENV)
00035 #import <CoreServices/CoreServices.h>
00036 #endif
00037
00038 #ifdef WIN_ENV
00039 #include "AIWinDef.h"
00040 #endif
00041
00042 #include "SPHeaderBegin.h"
00043
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00060 #define kSPAccessSuite "SP Access Suite"
00061
00062 #define kSPAccessSuiteVersion 3
00063
00095 #define kSPAccessCaller "SP Access"
00096
00101 #define kSPAccessReloadSelector "Reload"
00102
00106 #define kSPAccessUnloadSelector "Unload"
00107
00137 #define kSPFlushAccessType "SP Flush Access"
00138
00139
00140
00141
00142
00143
00144
00145
00153 typedef SPAPI SPErr (*SPEntry)( const char *caller, const char *selector, void *message );
00154
00155
00163 typedef struct SPAccess *SPAccessRef;
00164
00165
00166 #ifdef LINUX_ENV
00167 typedef void* SPMacResChain;
00168 #endif
00169
00170
00171
00172
00173 #ifdef MAC_ENV
00174 #if defined(IOS_ENV)
00175 typedef struct _SPMacResChain SPMacResChain;
00176 typedef SPMacResChain* SPPlatformAccessRef;
00177 #else
00178 #ifndef __FILES__
00179 #if __LP64__
00180 typedef int FSIORefNum;
00181 #else
00182 typedef short FSIORefNum;
00183 #endif
00184 #endif
00185
00186 typedef struct {
00188 FSIORefNum fileRefNum;
00190 CFBundleRef bundleRef;
00191 } SPMacResChain;
00192
00194 typedef SPMacResChain *SPPlatformAccessRef;
00195 #endif // !defined(IOS_ENV)
00196
00197 #endif
00198
00199 #if defined(WIN_ENV)
00200
00201 typedef HINSTANCE SPPlatformAccessRef;
00202 #elif defined(LINUX_ENV)
00203
00204 typedef void* SPPlatformAccessRef;
00205 #endif
00206
00207 #if !defined(IOS_ENV)
00208
00210 typedef struct {
00212 SPPlatformAccessRef defaultAccess;
00216 SPPlatformAccessRef resourceAccess;
00218 ai::uint32 lastAccessTicks;
00219 } SPPlatformAccessInfo;
00220 #endif // !defined(IOS_ENV)
00221
00222
00223
00227 typedef enum {
00230 kStartup = 0,
00234 kRuntime,
00237 kShutdown,
00243 kTerminal
00244 } SPAccessPoint;
00245
00247 typedef struct SPAccessMessage {
00249 SPMessageData d;
00251 SPAccessPoint when;
00252 } SPAccessMessage;
00253
00254
00255
00256
00257
00258
00259
00260
00292 typedef struct SPAccessSuite {
00293
00304 SPAPI SPErr (*AcquirePlugin)( SPPluginRef plugin, SPAccessRef *access );
00305
00311 SPAPI SPErr (*ReleasePlugin)( SPAccessRef access );
00312
00327 SPAPI SPErr (*GetPluginAccess)( SPPluginRef plugin, SPAccessRef *access );
00333 SPAPI SPErr (*GetAccessPlugin)( SPAccessRef access, SPPluginRef *plugin );
00340 SPAPI SPErr (*GetAccessEntry)( SPAccessRef access, SPEntry *entry );
00345 SPAPI SPErr (*GetAccessCount)( SPAccessRef access, ai::int32 *count );
00346 #if !defined(ILLUSTRATOR_MINIMAL)
00347
00352 SPAPI SPErr (*GetAccessInfo)( SPAccessRef access, SPPlatformAccessInfo *info );
00353
00361 SPAPI SPErr (*GetPluginResourceAccess)( SPPluginRef plugin, SPPlatformAccessRef *resourceAccess );
00366 SPAPI SPErr (*SetPluginResourceAccess)( SPPluginRef plugin, SPPlatformAccessRef resourceAccess );
00367 #endif // !defined(ILLUSTRATOR_MINIMAL)
00368
00377 SPAPI SPErr (*CallPlugin)( SPAccessRef access, const char *caller, const char *selector,
00378 void *message, SPErr *result );
00379
00386 SPAPI SPErr (*GetCurrentPlugin)( SPPluginRef *plugin );
00393 SPAPI SPErr (*SetCurrentPlugin)( SPPluginRef plugin );
00394
00395 } SPAccessSuite;
00396
00398 SPAPI SPErr SPAcquirePlugin( SPPluginRef plugin, SPAccessRef *access );
00400 SPAPI SPErr SPReleasePlugin( SPAccessRef access );
00401
00403 SPAPI SPErr SPGetPluginAccess( SPPluginRef plugin, SPAccessRef *access );
00405 SPAPI SPErr SPGetAccessPlugin( SPAccessRef access, SPPluginRef *plugin );
00407 SPAPI SPErr SPGetAccessEntry( SPAccessRef access, SPEntry *entry );
00409 SPAPI SPErr SPGetAccessCount( SPAccessRef access, ai::int32 *count );
00410 #if !defined(ILLUSTRATOR_MINIMAL)
00411
00412 SPAPI SPErr SPGetAccessInfo( SPAccessRef access, SPPlatformAccessInfo *info );
00413
00415 SPAPI SPErr SPGetPluginResourceAccess( SPPluginRef plugin, SPPlatformAccessRef *resourceAccess );
00417 SPAPI SPErr SPSetPluginResourceAccess( SPPluginRef plugin, SPPlatformAccessRef resourceAccess );
00418 #endif // !defined(ILLUSTRATOR_MINIMAL)
00419
00421 SPAPI SPErr SPCallPlugin( SPAccessRef access, const char *caller, const char *selector,
00422 void *message, SPErr *result );
00423
00425 SPAPI SPErr SPGetCurrentPlugin( SPPluginRef *plugin );
00427 SPAPI SPErr SPSetCurrentPlugin( SPPluginRef plugin );
00428
00429
00430
00431
00432
00433
00434
00435
00436 #include "SPErrorCodes.h"
00437
00438 #ifdef __cplusplus
00439 }
00440 #endif
00441
00442 #include "SPHeaderEnd.h"
00443
00444 #endif