Adobe.com
Contents Suites Classes Class Index Member Index

AIPathStyle.h

Go to the documentation of this file.
00001 #ifndef __AIPathStyle__
00002 #define __AIPathStyle__
00003 
00004 /*
00005  *        Name: AIPathStyle.h
00006  *      Author:
00007  *        Date:
00008  *     Purpose: Adobe Illustrator Path Style Suite.
00009  *
00010  * ADOBE SYSTEMS INCORPORATED
00011  * Copyright 1986-2007 Adobe Systems Incorporated.
00012  * All rights reserved.
00013  *
00014  * NOTICE:  Adobe permits you to use, modify, and distribute this file
00015  * in accordance with the terms of the Adobe license agreement
00016  * accompanying it. If you have received this file from a source other
00017  * than Adobe, then your use, modification, or distribution of it
00018  * requires the prior written permission of Adobe.
00019  *
00020  */
00021 
00022 
00023 /*******************************************************************************
00024  **
00025  **     Imports
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  **     Constants
00063  **
00064  **/
00065 
00066 #define kAIPathStyleSuite                       "AI Path Style Suite"
00067 #define kAIPathStyleSuiteVersion13      AIAPI_VERSION(13)
00068 #define kAIPathStyleSuiteVersion        kAIPathStyleSuiteVersion13
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  **     Types
00113  **
00114  **/
00115 
00119 struct AIFillStyle {
00121         AIColor color;
00124         AIBoolean overprint;
00125         void Init()
00126         {
00127                 overprint = false;
00128                 color.kind = kNoneColor;
00129         }
00130 };
00131 
00135 struct AIFillStyleMap {
00136         AIColorMap color;
00137         AIBoolean overprint;
00138         void Init()
00139         {
00140                 overprint = false;
00141                 color.kind = false;
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.kind = kNoneColor;
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.kind = false;
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  **     Suite
00304  **
00305  **/
00306 
00314 struct AIPathStyleSuite {
00315 
00322         AIAPI AIErr (*GetPathStyle) ( AIArtHandle path, AIPathStyle *style );
00323 
00343         AIAPI AIErr (*SetPathStyle) ( AIArtHandle path, const AIPathStyle *style );
00344 
00345 
00354         AIAPI AIErr (*GetCurrentPathStyle) ( AIPathStyle *style, AIPathStyleMap *stylemap, AIDictionaryRef *advStrokeParams );
00355 
00370         AIAPI AIErr (*SetCurrentPathStyle) ( AIPathStyle *style, AIPathStyleMap *stylemap, ConstAIDictionaryRef advStrokeParams );
00371 
00379         AIAPI AIErr (*ImportStyles) ( const ai::FilePath &source, AIDocumentHandle *newdoc );
00380 
00388         AIAPI AIErr (*ImportStylesMixedColorSpace) ( const ai::FilePath &source, AIDocumentHandle *newdoc );
00389 
00404         AIAPI AIErr (*SetObjectAIColor) ( AIArtHandle art, const AIColor *color, AIBoolean onStroke );
00405 
00418         AIAPI AIErr (*PathStyleUsesAIColor) ( const AIPathStyle *pathStyle,
00419                                                                                         const AIPathStyleMap *psMap,
00420                                                                                         const AIColor *color,
00421                                                                                         AIBoolean matchTint,
00422                                                                                         AIBoolean lookForIndirectUsage,
00423                                                                                         AIColorUsedHow *usage );
00424 
00454         AIAPI AIErr (*ApplyAIColorToPathStyle) ( AIPathStyle *pathStyle,
00455                                                                                         AIPathStyleMap  *psMap, // can be null
00456                                                                                         const AIColor   *newColor,
00457                                                                                         const AIColor   *matchColor,
00458                                                                                         AIBoolean               onStroke,
00459                                                                                         AIBoolean               useOldTint,
00460                                                                                         AIArtHandle             destination,
00461                                                                                         AIColorUsedHow  *whatChanged );
00462 
00474         AIAPI AIErr (*ObjectUsesAIColor) ( AIArtHandle art,
00475                                                                                 const AIColor *targetColor,
00476                                                                                 AIBoolean matchTint,
00477                                                                                 AIBoolean lookForIndirectUsage,
00478                                                                                 AIColorUsedHow *usage );
00479 
00503         AIAPI AIErr (*ReplaceObjectAIColor) ( AIArtHandle art,
00504                                                                                         const AIColor *oldColor, const AIColor *newColor,
00505                                                                                         AIBoolean useOldTint,
00506                                                                                         AIBoolean *madeReplacement /* can be NULL */ );
00507 
00512         AIAPI AIErr (*GetInitialPathStyle) ( AIPathStyle *style );
00513 
00518         AIAPI AIErr (*SetInitialPathStyle) ( const AIPathStyle *style );
00519 
00523         AIAPI AIErr (*GetInitialTextStyle) ( AIPathStyle *style );
00524 
00528         AIAPI AIErr (*SetInitialTextStyle) ( const AIPathStyle *style );
00529 
00535         AIAPI AIErr (*RetargetForCurrentDoc) ( AIColor *color) ;
00536 
00549         AIAPI AIErr (*SetCurrentPathStyleForceSimple) ( AIPathStyle *style, AIPathStyleMap* stylemap );
00550 
00559         AIAPI AIErr (*SetPathStyleForceSimple) ( AIArtHandle path, const AIPathStyle *style );
00560 
00569         AIAPI AIErr (*InterpolatePathStyle) ( const AIPathStyle *style0, const AIPathStyle *style1,
00570                 AIPathStyle *styleOut, AIReal percent);
00571 
00580         AIAPI AIErr (*InterpolateAIColor) ( const AIColor *color0, const AIColor *color1, AIColor *colorOut,
00581                                                                                 AIReal fraction );
00582 
00583         // New for AI12:
00584 
00607         AIAPI AIErr (*SetSyncInitialPathStyle) ( AIBoolean syncInitialPathStyle );
00608 
00614         AIAPI AIBoolean (*GetSyncInitialPathStyle)();
00615 
00616         // New for AI 13:
00617 
00632         AIAPI AIErr (*AdjustObjectAIColors) ( AIArtHandle art,
00633                                 AIAdjustColorFunc adjustColorCallback, void *clientData,
00634                                 VisitAIColorFlags controlFlags,
00635                                 AIBoolean *madeReplacement );
00636 
00646         AIAPI AIErr (*GetPathStyleEx) ( AIArtHandle path, AIPathStyle *style, AIBoolean* fillVisible, AIBoolean* strokeVisible );
00647 
00648 
00668         AIAPI AIErr (*SetPathStyleEx) ( AIArtHandle path, const AIPathStyle *style, AIBoolean fillVisible, AIBoolean strokeVisible );
00669 
00670 
00677         AIAPI AIErr (*GetCurrentPathStyleEx) ( AIPathStyle *style, AIPathStyleMap* stylemap, AIBoolean* fillVisible, AIBoolean* strokeVisible );
00678 
00693         AIAPI AIErr (*SetCurrentPathStyleEx) ( AIPathStyle *style, AIPathStyleMap* stylemap, AIBoolean fillVisible, AIBoolean strokeVisible );
00694 
00695 };
00696 
00697 
00698 #include "AIHeaderEnd.h"
00699 
00700 #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