diff --git a/src/gradient-drag.h b/src/gradient-drag.h
index 5b8c867f1162a59bb358c954fbadc24f9a4e6d8f..ed0887e9810ab2ab4c8b6272ef5ac0f78c6ddcee 100644 (file)
--- a/src/gradient-drag.h
+++ b/src/gradient-drag.h
#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,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) {
*/
struct GrDragger {
GrDragger (GrDrag *parent, NR::Point p, GrDraggable *draggable);
- ~GrDragger();
+ virtual ~GrDragger();
GrDrag *parent;
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);
};
public: // FIXME: make more of this private!
GrDrag(SPDesktop *desktop);
- ~GrDrag();
+ virtual ~GrDrag();
bool isNonEmpty() {return (draggers != NULL);}
bool hasSelection() {return (selected != NULL);}
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;
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);