/* This file is part of tooldemo, a sample Tool plugin for Adobe Illustrator Copyright (C) 2002-4 Toby Thain, toby@telegraphics.com.au This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef RC_INVOKED #ifndef REZ // ---- includes #include // must be first, or MacTypes.h chokes on Boolean enum #include #include "AIBlock.h" #include "AIFilter.h" #include "AIMatchingArt.h" #include "AIFixedMath.h" #include "AIArt.h" #include "AIPath.h" #include "AIPathStyle.h" #include "AIMdMemory.h" #include "AITool.h" #include "AIUndo.h" #ifdef ATETEXT #include "AITextFrame.h" #else #include "AIText.h" #include "AITextRun.h" #include "AITextPath.h" #include "AITextStream.h" #endif #include "ADMBasic.h" //#include "ADMDialog.h" #include "ADMIcon.h" #include "dbg.h" // ---- API-version dependent stuff #ifdef kAIRealMathSuite // AI 8.0 or later #include "AIRealMath.h" typedef AIRealPoint AIPOINT; typedef AIReal AINUMBER; typedef AIRealMatrix AIMATRIX; #define ONECONSTANT kAIRealOne #define TOFLOAT // convert component of pt to floating point (null op) #define TONUMBER // convert floating argument to NUMBER #define LENGTH sRealMath->AIRealLength #define POINTCLOSE sRealMath->AIRealPointClose #define PRODUCT(a,b) ((a)*(b)) #define QUOTIENT(a,b) ((a)/(b)) #define MATRIXSETTRANSLATE sRealMath->AIRealMatrixSetTranslate #define MATRIXCONCATROTATE sRealMath->AIRealMatrixConcatRotate #define MATRIXSETROTATE sRealMath->AIRealMatrixSetRotate #define MATRIXCONCATTRANSLATE sRealMath->AIRealMatrixConcatTranslate #define DEGREETORADIAN sRealMath->DegreeToRadian #else typedef AIFixedPoint AIPOINT; typedef AIFixed AINUMBER; typedef AIFixedMatrix AIMATRIX; #define ONECONSTANT kFixedOne #define TOFLOAT sMath->FixedToFloat // convert component of pt to floating point #define TONUMBER sMath->FloatToFixed // convert floating argument to NUMBER #define LENGTH sMath->FixedLength #define POINTCLOSE sMath->FixedPointClose #define PRODUCT sMath->FixedMul #define QUOTIENT sMath->FixedDiv #define MATRIXSETTRANSLATE sMath->FixedMatrixSetTranslate #define MATRIXCONCATROTATE sMath->FixedMatrixConcatRotate #define MATRIXSETROTATE sMath->FixedMatrixSetRotate #define MATRIXCONCATTRANSLATE sMath->FixedMatrixConcatTranslate #define DEGREETORADIAN sMath->DegreeToRadian #endif #ifndef EXTERN #define EXTERN extern #endif EXTERN AIBlockSuite *sBlock; EXTERN AIMatchingArtSuite *sMatch; EXTERN AIFixedMathSuite *sMath; #ifdef kAIRealMathSuite EXTERN AIRealMathSuite *sRealMath; #endif EXTERN AIArtSuite *sArt; EXTERN AIPathSuite *sPath; EXTERN AIPathStyleSuite *sPathStyle; EXTERN AIMdMemorySuite *sMdMemory; EXTERN AIToolSuite *sTool; EXTERN AIUndoSuite *sUndo; EXTERN ADMIconSuite *sADMIcon; EXTERN SPAccessSuite *sSPAccess; EXTERN ADMBasicSuite *sADMBasic; #ifdef ATETEXT EXTERN AITextFrameSuite *sAITextFrame; #else EXTERN AITextSuite *sText; EXTERN AITextRunSuite *sTextRun; EXTERN AITextPathSuite *sTextPath; EXTERN AITextStreamSuite *sTextStream; #endif void plot_point(AIPOINT *p,float x,float y); AIErr plot_graph(AIPOINT *p0,AIPOINT *p1); AIErr new_path(AIPathSegment *segs,long count,AIPathStyle *style); AIErr new_text(AINUMBER tx,AINUMBER ty,float angledeg,char *str); AIErr acquire_suites( SPMessageData *m ); AIErr release_suites( SPMessageData *m ); AIErr addTool( SPInterfaceMessage *message ); AIErr toolOptions( AIToolMessage *message ); AIErr toolTrackCursor( AIToolMessage *message ); AIErr toolMouseDown( AIToolMessage *message ); AIErr toolMouseDrag( AIToolMessage *message ); AIErr toolMouseUp( AIToolMessage *message ); AIErr toolSelect( AIToolMessage *message ); AIErr toolDeselect( AIToolMessage *message ); AIErr toolValidate( AIToolMessage *message ); #define kNoIconErr '!ico' #endif #endif #define ID_TOOL_ICON 16000