diff --git a/src/sp-gradient.h b/src/sp-gradient.h
index e7488673dddb9a40fd7de11ca4e9e19ca732dbf5..fbcc4934ec0f0872a1afc47e4d318985ca395dd9 100644 (file)
--- a/src/sp-gradient.h
+++ b/src/sp-gradient.h
*/
#include <gdk/gdktypes.h>
+#include <glibmm/ustring.h>
#include "libnr/nr-matrix.h"
#include "sp-paint-server.h"
#include "sp-gradient-spread.h"
struct SPGradientReference;
-#define SP_TYPE_GRADIENT (sp_gradient_get_type())
+#define SP_TYPE_GRADIENT (SPGradient::getType())
#define SP_GRADIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SP_TYPE_GRADIENT, SPGradient))
#define SP_GRADIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SP_TYPE_GRADIENT, SPGradientClass))
#define SP_IS_GRADIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), SP_TYPE_GRADIENT))
#define SP_IS_GRADIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SP_TYPE_GRADIENT))
-GType sp_gradient_get_type();
-
typedef enum {
SP_GRADIENT_TYPE_UNKNOWN,
SP_GRADIENT_TYPE_LINEAR,
/** State in Inkscape gradient system */
guint state : 2;
+private:
/** gradientUnits attribute */
SPGradientUnits units;
guint units_set : 1;
+public:
/** gradientTransform attribute */
Geom::Matrix gradientTransform;
guint gradientTransform_set : 1;
+private:
/** spreadMethod attribute */
SPGradientSpread spread;
guint spread_set : 1;
/** Gradient stops */
guint has_stops : 1;
+public:
/** Composed vector */
SPGradientVector vector;
sigc::connection modified_connection;
+ bool hasStops() const;
SPStop* getFirstStop();
int getStopCount() const;
+
+ bool isUnitsSet() const;
+ SPGradientUnits getUnits() const;
+ void setUnits(SPGradientUnits units);
+
+
+ bool isSpreadSet() const;
+ SPGradientSpread getSpread() const;
+
/**
* Returns private vector of given gradient (the gradient at the end of the href chain which has
* stops), optionally normalizing it.
* \pre There exists a gradient in the chain that has stops.
*/
SPGradient *getVector(bool force_private = false);
+
+ static GType getType();
+
+ /** Forces vector to be built, if not present (i.e. changed) */
+ void ensureVector();
+
+ /** Ensures that color array is populated */
+ void ensureColors();
+
+ /**
+ * Set spread property of gradient and emit modified.
+ */
+ void setSpread(SPGradientSpread spread);
+
+ SPGradientSpread fetchSpread();
+ SPGradientUnits fetchUnits();
+
+ void setSwatch(bool swatch = true);
+
+private:
+ bool invalidateVector();
+ void rebuildVector();
+
+ friend class SPGradientImpl;
+ friend class SPLGPainter;
+ friend class SPRGPainter;
};
/**
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :