7#ifndef __HDI_CORE_LAYER__
8#define __HDI_CORE_LAYER__
16 #if defined(HDI_CORE_AIP_MODE)
21 #elif defined(HDI_CORE_PSP_MODE)
30 #if defined(HDI_CORE_AIP_MODE)
41 #if defined(HDI_CORE_AIP_MODE)
165 std::unique_ptr<Layer>
layer()
const;
195 typedef std::unique_ptr<Iterator> IteratorUP;
196 typedef std::shared_ptr<Iterator> IteratorSP;
197 typedef std::weak_ptr<Iterator> IteratorWP;
203 #if defined(HDI_CORE_PSP_MODE)
206 ColorTypeUnknown = 0,
209 ColorTypeOrange = 30,
210 ColorTypeYellow = 40,
213 ColorTypeViolet = 70,
219 LockingStateNone = 0,
220 LockingStateArtboardAutonest = 1 << 0,
221 LockingStateComposite = 1 << 1,
222 LockingStatePosition = 1 << 2,
223 LockingStateTransparency = 1 << 3,
224 LockingStateAll = 0xffffffff
250 #if defined(HDI_CORE_AIP_MODE)
258 Layer(
const AILayerHandle aiLayer_);
271 #elif defined(HDI_CORE_PSP_MODE)
279 Layer(
const int32_t psLayer_);
299 #if defined(HDI_CORE_AIP_MODE)
312 #elif defined(HDI_CORE_PSP_MODE)
324 virtual int32_t psLayerID()
const;
348 #if defined(HDI_CORE_AIP_MODE)
428 virtual std::unique_ptr<Art>
group()
const;
437 virtual std::unique_ptr<Layer>
parent()
const;
455 virtual std::unique_ptr<Layer>
sibling()
const;
574 #if defined(HDI_CORE_PSP_MODE)
582 virtual LockingState
locked()
const;
591 virtual void setLocked(
const LockingState locked_);
600 virtual bool background()
const;
609 virtual bool fxVisible()
const;
618 virtual void setFXVisible(
const bool visible_);
627 virtual double opacity()
const;
636 virtual void setOpacity(
const double o_);
645 virtual bool preserveTransparency()
const;
654 virtual void setPreserveTransparency(
const bool pres_);
672 virtual void setBlendMode(
const BlendMode bm_);
681 virtual Rect bounds()
const;
690 virtual Rect boundsNoEffects()
const;
699 virtual Rect boundsNoMask()
const;
710 virtual std::string
name()
const;
719 virtual void setName(
const std::string& name_);
813 #if defined(HDI_CORE_AIP_MODE)
816 friend aip::Layer* __accessImpl(
const Layer&);
817 friend Layer __accessCtor(aip::Layer*&);
825 #elif defined(HDI_CORE_PSP_MODE)
828 friend psp::Layer* __accessImpl(
const Layer&);
829 friend Layer __accessCtor(psp::Layer*&);
849 void* __impl()
const;
852 typedef std::unique_ptr<Layer> LayerUP;
853 typedef std::shared_ptr<Layer> LayerSP;
854 typedef std::weak_ptr<Layer> LayerWP;
856 #if defined(HDI_CORE_AIP_MODE)
857 extern aip::Layer* __accessImpl(
const Layer&);
858 extern Layer __accessCtor(aip::Layer*&);
859 #elif defined(HDI_CORE_PSP_MODE)
860 extern psp::Layer* __accessImpl(
const Layer&);
861 extern Layer __accessCtor(psp::Layer*&);
866#if defined(HDI_CORE_PSP_MODE)
867 hdi::core::Layer::LockingState operator|(
868 const hdi::core::Layer::LockingState lhs_,
869 const hdi::core::Layer::LockingState rhs_
872 hdi::core::Layer::LockingState& operator|=(
873 hdi::core::Layer::LockingState& lhs__,
874 const hdi::core::Layer::LockingState rhs_
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:32
Current (focused) document class to allow for metadata access, updating, dictionary access,...
Definition: hdicoreCurrentDocument.h:47
Allows one to interact with a document and its metadata (differs from CurrentDocument class)
Definition: hdicoreDocument.h:43
Allows for iteration through the siblings of a layer, a la std::vector iteration.
Definition: hdicoreLayer.h:62
std::unique_ptr< Layer > layer() const
Gets the current layer pointed to by the iterator.
Iterator & operator++()
Prefix increment operator for forward iteration.
Iterator operator++(int)
Postfix increment operator for forward iteration.
Iterator(const Iterator &iter_)
Constructs an Iterator object from an existing Iterator object (copy constructor)
~Iterator()
Destructs an Iterator object.
bool operator==(const Iterator &rhs_) const
Tests whether a given Iterator object is the same as another.
Iterator & operator=(const Iterator &rhs_)
Assigns one Iterator object to another.
Iterator & operator--()
Prefix decrement operator for reverse iteration.
bool operator!=(const Iterator &rhs_) const
Tests whether a given Iterator object is not the same as another.
bool atEnd() const
Determines whether iteration should stop; works well as the conditional in a for() loop.
Iterator operator--(int)
Postfix decrement operator for reverse iteration.
Allows for layer metadata access, visibility manipulation, locking, etc.
Definition: hdicoreLayer.h:39
virtual bool operator!=(const Layer &rhs_) const
Tests whether a given Layer object is not the same as another.
virtual ColorType color() const
Gets the color of the layer in the layer list.
Layer()
Constructs an empty Layer object.
virtual bool valid() const
Tests the validity of the target layer by checking its topmost "invisible" group.
virtual void setDimsPlacedImages(const bool dim_)
Sets whether images in the target layer are automatically dimmed.
virtual ~Layer()
Layer destructor.
virtual bool visible() const
Gets whether the target layer is visible.
virtual void setPrinted(const bool printed_)
Sets whether the target layer is considered printable when printing the document.
virtual void setColor(const ColorType color_)
Sets the color of the layer in the layer list.
virtual bool operator==(const Layer &rhs_) const
Tests whether a given Layer object is the same as another.
virtual bool dimsPlacedImages() const
Gets whether images in the target layer are automatically dimmed.
virtual std::unique_ptr< Layer > priorSibling() const
Gets the previous sibling layer object for the target layer.
virtual bool locked() const
Gets whether the target layer is locked.
virtual std::string name() const
Gets the name for the target layer.
virtual std::unique_ptr< Layer > firstChild() const
Gets the first child layer object for the target layer.
virtual void hide()
Hides the layer.
virtual void setName(const std::string &name_)
Sets the name for the target layer.
virtual bool hasSelectedArt() const
Gets whether any of the target layer's art is selected.
virtual void show()
Shows the layer.
virtual bool dispose()
Removes the layer from the document.
virtual bool convertToGroup()
Converts the target layer to an artwork group.
virtual std::unique_ptr< Layer > parent() const
Gets the parent layer object for the target layer.
Iterator begin() const
Gets an iterator for the layer in the target's parent layer, starting with the target.
virtual bool printed() const
Gets whether the target layer is considered printable when printing the document.
virtual bool isEmpty() const
Gets whether the target Layer object is empty (constructed with the default ctor)
Layer(const PaintOrder order_, const Layer *const prep_=NULL)
Inserts a new layer at a given position in the layer list in the current document.
virtual std::unique_ptr< Art > group() const
Gets the first (invisible) art group inside the layer.
Layer(const Layer &layer_)
Constructs a Layer object from an existing Layer object (copy constructor)
virtual Layer & operator=(const Layer &rhs_)
Assigns one Layer object to another.
virtual std::unique_ptr< Layer > nextPreorderLayer() const
Gets the next layer in preorder traversal, which returns descendents first.
virtual bool preview() const
Gets the target layer's preview or outline mode setting.
virtual bool editable() const
Gets whether the target layer is editable.
virtual AILayerHandle aiLayerHandle() const
Gets the layer handle around which the target object is wrapped.
virtual void setEditable(const bool editable_)
Sets whether the target layer is editable.
virtual void setLocked(const bool locked_)
Sets whether the target layer is locked.
virtual void setVisible(const bool visible_)
Sets whether the target layer is visible.
virtual void deselectArt() const
Deselects all of the target layer's art.
Layer(const AILayerHandle aiLayer_)
Constructs a new Layer object from an AILayerHandle.
virtual std::unique_ptr< Layer > sibling() const
Gets the next sibling layer object for the target layer.
virtual void setPreview(const bool preview_)
Sets the target layer to preview or outline mode.
virtual bool active() const
Gets whether the target Layer object is the active (current) layer.
virtual bool hasArt() const
Gets whether the target layer has any art.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:34
Header file for describing plugin UI colors.
Header file for describing rectangles.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
PaintOrder
Indicates the position of art or layers when during creation or reordering.
Definition: hdicoreTypes.h:316
BlendMode
Describes the blending mode of art (used for compositing art objects)
Definition: hdicoreTypes.h:750