Adobe.com
Contents Suites Classes Class Index Member Index

AITypes.h

Go to the documentation of this file.
00001 #ifndef __AITypes__
00002 #define __AITypes__
00003 
00004 /*
00005  *        Name: AITypes.h
00006  *   $Revision: 17 $
00007  *      Author:
00008  *        Date:
00009  *     Purpose: Adobe Illustrator core type definitions.
00010  *
00011  * ADOBE SYSTEMS INCORPORATED
00012  * Copyright 1986-2015 Adobe Systems Incorporated.
00013  * All rights reserved.
00014  *
00015  * NOTICE:  Adobe permits you to use, modify, and distribute this file 
00016  * in accordance with the terms of the Adobe license agreement 
00017  * accompanying it. If you have received this file from a source other 
00018  * than Adobe, then your use, modification, or distribution of it 
00019  * requires the prior written permission of Adobe.
00020  *
00021  */
00022 
00023 
00024 /*******************************************************************************
00025  *
00026  *  Includes
00027  *
00028  */
00029 #ifdef __cplusplus
00030 #include <exception>
00031 #endif
00032 
00033 #include "AIBasicTypes.h"
00034 
00035 #ifndef __ASTypes__
00036 #include "ASTypes.h"
00037 #endif
00038 
00039 #include "ADMStdTypes.h"// This is a new file we have added in shared\illustrator\public\api\...  
00040                                                         // It contains definition of ADMRect, ADMPoint, ADMUnits ... It has nothing to do with ADM, except that the name contains ADM.
00041 
00042 #ifdef WIN_ENV
00043 #include "AIWinDef.h"
00044 #endif
00045 
00046 #ifndef __SPFiles__
00047 #include "SPFiles.h"
00048 #endif
00049 
00050 #ifndef __SPPlugs__
00051 #include "SPPlugs.h"
00052 #endif
00053 
00054 #include "AIHeaderBegin.h"
00055 
00060 /*******************************************************************************
00061  *
00062  *  Constants
00063  *
00064  */
00065 
00066 #define kPluginInterfaceVersion6001             0x06000001  // 6.0x1
00067 #define kPluginInterfaceVersion6002             0x06000020
00068 
00069 #define kPluginInterfaceVersion7001             0x07000001      // AI 7.0
00070 
00071 #define kPluginInterfaceVersion6021             0x06000021  // Joe's AI6-based prototype (only needed to run his plugins)
00072 #define kPluginInterfaceVersion8001             0x08000001      // AI 8.0
00073 #define kPluginInterfaceVersion9001             0x09000001      // AI 9.0
00074 #define kPluginInterfaceVersion10001    0x10000001      // AI 10.0
00075 #define kPluginInterfaceVersion11001    0x11000001      // AI 11.0
00076 #define kPluginInterfaceVersion12001    0x12000001      // AI 12.0
00077 #define kPluginInterfaceVersion13001    0x13000001      // AI 13.0
00078 #define kPluginInterfaceVersion14001    0x14000001      // AI 14.0
00079 #define kPluginInterfaceVersion15001    0x15000001      // AI 15.0
00080 #define kPluginInterfaceVersion16001    0x16000001      // AI 16.0
00081 #define kPluginInterfaceVersion17001    0x17000001      // AI 17.0
00082 #define kPluginInterfaceVersion17011    0x17000011      // AI 17.1
00083 #define kPluginInterfaceVersion18001    0x18000001      // AI 18.0
00084 #define kPluginInterfaceVersion18011    0x18000011      // AI 18.1
00085 #define kPluginInterfaceVersion19001    0x19000001      // AI 19.0
00086 #define kPluginInterfaceVersion19021    0x19000021      // AI 19.2
00087 #define kPluginInterfaceVersion20001    0x20000001      // AI 20.0
00088 #define kPluginInterfaceVersion20011    0x20000011      // AI 20.1
00089 #define kPluginInterfaceVersion21001    0x21000001      // AI 21.0
00090 
00091 #define kPluginInterfaceVersion                 kPluginInterfaceVersion21001
00092 
00093 
00094 #ifdef MAC_ENV
00095 #define AIAPI_VERSION(x) (x + 1000)
00096 #endif
00097 
00098 #ifdef WIN_ENV
00099 #define AIAPI_VERSION(x) (x)
00100 #endif
00101 
00102 #define kPlatformUnloadedSuiteProc      NULL
00103 
00104 #if !defined(__BUILD_PLUGIN__)
00105 #if defined(ILLUSTRATOR_H)
00106 #define __BUILD_PLUGIN__ 0
00107 #else
00108 #define __BUILD_PLUGIN__ 1
00109 #endif
00110 #endif
00111 
00112 //These are no longer needed.
00114 #define PUSH_GLOBALS
00115 
00116 #define POP_GLOBALS
00117 
00118 // Determine the platform.
00119 #if !defined(Macintosh)
00120 #if defined(MAC_ENV)
00121 #define Macintosh 1
00122 #endif
00123 #endif
00124 
00125 #if !defined(MSWindows)
00126 #if defined(WIN_ENV)
00127 #define MSWindows 1
00128 #endif
00129 #endif
00130 
00131 // Some common error codes.
00134 #define kCanceledErr                    'STOP'
00135 
00137 #define kNoDocumentErr                  'DOC?'
00138 
00140 #define kSelectorClashErr               'CLSH'
00141 
00143 #define kNameNotFoundErr                'NAM?'
00144 
00146 #define kNameInUseErr                   'NAM2'
00147 
00149 #define kInvalidNameErr                 'NA*!'
00150 
00152 #define kNameTooLongErr                 'NAL!'
00153 
00155 #define kUndoRedoErr                    'UND!'
00156 
00157 /*******************************************************************************
00158  *
00159  *  Types
00160  *
00161  */
00162 
00163 #define AIAPI ASAPI
00164 
00166 typedef struct ArtObject *AIArtHandle;
00167 typedef const struct ArtObject *ConstAIArtHandle;
00169 typedef struct _t_AILayerOpaque *AILayerHandle;
00171 typedef ASFixed AIFixed;
00173 typedef ASFract AIFract;
00175 typedef ai::uint32 AIUFract;
00177 typedef double AIReal, *AIRealPtr;
00179 typedef float AIFloat;
00181 typedef double AIDouble;
00183 typedef struct _t_AIStreamOpaque *AIStream;
00185 typedef ASFixedRect AIFixedRect;
00187 typedef ASFixedPoint AIFixedPoint;
00189 typedef ASFixedMatrix AIFixedMatrix;
00191 typedef struct _t_AIRealRect {
00192         AIReal left, top, right, bottom;
00193 } AIRealRect, *AIRealRectPtr;
00194 
00195 typedef struct _t_AIFloatRect {
00196         AIFloat left, top, right, bottom;
00197 } AIFloatRect, *AIFloatRectPtr;
00198 //typedef AIRealRect AIRealRect, *AIRealRectPtr;
00200 typedef struct _t_AIRealMatrix {
00201         AIReal a, b, c, d, tx, ty;
00203         void Init()
00204         {
00205                 a = 1.0; b = 0.0;
00206                 c = 0.0; d = 1.0;
00207                 tx = 0.0; ty = 0.0;
00208         }
00209 } AIRealMatrix, *AIRealMatrixPtr;
00210 
00211 //typedef struct _t_AIFloatMatrix {
00212 //      AIFloat a, b, c, d, tx, ty;
00213 //} AIFloatMatrix, *AIFloatMatrixPtr;
00214 
00215 typedef ASRealMatrix AIFloatMatrix;
00216 typedef struct _t_AIRealPoint {
00217         AIReal h, v;
00218 } AIRealPoint, *AIRealPointPtr;
00219 
00220 //typedef struct _t_AIFloatPoint {
00221 //      AIFloat h, v;
00222 //} AIFloatPoint, *AIFloatPointPtr;
00223 typedef ASRealPoint AIFloatPoint;// *AIRealPointPtr;
00224 
00227 //typedef AIRealMatrix AIRealMatrix, *AIRealMatrixPtr;
00229 typedef ASBoolean AIBoolean;
00231 typedef ASByte AIBool8;
00232 
00233 typedef ADMRect AIRect;
00234 
00235 typedef ADMPoint AIPoint;
00236 
00238 typedef struct _t_AIPlatformViewOpaque *AIPlatformViewRef;
00239 
00241 struct AIDoubleRect {
00242         AIDouble left, top, right, bottom;
00243 };
00244 
00245 #ifdef MAC_ENV
00246 
00247 typedef struct MacPort_t* AIPortRef;
00248 
00250 typedef struct MacWindow_t* AIWindowRef;
00251 
00253 typedef struct MacDialog_t* AIDialogRef;
00254 #endif
00255 
00256 #ifdef WIN_ENV
00257 
00258 typedef HDC AIPortRef;
00259 
00261 typedef HWND AIWindowRef;
00262 
00264 typedef HWND AIDialogRef;
00265 #endif
00266 
00268 // AIRGBColor is the same as Macintosh RGBColor on Macintosh and Windows.
00270 struct AIRGBColor {
00272         ai::uint16 red, green, blue;
00273 };
00274 
00278 typedef struct _t_AIEvent {
00280         unsigned short  what;
00282         unsigned long   message;
00284         unsigned long   when;
00286         AIPoint                 where;
00289         unsigned short  modifiers;
00290 } AIEvent;
00291 
00293 typedef ASErr AIErr;
00294 
00296 class ACEProfile;
00298 typedef ACEProfile *AIColorProfile;
00299 
00301 typedef ai::uint32 AICommandID;
00302 
00309 typedef const struct ZREFStruct *ZRef;
00310 #define ZREF(x) ((ZRef)(x))
00311 
00330 typedef enum AIPaintOrder {
00332         kPlaceDefault = 0,
00334         kPlaceAbove = 1,
00336         kPlaceBelow,
00338         kPlaceInsideOnTop,
00340         kPlaceInsideOnBottom,
00342         kPlaceAboveAll,
00344         kPlaceBelowAll
00345 } AIPaintOrder;
00346 
00348 typedef enum AIPaintUsage {
00349         kAINotUsed = 0x0000,
00351         kAIUsedOnFill = 0x0001,
00353         kAIUsedOnStroke = 0x0002,
00355         kAIUsedOnBoth = 0x0003
00356 } AIPaintUsage;
00357 
00365 namespace ai
00366 {
00367         typedef enum Quadrant {
00368                 kFirstQuadrant = 1,
00369                 kSecondQuadrant,
00370                 kThirdQuadrant,
00371                 kFourthQuadrant
00372         } Quadrant;
00373 }
00374 
00376 typedef enum AIVersion {
00377         kAIVersion1 = 1,
00378         kAIVersion88,
00379         kAIVersion3,
00380         kAIVersion4,
00381         kAIVersion5,
00382         kAIVersion6,
00383         kAIVersion7,
00384         kAIVersion8,
00385         kAIVersion9,
00386         kAIVersion10,
00387         kAIVersion11,
00388         kAIVersion12,
00389         kAIVersion13,
00390         kAIVersion14,
00391         kAIVersion15,
00392         kAIVersion16,
00393         kAIVersion17,
00394         kAIVersion18,
00395         kAIVersion19,
00396         kAIVersion20,
00397         kAIVersion21
00398 } AIVersion;
00399 
00401 typedef enum AIUnits {
00403         kAINoUnits = 0,
00405         kAIPointUnits = 1,
00407         kAIInchUnits = 2,
00409         kAIMillimeterUnits = 3,
00411         kAICentimeterUnits = 4,
00413         kAIPicaUnits = 5,
00415         kAIPercentUnits = 6,
00417         kAIDegreeUnits = 7,
00419         kAIQUnits = 8,
00421         kAIBase16Units = 9,
00423         kAIPixelUnits = 10,
00425         kAITimeUnits = 11,
00427         kAIMinNormalUnits = kAIPointUnits,
00429         kAIMaxNormalUnits = kAITimeUnits,
00430 
00432         kAIAppUnits1 = 101,
00434         kAIAppUnits2 = 102,
00436         kAIAppUnits3 = 103,
00438         kAIAppUnits4 = 104,
00440         kAIAppUnits5 = 105,
00442         kAIAppUnits6 = 106,
00444         kAIAppUnits7 = 107,
00446         kAIAppUnits8 = 108,
00448         kAIAppUnits9 = 109,
00450         kAIAppUnits10 = 110,
00452         kAIMaxAppUnits = kAIAppUnits10,
00453 
00455         kAIDummyUnits = 0xFFFFFFFF
00456 } AIUnits;
00457 
00458 typedef struct 
00459 {
00460         AIReal width;
00461         AIReal height;
00462 }AISize;
00463 
00464 #ifdef __cplusplus
00465 namespace ai {
00466 
00470 #define AINOTHROW
00471 
00472 
00474 class Error : public std::exception {
00475 public:
00476         Error (AIErr _err) : err(_err)
00477                 {}
00478         operator AIErr () const
00479                 {return err;}
00480 
00481 protected:
00482         AIErr err;
00483 };
00484 
00485 } // end namespace ai
00486 #endif
00487 
00488 
00489 #include "AIHeaderEnd.h"
00490 
00491 // Note:
00492 // 1) Functions which throw must be declared after the AIHeaderEnd.h inclusion
00493 //    as AIHeaderBegin puts everything into an extern C. You cannot declare a
00494 //    template to have 'C' linkage.
00495 // 2) Exceptions must not be thrown across the API boundary so be sure to catch
00496 //    any potential exceptions before exiting your plug-in.
00497 
00498 #ifdef __cplusplus
00499 namespace ai {
00500 
00505 inline void check_ai_error(AIErr err)
00506 {
00507         if (err != kNoErr)
00508                 throw ai::Error(err);
00509 }
00510 
00518 template <typename T>
00519 inline void check_precondition(T condition, AIErr err = kBadParameterErr)
00520 {
00521         if (!condition)
00522                 throw ai::Error(err);
00523 }
00524 
00534 template<bool> struct CompileTimeChecker
00535 {
00536         CompileTimeChecker(...);
00537 };
00539 template<> struct CompileTimeChecker<false> {};
00540 
00547 #define AI_STATIC_CHECK(expr, msg) \
00548 {\
00549         class ERROR_##msg {};\
00550         (void)sizeof(ai::CompileTimeChecker<(expr) != 0>((new ERROR_##msg())));\
00551 }
00552 
00553 } //end namespace ai
00554 #endif // __cplusplus 
00555 
00556 #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