diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-08-31 18:17:26 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-08-31 18:17:26 +0000 |
| commit | 1f2d8bc4ce99e970cead4ca96c1859c383a9c043 (patch) | |
| tree | 07731605bc486145ce5817c5f98a27b0136c7074 /src/knot.h | |
| parent | Minor pass of header cleanup (diff) | |
| download | inkscape-1f2d8bc4ce99e970cead4ca96c1859c383a9c043.tar.gz inkscape-1f2d8bc4ce99e970cead4ca96c1859c383a9c043.zip | |
Header cleanup: stop using Glib types where they aren't truly needed. Eases GThread deprecation errors.
(bzr r13341.1.190)
Diffstat (limited to 'src/knot.h')
| -rw-r--r-- | src/knot.h | 62 |
1 files changed, 33 insertions, 29 deletions
diff --git a/src/knot.h b/src/knot.h index b79614bcb..e3ad98e66 100644 --- a/src/knot.h +++ b/src/knot.h @@ -14,15 +14,19 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <gdk/gdk.h> #include <2geom/point.h> -#include "knot-enums.h" #include <sigc++/sigc++.h> + +#include "knot-enums.h" #include "enums.h" class SPDesktop; -struct SPCanvasItem; class SPItem; +struct SPCanvasItem; + +typedef struct _GdkCursor GdkCursor; +typedef union _GdkEvent GdkEvent; +typedef unsigned int guint32; #define SP_KNOT(obj) (dynamic_cast<SPKnot*>(static_cast<SPKnot*>(obj))) #define SP_IS_KNOT(obj) (dynamic_cast<const SPKnot*>(static_cast<const SPKnot*>(obj)) != NULL) @@ -36,19 +40,17 @@ class SPItem; */ class SPKnot { public: - SPKnot(SPDesktop *desktop, gchar const *tip); + SPKnot(SPDesktop *desktop, char const *tip); virtual ~SPKnot(); - - int ref_count; - + int ref_count; // FIXME encapsulation SPDesktop *desktop; /**< Desktop we are on. */ SPCanvasItem *item; /**< Our CanvasItem. */ SPItem *owner; /**< Optional Owner Item */ - guint flags; + unsigned int flags; - guint size; /**< Always square. */ + unsigned int size; /**< Always square. */ Geom::Point pos; /**< Our desktop coordinates. */ Geom::Point grabbed_rel_pos; /**< Grabbed relative position. */ Geom::Point drag_origin; /**< Origin of drag. */ @@ -59,39 +61,41 @@ public: guint32 fill[SP_KNOT_VISIBLE_STATES]; guint32 stroke[SP_KNOT_VISIBLE_STATES]; - guchar *image[SP_KNOT_VISIBLE_STATES]; + unsigned char *image[SP_KNOT_VISIBLE_STATES]; GdkCursor *cursor[SP_KNOT_VISIBLE_STATES]; GdkCursor *saved_cursor; - gpointer pixbuf; + void* pixbuf; - gchar *tip; + char *tip; - gulong _event_handler_id; + unsigned long _event_handler_id; double pressure; /**< The tablet pen pressure when the knot is being dragged. */ - sigc::signal<void, SPKnot *, guint> click_signal; - sigc::signal<void, SPKnot*, guint> doubleclicked_signal; - sigc::signal<void, SPKnot*, guint> grabbed_signal; - sigc::signal<void, SPKnot *, guint> ungrabbed_signal; - sigc::signal<void, SPKnot *, Geom::Point const &, guint> moved_signal; + // FIXME: signals should NOT need to emit the object they came from, the callee should + // be able to figure that out + sigc::signal<void, SPKnot *, unsigned int> click_signal; + sigc::signal<void, SPKnot*, unsigned int> doubleclicked_signal; + sigc::signal<void, SPKnot*, unsigned int> grabbed_signal; + sigc::signal<void, SPKnot *, unsigned int> ungrabbed_signal; + sigc::signal<void, SPKnot *, Geom::Point const &, unsigned int> moved_signal; sigc::signal<bool, SPKnot*, GdkEvent*> event_signal; - sigc::signal<bool, SPKnot*, Geom::Point*, guint> request_signal; + sigc::signal<bool, SPKnot*, Geom::Point*, unsigned int> request_signal; //TODO: all the members above should eventualle become private, accessible via setters/getters - void setSize(guint i); - void setShape(guint i); - void setAnchor(guint i); - void setMode(guint i); - void setPixbuf(gpointer p); + void setSize(unsigned int i); + void setShape(unsigned int i); + void setAnchor(unsigned int i); + void setMode(unsigned int i); + void setPixbuf(void* p); void setFill(guint32 normal, guint32 mouseover, guint32 dragging); void setStroke(guint32 normal, guint32 mouseover, guint32 dragging); - void setImage(guchar* normal, guchar* mouseover, guchar* dragging); + void setImage(unsigned char* normal, unsigned char* mouseover, unsigned char* dragging); void setCursor(GdkCursor* normal, GdkCursor* mouseover, GdkCursor* dragging); @@ -108,7 +112,7 @@ public: /** * Set flag in knot, with side effects. */ - void setFlag(guint flag, bool set); + void setFlag(unsigned int flag, bool set); /** * Update knot's pixbuf and set its control state. @@ -118,17 +122,17 @@ public: /** * Request or set new position for knot. */ - void requestPosition(Geom::Point const &pos, guint state); + void requestPosition(Geom::Point const &pos, unsigned int state); /** * Update knot for dragging and tell canvas an item was grabbed. */ - void startDragging(Geom::Point const &p, gint x, gint y, guint32 etime); + void startDragging(Geom::Point const &p, int x, int y, guint32 etime); /** * Move knot to new position and emits "moved" signal. */ - void setPosition(Geom::Point const &p, guint state); + void setPosition(Geom::Point const &p, unsigned int state); /** * Move knot to new position, without emitting a MOVED signal. |
