X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fm17n.h;h=1d3a855cd18aa01baf0027f26ae2983062fd20eb;hb=6d7c6038302bc463b075089c23bf709a4d5f815e;hp=71fa3eb2277d1637997e56fffb9f8a32c7ca952e;hpb=2717af5d200418ee80e18c80e21cd5348c10ef4d;p=m17n%2Fm17n-lib.git diff --git a/src/m17n.h b/src/m17n.h index 71fa3eb..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 @@ -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_ @@ -31,23 +31,39 @@ #include #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); @@ -241,8 +210,7 @@ enum MConversionResult /***en On encoding, the source contains a character that cannot be encoded by the specified coding system. */ - /***ja ¥¨¥ó¥³¡¼¥É»þ¡¢»ØÄê¤Î¥³¡¼¥É·Ï¤Ç¥¨¥ó¥³¡¼¥É¤Ç¤­¤Ê¤¤Ê¸»ú¤¬¥½¡¼ - ¥¹¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë. */ + /***ja ¥¨¥ó¥³¡¼¥É»þ¡¢»ØÄê¤Î¥³¡¼¥É·Ï¤Ç¥¨¥ó¥³¡¼¥É¤Ç¤­¤Ê¤¤Ê¸»ú¤¬¥½¡¼¥¹¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë. */ MCONVERSION_RESULT_INVALID_CHAR, /***en On decoding, the source ends with an incomplete byte sequence. */ @@ -293,20 +261,18 @@ typedef struct with "" (otherwise). */ /***ja - ¸·Ì©¤ÊÊÑ´¹¤¬É¬ÍפǤʤ¤¾ì¹ç¤ËÃͤò 0 °Ê³°¤Ë¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ - ÊÑ´¹¤Ï¸·Ì©¤Ç¤¢¤ë¡£ + ¸·Ì©¤ÊÊÑ´¹¤¬É¬ÍפǤʤ¤¾ì¹ç¤ËÃͤò 0 °Ê³°¤Ë¤¹¤ë¡£ + ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ÊÑ´¹¤Ï¸·Ì©¤Ç¤¢¤ë¡£ - ÊÑ´¹¤¬¸·Ì©¤È¤Ï¡¢¥Ç¥³¡¼¥É¤ÎºÝ¤Ë¤ÏºÇ½é¤ÎÉÔÀµ¤Ê¥Ð¥¤¥È¤Ç¥³¥ó¥Ð¡¼¥¿ - ¤¬»ß¤Þ¤ë¤³¤È¡¢¥¨¥ó¥³¡¼¥É¤ÎºÝ¤Ë¤ÏÊÑ´¹¤µ¤ì¤ë¥³¡¼¥É·Ï¤Ç¥µ¥Ý¡¼¥È¤µ - ¤ì¤Ê¤¤ºÇ½é¤Îʸ»ú¤Ç¥³¥ó¥Ð¡¼¥¿¤¬»ß¤Þ¤ë¤³¤È¤ò»Ø¤¹¡£¤³¤ì¤é¤Î¾ì¹ç¡¢ - @c MConverter-\>result ¤Ï¤½¤ì¤¾¤ì @c + ÊÑ´¹¤¬¸·Ì©¤È¤Ï¡¢¥Ç¥³¡¼¥É¤ÎºÝ¤Ë¤ÏºÇ½é¤ÎÉÔÀµ¤Ê¥Ð¥¤¥È¤Ç¥³¥ó¥Ð¡¼¥¿¤¬»ß¤Þ¤ë¤³¤È¡¢ + ¥¨¥ó¥³¡¼¥É¤ÎºÝ¤Ë¤ÏÊÑ´¹¤µ¤ì¤ë¥³¡¼¥É·Ï¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤ºÇ½é¤Îʸ»ú¤Ç¥³¥ó¥Ð¡¼¥¿¤¬»ß¤Þ¤ë¤³¤È¤ò»Ø¤¹¡£ + ¤³¤ì¤é¤Î¾ì¹ç¡¢@c MConverter-\>result ¤Ï¤½¤ì¤¾¤ì @c MCONVERSION_RESULT_INVALID_BYTE ¤«@c MCONVERSION_RESULT_INVALID_CHAR ¤È¤Ê¤ë¡£ - ÊÑ´¹¤¬¸·Ì©¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥Ç¥³¡¼¥É¤ÎºÝ¤ÎÉÔÀµ¤Ê¥Ð¥¤¥È¤Ï¤½¤Î¥Ð¥¤¥È - ¤Î¤Þ¤Þ»Ä¤ë¡£¤Þ¤¿¥¨¥ó¥³¡¼¥É¤ÎºÝ¤Ë¤Ï¡¢ÉÔÀµ¤Êʸ»ú¤Ï Unicode ʸ»ú¤Î - ¾ì¹ç¤Ë¤Ï "" ¤Ë¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï "" ¤ËÃÖ¤­´¹ - ¤¨¤é¤ì¤ë¡£ */ + ÊÑ´¹¤¬¸·Ì©¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥Ç¥³¡¼¥É¤ÎºÝ¤ÎÉÔÀµ¤Ê¥Ð¥¤¥È¤Ï¤½¤Î¥Ð¥¤¥È¤Î¤Þ¤Þ»Ä¤ë¡£ + ¤Þ¤¿¥¨¥ó¥³¡¼¥É¤ÎºÝ¤Ë¤Ï¡¢ÉÔÀµ¤Êʸ»ú¤¬ Unicode ʸ»ú¤Î¾ì¹ç¤Ë¤Ï "" + ¤Ë¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï "" ¤ËÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ */ int lenient; @@ -338,24 +304,20 @@ typedef struct /***ja - ¥Ð¥¤¥ÈÎó¤Î½ªÃ¼¤Î¥Ö¥í¥Ã¥¯¤ò¥Ç¥³¡¼¥É¤¹¤ëºÝ¡¢¤Þ¤¿¤Ïʸ»úÎó¤Î½ªÃ¼¤Î¥Ö - ¥í¥Ã¥¯¤ò¥¨¥ó¥³¡¼¥É¤¹¤ëºÝ¤Ï¡¢Ãͤò 0 °Ê³°¤Ë¤¹¤ë¡£¤³¤ÎÃͤϰʲ¼¤Î¤è¤¦ - ¤ËÊÑ´¹¤Ë±Æ¶Á¤¹¤ë¡£ + ¥Ð¥¤¥ÈÎó¤Î½ªÃ¼¤Î¥Ö¥í¥Ã¥¯¤ò¥Ç¥³¡¼¥É¤¹¤ëºÝ¡¢¤Þ¤¿¤Ïʸ»úÎó¤Î½ªÃ¼¤Î¥Ö¥í¥Ã¥¯¤ò¥¨¥ó¥³¡¼¥É¤¹¤ëºÝ¤Ï¡¢Ãͤò + 0 °Ê³°¤Ë¤¹¤ë¡£¤³¤ÎÃͤϰʲ¼¤Î¤è¤¦¤ËÊÑ´¹¤Ë±Æ¶Á¤¹¤ë¡£ - ¥Ç¥³¡¼¥Ç¥£¥ó¥°¤ÎºÝ¤ËºÇ¸å¤Î¿ô¥Ð¥¤¥È¤¬Àµ¤·¤¤¥Ð¥¤¥È¥·¡¼¥¯¥¨¥ó¥¹¤ò·Á - À®¤¹¤ë¤Ë¤Ïû¤¹¤®¤ë¾ì¹ç¡§ + ¥Ç¥³¡¼¥Ç¥£¥ó¥°¤ÎºÝ¤ËºÇ¸å¤Î¿ô¥Ð¥¤¥È¤¬Àµ¤·¤¤¥Ð¥¤¥È¥·¡¼¥¯¥¨¥ó¥¹¤ò·ÁÀ®¤¹¤ë¤Ë¤Ïû¤¹¤®¤ë¾ì¹ç¡§ - Ãͤ¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢ÊÑ´¹¤Ï¤½¤Î¥·¡¼¥¯¥¨¥ó¥¹¤ÎºÇ½é¤Î¥Ð¥¤¥È¤Ë¤ª¤¤¤Æ¡¢ - ¥¨¥é¡¼ (MCONVERSION_RESULT_INVALID_BYTE) ¤Ç½ª¤ë¡£ + Ãͤ¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢ÊÑ´¹¤Ï¤½¤Î¥·¡¼¥¯¥¨¥ó¥¹¤ÎºÇ½é¤Î¥Ð¥¤¥È¤Ë¤ª¤¤¤Æ¡¢¥¨¥é¡¼ + (MCONVERSION_RESULT_INVALID_BYTE) ¤Ç½ª¤ë¡£ - Ãͤ¬ 0 ¤Ê¤é¤Ð¡¢ÊÑ´¹¤ÏÀ®¸ù¤·¤Æ½ª¤ë¡£ÌäÂê¤Î¿ô¥Ð¥¤¥È¤Ï¥­¥ã¥ê¡¼¥ª¡¼ - ¥Ð¤È¤·¤Æ¥³¥ó¥Ð¡¼¥¿¤ËÊÝ»ý¤µ¤ì¡¢Â³¤­¤ÎÊÑ´¹¤ò¹Ô¤¦ºÝ¤ËÊÑ´¹¤¹¤ë¥Ð¥¤ - ¥ÈÎó¤ÎÁ°¤ËÉÕ¤±¤é¤ì¤ë¡£ + Ãͤ¬ 0 ¤Ê¤é¤Ð¡¢ÊÑ´¹¤ÏÀ®¸ù¤·¤Æ½ª¤ë¡£ + ÌäÂê¤Î¿ô¥Ð¥¤¥È¤Ï¥­¥ã¥ê¡¼¥ª¡¼¥Ð¤È¤·¤Æ¥³¥ó¥Ð¡¼¥¿¤ËÊÝ»ý¤µ¤ì¡¢ÊÑ´¹¤Î³¤­¤ò¹Ô¤¦ºÝ¤ËÊÑ´¹¤¹¤ë¥Ð¥¤¥ÈÎó¤ÎÁ°¤ËÉÕ¤±¤é¤ì¤ë¡£ ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ÎºÝ¤Ë¥³¡¼¥É·Ï¤¬Ê¸Ì®°Í¸¤Î¾ì¹ç¡¢ - Ãͤ¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¥³¥ó¥Æ¥­¥¹¥È¤òºÇ½é¤ËÌ᤹¤¿¤á¤Î¥Ð¥¤¥ÈÎ󤬥½¡¼ - ¥¹¤Îʸ»ú¤È¤«¤«¤ï¤ê¤Ê¤¯ÊÑ´¹¤Î·ë²ÌÀ¸À®¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ + Ãͤ¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¥³¥ó¥Æ¥­¥¹¥È¤òºÇ½é¤ËÌ᤹¤¿¤á¤Î¥Ð¥¤¥ÈÎ󤬥½¡¼¥¹¤Îʸ»ú¤È¤«¤«¤ï¤ê¤Ê¤¯ÊÑ´¹¤Î·ë²ÌÀ¸À®¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£ Ãͤ¬ 0 ¤Ê¤é¤Ð¡¢¤½¤Î¤è¤¦¤Ê¥Ð¥¤¥ÈÎó¤ÏÀ¸À®¤µ¤ì¤Ê¤¤¡£ @@ -376,7 +338,7 @@ typedef struct The following three members are to report the result of the conversion. */ /***ja - °Ê²¼¤Î£³¤Ä¤Î¥á¥ó¥Ð¤ÏÊÑ´¹¤Î·ë²Ì¤òÊó¹ð¤¹¤ë¡£ */ + °Ê²¼¤Î£³¤Ä¤Î¥á¥ó¥Ð¤ÏÊÑ´¹¤Î·ë²Ì¤òɽ¤¹¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ */ /***en Number of characters most recently decoded or encoded. */ @@ -408,10 +370,8 @@ typedef struct and at least 256 bytes of memory space can be used. */ /***ja - ¥³¡¼¥ÉÊÑ´¹¤Î¾õ¶·¤Ë´Ø¤¹¤ë¼ï¡¹¤Î¾ðÊó¡£ÆâÍƤϥ³¡¼¥É·Ï¤Î¥¿¥¤¥×¤Ë¤è¤Ã - ¤Æ°Û¤Ê¤ë¡£@c status ¤Ï¤É¤Î¤è¤¦¤Ê·¿¤Ø¤Î¥­¥ã¥¹¥È¤ËÂФ·¤Æ¤â°ÂÁ´¤Ê¤è - ¤¦¤Ë¥á¥â¥ê¥¢¥é¥¤¥ó¤µ¤ì¤Æ¤ª¤ê¡¢¤Þ¤¿ºÇÄã256¥Ð¥¤¥È¤Î¥á¥â¥êÎΰ褬»È - ¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ */ + ¥³¡¼¥ÉÊÑ´¹¤Î¾õ¶·¤Ë´Ø¤¹¤ë¼ï¡¹¤Î¾ðÊó¡£ÆâÍƤϥ³¡¼¥É·Ï¤Î¥¿¥¤¥×¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ + @c status ¤Ï¤É¤Î¤è¤¦¤Ê·¿¤Ø¤Î¥­¥ã¥¹¥È¤ËÂФ·¤Æ¤â°ÂÁ´¤Ê¤è¤¦¤Ë¥á¥â¥ê¥¢¥é¥¤¥ó¤µ¤ì¤Æ¤ª¤ê¡¢¤Þ¤¿ºÇÄã256¥Ð¥¤¥È¤Î¥á¥â¥êÎΰ褬»È¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£ */ union { void *ptr; @@ -422,8 +382,7 @@ typedef struct /***en This member is for internally use only. An application program should never touch it. */ - /***ja ¤³¤Î¥á¥ó¥Ð¤ÏÆâÉôŪ¤Ë»ÈÍѤµ¤ì¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¿¨ - ¤ì¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ */ + /***ja ¤³¤Î¥á¥ó¥Ð¤ÏÆâÉôŪ¤Ë»ÈÍѤµ¤ì¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¿¨¤ì¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ */ void *internal_info; } MConverter; /*=*/ @@ -441,33 +400,25 @@ 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 ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥǥե©¥ë¥È¤Î¥¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼ - ¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤¹¤ë¡£ */ + ¤³¤Î¥¿¥¤¥×¤Î¥³¡¼¥É·Ï¤Ïʸ»ú¥»¥Ã¥È¤òľÀÜ¥µ¥Ý¡¼¥È¤¹¤ë¡£ + ³Æʸ»ú¥»¥Ã¥È¤Î¼¡¸µ¤È¤Ï¡¢¤½¤Îʸ»ú¥»¥Ã¥È¤Ç°ìʸ»ú¤òɽ¸½¤¹¤ë¤¿¤á¤ËɬÍפʥХ¤¥È¿ô¤Ç¤¢¤ê¡¢¥Ð¥¤¥ÈÎó¤Ïʸ»ú¤Î¥³¡¼¥É¥Ý¥¤¥ó¥È¤òľÀÜɽ¤¹¡£ + m17n ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥǥե©¥ë¥È¤Î¥¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤¹¤ë¡£ */ MCODING_TYPE_CHARSET, /***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 ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥǥե©¥ë¥È¤Î¥¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼ - ¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤¹¤ë¡£ */ + ¤³¤Î¥¿¥¤¥×¤Î¥³¡¼¥É·Ï¤Ï¡¢UTF ·Ï (UTF-8, UTF-16, UTF-32) ¤Î¥Ð¥¤¥ÈÎó¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ + m17n ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥǥե©¥ë¥È¤Î¥¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤¹¤ë¡£ */ MCODING_TYPE_UTF, @@ -475,34 +426,26 @@ 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 ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥǥե©¥ë¥È¤Î¥¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼ - ¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤¹¤ë¡£ */ + m17n ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥǥե©¥ë¥È¤Î¥¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤¹¤ë¡£ */ MCODING_TYPE_ISO_2022, /***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 ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥ¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼¥É¥ë¡¼¥Æ¥£¥ó - ¤òÄ󶡤·¤Ê¤¤¤Î¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¦¤Ç½àÈ÷¤¹ - ¤ëɬÍפ¬¤¢¤ë¡£ */ + ¤³¤Î¥¿¥¤¥×¤Î¥³¡¼¥É·Ï¤Ï¡¢¤½¤Î¾¤Î¹½Â¤¤Î¥Ð¥¤¥ÈÎó¤Î¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£ + m17n ¥é¥¤¥Ö¥é¥ê¤Ï¤³¤Î¥¿¥¤¥×ÍѤΥ¨¥ó¥³¡¼¥É¡¿¥Ç¥³¡¼¥É¥ë¡¼¥Æ¥£¥ó¤òÄ󶡤·¤Ê¤¤¤Î¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¦¤Ç½àÈ÷¤¹¤ëɬÍפ¬¤¢¤ë¡£ */ MCODING_TYPE_MISC }; @@ -539,10 +482,10 @@ enum MCodingFlagISO2022 /***en Use the non-standard 4 bytes format for designation sequence - for charsets JISX0208.1978, GB2312, and JISX0208.1983. */ + for charsets JISX0208-1978, GB2312, and JISX0208-1983. */ /***ja - JISX0208.1978, GB2312, JISX0208.1983 ¤Îʸ»ú½¸¹ç¤ËÂФ¹¤ë»Ø¼¨¥·¡¼ - ¥¯¥¨¥ó¥¹¤È¤·¤Æ¡¢Èóɸ½à¤Î4¥Ð¥¤¥È·Á¼°¤òÍѤ¤¤ë¡£ */ + JISX0208-1978, GB2312, JISX0208-1983 + ¤Îʸ»ú½¸¹ç¤ËÂФ¹¤ë»Ø¼¨¥·¡¼¥¯¥¨¥ó¥¹¤È¤·¤Æ¡¢Èóɸ½à¤Î4¥Ð¥¤¥È·Á¼°¤òÍѤ¤¤ë¡£ */ MCODING_ISO_LONG_FORM = 0x8, @@ -550,16 +493,16 @@ enum MCodingFlagISO2022 On encoding, unless explicitly specified, designate charsets to G0. */ /***ja - ¥¨¥ó¥³¡¼¥É¤ÎºÝ¡¢Æä˻ØÄꤵ¤ì¤Ê¤¤¸Â¤ê¡¢Ê¸»ú½¸¹ç¤ò G0 ¤Ë»Ø¼¨ - ¤¹¤ë¡£*/ + ¥¨¥ó¥³¡¼¥É¤ÎºÝ¡¢Æä˻ØÄꤵ¤ì¤Ê¤¤¸Â¤ê¡¢Ê¸»ú½¸¹ç¤ò G0 + ¤Ë»Ø¼¨¤¹¤ë¡£*/ MCODING_ISO_DESIGNATION_G0 = 0x10, /***en On encoding, unless explicitly specified, designate charsets except for ASCII to G1. */ /***ja - ¥¨¥ó¥³¡¼¥É¤ÎºÝ¡¢Æä˻ØÄꤵ¤ì¤Ê¤¤¸Â¤ê¡¢ASCII °Ê³°¤Îʸ»ú½¸¹ç¤ò G1 - ¤Ë»Ø¼¨¤¹¤ë¡£*/ + ¥¨¥ó¥³¡¼¥É¤ÎºÝ¡¢Æä˻ØÄꤵ¤ì¤Ê¤¤¸Â¤ê¡¢ASCII °Ê³°¤Îʸ»ú½¸¹ç¤ò + G1 ¤Ë»Ø¼¨¤¹¤ë¡£*/ MCODING_ISO_DESIGNATION_G1 = 0x20, /***en @@ -576,8 +519,8 @@ enum MCodingFlagISO2022 ESC % G ... ESC % @@ . On decoding, handle those escape sequences. */ /***ja - ¥¨¥ó¥³¡¼¥É¤ÎºÝ¡¢ISO-2022 ¤Ë¹çÃפ·¤Ê¤¤Ê¸»ú½¸¹ç¤ò ESC % / ... ¤Ç¥¨ - ¥ó¥³¡¼¥É¤¹¤ë¡£¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ Unicode ʸ»ú¤Ï ESC % G ... + ¥¨¥ó¥³¡¼¥É¤ÎºÝ¡¢ISO-2022 ¤Ë¹çÃפ·¤Ê¤¤Ê¸»ú½¸¹ç¤ò ESC % / ... + ¤Ç¥¨¥ó¥³¡¼¥É¤¹¤ë¡£¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ Unicode ʸ»ú¤Ï ESC % G ... ESC % @@ ¤Ç¥¨¥ó¥³¡¼¥É¤¹¤ë¡£ ¥Ç¥³¡¼¥É¤ÎºÝ¡¢¤³¤ì¤é¤Î¥¨¥¹¥±¡¼¥×¡¦¥·¡¼¥±¥ó¥¹¤ò²ò¼á¤¹¤ë¡£ */ MCODING_ISO_DESIGNATION_CTEXT_EXT = 0x80, @@ -617,8 +560,8 @@ enum MCodingFlagISO2022 On encoding, if a charset has revision number, produce escape sequences to specify the number. */ /***ja - ¥¨¥ó¥³¡¼¥É¤ÎºÝ¡¢Ê¸»ú¥»¥Ã¥È¤Ë revision number ¤¬¤¢¤ì¤Ð¤½ - ¤ì¤òɽ¤ï¤¹¥¨¥¹¥±¡¼¥×¥·¡¼¥¯¥¨¥ó¥¹¤òÀ¸À®¤¹¤ë¡£ */ + ¥¨¥ó¥³¡¼¥É¤ÎºÝ¡¢Ê¸»ú¥»¥Ã¥È¤Ë revision number + ¤¬¤¢¤ì¤Ð¤½¤ì¤òɽ¤ï¤¹¥¨¥¹¥±¡¼¥×¥·¡¼¥¯¥¨¥ó¥¹¤òÀ¸À®¤¹¤ë¡£ */ MCODING_ISO_REVISION_NUMBER = 0x2000, /***en @@ -641,8 +584,7 @@ enum MCodingFlagISO2022 /***ja @brief #MCODING_TYPE_ISO_2022 ¥¿¥¤¥×¤Î¥³¡¼¥É·Ï¤ÇɬÍפÊÉղþðÊóÍѹ½Â¤ÂÎ. - MCODING_TYPE_ISO_2022 ¥¿¥¤¥×¤Î¥³¡¼¥É·Ï¤ÇɬÍפÊÉղþðÊóÍѤòÊÝ»ý¤¹¤ë - ¤¿¤á¤Î¹½Â¤ÂΡ£ + MCODING_TYPE_ISO_2022 ¥¿¥¤¥×¤Î¥³¡¼¥É·Ï¤ÇɬÍפÊÉղþðÊóÍѤòÊÝ»ý¤¹¤ë¤¿¤á¤Î¹½Â¤ÂΡ£ @latexonly \IPAlabel{MCodingInfoISO2022} @endlatexonly */ @@ -654,9 +596,9 @@ typedef struct means no code extension element is invoked to that plane. */ /***ja - ³Æ¿Þ·Áʸ»úÎΰè (Graphic Left ¤È Graphic Right) ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤ - ¤ë¡¢ISO2022 Éä¹ç³ÈÄ¥Í×ÁǤÎÈÖ¹æ¤Î¥Æ¡¼¥Ö¥ë¡£-1 ¤Ï¤½¤ÎÎΰè¤Ë¤É¤ÎÉä - ¹ç³ÈÄ¥Í×ÁǤâ¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£ */ + ³Æ¿Þ·Áʸ»úÎΰè (Graphic Left ¤È Graphic Right) ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤ë¡¢ + ISO2022 Éä¹ç³ÈÄ¥Í×ÁǤÎÈÖ¹æ¤Î¥Æ¡¼¥Ö¥ë¡£-1 + ¤Ï¤½¤ÎÎΰè¤Ë¤É¤ÎÉä¹ç³ÈÄ¥Í×ÁǤâ¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£ */ int initial_invocation[2]; @@ -675,16 +617,16 @@ typedef struct register. */ /***ja - Éä¹ç³ÈÄ¥Í×ÁǤΥơ¼¥Ö¥ë¡£NÈÖÌܤÎÍ×ÁǤϡ¢$CHARSET_NAMES ¤Î N ÈÖÌÜ - ¤Îʸ»ú¥»¥Ã¥È¤ËÂбþ¤¹¤ë¡£$CHARSET_NAMES ¤Ï´Ø¿ô + Éä¹ç³ÈÄ¥Í×ÁǤΥơ¼¥Ö¥ë¡£NÈÖÌܤÎÍ×ÁǤϡ¢$CHARSET_NAMES ¤Î N + ÈÖÌܤÎʸ»ú¥»¥Ã¥È¤ËÂбþ¤¹¤ë¡£$CHARSET_NAMES ¤Ï´Ø¿ô mconv_define_coding () ¤Î°ú¿ô¤È¤Ê¤ë¡£ - Ãͤ¬ 0..3 ¤À¤Ã¤¿¤é¡¢Âбþ¤¹¤ëʸ»ú¥»¥Ã¥È¤ò G0..G3 ¤Î¤½¤ì¤¾¤ì¤Ë»Ø¼¨ - ¤¹¤ë¤³¤È¡¢½é´ü¾õÂ֤Ǥ¹¤Ç¤Ë G0..G3 ¤Ë»Ø¼¨¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò°ÕÌ£¤¹ - ¤ë¡£ + Ãͤ¬ 0..3 ¤À¤Ã¤¿¤é¡¢Âбþ¤¹¤ëʸ»ú¥»¥Ã¥È¤ò G0..G3 + ¤Î¤½¤ì¤¾¤ì¤Ë»Ø¼¨¤¹¤ë¤³¤È¡¢¤Þ¤¿½é´ü¾õÂ֤Ǥ¹¤Ç¤Ë G0..G3 + ¤Ë»Ø¼¨¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ - Ãͤ¬ -4..-1 ¤À¤Ã¤¿¤é¡¢Âбþ¤¹¤ëʸ»ú¥»¥Ã¥È¤ò G0..G3 ¤Î¤½¤ì¤¾¤ì¤Ë»Ø - ¼¨¤¹¤ë¤¬¡¢½é´ü¾õÂ֤ǤϤɤ³¤Ë¤â»Ø¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + Ãͤ¬ -4..-1 ¤À¤Ã¤¿¤é¡¢Âбþ¤¹¤ëʸ»ú¥»¥Ã¥È¤ò G0..G3 + ¤Î¤½¤ì¤¾¤ì¤Ë»Ø¼¨¤¹¤ë¤³¤È¡¢¤·¤«¤·½é´ü¾õÂ֤ǤϤɤ³¤Ë¤â»Ø¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ */ char designations[32]; @@ -717,7 +659,7 @@ typedef struct /***en Specify bits of a code unit. The value must be 8, 16, or 32. */ /***ja - ¥³¡¼¥ÉĹ¡Ê¥Ó¥Ã¥È¿ô¡Ë¡£ÃÍ¤Ï 8, 16, 32 ¤Î¤¤¤º¤ì¤«¡£ */ + ¥³¡¼¥ÉĹ¡Ê¥Ó¥Ã¥È¿ô¡Ë¤Î»ØÄê¡£ÃÍ¤Ï 8, 16, 32 ¤Î¤¤¤º¤ì¤«¡£ */ int code_unit_bits; /***en @@ -737,36 +679,35 @@ 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, 1, 2 ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ê¡¢¤½¤ì¤¾¤ì¤Î°ÕÌ£¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£ - 0: ¥Ç¥³¡¼¥É¤ÎºÝ¤ËºÇ½é¤Î 2 ¥Ð¥¤¥È¤òÄ´¤Ù¤ë¡£¤â¤·¤½¤ì¤¬ BOM ¤Ç¤¢¤ì - ¤Ð¡¢¥¨¥ó¥Ç¥£¥¢¥ó¤ò¤½¤ì¤ÇȽÄꤹ¤ë¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢¥á¥ó¥Ð @c + 0: ¥Ç¥³¡¼¥É¤ÎºÝ¤ËºÇ½é¤Î 2 ¥Ð¥¤¥È¤òÄ´¤Ù¤ë¡£¤â¤·¤½¤ì¤¬ BOM + ¤Ç¤¢¤ì¤Ð¡¢¥¨¥ó¥Ç¥£¥¢¥ó¤ò¤½¤ì¤ÇȽÄꤹ¤ë¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢¥á¥ó¥Ð @c endian ¤Ë½¾¤Ã¤Æ¥¨¥ó¥Ç¥£¥¢¥ó¤ò·èÄꤹ¤ë¡£¥¨¥ó¥³¡¼¥É¤ÎºÝ¤Ë¤Ï @c endian ¤Ë½¾¤Ã¤¿¥Ð¥¤¥ÈÎó¤òÀèƬ¤Ë BOM ÉÕ¤ÇÀ¸À®¤¹¤ë¡£ - 1: ¥Ç¥³¡¼¥É¤ÎºÝ¡¢ºÇ½é¤Î 2 ¥Ð¥¤¥È¤ò BOM ¤È¤·¤Æ°·¤ï¤º¡¢¥¨¥ó¥Ç¥£¥¢ - ¥ó¤Ï @c endian ¤ÇȽÄꤹ¤ë¡£¥¨¥ó¥³¡¼¥É¤ÎºÝ¤Ë¤Ï¡¢BOM ¤ò½ÐÎϤ»¤º¡¢ + 1: ¥Ç¥³¡¼¥É¤ÎºÝ¡¢ºÇ½é¤Î 2 ¥Ð¥¤¥È¤ò BOM ¤È¤·¤Æ°·¤ï¤º¡¢¥¨¥ó¥Ç¥£¥¢¥ó¤Ï + @c endian ¤ÇȽÄꤹ¤ë¡£¥¨¥ó¥³¡¼¥É¤ÎºÝ¤Ë¤Ï¡¢BOM ¤ò½ÐÎϤ»¤º¡¢ @c endian ¤Ë±þ¤¸¤¿¥Ð¥¤¥ÈÎó¤òÀ¸À®¤¹¤ë¡£ - 2: ¥Ç¥³¡¼¥É¤ÎºÝ¤ËºÇ½é¤Î2¥Ð¥¤¥È¤ò BOM¤È¤·¤Æ°·¤¤¡¢¤½¤ì¤Ë½¾¤Ã¤Æ¥¨¥ó - ¥Ç¥£¥¢¥ó¤òȽÄꤹ¤ë¡£¥¨¥ó¥³¡¼¥É¤ÎºÝ¤Ë¤Ï @c endian ¤Ë±þ¤¸¤¿¥Ð¥¤¥È - Îó¤òÀèƬ¤Ë BOM ÉÕ¤­¤ÇÀ¸À®¤¹¤ë¡£ */ + 2: ¥Ç¥³¡¼¥É¤ÎºÝ¤ËºÇ½é¤Î2¥Ð¥¤¥È¤ò BOM¤È¤·¤Æ°·¤¤¡¢¤½¤ì¤Ë½¾¤Ã¤Æ¥¨¥ó¥Ç¥£¥¢¥ó¤òȽÄꤹ¤ë¡£ + ¥¨¥ó¥³¡¼¥É¤ÎºÝ¤Ë¤Ï @c endian ¤Ë±þ¤¸¤¿¥Ð¥¤¥ÈÎó¤òÀèƬ¤Ë BOM ÉÕ¤­¤ÇÀ¸À®¤¹¤ë¡£ */ int bom; /***en 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 ¤Ê¤é¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ç¤¢¤ë¡£ + ¥¨¥ó¥Ç¥£¥¢¥ó¤Î¥¿¥¤¥×¤ò»ØÄꤹ¤ë¡£ÃÍ¤Ï 0 ¤« 1 ¤Ç¤¢¤ê¡¢0 + ¤Ê¤é¤Ð¥ê¥È¥ë¥¨¥ó¥Ç¥£¥¢¥ó¡¢1 ¤Ê¤é¤Ð¥Ó¥Ã¥°¥¨¥ó¥Ç¥£¥¢¥ó¤Ç¤¢¤ë¡£ - ¤¬ 8 ¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤ÎÃͤϰÕÌ£¤ò»ý¤¿¤Ê¤¤¡£ + \ ¤¬ 8 ¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤ÎÃͤϰÕÌ£¤ò»ý¤¿¤Ê¤¤¡£ */ int endian; } MCodingInfoUTF; @@ -785,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); @@ -795,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); @@ -844,12 +786,10 @@ extern MText *mconv_gets (MConverter *converter, MText *mt); /***ja @brief @c MLocale ¹½Â¤ÂÎ. - @c MLocale ¹½Â¤ÂΤϡ¢¥í¥±¡¼¥ë¤Î̾Á°¡¢¸À¸ì¡¢ÃÏ°è¡¢¥â¥Ç¥£¥Õ¥¡¥¤¥¢¡¢ - ¥³¡¼¥É¥»¥Ã¥È¡¢¤ª¤è¤ÓÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤¿¤á¤ËÍÑ - ¤¤¤é¤ì¤ë¡£ + @c MLocale ¹½Â¤ÂΤϡ¢¥í¥±¡¼¥ë¤Î̾Á°¡¢¸À¸ì¡¢ÃÏ°è¡¢¥â¥Ç¥£¥Õ¥¡¥¤¥¢¡¢¥³¡¼¥É¥»¥Ã¥È¡¢¤ª¤è¤ÓÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£ - ¤³¤Î¹½Â¤ÂΤÎÆâÍƤϼÂÁõ¤Ë°Í¸¤¹¤ë¡£ ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í - ¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */ + ¤³¤Î¹½Â¤ÂΤÎÆâÍƤϼÂÁõ¤Ë°Í¸¤¹¤ë¡£ + ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */ /*** @seealso @@ -859,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); @@ -898,23 +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); /*=*/ @@ -928,8 +888,7 @@ typedef void (*MInputCallbackFunc) (MInputContext *ic, MSymbol command); /***ja @brief ÆþÎϥɥ饤¥ÐÍѹ½Â¤ÂÎ. - @c MInputDriver ¤Ï¡¢ÆþÎϥ᥽¥Ã¥É¤ò¼è¤ê°·¤¦´Ø¿ô¤ò´Þ¤àÆþÎϥ᥽¥Ã¥É¥É - ¥é¥¤¥Ð¤Î¹½Â¤ÂΤη¿¤Ç¤¢¤ë¡£ */ + @c MInputDriver ¤Ï¡¢ÆþÎϥ᥽¥Ã¥É¤ò¼è¤ê°·¤¦´Ø¿ô¤ò´Þ¤àÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð¤Î¹½Â¤ÂΤη¿¤Ç¤¢¤ë¡£ */ typedef struct MInputDriver { @@ -937,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. */ @@ -945,11 +904,11 @@ typedef struct MInputDriver /***ja @brief ÆþÎϥ᥽¥Ã¥É¤ò¥ª¡¼¥×¥ó¤¹¤ë. - ¤³¤Î´Ø¿ô¤Ï¡¢ÆþÎϥ᥽¥Ã¥É $IM ¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£$IM ¤Î °Ê³° - ¤ÎÁ´¥á¥ó¥Ð¡¼¤¬¥»¥Ã¥È¤µ¤ì¤¿¸å¤Ç¡¢´Ø¿ô minput_open_im () ¤«¤é¸Æ¤Ð - ¤ì¤ë¡£$IM ¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ì¤Ð 0 ¤ò¡¢¤Ç¤­¤Ê¤±¤ì¤Ð -1¤òÊÖ¤¹¡£¤³¤Î´Ø - ¿ô¤Ï $IM->info ¤òÀßÄꤷ¤Æ¡¢Â¾¤Î¥É¥é¥¤¥Ð´Ø¿ô¤«¤é»²¾È¤µ¤ì¤ë¾ðÊó¤ò - ÊÝ»ý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + ¤³¤Î´Ø¿ô¤Ï¡¢ÆþÎϥ᥽¥Ã¥É $IM ¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£$IM ¤Î \ + °Ê³°¤ÎÁ´¥á¥ó¥Ð¡¼¤¬¥»¥Ã¥È¤µ¤ì¤¿¸å¤Ç¡¢´Ø¿ô minput_open_im () + ¤«¤é¸Æ¤Ð¤ì¤ë¡£$IM ¤ò¥ª¡¼¥×¥ó¤Ç¤­¤ì¤Ð 0 ¤ò¡¢¤Ç¤­¤Ê¤±¤ì¤Ð -1¤òÊÖ¤¹¡£ + ¤³¤Î´Ø¿ô¤Ï $IM->info + ¤òÀßÄꤷ¤Æ¡¢Â¾¤Î¥É¥é¥¤¥Ð´Ø¿ô¤«¤é»²¾È¤µ¤ì¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ */ int (*open_im) (MInputMethod *im); @@ -967,9 +926,10 @@ typedef struct MInputDriver @brief ÆþÎϥ᥽¥Ã¥É¤ò¥¯¥í¡¼¥º¤¹¤ë. ¤³¤Î´Ø¿ô¤Ï¡¢ÆþÎϥ᥽¥Ã¥É $IM ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£´Ø¿ô - minput_close_im () ¤«¤é¸Æ¤Ð¤ì¤ë¡£ÆþÎϥ᥽¥Ã¥É¤Î¥¯¥í¡¼¥º¤¬¤¹¤Ù¤Æ - ½ªÎ»¤·¤¿»þÅÀ¤Ç¡¢$IM->info ¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥á¥â¥ê¤ò(¤¢¤ì¤Ð)¤¹ - ¤Ù¤Æ³«Êü¤¹¤ë¡£¤¿¤À¤·¡¢$IM ¤Î¾¤Î¥á¥ó¥Ð¤Ë±Æ¶Á¤òÍ¿¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + minput_close_im () ¤«¤é¸Æ¤Ð¤ì¤ë¡£ + ÆþÎϥ᥽¥Ã¥É¤Î¥¯¥í¡¼¥º¤¬¤¹¤Ù¤Æ½ªÎ»¤·¤¿»þÅÀ¤Ç¡¢¤³¤Î´Ø¿ô¤Ï$IM->info + ¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥á¥â¥ê¤ò(¤¢¤ì¤Ð)¤¹¤Ù¤Æ³«Êü¤¹¤ë¡£ + ¤¿¤À¤·¡¢$IM ¤Î¾¤Î¥á¥ó¥Ð¤Ë±Æ¶Á¤òÍ¿¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ */ void (*close_im) (MInputMethod *im); @@ -979,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. */ @@ -987,11 +947,11 @@ typedef struct MInputDriver /***ja @brief ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤òÀ¸À®¤¹¤ë. - ¤³¤Î´Ø¿ô¤ÏÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È $IC ¤òÀ¸À®¤¹¤ë¡£$IC ¤Î °Ê³°¤Î - Á´¥á¥ó¥Ð¡¼¤¬¥»¥Ã¥È¤µ¤ì¤¿¸å¤Ç¡¢´Ø¿ô minput_create_ic () ¤«¤é¸Æ¤Ð - ¤ì¤ë¡£$IC ¤òÀ¸À®¤Ç¤­¤ì¤Ð 0 ¤ò¡¢¤Ç¤­¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤¹¡£¤³¤Î´Ø¿ô - ¤Ï $IC->info ¤òÀßÄꤷ¤Æ¡¢Â¾¤Î¥É¥é¥¤¥Ð´Ø¿ô¤«¤é»²¾È¤µ¤ì¤ë¾ðÊó¤òÊÝ - »ý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ */ + ¤³¤Î´Ø¿ô¤ÏÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È $IC ¤òÀ¸À®¤¹¤ë¡£ + $IC ¤Î \ °Ê³°¤ÎÁ´¥á¥ó¥Ð¡¼¤¬¥»¥Ã¥È¤µ¤ì¤¿¸å¤Ç¡¢´Ø¿ô + minput_create_ic () ¤«¤é¸Æ¤Ð¤ì¤ë¡£ + $IC ¤òÀ¸À®¤Ç¤­¤ì¤Ð 0 ¤ò¡¢¤Ç¤­¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤¹¡£ + ¤³¤Î´Ø¿ô¤Ï $IC->info ¤òÀßÄꤷ¤Æ¡¢Â¾¤Î¥É¥é¥¤¥Ð´Ø¿ô¤«¤é»²¾È¤µ¤ì¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ */ int (*create_ic) (MInputContext *ic); @@ -1008,8 +968,8 @@ typedef struct MInputDriver /***ja @brief ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤òÇ˲õ¤¹¤ë. - ´Ø¿ô minput_destroy_ic () ¤«¤é¸Æ¤Ð¤ì¡¢ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È $IC ¤òÇË - ²õ¤¹¤ë¡£ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤ÎÇ˲õ¤¬¤¹¤Ù¤Æ½ªÎ»¤·¤¿»þÅÀ¤Ç¡¢$IC->info + ´Ø¿ô minput_destroy_ic () ¤«¤é¸Æ¤Ð¤ì¡¢ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È $IC + ¤òÇ˲õ¤¹¤ë¡£ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤ÎÇ˲õ¤¬¤¹¤Ù¤Æ½ªÎ»¤·¤¿»þÅÀ¤Ç¡¢$IC->info ¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥á¥â¥ê¤ò(¤¢¤ì¤Ð)¤¹¤Ù¤Æ³«Êü¤¹¤ë¡£¤¿¤À¤·¡¢$IC ¤Î¾¤Î¥á¥ó¥Ð¤Ë±Æ¶Á¤òÍ¿¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ */ @@ -1028,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 @@ -1040,17 +1000,17 @@ typedef struct MInputDriver ´Ø¿ô minput_filter () ¤«¤é¸Æ¤Ð¤ì¡¢ÆþÎÏ¥­¡¼¤ò¥Õ¥£¥ë¥¿¤¹¤ë¡£°ú¿ô $KEY, $ARG ¤Ï´Ø¿ô minput_filter () ¤Î¤â¤Î¤ÈƱ¤¸¡£ - ¤³¤Î´Ø¿ô¤Ï $KEY ¤ò½èÍý¤·¡¢$IC ¤ÎÆâÉô¾õÂÖ¤ò¹¹¿·¤¹¤ë¡£ $KEY ¤¬ÆþÎÏ - ¥á¥½¥Ã¥É¤ËµÛ¼ý¤µ¤ì¤Æ¥Æ¥­¥¹¥È¤¬À¸À®¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ 1 ¤òÊÖ - ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ + ¤³¤Î´Ø¿ô¤Ï $KEY ¤ò½èÍý¤·¡¢$IC ¤ÎÆâÉô¾õÂÖ¤ò¹¹¿·¤¹¤ë¡£ $KEY + ¤¬ÆþÎϥ᥽¥Ã¥É¤ËµÛ¼ý¤µ¤ì¤Æ¥Æ¥­¥¹¥È¤¬À¸À®¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ + 1 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£ - ¥á¥ó¥Ð ¤ËɬÍפǤ¢¤ì¤Ð¡¢$IC->status, $IC->preedit, + ¥á¥ó¥Ð \ ¤ËɬÍפǤ¢¤ì¤Ð¡¢$IC->status, $IC->preedit, $IC->cursor_pos, $IC->ncandidates, $IC->candidates, $IC->produced ¤ò¹¹¿·¤Ç¤­¤ë¡£ $ARG ¤Î°ÕÌ£¤ÏÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð¤Ë°Í¸¤¹¤ë¡£Îã¤Ï @c - minput_default_driver ¤Þ¤¿¤Ï @c minput_gui_driver ¤ÎÀâÌÀ¤ò»²¾È¤Î - ¤³¤È¡£ */ + minput_default_driver ¤Þ¤¿¤Ï @c minput_gui_driver + ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ */ int (*filter) (MInputContext *ic, MSymbol key, void *arg); @@ -1070,10 +1030,10 @@ typedef struct MInputDriver /***ja @brief ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤ÇÀ¸À®¤µ¤ì¤ë¥Æ¥­¥¹¥È¤Î³ÍÆÀ. - ´Ø¿ô minput_lookup () ¤«¤é¸Æ¤Ð¤ì¡¢ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È $IC ¤ÇÀ¸À®¤µ - ¤ì¤ë¥Æ¥­¥¹¥È¤ò¸¡º÷¤¹¤ë¡£ÆþÎÏ¥­¡¼ $KEY ¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ë¥Æ¥­¥¹¥È - ¤¬¤¢¤ì¤Ð¡¢M-text $MT ¤ËÄɲ乤롣 $KEY ¤¬ÆþÎϥ᥽¥Ã¥É $IC ¤Ë¤è¤Ã - ¤ÆÀµ¤·¤¯½èÍý¤µ¤ì¤ì¤Ð 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 1 ¤òÊÖ¤¹¡£ + ´Ø¿ô minput_lookup () ¤«¤é¸Æ¤Ð¤ì¡¢ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È $IC + ¤ÇÀ¸À®¤µ¤ì¤ë¥Æ¥­¥¹¥È¤ò¸¡º÷¤¹¤ë¡£ÆþÎÏ¥­¡¼ $KEY + ¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤ë¥Æ¥­¥¹¥È¤¬¤¢¤ì¤Ð¡¢M-text $MT ¤ËÄɲ乤롣 $KEY + ¤¬ÆþÎϥ᥽¥Ã¥É $IC ¤Ë¤è¤Ã¤ÆÀµ¤·¤¯½èÍý¤µ¤ì¤ì¤Ð 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð 1 ¤òÊÖ¤¹¡£ $ARG ¤Î°ÕÌ£¤ÏÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð¤Ë°Í¸¤¹¤ë¡£Îã¤Ï @c minput_default_driver ¤Þ¤¿¤Ï @c minput_gui_driver ¤ÎÀâÌÀ¤ò»²¾È¤Î @@ -1085,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; @@ -1125,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. @@ -1140,16 +1120,15 @@ struct MInputMethod { /***en Which language this input method is for. The value is @c Mnil if the input method is foreign. */ - /***ja ¤É¤Î¸À¸ìÍѤÎÆþÎϥ᥽¥Ã¥É¤«¡£ÆþÎϥ᥽¥Ã¥É¤¬³°Éô¤Î¤â¤Î¤Ç¤¢¤ë¾ì - ¹ç¤Ë¤ÏÃͤȤ·¤Æ @c Mnil ¤ò»ý¤Ä¡£ */ + /***ja ¤É¤Î¸À¸ìÍѤÎÆþÎϥ᥽¥Ã¥É¤«¡£ + ÆþÎϥ᥽¥Ã¥É¤¬³°Éô¤Î¤â¤Î¤Ç¤¢¤ë¾ì¹ç¤ÎÃÍ¤Ï @c Mnil ¡£ */ MSymbol language; /***en Name of the input method. If the input method is foreign, it must has a property of key @c Minput_driver and the value must be a pointer to a proper input method driver. */ /***ja ÆþÎϥ᥽¥Ã¥É¤Î̾Á°¡£³°Éô¥á¥½¥Ã¥É¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢@c - Minput_driver ¤ò¥­¡¼¤È¤¹¤ë¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Á¡¢¤½¤ÎÃͤÏŬÀÚ¤ÊÆþÎÏ¥á - ¥½¥Ã¥É¥É¥é¥¤¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£*/ + Minput_driver ¤ò¥­¡¼¤È¤¹¤ë¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Á¡¢¤½¤ÎÃͤÏŬÀÚ¤ÊÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£*/ MSymbol name; /***en Input method driver of the input method. */ @@ -1160,15 +1139,32 @@ 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; }; /*=*/ /***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 @@ -1177,15 +1173,14 @@ struct MInputMethod /***ja @brief ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥ÈÍѹ½Â¤ÂÎ. - @c MInputContext ¤Ï¡¢ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¥ª¥Ö¥¸¥§¥¯¥ÈÍѤι½Â¤ÂΤη¿¤Ç - ¤¢¤ë¡£ */ + @c MInputContext ¤Ï¡¢ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¥ª¥Ö¥¸¥§¥¯¥ÈÍѤι½Â¤ÂΤη¿¤Ç¤¢¤ë¡£ */ struct MInputContext { /***en Backward pointer to the input method. It is set up be the function minput_create_ic (). */ - /***ja ÆþÎϥ᥽¥Ã¥É¤Ø¤ÎµÕ¥Ý¥¤¥ó¥¿¡£´Ø¿ô minput_create_ic () ¤Ë¤è¤Ã¤Æ - ÀßÄꤵ¤ì¤ë¡£ */ + /***ja ÆþÎϥ᥽¥Ã¥É¤Ø¤ÎµÕ¥Ý¥¤¥ó¥¿¡£´Ø¿ô minput_create_ic () + ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ */ MInputMethod *im; /***en M-text produced by the input method. It is set up by the @@ -1194,20 +1189,18 @@ 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; /***en Flag telling whether the input context is currently active or inactive. The value is set to 1 (active) when the input context - is created. It can be toggled by the function minput_toggle - (). */ - /***ja ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤¬¥¢¥¯¥Æ¥£¥Ö¤«¤É¤¦¤«¤ò¼¨¤¹¥Õ¥é¥°¡£ÆþÎÏ¥³¥ó¥Æ - ¥¯¥¹¥È¤¬À¸À®¤µ¤ì¤¿»þÅÀ¤Ç¤ÏÃÍ¤Ï 1 ¡Ê¥¢¥¯¥Æ¥£¥Ö¡Ë¤Ç¤¢¤ê¡¢´Ø¿ô + is created. It is toggled by the function minput_toggle (). */ + /***ja ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤¬¥¢¥¯¥Æ¥£¥Ö¤«¤É¤¦¤«¤ò¼¨¤¹¥Õ¥é¥°¡£ + ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤¬À¸À®¤µ¤ì¤¿»þÅÀ¤Ç¤ÏÃÍ¤Ï 1 ¡Ê¥¢¥¯¥Æ¥£¥Ö¡Ë¤Ç¤¢¤ê¡¢´Ø¿ô minput_toggle () ¤Ë¤è¤Ã¤Æ¥È¥°¥ë¤µ¤ì¤ë¡£ */ int active; - /***en Spot location and size of the input context. */ /***ja ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤Î¥¹¥Ý¥Ã¥È¤Î°ÌÃÖ¤ÈÂ礭¤µ. */ struct { @@ -1227,72 +1220,125 @@ 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 (). */ - /***ja °Ê²¼¤Î¥á¥ó¥Ð¤Î»ÈÍÑË¡¤ÏÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£°Ê - ²¼¤ÎÀâÌÀ¤Ï¡¢ÆâÉôÆþÎϥ᥽¥Ã¥ÉÍѤÎÆþÎϥɥ饤¥Ð¤ËÂФ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ - ¤³¤ì¤é¤Ï´Ø¿ô ->driver.filter () ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£ */ + \->driver.filter (). */ + /***ja °Ê²¼¤Î¥á¥ó¥Ð¤Î»ÈÍÑË¡¤ÏÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ + °Ê²¼¤ÎÀâÌÀ¤Ï¡¢ÆâÉôÆþÎϥ᥽¥Ã¥ÉÍѤÎÆþÎϥɥ饤¥Ð¤ËÂФ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ + ¤³¤ì¤é¤Ï´Ø¿ô \->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; /***en M-text describing the current status of the input context. */ - /***ja ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤Î¸½ºß¤Î¾õ¶·¤òɽ¤¹ M-text */ + /***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 () ¤Ï¡¢\ ¤òÊѤ¨¤¿ºÝ¤Ë¤³¤ÎÃͤò + 1 ¤ËÀßÄꤹ¤ë¡£ */ int cursor_pos_changed; - /***en Array of the current candidate texts. */ - /***ja ¸½ºß¤Î¥Æ¥­¥¹¥È¸õÊä¤ÎÇÛÎó. */ + /***en Plist of the current candidate groups. Each element is an + M-text or a plist. If an element is an M-text (i.e. the key is Mtext), + candidates in that group are characters in the M-text. If it is + a plist (i.e. the key is Mplist), each element is an M-text, and + candidates in that group are those M-texts. */ + /***ja ¸½ºß¤Î¸õÊ䥰¥ë¡¼¥×¤Î Plist ¡£³ÆÍ×ÁÇ¤Ï M-text ¤« plist ¤Ç¤¢¤ë¡£ + Í×ÁǤ¬ M-text ¤Î¾ì¹ç¡Ê¥­¡¼¤¬ Mtext ¤Ç¤¢¤ë¾ì¹ç¡Ë¤Ë¤Ï¡¢¤½¤Î¥°¥ë¡¼¥×¤Î¸õÊä¤Ï¤½¤Î + M-text Ãæ¤Î³Æʸ»ú¤Ç¤¢¤ë¡£ Í×ÁǤ¬ plist ¤Î¾ì¹ç¡Ê¥­¡¼¤¬ Mplist + ¤Ç¤¢¤ë¾ì¹ç¡Ë¤Ë¤Ï¡¢¤½¤Î¥ê¥¹¥È¤Î³ÆÍ×ÁÇ¤Ï M-text ¤Ç¤¢¤ê¡¢¤½¤ì¤é¤¬¤½¤Î¥°¥ë¡¼¥×¤Î¸õÊä¤È¤Ê¤ë¡£ */ MPlist *candidate_list; + + /***en Index number of the currently selected candidate in all the + candidates. The index of the first candidate is 0. If the + number is 8, and the first candidate group contains 7 + candidates, the currently selected candidate is the second element of the + second candidate group. */ + /***ja ¸½ºßÁªÂò¤µ¤ì¤Æ¤¤¤ë¸õÊ䤬Á´¸õÊäÃæ¤Ç²¿ÈÖÌܤ«¤ò¤ò¼¨¤¹¥¤¥ó¥Ç¥Ã¥¯¥¹¡£ + ºÇ½é¤Î¸õÊä¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï 0¡£ºÇ½é¤Î¸õÊ䥰¥ë¡¼¥×¤Ë¼·¤Ä¤Î¸õÊ䤬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢¤³¤ÎÃͤ¬ + 8 ¤Ê¤é¤Ð¡¢¸½ºß¤Î¸õÊä¤ÏÆóÈÖÌܤθõÊ䥰¥ë¡¼¥×¤ÎÆóÈÖÌܤÎÍ×ÁǤȤ¤¤¦¤³¤È¤Ë¤Ê¤ë¡£ + */ int candidate_index; + + /* @{ */ + /***en Start and the end positions of the preedit text where + \ 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 + value to 1 when an input method required to show candidates, and + sets the value to 0 otherwise. */ + /***ja ¸½ºß¤Î¸õÊ䥰¥ë¡¼¥×¤òɽ¼¨¤¹¤ë¤«¤É¤¦¤«¤ò¼¨¤¹¥Õ¥é¥°¡£ + ´Ø¿ô \->driver.filter () ¤Ï¡¢ÆþÎϥ᥽¥Ã¥É¤¬¸õÊä¤Îɽ¼¨¤òÍ׵ᤷ¤¿»þ¤³¤ÎÃͤò + 1 ¤Ë¡¢¤½¤ì°Ê³°¤Î»þ 0 ¤ËÀßÄꤹ¤ë¡£ */ int candidate_show; - /***en The function ->driver.filter () sets the value to 1 when - it changes one of the above members. */ - /***ja ´Ø¿ô ->driver.filter () ¤Ï¡¢¾åµ­¤Î¥á¥ó¥Ð¤Î£±¤Ä¤òÊѤ¨¤¿»þ - ¤³¤ÎÃͤò 1 ¤ËÀßÄꤹ¤ë¡£ */ + /***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 + otherwise. */ + /***ja ´Ø¿ô \->driver.filter () ¤Ï¡¢¾åµ­¤Î¥á¥ó¥Ð \ + ¤Î£±¤Ä¤Ç¤âÊѹ¹¤·¤¿ºÝ¤Ë¤Ï¡¢¤³¤ÎÃͤò @c enum @c + MInputCandidatesChanged ¤Î¥Ó¥Ã¥Èñ°Ì¤Ç¤ÎÏÀÍý OR ¤ËÀßÄꤹ¤ë¡£¤½¤¦ + ¤Ç¤Ê¤±¤ì¤Ð 0 ¤ËÀßÄꤹ¤ë¡£ */ int candidates_changed; + /***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 + m17n_object_unref (). */ + /***ja \->driver ¤Î´Ø¿ô·²¤Ë¤è¤Ã¤Æ¼«Í³¤Ë»ÈÍѤǤ­¤ë plist¡£ + ÆâÉôÆþÎϥ᥽¥Ã¥ÉÍѥɥ饤¥Ð¤Ï¤³¤ì¤ò¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤È¤Î°ú¿ô¤äÊÖÃÍ + ¤Î¼õÅϤ·¤Ë»ÈÍѤ¹¤ë¡£´Ø¿ô \->driver.create_ic () ¤Ï¤³¤Î plist + ¤ò¶õ¤ËÀßÄꤹ¤ë¡£´Ø¿ô\->driver.destroy_ic () ¤Ï + m17n_object_unref () ¤òÍѤ¤¤Æ¤³¤Î plist ¤ò²òÊü¤¹¤ë¡£ */ MPlist *plist; }; /*=*/ +/*** @} */ +/*=*/ extern MInputMethod *minput_open_im (MSymbol language, MSymbol name, void *arg); @@ -1309,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_ */