Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreArtStyle.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_ART_STYLE__
8 #define __HDI_CORE_ART_STYLE__
9 
10 #include "hdicoreArtboardPoint.h"
11 #include "hdicoreLiveEffect.h"
12 #include "hdicorePathStyle.h"
13 #include "hdicoreTypes.h"
14 
15 namespace hdi
16 {
17  namespace plugin
18  {
19  class ArtStyle;
20  }
21 
22  namespace core
23  {
27  class ArtStyle
28  {
29  public:
30  class BlendField;
31  class Effect;
32  class PaintField;
33 
37  struct PaintData
38  {
44 
49 
54 
60 
65 
70 
76  PaintData();
77 
85  PaintData(const PaintData& pd_);
86 
92  virtual ~PaintData();
93 
103  PaintData& operator=(const PaintData& rhs_);
104  };
105 
106  typedef std::auto_ptr<PaintData> PaintDataAP;
107 
112  {
113  public:
125  BlendField();
126 
134  BlendField(const BlendField& bf_);
135 
141  virtual ~BlendField();
142 
152  BlendField& operator=(const BlendField& rhs_);
153 
162  bool isEmpty() const;
163 
172  bool isDefault() const;
173 
180  void setDefault();
181 
189  bool visible() const;
190 
199  void setVisible(const bool visible_);
200 
208  BlendMode mode() const;
209 
217  void setMode(const BlendMode mode_);
218 
227  double opacity() const;
228 
236  void setOpacity(const double o_);
237 
245  bool isolated() const;
246 
254  void setIsolated(const bool iso_);
255 
263  BlendKnockout knockout() const;
264 
272  void setKnockout(const BlendKnockout ko_);
273 
281  bool alphaIsShape() const;
282 
290  void setAlphaIsShape(const bool alpha_);
291 
292 
293  private:
294  friend class ArtStyle;
295  friend class PaintField;
296 
300  void* __data;
301  };
302 
303  typedef std::auto_ptr<BlendField> BlendFieldAP;
304 
313  class Effect
314  {
315  public:
327  Effect();
328 
336  Effect(const Effect& e_);
337 
343  virtual ~Effect();
344 
354  Effect& operator=(const Effect& rhs_);
355 
363  bool isEmpty() const;
364 
372  bool visible() const;
373 
381  void setVisible(const bool visible_);
382 
390  std::auto_ptr<LiveEffect> liveEffect() const;
391 
399  void setLiveEffect(const LiveEffect& le_);
400 
408  std::auto_ptr<LiveEffect::Parameters> parameters() const;
409 
417  void setParameters(const LiveEffect::Parameters& p_);
418 
419 
420  private:
421  friend class ArtStyle;
422  friend class PaintField;
423 
427  void* __data;
428  };
429 
430  typedef std::auto_ptr<Effect> EffectAP;
431 
437  {
438  public:
450  PaintField();
451 
459  PaintField(const PaintField& pf_);
460 
466  virtual ~PaintField();
467 
477  PaintField& operator=(const PaintField& rhs_);
478 
487  bool isEmpty() const;
488 
497  bool visible() const;
498 
508  void setVisible(const bool visible_);
509 
517  bool isFill() const;
518 
528  bool fill(FillStyle& fs__, PaintData& pd__);
529 
538  void setFill(const FillStyle& fs_, const PaintData& pd_);
539 
547  bool isStroke() const;
548 
558  bool stroke(StrokeStyle& ss__, PaintData& pd__);
559 
568  void setStroke(const StrokeStyle& ss_, const PaintData& pd_);
569 
578  int32_t colorPosition() const;
579 
588  void setColorPosition(const int32_t pos_);
589 
597  bool evenOdd() const;
598 
606  void setEvenOdd(const bool eo_);
607 
615  int32_t effectCount() const;
616 
625  std::auto_ptr<Effect> effectAtIndex(const int32_t index_) const;
626 
644 
654  void setLiveEffectInfo(const LiveEffect& le_, const LiveEffect::Parameters& p_);
655 
663  std::auto_ptr<BlendField> blend() const;
664 
665 
666  private:
667  friend class ArtStyle;
668 
672  void* __data;
673  };
674 
675  typedef std::auto_ptr<PaintField> PaintFieldAP;
676 
680  enum Type
681  {
682  UnknownType = 0,
683  SimpleType = 10, // Has only one fill and one stroke
684  ActiveType = 20 // Can have multiple fills and strokes
685  };
686 
691  {
692  NoAttributes = 0,
693  HasFillAttribute = 1 << 0,
694  HasStrokeAttribute = 1 << 1,
695  PatternsAttribute = 1 << 2,
696  CustomColorsAttribute = 1 << 3,
697  FillGradientsAttribute = 1 << 4,
698  FillRadialGradientsAttribute = 1 << 5,
699  StrokeGradientsAttribute = 1 << 6,
700  StrokeRadialGradientsAttribute = 1 << 7,
701  TransparencyAttribute = 1 << 8,
702  BrushesAttribute = 1 << 9,
703  EffectsAttribute = 1 << 10,
704  ScalableEffectsAttribute = 1 << 11
705  };
706 
716  ArtStyle();
717 
725  ArtStyle(const ArtStyle& a_);
726 
734  ArtStyle(const AIArtStyleHandle aiArtStyle_);
735 
741  virtual ~ArtStyle();
742 
751  virtual ArtStyle& operator=(const ArtStyle& rhs_);
752 
761  virtual bool operator==(const ArtStyle& rhs_) const;
762 
771  virtual bool operator!=(const ArtStyle& rhs_) const;
772 
784  virtual AIArtStyleHandle aiArtStyleHandle() const;
785 
793  virtual bool valid();
794 
802  virtual std::string name() const;
803 
811  virtual void setName(const std::string& name_);
812 
820  virtual bool isAnonymous() const;
821 
829  virtual Type styleType() const;
830 
838  virtual Attributes attributes() const;
839 
850  virtual bool visible() const;
851 
859  virtual bool hasFillOrStroke() const;
860 
868  virtual bool hasEffects() const;
869 
877  virtual bool hasTransparency() const;
878 
886  virtual int32_t paintFieldCount() const;
887 
896  virtual std::auto_ptr<PaintField> paintFieldAtIndex(const int32_t index_) const;
897 
909  virtual std::auto_ptr<PaintField> focusFill() const;
910 
922  virtual std::auto_ptr<PaintField> focusStroke() const;
923 
931  virtual int32_t preEffectCount() const;
932 
941  virtual std::auto_ptr<Effect> preEffectAtIndex(const int32_t index_) const;
942 
950  virtual int32_t postEffectCount() const;
951 
960  virtual std::auto_ptr<Effect> postEffectAtIndex(const int32_t index_) const;
961 
969  virtual std::auto_ptr<BlendField> blendField() const;
970 
971 
972  private:
973  friend plugin::ArtStyle* __accessImpl(const ArtStyle&);
974  friend ArtStyle __accessCtor(plugin::ArtStyle*&);
975 
979  void* __data;
980 
986  void* __impl() const;
987 
993  ArtStyle(plugin::ArtStyle*&);
994  };
995 
996  typedef std::auto_ptr<ArtStyle> ArtStyleAP;
997 
998  extern plugin::ArtStyle* __accessImpl(const ArtStyle&);
999  extern ArtStyle __accessCtor(plugin::ArtStyle*&);
1000  }
1001 }
1002 
1006 );
1007 
1011 );
1012 
1013 #endif
1014 // __HDI_CORE_ART_STYLE__
void setParameters(const LiveEffect::Parameters &p_)
Sets the live effect parameters object for the art style effect.
double fillGradientAspectRatio
The fill gradient aspect ratio, for radial gradients.
Definition: hdicoreArtStyle.h:53
virtual std::auto_ptr< Effect > preEffectAtIndex(const int32_t index_) const
Gets a pre-effect from the target style by position index.
Describes the parameters of an Illustrator live effect.
Definition: hdicoreLiveEffect.h:24
virtual ArtStyle & operator=(const ArtStyle &rhs_)
Overloaded ArtStyle assignment operator.
Describes blending info for an art style or paint field of an art style.
Definition: hdicoreArtStyle.h:111
double fillRelativeGradientLength
The fill gradient length, in points.
Definition: hdicoreArtStyle.h:48
void setVisible(const bool visible_)
Sets the visibility status of a blend field, which affects whether it is drawn. This is applied to al...
virtual ~ArtStyle()
Destructs an ArtStyle object.
Effect()
Constructs an empty Effect object.
std::auto_ptr< LiveEffect > liveEffect() const
Gets the live effect object for the art style effect.
void setFill(const FillStyle &fs_, const PaintData &pd_)
Sets fill information for a paint field.
void setIsolated(const bool iso_)
Sets the isolation state of a blend field.
virtual void setName(const std::string &name_)
Sets the name of the art style.
ArtStyle()
Constructs an empty ArtStyle object.
void setVisible(const bool visible_)
Sets the visibility status of blend of a paint field (fill/stroke), which affects whether the blend i...
PaintField()
Constructs an empty PaintField object.
std::auto_ptr< Effect > effectAtIndex(const int32_t index_) const
Gets a effect from a paint field by position index.
bool visible() const
Gets the visibility status of blend of a paint field (fill/stroke), which affects whether the blend i...
virtual std::auto_ptr< BlendField > blendField() const
Gets the overall art style transparency in the form of a blend field.
ArtboardPoint strokeRelativeGradientOrigin
The stroke gradient origin, relative to the bounding box of the object to which the style would be ap...
Definition: hdicoreArtStyle.h:59
BlendField()
Constructs an empty BlendField object.
PaintData & operator=(const PaintData &rhs_)
Overloaded assignment operator to copy data from the given PaintData object into the target...
Header file for Illustrator live effect manipulation.
bool isStroke() const
Reports whether a paint field corresponds to a stroke.
Effect & operator=(const Effect &rhs_)
Overloaded assignment operator to copy data from the given Effect object into the target...
virtual std::string name() const
Gets the name of the art style.
Definition: hdicoreLiveEffect.h:18
bool isEmpty() const
Gets whether the target PaintField object is empty (constructed with the default ctor) ...
bool stroke(StrokeStyle &ss__, PaintData &pd__)
Gets stroke information from a paint field.
virtual ~PaintData()
Destructs a PaintData object.
int32_t effectCount() const
Gets the number of effects in a paint field.
Describes the stroke styling of a path.
Definition: hdicorePathStyle.h:249
virtual ~BlendField()
Destructs a BlendField object.
void setEvenOdd(const bool eo_)
Sets the even-odd fill rule for a paint field.
virtual bool visible() const
Gets whether the style is visible.
bool isEmpty() const
Gets whether the target BlendField object is empty (constructed with the default ctor) ...
virtual ~Effect()
Destructs an Effect object.
void setMode(const BlendMode mode_)
Sets the blending mode of a blend field.
Attributes
Indicates the various attributes of an art style.
Definition: hdicoreArtStyle.h:690
virtual AIArtStyleHandle aiArtStyleHandle() const
Gets the art style handle around which the target object is wrapped.
PaintField & operator=(const PaintField &rhs_)
Overloaded assignment operator to copy data from the given PaintField object into the target...
bool isFill() const
Reports whether a paint field corresponds to a fill.
double strokeRelativeGradientLength
The stroke gradient length, in points.
Definition: hdicoreArtStyle.h:64
virtual Type styleType() const
Gets the type of the art style.
bool visible() const
Gets the visibility status of an effect, which affects whether it is drawn.
virtual Attributes attributes() const
Gets the attributes of the art style.
void setColorPosition(const int32_t pos_)
Sets the color position of a paint field (the point in effect order at which painting occurs) ...
bool alphaIsShape() const
Gets whether opacity and mask define the knockout shape.
virtual std::auto_ptr< PaintField > focusStroke() const
Gets the focus stroke from the target style.
void setLiveEffect(const LiveEffect &le_)
Sets the live effect object for the art style effect.
virtual bool valid()
Tests the validity of the target style by searching for it in the document.
void setVisible(const bool visible_)
Sets the visibility status of an effect, which affects whether it is drawn.
bool evenOdd() const
Gets the even-odd fill rule for a paint field.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
virtual bool operator==(const ArtStyle &rhs_) const
Tests whether a given ArtStyle object is the same as another.
virtual bool hasFillOrStroke() const
Gets whether the style has any fill or stroke.
Header file for path style-related classes.
Header file for geometric point manipulation on the Illustrator artboard.
void setLiveEffectInfo(const LiveEffect &le_, const LiveEffect::Parameters &p_)
Sets the live effect and/or parameter references for effects in a paint field that substitute for the...
Corresponds to either a fill or a stroke in an art style. Each paint field can also contain live effe...
Definition: hdicoreArtStyle.h:436
void setStroke(const StrokeStyle &ss_, const PaintData &pd_)
Sets stroke information for a paint field.
virtual std::auto_ptr< Effect > postEffectAtIndex(const int32_t index_) const
Gets a post-effect from the target style by position index.
BlendField & operator=(const BlendField &rhs_)
Overloaded assignment operator to copy data from the given BlendField object into the target...
Describes an art style.
Definition: hdicoreArtStyle.h:27
void setOpacity(const double o_)
Sets the opacity value of a blend field.
virtual int32_t postEffectCount() const
Gets the number of post-effects in the target style.
int32_t colorPosition() const
Gets the color position of a paint field (the point in effect order at which painting occurs) ...
Definition: hdicoreaiArray.h:12
virtual std::auto_ptr< PaintField > paintFieldAtIndex(const int32_t index_) const
Gets a paint field from the target style by position index.
ArtboardPoint fillRelativeGradientOrigin
The fill gradient origin, relative to the bounding box of the object to which the style would be appl...
Definition: hdicoreArtStyle.h:43
virtual int32_t paintFieldCount() const
Gets the number of paint fields in the target style.
Effects are contained by art styles and are used to replace typical fill/stroke drawing.
Definition: hdicoreArtStyle.h:313
PaintData()
Constructs a new PaintData object with default values.
Stores art style gradient information.
Definition: hdicoreArtStyle.h:37
virtual bool operator!=(const ArtStyle &rhs_) const
Tests whether a given ArtStyle object is not the same as another.
std::auto_ptr< LiveEffect::Parameters > parameters() const
Gets the live effect parameters object for the art style effect.
bool isDefault() const
Gets whether a blend field is a default blend; that is, normal 100% opacity with non-isolated blendin...
BlendKnockout knockout() const
Retrieves the knockout setting of a blend field.
bool isEmpty() const
Gets whether the target Effect object is empty (constructed with the default ctor) ...
bool isolated() const
Gets the isolation state of a blend field.
bool liveEffectInfo(LiveEffect &le__, LiveEffect::Parameters &p__)
Retrieves live effect and/or parameter objects for effects in a paint field that substitute for the b...
virtual bool hasEffects() const
Gets whether the style has any live effects.
bool fill(FillStyle &fs__, PaintData &pd__)
Gets fill information from a paint field.
double opacity() const
Retrieves the opacity value of a blend field.
virtual int32_t preEffectCount() const
Gets the number of pre-effects in the target style.
virtual ~PaintField()
Destructs a PaintField object.
virtual bool hasTransparency() const
Gets whether the style has any transparency.
std::auto_ptr< BlendField > blend() const
Gets the blend field for the paint field.
bool visible() const
Gets the visibility status of a blend field, which affects whether it is drawn.
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:28
Type
Indicates the type of an art style.
Definition: hdicoreArtStyle.h:680
virtual bool isAnonymous() const
Gets whether an art style is anonymous (named art styles appear in the styles panel) ...
void setAlphaIsShape(const bool alpha_)
Sets whether opacity and mask define the knockout shape.
void setDefault()
Sets a blend field to a default blend; that is, normal 100% opacity with non-isolated blending and th...
Describes the fill styling of a path.
Definition: hdicorePathStyle.h:140
double strokeGradientAspectRatio
The stroke gradient aspect ratio, for radial gradients.
Definition: hdicoreArtStyle.h:69
void setKnockout(const BlendKnockout ko_)
Sets the knockout setting of a blend field.
virtual std::auto_ptr< PaintField > focusFill() const
Gets the focus fill from the target style.
BlendMode mode() const
Retrieves the blending mode of a blend field.