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 // NULL and nil
00088 
00089 #ifndef NULL
00090 
00091 #ifdef MAC_ENV
00092 #if !defined(__cplusplus) && (defined(__SC__) || defined(THINK_C))
00093 #define NULL    ((void *) 0)
00094 #else
00095 #define NULL    0
00096 #endif
00097 #endif
00098 
00099 #ifdef WIN_ENV
00100 #ifdef __cplusplus
00101 #define NULL    0
00102 #else
00103 #define NULL    ((void *)0)
00104 #endif
00105 #endif
00106 
00107 #endif
00108 
00109 // dhearst 8/11/99 - we now specifically prefer NULL, so nil
00110 // is obsolete. We no longer provide it, but can't enforce this
00111 // policy because platform headers often provide nil.
00112 #ifndef nil
00113 #define nil NULL
00114 #endif
00115 
00116 
00117 // AMPAPI  Adobe Standard Plugin API calling convention.
00118 
00119 #ifndef AMPAPI
00120 #ifdef MAC_ENV
00121 #define ASAPI
00122 #endif
00123 #ifdef WIN_ENV
00124 #define ASAPI
00125 #endif
00126 #endif
00127 
00128 // C calling convention for those places that need it.
00129 // This doesn't really do anything, but is  more for
00130 // an explicitly declaration when it matters.
00131 #define ASCAPI
00132 
00133 
00134 
00135 /*
00136  * Types
00137  */
00138 
00139 // Integer Types
00140 
00141 #ifndef _H_CoreExpT
00142 
00143 typedef signed char ASInt8;
00145 typedef signed short ASInt16;
00146 
00147 // ASNumTypes is causing redefination error.
00148 // TODO Replace occurances with ai::int32 before
00149 // moving to 64 bit.
00150 #ifndef __TREAT_ASINT32_AS_INT__
00151 
00152 typedef ai::int32 ASInt32;
00153 #else
00154 typedef signed int ASInt32;
00155 #endif
00156 
00157 #endif
00158 
00159 typedef unsigned char ASUInt8;
00161 typedef unsigned short ASUInt16;
00163 typedef ai::uint32 ASUInt32;
00164 
00166 typedef ai::int32 ASErr;
00167 
00168 // Storage Types
00169 
00170 typedef unsigned char ASByte;
00171 typedef ASByte* ASBytePtr;
00172 
00173 // Unicode Types
00175 typedef ASUInt16 ASUnicode;
00176 
00177 // Pointer Types
00179 typedef void* ASPtr;
00181 typedef void** ASHandle;
00182 
00183 // Fixed Types
00185 typedef ASInt32 ASFract;
00187 typedef float ASReal;
00188 
00189 #ifndef _AS_FIXED_TYPE_
00190 #define _AS_FIXED_TYPE_ 1
00191 
00193 typedef ASInt32 ASFixed;
00195 typedef struct _t_ASFixedPoint {
00196         ASFixed h, v;
00197 } ASFixedPoint, *ASFixedPointP;
00198 
00200 typedef struct _t_ASFixedRect {
00201         ASFixed left, top, right, bottom;
00202 } ASFixedRect, *ASFixedRectP;
00203 
00205 typedef struct _t_ASFixedMatrix {
00206         ASFixed a, b, c, d, tx, ty;
00207 } ASFixedMatrix, *ASFixedMatrixP;
00208 
00209 #endif/* _AS_FIXED_TYPE_ */
00210 
00212 typedef struct _t_ASRealPoint {
00213         ASReal h, v;
00214 } ASRealPoint;
00215 
00217 typedef struct _t_ASRealRect {
00218         ASReal left, top, right, bottom;
00219 } ASRealRect;
00220 
00222 typedef struct _t_ASRealMatrix {
00223         ASReal a, b, c, d, tx, ty;
00224         void Init()
00225         {
00226                 a = 0.0; b = 1.0;
00227                 c = 1.0; d = 0.0;
00228                 tx = 0.0; ty = 0.0;
00229         }
00230 } ASRealMatrix;
00231 
00234 typedef struct ASAccess* ASAccessRef;
00235 
00236 
00237 //
00238 //
00239 // Platform dependant natively aligned structures
00240 //
00241 //
00242 
00243 #ifdef MAC_ENV
00244 
00245 typedef short ASSize;
00246 
00248 typedef unsigned char ASBoolean;
00249 #endif
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 © 2016 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks