Code

Patch from codedread. Prevents rendering of title/desc/metadata elements in text...
[inkscape.git] / src / gradient-drag.h
index b9a2fdcc22aa66204818e697958b588079427589..ed0887e9810ab2ab4c8b6272ef5ac0f78c6ddcee 100644 (file)
 #include <vector>
 
 #include <forward.h>
+#include <libnr/nr-forward.h>
 #include <knot-enums.h>
 
 struct SPItem;
 struct SPKnot;
-namespace NR {
-class Point;
-}
 
 /**
 This class represents a single draggable point of a gradient. It remembers the item
@@ -34,7 +32,7 @@ GrPointType enum), and the point number (needed if more than 2 stops are present
 */
 struct GrDraggable {
        GrDraggable(SPItem *item, guint point_type, guint point_i, bool fill_or_stroke);
-       ~GrDraggable();
+    virtual ~GrDraggable();
 
        SPItem *item;
        gint point_type;
@@ -59,7 +57,7 @@ be more when draggers are snapped together.
 */
 struct GrDragger {
        GrDragger (GrDrag *parent, NR::Point p, GrDraggable *draggable);
-       ~GrDragger();
+    virtual ~GrDragger();
 
        GrDrag *parent;
 
@@ -92,8 +90,9 @@ struct GrDragger {
        bool mayMerge (GrDragger *other);
        bool mayMerge (GrDraggable *da2);
 
-       bool isA (gint point_type);
-       bool isA (SPItem *item, gint point_type, gint point_i, bool fill_or_stroke);
+    bool isA (gint point_type);
+    bool isA (SPItem *item, gint point_type, bool fill_or_stroke);
+    bool isA (SPItem *item, gint point_type, gint point_i, bool fill_or_stroke);
 
        void fireDraggables (bool write_repr, bool scale_radial = false, bool merging_focus = false);
 };
@@ -106,7 +105,7 @@ class GrDrag {
 public: // FIXME: make more of this private!
 
     GrDrag(SPDesktop *desktop);
-    ~GrDrag();
+    virtual ~GrDrag();
 
                bool isNonEmpty() {return (draggers != NULL);}
                bool hasSelection() {return (selected != NULL);}
@@ -122,13 +121,21 @@ public: // FIXME: make more of this private!
     void deselectAll();
                void selectAll();
                void selectByCoords(std::vector<NR::Point> coords);
+    void selectRect(NR::Rect const &r);
+
+    bool dropColor(SPItem *item, gchar *c, NR::Point p);
+
+               SPStop *addStopNearPoint (SPItem *item, NR::Point mouse_p, double tolerance);
     
     void deleteSelected (bool just_one = false);
+
+    guint32 getColor();
     
     bool keep_selection;    
     
     GrDragger *getDraggerFor (SPItem *item, gint point_type, gint point_i, bool fill_or_stroke);
 
+    void grabKnot (GrDragger *dragger, gint x, gint y, guint32 etime);
     void grabKnot (SPItem *item, gint point_type, gint point_i, bool fill_or_stroke, gint x, gint y, guint32 etime);
 
     bool local_change;
@@ -158,7 +165,7 @@ public: // FIXME: make more of this private!
 private: 
     void deselect_all();
 
-    void addLine (NR::Point p1, NR::Point p2, guint32 rgba);
+    void addLine (SPItem *item, NR::Point p1, NR::Point p2, guint32 rgba);
 
     void addDragger (GrDraggable *draggable);