diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-07-10 20:20:27 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-07-10 20:20:27 +0000 |
| commit | efaed47ba2c19204e9cf05e1f6f2a021ebdb363d (patch) | |
| tree | 3f48d75135f62ec149ef98870ecda0ad4750166d | |
| parent | shorter and less assuming status message - note that effects are used among o... (diff) | |
| download | inkscape-efaed47ba2c19204e9cf05e1f6f2a021ebdb363d.tar.gz inkscape-efaed47ba2c19204e9cf05e1f6f2a021ebdb363d.zip | |
add item handler so that right-click works over an item; fixes 1751318
(bzr r3220)
| -rw-r--r-- | src/pen-context.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/pen-context.cpp b/src/pen-context.cpp index 5a60a7b52..f201513c8 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -48,6 +48,7 @@ static void sp_pen_context_setup(SPEventContext *ec); static void sp_pen_context_finish(SPEventContext *ec); static void sp_pen_context_set(SPEventContext *ec, gchar const *key, gchar const *val); static gint sp_pen_context_root_handler(SPEventContext *ec, GdkEvent *event); +static gint sp_pen_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event); static void spdc_pen_set_initial_point(SPPenContext *pc, NR::Point const p); static void spdc_pen_set_subsequent_point(SPPenContext *pc, NR::Point const p, bool statusbar); @@ -114,6 +115,7 @@ sp_pen_context_class_init(SPPenContextClass *klass) event_context_class->finish = sp_pen_context_finish; event_context_class->set = sp_pen_context_set; event_context_class->root_handler = sp_pen_context_root_handler; + event_context_class->item_handler = sp_pen_context_item_handler; } /** @@ -284,6 +286,29 @@ spdc_endpoint_snap_handle(SPPenContext const *const pc, NR::Point &p, guint cons spdc_endpoint_snap_free(pc, p, state); } +static gint +sp_pen_context_item_handler(SPEventContext *ec, SPItem *item, GdkEvent *event) +{ + SPPenContext *const pc = SP_PEN_CONTEXT(ec); + + gint ret = FALSE; + + switch (event->type) { + case GDK_BUTTON_PRESS: + ret = pen_handle_button_press(pc, event->button); + break; + default: + break; + } + + if (!ret) { + if (((SPEventContextClass *) pen_parent_class)->item_handler) + ret = ((SPEventContextClass *) pen_parent_class)->item_handler(ec, item, event); + } + + return ret; +} + /** * Callback to handle all pen events. */ |
