add set_cursor_pos() virtual method
2001-03-14 HideToshi Tajima <tajima@happy.sunsoft.eng.sun.com> * gtk/gtkimmulticontext.c (gtk_im_multicontext_set_cursor_pos): * gtk/gtkimcontext.c (gtk_im_context_set_cursor_pos): * gtk/gtkimcontext.h (struct _GtkIMContextClass): add set_cursor_pos() virtual method * modules/input/gtkimcontextxim.c (gtk_im_context_xim_class_init): (gtk_im_context_xim_set_cursor_pos): add implementation for set_cursor_pos() method * gtk/gtkentry.c (recompute_idle_func): set current cursor position to input methods
This commit is contained in:
committed by
Hidetoshi Tajima
parent
cf89a05f07
commit
02f376a91f
@ -40,6 +40,8 @@ static gboolean gtk_im_context_xim_filter_keypress (GtkIMContext *co
|
||||
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_set_cursor_pos (GtkIMContext *context,
|
||||
GdkRectangle *area);
|
||||
static void gtk_im_context_xim_get_preedit_string (GtkIMContext *context,
|
||||
gchar **str,
|
||||
PangoAttrList **attrs,
|
||||
@ -213,6 +215,7 @@ gtk_im_context_xim_class_init (GtkIMContextXIMClass *class)
|
||||
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;
|
||||
im_context_class->set_cursor_pos = gtk_im_context_xim_set_cursor_pos;
|
||||
gobject_class->finalize = gtk_im_context_xim_finalize;
|
||||
}
|
||||
|
||||
@ -391,6 +394,33 @@ gtk_im_context_xim_focus_out (GtkIMContext *context)
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_xim_set_cursor_pos (GtkIMContext *context,
|
||||
GdkRectangle *area)
|
||||
{
|
||||
GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
|
||||
XIC ic = gtk_im_context_xim_get_ic (context_xim);
|
||||
|
||||
XVaNestedList preedit_attr;
|
||||
XPoint spot;
|
||||
|
||||
if (!ic)
|
||||
return;
|
||||
|
||||
spot.x = area->x;
|
||||
spot.y = area->y;
|
||||
|
||||
preedit_attr = XVaCreateNestedList (0,
|
||||
XNSpotLocation, &spot,
|
||||
0);
|
||||
XSetICValues (ic,
|
||||
XNPreeditAttributes, preedit_attr,
|
||||
NULL);
|
||||
XFree(preedit_attr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_xim_reset (GtkIMContext *context)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user