diff options
author | Thomas White <taw@bitwiz.org.uk> | 2011-10-04 23:57:01 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2011-10-04 23:57:01 +0200 |
commit | 48cbffa2da42612a242f96fa0fd09683e9d1442b (patch) | |
tree | 42e16e5a9021c3e6f850f1b2c512f203e933d506 /src/mainwindow.c | |
parent | 064482aaaf0857cc0ad01b845558d84e1f684d58 (diff) |
Move key press stuff into tool callbacks
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r-- | src/mainwindow.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c index d115ec3..b98ed00 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -557,7 +557,7 @@ static gboolean im_commit_sig(GtkIMContext *im, gchar *str, if ( p->editing_object == NULL ) return FALSE; if ( p->editing_object->type != TEXT ) return FALSE; - insert_text(p->editing_object, str); + p->cur_tool->im_commit(p->editing_object, str, p->cur_tool); redraw_object(p->editing_object); @@ -573,31 +573,9 @@ static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event, /* Throw the event to the IM context and let it sort things out */ r = gtk_im_context_filter_keypress(GTK_IM_CONTEXT(p->im_context), event); - if ( r ) return FALSE; /* IM ate it */ - if ( (p->editing_object != NULL) - && (p->editing_object->type == TEXT) ) - { - switch ( event->keyval ) { - - case GDK_KEY_BackSpace : - handle_text_backspace(p->editing_object); - redraw_object(p->editing_object); - break; - - case GDK_KEY_Left : - move_cursor_left(p->editing_object); - redraw_object(p->editing_object); - break; - - case GDK_KEY_Right : - move_cursor_right(p->editing_object); - redraw_object(p->editing_object); - break; - - } - } + p->cur_tool->key_pressed(p->editing_object, event->keyval, p->cur_tool); switch ( event->keyval ) { |