Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreGrid.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_GRID__
8#define __HDI_CORE_GRID__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include "hdicoreTypes.h"
13#include "hdicoreColor.h"
14
15namespace hdi
16{
17 namespace core
18 {
22 class Grid
23 {
24 public:
28 enum Style
29 {
30 UnknownStyle = 0,
31 GraphStyle = 10,
32 DottedStyle = 20
33 };
34
38 class Spacing
39 {
40 public:
44 double spacing;
45
49 int32_t ticks;
50
57
63 virtual ~Spacing();
64 };
65
66 typedef std::unique_ptr<Spacing> SpacingUP;
67 typedef std::shared_ptr<Spacing> SpacingSP;
68 typedef std::weak_ptr<Spacing> SpacingWP;
69
76
82 void show();
83
89 void hide();
90
98 bool visible() const;
99
109 void setVisible(const bool visible_);
110
118 bool snaps() const;
119
127 void setSnaps(const bool snaps_);
128
136 bool behindArt() const;
137
145 void setBehindArt(const bool behind_);
146
154 Style style() const;
155
163 void setStyle(const Style style_);
164
173
181 void setSpacing(const Spacing& spacing_);
182
191 void setSpacing(const double spacing_, const int32_t ticks_);
192
201
209 void setDarkColor(const Color& color_);
210
219
227 void setLightColor(const Color& color_);
228
229
230 private:
231 // Only CurrentDocument can construct a Grid object
232 friend class CurrentDocument;
233
239 Grid();
240 };
241 }
242}
243
244#endif
245// HDI_CORE_AIP_MODE
246
247#endif
248// __HDI_CORE_GRID__
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
Describes the spacing and density of gridlines.
Definition: hdicoreGrid.h:39
Spacing()
Constructs a new Spacing object with default values.
double spacing
Space between major gridlines, in points.
Definition: hdicoreGrid.h:44
virtual ~Spacing()
Destructs a Spacing object.
int32_t ticks
Number of minor gridlines between the major gridlines.
Definition: hdicoreGrid.h:49
Allows manipulation of Illustrator's built-in grids.
Definition: hdicoreGrid.h:23
Color darkColor() const
Gets the current "dark" color (for major gridlines)
void setVisible(const bool visible_)
Sets whether the grid is visible.
void hide()
Hides the grid.
~Grid()
Destructs a Grid object.
Spacing spacing() const
Gets the spacing of the gridlines.
void setSpacing(const double spacing_, const int32_t ticks_)
Sets the spacing of the gridlines from a spacing distance and the number of ticks between.
void setBehindArt(const bool behind_)
Sets whether the grid draws behind art.
Color lightColor() const
Gets the current "light" color (for minor gridlines, also called "ticks")
bool visible() const
Gets whether the grid is visible or not.
void setDarkColor(const Color &color_)
Sets the current "dark" color (for major gridlines)
void show()
Shows the grid.
Style
Indicates how the grid is drawn.
Definition: hdicoreGrid.h:29
bool behindArt() const
Gets whether the grid draws behind art.
void setSnaps(const bool snaps_)
Sets whether the gridlines can be snapped to.
void setStyle(const Style style_)
Sets the gridline style, either kAIGridStyleGraph and kAIGridStyleDotted.
void setLightColor(const Color &color_)
Sets the current "light" color (for minor gridlines, also called "ticks")
bool snaps() const
Gets whether the gridlines can be snapped to.
Style style() const
Gets the gridline style, either kAIGridStyleGraph and kAIGridStyleDotted.
void setSpacing(const Spacing &spacing_)
Sets the spacing of the gridlines from an AIGridSpacing struct.
Header file for describing plugin UI colors.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.