Code

Avoid crash by uninitialized perspectives.
[inkscape.git] / src / sp-gradient.h
index 999f4f0a8971b377160ee8a1833cfc2c0b4fa0f3..abd44538e71204c6f3c7ce389c75a21777088f0b 100644 (file)
@@ -6,7 +6,9 @@
  *
  * Authors:
  *   Lauris Kaplinski <lauris@kaplinski.com>
+ *   Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
  *
+ * Copyright (C) 2007 Johan Engelen
  * Copyright (C) 1999-2002 Lauris Kaplinski
  * Copyright (C) 2000-2001 Ximian, Inc.
  *
@@ -37,7 +39,7 @@ typedef enum {
 } SPGradientState;
 
 typedef enum {
-    POINT_LG_BEGIN,
+    POINT_LG_BEGIN =0, //start enum at 0 (for indexing into gr_knot_shapes array for example)
     POINT_LG_END,
     POINT_LG_MID,
     POINT_RG_CENTER,
@@ -45,7 +47,10 @@ typedef enum {
     POINT_RG_R2,
     POINT_RG_FOCUS,
     POINT_RG_MID1,
-    POINT_RG_MID2
+    POINT_RG_MID2,
+    // insert new point types here.
+    
+    POINT_G_INVALID
 } GrPointType;
 
 /**
@@ -55,23 +60,31 @@ typedef enum {
  * \todo fixme: Implement more here (Lauris)
  */
 struct SPGradient : public SPPaintServer {
+
        /** Reference (href) */
        SPGradientReference *ref;
+
        /** State in Inkscape gradient system */
        guint state : 2;
+
        /** gradientUnits attribute */
        SPGradientUnits units;
        guint units_set : 1;
+
        /** gradientTransform attribute */
-       NR::Matrix gradientTransform;
+       Geom::Matrix gradientTransform;
        guint gradientTransform_set : 1;
+
        /** spreadMethod attribute */
        SPGradientSpread spread;
        guint spread_set : 1;
+
        /** Gradient stops */
        guint has_stops : 1;
+
        /** Composed vector */
        SPGradientVector vector;
+
        /** Rendered color array (4 * 1024 bytes) */
        guchar *color;