summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d9cc7e)
raw | patch | inline | side by side (parent: 6d9cc7e)
author | cilix42 <cilix42@users.sourceforge.net> | |
Fri, 5 Sep 2008 18:54:49 +0000 (18:54 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Fri, 5 Sep 2008 18:54:49 +0000 (18:54 +0000) |
src/lpe-tool-context.cpp | patch | blob | history |
index 9b0a8380b9de78b8d3a5596dd654e73f81f6cb0d..ec4cd068948bee302d8a981b8ce424c1a7c19ecd 100644 (file)
--- a/src/lpe-tool-context.cpp
+++ b/src/lpe-tool-context.cpp
static void sp_lpetool_context_setup(SPEventContext *ec);
static void sp_lpetool_context_set(SPEventContext *ec, gchar const *key, gchar const *val);
+static gint sp_lpetool_context_item_handler(SPEventContext *ec, SPItem *item, GdkEvent *event);
static gint sp_lpetool_context_root_handler(SPEventContext *ec, GdkEvent *event);
void sp_lpetool_context_selection_changed(Inkscape::Selection *selection, gpointer data);
event_context_class->setup = sp_lpetool_context_setup;
event_context_class->set = sp_lpetool_context_set;
event_context_class->root_handler = sp_lpetool_context_root_handler;
+ event_context_class->item_handler = sp_lpetool_context_item_handler;
}
static void
**/
}
+static gint
+sp_lpetool_context_item_handler(SPEventContext *ec, SPItem *item, GdkEvent *event)
+{
+ gint ret = FALSE;
+
+ switch (event->type) {
+ case GDK_BUTTON_PRESS:
+ {
+ // select the clicked item but do nothing else
+ Inkscape::Selection * const selection = sp_desktop_selection(ec->desktop);
+ selection->clear();
+ selection->add(item);
+ ret = TRUE;
+ break;
+ }
+ case GDK_BUTTON_RELEASE:
+ // TODO: do we need to catch this or can we pass it on to the parent handler?
+ ret = TRUE;
+ break;
+ default:
+ break;
+ }
+
+ if (!ret) {
+ if (((SPEventContextClass *) lpetool_parent_class)->item_handler)
+ ret = ((SPEventContextClass *) lpetool_parent_class)->item_handler(ec, item, event);
+ }
+
+ return ret;
+}
+
gint
sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event)
{