X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Finput-gui.c;h=c3d42023be0903e58604a7a8784440dbcc9d9c68;hb=62f77fab4e243f557ed9f9ec9d25e6690f935951;hp=904ac8bdbb780ea5c7ad2cf5b2cf47f5dcf799ab;hpb=3337b4afb316e3459cdc818cc73c703ab71a38dc;p=m17n%2Fm17n-lib.git diff --git a/src/input-gui.c b/src/input-gui.c index 904ac8b..c3d4202 100644 --- a/src/input-gui.c +++ b/src/input-gui.c @@ -27,13 +27,13 @@ The input driver @c minput_gui_driver is provided for internal input methods that is useful on window systems. It displays preedit text and status text at the inputting spot. See the - documentation of @c minput_gui_driver for more detail. + documentation of @c minput_gui_driver for more details. In the m17n-X library, the foreign input method of name @c Mxim is provided. It uses XIM (X Input Method) as a background input engine. The symbol @c Mxim has a property @c Minput_driver whose value is a pointer to the input driver @c minput_xim_driver. See - the documentation of @c minput_xim_driver for more detail. */ + the documentation of @c minput_xim_driver for more details. */ /***ja @addtogroup m17nInputMethodWin @@ -60,6 +60,7 @@ #include #include +#include "config.h" #include "m17n-gui.h" #include "m17n-misc.h" #include "internal.h" @@ -105,13 +106,13 @@ win_create_ic (MInputContext *ic) win_ic_info->ic_info = (MInputContextInfo *) ic->info; win_ic_info->frame = frame; win_ic_info->client.win = win_info->client; - mwin__window_geometry (frame, win_info->client, win_info->client, + (*frame->driver->window_geometry) (frame, win_info->client, win_info->client, &win_ic_info->client.geometry); win_ic_info->focus.win = win_info->focus; - mwin__window_geometry (frame, win_info->focus, win_info->client, + (*frame->driver->window_geometry) (frame, win_info->focus, win_info->client, &win_ic_info->focus.geometry); - win_ic_info->preedit.win = mwin__create_window (frame, win_info->client); + win_ic_info->preedit.win = (*frame->driver->create_window) (frame, win_info->client); win_ic_info->preedit.control.two_dimensional = 1; win_ic_info->preedit.control.as_image = 0; win_ic_info->preedit.control.with_cursor = 1; @@ -120,11 +121,11 @@ win_create_ic (MInputContext *ic) win_ic_info->preedit.geometry.x = -1; win_ic_info->preedit.geometry.y = -1; - win_ic_info->status.win = mwin__create_window (frame, win_info->client); + win_ic_info->status.win = (*frame->driver->create_window) (frame, win_info->client); win_ic_info->status.control.as_image = 1; win_ic_info->status.control.enable_bidi = 1; - win_ic_info->candidates.win = mwin__create_window (frame, win_info->client); + win_ic_info->candidates.win = (*frame->driver->create_window) (frame, win_info->client); win_ic_info->candidates.control.as_image = 1; ic->info = win_ic_info; @@ -137,10 +138,11 @@ win_destroy_ic (MInputContext *ic) { MInputGUIContextInfo *win_ic_info = (MInputGUIContextInfo *) ic->info; MInputContextInfo *ic_info = (MInputContextInfo *) win_ic_info->ic_info; + MFrame *frame = win_ic_info->frame; - mwin__destroy_window (win_ic_info->frame, win_ic_info->preedit.win); - mwin__destroy_window (win_ic_info->frame, win_ic_info->status.win); - mwin__destroy_window (win_ic_info->frame, win_ic_info->candidates.win); + (*frame->driver->destroy_window) (frame, win_ic_info->preedit.win); + (*frame->driver->destroy_window) (frame, win_ic_info->status.win); + (*frame->driver->destroy_window) (frame, win_ic_info->candidates.win); ic->info = ic_info; (*minput_default_driver.destroy_ic) (ic); free (win_ic_info); @@ -281,7 +283,7 @@ adjust_window_and_draw (MFrame *frame, MInputContext *ic, MText *mt, int type) } } - mwin__adjust_window (frame, win, geometry, &physical); + (*frame->driver->adjust_window) (frame, win, geometry, &physical); mdraw_text_with_control (frame, win, -x0, -y0, mt, 0, len, control); } @@ -298,7 +300,7 @@ win_callback (MInputContext *ic, MSymbol command) if (! win_ic_info->preedit.mapped) { - mwin__map_window (frame, win_ic_info->preedit.win); + (*frame->driver->map_window) (frame, win_ic_info->preedit.win); win_ic_info->preedit.mapped = 1; } win_ic_info->preedit.control.cursor_pos = ic->cursor_pos; @@ -352,7 +354,7 @@ win_callback (MInputContext *ic, MSymbol command) { if (win_ic_info->candidates.mapped) { - mwin__unmap_window (frame, win_ic_info->candidates.win); + (*frame->driver->unmap_window) (frame, win_ic_info->candidates.win); win_ic_info->candidates.mapped = 0; } return; @@ -360,7 +362,7 @@ win_callback (MInputContext *ic, MSymbol command) if (! win_ic_info->candidates.mapped) { - mwin__map_window (frame, win_ic_info->candidates.win); + (*frame->driver->map_window) (frame, win_ic_info->candidates.win); win_ic_info->candidates.mapped = 1; } @@ -446,7 +448,7 @@ win_callback (MInputContext *ic, MSymbol command) { if (win_ic_info->preedit.mapped) { - mwin__unmap_window (frame, win_ic_info->preedit.win); + (*frame->driver->unmap_window) (frame, win_ic_info->preedit.win); win_ic_info->preedit.mapped = 0; } } @@ -454,7 +456,7 @@ win_callback (MInputContext *ic, MSymbol command) { if (! win_ic_info->status.mapped) { - mwin__map_window (frame, win_ic_info->status.win); + (*frame->driver->map_window) (frame, win_ic_info->status.win); win_ic_info->status.mapped = 1; } } @@ -462,7 +464,7 @@ win_callback (MInputContext *ic, MSymbol command) { if (win_ic_info->status.mapped) { - mwin__unmap_window (frame, win_ic_info->status.win); + (*frame->driver->unmap_window) (frame, win_ic_info->status.win); win_ic_info->status.mapped = 0; } } @@ -470,7 +472,7 @@ win_callback (MInputContext *ic, MSymbol command) { if (! win_ic_info->candidates.mapped) { - mwin__map_window (frame, win_ic_info->candidates.win); + (*frame->driver->map_window) (frame, win_ic_info->candidates.win); win_ic_info->candidates.mapped = 1; } } @@ -478,7 +480,7 @@ win_callback (MInputContext *ic, MSymbol command) { if (win_ic_info->candidates.mapped) { - mwin__unmap_window (frame, win_ic_info->candidates.win); + (*frame->driver->unmap_window) (frame, win_ic_info->candidates.win); win_ic_info->candidates.mapped = 0; } } @@ -580,7 +582,7 @@ minput__win_fini () The argument $ARG of the function minput_create_ic () must be a pointer to the structure @c MInputGUIArgIC. See the documentation - of @c MInputGUIArgIC for more detail. + of @c MInputGUIArgIC for more details. If the argument $KEY is @c Mnil, the argument $ARG of the function minput_filter () must be a pointer to the object of type @@ -625,6 +627,21 @@ MInputDriver minput_gui_driver; /*=*/ /***en + @brief Symbol of the name "xim". + + The variable Mxim is a symbol of name "xim". It is a name of the + input method driver #minput_xim_driver. */ +/***ja + @brief "xim"¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë . + + ÊÑ¿ô Mxim ¤Ï"xim"¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£"xim" ¤ÏÆþÎϥ᥽¥Ã + ¥É¥É¥é¥¤¥Ð #minput_xim_driver ¤Î̾Á°¤Ç¤¢¤ë¡£ */ + +MSymbol Mxim; + +/*=*/ + +/***en @brief Convert an event to an input key. The minput_event_to_key () function returns the input key @@ -688,9 +705,11 @@ MSymbol minput_event_to_key (MFrame *frame, void *event) { int modifiers; - MSymbol key = mwin__parse_event (frame, event, &modifiers); + MSymbol key; char *name, *str; + M_CHECK_READABLE (frame, MERROR_IM, Mnil); + key = (*frame->driver->parse_event) (frame, event, &modifiers); if (! modifiers) return key;