From dafebc5bb70303f0b5baf0b087cf4d9a64b5c7f0 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 12 Sep 2011 11:27:51 +0200 Subject: Synchronised line endinge with release branch --- libX11/specs/i18n/framework/Makefile.am | 32 +- libX11/specs/i18n/localedb/Makefile.am | 26 +- libX11/specs/i18n/localedb/localedb.xml | 1554 ++++++------ libX11/specs/i18n/trans/Makefile.am | 26 +- libX11/specs/i18n/trans/trans.xml | 3958 +++++++++++++++---------------- 5 files changed, 2798 insertions(+), 2798 deletions(-) (limited to 'libX11/specs/i18n') diff --git a/libX11/specs/i18n/framework/Makefile.am b/libX11/specs/i18n/framework/Makefile.am index 38db989db..af7ae1d0e 100644 --- a/libX11/specs/i18n/framework/Makefile.am +++ b/libX11/specs/i18n/framework/Makefile.am @@ -1,16 +1,16 @@ - -if ENABLE_SPECS - -# Main DocBook/XML files (DOCTYPE book) -docbook = framework.xml - -# Included chapters, appendix, images -chapters = framework.svg - -# The location where the DocBook/XML files and their generated formats are installed -shelfdir = $(docdir)/i18n/framework - -# Generate DocBook/XML output formats with or without stylesheets -include $(top_srcdir)/docbook.am - -endif ENABLE_SPECS + +if ENABLE_SPECS + +# Main DocBook/XML files (DOCTYPE book) +docbook = framework.xml + +# Included chapters, appendix, images +chapters = framework.svg + +# The location where the DocBook/XML files and their generated formats are installed +shelfdir = $(docdir)/i18n/framework + +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/docbook.am + +endif ENABLE_SPECS diff --git a/libX11/specs/i18n/localedb/Makefile.am b/libX11/specs/i18n/localedb/Makefile.am index e7ae3523f..68a917c95 100644 --- a/libX11/specs/i18n/localedb/Makefile.am +++ b/libX11/specs/i18n/localedb/Makefile.am @@ -1,13 +1,13 @@ - -if ENABLE_SPECS - -# Main DocBook/XML files (DOCTYPE book) -docbook = localedb.xml - -# The location where the DocBook/XML files and their generated formats are installed -shelfdir = $(docdir)/i18n/localedb - -# Generate DocBook/XML output formats with or without stylesheets -include $(top_srcdir)/docbook.am - -endif ENABLE_SPECS + +if ENABLE_SPECS + +# Main DocBook/XML files (DOCTYPE book) +docbook = localedb.xml + +# The location where the DocBook/XML files and their generated formats are installed +shelfdir = $(docdir)/i18n/localedb + +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/docbook.am + +endif ENABLE_SPECS diff --git a/libX11/specs/i18n/localedb/localedb.xml b/libX11/specs/i18n/localedb/localedb.xml index 7b27d9f0c..c4f6d1377 100644 --- a/libX11/specs/i18n/localedb/localedb.xml +++ b/libX11/specs/i18n/localedb/localedb.xml @@ -1,777 +1,777 @@ - - - - - - - X Locale Database Specification - - - YoshioHoriuchi - IBM Japan - - - 1994IBM Corporation - 1994X Consortium - - - - - -License to use, copy, modify, and distribute this software and its documentation for -any purpose and without fee is hereby granted, provided that the above copyright notice -appear in all copies and that both that copyright notice and this permission notice -appear in supporting documentation, and that the name of IBM not be used in advertising -or publicity pertaining to distribution of the software without specific, written -prior permission. - - -IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY, FITNESS, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS, -IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN -AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files -(the “Software”), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following -conditions: - - - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - - - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - - -Except as contained in this notice, the name of The Open Group shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from X Consortium. - - -X Window System is a trademark of The Open Group. - - - - - -LocaleDB - - -General - -An X Locale Database contains the subset of a user's environment that -depends on language, in X Window System. It is made up from one or more -categories. Each category consists of some classes and sub-classes. - - - -It is provided as a plain ASCII text file, so a user can change its -contents easily. It allows a user to customize the behavior of -internationalized portion of Xlib without changing Xlib itself. - - - -This document describes; - - - - - -Database Format Definition - - - - -Contents of Database in sample implementation - - - - - - -Since it is hard to define the set of required information for all -platforms, only the flexible database format is defined. -The available entries in database are implementation dependent. - - - - -Database Format Definition - -The X Locale Database contains one or more category definitions. -This section describes the format of each category definition. - - - -The category definition consists of one or more class definitions. -Each class definition has a pair of class name and class value, or -has several subclasses which are enclosed by the left brace ({) and -the right brace (}). - - - -Comments can be placed by using the number sign character (#). -Putting the number sign character on the top of the line indicates -that the entire line is comment. Also, putting any whitespace character -followed by the number sign character indicates that a part of the line -(from the number sign to the end of the line) is comment. -A line can be continued by placing backslash (\) character as the -last character on the line; this continuation character will be -discarded from the input. Comment lines cannot be continued on -a subsequent line using an escaped new line character. - - - -X Locale Database only accepts XPCS, the X Portable Character Set. -The reserved symbols are; the quotation mark("), the number sign (#), -the semicolon(;), the backslash(\), the left brace({) and -the right brace(}). - - - -The format of category definition is; - - - - - - - - - - CategoryDefinition - ::= - CategoryHeader CategorySpec CategoryTrailer - - - CategoryHeader - ::= - CategoryName NL - - - CategorySpec - ::= - { ClassSpec } - - - CategoryTrailer - ::= - "END" Delimiter CategoryName NL - - - CategoryName - ::= - String - - - ClassSpec - ::= - ClassName Delimiter ClassValue NL - - - ClassName - ::= - String - - - ClassValue - ::= - ValueList | "{" NL { ClassSpec } "}" - - - ValueList - ::= - Value | Value ";" ValueList - - - Value - ::= - ValuePiece | ValuePiece Value - - - ValuePiece - ::= - String | QuotedString | NumericString - - - String - ::= - Char { Char } - - - QuotedString - ::= - """ QuotedChar { QuotedChar } """ - - - NumericString - ::= - "\\o" OctDigit { OctDigit } - - - - | - "\\d" DecDigit { DecDigit } - - - - | - "\\x" HexDigit { HexDigit } - - - Char - ::= - <XPCS except NL, Space or unescaped reserved symbols> - - - QuotedChar - ::= - <XPCS except unescaped """> - - - OctDigit - ::= - <character in the range of "0" - "7"> - - - DecDigit - ::= - <character in the range of "0" - "9"> - - - HexDigit - ::= - <character in the range of "0" - "9", "a" - "f", "A" - "F"> - - - Delimiter - ::= - Space { Space } - - - Space - ::= - <space> | <horizontal tab> - - - NL - ::= - <newline> - - - - - - -Elements separated by vertical bar (|) are alternatives. Curly -braces ({...}) indicate zero or more repetitions of the enclosed -elements. Square brackets ([...]) indicate that the enclosed element -is optional. Quotes ("...") are used around literal characters. - - - -The backslash, which is not the top character of the NumericString, is -recognized as an escape character, so that the next one character is -treated as a literal character. For example, the two-character -sequence, ""\"""(the backslash followed by the quotation mark) is -recognized and replaced with a quotation mark character. -Any whitespace character, that is not the Delimiter, unquoted and -unescaped, is ignored. - - - - -Contents of Database - -The available categories and classes depend on implementation, because -different platform will require different information set. -For example, some platform have system locale but some platform don't. -Furthermore, there might be a difference in functionality even if the -platform has system locale. - - - -In current sample implementation, categories listed below are available. - - - - - - - - - XLC_FONTSET:XFontSet relative information - - - XLC_XLOCALE:Character classification and conversion information - - - - - - - -XLC_FONTSET Category - -The XLC_FONTSET category defines the XFontSet relative information. -It contains the CHARSET_REGISTRY-CHARSET_ENCODING name and character -mapping side (GL, GR, etc), and is used in Output Method (OM). - - - - - - - - - - class - super class - description - - - - - fsN - - Nth fontset (N=0,1,2, ...) - - - charset - fsN - list of encoding name - - - font - fsN - list of font encoding name - - - - - - - - fsN - - -Includes an encoding information for Nth charset, where N is -the index number (0,1,2,...). If there are 4 charsets available -in current locale, 4 fontsets, fs0, fs1, fs2 and fs3, should be -defined. -This class has two subclasses, 'charset' and 'font'. - - - - - charset - - -Specifies an encoding information to be used internally in Xlib -for this fontset. The format of value is; - - - - - - - - - EncodingInfo - ::= - EncodingName [ ":" EncodingSide ] - - - EncodingName - ::= - CHARSET_REGISTRY-CHARSET_ENCODING - - - EncodingSide - ::= - "GL" | "GR" - - - - - - -For detail definition of CHARSET_REGISTRY-CHARSET_ENCODING, refer -"X Logical Font Descriptions" document. - - -example: - ISO8859-1:GL - - - - - font - - -Specifies a list of encoding information which is used for searching -appropriate font for this fontset. The left most entry has highest -priority. - - - - - - - -XLC_XLOCALE Category - -The XLC_XLOCALE category defines character classification, conversion -and other character attributes. - - - - - - - - - - class - super class - description - - - - - encoding_name - - codeset name - - - mb_cur_max - - MB_CUR_MAX - - - state_depend_encoding - - state dependent or not - - - wc_encoding_mask - - for parsing wc string - - - wc_shift_bits - - for conversion between wc and mb - - - csN - - Nth charset (N=0,1,2,...) - - - side - csN - mapping side (GL, etc) - - - length - csN - length of a character - - - mb_encoding - csN - for parsing mb string - - - wc_encoding - csN - for parsing wc string - - - ct_encoding - csN - list of encoding name for ct - - - - - - - - encoding_name - - -Specifies a codeset name of current locale. - - - - - mb_cur_max - - -Specifies a maximum allowable number of bytes in a multi-byte character. -It is corresponding to MB_CUR_MAX of "ISO/IEC 9899:1990 C Language Standard". - - - - - state_depend_encoding - - -Indicates a current locale is state dependent. The value should be -specified "True" or "False". - - - - - wc_encoding_mask - - -Specifies a bit-mask for parsing wide-char string. Each wide character is -applied bit-and operation with this bit-mask, then is classified into -the unique charset, by using 'wc_encoding'. - - - - - wc_shift_bits - - -Specifies a number of bit to be shifted for converting from a multi-byte -character to a wide character, and vice-versa. - - - - - csN - - - -Includes a character set information for Nth charset, where N is the -index number (0,1,2,...). If there are 4 charsets available in current -locale, cs0, cs1, cs2 and cs3 should be defined. This class has five -subclasses, 'side', 'length', 'mb_encoding' 'wc_encoding' and 'ct_encoding'. - - - - - side - - -Specifies a mapping side of this charset. The format of this value is; - - - Side ::= EncodingSide[":Default"] - - -The suffix ":Default" can be specified. It indicates that a character -belongs to the specified side is mapped to this charset in initial state. - - - - - length - - - -Specifies a number of bytes of a multi-byte character of this charset. -It should not contain the length of any single-shift sequence. - - - - - mb_encoding - - -Specifies a list of shift sequence for parsing multi-byte string. -The format of this value is; - - - - - - - - - MBEncoding - ::= - ShiftType ShiftSequence - - - - | - ShiftType ShiftSequence ";" MBEncoding - - - ShiftType - ::= - "<SS>"|"<LSL>"|"<LSR>" - - - ShiftSequence - ::= - SequenceValue|SequenceValue ShiftSequence - - - SequenceValue - ::= - NumericString - - - - - - -example: - <LSL> \x1b \x28 \x4a; <LSL> \x1b \x28 \x42 - - - - - wc_encoding - - -Specifies an integer value for parsing wide-char string. -It is used to determine the charset for each wide character, after -applying bit-and operation using 'wc_encoding_mask'. -This value should be unique in all csN classes. - - - - - ct_encoding - - -Specifies a list of encoding information that can be used for Compound -Text. - - - - - - - -Sample of X Locale Database - -The following is sample X Locale Database file. - - - -# XLocale Database Sample for ja_JP.euc -# - -# -# XLC_FONTSET category -# -XLC_FONTSET -# fs0 class (7 bit ASCII) -fs0 { - charset ISO8859-1:GL - font ISO8859-1:GL; JISX0201.1976-0:GL -} -# fs1 class (Kanji) -fs1 { - charset JISX0208.1983-0:GL - font JISX0208.1983-0:GL -} -# fs2 class (Half Kana) -fs2 { - charset JISX0201.1976-0:GR - font JISX0201.1976-0:GR -} -# fs3 class (User Defined Character) -# fs3 { -# charset JISX0212.1990-0:GL -# font JISX0212.1990-0:GL -# } -END XLC_FONTSET - -# -# XLC_XLOCALE category -# -XLC_XLOCALE - -encoding_name ja.euc -mb_cur_max 3 -state_depend_encoding False - -wc_encoding_mask \x00008080 -wc_shift_bits 8 - -# cs0 class -cs0 { - side GL:Default - length 1 - wc_encoding \x00000000 - ct_encoding ISO8859-1:GL; JISX0201.1976-0:GL -} -# cs1 class -cs1 { - side GR:Default - length 2 - - wc_encoding \x00008080 - - ct_encoding JISX0208.1983-0:GL; JISX0208.1983-0:GR;\ - JISX0208.1983-1:GL; JISX0208.1983-1:GR -} - -# cs2 class -cs2 { - side GR - length 1 - mb_encoding <SS> \x8e - - wc_encoding \x00000080 - - ct_encoding JISX0201.1976-0:GR -} - -# cs3 class -# cs3 { -# side GL -# length 2 -# mb_encoding <SS> \x8f -# #if HasWChar32 -# wc_encoding \x20000000 -# #else -# wc_encoding \x00008000 -# #endif -# ct_encoding JISX0212.1990-0:GL; JISX0212.1990-0:GR -# } - -END XLC_XLOCALE - - - - -Reference - -[1] ISO/IEC 9899:1990 C Language Standard - - -[2] X Logical Font Descriptions - - - - - + + + + + + + X Locale Database Specification + + + YoshioHoriuchi + IBM Japan + + + 1994IBM Corporation + 1994X Consortium + + + + + +License to use, copy, modify, and distribute this software and its documentation for +any purpose and without fee is hereby granted, provided that the above copyright notice +appear in all copies and that both that copyright notice and this permission notice +appear in supporting documentation, and that the name of IBM not be used in advertising +or publicity pertaining to distribution of the software without specific, written +prior permission. + + +IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS, +IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN +AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION +WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files +(the “Software”), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following +conditions: + + + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + + +Except as contained in this notice, the name of The Open Group shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from X Consortium. + + +X Window System is a trademark of The Open Group. + + + + + +LocaleDB + + +General + +An X Locale Database contains the subset of a user's environment that +depends on language, in X Window System. It is made up from one or more +categories. Each category consists of some classes and sub-classes. + + + +It is provided as a plain ASCII text file, so a user can change its +contents easily. It allows a user to customize the behavior of +internationalized portion of Xlib without changing Xlib itself. + + + +This document describes; + + + + + +Database Format Definition + + + + +Contents of Database in sample implementation + + + + + + +Since it is hard to define the set of required information for all +platforms, only the flexible database format is defined. +The available entries in database are implementation dependent. + + + + +Database Format Definition + +The X Locale Database contains one or more category definitions. +This section describes the format of each category definition. + + + +The category definition consists of one or more class definitions. +Each class definition has a pair of class name and class value, or +has several subclasses which are enclosed by the left brace ({) and +the right brace (}). + + + +Comments can be placed by using the number sign character (#). +Putting the number sign character on the top of the line indicates +that the entire line is comment. Also, putting any whitespace character +followed by the number sign character indicates that a part of the line +(from the number sign to the end of the line) is comment. +A line can be continued by placing backslash (\) character as the +last character on the line; this continuation character will be +discarded from the input. Comment lines cannot be continued on +a subsequent line using an escaped new line character. + + + +X Locale Database only accepts XPCS, the X Portable Character Set. +The reserved symbols are; the quotation mark("), the number sign (#), +the semicolon(;), the backslash(\), the left brace({) and +the right brace(}). + + + +The format of category definition is; + + + + + + + + + + CategoryDefinition + ::= + CategoryHeader CategorySpec CategoryTrailer + + + CategoryHeader + ::= + CategoryName NL + + + CategorySpec + ::= + { ClassSpec } + + + CategoryTrailer + ::= + "END" Delimiter CategoryName NL + + + CategoryName + ::= + String + + + ClassSpec + ::= + ClassName Delimiter ClassValue NL + + + ClassName + ::= + String + + + ClassValue + ::= + ValueList | "{" NL { ClassSpec } "}" + + + ValueList + ::= + Value | Value ";" ValueList + + + Value + ::= + ValuePiece | ValuePiece Value + + + ValuePiece + ::= + String | QuotedString | NumericString + + + String + ::= + Char { Char } + + + QuotedString + ::= + """ QuotedChar { QuotedChar } """ + + + NumericString + ::= + "\\o" OctDigit { OctDigit } + + + + | + "\\d" DecDigit { DecDigit } + + + + | + "\\x" HexDigit { HexDigit } + + + Char + ::= + <XPCS except NL, Space or unescaped reserved symbols> + + + QuotedChar + ::= + <XPCS except unescaped """> + + + OctDigit + ::= + <character in the range of "0" - "7"> + + + DecDigit + ::= + <character in the range of "0" - "9"> + + + HexDigit + ::= + <character in the range of "0" - "9", "a" - "f", "A" - "F"> + + + Delimiter + ::= + Space { Space } + + + Space + ::= + <space> | <horizontal tab> + + + NL + ::= + <newline> + + + + + + +Elements separated by vertical bar (|) are alternatives. Curly +braces ({...}) indicate zero or more repetitions of the enclosed +elements. Square brackets ([...]) indicate that the enclosed element +is optional. Quotes ("...") are used around literal characters. + + + +The backslash, which is not the top character of the NumericString, is +recognized as an escape character, so that the next one character is +treated as a literal character. For example, the two-character +sequence, ""\"""(the backslash followed by the quotation mark) is +recognized and replaced with a quotation mark character. +Any whitespace character, that is not the Delimiter, unquoted and +unescaped, is ignored. + + + + +Contents of Database + +The available categories and classes depend on implementation, because +different platform will require different information set. +For example, some platform have system locale but some platform don't. +Furthermore, there might be a difference in functionality even if the +platform has system locale. + + + +In current sample implementation, categories listed below are available. + + + + + + + + + XLC_FONTSET:XFontSet relative information + + + XLC_XLOCALE:Character classification and conversion information + + + + + + + +XLC_FONTSET Category + +The XLC_FONTSET category defines the XFontSet relative information. +It contains the CHARSET_REGISTRY-CHARSET_ENCODING name and character +mapping side (GL, GR, etc), and is used in Output Method (OM). + + + + + + + + + + class + super class + description + + + + + fsN + + Nth fontset (N=0,1,2, ...) + + + charset + fsN + list of encoding name + + + font + fsN + list of font encoding name + + + + + + + + fsN + + +Includes an encoding information for Nth charset, where N is +the index number (0,1,2,...). If there are 4 charsets available +in current locale, 4 fontsets, fs0, fs1, fs2 and fs3, should be +defined. +This class has two subclasses, 'charset' and 'font'. + + + + + charset + + +Specifies an encoding information to be used internally in Xlib +for this fontset. The format of value is; + + + + + + + + + EncodingInfo + ::= + EncodingName [ ":" EncodingSide ] + + + EncodingName + ::= + CHARSET_REGISTRY-CHARSET_ENCODING + + + EncodingSide + ::= + "GL" | "GR" + + + + + + +For detail definition of CHARSET_REGISTRY-CHARSET_ENCODING, refer +"X Logical Font Descriptions" document. + + +example: + ISO8859-1:GL + + + + + font + + +Specifies a list of encoding information which is used for searching +appropriate font for this fontset. The left most entry has highest +priority. + + + + + + + +XLC_XLOCALE Category + +The XLC_XLOCALE category defines character classification, conversion +and other character attributes. + + + + + + + + + + class + super class + description + + + + + encoding_name + + codeset name + + + mb_cur_max + + MB_CUR_MAX + + + state_depend_encoding + + state dependent or not + + + wc_encoding_mask + + for parsing wc string + + + wc_shift_bits + + for conversion between wc and mb + + + csN + + Nth charset (N=0,1,2,...) + + + side + csN + mapping side (GL, etc) + + + length + csN + length of a character + + + mb_encoding + csN + for parsing mb string + + + wc_encoding + csN + for parsing wc string + + + ct_encoding + csN + list of encoding name for ct + + + + + + + + encoding_name + + +Specifies a codeset name of current locale. + + + + + mb_cur_max + + +Specifies a maximum allowable number of bytes in a multi-byte character. +It is corresponding to MB_CUR_MAX of "ISO/IEC 9899:1990 C Language Standard". + + + + + state_depend_encoding + + +Indicates a current locale is state dependent. The value should be +specified "True" or "False". + + + + + wc_encoding_mask + + +Specifies a bit-mask for parsing wide-char string. Each wide character is +applied bit-and operation with this bit-mask, then is classified into +the unique charset, by using 'wc_encoding'. + + + + + wc_shift_bits + + +Specifies a number of bit to be shifted for converting from a multi-byte +character to a wide character, and vice-versa. + + + + + csN + + + +Includes a character set information for Nth charset, where N is the +index number (0,1,2,...). If there are 4 charsets available in current +locale, cs0, cs1, cs2 and cs3 should be defined. This class has five +subclasses, 'side', 'length', 'mb_encoding' 'wc_encoding' and 'ct_encoding'. + + + + + side + + +Specifies a mapping side of this charset. The format of this value is; + + + Side ::= EncodingSide[":Default"] + + +The suffix ":Default" can be specified. It indicates that a character +belongs to the specified side is mapped to this charset in initial state. + + + + + length + + + +Specifies a number of bytes of a multi-byte character of this charset. +It should not contain the length of any single-shift sequence. + + + + + mb_encoding + + +Specifies a list of shift sequence for parsing multi-byte string. +The format of this value is; + + + + + + + + + MBEncoding + ::= + ShiftType ShiftSequence + + + + | + ShiftType ShiftSequence ";" MBEncoding + + + ShiftType + ::= + "<SS>"|"<LSL>"|"<LSR>" + + + ShiftSequence + ::= + SequenceValue|SequenceValue ShiftSequence + + + SequenceValue + ::= + NumericString + + + + + + +example: + <LSL> \x1b \x28 \x4a; <LSL> \x1b \x28 \x42 + + + + + wc_encoding + + +Specifies an integer value for parsing wide-char string. +It is used to determine the charset for each wide character, after +applying bit-and operation using 'wc_encoding_mask'. +This value should be unique in all csN classes. + + + + + ct_encoding + + +Specifies a list of encoding information that can be used for Compound +Text. + + + + + + + +Sample of X Locale Database + +The following is sample X Locale Database file. + + + +# XLocale Database Sample for ja_JP.euc +# + +# +# XLC_FONTSET category +# +XLC_FONTSET +# fs0 class (7 bit ASCII) +fs0 { + charset ISO8859-1:GL + font ISO8859-1:GL; JISX0201.1976-0:GL +} +# fs1 class (Kanji) +fs1 { + charset JISX0208.1983-0:GL + font JISX0208.1983-0:GL +} +# fs2 class (Half Kana) +fs2 { + charset JISX0201.1976-0:GR + font JISX0201.1976-0:GR +} +# fs3 class (User Defined Character) +# fs3 { +# charset JISX0212.1990-0:GL +# font JISX0212.1990-0:GL +# } +END XLC_FONTSET + +# +# XLC_XLOCALE category +# +XLC_XLOCALE + +encoding_name ja.euc +mb_cur_max 3 +state_depend_encoding False + +wc_encoding_mask \x00008080 +wc_shift_bits 8 + +# cs0 class +cs0 { + side GL:Default + length 1 + wc_encoding \x00000000 + ct_encoding ISO8859-1:GL; JISX0201.1976-0:GL +} +# cs1 class +cs1 { + side GR:Default + length 2 + + wc_encoding \x00008080 + + ct_encoding JISX0208.1983-0:GL; JISX0208.1983-0:GR;\ + JISX0208.1983-1:GL; JISX0208.1983-1:GR +} + +# cs2 class +cs2 { + side GR + length 1 + mb_encoding <SS> \x8e + + wc_encoding \x00000080 + + ct_encoding JISX0201.1976-0:GR +} + +# cs3 class +# cs3 { +# side GL +# length 2 +# mb_encoding <SS> \x8f +# #if HasWChar32 +# wc_encoding \x20000000 +# #else +# wc_encoding \x00008000 +# #endif +# ct_encoding JISX0212.1990-0:GL; JISX0212.1990-0:GR +# } + +END XLC_XLOCALE + + + + +Reference + +[1] ISO/IEC 9899:1990 C Language Standard + + +[2] X Logical Font Descriptions + + + + + diff --git a/libX11/specs/i18n/trans/Makefile.am b/libX11/specs/i18n/trans/Makefile.am index e3c499744..40a135a2f 100644 --- a/libX11/specs/i18n/trans/Makefile.am +++ b/libX11/specs/i18n/trans/Makefile.am @@ -1,13 +1,13 @@ - -if ENABLE_SPECS - -# Main DocBook/XML files (DOCTYPE book) -docbook = trans.xml - -# The location where the DocBook/XML files and their generated formats are installed -shelfdir = $(docdir)/i18n/trans - -# Generate DocBook/XML output formats with or without stylesheets -include $(top_srcdir)/docbook.am - -endif ENABLE_SPECS + +if ENABLE_SPECS + +# Main DocBook/XML files (DOCTYPE book) +docbook = trans.xml + +# The location where the DocBook/XML files and their generated formats are installed +shelfdir = $(docdir)/i18n/trans + +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/docbook.am + +endif ENABLE_SPECS diff --git a/libX11/specs/i18n/trans/trans.xml b/libX11/specs/i18n/trans/trans.xml index a61be65bc..61e2e7976 100644 --- a/libX11/specs/i18n/trans/trans.xml +++ b/libX11/specs/i18n/trans/trans.xml @@ -1,1979 +1,1979 @@ - - - - - - - The XIM Transport Specification - Revision 0.1 - X Version 11, Release 7 - - - TakashiFujiwara - FUJITSU LIMITED - - - 1994FUJITSU LIMITED - 1994X Consortium - - Revision 0.1 - - - - -This specification describes the transport layer interfaces between Xlib and IM Server, -which makes various channels usable such as X protocol or TCP/IP, DECnet and etc. - - - - - - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files -(the “Software”), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following -conditions: - - - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - - - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - - -Except as contained in this notice, the name of The Open Group shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from X Consortium. - - -X Window System is a trademark of The Open Group. - - - - - -X Transport Specification - - -Introduction - - - - - -The Xlib XIM implementation is layered into three functions, a protocol -layer, an interface layer and a transport layer. The purpose of this -layering is to make the protocol independent of transport implementation. -Each function of these layers are: - - - - - The protocol layer - - -implements overall function of XIM and calls the interface layer -functions when it needs to communicate to IM Server. - - - - - The interface layer - - -separates the implementation of the transport layer from the protocol -layer, in other words, it provides implementation independent hook for -the transport layer functions. - - - - - - The transport layer - - -handles actual data communication with IM Server. It is done by a set -of several functions named transporters. - - - - - - -This specification describes the interface layer and the transport -layer, which makes various communication channels usable such as -X protocol or, TCP/IP, DECnet, STREAM, etc., and provides -the information needed for adding another new transport layer. -In addition, sample implementations for the transporter using the -X connection is described in section 4. - - - - -Initialization - - -Registering structure to initialize - - -The structure typed as TransportSW contains the list of the transport -layer the specific implementations supports. - - - -typedef struct { - char *transport_name; - Bool (*config); -} TransportSW; - - - - - - - - - transport_name - name of transportRefer to "The Input Method Protocol: Appendix B - - - config - initial configuration function - - - - - - -A sample entry for the Xlib supporting transporters is shown below: - - - -TransportSW _XimTransportRec[] = { -/* char *: - * transport_name, Bool (*config)() - */ - "X", _XimXConf, - "tcp", _XimTransConf, - "local", _XimTransConf, - "decnet", _XimTransConf, - "streams", _XimTransConf, - (char *)NULL, (Bool (*)())NULL, -}; - - - - -Initialization function - - - - -The following function will be called once when Xlib configures the -transporter functions. - - - - - Bool (*config) - XIM im - char *transport_data - - - - - - - im - - - -Specifies XIM structure address. - - - - - - transport_data - - - -Specifies the data specific to the transporter, in IM Server address.Refer to "The Input Method Protocol: Appendix B - - - - - - -This function must setup the transporter function pointers. - - - - -The actual config function will be chosen by IM Server at the -pre-connection time, matching by the transport_name specified -in the _XimTransportRec array; The specific members of XimProto -structure listed below must be initialized so that point they -appropriate transporter functions. - - - -If the specified transporter has been configured successfully, this -function returns True. There is no Alternative Entry for config -function itself. - - - -The structure XimProto contains the following function pointers: - - - -Bool (*connect)(); /* Open connection */ -Bool (*shutdown)(); /* Close connection */ -Bool (*write)(); /* Write data */ -Bool (*read)(); /* Read data */ -Bool (*flush)(); /* Flush data buffer */ -Bool (*register_dispatcher)(); /* Register asynchronous data handler */ -Bool (*call_dispatcher)(); /* Call dispatcher */ - - - -These functions are called when Xlib needs to communicate the -IM Server. These functions must process the appropriate procedure -described below. - - - - - -The interface/transport layer functions - -Following functions are used for the transport interface. - - - - The Transport Layer Functions - - - - - - - Alternate Entry (Interface Layer) - XimProto member (Transport Layer) - Section - - - - - _XimConnect - connect - 3.1 - - - _XimShutdown - shutdown - 3.2 - - - _XimWrite - write - 3.3 - - - _XimRead - read - 3.4 - - - _XimFlush - flush - 3.5 - - - _XimRegisterDispatcher - register_dispatcher - 3.6 - - - _XimCallDispatcher - call_dispatcher - 3.7 - - - -
- - -The Protocol layer calls the above functions using the Alternative -Entry in the left column. The transport implementation defines -XimProto member function in the right column. The Alternative Entry is -provided so as to make easier to implement the Protocol Layer. - - - -Opening connection - - -When XOpenIM is called, the following function is called to connect -with the IM Server. - - - - - Bool (*connect) - XIM im - - - - - - - im - - - -Specifies XIM structure address. - - - - - - -This function must establishes the connection to the IM Server. If the -connection is established successfully, this function returns True. -The Alternative Entry for this function is: - - - - - Bool _XimConnect - XIM im - - - - - - - im - - - -Specifies XIM structure address. - - - - - - - -Closing connection - - - - - -When XCloseIM is called, the following function is called to -disconnect the connection with the IM Server. The Alternative Entry -for this function is: - - - - - Bool (*shutdown) - XIM im - - - - - - - im - - - -Specifies XIM structure address. - - - - - - - -This function must close connection with the IM Server. If the -connection is closed successfully, this function returns True. The -Alternative Entry for this function is: - - - - - Bool _XimShutdown - XIM im - - - - - - - im - - - -Specifies XIM structure address. - - - - - - - - -Writing data - -The following function is called, when Xlib needs to write data to the -IM Server. - - - - - Bool _XimWrite - XIM im - INT16 len - XPointer data - - - - - - - im - - - -Specifies XIM structure address. - - - - - - len - - - -Specifies the length of writing data. - - - - - - data - - - -Specifies the writing data. - - - - - - -This function writes the data to the IM Server, regardless -of the contents. The number of bytes is passed to len. The -writing data is passed to data. If data is sent successfully, -the function returns True. Refer to "The Input Method Protocol" for -the contents of the writing data. The Alternative Entry for this -function is: - - - - - Bool _XimWrite - XIM im - INT16 len - XPointer data - - - - - - - im - - - -Specifies XIM structure address. - - - - - - len - - - -Specifies the length of writing data. - - - - - - data - - - -Specifies the writing data. - - - - - - - -Reading data - -The following function is called when Xlib waits for response from IM -server synchronously. - - - - - Bool _XimRead - XIM im - XPointer read_buf - int buf_len - int *ret_len - - - - - - - im - - - -Specifies XIM structure address. - - - - - - read_buf - - - -Specifies the buffer to store data. - - - - - - buf_len - - - -Specifies the size of the buffer - - - - - - ret_len - - - -Specifies the length of stored data. - - - - - - -This function stores the read data in read_buf, which size is -specified as buf_len. The size of data is set to ret_len. -This function return True, if the data is read normally or reading -data is completed. - - -The Alternative Entry for this function is: - - - - - Bool _XimRead - XIM im - INT16 *ret_len - XPointer buf - int buf_len - Bool (*predicate)() - XPointer predicate_arg - - - - - - - im - - - -Specifies XIM structure address. - - - - - - ret_len - - - -Specifies the size of the data buffer. - - - - - - buf - - - -Specifies the buffer to store data. - - - - - - buf_len - - - -Specifies the length of buffer. - - - - - - predicate - - - -Specifies the predicate for the XIM data. - - - - - - predicate_arg - - - -Specifies the predicate specific data. - - - - - - - -The predicate procedure indicates whether the data is for the -XIM or not. len -This function stores the read data in buf, which size -is specified as buf_len. The size of data is set to -ret_len. If preedicate() -returns True, this function returns True. If not, it calls the registered callback function. - - - -The procedure and its arguments are: - - - - - - void (*predicate) - XIM im - INT16 len - XPointer data - XPointer predicate_arg - - - - - - - im - - - -Specifies XIM structure address. - - - - - - len - - - -Specifies the size of the data buffer. - - - - - - data - - - -Specifies the buffer to store data. - - - - - - predicate_arg - - - -Specifies the predicate specific data. - - - - - - - -Flushing buffer - -The following function is called when Xlib needs to flush the data. - - - - - void (*flush) - XIM im - - - - - - - im - - - -Specifies XIM structure address. - - - - - - -This function must flush the data stored in internal buffer on the -transport layer. If data transfer is completed, the function returns -True. The Alternative Entry for this function is: - - - - - void _XimFlush - XIM im - - - - - - - im - - - -Specifies XIM structure address. - - - - - - - -Registering asynchronous data handler - -Xlib needs to handle asynchronous response from IM Server. This is -because some of the XIM data occur asynchronously to X events. - - - -Those data will be handled in the Filter, -and the Filter -will call asynchronous data handler in the protocol layer. Then it -calls dispatchers in the transport layer. The dispatchers are -implemented by the protocol layer. This function must store the -information and prepare for later call of the dispatchers using -_XimCallDispatcher. - - - -When multiple dispatchers are registered, they will be called -sequentially in order of registration, on arrival of asynchronous -data. The register_dispatcher is declared as following: - - - - - Bool (*register_dispatcher) - XIM im - Bool (*dispatcher)() - XPointer call_data - - - - - - - im - - - -Specifies XIM structure address. - - - - - - dispatcher - - - -Specifies the dispatcher function to register. - - - - - - call_data - - - -Specifies a parameter for the dispatcher. - - - - - - -The dispatcher is a function of the following type: - - - - - Bool (*dispatcher) - XIM im - INT16 len - XPointer data - XPointer call_data - - - - - - - im - - - -Specifies XIM structure address. - - - - - - len - - - -Specifies the size of the data buffer. - - - - - - data - - - -Specifies the buffer to store data. - - - - - - call_data - - - -Specifies a parameter passed to the register_dispatcher. - - - - - - -The dispatcher is provided by the protocol layer. They are called once -for every asynchronous data, in order of registration. If the data is -used, it must return True. otherwise, it must return False. - - - -If the dispatcher function returns True, the Transport Layer assume -that the data has been processed by the upper layer. The Alternative -Entry for this function is: - - - - - Bool _XimRegisterDispatcher - XIM im - Bool (*dispatcher)() - XPointer call_data - - - - - - - im - - - -Specifies XIM structure address. - - - - - - dispatcher - - - -Specifies the dispatcher function to register. - - - - - - call_data - - - -Specifies a parameter for the dispatcher. - - - - - - - -Calling dispatcher - -The following function is used to call the registered dispatcher -function, when the asynchronous response from IM Server has arrived. - - - - - Bool (*call_dispatcher) - XIM im - INT16 len - XPointer data - - - - - - - im - - - -Specifies XIM structure address. - - - - - - len - - - -Specifies the size of data buffer. - - - - - - data - - - -Specifies the buffer to store data. - - - - - - -The call_dispatcher must call the dispatcher function, in order of -their registration. len and data are the data passed to -register_dispatcher. - - - -The return values are checked at each invocation, and if it finds -True, it immediately return with true for its return value. - - - -It is depend on the upper layer whether the read data is XIM -Protocol packet unit or not. -The Alternative Entry for this function is: - - - - - Bool _XimCallDispatcher - XIM im - INT16 len - XPointer call_data - - - - -
- -Sample implementations for the Transport Layer - -Sample implementations for the transporter using the X connection is -described here. - - - -X Transport - -At the beginning of the X Transport connection for the XIM transport -mechanism, two different windows must be created either in an Xlib XIM -or in an IM Server, with which the Xlib and the IM Server exchange the -XIM transports by using the ClientMessage events and Window Properties. -In the following, the window created by the Xlib is referred as the -"client communication window", and on the other hand, the window created -by the IM Server is referred as the "IMS communication window". - - - -Connection - -In order to establish a connection, a communication window is created. -A ClientMessage in the following event's format is sent to the owner -window of XIM_SERVER selection, which the IM Server has created. - - - - -Refer to "The Input Method Protocol" for the XIM_SERVER atom. - - - - The ClientMessage sent to the IMS window. - - - - - - - - Structure Member - Contents - - - - - int - type - ClientMessage - - - u_long - serial - Set by the X Window System - - - Bool - send_event - Set by the X Window System - - - Display - *display - The display to which connects - - - Window - window - IMS Window ID - - - Atom - message_type - XInternAtom(display, "_XIM_CONNECT", false) - - - int - format - 32 - - - long - data.1[0] - client communication window ID - - - long - data.1[1] - client-major-transport-version(*1) - - - long - data.1[2] - client-major-transport-version(*1) - - - -
- - -In order to establish the connection (to notify the IM Server communication -window), the IM Server sends a ClientMessage in the following event's -format to the client communication window. - - - - The ClientMessage sent by IM Server. - - - - - - - - Structure Member - Contents - - - - - int - type - ClientMessage - - - u_long - serial - Set by the X Window System - - - Bool - send_event - Set by the X Window System - - - Display - *display - The display to which connects - - - Window - window - IMS Window ID - - - Atom - message_type - XInternAtom(display, "_XIM_CONNECT", false) - - - int - format - 32 - - - long - data.1[0] - client communication window ID - - - long - data.1[1] - client-major-transport-version(*1) - - - long - data.1[2] - client-major-transport-version(*1) - - - long - data.1[3] - dividing size between ClientMessage and Property(*2) - - - -
- - -(*1) major/minor-transport-version - - - -The read/write method is decided by the combination of -major/minor-transport-version, as follows: - - - -The read/write method and the major/minor-transport-version - - - - - - - - Transport-version - read/write - - - major - minor - - - - - - 0 - 0 - only-CM & Property-with-CM - - - 1 - only-CM & multi-CM - - - 2 - only-CM & multi-CM & Property-with-CM - - - 1 - 0 - PropertyNotify - - - 2 - 0 - only-CM & PropertyNotify - - - 1 - only-CM & multi-CM & PropertyNotify - - - -
- - -only-CM : data is sent via a ClientMessage -multi-CM : data is sent via multiple ClientMessages -Property-with-CM : data is written in Property, and its Atom - is send via ClientMessage -PropertyNotify : data is written in Property, and its Atom - is send via PropertyNotify - - - - - -The method to decide major/minor-transport-version is as follows: - - - - - -The client sends 0 as major/minor-transport-version to the IM Server. -The client must support all methods in Table 4-3. -The client may send another number as major/minor-transport-version to -use other method than the above in the future. - - - - -The IM Server sends its major/minor-transport-version number to -the client. The client sends data using the method specified by the -IM Server. - - - - -If major/minor-transport-version number is not available, it is regarded -as 0. - - - - - -(*2) dividing size between ClientMessage and Property - - - -If data is sent via both of multi-CM and Property, specify the dividing -size between ClientMessage and Property. The data, which is smaller than -this size, is sent via multi-CM (or only-CM), and the data, which is -lager than this size, is sent via Property. - - -
- - -read/write - -The data is transferred via either ClientMessage or Window Property in -the X Window System. - - - -Format for the data from the Client to the IM Server - -ClientMessage - - - -If data is sent via ClientMessage event, the format is as follows: - - - - The ClientMessage event's format (first or middle) - - - - - - - - Structure Member - Contents - - - - - int - type - ClientMessage - - - u_long - serial - Set by the X Window System - - - Bool - send_event - Set by the X Window System - - - Display - *display - The display to which connects - - - Window - window - IMS Window ID - - - Atom - message_type - XInternAtom(display, "_XIM_MOREDATA", False) - - - int - format - 8 - - - char - data.b[20] - (read/write DATA : 20 byte) - - - -
- - - - - The ClientMessage event's format (only or last) - - - - - - - - Structure Member - Contents - - - - - int - type - ClientMessage - - - u_long - serial - Set by the X Window System - - - Bool - send_event - Set by the X Window System - - - Display - *display - The display to which connects - - - Window - window - IMS Window ID - - - Atom - message_type - XInternAtom(display, "_XIM_PROTOCOL", False) - - - int - format - 8 - - - char - data.b[20] - (read/write DATA : MAX 20 byte) -If the data is smaller -than 20 bytes, all data other than available data must be 0. - - - - - -
- - -Property - - - -In the case of large data, data will be sent via the Window Property -for the efficiency. There are the following two methods to notify -Property, and transport-version is decided which method is used. - - - - - -The XChangeProperty function is used to store data in the client -communication window, and Atom of the stored data is notified to the -IM Server via ClientMessage event. - - - - -The XChangeProperty function is used to store data in the client -communication window, and Atom of the stored data is notified to the -IM Server via PropertyNotify event. - - - - - -The arguments of the XChangeProperty are as follows: - - - - - The XChangeProperty event's format - - - - - - - - Argument - Contents - - - - - Display - *display - The display to which connects - - - Window - window - IMS communication window ID - - - Atom - property - read/write property Atom (*1) - - - int - format - 8 - - - int - mode - PropModeAppend - - - u_char - *data - read/write DATA - - - int - nelements - length of DATA - - - -
- - -(*1) The read/write property ATOM allocates the following strings by -XInternAtom. -"_clientXXX" - - - -The client changes the property with the mode of PropModeAppend and -the IM Server will read it with the delete mode i.e. (delete = True). - - - -If Atom is notified via ClientMessage event, the format of the ClientMessage -is as follows: - - - - The ClientMessage event's format to send Atom of property - - - - - - - - Structure Member - Contents - - - - - int - type - ClientMessage - - - u_long - serial - Set by the X Window System - - - Bool - send_event - Set by the X Window System - - - Display - *display - The display to which connects - - - Window - window - IMS Window ID - - - Atom - message_type - XInternAtom(display, "_XIM_PROTOCOL", False) - - - int - format - 8 - - - long - data.1[0] - length of read/write property Atom - - - long - data.1[1] - read/write property Atom - - - -
-
- - -Format for the data from the IM Server to the Client - -ClientMessage - - - -The format of the ClientMessage is as follows: - - - - The ClientMessage event's format (first or middle) - - - - - - - - Structure Member - Contents - - - - - int - type - ClientMessage - - - u_long - serial - Set by the X Window System - - - Bool - send_event - Set by the X Window System - - - Display - *display - The display to which connects - - - Window - window - IMS Window ID - - - Atom - message_type - XInternAtom(display, "_XIM_MOREDATA", False) - - - int - format - 8 - - - char - data.b[20] - (read/write DATA : 20 byte) - - - -
- - - - - - - The ClientMessage event's format (only or last) - - - - - - - - Structure Member - Contents - - - - - int - type - ClientMessage - - - u_long - serial - Set by the X Window System - - - Bool - send_event - Set by the X Window System - - - Display - *display - The display to which connects - - - Window - window - IMS Window ID - - - Atom - message_type - XInternAtom(display, "_XIM_PROTOCOL", False) - - - int - format - 8 - - - char - data.b[20] - (read/write DATA : MAX 20 byte) (*1) - - - -
- - -(*1) If the data size is smaller than 20 bytes, all data other than available -data must be 0. - - - -Property - - - -In the case of large data, data will be sent via the Window Property -for the efficiency. There are the following two methods to notify -Property, and transport-version is decided which method is used. - - - - - -The XChangeProperty function is used to store data in the IMS -communication window, and Atom of the property is sent via the -ClientMessage event. - - - - -The XChangeProperty function is used to store data in the IMS -communication window, and Atom of the property is sent via -PropertyNotify event. - - - - - -The arguments of the XChangeProperty are as follows: - - - - The XChangeProperty event's format - - - - - - - - Argument - Contents - - - - - Display - *display - The display to which connects - - - Window - window - IMS communication window ID - - - Atom - property - read/write property Atom (*1) - - - int - format - 8 - - - int - mode - PropModeAppend - - - u_char - *data - read/write DATA - - - int - nelements - length of DATA - - - -
- - -(*1) The read/write property ATOM allocates some strings, which are not -allocated by the client, by XInternAtom. - - - -The IM Server changes the property with the mode of PropModeAppend and -the client reads it with the delete mode, i.e. (delete = True). - - - -If Atom is notified via ClientMessage event, the format of the ClientMessage -is as follows: - - - - The ClientMessage event's format to send Atom of property - - - - - - - - Structure Member - Contents - - - - - int - type - ClientMessage - - - u_long - serial - Set by the X Window System - - - Bool - send_event - Set by the X Window System - - - Display - *display - The display to which connects - - - Window - window - IMS Window ID - - - Atom - message_type - XInternAtom(display, "_XIM_PROTOCOL", False) - - - int - format - 8 - - - long - data.1[0] - length of read/write property Atom - - - long - data.1[1] - read/write property Atom - - - -
- -
-
- -Closing Connection - - -If the client disconnect with the IM Server, shutdown function should -free the communication window properties and etc.. - - - -
-
- - -References - -[1] Masahiko Narita and Hideki Hiura, "The Input Method Protocol" - - - -
-
+ + + + + + + The XIM Transport Specification + Revision 0.1 + X Version 11, Release 7 + + + TakashiFujiwara + FUJITSU LIMITED + + + 1994FUJITSU LIMITED + 1994X Consortium + + Revision 0.1 + + + + +This specification describes the transport layer interfaces between Xlib and IM Server, +which makes various channels usable such as X protocol or TCP/IP, DECnet and etc. + + + + + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files +(the “Software”), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following +conditions: + + + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + + +Except as contained in this notice, the name of The Open Group shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from X Consortium. + + +X Window System is a trademark of The Open Group. + + + + + +X Transport Specification + + +Introduction + + + + + +The Xlib XIM implementation is layered into three functions, a protocol +layer, an interface layer and a transport layer. The purpose of this +layering is to make the protocol independent of transport implementation. +Each function of these layers are: + + + + + The protocol layer + + +implements overall function of XIM and calls the interface layer +functions when it needs to communicate to IM Server. + + + + + The interface layer + + +separates the implementation of the transport layer from the protocol +layer, in other words, it provides implementation independent hook for +the transport layer functions. + + + + + + The transport layer + + +handles actual data communication with IM Server. It is done by a set +of several functions named transporters. + + + + + + +This specification describes the interface layer and the transport +layer, which makes various communication channels usable such as +X protocol or, TCP/IP, DECnet, STREAM, etc., and provides +the information needed for adding another new transport layer. +In addition, sample implementations for the transporter using the +X connection is described in section 4. + + + + +Initialization + + +Registering structure to initialize + + +The structure typed as TransportSW contains the list of the transport +layer the specific implementations supports. + + + +typedef struct { + char *transport_name; + Bool (*config); +} TransportSW; + + + + + + + + + transport_name + name of transportRefer to "The Input Method Protocol: Appendix B + + + config + initial configuration function + + + + + + +A sample entry for the Xlib supporting transporters is shown below: + + + +TransportSW _XimTransportRec[] = { +/* char *: + * transport_name, Bool (*config)() + */ + "X", _XimXConf, + "tcp", _XimTransConf, + "local", _XimTransConf, + "decnet", _XimTransConf, + "streams", _XimTransConf, + (char *)NULL, (Bool (*)())NULL, +}; + + + + +Initialization function + + + + +The following function will be called once when Xlib configures the +transporter functions. + + + + + Bool (*config) + XIM im + char *transport_data + + + + + + + im + + + +Specifies XIM structure address. + + + + + + transport_data + + + +Specifies the data specific to the transporter, in IM Server address.Refer to "The Input Method Protocol: Appendix B + + + + + + +This function must setup the transporter function pointers. + + + + +The actual config function will be chosen by IM Server at the +pre-connection time, matching by the transport_name specified +in the _XimTransportRec array; The specific members of XimProto +structure listed below must be initialized so that point they +appropriate transporter functions. + + + +If the specified transporter has been configured successfully, this +function returns True. There is no Alternative Entry for config +function itself. + + + +The structure XimProto contains the following function pointers: + + + +Bool (*connect)(); /* Open connection */ +Bool (*shutdown)(); /* Close connection */ +Bool (*write)(); /* Write data */ +Bool (*read)(); /* Read data */ +Bool (*flush)(); /* Flush data buffer */ +Bool (*register_dispatcher)(); /* Register asynchronous data handler */ +Bool (*call_dispatcher)(); /* Call dispatcher */ + + + +These functions are called when Xlib needs to communicate the +IM Server. These functions must process the appropriate procedure +described below. + + + + + +The interface/transport layer functions + +Following functions are used for the transport interface. + + + + The Transport Layer Functions + + + + + + + Alternate Entry (Interface Layer) + XimProto member (Transport Layer) + Section + + + + + _XimConnect + connect + 3.1 + + + _XimShutdown + shutdown + 3.2 + + + _XimWrite + write + 3.3 + + + _XimRead + read + 3.4 + + + _XimFlush + flush + 3.5 + + + _XimRegisterDispatcher + register_dispatcher + 3.6 + + + _XimCallDispatcher + call_dispatcher + 3.7 + + + +
+ + +The Protocol layer calls the above functions using the Alternative +Entry in the left column. The transport implementation defines +XimProto member function in the right column. The Alternative Entry is +provided so as to make easier to implement the Protocol Layer. + + + +Opening connection + + +When XOpenIM is called, the following function is called to connect +with the IM Server. + + + + + Bool (*connect) + XIM im + + + + + + + im + + + +Specifies XIM structure address. + + + + + + +This function must establishes the connection to the IM Server. If the +connection is established successfully, this function returns True. +The Alternative Entry for this function is: + + + + + Bool _XimConnect + XIM im + + + + + + + im + + + +Specifies XIM structure address. + + + + + + + +Closing connection + + + + + +When XCloseIM is called, the following function is called to +disconnect the connection with the IM Server. The Alternative Entry +for this function is: + + + + + Bool (*shutdown) + XIM im + + + + + + + im + + + +Specifies XIM structure address. + + + + + + + +This function must close connection with the IM Server. If the +connection is closed successfully, this function returns True. The +Alternative Entry for this function is: + + + + + Bool _XimShutdown + XIM im + + + + + + + im + + + +Specifies XIM structure address. + + + + + + + + +Writing data + +The following function is called, when Xlib needs to write data to the +IM Server. + + + + + Bool _XimWrite + XIM im + INT16 len + XPointer data + + + + + + + im + + + +Specifies XIM structure address. + + + + + + len + + + +Specifies the length of writing data. + + + + + + data + + + +Specifies the writing data. + + + + + + +This function writes the data to the IM Server, regardless +of the contents. The number of bytes is passed to len. The +writing data is passed to data. If data is sent successfully, +the function returns True. Refer to "The Input Method Protocol" for +the contents of the writing data. The Alternative Entry for this +function is: + + + + + Bool _XimWrite + XIM im + INT16 len + XPointer data + + + + + + + im + + + +Specifies XIM structure address. + + + + + + len + + + +Specifies the length of writing data. + + + + + + data + + + +Specifies the writing data. + + + + + + + +Reading data + +The following function is called when Xlib waits for response from IM +server synchronously. + + + + + Bool _XimRead + XIM im + XPointer read_buf + int buf_len + int *ret_len + + + + + + + im + + + +Specifies XIM structure address. + + + + + + read_buf + + + +Specifies the buffer to store data. + + + + + + buf_len + + + +Specifies the size of the buffer + + + + + + ret_len + + + +Specifies the length of stored data. + + + + + + +This function stores the read data in read_buf, which size is +specified as buf_len. The size of data is set to ret_len. +This function return True, if the data is read normally or reading +data is completed. + + +The Alternative Entry for this function is: + + + + + Bool _XimRead + XIM im + INT16 *ret_len + XPointer buf + int buf_len + Bool (*predicate)() + XPointer predicate_arg + + + + + + + im + + + +Specifies XIM structure address. + + + + + + ret_len + + + +Specifies the size of the data buffer. + + + + + + buf + + + +Specifies the buffer to store data. + + + + + + buf_len + + + +Specifies the length of buffer. + + + + + + predicate + + + +Specifies the predicate for the XIM data. + + + + + + predicate_arg + + + +Specifies the predicate specific data. + + + + + + + +The predicate procedure indicates whether the data is for the +XIM or not. len +This function stores the read data in buf, which size +is specified as buf_len. The size of data is set to +ret_len. If preedicate() +returns True, this function returns True. If not, it calls the registered callback function. + + + +The procedure and its arguments are: + + + + + + void (*predicate) + XIM im + INT16 len + XPointer data + XPointer predicate_arg + + + + + + + im + + + +Specifies XIM structure address. + + + + + + len + + + +Specifies the size of the data buffer. + + + + + + data + + + +Specifies the buffer to store data. + + + + + + predicate_arg + + + +Specifies the predicate specific data. + + + + + + + +Flushing buffer + +The following function is called when Xlib needs to flush the data. + + + + + void (*flush) + XIM im + + + + + + + im + + + +Specifies XIM structure address. + + + + + + +This function must flush the data stored in internal buffer on the +transport layer. If data transfer is completed, the function returns +True. The Alternative Entry for this function is: + + + + + void _XimFlush + XIM im + + + + + + + im + + + +Specifies XIM structure address. + + + + + + + +Registering asynchronous data handler + +Xlib needs to handle asynchronous response from IM Server. This is +because some of the XIM data occur asynchronously to X events. + + + +Those data will be handled in the Filter, +and the Filter +will call asynchronous data handler in the protocol layer. Then it +calls dispatchers in the transport layer. The dispatchers are +implemented by the protocol layer. This function must store the +information and prepare for later call of the dispatchers using +_XimCallDispatcher. + + + +When multiple dispatchers are registered, they will be called +sequentially in order of registration, on arrival of asynchronous +data. The register_dispatcher is declared as following: + + + + + Bool (*register_dispatcher) + XIM im + Bool (*dispatcher)() + XPointer call_data + + + + + + + im + + + +Specifies XIM structure address. + + + + + + dispatcher + + + +Specifies the dispatcher function to register. + + + + + + call_data + + + +Specifies a parameter for the dispatcher. + + + + + + +The dispatcher is a function of the following type: + + + + + Bool (*dispatcher) + XIM im + INT16 len + XPointer data + XPointer call_data + + + + + + + im + + + +Specifies XIM structure address. + + + + + + len + + + +Specifies the size of the data buffer. + + + + + + data + + + +Specifies the buffer to store data. + + + + + + call_data + + + +Specifies a parameter passed to the register_dispatcher. + + + + + + +The dispatcher is provided by the protocol layer. They are called once +for every asynchronous data, in order of registration. If the data is +used, it must return True. otherwise, it must return False. + + + +If the dispatcher function returns True, the Transport Layer assume +that the data has been processed by the upper layer. The Alternative +Entry for this function is: + + + + + Bool _XimRegisterDispatcher + XIM im + Bool (*dispatcher)() + XPointer call_data + + + + + + + im + + + +Specifies XIM structure address. + + + + + + dispatcher + + + +Specifies the dispatcher function to register. + + + + + + call_data + + + +Specifies a parameter for the dispatcher. + + + + + + + +Calling dispatcher + +The following function is used to call the registered dispatcher +function, when the asynchronous response from IM Server has arrived. + + + + + Bool (*call_dispatcher) + XIM im + INT16 len + XPointer data + + + + + + + im + + + +Specifies XIM structure address. + + + + + + len + + + +Specifies the size of data buffer. + + + + + + data + + + +Specifies the buffer to store data. + + + + + + +The call_dispatcher must call the dispatcher function, in order of +their registration. len and data are the data passed to +register_dispatcher. + + + +The return values are checked at each invocation, and if it finds +True, it immediately return with true for its return value. + + + +It is depend on the upper layer whether the read data is XIM +Protocol packet unit or not. +The Alternative Entry for this function is: + + + + + Bool _XimCallDispatcher + XIM im + INT16 len + XPointer call_data + + + + +
+ +Sample implementations for the Transport Layer + +Sample implementations for the transporter using the X connection is +described here. + + + +X Transport + +At the beginning of the X Transport connection for the XIM transport +mechanism, two different windows must be created either in an Xlib XIM +or in an IM Server, with which the Xlib and the IM Server exchange the +XIM transports by using the ClientMessage events and Window Properties. +In the following, the window created by the Xlib is referred as the +"client communication window", and on the other hand, the window created +by the IM Server is referred as the "IMS communication window". + + + +Connection + +In order to establish a connection, a communication window is created. +A ClientMessage in the following event's format is sent to the owner +window of XIM_SERVER selection, which the IM Server has created. + + + + +Refer to "The Input Method Protocol" for the XIM_SERVER atom. + + + + The ClientMessage sent to the IMS window. + + + + + + + + Structure Member + Contents + + + + + int + type + ClientMessage + + + u_long + serial + Set by the X Window System + + + Bool + send_event + Set by the X Window System + + + Display + *display + The display to which connects + + + Window + window + IMS Window ID + + + Atom + message_type + XInternAtom(display, "_XIM_CONNECT", false) + + + int + format + 32 + + + long + data.1[0] + client communication window ID + + + long + data.1[1] + client-major-transport-version(*1) + + + long + data.1[2] + client-major-transport-version(*1) + + + +
+ + +In order to establish the connection (to notify the IM Server communication +window), the IM Server sends a ClientMessage in the following event's +format to the client communication window. + + + + The ClientMessage sent by IM Server. + + + + + + + + Structure Member + Contents + + + + + int + type + ClientMessage + + + u_long + serial + Set by the X Window System + + + Bool + send_event + Set by the X Window System + + + Display + *display + The display to which connects + + + Window + window + IMS Window ID + + + Atom + message_type + XInternAtom(display, "_XIM_CONNECT", false) + + + int + format + 32 + + + long + data.1[0] + client communication window ID + + + long + data.1[1] + client-major-transport-version(*1) + + + long + data.1[2] + client-major-transport-version(*1) + + + long + data.1[3] + dividing size between ClientMessage and Property(*2) + + + +
+ + +(*1) major/minor-transport-version + + + +The read/write method is decided by the combination of +major/minor-transport-version, as follows: + + + +The read/write method and the major/minor-transport-version + + + + + + + + Transport-version + read/write + + + major + minor + + + + + + 0 + 0 + only-CM & Property-with-CM + + + 1 + only-CM & multi-CM + + + 2 + only-CM & multi-CM & Property-with-CM + + + 1 + 0 + PropertyNotify + + + 2 + 0 + only-CM & PropertyNotify + + + 1 + only-CM & multi-CM & PropertyNotify + + + +
+ + +only-CM : data is sent via a ClientMessage +multi-CM : data is sent via multiple ClientMessages +Property-with-CM : data is written in Property, and its Atom + is send via ClientMessage +PropertyNotify : data is written in Property, and its Atom + is send via PropertyNotify + + + + + +The method to decide major/minor-transport-version is as follows: + + + + + +The client sends 0 as major/minor-transport-version to the IM Server. +The client must support all methods in Table 4-3. +The client may send another number as major/minor-transport-version to +use other method than the above in the future. + + + + +The IM Server sends its major/minor-transport-version number to +the client. The client sends data using the method specified by the +IM Server. + + + + +If major/minor-transport-version number is not available, it is regarded +as 0. + + + + + +(*2) dividing size between ClientMessage and Property + + + +If data is sent via both of multi-CM and Property, specify the dividing +size between ClientMessage and Property. The data, which is smaller than +this size, is sent via multi-CM (or only-CM), and the data, which is +lager than this size, is sent via Property. + + +
+ + +read/write + +The data is transferred via either ClientMessage or Window Property in +the X Window System. + + + +Format for the data from the Client to the IM Server + +ClientMessage + + + +If data is sent via ClientMessage event, the format is as follows: + + + + The ClientMessage event's format (first or middle) + + + + + + + + Structure Member + Contents + + + + + int + type + ClientMessage + + + u_long + serial + Set by the X Window System + + + Bool + send_event + Set by the X Window System + + + Display + *display + The display to which connects + + + Window + window + IMS Window ID + + + Atom + message_type + XInternAtom(display, "_XIM_MOREDATA", False) + + + int + format + 8 + + + char + data.b[20] + (read/write DATA : 20 byte) + + + +
+ + + + + The ClientMessage event's format (only or last) + + + + + + + + Structure Member + Contents + + + + + int + type + ClientMessage + + + u_long + serial + Set by the X Window System + + + Bool + send_event + Set by the X Window System + + + Display + *display + The display to which connects + + + Window + window + IMS Window ID + + + Atom + message_type + XInternAtom(display, "_XIM_PROTOCOL", False) + + + int + format + 8 + + + char + data.b[20] + (read/write DATA : MAX 20 byte) +If the data is smaller +than 20 bytes, all data other than available data must be 0. + + + + + +
+ + +Property + + + +In the case of large data, data will be sent via the Window Property +for the efficiency. There are the following two methods to notify +Property, and transport-version is decided which method is used. + + + + + +The XChangeProperty function is used to store data in the client +communication window, and Atom of the stored data is notified to the +IM Server via ClientMessage event. + + + + +The XChangeProperty function is used to store data in the client +communication window, and Atom of the stored data is notified to the +IM Server via PropertyNotify event. + + + + + +The arguments of the XChangeProperty are as follows: + + + + + The XChangeProperty event's format + + + + + + + + Argument + Contents + + + + + Display + *display + The display to which connects + + + Window + window + IMS communication window ID + + + Atom + property + read/write property Atom (*1) + + + int + format + 8 + + + int + mode + PropModeAppend + + + u_char + *data + read/write DATA + + + int + nelements + length of DATA + + + +
+ + +(*1) The read/write property ATOM allocates the following strings by +XInternAtom. +"_clientXXX" + + + +The client changes the property with the mode of PropModeAppend and +the IM Server will read it with the delete mode i.e. (delete = True). + + + +If Atom is notified via ClientMessage event, the format of the ClientMessage +is as follows: + + + + The ClientMessage event's format to send Atom of property + + + + + + + + Structure Member + Contents + + + + + int + type + ClientMessage + + + u_long + serial + Set by the X Window System + + + Bool + send_event + Set by the X Window System + + + Display + *display + The display to which connects + + + Window + window + IMS Window ID + + + Atom + message_type + XInternAtom(display, "_XIM_PROTOCOL", False) + + + int + format + 8 + + + long + data.1[0] + length of read/write property Atom + + + long + data.1[1] + read/write property Atom + + + +
+
+ + +Format for the data from the IM Server to the Client + +ClientMessage + + + +The format of the ClientMessage is as follows: + + + + The ClientMessage event's format (first or middle) + + + + + + + + Structure Member + Contents + + + + + int + type + ClientMessage + + + u_long + serial + Set by the X Window System + + + Bool + send_event + Set by the X Window System + + + Display + *display + The display to which connects + + + Window + window + IMS Window ID + + + Atom + message_type + XInternAtom(display, "_XIM_MOREDATA", False) + + + int + format + 8 + + + char + data.b[20] + (read/write DATA : 20 byte) + + + +
+ + + + + + + The ClientMessage event's format (only or last) + + + + + + + + Structure Member + Contents + + + + + int + type + ClientMessage + + + u_long + serial + Set by the X Window System + + + Bool + send_event + Set by the X Window System + + + Display + *display + The display to which connects + + + Window + window + IMS Window ID + + + Atom + message_type + XInternAtom(display, "_XIM_PROTOCOL", False) + + + int + format + 8 + + + char + data.b[20] + (read/write DATA : MAX 20 byte) (*1) + + + +
+ + +(*1) If the data size is smaller than 20 bytes, all data other than available +data must be 0. + + + +Property + + + +In the case of large data, data will be sent via the Window Property +for the efficiency. There are the following two methods to notify +Property, and transport-version is decided which method is used. + + + + + +The XChangeProperty function is used to store data in the IMS +communication window, and Atom of the property is sent via the +ClientMessage event. + + + + +The XChangeProperty function is used to store data in the IMS +communication window, and Atom of the property is sent via +PropertyNotify event. + + + + + +The arguments of the XChangeProperty are as follows: + + + + The XChangeProperty event's format + + + + + + + + Argument + Contents + + + + + Display + *display + The display to which connects + + + Window + window + IMS communication window ID + + + Atom + property + read/write property Atom (*1) + + + int + format + 8 + + + int + mode + PropModeAppend + + + u_char + *data + read/write DATA + + + int + nelements + length of DATA + + + +
+ + +(*1) The read/write property ATOM allocates some strings, which are not +allocated by the client, by XInternAtom. + + + +The IM Server changes the property with the mode of PropModeAppend and +the client reads it with the delete mode, i.e. (delete = True). + + + +If Atom is notified via ClientMessage event, the format of the ClientMessage +is as follows: + + + + The ClientMessage event's format to send Atom of property + + + + + + + + Structure Member + Contents + + + + + int + type + ClientMessage + + + u_long + serial + Set by the X Window System + + + Bool + send_event + Set by the X Window System + + + Display + *display + The display to which connects + + + Window + window + IMS Window ID + + + Atom + message_type + XInternAtom(display, "_XIM_PROTOCOL", False) + + + int + format + 8 + + + long + data.1[0] + length of read/write property Atom + + + long + data.1[1] + read/write property Atom + + + +
+ +
+
+ +Closing Connection + + +If the client disconnect with the IM Server, shutdown function should +free the communication window properties and etc.. + + + +
+
+ + +References + +[1] Masahiko Narita and Hideki Hiura, "The Input Method Protocol" + + + +
+
-- cgit v1.2.3