(minput_list): Extern it.
[m17n/m17n-lib.git] / src / m17n.h
index 3b27698..1d3a855 100644 (file)
@@ -1,5 +1,5 @@
 /* m17n.h -- header file for the SHELL API of the m17n library.
-   Copyright (C) 2003, 2004
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
@@ -17,7 +17,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the m17n library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    02111-1307, USA.  */
 
 #ifndef _M17N_H_
 #include <m17n-core.h>
 #endif
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
+M17N_BEGIN_HEADER
 
 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
 extern void m17n_init (void);
 #undef M17N_INIT
+#ifdef _M17N_FLT_H_
+#define M17N_INIT()    \
+  do {                 \
+    m17n_init ();      \
+    m17n_init_flt ();  \
+  } while (0)
+#else  /* not _M17N_FLT_H_ */
 #define M17N_INIT() m17n_init ()
+#endif /* not _M17N_FLT_H_ */
 
 extern void m17n_fini (void);
 #undef M17N_FINI
+#ifdef _M17N_FLT_H_
+#define M17N_FINI()    \
+  do {                 \
+    m17n_fini_flt ();  \
+    m17n_fini ();      \
+  } while (0)
+#else  /* not _M17N_FLT_H_ */
 #define M17N_FINI() m17n_fini ()
+#endif /* not _M17N_FLT_H_ */
+
 #endif
 
-/***en @defgroup m17nShell SHELL API */
-/***ja @defgroup m17nShell ¥·¥§¥ë API */
+/***en @defgroup m17nShell SHELL API
+    @brief API provided by libm17n.so */
+/***ja @defgroup m17nShell ¥·¥§¥ë API
+    @brief libm17n.so ¤¬Ä󶡤¹¤ë API */
 /*=*/
 
 /*
@@ -55,51 +71,6 @@ extern void m17n_fini (void);
  */
 /*=*/
 
-/*** @ingroup m17nShell */
-/***en @defgroup m17nDatabase Database */
-/***ja @defgroup m17nDatabase ¥Ç¡¼¥¿¥Ù¡¼¥¹ */
-/*=*/
-
-/* Directory of an application specific databases.  */
-extern char *mdatabase_dir;
-/*=*/
-/***
-    @ingroup m17nDatabase  */ 
-/***en
-    @brief Type of database.
-
-    The type #MDatabase is for a database object.  Its internal
-    structure is concealed from an application program.  */
-/***ja 
-    @brief ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î·¿Àë¸À.
-
-    #MDatabase ·¿¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥ÈÍѤι½Â¤ÂΤǤ¢¤ë¡£
-    ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£
-    */
-
-typedef struct MDatabase MDatabase;
-
-/*=*/
-
-/* Look for a data.  */
-extern MDatabase *mdatabase_find (MSymbol tag1, MSymbol tag2,
-                                 MSymbol tag3, MSymbol tag4);
-
-extern MPlist *mdatabase_list (MSymbol tag0, MSymbol tag1,
-                              MSymbol tag2, MSymbol tag3);
-
-/* Load a data.  */
-void *mdatabase_load (MDatabase *mdb);
-
-/* Get tags of a data.  */
-extern MSymbol *mdatabase_tag (MDatabase *mdb);
-
-/* Define a data.  */
-extern MDatabase *mdatabase_define (MSymbol tag1, MSymbol tag2,
-                                   MSymbol tag3, MSymbol tag4,
-                                   void *(*loader) (MSymbol *, void *),
-                                   void *extra_info);
-
 /*=*/
 /* (S2) Charset staffs */
 /*=*/
@@ -145,8 +116,6 @@ extern MSymbol Msubset;
 extern MSymbol Msuperset;
 
 /* etc. */
-extern MSymbol Mcharset;
-
 extern MSymbol mchar_define_charset (const char *name, MPlist *plist);
 
 extern MSymbol mchar_resolve_charset (MSymbol symbol);
@@ -431,14 +400,12 @@ enum MCodingType
        The dimension of each charset defines the length of bytes to
        represent a single character of the charset, and a byte
        sequence directly represents the code-point of a character.
-
        The m17n library provides the default decoding and encoding
        routines of this type.  */
 
     /***ja
        ¤³¤Î¥¿¥¤¥×¤Î¥³¡¼¥É·Ï¤Ïʸ»ú¥»¥Ã¥È¤òľÀÜ¥µ¥Ý¡¼¥È¤¹¤ë¡£
        ³Æʸ»ú¥»¥Ã¥È¤Î¼¡¸µ¤È¤Ï¡¢¤½¤Îʸ»ú¥»¥Ã¥È¤Ç°ìʸ»ú¤òɽ¸½¤¹¤ë¤¿¤á¤ËɬÍפʥХ¤¥È¿ô¤Ç¤¢¤ê¡¢¥Ð¥¤¥ÈÎó¤Ïʸ»ú¤Î¥³¡¼¥É¥Ý¥¤¥ó¥È¤òľÀÜɽ¤¹¡£
-
        m17n ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥǥե©¥ë¥È¤Î¥¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤¹¤ë¡£  */
 
     MCODING_TYPE_CHARSET,
@@ -446,13 +413,11 @@ enum MCodingType
     /***en
        A coding system of this type supports byte sequences of a
        UTF (UTF-8, UTF-16, UTF-32) like structure.
-
        The m17n library provides the default decoding and encoding
        routines of this type.  */
 
     /***ja
        ¤³¤Î¥¿¥¤¥×¤Î¥³¡¼¥É·Ï¤Ï¡¢UTF ·Ï (UTF-8, UTF-16, UTF-32) ¤Î¥Ð¥¤¥ÈÎó¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£
-
        m17n ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥǥե©¥ë¥È¤Î¥¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤¹¤ë¡£  */
 
     MCODING_TYPE_UTF,
@@ -461,14 +426,12 @@ enum MCodingType
        A coding system of this type supports byte sequences of an
        ISO-2022 like structure.  The details of each structure are
        specified by @c MCodingInfoISO2022 .
-
        The m17n library provides decoding and encoding routines of
        this type.  */
 
     /***ja 
         ¤³¤Î¥¿¥¤¥×¤Î¥³¡¼¥É·Ï¤Ï¡¢ISO-2022 ·Ï¤Î¥Ð¥¤¥ÈÎó¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£
        ³Æ¥³¡¼¥É·Ï¤Î¹½Â¤¤Î¾ÜºÙ¤Ï @c MCodingInfoISO2022 ¤Ç»ØÄꤵ¤ì¤ë¡£
-
        m17n ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥǥե©¥ë¥È¤Î¥¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤¹¤ë¡£  */
 
     MCODING_TYPE_ISO_2022,
@@ -476,14 +439,12 @@ enum MCodingType
     /***en
        A coding system of this type is for byte sequences of
        miscellaneous structures.
-
        The m17n library does not provide decoding and encoding
        routines of this type.  They must be provided by the
        application program.  */
 
     /***ja
        ¤³¤Î¥¿¥¤¥×¤Î¥³¡¼¥É·Ï¤Ï¡¢¤½¤Î¾¤Î¹½Â¤¤Î¥Ð¥¤¥ÈÎó¤Î¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£
-
        m17n ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥ¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤·¤Ê¤¤¤Î¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¦¤Ç½àÈ÷¤¹¤ëɬÍפ¬¤¢¤ë¡£  */
 
     MCODING_TYPE_MISC
@@ -718,7 +679,7 @@ typedef struct
       ending by them.  On encoding, produce byte sequence according to
       @c endian with heading BOM.
 
-      If <code_unit_bits> is 8, the value has no meaning.  */
+      If \<code_unit_bits\> is 8, the value has no meaning.  */
 
   /***ja
       ÀèƬ¤Î BOM (¥Ð¥¤¥È¥ª¡¼¥À¡¼¥Þ¡¼¥¯) ¤Î¼è¤ê°·¤¤¤ò»ØÄꤹ¤ë¡£ÃͤϠ0,
@@ -741,12 +702,12 @@ typedef struct
       Specify the endian type.  The value must be 0 or 1.  0 means
       little endian, and 1 means big endian.
 
-      If <code_unit_bits> is 8, the value has no meaning.  */
+      If \<code_unit_bits\> is 8, the value has no meaning.  */
   /***ja
       ¥¨¥ó¥Ç¥£¥¢¥ó¤Î¥¿¥¤¥×¤ò»ØÄꤹ¤ë¡£ÃͤϠ0 ¤« 1 ¤Ç¤¢¤ê¡¢0 
       ¤Ê¤é¤Ð¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¡¢1 ¤Ê¤é¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ç¤¢¤ë¡£
 
-      <code_unit_bits> ¤¬ 8 ¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤ÎÃͤϰÕÌ£¤ò»ý¤¿¤Ê¤¤¡£
+      \<code_unit_bits\> ¤¬ 8 ¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤ÎÃͤϰÕÌ£¤ò»ý¤¿¤Ê¤¤¡£
   */
   int endian;
 } MCodingInfoUTF;
