X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fgradient-drag.h;h=ed0887e9810ab2ab4c8b6272ef5ac0f78c6ddcee;hb=8d358698ecbf192ba7c6dc05d4f7de7592753d9f;hp=5b8c867f1162a59bb358c954fbadc24f9a4e6d8f;hpb=e9567f83e9050b0a7ec58d22a9199cc8eca9fed8;p=inkscape.git diff --git a/src/gradient-drag.h b/src/gradient-drag.h index 5b8c867f1..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,13 +32,15 @@ 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; gint point_i; // the stop number of this point ( = 0 POINT_LG_BEGIN and POINT_RG_CENTER) bool fill_or_stroke; + SPObject *getServer(); + bool mayMerge (GrDraggable *da2); inline int equals (GrDraggable *other) { @@ -57,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; @@ -90,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); }; @@ -104,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);} @@ -120,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; @@ -148,15 +157,15 @@ public: // FIXME: make more of this private! void selected_move (double x, double y, bool write_repr = true, bool scale_radial = false); void selected_move_screen (double x, double y); - void select_next (); - void select_prev (); + GrDragger *select_next (); + GrDragger *select_prev (); void selected_reverse_vector (); 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);