+ ´Ø¿ô minput_get_variables () ¤Ï¡¢$LANGUAGE ¤È $NAME ¤Ë¤è¤Ã¤Æ»ØÄꤵ
+ ¤ì¤¿ÆþÎϥ᥽¥Ã¥É¤Î¿¶¤ëÉñ¤¤¤òÀ©¸æ¤¹¤ëÊÑ¿ô¤Î¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È
+ (#MPlist) ¤òÊÖ¤¹¡£¤³¤Î¥ê¥¹¥È¤Ï @e well-formed ¤Ç¤¢¤ê(#m17nPlist) °Ê
+ ²¼¤Î·Á¼°¤Ç¤¢¤ë¡£
+
+@verbatim
+ (VARNAME (DOC-MTEXT DEFAULT-VALUE [ VALUE ... ] )
+ VARNAME (DOC-MTEXT DEFAULT-VALUE [ VALUE ... ] )
+ ...)
+@endverbatim
+
+ @c VARNAME ¤ÏÊÑ¿ô¤Î̾Á°¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£
+
+ @c DOC-MTEXT ¤ÏÊÑ¿ô¤òÀâÌÀ¤¹¤ë M-text ¤Ç¤¢¤ë¡£
+
+ @c DEFAULT-VALUE ¤ÏÊÑ¿ô¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤǤ¢¤ê¡¢¥·¥ó¥Ü¥ë¡¢À°¿ô¤â¤·¤¯¤Ï
+ M-text ¤Ç¤¢¤ë¡£
+
+ @c VALUE ¤Ï¡¢¤â¤·»ØÄꤵ¤ì¤Æ¤¤¤ì¤ÐÊÑ¿ô¤Î¼è¤êÆÀ¤ëÃͤò¼¨¤¹¡£¤â¤·
+ @c DEFAULT-VALUE ¤¬À°¿ô¤Ê¤é¡¢ @c VALUE ¤Ï (@c FROM @c TO) ¤È¤¤¤¦·Á
+ ¤Î¥ê¥¹¥È¤Ç¤âÎɤ¤¡£¤³¤Î¾ì¹ç @c FROM ¤È @c TO ¤Ï²Äǽ¤ÊÃͤÎÈϰϤò¼¨¤¹¡£
+
+ Îã¤È¤·¤Æ¡¢¤¢¤ëÆþÎϥ᥽¥Ã¥É¤¬¼¡¤Î¤è¤¦¤ÊÊÑ¿ô¤ò»ý¤Ä¾ì¹ç¤ò¹Í¤¨¤è¤¦¡£
+
+ @li name:intvar, ÀâÌÀ:"value is an integer",
+ ½é´üÃÍ:0, ÃͤÎÈÏ°Ï:0..3,10,20
+
+ @li name:symvar, ÀâÌÀ:"value is a symbol",
+ ½é´üÃÍ:nil, ÃͤÎÈÏ°Ï:a, b, c, nil
+
+ @li name:txtvar, ÀâÌÀ:"value is an M-text",
+ ½é´üÃÍ:empty text, ÃͤÎÈϰϤʤ·(¤É¤ó¤Ê M-text ¤Ç¤â²Ä)
+
+ ¤³¤Î¾ì¹ç¡¢ÊÖ¤µ¤ì¤ë¥ê¥¹¥È¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£
+
+@verbatim
+ (intvar ("value is an integer" 0 (0 3) 10 20)
+ symvar ("value is a symbol" nil a b c nil)
+ txtvar ("value is an M-text" ""))
+@endverbatim
+
+ @return
+ ÆþÎϥ᥽¥Ã¥É¤¬²¿¤é¤«¤ÎÊÑ¿ô¤ò»ÈÍѤ·¤Æ¤¤¤ì¤Ð #MPlist ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
+ ÊÖ¤µ¤ì¤ë¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Ï¥é¥¤¥Ö¥é¥ê¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤ª¤ê¡¢¸Æ¤Ó½Ð¤·Â¦¤ÇÊѹ¹¤·¤¿¤ê²òÊü¤·¤¿¤ê¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+ ÆþÎϥ᥽¥Ã¥É¤¬ÊÑ¿ô¤ò°ìÀÚ»ÈÍѤ·¤Æ¤Ê¤±¤ì¤Ð¡¢@c NULL ¤òÊÖ¤¹¡£ */
+
+MPlist *
+minput_get_variables (MSymbol language, MSymbol name)
+{
+ MInputMethodInfo *im_info;
+ MPlist *vars;
+
+ MINPUT__INIT ();
+
+ im_info = get_im_info (language, name, Mnil, Mvariable);
+ if (! im_info || ! im_info->configured_vars)
+ return NULL;
+
+ M17N_OBJECT_UNREF (im_info->bc_vars);
+ im_info->bc_vars = mplist ();
+ MPLIST_DO (vars, im_info->configured_vars)
+ {
+ MPlist *plist = MPLIST_PLIST (vars);
+ MPlist *elt = mplist ();
+
+ mplist_push (im_info->bc_vars, Mplist, elt);
+ mplist_add (elt, Msymbol, MPLIST_SYMBOL (plist));
+ elt = MPLIST_NEXT (elt);
+ mplist_set (elt, Mplist, mplist_copy (MPLIST_NEXT (plist)));
+ M17N_OBJECT_UNREF (elt);
+ }
+ return im_info->bc_vars;
+}
+
+/*=*/
+
+/***en
+ @brief Set the initial value of an input method variable.
+
+ The minput_set_variable () function sets the initial value of
+ input method variable $VARIABLE to $VALUE for the input method
+ specified by $LANGUAGE and $NAME.
+
+ By default, the initial value is 0.
+
+ This setting gets effective in a newly opened input method.
+
+ @return
+ If the operation was successful, 0 is returned. Otherwise -1 is
+ returned, and #merror_code is set to #MERROR_IM. */
+/***ja
+ @brief ÆþÎϥ᥽¥Ã¥ÉÊÑ¿ô¤Î½é´üÃͤòÀßÄꤹ¤ë.
+
+ ´Ø¿ô minput_set_variable () ¤Ï¡¢$LANGUAGE ¤È $NAME
+ ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿ÆþÎϥ᥽¥Ã¥É¤ÎÆþÎϥ᥽¥Ã¥ÉÊÑ¿ô $VARIABLE
+ ¤Î½é´üÃͤò¡¢ $VALUE ¤ËÀßÄꤹ¤ë¡£
+
+ ¥Ç¥Õ¥©¥ë¥È¤Î½é´üÃÍ¤Ï 0 ¤Ç¤¢¤ë¡£
+
+ ¤³¤ÎÀßÄê¤Ï¡¢¿·¤·¤¯¥ª¡¼¥×¥ó¤µ¤ì¤¿ÆþÎϥ᥽¥Ã¥É¤«¤é͸ú¤È¤Ê¤ë¡£
+
+ @return
+ ½èÍý¤¬À®¸ù¤¹¤ì¤Ð 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤·¡¢
+ #merror_code ¤ò #MERROR_IM ¤ËÀßÄꤹ¤ë¡£ */
+
+int
+minput_set_variable (MSymbol language, MSymbol name,
+ MSymbol variable, void *value)
+{
+ MPlist *plist, *pl;
+ MInputMethodInfo *im_info;
+ int ret;
+
+ MINPUT__INIT ();
+
+ if (variable == Mnil)
+ MERROR (MERROR_IM, -1);
+ plist = minput_get_variable (language, name, variable);
+ plist = MPLIST_PLIST (plist);
+ plist = MPLIST_NEXT (plist);
+ pl = mplist ();
+ mplist_add (pl, MPLIST_KEY (plist), value);
+ ret = minput_config_variable (language, name, variable, pl);
+ M17N_OBJECT_UNREF (pl);
+ if (ret == 0)
+ {
+ im_info = get_im_info (language, name, Mnil, Mvariable);
+ im_info->tick = 0;
+ }
+ return ret;
+}
+
+/*=*/
+
+/***en
+ @brief Get information about input method commands.
+
+ The minput_get_commands () function returns information about
+ input method commands of the input method specified by $LANGUAGE
+ and $NAME. An input method command is a pseudo key event to which
+ one or more actual input key sequences are assigned.
+
+ There are two kinds of commands, global and local. Global
+ commands are used by multiple input methods for the same purpose,
+ and have global key assignments. Local commands are used only by
+ a specific input method, and have only local key assignments.
+
+ Each input method may locally change key assignments for global
+ commands. The global key assignment for a global command is
+ effective only when the current input method does not have local
+ key assignments for that command.
+
+ If $NAME is #Mnil, information about global commands is returned.
+ In this case $LANGUAGE is ignored.
+
+ If $NAME is not #Mnil, information about those commands that have
+ local key assignments in the input method specified by $LANGUAGE
+ and $NAME is returned.
+
+ @return
+ If no input method commands are found, this function returns @c NULL.
+
+ Otherwise, a pointer to a plist is returned. The key of each
+ element in the plist is a symbol representing a command, and the
+ value is a plist of the form COMMAND-INFO described below.
+
+ The first element of COMMAND-INFO has the key #Mtext, and the
+ value is an M-text describing the command.
+
+ If there are no more elements, that means no key sequences are
+ assigned to the command. Otherwise, each of the remaining
+ elements has the key #Mplist, and the value is a plist whose keys are
+ #Msymbol and values are symbols representing input keys, which are
+ currently assigned to the command.
+
+ As the returned plist is kept in the library, the caller must not
+ modify nor free it. */
+/***ja
+ @brief ÆþÎϥ᥽¥Ã¥É¤Î¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó¤òÆÀ¤ë.
+
+ ´Ø¿ô minput_get_commands () ¤Ï¡¢ $LANGUAGE ¤È $NAME ¤Ë¤è¤Ã¤Æ»ØÄꤵ
+ ¤ì¤¿ÆþÎϥ᥽¥Ã¥É¤ÎÆþÎϥ᥽¥Ã¥É¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÖ¤¹¡£ÆþÎϥ᥽¥Ã
+ ¥É¥³¥Þ¥ó¥É¤È¤Ï¡¢µ¿»÷¥¡¼¥¤¥Ù¥ó¥È¤Ç¤¢¤ê¡¢¤½¤ì¤¾¤ì¤Ë£±¤Ä°Ê¾å¤Î¼ÂºÝ¤Î
+ ÆþÎÏ¥¡¼¥·¡¼¥¯¥¨¥ó¥¹¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¤â¤Î¤ò»Ø¤¹¡£
+
+ ¥³¥Þ¥ó¥É¤Ë¤Ï¥°¥í¡¼¥Ð¥ë¤È¥í¡¼¥«¥ë¤Î£²¼ïÎब¤¢¤ë¡£¥°¥í¡¼¥Ð¥ë¥³¥Þ¥ó¥É
+ ¤ÏÊ£¿ô¤ÎÆþÎϥ᥽¥Ã¥É¤Ë¤ª¤¤¤Æ¡¢Æ±¤¸ÌÜŪ¤Ç¡¢¥°¥í¡¼¥Ð¥ë¤Ê¥¡¼³ä¤êÅö¤Æ
+ ¤ÇÍѤ¤¤é¤ì¤ë¡£¥í¡¼¥«¥ë¥³¥Þ¥ó¥É¤ÏÆÃÄê¤ÎÆþÎϥ᥽¥Ã¥É¤Ç¤Î¤ß¡¢¥í¡¼¥«¥ë
+ ¤Ê¥¡¼³äÅö¤Ç»ÈÍѤµ¤ì¤ë¡£
+
+ ¸Ä¡¹¤ÎÆþÎϥ᥽¥Ã¥É¤Ï¥°¥í¡¼¥Ð¥ë¥³¥Þ¥ó¥É¤Î¥¡¼³äÅö¤òÊѹ¹¤¹¤ë¤³¤È¤â¤Ç
+ ¤¤ë¡£¥°¥í¡¼¥Ð¥ë¥³¥Þ¥ó¥ÉÍѤΥ°¥í¡¼¥Ð¥ë¥¡¼³ä¤êÅö¤Æ¤Ï¡¢»ÈÍѤ¹¤ëÆþÎÏ
+ ¥á¥½¥Ã¥É¤Ë¤ª¤¤¤Æ¤½¤Î¥³¥Þ¥ó¥ÉÍÑ¤Î¥í¡¼¥«¥ë¤Ê¥¡¼³äÅö¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç
+ ¤Ë¤Î¤ß͸ú¤Ç¤¢¤ë¡£
+
+ $NAME ¤¬ #Mnil ¤Ç¤¢¤ì¤Ð¡¢¥°¥í¡¼¥Ð¥ë¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÖ¤¹¡£¤³¤Î
+ ¾ì¹ç¡¢$LANGUAGE ¤Ï̵»ë¤µ¤ì¤ë¡£
+
+ $NAME ¤¬ #Mnil ¤Ç¤Ê¤±¤ì¤Ð¡¢$LANGUAGE ¤È $NAME ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤ëÆþ
+ Îϥ᥽¥Ã¥É¤ËÃÖ¤±¤ë¥í¡¼¥«¥ë¤Ê¥¡¼³ä¤êÅö¤Æ¤ò»ý¤Ä¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó
+ ¤òÊÖ¤¹¡£
+
+ @return
+ ÆþÎϥ᥽¥Ã¥É¥³¥Þ¥ó¥É¤¬¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð¡¢¤³¤Î´Ø¿ô¤Ï @c NULL ¤òÊÖ¤¹¡£
+
+ ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¥ê¥¹¥È¤Î³ÆÍ×ÁǤÎ
+ ¥¡¼¤Ï¸Ä¡¹¤Î¥³¥Þ¥ó¥É¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢Ãͤϲ¼µ¤Î COMMAND-INFO
+ ¤Î·Á¼°¤Î¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Ç¤¢¤ë¡£
+
+ COMMAND-INFO ¤ÎÂè°ìÍ×ÁǤΥ¡¼¤Ï #Mtext ¤Þ¤¿¤Ï #Msymbol ¤Ç¤¢¤ë¡£¥¡¼
+ ¤¬ #Mtext ¤Ê¤é¡¢ÃͤϤ½¤Î¥³¥Þ¥ó¥É¤òÀâÌÀ¤¹¤ë M-text ¤Ç¤¢¤ë¡£¥¡¼¤¬
+ #Msymbol ¤Ê¤éÃÍ¤Ï #Mnil ¤Ç¤¢¤ê¡¢¤³¤Î¥³¥Þ¥ó¥É¤ÏÀâÌÀ¥Æ¥¥¹¥È¤ò»ý¤¿¤Ê
+ ¤¤¤³¤È¤Ë¤Ê¤ë¡£
+
+ ¤½¤ì°Ê³°¤ÎÍ×ÁǤ¬Ìµ¤±¤ì¤Ð¡¢¤³¤Î¥³¥Þ¥ó¥É¤ËÂФ·¤Æ¥¡¼¥·¡¼¥¯¥¨¥ó¥¹¤¬³ä
+ ¤êÅö¤Æ¤é¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢»Ä¤ê¤Î³ÆÍ×ÁǤϥ
+ ¡¼¤È¤·¤Æ#Mplist ¤ò¡¢ÃͤȤ·¤Æ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤ò»ý¤Ä¡£¤³¤Î¥×¥í¥Ñ¥Æ¥£
+ ¥ê¥¹¥È¤Î¥¡¼¤Ï #Msymbol ¤Ç¤¢¤ê¡¢Ãͤϸ½ºß¤½¤Î¥³¥Þ¥ó¥É¤Ë³ä¤êÅö¤Æ¤é¤ì
+ ¤Æ¤¤¤ëÆþÎÏ¥¡¼¤òɽ¤¹¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£
+
+ ÊÖ¤µ¤ì¤ë¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Ï¥é¥¤¥Ö¥é¥ê¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤ª¤ê¡¢¸Æ¤Ó½Ð
+ ¤·Â¦¤ÇÊѹ¹¤·¤¿¤ê²òÊü¤·¤¿¤ê¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£*/
+
+MPlist *
+minput_get_commands (MSymbol language, MSymbol name)
+{
+ MInputMethodInfo *im_info;
+ MPlist *cmds;
+
+ MINPUT__INIT ();
+
+ im_info = get_im_info (language, name, Mnil, Mcommand);
+ if (! im_info || ! im_info->configured_vars)
+ return NULL;
+ M17N_OBJECT_UNREF (im_info->bc_cmds);
+ im_info->bc_cmds = mplist ();
+ MPLIST_DO (cmds, im_info->configured_cmds)
+ {
+ MPlist *plist = MPLIST_PLIST (cmds);
+ MPlist *elt = mplist ();
+
+ mplist_push (im_info->bc_cmds, Mplist, elt);
+ mplist_add (elt, MPLIST_SYMBOL (plist),
+ mplist_copy (MPLIST_NEXT (plist)));
+ M17N_OBJECT_UNREF (elt);
+ }
+ return im_info->bc_cmds;
+}
+
+/*=*/
+
+/***en
+ @brief Assign a key sequence to an input method command (obsolete).
+
+ This function is obsolete. Use minput_config_command () instead.
+
+ The minput_assign_command_keys () function assigns input key
+ sequence $KEYSEQ to input method command $COMMAND for the input
+ method specified by $LANGUAGE and $NAME. If $NAME is #Mnil, the
+ key sequence is assigned globally no matter what $LANGUAGE is.
+ Otherwise the key sequence is assigned locally.
+
+ Each element of $KEYSEQ must have the key $Msymbol and the value
+ must be a symbol representing an input key.
+
+ $KEYSEQ may be @c NULL, in which case, all assignments are deleted
+ globally or locally.
+
+ This assignment gets effective in a newly opened input method.
+
+ @return
+ If the operation was successful, 0 is returned. Otherwise -1 is
+ returned, and #merror_code is set to #MERROR_IM. */
+/***ja
+ @brief ÆþÎϥ᥽¥Ã¥É¥³¥Þ¥ó¥É¤Ë¥¡¼¥·¡¼¥¯¥¨¥ó¥¹¤ò³ä¤êÅö¤Æ¤ë.
+
+ ´Ø¿ô minput_assign_command_keys () ¤Ï¡¢ $LANGUAGE ¤È $NAME ¤Ë¤è¤Ã¤Æ
+ »ØÄꤵ¤ì¤¿ÆþÎϥ᥽¥Ã¥ÉÍѤÎÆþÎϥ᥽¥Ã¥É¥³¥Þ¥ó¥É $COMMAND ¤ËÂФ·¤Æ¡¢
+ ÆþÎÏ¥¡¼¥·¡¼¥¯¥¨¥ó¥¹ $KEYSEQ ¤ò³ä¤êÅö¤Æ¤ë¡£ $NAME ¤¬ #Mnil ¤Ê¤é¤Ð¡¢
+ $LANGUAGE ¤Ë´Ø·¸¤Ê¤¯¡¢ÆþÎÏ¥¡¼¥·¡¼¥¯¥¨¥ó¥¹¤Ï¥°¥í¡¼¥Ð¥ë¤Ë³ä¤êÅö¤Æ¤é
+ ¤ì¤ë¡£¤½¤¦¤Ç¤Ê¤ì¤Ð¡¢³ä¤êÅö¤Æ¤Ï¥í¡¼¥«¥ë¤Ç¤¢¤ë¡£
+
+ $KEYSEQ ¤Î³ÆÍ×ÁǤϥ¡¼¤È¤·¤Æ $Msymbol ¤ò¡¢ÃͤȤ·¤ÆÆþÎÏ¥¡¼¤òɽ¤¹¥·
+ ¥ó¥Ü¥ë¤ò»ý¤¿¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+
+ $KEYSEQ ¤Ï @c NULL ¤Ç¤â¤è¤¤¡£¤³¤Î¾ì¹ç¡¢¥°¥í¡¼¥Ð¥ë¤â¤·¤¯¤Ï¥í¡¼¥«¥ë¤Ê
+ ¤¹¤Ù¤Æ¤Î³ä¤êÅö¤Æ¤¬¾Ãµî¤µ¤ì¤ë¡£
+
+ ¤³¤Î³ä¤êÅö¤Æ¤Ï¡¢³ä¤êÅö¤Æ°Ê¹ß¿·¤·¤¯¥ª¡¼¥×¥ó¤µ¤ì¤¿ÆþÎϥ᥽¥Ã¥É¤«¤éÍ
+ ¸ú¤Ë¤Ê¤ë¡£
+
+ @return ½èÍý¤¬À®¸ù¤¹¤ì¤Ð 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤·¡¢
+ #merror_code ¤ò #MERROR_IM ¤ËÀßÄꤹ¤ë¡£ */
+
+int
+minput_assign_command_keys (MSymbol language, MSymbol name,
+ MSymbol command, MPlist *keyseq)
+{
+ int ret;
+
+ MINPUT__INIT ();
+
+ if (command == Mnil)
+ MERROR (MERROR_IM, -1);
+ if (keyseq)
+ {
+ MPlist *plist;
+
+ if (! check_command_keyseq (keyseq))
+ MERROR (MERROR_IM, -1);
+ plist = mplist ();
+ mplist_add (plist, Mplist, keyseq);
+ keyseq = plist;
+ }
+ else
+ keyseq = mplist ();
+ ret = minput_config_command (language, name, command, keyseq);
+ M17N_OBJECT_UNREF (keyseq);
+ return ret;
+}
+
+/*=*/
+
+/***en
+ @brief Call a callback function
+
+ The minput_callback () functions calls a callback function
+ $COMMAND assigned for the input context $IC. The caller must set
+ specific elements in $IC->plist if the callback function requires.
+
+ @return
+ If there exists a specified callback function, 0 is returned.
+ Otherwise -1 is returned. By side effects, $IC->plist may be
+ modified. */
+
+int
+minput_callback (MInputContext *ic, MSymbol command)
+{
+ MInputCallbackFunc func;
+
+ if (! ic->im->driver.callback_list)
+ return -1;
+ func = ((MInputCallbackFunc)
+ mplist_get_func (ic->im->driver.callback_list, command));
+ if (! func)
+ return -1;
+ (func) (ic, command);
+ return 0;
+}
+
+/*** @} */