@@ -765,7 +726,8 @@ extern MSymbol mconv_resolve_coding (MSymbol symbol);
 
 extern int mconv_list_codings (MSymbol **symbols);
 
-extern MConverter *mconv_buffer_converter (MSymbol coding, unsigned char *buf,
+extern MConverter *mconv_buffer_converter (MSymbol coding,
+                                          const unsigned char *buf,
                                           int n);
 
 extern MConverter *mconv_stream_converter (MSymbol coding, FILE *fp);
@@ -775,13 +737,13 @@ extern int mconv_reset_converter (MConverter *converter);
 extern void mconv_free_converter (MConverter *converter);
 
 extern MConverter *mconv_rebind_buffer (MConverter *converter,
-                                       unsigned char *buf, int n);
+                                       const unsigned char *buf, int n);
 
 extern MConverter *mconv_rebind_stream (MConverter *converter, FILE *fp);
 
 extern MText *mconv_decode (MConverter *converter, MText *mt);
 
-MText *mconv_decode_buffer (MSymbol name, unsigned char *buf, int n);
+MText *mconv_decode_buffer (MSymbol name, const unsigned char *buf, int n);
 
 MText *mconv_decode_stream (MSymbol name, FILE *fp);   
 
@@ -837,11 +799,26 @@ typedef struct MLocale MLocale;
 
 /*=*/
 
-extern MSymbol Mlanguage;
+extern MSymbol Miso639_1, Miso639_2;
 extern MSymbol Mterritory;
 extern MSymbol Mmodifier;
 extern MSymbol Mcodeset;
 
+extern MPlist *mlanguage_list (void);
+
+extern MSymbol mlanguage_code (MSymbol language, int len);
+
+extern MPlist *mlanguage_name_list (MSymbol language, MSymbol target,
+                                   MSymbol script, MSymbol territory);
+
+extern MText *mlanguage_text (MSymbol language);
+
+extern MPlist *mscript_list (void);
+
+extern MPlist *mscript_language_list (MSymbol script);
+
+extern MSymbol mlanguage_name (MSymbol language);
+
 extern MLocale *mlocale_set (int category, const char *locale);
 
 extern MSymbol mlocale_get_prop (MLocale *locale, MSymbol key);
@@ -876,22 +853,28 @@ extern MText *mtext_toupper (MText *mt);
 
 /*** @addtogroup m17nInputMethod 
      @{ */
-
+/*=*/
 /* Struct forward declaration.  */
+/***
+    @brief See struct MInputMethod */
 typedef struct MInputMethod MInputMethod;
+/*=*/
+/***
+    @brief See struct MInputContext */
 typedef struct MInputContext MInputContext;
+/*=*/
 
 /***en
     @brief Type of input method callback functions.
 
     This is the type of callback functions called from input method
-    drivers.  #IC is a pointer to an input context, #COMMAND is a name
+    drivers.  $IC is a pointer to an input context, $COMMAND is a name
     of callback for which the function is called.   */
 /***ja
     @brief ÆþÎϥ᥽¥Ã¥É¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤Î·¿Àë¸À.
 
-    ÆþÎϥ᥽¥Ã¥É¤«¤é¸Æ¤Ð¤ì¤ë¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£#IC 
-    ¤ÏÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢#COMMAND ¤Ï´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¥³¡¼¥ë¥Ð¥Ã¥¯¤Î̾Á°¤Ç¤¢¤ë¡£  */
+    ÆþÎϥ᥽¥Ã¥É¤«¤é¸Æ¤Ð¤ì¤ë¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£$IC 
+    ¤ÏÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¡¢$COMMAND ¤Ï´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¥³¡¼¥ë¥Ð¥Ã¥¯¤Î̾Á°¤Ç¤¢¤ë¡£  */
 
 typedef void (*MInputCallbackFunc) (MInputContext *ic, MSymbol command);
 /*=*/
@@ -913,7 +896,7 @@ typedef struct MInputDriver
       @brief Open an input method.
 
       This function opens the input method $IM.  It is called from the
-      function minput_open_im () after all member of $IM but <info>
+      function minput_open_im () after all member of $IM but \<info\>
       set.  If opening $IM succeeds, it returns 0.  Otherwise, it
       returns -1.  The function can setup $IM->info to keep various
       information that is referred by the other driver functions.  */
@@ -921,7 +904,7 @@ typedef struct MInputDriver
   /***ja
       @brief ÆþÎϥ᥽¥Ã¥É¤ò¥ª¡¼¥×¥ó¤¹¤ë.
 
-      ¤³¤Î´Ø¿ô¤Ï¡¢ÆþÎϥ᥽¥Ã¥É $IM ¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£$IM ¤Î <info> 
+      ¤³¤Î´Ø¿ô¤Ï¡¢ÆþÎϥ᥽¥Ã¥É $IM ¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£$IM ¤Î \<info\> 
       °Ê³°¤ÎÁ´¥á¥ó¥Ð¡¼¤¬¥»¥Ã¥È¤µ¤ì¤¿¸å¤Ç¡¢´Ø¿ô minput_open_im () 
       ¤«¤é¸Æ¤Ð¤ì¤ë¡£$IM ¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ì¤Ð 0 ¤ò¡¢¤Ç¤­¤Ê¤±¤ì¤Ð -1¤òÊÖ¤¹¡£
       ¤³¤Î´Ø¿ô¤Ï $IM->info 
@@ -956,7 +939,7 @@ typedef struct MInputDriver
 
       This function creates the input context $IC.  It is called from
       the function minput_create_ic () after all members of $IC but
-      <info> are set.  If creating $IC succeeds, it returns 0.
+      \<info\> are set.  If creating $IC succeeds, it returns 0.
       Otherwise, it returns -1.  The function can setup $IC->info to
       keep various information that is referred by the other driver
       functions.  */
@@ -965,7 +948,7 @@ typedef struct MInputDriver
       @brief ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤òÀ¸À®¤¹¤ë.
 
       ¤³¤Î´Ø¿ô¤ÏÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È $IC ¤òÀ¸À®¤¹¤ë¡£
-      $IC ¤Î <info> °Ê³°¤ÎÁ´¥á¥ó¥Ð¡¼¤¬¥»¥Ã¥È¤µ¤ì¤¿¸å¤Ç¡¢´Ø¿ô
+      $IC ¤Î \<info\> °Ê³°¤ÎÁ´¥á¥ó¥Ð¡¼¤¬¥»¥Ã¥È¤µ¤ì¤¿¸å¤Ç¡¢´Ø¿ô
       minput_create_ic () ¤«¤é¸Æ¤Ð¤ì¤ë¡£
       $IC ¤òÀ¸À®¤Ç¤­¤ì¤Ð 0 ¤ò¡¢¤Ç¤­¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤¹¡£
       ¤³¤Î´Ø¿ô¤Ï $IC->info ¤òÀßÄꤷ¤Æ¡¢Â¾¤Î¥É¥é¥¤¥Ð´Ø¿ô¤«¤é»²¾È¤µ¤ì¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£  */
@@ -1005,7 +988,7 @@ typedef struct MInputDriver
 
       It may update $IC->status, $IC->preedit, $IC->cursor_pos,
       $IC->ncandidates, $IC->candidates, and $IC->produced if that is
-      necessary for the member <callback>.
+      necessary for the member \<callback\>.
 
       The meaning of $ARG depends on the input method river.  See the
       documentation of @c minput_default_driver and @c
@@ -1021,7 +1004,7 @@ typedef struct MInputDriver
       ¤¬ÆþÎϥ᥽¥Ã¥É¤ËµÛ¼ý¤µ¤ì¤Æ¥Æ¥­¥¹¥È¤¬À¸À®¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ 
       1 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£
 
-      ¥á¥ó¥Ð <callback> ¤ËɬÍפǤ¢¤ì¤Ð¡¢$IC->status, $IC->preedit,
+      ¥á¥ó¥Ð \<callback\> ¤ËɬÍפǤ¢¤ì¤Ð¡¢$IC->status, $IC->preedit,
       $IC->cursor_pos, $IC->ncandidates, $IC->candidates,
       $IC->produced ¤ò¹¹¿·¤Ç¤­¤ë¡£
 
@@ -1062,29 +1045,34 @@ typedef struct MInputDriver
       @brief List of callback functions.
 
       List of callback functions.  Keys are one of
