X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fm17n.h;h=1d3a855cd18aa01baf0027f26ae2983062fd20eb;hb=6d7c6038302bc463b075089c23bf709a4d5f815e;hp=0a58d49297dd9156975bcb61a9fa412eb7fe16a0;hpb=d43ad5dd9abbce36969c216e1e68ed156bf095e1;p=m17n%2Fm17n-lib.git diff --git a/src/m17n.h b/src/m17n.h index 0a58d49..1d3a855 100644 --- a/src/m17n.h +++ b/src/m17n.h @@ -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 @@ -60,8 +60,10 @@ extern void m17n_fini (void); #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 */ /*=*/ /* @@ -677,7 +679,7 @@ typedef struct ending by them. On encoding, produce byte sequence according to @c endian with heading BOM. - If is 8, the value has no meaning. */ + If \ is 8, the value has no meaning. */ /***ja ÀèƬ¤Î BOM (¥Ð¥¤¥È¥ª¡¼¥À¡¼¥Þ¡¼¥¯) ¤Î¼è¤ê°·¤¤¤ò»ØÄꤹ¤ë¡£ÃÍ¤Ï 0, @@ -700,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 is 8, the value has no meaning. */ + If \ is 8, the value has no meaning. */ /***ja ¥¨¥ó¥Ç¥£¥¢¥ó¤Î¥¿¥¤¥×¤ò»ØÄꤹ¤ë¡£ÃÍ¤Ï 0 ¤« 1 ¤Ç¤¢¤ê¡¢0 ¤Ê¤é¤Ð¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¡¢1 ¤Ê¤é¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ç¤¢¤ë¡£ - ¤¬ 8 ¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤ÎÃͤϰÕÌ£¤ò»ý¤¿¤Ê¤¤¡£ + \ ¤¬ 8 ¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤ÎÃͤϰÕÌ£¤ò»ý¤¿¤Ê¤¤¡£ */ int endian; } MCodingInfoUTF; @@ -851,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); /*=*/ @@ -888,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 + function minput_open_im () after all member of $IM but \ 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. */ @@ -896,7 +904,7 @@ typedef struct MInputDriver /***ja @brief ÆþÎϥ᥽¥Ã¥É¤ò¥ª¡¼¥×¥ó¤¹¤ë. - ¤³¤Î´Ø¿ô¤Ï¡¢ÆþÎϥ᥽¥Ã¥É $IM ¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£$IM ¤Î + ¤³¤Î´Ø¿ô¤Ï¡¢ÆþÎϥ᥽¥Ã¥É $IM ¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£$IM ¤Î \ °Ê³°¤ÎÁ´¥á¥ó¥Ð¡¼¤¬¥»¥Ã¥È¤µ¤ì¤¿¸å¤Ç¡¢´Ø¿ô minput_open_im () ¤«¤é¸Æ¤Ð¤ì¤ë¡£$IM ¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ì¤Ð 0 ¤ò¡¢¤Ç¤­¤Ê¤±¤ì¤Ð -1¤òÊÖ¤¹¡£ ¤³¤Î´Ø¿ô¤Ï $IM->info @@ -931,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 - are set. If creating $IC succeeds, it returns 0. + \ 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. */ @@ -940,7 +948,7 @@ typedef struct MInputDriver @brief ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤òÀ¸À®¤¹¤ë. ¤³¤Î´Ø¿ô¤ÏÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È $IC ¤òÀ¸À®¤¹¤ë¡£ - $IC ¤Î °Ê³°¤ÎÁ´¥á¥ó¥Ð¡¼¤¬¥»¥Ã¥È¤µ¤ì¤¿¸å¤Ç¡¢´Ø¿ô + $IC ¤Î \ °Ê³°¤ÎÁ´¥á¥ó¥Ð¡¼¤¬¥»¥Ã¥È¤µ¤ì¤¿¸å¤Ç¡¢´Ø¿ô minput_create_ic () ¤«¤é¸Æ¤Ð¤ì¤ë¡£ $IC ¤òÀ¸À®¤Ç¤­¤ì¤Ð 0 ¤ò¡¢¤Ç¤­¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤¹¡£ ¤³¤Î´Ø¿ô¤Ï $IC->info ¤òÀßÄꤷ¤Æ¡¢Â¾¤Î¥É¥é¥¤¥Ð´Ø¿ô¤«¤é»²¾È¤µ¤ì¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ */ @@ -980,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 . + necessary for the member \. The meaning of $ARG depends on the input method river. See the documentation of @c minput_default_driver and @c @@ -996,7 +1004,7 @@ typedef struct MInputDriver ¤¬ÆþÎϥ᥽¥Ã¥É¤ËµÛ¼ý¤µ¤ì¤Æ¥Æ¥­¥¹¥È¤¬À¸À®¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ 1 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ - ¥á¥ó¥Ð ¤ËɬÍפǤ¢¤ì¤Ð¡¢$IC->status, $IC->preedit, + ¥á¥ó¥Ð \ ¤ËɬÍפǤ¢¤ì¤Ð¡¢$IC->status, $IC->preedit, $IC->cursor_pos, $IC->ncandidates, $IC->candidates, $IC->produced ¤ò¹¹¿·¤Ç¤­¤ë¡£ @@ -1037,31 +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, - #Minput_get_surrounding_text, #Minput_delete_surrounding_text. + @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, - #Minput_get_surrounding_text, #Minput_delete_surrounding_text¡£ + @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; @@ -1092,6 +1103,9 @@ extern MSymbol Minherited; extern MSymbol Mcustomized; extern MSymbol Mconfigured; +/*** @addtogroup m17nInputMethod + @{ */ +/*=*/ /***en @brief Structure of input method. @@ -1125,9 +1139,9 @@ struct MInputMethod /***ja minput_open_im () ¤ËÅϤµ¤ì¤ë°ú¿ô¡£ */ void *arg; - /***en Pointer to extra information that .open_im () + /***en Pointer to extra information that \.open_im () setups. */ - /***ja .open_im () ¤¬ÀßÄꤹ¤ëÄɲþðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ */ + /***ja \.open_im () ¤¬ÀßÄꤹ¤ëÄɲþðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ */ void *info; }; @@ -1175,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; @@ -1206,23 +1220,23 @@ struct MInputContext /***ja ¥¹¥Ý¥Ã¥È¾å¤Î M-text¡¢¤Þ¤¿¤Ï NULL. */ MText *mt; - /***en Character position in at the spot. */ - /***ja ¤Ë¤ª¤±¤ë¥¹¥Ý¥Ã¥È¤Îʸ»ú°ÌÃÖ. */ + /***en Character position in \ at the spot. */ + /***ja \ ¤Ë¤ª¤±¤ë¥¹¥Ý¥Ã¥È¤Îʸ»ú°ÌÃÖ. */ 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 - ->driver.filter (). */ + \->driver.filter (). */ /***ja °Ê²¼¤Î¥á¥ó¥Ð¤Î»ÈÍÑË¡¤ÏÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ °Ê²¼¤ÎÀâÌÀ¤Ï¡¢ÆâÉôÆþÎϥ᥽¥Ã¥ÉÍѤÎÆþÎϥɥ饤¥Ð¤ËÂФ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ - ¤³¤ì¤é¤Ï´Ø¿ô ->driver.filter () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ */ + ¤³¤ì¤é¤Ï´Ø¿ô \->driver.filter () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ */ - /***en Pointer to extra information that ->driver.create_ic () + /***en Pointer to extra information that \->driver.create_ic () setups. It is used to record the internal state of the input context. */ - /***ja ->driver.create_ic () ¤¬ÀßÄꤹ¤ëÄɲþðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ + /***ja \->driver.create_ic () ¤¬ÀßÄꤹ¤ëÄɲþðÊó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤ÎÆâÉô¾õÂÖ¤òµ­Ï¿¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ */ void *info; @@ -1231,31 +1245,31 @@ struct MInputContext /***ja ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤Î¸½ºß¤Î¾õÂÖ¤òɽ¤¹ M-text */ MText *status; - /***en The function ->driver.filter () sets the value to 1 when - it changes . */ - /***ja ´Ø¿ô ->driver.filter () ¤Ï¡¢ ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò 1 + /***en The function \->driver.filter () sets the value to 1 when + it changes \. */ + /***ja ´Ø¿ô \->driver.filter () ¤Ï¡¢\ ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò 1 ¤ËÀßÄꤹ¤ë¡£ */ int status_changed; /***en M-text containing the current preedit text. The function - ->driver.filter () sets the value. */ + \->driver.filter () sets the value. */ /***ja ¸½ºß¤Î preedit ¥Æ¥­¥¹¥È¤ò´Þ¤à M-text¡£´Ø¿ô - ->driver.filter () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ */ + \->driver.filter () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ */ MText *preedit; - /***en The function ->driver.filter () sets the value to 1 when - it changes . */ - /***ja ´Ø¿ô ->driver.filter () ¤Ï¡¢ ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò + /***en The function \->driver.filter () sets the value to 1 when + it changes \. */ + /***ja ´Ø¿ô \->driver.filter () ¤Ï¡¢\ ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò 1 ¤ËÀßÄꤹ¤ë¡£ */ int preedit_changed; - /***en Cursor position of . */ - /***ja ¤Î¥«¡¼¥½¥ë°ÌÃÖ */ + /***en Cursor position of \. */ + /***ja \¤Î¥«¡¼¥½¥ë°ÌÃÖ */ int cursor_pos; - /***en The function ->driver.filter () sets the value to 1 when - it changes . */ - /***ja ´Ø¿ô ->driver.filter () ¤Ï¡¢ ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò + /***en The function \->driver.filter () sets the value to 1 when + it changes \. */ + /***ja ´Ø¿ô \->driver.filter () ¤Ï¡¢\ ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò 1 ¤ËÀßÄꤹ¤ë¡£ */ int cursor_pos_changed; @@ -1281,46 +1295,50 @@ struct MInputContext */ int candidate_index; + /* @{ */ /***en Start and the end positions of the preedit text where - corresponds to. */ - /***ja preedit ¥Æ¥­¥¹¥ÈÃæ¤Ç¡¢¤ËÂбþ¤¹¤ëºÇ½é¤ÈºÇ¸å¤Î°ÌÃÖ¡£ + \ corresponds to. */ + /***ja preedit ¥Æ¥­¥¹¥ÈÃæ¤Ç¡¢\¤ËÂбþ¤¹¤ëºÇ½é¤ÈºÇ¸å¤Î°ÌÃÖ¡£ */ int candidate_from, candidate_to; + /* @} */ /***en Flag telling whether the current candidate group must be - shown or not. The function ->driver.filter () sets the + shown or not. The function \->driver.filter () sets the value to 1 when an input method required to show candidates, and sets the value to 0 otherwise. */ /***ja ¸½ºß¤Î¸õÊ䥰¥ë¡¼¥×¤òɽ¼¨¤¹¤ë¤«¤É¤¦¤«¤ò¼¨¤¹¥Õ¥é¥°¡£ - ´Ø¿ô ->driver.filter () ¤Ï¡¢ÆþÎϥ᥽¥Ã¥É¤¬¸õÊä¤Îɽ¼¨¤òÍ׵ᤷ¤¿»þ¤³¤ÎÃͤò + ´Ø¿ô \->driver.filter () ¤Ï¡¢ÆþÎϥ᥽¥Ã¥É¤¬¸õÊä¤Îɽ¼¨¤òÍ׵ᤷ¤¿»þ¤³¤ÎÃͤò 1 ¤Ë¡¢¤½¤ì°Ê³°¤Î»þ 0 ¤ËÀßÄꤹ¤ë¡£ */ int candidate_show; - /***en The function ->driver.filter () sets the value to bitwise + /***en The function \->driver.filter () sets the value to bitwise OR of @c enum @c MInputCandidatesChanged when it changed any of - the above members (), and sets the value to 0 + the above members (\), and sets the value to 0 otherwise. */ - /***ja ´Ø¿ô ->driver.filter () ¤Ï¡¢¾åµ­¤Î¥á¥ó¥Ð + /***ja ´Ø¿ô \->driver.filter () ¤Ï¡¢¾åµ­¤Î¥á¥ó¥Ð \ ¤Î£±¤Ä¤Ç¤âÊѹ¹¤·¤¿ºÝ¤Ë¤Ï¡¢¤³¤ÎÃͤò @c enum @c MInputCandidatesChanged ¤Î¥Ó¥Ã¥Èñ°Ì¤Ç¤ÎÏÀÍý OR ¤ËÀßÄꤹ¤ë¡£¤½¤¦ ¤Ç¤Ê¤±¤ì¤Ð 0 ¤ËÀßÄꤹ¤ë¡£ */ int candidates_changed; - /***en Plist that can be freely used by ->driver functions. + /***en Plist that can be freely used by \->driver functions. The driver of internal input method uses it to exchange extra arguments and result for callback functions. The function - ->driver.create_ic () sets this to an empty plist, and the - function ->driver.destroy_ic () frees it by using + \->driver.create_ic () sets this to an empty plist, and the + function \->driver.destroy_ic () frees it by using m17n_object_unref (). */ - /***ja ->driver ¤Î´Ø¿ô·²¤Ë¤è¤Ã¤Æ¼«Í³¤Ë»ÈÍѤǤ­¤ë plist¡£ + /***ja \->driver ¤Î´Ø¿ô·²¤Ë¤è¤Ã¤Æ¼«Í³¤Ë»ÈÍѤǤ­¤ë plist¡£ ÆâÉôÆþÎϥ᥽¥Ã¥ÉÍѥɥ饤¥Ð¤Ï¤³¤ì¤ò¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤È¤Î°ú¿ô¤äÊÖÃÍ - ¤Î¼õÅϤ·¤Ë»ÈÍѤ¹¤ë¡£´Ø¿ô ->driver.create_ic () ¤Ï¤³¤Î plist - ¤ò¶õ¤ËÀßÄꤹ¤ë¡£´Ø¿ô->driver.destroy_ic () ¤Ï + ¤Î¼õÅϤ·¤Ë»ÈÍѤ¹¤ë¡£´Ø¿ô \->driver.create_ic () ¤Ï¤³¤Î plist + ¤ò¶õ¤ËÀßÄꤹ¤ë¡£´Ø¿ô\->driver.destroy_ic () ¤Ï m17n_object_unref () ¤òÍѤ¤¤Æ¤³¤Î plist ¤ò²òÊü¤¹¤ë¡£ */ MPlist *plist; }; /*=*/ +/*** @} */ +/*=*/ extern MInputMethod *minput_open_im (MSymbol language, MSymbol name, void *arg); @@ -1370,11 +1388,10 @@ extern MPlist *minput_get_variables (MSymbol language, MSymbol name); extern int minput_set_variable (MSymbol language, MSymbol name, MSymbol variable, void *value); -/*=*/ -/*** @} */ -extern MInputMethod *mdebug_dump_im (MInputMethod *im, int indent); +extern MPlist *minput_list (MSymbol lang); +extern MInputMethod *mdebug_dump_im (MInputMethod *im, int indent); M17N_END_HEADER