Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreArtStyle.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_ART_STYLE__
8#define __HDI_CORE_ART_STYLE__
9
10#if defined(HDI_CORE_AIP_MODE)
11
13#include "hdicoreLiveEffect.h"
14#include "hdicorePathStyle.h"
15#include "hdicoreTypes.h"
16
17namespace hdi
18{
19 namespace aip
20 {
21 class ArtStyle;
22 }
23
24 namespace core
25 {
30 {
31 public:
32 class BlendField;
33 class Effect;
34 class PaintField;
35
39 struct PaintData
40 {
46
51
56
62
67
72
79
87 PaintData(const PaintData& pd_);
88
94 virtual ~PaintData();
95
106 };
107
108 typedef std::unique_ptr<PaintData> PaintDataUP;
109 typedef std::shared_ptr<PaintData> PaintDataSP;
110 typedef std::weak_ptr<PaintData> PaintDataWP;
111
116 {
117 public:
130
139
145 virtual ~BlendField();
146
157
166 bool isEmpty() const;
167
176 bool isDefault() const;
177
185
193 bool visible() const;
194
203 void setVisible(const bool visible_);
204
213
221 void setMode(const BlendMode mode_);
222
231 double opacity() const;
232
240 void setOpacity(const double o_);
241
249 bool isolated() const;
250
258 void setIsolated(const bool iso_);
259
268
276 void setKnockout(const BlendKnockout ko_);
277
285 bool alphaIsShape() const;
286
294 void setAlphaIsShape(const bool alpha_);
295
296
297 private:
298 friend class ArtStyle;
299 friend class PaintField;
300
304 void* __data;
305 };
306
307 typedef std::unique_ptr<BlendField> BlendFieldUP;
308 typedef std::shared_ptr<BlendField> BlendFieldSP;
309 typedef std::weak_ptr<BlendField> BlendFieldWP;
310
319 class Effect
320 {
321 public:
334
342 Effect(const Effect& e_);
343
349 virtual ~Effect();
350
360 Effect& operator=(const Effect& rhs_);
361
369 bool isEmpty() const;
370
378 bool visible() const;
379
387 void setVisible(const bool visible_);
388
396 std::unique_ptr<LiveEffect> liveEffect() const;
397
405 void setLiveEffect(const LiveEffect& le_);
406
414 std::unique_ptr<LiveEffect::Parameters> parameters() const;
415
424
425
426 private:
427 friend class ArtStyle;
428 friend class PaintField;
429
433 void* __data;
434 };
435
436 typedef std::unique_ptr<Effect> EffectUP;
437 typedef std::shared_ptr<Effect> EffectSP;
438 typedef std::weak_ptr<Effect> EffectWP;
439
445 {
446 public:
459
468
474 virtual ~PaintField();
475
486
495 bool isEmpty() const;
496
505 bool visible() const;
506
516 void setVisible(const bool visible_);
517
525 bool isFill() const;
526
536 bool fill(FillStyle& fs__, PaintData& pd__);
537
546 void setFill(const FillStyle& fs_, const PaintData& pd_);
547
555 bool isStroke() const;
556
566 bool stroke(StrokeStyle& ss__, PaintData& pd__);
567
576 void setStroke(const StrokeStyle& ss_, const PaintData& pd_);
577
586 int32_t colorPosition() const;
587
596 void setColorPosition(const int32_t pos_);
597
605 bool evenOdd() const;
606
614 void setEvenOdd(const bool eo_);
615
623 int32_t effectCount() const;
624
633 std::unique_ptr<Effect> effectAtIndex(const int32_t index_) const;
634
652
663
671 std::unique_ptr<BlendField> blend() const;
672
673
674 private:
675 friend class ArtStyle;
676
680 void* __data;
681 };
682
683 typedef std::unique_ptr<PaintField> PaintFieldUP;
684 typedef std::shared_ptr<PaintField> PaintFieldSP;
685 typedef std::weak_ptr<PaintField> PaintFieldWP;
686
690 enum Type
691 {
692 UnknownType = 0,
693 SimpleType = 10, // Has only one fill and one stroke
694 ActiveType = 20 // Can have multiple fills and strokes
695 };
696
701 {
702 NoAttributes = 0,
703 HasFillAttribute = 1 << 0,
704 HasStrokeAttribute = 1 << 1,
705 PatternsAttribute = 1 << 2,
706 CustomColorsAttribute = 1 << 3,
707 FillGradientsAttribute = 1 << 4,
708 FillRadialGradientsAttribute = 1 << 5,
709 StrokeGradientsAttribute = 1 << 6,
710 StrokeRadialGradientsAttribute = 1 << 7,
711 TransparencyAttribute = 1 << 8,
712 BrushesAttribute = 1 << 9,
713 EffectsAttribute = 1 << 10,
714 ScalableEffectsAttribute = 1 << 11
715 };
716
727
735 ArtStyle(const ArtStyle& a_);
736
744 ArtStyle(const AIArtStyleHandle aiArtStyle_);
745
751 virtual ~ArtStyle();
752
761 virtual ArtStyle& operator=(const ArtStyle& rhs_);
762
771 virtual bool operator==(const ArtStyle& rhs_) const;
772
781 virtual bool operator!=(const ArtStyle& rhs_) const;
782
794 virtual AIArtStyleHandle aiArtStyleHandle() const;
795
803 virtual bool valid();
804
812 virtual std::string name() const;
813
821 virtual void setName(const std::string& name_);
822
830 virtual bool isAnonymous() const;
831
839 virtual Type styleType() const;
840
848 virtual Attributes attributes() const;
849
860 virtual bool visible() const;
861
869 virtual bool hasFillOrStroke() const;
870
878 virtual bool hasEffects() const;
879
887 virtual bool hasTransparency() const;
888
896 virtual int32_t paintFieldCount() const;
897
906 virtual std::unique_ptr<PaintField> paintFieldAtIndex(const int32_t index_) const;
907
919 virtual std::unique_ptr<PaintField> focusFill() const;
920
932 virtual std::unique_ptr<PaintField> focusStroke() const;
933
941 virtual int32_t preEffectCount() const;
942
951 virtual std::unique_ptr<Effect> preEffectAtIndex(const int32_t index_) const;
952
960 virtual int32_t postEffectCount() const;
961
970 virtual std::unique_ptr<Effect> postEffectAtIndex(const int32_t index_) const;
971
979 virtual std::unique_ptr<BlendField> blendField() const;
980
981
982 private:
983 friend aip::ArtStyle* __accessImpl(const ArtStyle&);
984 friend ArtStyle __accessCtor(aip::ArtStyle*&);
985
989 void* __data;
990
996 void* __impl() const;
997
1003 ArtStyle(aip::ArtStyle*&);
1004 };
1005
1006 typedef std::unique_ptr<ArtStyle> ArtStyleUP;
1007 typedef std::shared_ptr<ArtStyle> ArtStyleSP;
1008 typedef std::weak_ptr<ArtStyle> ArtStyleWP;
1009
1010 extern aip::ArtStyle* __accessImpl(const ArtStyle&);
1011 extern ArtStyle __accessCtor(aip::ArtStyle*&);
1012 }
1013}
1014
1018);
1019
1023);
1024
1025#endif
1026// HDI_CORE_AIP_MODE
1027
1028#endif
1029// __HDI_CORE_ART_STYLE__
Describes blending info for an art style or paint field of an art style.
Definition: hdicoreArtStyle.h:116
BlendField(const BlendField &bf_)
Constructs a new BlendField object from another existing object.
void setMode(const BlendMode mode_)
Sets the blending mode of a blend field.
double opacity() const
Retrieves the opacity value of a blend field.
virtual ~BlendField()
Destructs a BlendField object.
BlendKnockout knockout() const
Retrieves the knockout setting of a blend field.
void setIsolated(const bool iso_)
Sets the isolation state of a blend field.
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...
bool isEmpty() const
Gets whether the target BlendField object is empty (constructed with the default ctor)
void setOpacity(const double o_)
Sets the opacity value of a blend field.
BlendField()
Constructs an empty BlendField object.
bool visible() const
Gets the visibility status of a blend field, which affects whether it is drawn.
bool isolated() const
Gets the isolation state of a blend field.
void setVisible(const bool visible_)
Sets the visibility status of a blend field, which affects whether it is drawn. This is applied to al...
BlendMode mode() const
Retrieves the blending mode of a blend field.
void setKnockout(const BlendKnockout ko_)
Sets the knockout setting of a blend field.
BlendField & operator=(const BlendField &rhs_)
Overloaded assignment operator to copy data from the given BlendField object into the target.
bool alphaIsShape() const
Gets whether opacity and mask define the knockout shape.
bool isDefault() const
Gets whether a blend field is a default blend; that is, normal 100% opacity with non-isolated blendin...
Effects are contained by art styles and are used to replace typical fill/stroke drawing.
Definition: hdicoreArtStyle.h:320
std::unique_ptr< LiveEffect > liveEffect() const
Gets the live effect object for the art style effect.
virtual ~Effect()
Destructs an Effect object.
Effect(const Effect &e_)
Constructs a new Effect object from another existing object.
Effect()
Constructs an empty Effect object.
void setVisible(const bool visible_)
Sets the visibility status of an effect, which affects whether it is drawn.
void setParameters(const LiveEffect::Parameters &p_)
Sets the live effect parameters object for the art style effect.
void setLiveEffect(const LiveEffect &le_)
Sets the live effect object for the art style effect.
Effect & operator=(const Effect &rhs_)
Overloaded assignment operator to copy data from the given Effect object into the target.
bool isEmpty() const
Gets whether the target Effect object is empty (constructed with the default ctor)
std::unique_ptr< LiveEffect::Parameters > parameters() const
Gets the live effect parameters object for the art style effect.
bool visible() const
Gets the visibility status of an effect, which affects whether it is drawn.
Corresponds to either a fill or a stroke in an art style. Each paint field can also contain live effe...
Definition: hdicoreArtStyle.h:445
bool evenOdd() const
Gets the even-odd fill rule for a paint field.
bool stroke(StrokeStyle &ss__, PaintData &pd__)
Gets stroke information from a paint field.
void setColorPosition(const int32_t pos_)
Sets the color position of a paint field (the point in effect order at which painting occurs)
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.
PaintField()
Constructs an empty PaintField object.
void setFill(const FillStyle &fs_, const PaintData &pd_)
Sets fill information for a paint field.
std::unique_ptr< BlendField > blend() const
Gets the blend field for the paint field.
int32_t effectCount() const
Gets the number of effects in a paint 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...
bool fill(FillStyle &fs__, PaintData &pd__)
Gets fill information from a paint field.
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...
bool isEmpty() const
Gets whether the target PaintField object is empty (constructed with the default ctor)
void setEvenOdd(const bool eo_)
Sets the even-odd fill rule for a paint field.
void setStroke(const StrokeStyle &ss_, const PaintData &pd_)
Sets stroke information for a paint field.
virtual ~PaintField()
Destructs a PaintField object.
bool isStroke() const
Reports whether a paint field corresponds to a stroke.
bool visible() const
Gets the visibility status of blend of a paint field (fill/stroke), which affects whether the blend i...
int32_t colorPosition() const
Gets the color position of a paint field (the point in effect order at which painting occurs)
PaintField(const PaintField &pf_)
Constructs a new PaintField object from another existing object.
std::unique_ptr< Effect > effectAtIndex(const int32_t index_) const
Gets a effect from a paint field by position index.
void setVisible(const bool visible_)
Sets the visibility status of blend of a paint field (fill/stroke), which affects whether the blend i...
Describes an art style.
Definition: hdicoreArtStyle.h:30
Type
Indicates the type of an art style.
Definition: hdicoreArtStyle.h:691
virtual bool hasTransparency() const
Gets whether the style has any transparency.
virtual void setName(const std::string &name_)
Sets the name of the art style.
virtual std::unique_ptr< PaintField > focusFill() const
Gets the focus fill from the target style.
virtual Type styleType() const
Gets the type of the art style.
virtual bool operator!=(const ArtStyle &rhs_) const
Tests whether a given ArtStyle object is not the same as another.
virtual AIArtStyleHandle aiArtStyleHandle() const
Gets the art style handle around which the target object is wrapped.
virtual int32_t postEffectCount() const
Gets the number of post-effects in the target style.
virtual std::unique_ptr< PaintField > paintFieldAtIndex(const int32_t index_) const
Gets a paint field from the target style by position index.
virtual Attributes attributes() const
Gets the attributes of the art style.
virtual int32_t paintFieldCount() const
Gets the number of paint fields in the target style.
virtual ArtStyle & operator=(const ArtStyle &rhs_)
Overloaded ArtStyle assignment operator.
virtual bool hasFillOrStroke() const
Gets whether the style has any fill or stroke.
virtual bool hasEffects() const
Gets whether the style has any live effects.
virtual ~ArtStyle()
Destructs an ArtStyle object.
ArtStyle(const ArtStyle &a_)
ArtStyle copy constructor.
virtual bool operator==(const ArtStyle &rhs_) const
Tests whether a given ArtStyle object is the same as another.
virtual std::unique_ptr< PaintField > focusStroke() const
Gets the focus stroke from the target style.
virtual std::unique_ptr< Effect > preEffectAtIndex(const int32_t index_) const
Gets a pre-effect from the target style by position index.
virtual bool isAnonymous() const
Gets whether an art style is anonymous (named art styles appear in the styles panel)
virtual std::string name() const
Gets the name of the art style.
virtual int32_t preEffectCount() const
Gets the number of pre-effects in the target style.
virtual bool visible() const
Gets whether the style is visible.
virtual bool valid()
Tests the validity of the target style by searching for it in the document.
ArtStyle(const AIArtStyleHandle aiArtStyle_)
Constructs a new ArtStyle object from an AIArtStyleHandle.
virtual std::unique_ptr< BlendField > blendField() const
Gets the overall art style transparency in the form of a blend field.
virtual std::unique_ptr< Effect > postEffectAtIndex(const int32_t index_) const
Gets a post-effect from the target style by position index.
Attributes
Indicates the various attributes of an art style.
Definition: hdicoreArtStyle.h:701
ArtStyle()
Constructs an empty ArtStyle object.
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:31
Describes the fill styling of a path.
Definition: hdicorePathStyle.h:147
Describes the parameters of an Illustrator live effect.
Definition: hdicoreLiveEffect.h:27
Definition: hdicoreLiveEffect.h:21
Describes the stroke styling of a path.
Definition: hdicorePathStyle.h:260
Header file for geometric point manipulation on the Illustrator artboard.
Header file for Illustrator live effect manipulation.
Header file for path style-related classes.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
BlendMode
Describes the blending mode of art (used for compositing art objects)
Definition: hdicoreTypes.h:750
BlendKnockout
Describes the blending knockout of art.
Definition: hdicoreTypes.h:329
Stores art style gradient information.
Definition: hdicoreArtStyle.h:40
double fillGradientAspectRatio
The fill gradient aspect ratio, for radial gradients.
Definition: hdicoreArtStyle.h:55
PaintData()
Constructs a new PaintData object with default values.
PaintData(const PaintData &pd_)
Constructs a new PaintData object from another existing object.
double strokeRelativeGradientLength
The stroke gradient length, in points.
Definition: hdicoreArtStyle.h:66
ArtboardPoint strokeRelativeGradientOrigin
The stroke gradient origin, relative to the bounding box of the object to which the style would be ap...
Definition: hdicoreArtStyle.h:61
PaintData & operator=(const PaintData &rhs_)
Overloaded assignment operator to copy data from the given PaintData object into the target.
virtual ~PaintData()
Destructs a PaintData object.
double fillRelativeGradientLength
The fill gradient length, in points.
Definition: hdicoreArtStyle.h:50
double strokeGradientAspectRatio
The stroke gradient aspect ratio, for radial gradients.
Definition: hdicoreArtStyle.h:71
ArtboardPoint fillRelativeGradientOrigin
The fill gradient origin, relative to the bounding box of the object to which the style would be appl...
Definition: hdicoreArtStyle.h:45