From 80505c5a0347d0d4b7a05c7660ef5ba8812e86e4 Mon Sep 17 00:00:00 2001 From: nisikimi Date: Fri, 27 Mar 2009 06:48:14 +0000 Subject: [PATCH] *** empty log message *** --- FORMATS/IM-xml.txt | 1464 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 982 insertions(+), 482 deletions(-) diff --git a/FORMATS/IM-xml.txt b/FORMATS/IM-xml.txt index 644cfb1..d483c1c 100644 --- a/FORMATS/IM-xml.txt +++ b/FORMATS/IM-xml.txt @@ -31,95 +31,85 @@ is converted into the form of plist in the driver. xmlns:xi="http://www.w3.org/1999/XML/xinclude" xmlns="http://relaxng.org/ns/structure/1.0" ns="http://www.m17n.org/MIM"> - - - - - - - + - - - - - - - - + + + + + + + + + - - - +@endverbatim - - - +The top-level node of an input method has a <input-method> tag. - - - +The element <description> can appear in <input-method>, <variable> or +<command>, and specifies the description text of its parent. The +content of the element <get-text> is translated according to the +current locale by "gettext" (if the translation is provided). - - - +The element <title> contains a string that is displayed on the screen +when this input method is active. - - - - - +@verbatim - - + - t [a-z]{2,3} - - - nil - [^n][^i][^l] @@ -133,35 +123,62 @@ element is required to identify the input method. --> + - [0-9]+\.[0-9]+\.[0-9]+ - +@endverbatim - - +The element <tags> specifies for which language the input method is, +and the name of the input method. There is one special input method +file "global.mimx" that declares common variables and commands. The +input method driver always loads this file and other input methods can +inherit its variables and commands. - +When the element <language> has "t" as its content, the use of the +input method is not limited to one language. When the content is +other than "t", it must be a valid code in ISO639-1, two-character +code or ISO639-2, three charcter code for the names of languages. + +When the element <name> has "nil" as its content, the input method is +not standalone, but is expected to be used in other input methods. In +such cases, the element <extra-id> is required to identify the input +method. When the element <name> has content other than "nil", the +element <extra-id> is optional. + +#if EXAMPLE_CODE + + bo + ewts + +#endif + +#if EXAMPLE_CODE + + t + nil + zh-util + +#endif + +The optional element <m17n-version> specifies the required minimum +version number of the m17n library. The format is "X.Y.Z" where X is +a major version number, Y is a minor version number, and Z is a patch +level. + +@subsection im-setups Input Method Setups + +@verbatim + + - - @@ -172,38 +189,28 @@ specially for the current input method. In the latter case, can be omit - - string - symbol - integer + - - string @@ -220,42 +227,104 @@ implicitly (e.g. candidates-charset). --> - - - - - - - - - + + - - - - - + + + +@endverbatim + +<variable-list> declares variables used in this input method. If a +variable must be initialized to the default value, or is to be +customized by a user, it must be declared here. The declaration can +be used in two ways. One is to introduce a new variable. In that +case, the <value> element in <variable> must not be omitted. Another +is to inherit the variable from what declared in "global.mim", and to +give the different default value and/or to make the variable +customizable specially for the current input method. In the latter +case, <value> can be omitted. + +Each <variable> declares one variable, and a variable is referred with +the attribute "id". <value> of a <variable> can be an integer, a +symbol, or an M-text value. All variables are implicitly initialized +to the integer value zero. + +The M-text (string) <value> can be referred by the <insert> action. +The symbol <value> can not be referred directly, but is used the +library implicitly (e.g. candidates-charset). The integer <value> can +be set, modified and referred by the <set>, <add>, <sub>, <mul>, and +<div> action. It can be referred by the the <insert>, <select>, +<undo>, <if>, and <cond> actions. + +<variable-value-candidate> lists the possible values of the variable. +<c-value> specifies one of the possible value of the variable. It can +be a M-text (string), a symbol or an integer. + +<c-range> specifies a range of integers that the variable can have as +its value. It can be used mixed with <c-value>. The attribute "from +is the minimum integer value that a variable can take, and the +attribute "to" is the maximum. + +#if EXAMPLE_CODE + + + + Flag to tell whether or not to generate precomposed characters. + If 1, generate precomposed characters if available (e.g. "ྲྀ"(U+0F76). + If 0, generate only decomposed characters (e.g. "ྲྀ" (U+0FB2 U+0F80). + + 0 + + 0 + 1 + + + +#endif + +This code declares one variable "precomposed" whose value can be 0 or +1 and is initially set to 0. + +@verbatim + + + predefined + + + handled-keys + predefined-surround-text-flag + @.+ + + + + +@endverbatim + +Predefined-variables are variables whose "type" attribute has the +value "predefiend". When "id" sttribute has the value "handled-keys", +the value of the variable is the number of handled keys at that +moment. If the "id" attrubyte has the value +"predefined-surround-text-flag", the value of the variable is -1 +if surrounding text is supported, and -2 if not. + +#if EXAMPLE_CODE + +#endif + +This code referes to a predefined varialbe "handled-keys". + +@verbatim + - - - command-.* @@ -268,22 +337,45 @@ latter case, can be omitted.--> +@endverbatim + +<command-list> declares a command used in the input method. If a +command must be bound to the default key sequence, or is to be +customized by a user, it must be declared here. Like <variable-list>, +the declaration can be used in two ways. One is to introduce a new +command. In that case, the <keyseq> element must appear in <command>. +Another is to inherit the command from what declared in "global.mim", +and to give the different key binding and/or to make the command +customizable specially for the current input method. In the latter +case, <keyseq> can be omitted. + +Each <command> declares one command and a command <command> is +referred with the attribute "id". + +#if EXAMPLE_CODE + + + + Commit + Commit the preedit text + + Return + Linefeed + + +#endif + +@verbatim + - - module-.* - function-.* @@ -295,14 +387,40 @@ it is called with only the default arguments when the input context is destroye +@endverbatim + +Each <module> element declares an external module (i.e. dynamic +library). The value of "id" attribute gives the name of the module + +<function> elements specify function names exported by the module. If +the "id" attribute has the value "function-init", it is called with +only the default arguments (see <call>) when an input context is +created for the input method. If the "id" attribute has the value +"function-fini", it is called with only the default arguments when the +input context is destroyed. + +#if EXAMPLE_CODE + + + + + + + + + + +#endif + +This code declares a module "module-libmimx-anthy" who export six functions. + +@verbatim + - - macro-.* @@ -311,25 +429,178 @@ it is called with only the default arguments when the input context is destroye - +@endverbatim + +The elemnt <macro> bundles and names a set of <action>s. The +attribute "id" gives the name of a <macro>, and a macro is referred +with this attribute. + +#if EXAMPLE_CODE + + + + + + + : : ;; more s + + +#endif + +This code declares one macro "macro-forward". + +@verbatim + + + + + + + + +@endverbatim + +A marker is a symbol indicating a character position in the preediting +text. The element <mark-current-position> assigns a position to +a marker. The position of a marker is referred by the elements +<move-to-marker> and <delete-to-marker>. + +@verbatim + + + + + @[0-9] + + @first + @current + @last + @previous + @next + @previous_candidate_list + @next_candidate_list + + + + +@endverbatim + +Predefined markers start with @@. @@0, @@1, ... , @@9 mark the 0th, 1st, +2nd,... 9th position respetively. @@previous_candidate_list mark the +previous position where a candidate list changes. +@@next_candidate_list mark the next position where a candidate list +changes. + +#if EXAMPLE_CODE + +#endif + +This code deletes character between the first position and the current +position in the buffer. + +@verbatim + + + + [^@].* + + + +@endverbatim + +User-defined markers may not start with @@. + +#if EXAMPLE_CODE + +#endif + +This code moves the marker to the usr defined position T. + +@verbatim + + + + + + + + + + + + +@endverbatim + +The element <predefined-nth-previous-or-following-character> specifies +a character inside or outside of the preedit buffer. + +When the value of the attribute "position" is a negative integer -N, +the element <predefined-nth-previous-or-following-character> means the +Nth previous character in the preedit buffer. If there are only M +(M<N) previous characters in it, the value is the (N-M)th previous +character from the inputting spot. + +When the value of the attribute "position" is a positive integer N, +the element <predefined-nth-previous-or-following-character> means the +Nth following character in the preedit buffer. If there are only M +(M<N) following characters in it, the value is the (N-M)th following +character from the inputting spot. + +#if EXAMPLE_CODE + +#endif + +This code refers to the previous character. + +@verbatim + + + @[0-9] + @first + @current + @last + @previous + @next + @previous_candidate_list + @next_candidate_list + + + +@endverbatim + +Predefined-selectors specify positions in a candidate list. They are +used in the element <select>. + +@@0, @@1, ... , @@9 specify the 0th, 1st, ... 9th position +respetively. @@previous means the previous position, and if the +current candidate is the first one in the current candidate group, +this value means the last candidate in the previous candidate +group. @@next means the next position, and if the current candidate is +the last one in the current candidate group, this value means the +first candidate in the next candidate group. +@@previous_candidate_list specifies the candidate in the previous +candidate group having the same candidate index as the current one, +and @@next_candidate_list specifies the candidate in the next +candidate group having the same candidate index as the current one. + +#if EXAMPLE_CODE + +