00001 #ifndef __AIPathStyle__
00002 #define __AIPathStyle__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __AITypes__
00030 #include "AITypes.h"
00031 #endif
00032
00033 #ifndef __AIArt__
00034 #include "AIArt.h"
00035 #endif
00036
00037 #ifndef __AIColor__
00038 #include "AIColor.h"
00039 #endif
00040
00041 #ifndef __AIDocument__
00042 #include "AIDocument.h"
00043 #endif
00044
00045 #ifndef __AIRealMath__
00046 #include "AIRealMath.h"
00047 #endif
00048
00049 #ifndef __AIEntry__
00050 #include "AIEntry.h"
00051 #endif
00052
00053 #include "IAIFilePath.hpp"
00054
00055 #include "AIHeaderBegin.h"
00056
00060
00061
00062
00063
00064
00065
00066 #define kAIPathStyleSuite "AI Path Style Suite"
00067 #define kAIPathStyleSuiteVersion14 AIAPI_VERSION(14)
00068 #define kAIPathStyleSuiteVersion kAIPathStyleSuiteVersion14
00069 #define kAIPathStyleVersion kAIPathStyleSuiteVersion
00070
00072 #define kMaxDashComponents 6
00073
00075 enum AILineCap {
00077 kAIButtCap = 0,
00079 kAIRoundCap,
00081 kAIProjectingCap
00082 };
00083
00085 enum AILineJoin {
00087 kAIMiterJoin = 0,
00089 kAIRoundJoin,
00091 kAIBevelJoin
00092 };
00093
00096 #define kAIBeginImportStylesNotifier "AI Begin Import Styles Notifier"
00097
00099 #define kAIEndImportStylesNotifier "AI End Import Styles Notifier"
00100
00101
00104 #define kTooManyDashComponents 'DASH'
00105
00107 #define kCantImportStyles '!Imp'
00108
00109
00110
00111
00112
00113
00114
00115
00119 struct AIFillStyle {
00121 AIColor color;
00124 AIBoolean overprint;
00125 void Init()
00126 {
00127 overprint = false;
00128 color.Init();
00129 }
00130 };
00131
00135 struct AIFillStyleMap {
00136 AIColorMap color;
00137 AIBoolean overprint;
00138 void Init()
00139 {
00140 overprint = false;
00141 color.Init();
00142 }
00143 };
00144
00149 struct AIDashStyle {
00151 ai::int16 length;
00153 AIFloat offset;
00155 AIFloat array[kMaxDashComponents];
00156 void Init()
00157 {
00158 length = 0;
00159 offset = kAIRealZero;
00160 }
00161 };
00162
00166 struct AIDashStyleMap {
00167 AIBoolean length;
00168 AIBoolean offset;
00169 AIBoolean array[kMaxDashComponents];
00170 void Init()
00171 {
00172 length = false;
00173 offset = false;
00174 }
00175 };
00176
00180 struct AIStrokeStyle {
00182 AIColor color;
00184 AIBoolean overprint;
00186 AIReal width;
00188 struct AIDashStyle dash;
00190 enum AILineCap cap;
00192 enum AILineJoin join;
00194 AIReal miterLimit;
00195
00196 void Init()
00197 {
00198 overprint = false;
00199 width = kAIRealZero;
00200 dash.Init();
00201 color.Init();
00202 cap = kAIButtCap;
00203 join = kAIMiterJoin;
00204 miterLimit = kAIRealZero;
00205 }
00206
00207 };
00208
00211 struct AIStrokeStyleMap {
00212 AIColorMap color;
00213 AIBoolean overprint;
00214 AIBoolean width;
00215 struct AIDashStyleMap dash;
00216 AIBoolean cap;
00217 AIBoolean join;
00218 AIBoolean miterLimit;
00219 void Init()
00220 {
00221 overprint = false;
00222 width = false;
00223 dash.Init();
00224 cap = false;
00225 join = false;
00226 miterLimit = false;
00227 color.Init();
00228 }
00229 };
00230
00244 struct AIPathStyle {
00246 AIBoolean fillPaint;
00248 AIBoolean strokePaint;
00250 struct AIFillStyle fill;
00252 struct AIStrokeStyle stroke;
00255 AIBoolean clip;
00258 AIBoolean lockClip;
00260 AIBoolean evenodd;
00262 AIReal resolution;
00263 void Init()
00264 {
00265 fillPaint = false;
00266 strokePaint = false;
00267 fill.Init();
00268 stroke.Init();
00269 clip = false;
00270 lockClip = false;
00271 evenodd = false;
00272 resolution = 800.0;
00273 }
00274 };
00275
00278 struct AIPathStyleMap {
00279 AIBoolean fillPaint;
00280 AIBoolean strokePaint;
00281 struct AIFillStyleMap fill;
00282 struct AIStrokeStyleMap stroke;
00283 AIBoolean clip;
00284 AIBoolean lockClip;
00285 AIBoolean evenodd;
00286 AIBoolean resolution;
00287 void Init()
00288 {
00289 fillPaint = false;
00290 strokePaint = false;
00291 fill.Init();
00292 stroke.Init();
00293 clip = false;
00294 lockClip = false;
00295 evenodd = false;
00296 resolution = false;
00297 }
00298 };
00299
00300
00301
00302
00303
00304
00305
00306
00314 struct AIPathStyleSuite {
00315
00323 AIAPI AIErr (*GetPathStyle) ( AIArtHandle path, AIPathStyle *style, AIBoolean *outHasAdvFill );
00324
00344 AIAPI AIErr (*SetPathStyle) ( AIArtHandle path, const AIPathStyle *style );
00345
00346
00356 AIAPI AIErr (*GetCurrentPathStyle) ( AIPathStyle *style, AIPathStyleMap *stylemap, AIDictionaryRef *advStrokeParams, AIBoolean *outHasAdvFill);
00357
00372 AIAPI AIErr (*SetCurrentPathStyle) ( AIPathStyle *style, AIPathStyleMap *stylemap, ConstAIDictionaryRef advStrokeParams );
00373
00381 AIAPI AIErr (*ImportStyles) ( const ai::FilePath &source, AIDocumentHandle *newdoc );
00382
00390 AIAPI AIErr (*ImportStylesMixedColorSpace) ( const ai::FilePath &source, AIDocumentHandle *newdoc );
00391
00406 AIAPI AIErr (*SetObjectAIColor) ( AIArtHandle art, const AIColor *color, AIBoolean onStroke );
00407
00420 AIAPI AIErr (*PathStyleUsesAIColor) ( const AIPathStyle *pathStyle,
00421 const AIPathStyleMap *psMap,
00422 const AIColor *color,
00423 AIBoolean matchTint,
00424 AIBoolean lookForIndirectUsage,
00425 AIColorUsedHow *usage );
00426
00456 AIAPI AIErr (*ApplyAIColorToPathStyle) ( AIPathStyle *pathStyle,
00457 AIPathStyleMap *psMap,
00458 const AIColor *newColor,
00459 const AIColor *matchColor,
00460 AIBoolean onStroke,
00461 AIBoolean useOldTint,
00462 AIArtHandle destination,
00463 AIColorUsedHow *whatChanged );
00464
00476 AIAPI AIErr (*ObjectUsesAIColor) ( AIArtHandle art,
00477 const AIColor *targetColor,
00478 AIBoolean matchTint,
00479 AIBoolean lookForIndirectUsage,
00480 AIColorUsedHow *usage );
00481
00505 AIAPI AIErr (*ReplaceObjectAIColor) ( AIArtHandle art,
00506 const AIColor *oldColor, const AIColor *newColor,
00507 AIBoolean useOldTint,
00508 AIBoolean *madeReplacement );
00509
00514 AIAPI AIErr (*GetInitialPathStyle) ( AIPathStyle *style );
00515
00520 AIAPI AIErr (*SetInitialPathStyle) ( const AIPathStyle *style );
00521
00525 AIAPI AIErr (*GetInitialTextStyle) ( AIPathStyle *style );
00526
00530 AIAPI AIErr (*SetInitialTextStyle) ( const AIPathStyle *style );
00531
00537 AIAPI AIErr (*RetargetForCurrentDoc) ( AIColor *color) ;
00538
00551 AIAPI AIErr (*SetCurrentPathStyleForceSimple) ( AIPathStyle *style, AIPathStyleMap* stylemap );
00552
00561 AIAPI AIErr (*SetPathStyleForceSimple) ( AIArtHandle path, const AIPathStyle *style );
00562
00571 AIAPI AIErr (*InterpolatePathStyle) ( const AIPathStyle *style0, const AIPathStyle *style1,
00572 AIPathStyle *styleOut, AIReal percent);
00573
00582 AIAPI AIErr (*InterpolateAIColor) ( const AIColor *color0, const AIColor *color1, AIColor *colorOut,
00583 AIReal fraction );
00584
00585
00586
00609 AIAPI AIErr (*SetSyncInitialPathStyle) ( AIBoolean syncInitialPathStyle );
00610
00616 AIAPI AIBoolean (*GetSyncInitialPathStyle)();
00617
00618
00619
00634 AIAPI AIErr (*AdjustObjectAIColors) ( AIArtHandle art,
00635 AIAdjustColorFunc adjustColorCallback, void *clientData,
00636 VisitAIColorFlags controlFlags,
00637 AIBoolean *madeReplacement );
00638
00648 AIAPI AIErr (*GetPathStyleEx) ( AIArtHandle path, AIPathStyle *style, AIBoolean* fillVisible, AIBoolean* strokeVisible );
00649
00650
00670 AIAPI AIErr (*SetPathStyleEx) ( AIArtHandle path, const AIPathStyle *style, AIBoolean fillVisible, AIBoolean strokeVisible );
00671
00672
00679 AIAPI AIErr (*GetCurrentPathStyleEx) ( AIPathStyle *style, AIPathStyleMap* stylemap, AIBoolean* fillVisible, AIBoolean* strokeVisible );
00680
00695 AIAPI AIErr (*SetCurrentPathStyleEx) ( AIPathStyle *style, AIPathStyleMap* stylemap, AIBoolean fillVisible, AIBoolean strokeVisible );
00696
00697 };
00698
00699
00700 #include "AIHeaderEnd.h"
00701
00702 #endif