Adobe.com
Contents Suites Classes Class Index Member Index

ASTypes.h

Go to the documentation of this file.
00001 /***********************************************************************/
00002 /*                                                                     */
00003 /* ASTypes.h                                                           */
00004 /*                                                                     */
00005 /* ADOBE SYSTEMS INCORPORATED                                          */
00006 /* Copyright 1996-2015 Adobe Systems Incorporated.                     */
00007 /* All Rights Reserved.                                                */
00008 /*                                                                     */
00009 /* NOTICE:  Adobe permits you to use, modify, and distribute this file */
00010 /* in accordance with the terms of the Adobe license agreement         */
00011 /* accompanying it. If you have received this file from a source other */
00012 /* than Adobe, then your use, modification, or distribution of it      */
00013 /* requires the prior written permission of Adobe.                     */
00014 /*                                                                     */
00015 /* Patents Pending                                                     */
00016 /*                                                                     */
00017 /*                                                                     */
00018 /* Started by Dave Lazarony, 01/26/1996                                */
00019 /*                                                                     */
00020 /***********************************************************************/
00021 
00022 #ifndef __ASTypes__
00023 #define __ASTypes__
00024 
00025 /*
00026  * Includes
00027  */
00028 
00029 #ifndef __ASConfig__
00030 #include "ASConfig.h"
00031 #endif
00032 #include "AIBasicTypes.h"
00033 
00034 #ifdef WIN_ENV
00035         #include "AIWinDef.h"
00036 #endif
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00042 
00043 //We need everything to be properly aligned on Windows
00044 #ifdef WIN_ENV
00045 #pragma pack(push, 8)
00046 #endif
00047 
00048 /*
00049  * Constants
00050  */
00051 
00052 // true and false
00053 
00054 #ifndef __cplusplus
00055 #ifndef true
00056 #define true    1
00057 #endif
00058 
00059 #ifndef false
00060 #define false   0
00061 #endif
00062 #endif // __cplusplus
00063 
00064 #ifdef TRUE
00065 #undef TRUE
00066 #endif
00067 #define TRUE    true
00068 
00069 #ifdef FALSE
00070 #undef FALSE
00071 #endif
00072 #define FALSE   false
00073 
00074 // error codes
00076 #define kNoErr                                  0
00077 
00078 #define kOutOfMemoryErr                 '!MEM'
00079 
00080 #define kBadParameterErr                'PARM'
00081 
00082 #define kNotImplementedErr              '!IMP'
00083 
00084 #define kCantHappenErr                  'CANT'
00085 
00086 
00087 #ifndef NULL
00088 
00089 #ifdef MAC_ENV
00090 #if !defined(__cplusplus) && (defined(__SC__) || defined(THINK_C))
00091 #define NULL    ((void *) 0)
00092 #else
00093 #define NULL    0
00094 #endif
00095 #endif
00096 
00097 #ifdef WIN_ENV
00098 #ifdef __cplusplus
00099 #define NULL    0
00100 #else
00101 #define NULL    ((void *)0)
00102 #endif
00103 #endif
00104 
00105 #endif
00106 
00107 // AMPAPI  Adobe Standard Plugin API calling convention.
00108 
00109 #ifndef AMPAPI
00110 #ifdef MAC_ENV
00111 #define ASAPI
00112 #endif
00113 #ifdef WIN_ENV
00114 #define ASAPI
00115 #endif
00116 #ifdef LINUX_ENV
00117 #define ASAPI
00118 #endif
00119 #endif
00120 
00121 // C calling convention for those places that need it.
00122 // This doesn't really do anything, but is  more for
00123 // an explicitly declaration when it matters.
00124 #define ASCAPI
00125 
00126 
00127 
00128 /*
00129  * Types
00130  */
00131 
00132 // Integer Types
00133 
00134 #ifndef _H_CoreExpT
00135 
00136 typedef signed char ASInt8;
00138 typedef signed short ASInt16;
00139 
00140 // ASNumTypes is causing redefination error.
00141 // TODO Replace occurances with ai::int32 before
00142 // moving to 64 bit.
00143 #ifndef __TREAT_ASINT32_AS_INT__
00144 
00145 typedef ai::int32 ASInt32;
00146 #else
00147 typedef signed int ASInt32;
00148 #endif
00149 
00150 #endif
00151 
00152 typedef unsigned char ASUInt8;
00154 typedef unsigned short ASUInt16;
00156 typedef ai::uint32 ASUInt32;
00157 
00159 typedef ai::int32 ASErr;
00160 
00161 // Storage Types
00162 
00163 typedef unsigned char ASByte;
00164 typedef ASByte* ASBytePtr;
00165 
00166 // Unicode Types
00168 typedef ASUInt16 ASUnicode;
00169 
00170 // Pointer Types
00172 typedef void* ASPtr;
00174 typedef void** ASHandle;
00175 
00176 // Fixed Types
00178 typedef ASInt32 ASFract;
00180 typedef float ASReal;
00181 
00182 #ifndef _AS_FIXED_TYPE_
00183 #define _AS_FIXED_TYPE_ 1
00184 
00186 typedef ASInt32 ASFixed;
00188 typedef struct _t_ASFixedPoint {
00189         ASFixed h, v;
00190 } ASFixedPoint, *ASFixedPointP;
00191 
00193 typedef struct _t_ASFixedRect {
00194         ASFixed left, top, right, bottom;
00195 } ASFixedRect, *ASFixedRectP;
00196 
00198 typedef struct _t_ASFixedMatrix {
00199         ASFixed a, b, c, d, tx, ty;
00200 } ASFixedMatrix, *ASFixedMatrixP;
00201 
00202 #endif/* _AS_FIXED_TYPE_ */
00203 
00205 typedef struct _t_ASRealPoint {
00206         ASReal h, v;
00207 } ASRealPoint;
00208 
00210 typedef struct _t_ASRealRect {
00211         ASReal left, top, right, bottom;
00212 } ASRealRect;
00213 
00215 typedef struct _t_ASRealMatrix {
00216         ASReal a, b, c, d, tx, ty;
00217         void Init()
00218         {
00219                 a = 0.0; b = 1.0;
00220                 c = 1.0; d = 0.0;
00221                 tx = 0.0; ty = 0.0;
00222         }
00223 } ASRealMatrix;
00224 
00227 typedef struct ASAccess* ASAccessRef;
00228 
00229 
00230 //
00231 //
00232 // Platform dependant natively aligned structures
00233 //
00234 //
00235 
00236 #ifdef MAC_ENV
00237 
00238 typedef short ASSize;
00239 
00241 typedef unsigned char ASBoolean;
00242 #endif
00243 
00244 #ifdef LINUX_ENV
00245 typedef short ASSize;
00246 
00247 typedef unsigned char ASBoolean;
00248 #endif
00249 
00250 
00251 #ifdef WIN_ENV
00252 
00253 typedef int ASBoolean;
00254 
00256 typedef ai::int32 ASSize;
00257 #endif
00258 
00259 
00260 //
00261 //
00262 // Platform dependant fixed alignment (68K on Mac, 4 Byte on Windows) structures
00263 //
00264 //
00265 #if defined(MAC_ENV) && !__LP64__
00266 #pragma options align=mac68k
00267 #endif
00268 // Platform Structures
00269 
00270 #ifdef MAC_ENV
00271 
00273 typedef struct MacPort_t* AIPortRef;
00274     
00276 typedef struct MacWindow_t* AIWindowRef;
00277     
00279 typedef struct MacDialog_t* AIDialogRef;
00280 
00281 // ASRect is the same size and layout as a Macintosh Rect.
00282 /*typedef struct _t_ASRect {
00283         ASSize top, left, bottom, right;
00284 } ASRect;*/
00285 
00286 // ASPoint is the same size and layout as a Macintosh Point.
00287 /*typedef struct _t_ASPoint {
00288         ASSize v, h;
00289 } ASPoint;*/
00290 
00291 #endif
00292 
00293 
00294 #ifdef WIN_ENV
00295 
00297 typedef HDC ASPortRef;
00298 
00300 typedef HWND ASWindowRef;
00301 
00303 typedef HWND ASDialogRef;
00304 
00305 // ASRect is the same size and layout as a Windows RECT.
00306 /*typedef struct _t_ASRect {
00307         ASSize left, top, right, bottom;
00308 } ASRect;*/
00309 
00310 // ASPoint is the same size and layout as a Windows POINT.
00311 /*typedef struct _t_ASPoint  {
00312         ASSize h, v;
00313 } ASPoint;*/
00314 
00315 #endif
00316 
00317 // ASRGBColor is the same as a Macintosh RGBColor on Macintosh and Windows.
00318 /*typedef struct _t_ASRGBColor {
00319         unsigned short red, green, blue;
00320 } ASRGBColor;*/
00321 
00322 
00323 // AIEvent is the same as a Macintosh EventRecord on Macintosh and Windows.
00324 /*typedef struct _t_ASEvent {
00325         unsigned short  what;
00326         unsigned long   message;
00327         unsigned long   when;
00328         ASPoint                 where;
00329         unsigned short  modifiers;
00330 
00331 } ASEvent;*/
00332 
00333 #if defined(MAC_ENV) && !__LP64__
00334 #pragma options align=reset
00335 #endif
00336 #ifdef WIN_ENV
00337 #pragma pack(pop)
00338 #endif
00339 
00340 //
00341 //
00342 // End of Aligned Structures
00343 //
00344 //
00345 
00346 #ifdef __cplusplus
00347 }
00348 #endif
00349 
00350 
00351 #endif


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks