GTK+ Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
#include <gtk/gtk.h> struct GtkIMContext; 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); |
"commit" void user_function (GtkIMContext *imcontext, gchar *arg1, gpointer user_data); "preedit-changed" void user_function (GtkIMContext *imcontext, gpointer user_data); "preedit-end" void user_function (GtkIMContext *imcontext, gpointer user_data); "preedit-start" void user_function (GtkIMContext *imcontext, gpointer user_data); |
void gtk_im_context_set_client_window (GtkIMContext *context, GdkWindow *window); |
Set the client window for the input context; this is the GdkWindow in which the input appears. This window is used in order to correctly position status windows, and may also be used for purposes internal to the input method.
context : | a GtkIMContext |
window : | the client window. This may be NULL to indicate that the previous client window no longer exists. |
void gtk_im_context_get_preedit_string (GtkIMContext *context, gchar **str, PangoAttrList **attrs, gint *cursor_pos); |
Retrieve the current preedit string for the input context, and a list of attributes to apply to the string. This string should be displayed inserted at the insertion point.
context : | a GtkIMContext |
str : | location to store the retrieved string. The string retrieved must be freed with g_free(). |
attrs : | location to store the retrieved attribute list. When you are done with this list, you must unreference it with pango_attr_list_unref(). |
cursor_pos : | location to store position of cursor (in bytes) within the preedit string. |
gboolean gtk_im_context_filter_keypress (GtkIMContext *context, GdkEventKey *event); |
Allow an input method to internally handle a key press event. if this function returns TRUE, then no further processing should be done for this keystroke.
context : | a GtkIMContext |
event : | the key event |
Returns : | TRUE if the input method handled the keystroke. |
void gtk_im_context_focus_in (GtkIMContext *context); |
Notify the input method that the widget to which this input context corresponds has lost gained. The input method may, for example, change the displayed feedback to reflect this change.
context : | a GtkIMContext |
void gtk_im_context_focus_out (GtkIMContext *context); |
Notify the input method that the widget to which this input context corresponds has lost focus. The input method may, for example, change the displayed feedback or reset the contexts state to reflect this change.
context : | a GtkIMContext |
void gtk_im_context_reset (GtkIMContext *context); |
Notify the input method that a change such as a change in cursor position has been made. This will typically cause the input method to clear the preedit state.
context : | a GtkIMContext |
void gtk_im_context_set_cursor_location (GtkIMContext *context, GdkRectangle *area); |
Notify the input method that a change in cursor position has been made.
context : | a GtkIMContext |
area : | new location |
void gtk_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit); |
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.
context : | a GtkIMContext |
use_preedit : | whether the IM context should use the preedit string. |