diff options
author | Lauris Kaplinski <lauris@src.gnome.org> | 2000-08-23 08:22:18 +0800 |
---|---|---|
committer | Lauris Kaplinski <lauris@src.gnome.org> | 2000-08-23 08:22:18 +0800 |
commit | 1e5ae349da6db9a0af7714037e23ee599f60c068 (patch) | |
tree | e4e514e57d513ea0c63aa9309f5d7feefbe74ce0 | |
parent | 6b2a9a563f754366af99671e5df19fbc4c8c7ad8 (diff) | |
download | gsoc2013-evolution-1e5ae349da6db9a0af7714037e23ee599f60c068.tar gsoc2013-evolution-1e5ae349da6db9a0af7714037e23ee599f60c068.tar.gz gsoc2013-evolution-1e5ae349da6db9a0af7714037e23ee599f60c068.tar.bz2 gsoc2013-evolution-1e5ae349da6db9a0af7714037e23ee599f60c068.tar.lz gsoc2013-evolution-1e5ae349da6db9a0af7714037e23ee599f60c068.tar.xz gsoc2013-evolution-1e5ae349da6db9a0af7714037e23ee599f60c068.tar.zst gsoc2013-evolution-1e5ae349da6db9a0af7714037e23ee599f60c068.zip |
Handle iso-8859-1 keys nicely in e-text and e-table. Other encodings to
come...
svn path=/trunk/; revision=4972
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | e-util/ChangeLog | 7 | ||||
-rw-r--r-- | e-util/Makefile.am | 4 | ||||
-rw-r--r-- | widgets/e-table/ChangeLog | 5 | ||||
-rw-r--r-- | widgets/e-table/e-cell-text.c | 17 | ||||
-rw-r--r-- | widgets/e-text/e-text.c | 21 | ||||
-rw-r--r-- | widgets/table/e-cell-text.c | 17 | ||||
-rw-r--r-- | widgets/text/e-text.c | 21 |
8 files changed, 88 insertions, 9 deletions
@@ -1,3 +1,8 @@ +2000-08-22 Lauris Kaplinski <lauris@helixcode.com> + + * widgets/e-text/e-text.c (e_text_event): Use e_utf8_from_gtk_event_key + to translate GDK_KEY_PRESS to insertable UTF-8 string + 2000-08-22 Christopher James Lahey <clahey@helixcode.com> * announcement-0.4.1.txt: Updated dependency list. diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 9958171157..42ffd785d4 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,10 @@ +2000-08-22 Lauris Kaplinski <lauris@helixcode.com> + + * e-unicode.h: + * e-unicode.c: Some convenience functions to deal with Gtk+ and UTF-8 + + * Makefile.am: Added e-unicode.h, e-unicode.c + 2000-08-21 Lauris Kaplinski <lauris@helixcode.com> * e-font.h: diff --git a/e-util/Makefile.am b/e-util/Makefile.am index 6a1dd2cb02..729a402c4b 100644 --- a/e-util/Makefile.am +++ b/e-util/Makefile.am @@ -42,7 +42,9 @@ libeutil_la_SOURCES = \ e-xml-utils.c \ e-xml-utils.h \ e-font.c \ - e-font.h + e-font.h \ + e-unicode.c \ + e-unicode.h libeutil_static_la_SOURCES = $(libeutil_la_SOURCES) libeutil_static_la_LDFLAGS = --all-static
\ No newline at end of file diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index 9ff6fbfe97..8429e2fabf 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,3 +1,8 @@ +2000-08-21 Lauris Kaplinski <lauris@helixcode.com> + + * e-cell-text.c (ect_event): Use e_utf8_from_gtk_event_key to translate + GDK_KEY_PRESS event to insertable UTF-8 string + 2000-08-22 Christopher James Lahey <clahey@helixcode.com> * e-cell-text.c, e-cell-toggle.c, e-cell-tree.c, e-table-item.c: diff --git a/widgets/e-table/e-cell-text.c b/widgets/e-table/e-cell-text.c index 279ef4975b..5a7f8d514e 100644 --- a/widgets/e-table/e-cell-text.c +++ b/widgets/e-table/e-cell-text.c @@ -35,6 +35,7 @@ #include "e-cell-text.h" #include "e-util/e-util.h" #include "e-util/e-font.h" +#include "e-util/e-unicode.h" #include "e-table-item.h" #include "e-text-event-processor.h" #include "e-text-event-processor-emacs-like.h" @@ -912,11 +913,23 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, e_tep_event.key.time = key.time; e_tep_event.key.state = key.state; e_tep_event.key.keyval = key.keyval; + + /* This is probably ugly hack, but we have to handle UTF-8 input somehow */ +#if 0 e_tep_event.key.length = key.length; e_tep_event.key.string = key.string; +#else + e_tep_event.key.string = e_utf8_from_gtk_event_key (canvas, key.keyval, key.string); + if (e_tep_event.key.string != NULL) { + e_tep_event.key.length = strlen (e_tep_event.key.string); + } else { + e_tep_event.key.length = 0; + } +#endif + _get_tep (edit); - return_val = e_text_event_processor_handle_event (edit->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event (edit->tep, &e_tep_event); + if (e_tep_event.key.string) g_free (e_tep_event.key.string); break; } } diff --git a/widgets/e-text/e-text.c b/widgets/e-text/e-text.c index dc28886c15..d30d1cb716 100644 --- a/widgets/e-text/e-text.c +++ b/widgets/e-text/e-text.c @@ -28,6 +28,7 @@ #include <gtk/gtkinvisible.h> #include "e-util/e-canvas.h" #include "e-util/e-canvas-utils.h" +#include "e-util/e-unicode.h" #include "e-text-event-processor-emacs-like.h" @@ -2615,14 +2616,30 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) case GDK_KEY_RELEASE: if (text->editing) { GdkEventKey key = event->key; + gint ret; + e_tep_event.key.time = key.time; e_tep_event.key.state = key.state; e_tep_event.key.keyval = key.keyval; + + /* This is probably ugly hack, but we have to handle UTF-8 input somehow */ +#if 0 e_tep_event.key.length = key.length; e_tep_event.key.string = key.string; +#else + e_tep_event.key.string = e_utf8_from_gtk_event_key (GTK_WIDGET (item->canvas), key.keyval, key.string); + if (e_tep_event.key.string != NULL) { + e_tep_event.key.length = strlen (e_tep_event.key.string); + } else { + e_tep_event.key.length = 0; + } +#endif _get_tep(text); - return e_text_event_processor_handle_event (text->tep, - &e_tep_event); + ret = e_text_event_processor_handle_event (text->tep, &e_tep_event); + + if (e_tep_event.key.string) g_free (e_tep_event.key.string); + + return ret; } else return 0; diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 279ef4975b..5a7f8d514e 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -35,6 +35,7 @@ #include "e-cell-text.h" #include "e-util/e-util.h" #include "e-util/e-font.h" +#include "e-util/e-unicode.h" #include "e-table-item.h" #include "e-text-event-processor.h" #include "e-text-event-processor-emacs-like.h" @@ -912,11 +913,23 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, e_tep_event.key.time = key.time; e_tep_event.key.state = key.state; e_tep_event.key.keyval = key.keyval; + + /* This is probably ugly hack, but we have to handle UTF-8 input somehow */ +#if 0 e_tep_event.key.length = key.length; e_tep_event.key.string = key.string; +#else + e_tep_event.key.string = e_utf8_from_gtk_event_key (canvas, key.keyval, key.string); + if (e_tep_event.key.string != NULL) { + e_tep_event.key.length = strlen (e_tep_event.key.string); + } else { + e_tep_event.key.length = 0; + } +#endif + _get_tep (edit); - return_val = e_text_event_processor_handle_event (edit->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event (edit->tep, &e_tep_event); + if (e_tep_event.key.string) g_free (e_tep_event.key.string); break; } } diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index dc28886c15..d30d1cb716 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -28,6 +28,7 @@ #include <gtk/gtkinvisible.h> #include "e-util/e-canvas.h" #include "e-util/e-canvas-utils.h" +#include "e-util/e-unicode.h" #include "e-text-event-processor-emacs-like.h" @@ -2615,14 +2616,30 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) case GDK_KEY_RELEASE: if (text->editing) { GdkEventKey key = event->key; + gint ret; + e_tep_event.key.time = key.time; e_tep_event.key.state = key.state; e_tep_event.key.keyval = key.keyval; + + /* This is probably ugly hack, but we have to handle UTF-8 input somehow */ +#if 0 e_tep_event.key.length = key.length; e_tep_event.key.string = key.string; +#else + e_tep_event.key.string = e_utf8_from_gtk_event_key (GTK_WIDGET (item->canvas), key.keyval, key.string); + if (e_tep_event.key.string != NULL) { + e_tep_event.key.length = strlen (e_tep_event.key.string); + } else { + e_tep_event.key.length = 0; + } +#endif _get_tep(text); - return e_text_event_processor_handle_event (text->tep, - &e_tep_event); + ret = e_text_event_processor_handle_event (text->tep, &e_tep_event); + + if (e_tep_event.key.string) g_free (e_tep_event.key.string); + + return ret; } else return 0; |