Add focus_in and focus_out implementation to im_context_class as

2000-12-08    <tajima@eng.sun.com>

        * modules/input/gtkimcontextxim.c (gtk_im_context_xim_class_init):
          Add focus_in and focus_out implementation to im_context_class
          as gtk_im_context_xim_focus_in and gtk_im_context_xim_focus_out.
This commit is contained in:
8 2000-12-09 01:06:55 +00:00 committed by Hidetoshi Tajima
parent ad3f7d9653
commit eccd33b2e7

View File

@ -38,6 +38,8 @@ static void gtk_im_context_xim_set_client_window (GtkIMContext *co
static gboolean gtk_im_context_xim_filter_keypress (GtkIMContext *context, static gboolean gtk_im_context_xim_filter_keypress (GtkIMContext *context,
GdkEventKey *key); GdkEventKey *key);
static void gtk_im_context_xim_reset (GtkIMContext *context); static void gtk_im_context_xim_reset (GtkIMContext *context);
static void gtk_im_context_xim_focus_in (GtkIMContext *context);
static void gtk_im_context_xim_focus_out (GtkIMContext *context);
static void gtk_im_context_xim_get_preedit_string (GtkIMContext *context, static void gtk_im_context_xim_get_preedit_string (GtkIMContext *context,
gchar **str, gchar **str,
PangoAttrList **attrs, PangoAttrList **attrs,
@ -209,6 +211,8 @@ gtk_im_context_xim_class_init (GtkIMContextXIMClass *class)
im_context_class->filter_keypress = gtk_im_context_xim_filter_keypress; im_context_class->filter_keypress = gtk_im_context_xim_filter_keypress;
im_context_class->reset = gtk_im_context_xim_reset; im_context_class->reset = gtk_im_context_xim_reset;
im_context_class->get_preedit_string = gtk_im_context_xim_get_preedit_string; im_context_class->get_preedit_string = gtk_im_context_xim_get_preedit_string;
im_context_class->focus_in = gtk_im_context_xim_focus_in;
im_context_class->focus_out = gtk_im_context_xim_focus_out;
gobject_class->finalize = gtk_im_context_xim_finalize; gobject_class->finalize = gtk_im_context_xim_finalize;
} }
@ -361,6 +365,32 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context,
return FALSE; return FALSE;
} }
static void
gtk_im_context_xim_focus_in (GtkIMContext *context)
{
GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
XIC ic = gtk_im_context_xim_get_ic (context_xim);
if (!ic)
return;
XSetICFocus (ic);
return;
}
static void
gtk_im_context_xim_focus_out (GtkIMContext *context)
{
GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
XIC ic = gtk_im_context_xim_get_ic (context_xim);
if (!ic)
return;
XUnsetICFocus (ic);
return;
}
static void static void
gtk_im_context_xim_reset (GtkIMContext *context) gtk_im_context_xim_reset (GtkIMContext *context)
{ {