From cf41369b5b0f7898cb9c49a35dfb8febd7aef364 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Mon, 26 Mar 2001 20:35:21 +0000 Subject: [PATCH] Add a virtual function to set whether the IM context should use the Mon Mar 26 15:26:17 2001 Owen Taylor * gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add a virtual function to set whether the IM context should use the preedit string. (#51922) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkimcontext.c | 23 +++++++++++++++++++++++ gtk/gtkimcontext.h | 29 ++++++++++++++++------------- 9 files changed, 81 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c17aa981a..15dc1b8413 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Mar 26 15:26:17 2001 Owen Taylor + + * gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add + a virtual function to set whether the IM context should use + the preedit string. (#51922) + Mon Mar 26 14:42:59 2001 Owen Taylor * gdk/gdkpango.h: Remove stale FIXME comment. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 7c17aa981a..15dc1b8413 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Mon Mar 26 15:26:17 2001 Owen Taylor + + * gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add + a virtual function to set whether the IM context should use + the preedit string. (#51922) + Mon Mar 26 14:42:59 2001 Owen Taylor * gdk/gdkpango.h: Remove stale FIXME comment. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 7c17aa981a..15dc1b8413 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Mon Mar 26 15:26:17 2001 Owen Taylor + + * gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add + a virtual function to set whether the IM context should use + the preedit string. (#51922) + Mon Mar 26 14:42:59 2001 Owen Taylor * gdk/gdkpango.h: Remove stale FIXME comment. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 7c17aa981a..15dc1b8413 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Mon Mar 26 15:26:17 2001 Owen Taylor + + * gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add + a virtual function to set whether the IM context should use + the preedit string. (#51922) + Mon Mar 26 14:42:59 2001 Owen Taylor * gdk/gdkpango.h: Remove stale FIXME comment. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 7c17aa981a..15dc1b8413 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Mon Mar 26 15:26:17 2001 Owen Taylor + + * gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add + a virtual function to set whether the IM context should use + the preedit string. (#51922) + Mon Mar 26 14:42:59 2001 Owen Taylor * gdk/gdkpango.h: Remove stale FIXME comment. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 7c17aa981a..15dc1b8413 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Mon Mar 26 15:26:17 2001 Owen Taylor + + * gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add + a virtual function to set whether the IM context should use + the preedit string. (#51922) + Mon Mar 26 14:42:59 2001 Owen Taylor * gdk/gdkpango.h: Remove stale FIXME comment. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 7c17aa981a..15dc1b8413 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Mon Mar 26 15:26:17 2001 Owen Taylor + + * gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add + a virtual function to set whether the IM context should use + the preedit string. (#51922) + Mon Mar 26 14:42:59 2001 Owen Taylor * gdk/gdkpango.h: Remove stale FIXME comment. diff --git a/gtk/gtkimcontext.c b/gtk/gtkimcontext.c index ebaa9ba9e8..ea8e9212be 100644 --- a/gtk/gtkimcontext.c +++ b/gtk/gtkimcontext.c @@ -306,3 +306,26 @@ gtk_im_context_set_cursor_location (GtkIMContext *context, klass->set_cursor_location (context, area); } +/** + * gtk_im_context_set_use_preedit: + * @context: a #GtkIMContext + * @use_preedit: whether the IM context should use the preedit string. + * + * Sets whether the IM context should use the preedit string + * to display feedback. If @use_preedit is FALSE (default + * is TRUE), then the IM context may use some other method to display + * feedback, such as displaying it in a child of the root window. + **/ +void +gtk_im_context_set_use_preedit (GtkIMContext *context, + gboolean use_preedit) +{ + GtkIMContextClass *klass; + + g_return_if_fail (context != NULL); + g_return_if_fail (GTK_IS_IM_CONTEXT (context)); + + klass = GTK_IM_CONTEXT_GET_CLASS (context); + if (klass->set_use_preedit) + klass->set_use_preedit (context, use_preedit); +} diff --git a/gtk/gtkimcontext.h b/gtk/gtkimcontext.h index 3f8ea707f9..a31e8542fd 100644 --- a/gtk/gtkimcontext.h +++ b/gtk/gtkimcontext.h @@ -56,19 +56,21 @@ struct _GtkIMContextClass void (*commit) (GtkIMContext *context, const gchar *str); /* Virtual functions */ - void (*set_client_window) (GtkIMContext *context, - GdkWindow *window); - void (*get_preedit_string) (GtkIMContext *context, - gchar **str, - PangoAttrList **attrs, - gint *cursor_pos); - gboolean (*filter_keypress) (GtkIMContext *context, - GdkEventKey *event); - void (*focus_in) (GtkIMContext *context); - void (*focus_out) (GtkIMContext *context); - void (*reset) (GtkIMContext *context); + void (*set_client_window) (GtkIMContext *context, + GdkWindow *window); + void (*get_preedit_string) (GtkIMContext *context, + gchar **str, + PangoAttrList **attrs, + gint *cursor_pos); + gboolean (*filter_keypress) (GtkIMContext *context, + GdkEventKey *event); + void (*focus_in) (GtkIMContext *context); + void (*focus_out) (GtkIMContext *context); + void (*reset) (GtkIMContext *context); void (*set_cursor_location) (GtkIMContext *context, - GdkRectangle *area); + GdkRectangle *area); + void (*set_use_preedit) (GtkIMContext *context, + gboolean use_preedit); }; GtkType gtk_im_context_get_type (void) G_GNUC_CONST; @@ -86,7 +88,8 @@ void gtk_im_context_focus_out (GtkIMContext *context); void gtk_im_context_reset (GtkIMContext *context); void gtk_im_context_set_cursor_location (GtkIMContext *context, GdkRectangle *area); - +void gtk_im_context_set_use_preedit (GtkIMContext *context, + gboolean use_preedit); #ifdef __cplusplus } #endif /* __cplusplus */