From 55b2e59196c6e980bdb3f03379de6707dd91082b Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sat, 26 Jan 2013 16:18:08 +0000 Subject: More GObject boilerplate reduction (bzr r12064) --- src/event-context.cpp | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'src/event-context.cpp') diff --git a/src/event-context.cpp b/src/event-context.cpp index 71d4a5fb9..4e5917afa 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -54,8 +54,6 @@ #include "sp-guide.h" #include "color.h" -static void sp_event_context_class_init(SPEventContextClass *klass); -static void sp_event_context_init(SPEventContext *event_context); static void sp_event_context_dispose(GObject *object); static void sp_event_context_private_setup(SPEventContext *ec); @@ -66,8 +64,6 @@ static gint sp_event_context_private_item_handler( static void set_event_location(SPDesktop * desktop, GdkEvent * event); -static GObjectClass *parent_class; - // globals for temporary switching to selector by space static bool selector_toggled = FALSE; static int switch_selector_to = 0; @@ -85,22 +81,7 @@ static guint32 scroll_event_time = 0; static gdouble scroll_multiply = 1; static guint scroll_keyval = 0; -/** - * Registers the SPEventContext class with Glib and returns its type number. - */ -GType sp_event_context_get_type(void) { - static GType type = 0; - if (!type) { - GTypeInfo info = { sizeof(SPEventContextClass), NULL, NULL, - (GClassInitFunc) sp_event_context_class_init, NULL, NULL, - sizeof(SPEventContext), 4, - (GInstanceInitFunc) sp_event_context_init, NULL, /* value_table */ - }; - type = g_type_register_static(G_TYPE_OBJECT, "SPEventContext", &info, - (GTypeFlags) 0); - } - return type; -} +G_DEFINE_TYPE(SPEventContext, sp_event_context, G_TYPE_OBJECT); /** * Callback to set up the SPEventContext vtable. @@ -108,8 +89,6 @@ GType sp_event_context_get_type(void) { static void sp_event_context_class_init(SPEventContextClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); - parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(klass)); - object_class->dispose = sp_event_context_dispose; klass->setup = sp_event_context_private_setup; @@ -166,7 +145,7 @@ static void sp_event_context_dispose(GObject *object) { delete ec->_delayed_snap_event; } - G_OBJECT_CLASS(parent_class)->dispose(object); + G_OBJECT_CLASS(sp_event_context_parent_class)->dispose(object); } /** -- cgit v1.2.3 From 5ebf0c12c2b1be530bf4742236768a55e549494b Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sun, 27 Jan 2013 14:19:11 +0000 Subject: Migrate ruler position tracking to new track_widget API Fixed bugs: - https://launchpad.net/bugs/1105504 (bzr r12067) --- src/event-context.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/event-context.cpp') diff --git a/src/event-context.cpp b/src/event-context.cpp index 4e5917afa..096b310c3 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -1082,7 +1082,7 @@ gint sp_event_context_virtual_item_handler(SPEventContext * event_context, SPIte } /** - * Emits 'position_set' signal on desktop and shows coordinates on status bar. + * Shows coordinates on status bar. */ static void set_event_location(SPDesktop *desktop, GdkEvent *event) { if (event->type != GDK_MOTION_NOTIFY) { @@ -1091,7 +1091,6 @@ static void set_event_location(SPDesktop *desktop, GdkEvent *event) { Geom::Point const button_w(event->button.x, event->button.y); Geom::Point const button_dt(desktop->w2d(button_w)); - desktop->setPosition(button_dt); desktop->set_coordinate_status(button_dt); } -- cgit v1.2.3 From 5801c9a1acae9403433ff60c8d3e6a02c3abb056 Mon Sep 17 00:00:00 2001 From: John Smith Date: Fri, 1 Feb 2013 15:47:04 +0900 Subject: Fix for 1091582 : Problem when entering space in text after space tool toggling. (bzr r12085) --- src/event-context.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/event-context.cpp') diff --git a/src/event-context.cpp b/src/event-context.cpp index 096b310c3..11b814aab 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -712,6 +712,7 @@ static gint sp_event_context_private_root_handler( sp_toggle_selector(desktop); ret = TRUE; } + within_tolerance = false; break; case GDK_KEY_Q: case GDK_KEY_q: -- cgit v1.2.3