summaryrefslogtreecommitdiff
path: root/gtk/gtkimcontext.h
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-11-01 21:50:58 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-11-01 21:50:58 +0000
commita1fe2ac180bf3c16dd58145e356767fc097c6b70 (patch)
tree9b501544246cd9c8f780550291b5f32080843500 /gtk/gtkimcontext.h
parent2704ea2b581c4d601c43e9843fca9afe271fc3a7 (diff)
downloadgtk+-a1fe2ac180bf3c16dd58145e356767fc097c6b70.tar.gz
Add: - A ::retrieve_surrounding signal that asks the widget for context
Thu Nov 1 16:20:56 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkimcontext.[ch]: Add: - A ::retrieve_surrounding signal that asks the widget for context around the insertion point. - A ::delete_surrounding signal that asks the widget to delete context aroudn the insertion point. - gtk_im_context_set_context() for widgets to set context around the insertion point in response to ::retrieve_context. - gtk_im_context_get_context() for context to get context around the insertion point * gtkmarshal.list: Add BOOL:INT,INT * gtk/gtkimmulticontext.c: Proxy the get_surrounding() / set_surrounding() methods, and the ::retrieve_surrounding / ::delete_surrounding signals. * gtk/gtkentry.c gtk/gtktreeview.c: Hook up to the GtkIMContext::retrieve_surrounding / ::delete_surrounding signals.
Diffstat (limited to 'gtk/gtkimcontext.h')
-rw-r--r--gtk/gtkimcontext.h60
1 files changed, 41 insertions, 19 deletions
diff --git a/gtk/gtkimcontext.h b/gtk/gtkimcontext.h
index 0b5d8f3759..1f1433873e 100644
--- a/gtk/gtkimcontext.h
+++ b/gtk/gtkimcontext.h
@@ -50,10 +50,14 @@ struct _GtkIMContextClass
GtkObjectClass parent_class;
/* Signals */
- void (*preedit_start) (GtkIMContext *context);
- void (*preedit_end) (GtkIMContext *context);
- void (*preedit_changed) (GtkIMContext *context);
- void (*commit) (GtkIMContext *context, const gchar *str);
+ void (*preedit_start) (GtkIMContext *context);
+ void (*preedit_end) (GtkIMContext *context);
+ void (*preedit_changed) (GtkIMContext *context);
+ void (*commit) (GtkIMContext *context, const gchar *str);
+ gboolean (*retrieve_surrounding) (GtkIMContext *context);
+ gboolean (*delete_surrounding) (GtkIMContext *context,
+ gint offset,
+ gint n_chars);
/* Virtual functions */
void (*set_client_window) (GtkIMContext *context,
@@ -71,25 +75,43 @@ struct _GtkIMContextClass
GdkRectangle *area);
void (*set_use_preedit) (GtkIMContext *context,
gboolean use_preedit);
+ void (*set_surrounding) (GtkIMContext *context,
+ const gchar *text,
+ gint len,
+ gint cursor_index);
+ gboolean (*get_surrounding) (GtkIMContext *context,
+ gchar **text,
+ gint *cursor_index);
};
GtkType gtk_im_context_get_type (void) G_GNUC_CONST;
-void gtk_im_context_set_client_window (GtkIMContext *context,
- GdkWindow *window);
-void gtk_im_context_get_preedit_string (GtkIMContext *context,
- gchar **str,
- PangoAttrList **attrs,
- gint *cursor_pos);
-gboolean gtk_im_context_filter_keypress (GtkIMContext *context,
- GdkEventKey *event);
-void gtk_im_context_focus_in (GtkIMContext *context);
-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);
+void gtk_im_context_set_client_window (GtkIMContext *context,
+ GdkWindow *window);
+void gtk_im_context_get_preedit_string (GtkIMContext *context,
+ gchar **str,
+ PangoAttrList **attrs,
+ gint *cursor_pos);
+gboolean gtk_im_context_filter_keypress (GtkIMContext *context,
+ GdkEventKey *event);
+void gtk_im_context_focus_in (GtkIMContext *context);
+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);
+void gtk_im_context_set_surrounding (GtkIMContext *context,
+ const gchar *text,
+ gint len,
+ gint cursor_index);
+gboolean gtk_im_context_get_surrounding (GtkIMContext *context,
+ gchar **text,
+ gint *cursor_index);
+gboolean gtk_im_context_delete_surrounding (GtkIMContext *context,
+ gint offset,
+ gint n_chars);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */