X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Finput-gui.c;h=440671375ac0b68f63a72c95882082fd8064fb5b;hb=fbe9e89384f0db66c42c3d15b88283e8d63f53ea;hp=60ebcc8c4a5577db8eb0eaa2ac5172f7c1c185aa;hpb=512769e7eb06bfa04ca9934d6879586ab6798afd;p=m17n%2Fm17n-lib.git diff --git a/src/input-gui.c b/src/input-gui.c index 60ebcc8..4406713 100644 --- a/src/input-gui.c +++ b/src/input-gui.c @@ -39,17 +39,16 @@ @addtogroup m17nInputMethodWin @brief ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¾å¤ÎÆþÎϥ᥽¥Ã¥É¤Î¥µ¥Ý¡¼¥È. - ÆþÎϥɥ饤¥Ð @c minput_gui_driver ¤Ï¡¢¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¾å¤ÇÍѤ¤¤é - ¤ì¤ëÆâÉôÆþÎϥ᥽¥Ã¥ÉÍѤǤ¢¤ë¡£¤³¤Î¥É¥é¥¤¥Ð¤ÏÆþÎÏ¥¹¥Ý¥Ã¥È¤Ë preedit - ¥Æ¥­¥¹¥È¤È status ¥Æ¥­¥¹¥È¤òɽ¼¨¤¹¤ë¡£¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï @c - minput_gui_driver ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ - - m17n-X ¥é¥¤¥Ö¥é¥ê¤Ï¡¢@c Mxim ¤È¸À¤¦Ì¾Á°¤ò»ý¤Ä³°ÉôÆþÎϥ᥽¥Ã¥É¤òÄó - ¶¡¤·¤Æ¤¤¤ë¡£¤³¤ì¤Ï XIM (X Input Method) ¤ò¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ÎÆþÎÏ¥¨ - ¥ó¥¸¥ó¤È¤·¤ÆÍøÍѤ¹¤ë¡£¥·¥ó¥Ü¥ë @c Mxim ¤Ï @c Minput_driver ¤È¤¤¤¦ - ¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ã¤Æ¤ª¤ê¡¢¤½¤ÎÃͤÏÆþÎϥɥ饤¥Ð @c minput_xim_driver - ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ ¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï @c minput_xim_driver ¤ÎÀâÌÀ¤ò - »²¾È¤Î¤³¤È¡£ */ + ÆþÎϥɥ饤¥Ð @c minput_gui_driver ¤Ï¡¢ + ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¾å¤ÇÍѤ¤¤é¤ì¤ëÆâÉôÆþÎϥ᥽¥Ã¥ÉÍѤΥɥ饤¥Ð¤Ç¤¢¤ë¡£ + ¤³¤Î¥É¥é¥¤¥Ð¤ÏÆþÎÏ¥¹¥Ý¥Ã¥È¤Ë preedit ¥Æ¥­¥¹¥È¤È status + ¥Æ¥­¥¹¥È¤òɽ¼¨¤¹¤ë¡£¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï @c minput_gui_driver ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ + + m17n-X ¥é¥¤¥Ö¥é¥ê¤Ï¡¢@c Mxim ¤È¸À¤¦Ì¾Á°¤ò»ý¤Ä³°ÉôÆþÎϥ᥽¥Ã¥É¤òÄ󶡤·¤Æ¤¤¤ë¡£¤³¤ì¤Ï + XIM (X Input Method) ¤ò¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ÎÆþÎÏ¥¨¥ó¥¸¥ó¤È¤·¤ÆÍøÍѤ¹¤ë¡£¥·¥ó¥Ü¥ë + @c Mxim ¤Ï @c Minput_driver ¤È¤¤¤¦¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ã¤Æ¤ª¤ê¡¢¤½¤ÎÃͤÏÆþÎϥɥ饤¥Ð + @c minput_xim_driver ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ ¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï + @c minput_xim_driver ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ */ /*=*/ @@ -60,6 +59,7 @@ #include #include +#include "config.h" #include "m17n-gui.h" #include "m17n-misc.h" #include "internal.h" @@ -483,6 +483,28 @@ win_callback (MInputContext *ic, MSymbol command) win_ic_info->candidates.mapped = 0; } } + else if (command == Minput_reset) + { + MInputCallbackFunc func; + + if (minput_default_driver.callback_list + && (func = ((MInputCallbackFunc) + mplist_get (minput_default_driver.callback_list, + Minput_reset)))) + { + MInputContextInfo *ic_info + = (MInputContextInfo *) win_ic_info->ic_info; + ic->info = ic_info; + (func) (ic, Minput_reset); + ic->info = win_ic_info; + } + if (ic->preedit_changed) + minput__callback (ic, Minput_preedit_draw); + if (ic->status_changed) + minput__callback (ic, Minput_status_draw); + if (ic->candidates_changed) + minput__callback (ic, Minput_candidates_draw); + } } static int @@ -524,8 +546,12 @@ minput__win_init () plist = mplist_add (plist, Minput_candidates_done, (void *) win_callback); plist = mplist_add (plist, Minput_set_spot, (void *) win_callback); plist = mplist_add (plist, Minput_toggle, (void *) win_callback); + plist = mplist_add (plist, Minput_reset, (void *) win_callback); } +#if 0 + /* This will make a caller of minput_method_open() pazzled. */ minput_driver = &minput_gui_driver; +#endif face_box_prop.width = 1; face_box_prop.color_top = face_box_prop.color_left @@ -583,9 +609,9 @@ minput__win_fini () pointer to the structure @c MInputGUIArgIC. See the documentation 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 - @c XEvent. In that case, $KEY is generated from $ARG. + If the argument $KEY of function minput_filter () is @c Mnil, the + argument $ARG must be a pointer to the object of type @c XEvent. + In that case, $KEY is generated from $ARG. The argument $ARG of the function minput_lookup () must be the same one as that of the function minput_filter (). */ @@ -593,26 +619,24 @@ minput__win_fini () /***ja @brief ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤ÎÆâÉôÆþÎϥ᥽¥Ã¥ÉÍÑÆþÎϥɥ饤¥Ð. - ÆþÎϥɥ饤¥Ð @c minput_gui_driver ¤Ï¡¢¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¾å¤ÇÍѤ¤¤é - ¤ì¤ëÆþÎϥ᥽¥Ã¥ÉÍѤǤ¢¤ë¡£ + ÆþÎϥɥ饤¥Ð @c minput_gui_driver + ¤Ï¡¢¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¾å¤ÇÍѤ¤¤é¤ì¤ëÆþÎϥ᥽¥Ã¥ÉÍѥɥ饤¥Ð¤Ç¤¢¤ë¡£ - ¤³¤Î¥É¥é¥¤¥Ð¤Ï¡¢´Ø¿ô minput_set_spot () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤¿ÆþÎÏ¥¹¥Ý¥Ã - ¥È¤Ë preedit ¥Æ¥­¥¹¥ÈÍѤΥµ¥Ö¥¦¥£¥ó¥É¥¦¤È status ¥Æ¥­¥¹¥ÈÍѤΥµ¥Ö - ¥¦¥£¥ó¥É¥¦¤òºî¤ê¡¢¤½¤ì¤¾¤ì¤òɽ¼¨¤¹¤ë¡£ + ¤³¤Î¥É¥é¥¤¥Ð¤Ï¡¢´Ø¿ô minput_set_spot () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤¿ÆþÎÏ¥¹¥Ý¥Ã¥È¤Ë + preedit ¥Æ¥­¥¹¥ÈÍѤΥµ¥Ö¥¦¥£¥ó¥É¥¦¤È status + ¥Æ¥­¥¹¥ÈÍѤΥµ¥Ö¥¦¥£¥ó¥É¥¦¤òºî¤ê¡¢¤½¤ì¤¾¤ì¤òɽ¼¨¤¹¤ë¡£ - ¥Þ¥¯¥í M17N_INIT () ¤ÏÊÑ¿ô @c minput_driver ¤ò¤³¤Î¥É¥é¥¤¥Ð - ¤Ø¤Î¥Ý¥¤¥ó¥¿¤ËÀßÄꤷ¡¢Á´¤Æ¤ÎÆâÉôÆþÎϥ᥽¥Ã¥É¤¬¤³¤Î¥É¥é¥¤¥Ð¤ò»È¤¦¤è - ¤¦¤Ë¤¹¤ë¡£ + ¥Þ¥¯¥í M17N_INIT () ¤ÏÊÑ¿ô @c minput_driver + ¤ò¤³¤Î¥É¥é¥¤¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿¤ËÀßÄꤷ¡¢Á´¤Æ¤ÎÆâÉôÆþÎϥ᥽¥Ã¥É¤¬¤³¤Î¥É¥é¥¤¥Ð¤ò»È¤¦¤è¤¦¤Ë¤¹¤ë¡£ ¤·¤¿¤¬¤Ã¤Æ¡¢@c minput_driver ¤¬¥Ç¥Õ¥©¥ë¥ÈÃͤΤޤޤǤ¢¤ì¤Ð¡¢minput_ - ¤Ç»Ï¤Þ¤ë̾Á°¤ò»ý¤Ä´Ø¿ô¤Î°ú¿ô¤Î¤¦¤Á¥É¥é¥¤¥Ð°Í¸¤Î¤â¤Î¤Ï°Ê²¼¤Î¤è¤¦¤Ë - ¤Ê¤ë¡£ + ¤Ç»Ï¤Þ¤ë̾Á°¤ò»ý¤Ä´Ø¿ô¤Î°ú¿ô¤Î¤¦¤Á¥É¥é¥¤¥Ð°Í¸¤Î¤â¤Î¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£ ´Ø¿ô minput_open_im () ¤Î°ú¿ô $ARG ¤Ï̵»ë¤µ¤ì¤ë¡£ - ´Ø¿ô minput_create_ic () ¤Î°ú¿ô $ARG ¤Ï¹½Â¤ÂÎ @c MInputGUIArgIC ¤Ø - ¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï @c MInputGUIArgIC ¤Î - ÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ + ´Ø¿ô minput_create_ic () ¤Î°ú¿ô $ARG ¤Ï¹½Â¤ÂÎ @c MInputGUIArgIC + ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï @c MInputGUIArgIC + ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ ´Ø¿ô minput_filter () ¤Î°ú¿ô $ARG ¤¬ @c Mnil ¤Î¾ì¹ç¡¢ $ARG ¤Ï @c XEvent ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤³¤Î¾ì¹ç @@ -633,8 +657,8 @@ MInputDriver minput_gui_driver; /***ja @brief "xim"¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë . - ÊÑ¿ô Mxim ¤Ï"xim"¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£"xim" ¤ÏÆþÎϥ᥽¥Ã - ¥É¥É¥é¥¤¥Ð #minput_xim_driver ¤Î̾Á°¤Ç¤¢¤ë¡£ */ + ÊÑ¿ô Mxim ¤Ï"xim"¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£"xim" + ¤ÏÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð #minput_xim_driver ¤Î̾Á°¤Ç¤¢¤ë¡£ */ MSymbol Mxim; @@ -661,9 +685,9 @@ MSymbol Mxim; the byte is bitwise anded by 0x1F and the Control modifier is cleared. - If $EVENT still has Shift, Control, Meta, Alt, Super, and/or Hyper - modifiers, the name is preceded by "S-", "C-", "M-", "A-", "s-", - and/or "H-" respectively in this order. + If $EVENT still has modifiers, the name is preceded by "H-" + (Hyper), "s-" (Super), "A-" (Alt), "M-" (Meta), "C-" (Control), + and/or "S-" (Shift) in this order. For instance, if the keysym name is "a" and the event has Shift, Meta, and Hyper modifiers, the resulting name is "H-M-A". @@ -673,29 +697,28 @@ MSymbol Mxim; /***ja @brief ¥¤¥Ù¥ó¥È¤òÆþÎÏ¥­¡¼¤ËÊÑ´¹¤¹¤ë. - ´Ø¿ô minput_name_to_key () ¤Ï¡¢$FRAME ¤Î¥¤¥Ù¥ó¥È $EVENT ¤ËÂбþ¤¹¤ë - ÆþÎÏ¥­¡¼¤òÊÖ¤¹¡£¤³¤³¤Ç¤Î¡ÖÂбþ¡×¤Ï¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à°Í¸¤Ç¤¢¤ë¡£ + ´Ø¿ô minput_event_to_key () ¤Ï¡¢$FRAME ¤Î¥¤¥Ù¥ó¥È $EVENT + ¤ËÂбþ¤¹¤ëÆþÎÏ¥­¡¼¤òÊÖ¤¹¡£¤³¤³¤Ç¤Î¡ÖÂбþ¡×¤Ï¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡£ - m17n-X ¥é¥¤¥Ö¥é¥ê¤Î¾ì¹ç¤Ë¤Ï¡¢$EVENT ¤Ï ¹½Â¤ÂÎ @c XKeyEvent ¤Ø¤Î¥Ý - ¥¤¥ó¥¿¤Ç¤¢¤ê¡¢¼¡¤Î¤è¤¦¤Ë½èÍý¤µ¤ì¤ë¡£ + m17n-X ¥é¥¤¥Ö¥é¥ê¤Î¾ì¹ç¤Ë¤Ï¡¢$EVENT ¤Ï ¹½Â¤ÂÎ @c XKeyEvent + ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ê¡¢¼¡¤Î¤è¤¦¤Ë½èÍý¤µ¤ì¤ë¡£ - ¤Þ¤º¡¢´Ø¿ô @c XKeysymToString ¤Ë¤è¤Ã¤Æ¡¢$EVENT ¤Î keysym ̾¤ò¼èÆÀ - ¤·¡¢¼¡¤¤¤Ç°Ê²¼¤ÎÊѹ¹¤ò²Ã¤¨¤ë¡£ + ¤Þ¤º¡¢´Ø¿ô @c XKeysymToString ¤Ë¤è¤Ã¤Æ¡¢$EVENT ¤Î keysym + ̾¤ò¼èÆÀ¤·¡¢¼¡¤¤¤Ç°Ê²¼¤ÎÊѹ¹¤ò²Ã¤¨¤ë¡£ - ̾Á°¤¬ "a" .. "z" ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤Ã¤Æ $EVENT ¤Ë Shift ¥â¥Ç¥£¥Õ¥¡¥¤ - ¥¢¤¬¤¢¤ì¤Ð¡¢Ì¾Á°¤Ï¤½¤ì¤¾¤ì "A" .. "Z" ¤ËÊÑ´¹¤µ¤ì¡¢Shift ¥â¥Ç¥£¥Õ¥¡ - ¥¤¥¢¤Ï¼è¤ê½ü¤«¤ì¤ë¡£ + ̾Á°¤¬ "a" .. "z" ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤Ã¤Æ $EVENT ¤Ë Shift + ¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤¬¤¢¤ì¤Ð¡¢Ì¾Á°¤Ï¤½¤ì¤¾¤ì "A" .. "Z" ¤ËÊÑ´¹¤µ¤ì¡¢Shift + ¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤Ï¼è¤ê½ü¤«¤ì¤ë¡£ - ̾Á°¤¬£±¥Ð¥¤¥ÈĹ¤Ç $EVENT ¤Ë Control ¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤¬¤¢¤ì¤Ð¡¢Ì¾Á° - ¤È 0x1F ¤ò¥Ó¥Ã¥Èñ°Ì and ±é»»¤¹¤ë¡£Control ¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤Ï¼è¤ê½ü - ¤«¤ì¤ë¡£ + ̾Á°¤¬£±¥Ð¥¤¥ÈĹ¤Ç $EVENT ¤Ë Control ¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤¬¤¢¤ì¤Ð¡¢Ì¾Á°¤È + 0x1F ¤È¤ò¥Ó¥Ã¥Èñ°Ì¤Ç and ±é»»¤·¡¢Control ¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤Ï¼è¤ê½ü¤«¤ì¤ë¡£ - $EVENT ¤Ë¤Þ¤À Shift, Control, Meta, Alt, Super, Hyper ¤Ê¤É¤Î¥â¥Ç¥£ - ¥Õ¥¡¥¤¥¢¤¬¤¢¤ì¤Ð¡¢Ì¾Á°¤ÎÁ°¤Ë¤½¤ì¤¾¤ì"S-", "C-", "M-", "A-", "s-", - "H-" ¤¬ÉÕ¤¯¡£ + ¤½¤ì¤Ç¤â $EVENT ¤Ë¤Þ¤À¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤¬¤¢¤ì¤Ð¡¢Ì¾Á°¤ÎÁ°¤Ë¤½¤ì¤¾¤ì + "H-" (Hyper), "s-" (Super), "A-" (Alt), "M-" (Meta), "C-" + (Control), "S-" (Shift) ¤¬¤³¤Î½çÈÖ¤ÇÉÕ¤¯¡£ - ¤¿¤È¤¨¤Ð¡¢keysym ̾¤¬ "a" ¤Ç¥¤¥Ù¥ó¥È¤¬ Shift, Meta, and Hyper ¥â¥Ç¥£ - ¥Õ¥¡¥¤¥¢¤ò»ý¤Æ¤Ð¡¢ÆÀ¤é¤ì¤ë̾Á°¤Ï "H-M-A" ¤Ç¤¢¤ë¡£ + ¤¿¤È¤¨¤Ð¡¢keysym ̾¤¬ "a" ¤Ç¥¤¥Ù¥ó¥È¤¬ Shift, Meta, and Hyper + ¥â¥Ç¥£¥Õ¥¡¥¤¥¢¤ò»ý¤Æ¤Ð¡¢ÆÀ¤é¤ì¤ë̾Á°¤Ï "H-M-A" ¤Ç¤¢¤ë¡£ ºÇ¸å¤Ë¤½¤Î̾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤òÊÖ¤¹¡£*/