-      #Minput_preedit_start, #Minput_preedit_draw,
-      #Minput_preedit_done, #Minput_status_start, #Minput_status_draw,
-      #Minput_status_done, #Minput_candidates_start,
-      #Minput_candidates_draw, #Minput_candidates_done,
-      #Minput_set_spot, #Minput_toggle, #Minput_reset.
+      @b Minput_preedit_start, @b Minput_preedit_draw,
+      @b Minput_preedit_done, @b Minput_status_start, @b Minput_status_draw,
+      @b Minput_status_done, @b Minput_candidates_start,
+      @b Minput_candidates_draw, @b Minput_candidates_done,
+      @b Minput_set_spot, @b Minput_toggle, @b Minput_reset,
+      @b Minput_get_surrounding_text, @b Minput_delete_surrounding_text.
       Values are functions of type #MInputCallbackFunc.  */
   /***ja
       @brief ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤Î¥ê¥¹¥È.
 
       ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤Î¥ê¥¹¥È¡£¥­¡¼¤Ï¼¡¤Î¤¤¤º¤ì¤«¡£
-      #Minput_preedit_start, #Minput_preedit_draw,
-      #Minput_preedit_done, #Minput_status_start, #Minput_status_draw,
-      #Minput_status_done, #Minput_candidates_start,
-      #Minput_candidates_draw, #Minput_candidates_done,
-      #Minput_set_spot, #Minput_toggle, #Minput_reset¡£ 
+      @b Minput_preedit_start, @b Minput_preedit_draw,
+      @b Minput_preedit_done, @b Minput_status_start, @b Minput_status_draw,
+      @b Minput_status_done, @b Minput_candidates_start,
+      @b Minput_candidates_draw, @b Minput_candidates_done,
+      @b Minput_set_spot, @b Minput_toggle, @b Minput_reset,
+      @b Minput_get_surrounding_text, @b Minput_delete_surrounding_text¡£
       ÃͤÏ#MInputCallbackFunc ·¿¤Î´Ø¿ô¡£  */
   MPlist *callback_list;
 
 } MInputDriver;
 /*=*/
+/*** @} */
+/*=*/
 
 extern MInputDriver minput_default_driver;
 
+extern MSymbol Minput_method;
 extern MSymbol Minput_driver;
 
 extern MInputDriver *minput_driver;
@@ -1102,7 +1090,22 @@ extern MSymbol Minput_candidates_done;
 extern MSymbol Minput_set_spot;
 extern MSymbol Minput_toggle;
 extern MSymbol Minput_reset;
+extern MSymbol Minput_get_surrounding_text;
+extern MSymbol Minput_delete_surrounding_text;
+
+/** Symbols for special input key event.  */
+extern MSymbol Minput_focus_move;
+extern MSymbol Minput_focus_in;
+extern MSymbol Minput_focus_out;
 
+/** Symbols describing input method command/variable.  */
+extern MSymbol Minherited;
+extern MSymbol Mcustomized;
+extern MSymbol Mconfigured;
+
+/*** @addtogroup m17nInputMethod 
+     @{ */
+/*=*/
 /***en
     @brief Structure of input method.
 
@@ -1136,15 +1139,32 @@ struct MInputMethod
   /***ja minput_open_im () ¤ËÅϤµ¤ì¤ë°ú¿ô¡£  */
   void *arg;
 
-  /***en Pointer to extra information that <driver>.open_im ()
+  /***en Pointer to extra information that \<driver\>.open_im ()
       setups. */
-  /***ja <driver>.open_im () ¤¬ÀßÄꤹ¤ëÄɲþðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ */
+  /***ja \<driver\>.open_im () ¤¬ÀßÄꤹ¤ëÄɲþðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ */
   void *info;
 };
 
 /*=*/
 
 /***en
+    @brief Bit-masks to specify how candidates of input method is changed.  */
+
+/***ja
+    @brief ÆþÎϥ᥽¥Ã¥É¤ÎÆþÎϸõÊ䤬¤É¤¦Êѹ¹¤µ¤ì¤¿¤«¤ò¼¨¤¹¥Ó¥Ã¥È¥Þ¥¹¥¯.  */
+
+enum MInputCandidatesChanged
+  {
+    MINPUT_CANDIDATES_LIST_CHANGED = 1,
+    MINPUT_CANDIDATES_INDEX_CHANGED = 2,
+    MINPUT_CANDIDATES_SHOW_CHANGED = 4,
+    MINPUT_CANDIDATES_CHANGED_MAX
+  };
+
+
+/*=*/
+
+/***en
     @brief Structure of input context.
 
     The type @c MInputContext is the structure of input context
@@ -1169,7 +1189,7 @@ struct MInputContext
       ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£  */
   MText *produced;
 
