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
00167
00168
00169 #ifdef MAC_ENV
00170 #if defined(IOS_ENV)
00171 typedef struct _SPMacResChain SPMacResChain;
00172 typedef SPMacResChain* SPPlatformAccessRef;
00173 #else
00174 #ifndef __FILES__
00175 #if __LP64__
00176 typedef int FSIORefNum;
00177 #else
00178 typedef short FSIORefNum;
00179 #endif
00180 #endif
00181
00182 typedef struct {
00184 FSIORefNum fileRefNum;
00186 CFBundleRef bundleRef;
00187 } SPMacResChain;
00188
00190 typedef SPMacResChain *SPPlatformAccessRef;
00191 #endif // !defined(IOS_ENV)
00192
00193 #endif
00194
00195 #ifdef WIN_ENV
00196
00198 typedef HINSTANCE SPPlatformAccessRef;
00199
00200 #endif
00201
00202 #if !defined(IOS_ENV)
00203
00205 typedef struct {
00207 SPPlatformAccessRef defaultAccess;
00211 SPPlatformAccessRef resourceAccess;
00213 ai::uint32 lastAccessTicks;
00214 } SPPlatformAccessInfo;
00215 #endif // !defined(IOS_ENV)
00216
00217
00218
00222 typedef enum {
00225 kStartup = 0,
00229 kRuntime,
00232 kShutdown,
00238 kTerminal
00239 } SPAccessPoint;
00240
00242 typedef struct SPAccessMessage {
00244 SPMessageData d;
00246 SPAccessPoint when;
00247 } SPAccessMessage;
00248
00249
00250
00251
00252
00253
00254
00255
00287 typedef struct SPAccessSuite {
00288
00299 SPAPI SPErr (*AcquirePlugin)( SPPluginRef plugin, SPAccessRef *access );
00300
00306 SPAPI SPErr (*ReleasePlugin)( SPAccessRef access );
00307
00322 SPAPI SPErr (*GetPluginAccess)( SPPluginRef plugin, SPAccessRef *access );
00328 SPAPI SPErr (*GetAccessPlugin)( SPAccessRef access, SPPluginRef *plugin );
00335 SPAPI SPErr (*GetAccessEntry)( SPAccessRef access, SPEntry *entry );
00340 SPAPI SPErr (*GetAccessCount)( SPAccessRef access, ai::int32 *count );
00341 #if !defined(IOS_ENV)
00342
00347 SPAPI SPErr (*GetAccessInfo)( SPAccessRef access, SPPlatformAccessInfo *info );
00348
00356 SPAPI SPErr (*GetPluginResourceAccess)( SPPluginRef plugin, SPPlatformAccessRef *resourceAccess );
00361 SPAPI SPErr (*SetPluginResourceAccess)( SPPluginRef plugin, SPPlatformAccessRef resourceAccess );
00362 #endif // !defined(IOS_ENV)
00363
00372 SPAPI SPErr (*CallPlugin)( SPAccessRef access, const char *caller, const char *selector,
00373 void *message, SPErr *result );
00374
00381 SPAPI SPErr (*GetCurrentPlugin)( SPPluginRef *plugin );
00388 SPAPI SPErr (*SetCurrentPlugin)( SPPluginRef plugin );
00389
00390 } SPAccessSuite;
00391
00393 SPAPI SPErr SPAcquirePlugin( SPPluginRef plugin, SPAccessRef *access );
00395 SPAPI SPErr SPReleasePlugin( SPAccessRef access );
00396
00398 SPAPI SPErr SPGetPluginAccess( SPPluginRef plugin, SPAccessRef *access );
00400 SPAPI SPErr SPGetAccessPlugin( SPAccessRef access, SPPluginRef *plugin );
00402 SPAPI SPErr SPGetAccessEntry( SPAccessRef access, SPEntry *entry );
00404 SPAPI SPErr SPGetAccessCount( SPAccessRef access, ai::int32 *count );
00405 #if !defined(IOS_ENV)
00406
00407 SPAPI SPErr SPGetAccessInfo( SPAccessRef access, SPPlatformAccessInfo *info );
00408
00410 SPAPI SPErr SPGetPluginResourceAccess( SPPluginRef plugin, SPPlatformAccessRef *resourceAccess );
00412 SPAPI SPErr SPSetPluginResourceAccess( SPPluginRef plugin, SPPlatformAccessRef resourceAccess );
00413 #endif // !defined(IOS_ENV)
00414
00416 SPAPI SPErr SPCallPlugin( SPAccessRef access, const char *caller, const char *selector,
00417 void *message, SPErr *result );
00418
00420 SPAPI SPErr SPGetCurrentPlugin( SPPluginRef *plugin );
00422 SPAPI SPErr SPSetCurrentPlugin( SPPluginRef plugin );
00423
00424
00425
00426
00427
00428
00429
00430
00431 #include "SPErrorCodes.h"
00432
00433 #ifdef __cplusplus
00434 }
00435 #endif
00436
00437 #include "SPHeaderEnd.h"
00438
00439 #endif