summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e3fde27)
raw | patch | inline | side by side (parent: e3fde27)
author | Jon A. Cruz <jon@joncruz.org> | |
Thu, 4 Mar 2010 08:52:16 +0000 (00:52 -0800) | ||
committer | Jon A. Cruz <jon@joncruz.org> | |
Thu, 4 Mar 2010 08:52:16 +0000 (00:52 -0800) |
src/sp-gradient.cpp | patch | blob | history | |
src/sp-gradient.h | patch | blob | history |
diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp
index 84a0a98704315228b655e8b80268a47726069a72..3fd120fb3d0b492c82fd086fc46f588f9361546a 100644 (file)
--- a/src/sp-gradient.cpp
+++ b/src/sp-gradient.cpp
}
}
+
+bool SPGradient::isSolid() const
+{
+ bool solid = false;
+ if ( SP_GRADIENT_HAS_STOPS(this) && (sp_number_of_stops(this) == 0) ) {
+ gchar const * attr = repr->attribute("osb:paint");
+ if (attr && !strcmp(attr, "solid")) {
+ solid = true;
+ }
+ }
+ return solid;
+}
+
+
/**
* Write gradient attributes to repr.
*/
diff --git a/src/sp-gradient.h b/src/sp-gradient.h
index abd44538e71204c6f3c7ce389c75a21777088f0b..947cc49ccf727fc196d77eabf85f8368a6634d58 100644 (file)
--- a/src/sp-gradient.h
+++ b/src/sp-gradient.h
struct SPGradientReference;
typedef enum {
- SP_GRADIENT_TYPE_UNKNOWN,
- SP_GRADIENT_TYPE_LINEAR,
- SP_GRADIENT_TYPE_RADIAL
+ SP_GRADIENT_TYPE_UNKNOWN,
+ SP_GRADIENT_TYPE_LINEAR,
+ SP_GRADIENT_TYPE_RADIAL
} SPGradientType;
typedef enum {
- SP_GRADIENT_STATE_UNKNOWN,
- SP_GRADIENT_STATE_VECTOR,
- SP_GRADIENT_STATE_PRIVATE
+ SP_GRADIENT_STATE_UNKNOWN,
+ SP_GRADIENT_STATE_VECTOR,
+ SP_GRADIENT_STATE_PRIVATE
} SPGradientState;
typedef enum {
POINT_RG_MID1,
POINT_RG_MID2,
// insert new point types here.
-
+
POINT_G_INVALID
} GrPointType;
*/
struct SPGradient : public SPPaintServer {
- /** Reference (href) */
- SPGradientReference *ref;
+ /** Reference (href) */
+ SPGradientReference *ref;
+
+ /** State in Inkscape gradient system */
+ guint state : 2;
+
+ /** gradientUnits attribute */
+ SPGradientUnits units;
+ guint units_set : 1;
- /** State in Inkscape gradient system */
- guint state : 2;
+ /** gradientTransform attribute */
+ Geom::Matrix gradientTransform;
+ guint gradientTransform_set : 1;
- /** gradientUnits attribute */
- SPGradientUnits units;
- guint units_set : 1;
+ /** spreadMethod attribute */
+ SPGradientSpread spread;
+ guint spread_set : 1;
- /** gradientTransform attribute */
- Geom::Matrix gradientTransform;
- guint gradientTransform_set : 1;
+ /** Gradient stops */
+ guint has_stops : 1;
- /** spreadMethod attribute */
- SPGradientSpread spread;
- guint spread_set : 1;
+ /** Composed vector */
+ SPGradientVector vector;
- /** Gradient stops */
- guint has_stops : 1;
+ /** Rendered color array (4 * 1024 bytes) */
+ guchar *color;
- /** Composed vector */
- SPGradientVector vector;
+ sigc::connection modified_connection;
- /** Rendered color array (4 * 1024 bytes) */
- guchar *color;
- sigc::connection modified_connection;
+ bool isSolid() const;
};
/**
* The SPGradient vtable.
*/
struct SPGradientClass {
- SPPaintServerClass parent_class;
+ SPPaintServerClass parent_class;
};