-  /***en Argument given to the function minput_create_im (). */
+  /***en Argument given to the function minput_create_ic (). */
   /***ja ´Ø¿ô minput_create_ic () ¤ËÅϤµ¤ì¤ë°ú¿ô¡£ */
   void *arg;
 
@@ -1200,23 +1220,23 @@ struct MInputContext
     /***ja ¥¹¥Ý¥Ã¥È¾å¤Î M-text¡¢¤Þ¤¿¤Ï NULL.  */
     MText *mt;
 
-    /***en Character position in <mt> at the spot.  */
-    /***ja <mt> ¤Ë¤ª¤±¤ë¥¹¥Ý¥Ã¥È¤Îʸ»ú°ÌÃÖ.  */
+    /***en Character position in \<mt\> at the spot.  */
+    /***ja \<mt\> ¤Ë¤ª¤±¤ë¥¹¥Ý¥Ã¥È¤Îʸ»ú°ÌÃÖ.  */
     int pos;
   } spot;
 
   /***en The usage of the following members depends on the input
       method driver.  The descriptions below are for the driver of an
       internal input method.  They are set by the function
-      <im>->driver.filter ().  */
+      \<im\>->driver.filter ().  */
   /***ja °Ê²¼¤Î¥á¥ó¥Ð¤Î»ÈÍÑË¡¤ÏÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
       °Ê²¼¤ÎÀâÌÀ¤Ï¡¢ÆâÉôÆþÎϥ᥽¥Ã¥ÉÍѤÎÆþÎϥɥ饤¥Ð¤ËÂФ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£
-      ¤³¤ì¤é¤Ï´Ø¿ô <im>->driver.filter () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£  */
+      ¤³¤ì¤é¤Ï´Ø¿ô \<im\>->driver.filter () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£  */
 
-  /***en Pointer to extra information that <im>->driver.create_ic ()
+  /***en Pointer to extra information that \<im\>->driver.create_ic ()
       setups.  It is used to record the internal state of the input
       context.  */
-  /***ja <im>->driver.create_ic () ¤¬ÀßÄꤹ¤ëÄɲþðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£
+  /***ja \<im\>->driver.create_ic () ¤¬ÀßÄꤹ¤ëÄɲþðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£
       ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤ÎÆâÉô¾õÂÖ¤òµ­Ï¿¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ */
   void *info;
 
@@ -1225,31 +1245,31 @@ struct MInputContext
   /***ja ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤Î¸½ºß¤Î¾õÂÖ¤òɽ¤¹ M-text  */
   MText *status;
 
-  /***en The function <im>->driver.filter () sets the value to 1 when
-      it changes <status>.  */
-  /***ja ´Ø¿ô <im>->driver.filter () ¤Ï¡¢<status> ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò 1 
+  /***en The function \<im\>->driver.filter () sets the value to 1 when
+      it changes \<status\>.  */
+  /***ja ´Ø¿ô \<im\>->driver.filter () ¤Ï¡¢\<status\> ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò 1 
       ¤ËÀßÄꤹ¤ë¡£  */
   int status_changed;
 
   /***en M-text containing the current preedit text.  The function
-      <im>->driver.filter () sets the value.  */
+      \<im\>->driver.filter () sets the value.  */
   /***ja ¸½ºß¤Î preedit ¥Æ¥­¥¹¥È¤ò´Þ¤à M-text¡£´Ø¿ô 
-      <im>->driver.filter () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£  */ 
+      \<im\>->driver.filter () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£  */ 
   MText *preedit;
 
-  /***en The function <im>->driver.filter () sets the value to 1 when
-      it changes <preedit>.  */
-  /***ja ´Ø¿ô <im>->driver.filter () ¤Ï¡¢<preedit> ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò 
+  /***en The function \<im\>->driver.filter () sets the value to 1 when
+      it changes \<preedit\>.  */
+  /***ja ´Ø¿ô \<im\>->driver.filter () ¤Ï¡¢\<preedit\> ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò 
       1 ¤ËÀßÄꤹ¤ë¡£  */
   int preedit_changed;
 
-  /***en Cursor position of <preedit>.  */
-  /***ja <preedit>¤Î¥«¡¼¥½¥ë°ÌÃÖ  */
+  /***en Cursor position of \<preedit\>.  */
+  /***ja \<preedit\>¤Î¥«¡¼¥½¥ë°ÌÃÖ  */
   int cursor_pos;
 
