8
8
* Lauris Kaplinski <lauris@kaplinski.com>
9
9
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
10
* Jon A. Cruz <jon@joncruz.org>
12
* Copyrigt (C) 2010 Jon A. Cruz
11
13
* Copyright (C) 2007 Johan Engelen
12
14
* Copyright (C) 1999-2002 Lauris Kaplinski
13
15
* Copyright (C) 2000-2001 Ximian, Inc.
27
30
struct SPGradientReference;
33
#define SP_TYPE_GRADIENT (SPGradient::getType())
34
#define SP_GRADIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SP_TYPE_GRADIENT, SPGradient))
35
#define SP_GRADIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SP_TYPE_GRADIENT, SPGradientClass))
36
#define SP_IS_GRADIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), SP_TYPE_GRADIENT))
37
#define SP_IS_GRADIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SP_TYPE_GRADIENT))
30
SP_GRADIENT_TYPE_UNKNOWN,
31
SP_GRADIENT_TYPE_LINEAR,
32
SP_GRADIENT_TYPE_RADIAL
40
SP_GRADIENT_TYPE_UNKNOWN,
41
SP_GRADIENT_TYPE_LINEAR,
42
SP_GRADIENT_TYPE_RADIAL
36
SP_GRADIENT_STATE_UNKNOWN,
37
SP_GRADIENT_STATE_VECTOR,
38
SP_GRADIENT_STATE_PRIVATE
46
SP_GRADIENT_STATE_UNKNOWN,
47
SP_GRADIENT_STATE_VECTOR,
48
SP_GRADIENT_STATE_PRIVATE
62
72
struct SPGradient : public SPPaintServer {
64
/** Reference (href) */
65
SPGradientReference *ref;
67
/** State in Inkscape gradient system */
70
/** gradientUnits attribute */
71
SPGradientUnits units;
74
/** gradientTransform attribute */
75
Geom::Matrix gradientTransform;
76
guint gradientTransform_set : 1;
78
/** spreadMethod attribute */
79
SPGradientSpread spread;
85
/** Composed vector */
86
SPGradientVector vector;
88
/** Rendered color array (4 * 1024 bytes) */
91
sigc::connection modified_connection;
74
/** Reference (href) */
75
SPGradientReference *ref;
77
/** State in Inkscape gradient system */
81
/** gradientUnits attribute */
82
SPGradientUnits units;
86
/** gradientTransform attribute */
87
Geom::Matrix gradientTransform;
88
guint gradientTransform_set : 1;
91
/** spreadMethod attribute */
92
SPGradientSpread spread;
99
/** Composed vector */
100
SPGradientVector vector;
102
/** Rendered color array (4 * 1024 bytes) */
105
sigc::connection modified_connection;
107
bool hasStops() const;
109
SPStop* getFirstStop();
110
int getStopCount() const;
113
bool isUnitsSet() const;
114
SPGradientUnits getUnits() const;
115
void setUnits(SPGradientUnits units);
118
bool isSpreadSet() const;
119
SPGradientSpread getSpread() const;
122
* Returns private vector of given gradient (the gradient at the end of the href chain which has
123
* stops), optionally normalizing it.
125
* \pre SP_IS_GRADIENT(gradient).
126
* \pre There exists a gradient in the chain that has stops.
128
SPGradient *getVector(bool force_private = false);
130
static GType getType();
132
/** Forces vector to be built, if not present (i.e. changed) */
135
/** Ensures that color array is populated */
139
* Set spread property of gradient and emit modified.
141
void setSpread(SPGradientSpread spread);
143
SPGradientSpread fetchSpread();
144
SPGradientUnits fetchUnits();
146
void setSwatch(bool swatch = true);
149
bool invalidateVector();
150
void rebuildVector();
152
friend class SPGradientImpl;
153
friend class SPLGPainter;
154
friend class SPRGPainter;
95
158
* The SPGradient vtable.
97
160
struct SPGradientClass {
98
SPPaintServerClass parent_class;
161
SPPaintServerClass parent_class;
102
165
#include "sp-gradient-fns.h"
104
#endif /* !__SP_GRADIENT_H__ */
167
#endif // SEEN_SP_GRADIENT_H