X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fgradient-drag.h;h=ed0887e9810ab2ab4c8b6272ef5ac0f78c6ddcee;hb=8d358698ecbf192ba7c6dc05d4f7de7592753d9f;hp=b9a2fdcc22aa66204818e697958b588079427589;hpb=b98e9f3d5d62fa5733409d4d6b1fb95e32751438;p=inkscape.git diff --git a/src/gradient-drag.h b/src/gradient-drag.h index b9a2fdcc2..ed0887e98 100644 --- a/src/gradient-drag.h +++ b/src/gradient-drag.h @@ -19,13 +19,11 @@ #include #include +#include #include 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 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);