-  /***en The function <im>->driver.filter () sets the value to 1 when
-      it changes <cursor_pos>.  */
-  /***ja ´Ø¿ô <im>->driver.filter () ¤Ï¡¢<cursor_pos> ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò 
+  /***en The function \<im\>->driver.filter () sets the value to 1 when
+      it changes \<cursor_pos\>.  */
+  /***ja ´Ø¿ô \<im\>->driver.filter () ¤Ï¡¢\<cursor_pos\> ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò 
       1 ¤ËÀßÄꤹ¤ë¡£  */
   int cursor_pos_changed;
 
@@ -1275,42 +1295,50 @@ struct MInputContext
       */
   int candidate_index;
 
+  /* @{ */
   /***en Start and the end positions of the preedit text where
-       <candidate_list> corresponds to.  */
-  /***ja preedit ¥Æ¥­¥¹¥ÈÃæ¤Ç¡¢<candidate_list>¤ËÂбþ¤¹¤ëºÇ½é¤ÈºÇ¸å¤Î°ÌÃÖ¡£
+       \<candidate_list\> corresponds to.  */
+  /***ja preedit ¥Æ¥­¥¹¥ÈÃæ¤Ç¡¢\<candidate_list\>¤ËÂбþ¤¹¤ëºÇ½é¤ÈºÇ¸å¤Î°ÌÃÖ¡£
        */
   int candidate_from, candidate_to;
+  /* @} */
 
   /***en Flag telling whether the current candidate group must be
-      shown or not.  The function <im>->driver.filter () sets the
+      shown or not.  The function \<im\>->driver.filter () sets the
       value to 1 when an input method required to show candidates, and
       sets the value to 0 otherwise.  */
   /***ja ¸½ºß¤Î¸õÊ䥰¥ë¡¼¥×¤òɽ¼¨¤¹¤ë¤«¤É¤¦¤«¤ò¼¨¤¹¥Õ¥é¥°¡£
-      ´Ø¿ô <im>->driver.filter () ¤Ï¡¢ÆþÎϥ᥽¥Ã¥É¤¬¸õÊä¤Îɽ¼¨¤òÍ׵ᤷ¤¿»þ¤³¤ÎÃͤò
+      ´Ø¿ô \<im\>->driver.filter () ¤Ï¡¢ÆþÎϥ᥽¥Ã¥É¤¬¸õÊä¤Îɽ¼¨¤òÍ׵ᤷ¤¿»þ¤³¤ÎÃͤò
       1 ¤Ë¡¢¤½¤ì°Ê³°¤Î»þ 0 ¤ËÀßÄꤹ¤ë¡£  */
   int candidate_show;
 
-  /***en The function <im>->driver.filter () sets the value to 1 when
-      it changed any of the above members (<candidate_XXX>), and sets
-      the value to 0 otherwise.  */
-  /***ja ´Ø¿ô <im>->driver.filter () ¤Ï¡¢¾åµ­¤Î¥á¥ó¥Ð <candidate_XXX> 
-      ¤Î£±¤Ä¤Ç¤âÊѹ¹¤·¤¿ºÝ¤Ë¤Ï¡¢¤³¤ÎÃͤò 1 ¤ËÀßÄꤹ¤ë¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤ËÀßÄꤹ¤ë¡£ */
+  /***en The function \<im\>->driver.filter () sets the value to bitwise
+      OR of @c enum @c MInputCandidatesChanged when it changed any of
+      the above members (\<candidate_XXX\>), and sets the value to 0
+      otherwise.  */
+  /***ja ´Ø¿ô \<im\>->driver.filter () ¤Ï¡¢¾åµ­¤Î¥á¥ó¥Ð \<candidate_XXX\>
+      ¤Î£±¤Ä¤Ç¤âÊѹ¹¤·¤¿ºÝ¤Ë¤Ï¡¢¤³¤ÎÃͤò @c enum @c
+      MInputCandidatesChanged ¤Î¥Ó¥Ã¥Èñ°Ì¤Ç¤ÎÏÀÍý OR ¤ËÀßÄꤹ¤ë¡£¤½¤¦
+      ¤Ç¤Ê¤±¤ì¤Ð 0 ¤ËÀßÄꤹ¤ë¡£ */
   int candidates_changed;
 
-  /***en Plist that can be freely used by <im>->driver functions.
-      The driver of internal input method never use it.  The function
-      <im>->driver.create_ic () sets this to an empty plist, and the
-      function <im>->driver.destroy_ic () frees it by using
+  /***en Plist that can be freely used by \<im\>->driver functions.
+      The driver of internal input method uses it to exchange extra
+      arguments and result for callback functions.  The function
+      \<im\>->driver.create_ic () sets this to an empty plist, and the
+      function \<im\>->driver.destroy_ic () frees it by using
       m17n_object_unref ().  */
-  /***ja <im>->driver ¤Î´Ø¿ô·²¤Ë¤è¤Ã¤Æ¼«Í³¤Ë»ÈÍѤǤ­¤ë plist¡£
-      ÆâÉôÆþÎϥ᥽¥Ã¥ÉÍѥɥ饤¥Ð¤Ï¤³¤ì¤ò»ÈÍѤ·¤Ê¤¤¡£´Ø¿ô 
-      <im>->driver.create_ic () ¤Ï¤³¤Î plist ¤ò¶õ¤ËÀßÄꤹ¤ë¡£´Ø¿ô
-      <im>->driver.destroy_ic () ¤Ï m17n_object_unref () ¤òÍѤ¤¤Æ¤³¤Î 
-      plist ¤ò²òÊü¤¹¤ë¡£  */
+  /***ja \<im\>->driver ¤Î´Ø¿ô·²¤Ë¤è¤Ã¤Æ¼«Í³¤Ë»ÈÍѤǤ­¤ë plist¡£
+      ÆâÉôÆþÎϥ᥽¥Ã¥ÉÍѥɥ饤¥Ð¤Ï¤³¤ì¤ò¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤È¤Î°ú¿ô¤äÊÖÃÍ
+      ¤Î¼õÅϤ·¤Ë»ÈÍѤ¹¤ë¡£´Ø¿ô \<im\>->driver.create_ic () ¤Ï¤³¤Î plist
+      ¤ò¶õ¤ËÀßÄꤹ¤ë¡£´Ø¿ô\<im\>->driver.destroy_ic () ¤Ï
+      m17n_object_unref () ¤òÍѤ¤¤Æ¤³¤Î plist ¤ò²òÊü¤¹¤ë¡£  */
   MPlist *plist;
 };
 
 /*=*/
+/*** @} */
+/*=*/
 
 extern MInputMethod *minput_open_im (MSymbol language, MSymbol name,
                                     void *arg);
@@ -1327,39 +1355,45 @@ extern int minput_filter (MInputContext *ic, MSymbol key, void *arg);
 
 extern int minput_lookup (MInputContext *ic, MSymbol key, void *arg,
                          MText *mt);
-
-extern void minput_set_spot (MInputContext *ic, int x, int y,
-                            int ascent, int descent, int fontsize,
-                            MText *mt, int pos);
-
+extern void minput_set_spot (MInputContext *ic, int x, int y, int ascent,
+                            int descent, int fontsize, MText *mt, int pos);
 extern void minput_toggle (MInputContext *ic);
 
 extern void minput_reset_ic (MInputContext *ic);
 
-extern MSymbol Mdetail_text;
-
 extern MText *minput_get_description (MSymbol language, MSymbol name);
 
+extern MPlist *minput_get_title_icon (MSymbol language, MSymbol name);
+
+extern MPlist *minput_get_command (MSymbol language, MSymbol name,
+                                  MSymbol command);
+extern int minput_config_command (MSymbol language, MSymbol name,
+                                 MSymbol command, MPlist *keyseq);
+extern MPlist *minput_get_variable (MSymbol language, MSymbol name,
+                                   MSymbol variable);
+extern int minput_config_variable (MSymbol language, MSymbol name,
+                                  MSymbol variable, MPlist *value);
+extern char *minput_config_file (void);
+
+extern int minput_save_config (void);
+
+extern int minput_callback (MInputContext *ic, MSymbol command);
+
+/* obsolete functions */
 extern MPlist *minput_get_commands (MSymbol language, MSymbol name);
 
 extern int minput_assign_command_keys (MSymbol language, MSymbol name,
                                       MSymbol command, MPlist *keys);
-
 extern MPlist *minput_get_variables (MSymbol language, MSymbol name);
 
 extern int minput_set_variable (MSymbol language, MSymbol name,
                                MSymbol variable, void *value);
 
-
-/*=*/
-/***     @} */
+extern MPlist *minput_list (MSymbol lang);
 
 extern MInputMethod *mdebug_dump_im (MInputMethod *im, int indent);
 
-
-#ifdef __cplusplus
-}
-#endif
+M17N_END_HEADER
 
 #endif /* _M17N_H_ */