trans.xml revision 57f47464
1e9fcaa8aSmrg<?xml version="1.0" encoding="UTF-8" ?> 2e9fcaa8aSmrg<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" 3e9fcaa8aSmrg "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"> 4e9fcaa8aSmrg 557f47464Smrg<book id="trans"> 6e9fcaa8aSmrg 7e9fcaa8aSmrg<bookinfo> 8e9fcaa8aSmrg <title>The XIM Transport Specification</title> 9e9fcaa8aSmrg <subtitle>Revision 0.1</subtitle> 10e9fcaa8aSmrg <releaseinfo>X Version 11, Release 7</releaseinfo> 11e9fcaa8aSmrg <authorgroup> 12e9fcaa8aSmrg <author> 13e9fcaa8aSmrg <firstname>Takashi</firstname><surname>Fujiwara</surname> 14e9fcaa8aSmrg <affiliation><orgname>FUJITSU LIMITED</orgname></affiliation> 15e9fcaa8aSmrg </author> 16e9fcaa8aSmrg </authorgroup> 17e9fcaa8aSmrg <copyright><year>1994</year><holder>FUJITSU LIMITED</holder></copyright> 18e9fcaa8aSmrg <copyright><year>1994</year><holder>X Consortium</holder></copyright> 19e9fcaa8aSmrg 20e9fcaa8aSmrg <productnumber>Revision 0.1</productnumber> 21e9fcaa8aSmrg 22e9fcaa8aSmrg 23e9fcaa8aSmrg<abstract> 24e9fcaa8aSmrg<para> 25e9fcaa8aSmrgThis specification describes the transport layer interfaces between Xlib and IM Server, 26e9fcaa8aSmrgwhich makes various channels usable such as X protocol or TCP/IP, DECnet and etc. 27e9fcaa8aSmrg</para> 28e9fcaa8aSmrg</abstract> 29e9fcaa8aSmrg 30e9fcaa8aSmrg<legalnotice> 31e9fcaa8aSmrg 32e9fcaa8aSmrg<para> 33e9fcaa8aSmrgPermission is hereby granted, free of charge, to any person obtaining a copy 34e9fcaa8aSmrgof this software and associated documentation files 35e9fcaa8aSmrg(the “Software”), to deal in the Software without restriction, 36e9fcaa8aSmrgincluding without limitation the rights to use, copy, modify, merge, publish, 37e9fcaa8aSmrgdistribute, sublicense, and/or sell copies of the Software, and to permit 38e9fcaa8aSmrgpersons to whom the Software is furnished to do so, subject to the following 39e9fcaa8aSmrgconditions: 40e9fcaa8aSmrg</para> 41e9fcaa8aSmrg 42e9fcaa8aSmrg<para> 43e9fcaa8aSmrgThe above copyright notice and this permission notice shall be included in all 44e9fcaa8aSmrgcopies or substantial portions of the Software. 45e9fcaa8aSmrg</para> 46e9fcaa8aSmrg 47e9fcaa8aSmrg<para> 48e9fcaa8aSmrgTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, 49e9fcaa8aSmrgEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 50e9fcaa8aSmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 51e9fcaa8aSmrgNO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52e9fcaa8aSmrgLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53e9fcaa8aSmrgOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 54e9fcaa8aSmrgTHE SOFTWARE. 55e9fcaa8aSmrg</para> 56e9fcaa8aSmrg 57e9fcaa8aSmrg<para> 58e9fcaa8aSmrgExcept as contained in this notice, the name of The Open Group shall not 59e9fcaa8aSmrgbe used in advertising or otherwise to promote the sale, use or other dealings 60e9fcaa8aSmrgin this Software without prior written authorization from X Consortium. 61e9fcaa8aSmrg</para> 62e9fcaa8aSmrg 63e9fcaa8aSmrg<para>X Window System is a trademark of The Open Group.</para> 64e9fcaa8aSmrg 65e9fcaa8aSmrg</legalnotice> 66e9fcaa8aSmrg</bookinfo> 67e9fcaa8aSmrg 68e9fcaa8aSmrg<chapter id="xim_transport_specification"> 69e9fcaa8aSmrg<title>X Transport Specification</title> 70e9fcaa8aSmrg 71e9fcaa8aSmrg<sect1 id="Introduction"> 72e9fcaa8aSmrg<title>Introduction</title> 73e9fcaa8aSmrg<!-- .XS --> 74e9fcaa8aSmrg<!-- (SN Introduction --> 75e9fcaa8aSmrg<!-- .XE --> 76e9fcaa8aSmrg<para> 77e9fcaa8aSmrg<!-- .LP --> 78e9fcaa8aSmrgThe Xlib XIM implementation is layered into three functions, a protocol 79e9fcaa8aSmrglayer, an interface layer and a transport layer. The purpose of this 80e9fcaa8aSmrglayering is to make the protocol independent of transport implementation. 81e9fcaa8aSmrgEach function of these layers are: 82e9fcaa8aSmrg<!-- .RS 3 --> 83e9fcaa8aSmrg</para> 84e9fcaa8aSmrg<variablelist> 85e9fcaa8aSmrg <varlistentry> 86e9fcaa8aSmrg <term><emphasis>The protocol layer</emphasis></term> 87e9fcaa8aSmrg <listitem> 88e9fcaa8aSmrg <para> 89e9fcaa8aSmrgimplements overall function of XIM and calls the interface layer 90e9fcaa8aSmrgfunctions when it needs to communicate to IM Server. 91e9fcaa8aSmrg </para> 92e9fcaa8aSmrg </listitem> 93e9fcaa8aSmrg </varlistentry> 94e9fcaa8aSmrg <varlistentry> 95e9fcaa8aSmrg <term><emphasis>The interface layer</emphasis></term> 96e9fcaa8aSmrg <listitem> 97e9fcaa8aSmrg <para> 98e9fcaa8aSmrgseparates the implementation of the transport layer from the protocol 99e9fcaa8aSmrglayer, in other words, it provides implementation independent hook for 100e9fcaa8aSmrgthe transport layer functions. 101e9fcaa8aSmrg </para> 102e9fcaa8aSmrg </listitem> 103e9fcaa8aSmrg </varlistentry> 104e9fcaa8aSmrg 105e9fcaa8aSmrg <varlistentry> 106e9fcaa8aSmrg <term><emphasis>The transport layer</emphasis></term> 107e9fcaa8aSmrg <listitem> 108e9fcaa8aSmrg <para> 109e9fcaa8aSmrghandles actual data communication with IM Server. It is done by a set 110e9fcaa8aSmrgof several functions named transporters. 111e9fcaa8aSmrg </para> 112e9fcaa8aSmrg </listitem> 113e9fcaa8aSmrg </varlistentry> 114e9fcaa8aSmrg</variablelist> 115e9fcaa8aSmrg 116e9fcaa8aSmrg<para> 117e9fcaa8aSmrgThis specification describes the interface layer and the transport 118e9fcaa8aSmrglayer, which makes various communication channels usable such as 119e9fcaa8aSmrgX protocol or, TCP/IP, DECnet, STREAM, etc., and provides 120e9fcaa8aSmrgthe information needed for adding another new transport layer. 121e9fcaa8aSmrgIn addition, sample implementations for the transporter using the 122e9fcaa8aSmrgX connection is described in section 4. <!-- xref --> 123e9fcaa8aSmrg</para> 124e9fcaa8aSmrg</sect1> 125e9fcaa8aSmrg 126e9fcaa8aSmrg<sect1 id="Initialization"> 127e9fcaa8aSmrg<title>Initialization</title> 128e9fcaa8aSmrg 129e9fcaa8aSmrg<sect2 id="Registering_structure_to_initialize"> 130e9fcaa8aSmrg<title>Registering structure to initialize</title> 131e9fcaa8aSmrg 132e9fcaa8aSmrg<para> 133e9fcaa8aSmrgThe structure typed as TransportSW contains the list of the transport 134e9fcaa8aSmrglayer the specific implementations supports. 135e9fcaa8aSmrg</para> 136e9fcaa8aSmrg 137e9fcaa8aSmrg<literallayout class="monospaced"> 138e9fcaa8aSmrgtypedef struct { 139e9fcaa8aSmrg char *transport_name; 140e9fcaa8aSmrg Bool (*config); 141e9fcaa8aSmrg} TransportSW; 142e9fcaa8aSmrg</literallayout> 143e9fcaa8aSmrg 144e9fcaa8aSmrg<informaltable frame="none"> 145e9fcaa8aSmrg <tgroup cols="2"> 146e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 147e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="0"/> 148e9fcaa8aSmrg <tbody> 149e9fcaa8aSmrg <row rowsep="0"> 150e9fcaa8aSmrg <entry><emphasis>transport_name</emphasis></entry> 151e9fcaa8aSmrg <entry>name of transport<footnote><para>Refer to "The Input Method Protocol: Appendix B</para></footnote></entry> 152e9fcaa8aSmrg </row> 153e9fcaa8aSmrg <row rowsep="0"> 154e9fcaa8aSmrg <entry><emphasis>config</emphasis></entry> 155e9fcaa8aSmrg <entry>initial configuration function</entry> 156e9fcaa8aSmrg </row> 157e9fcaa8aSmrg </tbody> 158e9fcaa8aSmrg </tgroup> 159e9fcaa8aSmrg</informaltable> 160e9fcaa8aSmrg 161e9fcaa8aSmrg<para> 162e9fcaa8aSmrgA sample entry for the Xlib supporting transporters is shown below: 163e9fcaa8aSmrg</para> 164e9fcaa8aSmrg 165e9fcaa8aSmrg<literallayout class="monospaced"> 166e9fcaa8aSmrgTransportSW _XimTransportRec[] = { 167e9fcaa8aSmrg/* char <emphasis remap='I'>*</emphasis>: 168e9fcaa8aSmrg * transport_name, Bool <emphasis remap='I'>(*config)()</emphasis> 169e9fcaa8aSmrg */ 170e9fcaa8aSmrg "X", _XimXConf, 171e9fcaa8aSmrg "tcp", _XimTransConf, 172e9fcaa8aSmrg "local", _XimTransConf, 173e9fcaa8aSmrg "decnet", _XimTransConf, 174e9fcaa8aSmrg "streams", _XimTransConf, 175e9fcaa8aSmrg (char *)NULL, (Bool (*)())NULL, 176e9fcaa8aSmrg}; 177e9fcaa8aSmrg</literallayout> 178e9fcaa8aSmrg 179e9fcaa8aSmrg</sect2> 180e9fcaa8aSmrg<sect2 id="Initialization_function"> 181e9fcaa8aSmrg<title>Initialization function</title> 182e9fcaa8aSmrg<!-- .XS --> 183e9fcaa8aSmrg<!-- (SN Initialization function --> 184e9fcaa8aSmrg<!-- .XE --> 185e9fcaa8aSmrg<para> 186e9fcaa8aSmrgThe following function will be called once when Xlib configures the 187e9fcaa8aSmrgtransporter functions. 188e9fcaa8aSmrg</para> 189e9fcaa8aSmrg 190e9fcaa8aSmrg<funcsynopsis> 191e9fcaa8aSmrg<funcprototype> 192e9fcaa8aSmrg <funcdef>Bool <function>(*config)</function></funcdef> 193e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 194e9fcaa8aSmrg <paramdef>char<parameter> *transport_data</parameter></paramdef> 195e9fcaa8aSmrg</funcprototype> 196e9fcaa8aSmrg</funcsynopsis> 197e9fcaa8aSmrg 198e9fcaa8aSmrg<variablelist> 199e9fcaa8aSmrg <varlistentry> 200e9fcaa8aSmrg <term> 201e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 202e9fcaa8aSmrg </term> 203e9fcaa8aSmrg <listitem> 204e9fcaa8aSmrg <para> 205e9fcaa8aSmrgSpecifies XIM structure address. 206e9fcaa8aSmrg </para> 207e9fcaa8aSmrg </listitem> 208e9fcaa8aSmrg </varlistentry> 209e9fcaa8aSmrg <varlistentry> 210e9fcaa8aSmrg <term> 211e9fcaa8aSmrg <emphasis remap='I'>transport_data</emphasis> 212e9fcaa8aSmrg </term> 213e9fcaa8aSmrg <listitem> 214e9fcaa8aSmrg <para> 215e9fcaa8aSmrgSpecifies the data specific to the transporter, in IM Server address.<footnote><para>Refer to "The Input Method Protocol: Appendix B</para></footnote> 216e9fcaa8aSmrg </para> 217e9fcaa8aSmrg </listitem> 218e9fcaa8aSmrg </varlistentry> 219e9fcaa8aSmrg</variablelist> 220e9fcaa8aSmrg 221e9fcaa8aSmrg<para> 222e9fcaa8aSmrgThis function must setup the transporter function pointers. 223e9fcaa8aSmrg</para> 224e9fcaa8aSmrg 225e9fcaa8aSmrg<para> 226e9fcaa8aSmrg<!-- .LP --> 227e9fcaa8aSmrgThe actual <emphasis remap='I'>config</emphasis> function will be chosen by IM Server at the 228e9fcaa8aSmrgpre-connection time, matching by the <emphasis remap='I'>transport_name</emphasis> specified 229e9fcaa8aSmrgin the <function>_XimTransportRec</function> array; The specific members of XimProto 230e9fcaa8aSmrgstructure listed below must be initialized so that point they 231e9fcaa8aSmrgappropriate transporter functions. 232e9fcaa8aSmrg</para> 233e9fcaa8aSmrg 234e9fcaa8aSmrg<para> 235e9fcaa8aSmrgIf the specified transporter has been configured successfully, this 236e9fcaa8aSmrgfunction returns True. There is no Alternative Entry for config 237e9fcaa8aSmrgfunction itself. 238e9fcaa8aSmrg</para> 239e9fcaa8aSmrg 240e9fcaa8aSmrg<para> 241e9fcaa8aSmrgThe structure XimProto contains the following function pointers: 242e9fcaa8aSmrg</para> 243e9fcaa8aSmrg 244e9fcaa8aSmrg<literallayout class="monospaced"> 245e9fcaa8aSmrgBool (*connect)(); /* Open connection */ 246e9fcaa8aSmrgBool (*shutdown)(); /* Close connection */ 247e9fcaa8aSmrgBool (*write)(); /* Write data */ 248e9fcaa8aSmrgBool (*read)(); /* Read data */ 249e9fcaa8aSmrgBool (*flush)(); /* Flush data buffer */ 250e9fcaa8aSmrgBool (*register_dispatcher)(); /* Register asynchronous data handler */ 251e9fcaa8aSmrgBool (*call_dispatcher)(); /* Call dispatcher */ 252e9fcaa8aSmrg</literallayout> 253e9fcaa8aSmrg 254e9fcaa8aSmrg<para> 255e9fcaa8aSmrgThese functions are called when Xlib needs to communicate the 256e9fcaa8aSmrgIM Server. These functions must process the appropriate procedure 257e9fcaa8aSmrgdescribed below. 258e9fcaa8aSmrg</para> 259e9fcaa8aSmrg 260e9fcaa8aSmrg</sect2> 261e9fcaa8aSmrg</sect1> 262e9fcaa8aSmrg<sect1 id="The_interface_transport_layer_functions"> 263e9fcaa8aSmrg<title>The interface/transport layer functions</title> 264e9fcaa8aSmrg<para> 265e9fcaa8aSmrgFollowing functions are used for the transport interface. 266e9fcaa8aSmrg</para> 267e9fcaa8aSmrg 268e9fcaa8aSmrg<table frame="all" id="transport_layer_functions_2"> 269e9fcaa8aSmrg <title>The Transport Layer Functions</title> 270e9fcaa8aSmrg <tgroup cols="3"> 271e9fcaa8aSmrg <colspec colname="col1" colwidth="3*" colsep="1"/> 272e9fcaa8aSmrg <colspec colname="col2" colwidth="3*" colsep="1"/> 273e9fcaa8aSmrg <colspec colname="col3" colwidth="1*" colsep="1"/> 274e9fcaa8aSmrg <thead> 275e9fcaa8aSmrg <row> 276e9fcaa8aSmrg <entry align="center">Alternate Entry (Interface Layer)</entry> 277e9fcaa8aSmrg <entry align="center">XimProto member (Transport Layer)</entry> 278e9fcaa8aSmrg <entry align="center">Section</entry> 279e9fcaa8aSmrg </row> 280e9fcaa8aSmrg </thead> 281e9fcaa8aSmrg <tbody> 282e9fcaa8aSmrg <row> 283e9fcaa8aSmrg <entry>_XimConnect</entry> 284e9fcaa8aSmrg <entry>connect</entry> 285e9fcaa8aSmrg <entry>3.1</entry> 286e9fcaa8aSmrg </row> 287e9fcaa8aSmrg <row> 288e9fcaa8aSmrg <entry>_XimShutdown</entry> 289e9fcaa8aSmrg <entry>shutdown</entry> 290e9fcaa8aSmrg <entry>3.2</entry> 291e9fcaa8aSmrg </row> 292e9fcaa8aSmrg <row> 293e9fcaa8aSmrg <entry>_XimWrite</entry> 294e9fcaa8aSmrg <entry>write</entry> 295e9fcaa8aSmrg <entry>3.3</entry> 296e9fcaa8aSmrg </row> 297e9fcaa8aSmrg <row> 298e9fcaa8aSmrg <entry>_XimRead</entry> 299e9fcaa8aSmrg <entry>read</entry> 300e9fcaa8aSmrg <entry>3.4</entry> 301e9fcaa8aSmrg </row> 302e9fcaa8aSmrg <row> 303e9fcaa8aSmrg <entry>_XimFlush</entry> 304e9fcaa8aSmrg <entry>flush</entry> 305e9fcaa8aSmrg <entry>3.5</entry> 306e9fcaa8aSmrg </row> 307e9fcaa8aSmrg <row> 308e9fcaa8aSmrg <entry>_XimRegisterDispatcher</entry> 309e9fcaa8aSmrg <entry>register_dispatcher</entry> 310e9fcaa8aSmrg <entry>3.6</entry> 311e9fcaa8aSmrg </row> 312e9fcaa8aSmrg <row> 313e9fcaa8aSmrg <entry>_XimCallDispatcher</entry> 314e9fcaa8aSmrg <entry>call_dispatcher</entry> 315e9fcaa8aSmrg <entry>3.7</entry> 316e9fcaa8aSmrg </row> 317e9fcaa8aSmrg </tbody> 318e9fcaa8aSmrg </tgroup> 319e9fcaa8aSmrg</table> 320e9fcaa8aSmrg 321e9fcaa8aSmrg<para> 322e9fcaa8aSmrgThe Protocol layer calls the above functions using the Alternative 323e9fcaa8aSmrgEntry in the left column. The transport implementation defines 324e9fcaa8aSmrgXimProto member function in the right column. The Alternative Entry is 325e9fcaa8aSmrgprovided so as to make easier to implement the Protocol Layer. 326e9fcaa8aSmrg</para> 327e9fcaa8aSmrg 328e9fcaa8aSmrg<sect2 id="Opening_connection"> 329e9fcaa8aSmrg<title>Opening connection</title> 330e9fcaa8aSmrg<para> 331e9fcaa8aSmrg<!-- .LP --> 332e9fcaa8aSmrgWhen <function>XOpenIM</function> is called, the following function is called to connect 333e9fcaa8aSmrgwith the IM Server. 334e9fcaa8aSmrg</para> 335e9fcaa8aSmrg 336e9fcaa8aSmrg<funcsynopsis> 337e9fcaa8aSmrg<funcprototype> 338e9fcaa8aSmrg <funcdef>Bool <function>(*connect)</function></funcdef> 339e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 340e9fcaa8aSmrg</funcprototype> 341e9fcaa8aSmrg</funcsynopsis> 342e9fcaa8aSmrg 343e9fcaa8aSmrg<variablelist> 344e9fcaa8aSmrg <varlistentry> 345e9fcaa8aSmrg <term> 346e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 347e9fcaa8aSmrg </term> 348e9fcaa8aSmrg <listitem> 349e9fcaa8aSmrg <para> 350e9fcaa8aSmrgSpecifies XIM structure address. 351e9fcaa8aSmrg </para> 352e9fcaa8aSmrg </listitem> 353e9fcaa8aSmrg </varlistentry> 354e9fcaa8aSmrg</variablelist> 355e9fcaa8aSmrg 356e9fcaa8aSmrg<para> 357e9fcaa8aSmrgThis function must establishes the connection to the IM Server. If the 358e9fcaa8aSmrgconnection is established successfully, this function returns True. 359e9fcaa8aSmrgThe Alternative Entry for this function is: 360e9fcaa8aSmrg</para> 361e9fcaa8aSmrg 362e9fcaa8aSmrg<funcsynopsis> 363e9fcaa8aSmrg<funcprototype> 364e9fcaa8aSmrg <funcdef>Bool <function> _XimConnect</function></funcdef> 365e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 366e9fcaa8aSmrg</funcprototype> 367e9fcaa8aSmrg</funcsynopsis> 368e9fcaa8aSmrg 369e9fcaa8aSmrg<variablelist> 370e9fcaa8aSmrg <varlistentry> 371e9fcaa8aSmrg <term> 372e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 373e9fcaa8aSmrg </term> 374e9fcaa8aSmrg <listitem> 375e9fcaa8aSmrg <para> 376e9fcaa8aSmrgSpecifies XIM structure address. 377e9fcaa8aSmrg </para> 378e9fcaa8aSmrg </listitem> 379e9fcaa8aSmrg </varlistentry> 380e9fcaa8aSmrg</variablelist> 381e9fcaa8aSmrg</sect2> 382e9fcaa8aSmrg 383e9fcaa8aSmrg<sect2 id="Closing_connection"> 384e9fcaa8aSmrg<title>Closing connection</title> 385e9fcaa8aSmrg<!-- .XS --> 386e9fcaa8aSmrg<!-- (SN Closing connection --> 387e9fcaa8aSmrg<!-- .XE --> 388e9fcaa8aSmrg<para> 389e9fcaa8aSmrg<!-- .LP --> 390e9fcaa8aSmrgWhen <function>XCloseIM</function> is called, the following function is called to 391e9fcaa8aSmrgdisconnect the connection with the IM Server. The Alternative Entry 392e9fcaa8aSmrgfor this function is: 393e9fcaa8aSmrg</para> 394e9fcaa8aSmrg 395e9fcaa8aSmrg<funcsynopsis> 396e9fcaa8aSmrg<funcprototype> 397e9fcaa8aSmrg <funcdef>Bool <function> (*shutdown)</function></funcdef> 398e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 399e9fcaa8aSmrg</funcprototype> 400e9fcaa8aSmrg</funcsynopsis> 401e9fcaa8aSmrg 402e9fcaa8aSmrg<variablelist> 403e9fcaa8aSmrg <varlistentry> 404e9fcaa8aSmrg <term> 405e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 406e9fcaa8aSmrg </term> 407e9fcaa8aSmrg <listitem> 408e9fcaa8aSmrg <para> 409e9fcaa8aSmrgSpecifies XIM structure address. 410e9fcaa8aSmrg </para> 411e9fcaa8aSmrg </listitem> 412e9fcaa8aSmrg </varlistentry> 413e9fcaa8aSmrg</variablelist> 414e9fcaa8aSmrg 415e9fcaa8aSmrg<para> 416e9fcaa8aSmrg<!-- .LP --> 417e9fcaa8aSmrgThis function must close connection with the IM Server. If the 418e9fcaa8aSmrgconnection is closed successfully, this function returns True. The 419e9fcaa8aSmrgAlternative Entry for this function is: 420e9fcaa8aSmrg</para> 421e9fcaa8aSmrg 422e9fcaa8aSmrg<funcsynopsis> 423e9fcaa8aSmrg<funcprototype> 424e9fcaa8aSmrg <funcdef>Bool <function>_XimShutdown</function></funcdef> 425e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 426e9fcaa8aSmrg</funcprototype> 427e9fcaa8aSmrg</funcsynopsis> 428e9fcaa8aSmrg 429e9fcaa8aSmrg<variablelist> 430e9fcaa8aSmrg <varlistentry> 431e9fcaa8aSmrg <term> 432e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 433e9fcaa8aSmrg </term> 434e9fcaa8aSmrg <listitem> 435e9fcaa8aSmrg <para> 436e9fcaa8aSmrgSpecifies XIM structure address. 437e9fcaa8aSmrg </para> 438e9fcaa8aSmrg </listitem> 439e9fcaa8aSmrg </varlistentry> 440e9fcaa8aSmrg</variablelist> 441e9fcaa8aSmrg 442e9fcaa8aSmrg</sect2> 443e9fcaa8aSmrg 444e9fcaa8aSmrg<sect2 id="Writing_data"> 445e9fcaa8aSmrg<title>Writing data</title> 446e9fcaa8aSmrg<para> 447e9fcaa8aSmrgThe following function is called, when Xlib needs to write data to the 448e9fcaa8aSmrgIM Server. 449e9fcaa8aSmrg</para> 450e9fcaa8aSmrg 451e9fcaa8aSmrg<funcsynopsis> 452e9fcaa8aSmrg<funcprototype> 453e9fcaa8aSmrg <funcdef>Bool <function> _XimWrite</function></funcdef> 454e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 455e9fcaa8aSmrg <paramdef>INT16<parameter> len</parameter></paramdef> 456e9fcaa8aSmrg <paramdef>XPointer<parameter> data</parameter></paramdef> 457e9fcaa8aSmrg</funcprototype> 458e9fcaa8aSmrg</funcsynopsis> 459e9fcaa8aSmrg 460e9fcaa8aSmrg<variablelist> 461e9fcaa8aSmrg <varlistentry> 462e9fcaa8aSmrg <term> 463e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 464e9fcaa8aSmrg </term> 465e9fcaa8aSmrg <listitem> 466e9fcaa8aSmrg <para> 467e9fcaa8aSmrgSpecifies XIM structure address. 468e9fcaa8aSmrg </para> 469e9fcaa8aSmrg </listitem> 470e9fcaa8aSmrg </varlistentry> 471e9fcaa8aSmrg <varlistentry> 472e9fcaa8aSmrg <term> 473e9fcaa8aSmrg <emphasis remap='I'>len</emphasis> 474e9fcaa8aSmrg </term> 475e9fcaa8aSmrg <listitem> 476e9fcaa8aSmrg <para> 477e9fcaa8aSmrgSpecifies the length of writing data. 478e9fcaa8aSmrg </para> 479e9fcaa8aSmrg </listitem> 480e9fcaa8aSmrg </varlistentry> 481e9fcaa8aSmrg <varlistentry> 482e9fcaa8aSmrg <term> 483e9fcaa8aSmrg <emphasis remap='I'>data</emphasis> 484e9fcaa8aSmrg </term> 485e9fcaa8aSmrg <listitem> 486e9fcaa8aSmrg <para> 487e9fcaa8aSmrgSpecifies the writing data. 488e9fcaa8aSmrg </para> 489e9fcaa8aSmrg </listitem> 490e9fcaa8aSmrg </varlistentry> 491e9fcaa8aSmrg</variablelist> 492e9fcaa8aSmrg 493e9fcaa8aSmrg<para> 494e9fcaa8aSmrgThis function writes the <emphasis remap='I'>data</emphasis> to the IM Server, regardless 495e9fcaa8aSmrgof the contents. The number of bytes is passed to <emphasis remap='I'>len</emphasis>. The 496e9fcaa8aSmrgwriting data is passed to <emphasis remap='I'>data</emphasis>. If data is sent successfully, 497e9fcaa8aSmrgthe function returns True. Refer to "The Input Method Protocol" for 498e9fcaa8aSmrgthe contents of the writing data. The Alternative Entry for this 499e9fcaa8aSmrgfunction is: 500e9fcaa8aSmrg</para> 501e9fcaa8aSmrg 502e9fcaa8aSmrg<funcsynopsis> 503e9fcaa8aSmrg<funcprototype> 504e9fcaa8aSmrg <funcdef>Bool <function>_XimWrite</function></funcdef> 505e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 506e9fcaa8aSmrg <paramdef>INT16<parameter> len</parameter></paramdef> 507e9fcaa8aSmrg <paramdef>XPointer<parameter> data</parameter></paramdef> 508e9fcaa8aSmrg</funcprototype> 509e9fcaa8aSmrg</funcsynopsis> 510e9fcaa8aSmrg 511e9fcaa8aSmrg<variablelist> 512e9fcaa8aSmrg <varlistentry> 513e9fcaa8aSmrg <term> 514e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 515e9fcaa8aSmrg </term> 516e9fcaa8aSmrg <listitem> 517e9fcaa8aSmrg <para> 518e9fcaa8aSmrgSpecifies XIM structure address. 519e9fcaa8aSmrg </para> 520e9fcaa8aSmrg </listitem> 521e9fcaa8aSmrg </varlistentry> 522e9fcaa8aSmrg <varlistentry> 523e9fcaa8aSmrg <term> 524e9fcaa8aSmrg <emphasis remap='I'>len</emphasis> 525e9fcaa8aSmrg </term> 526e9fcaa8aSmrg <listitem> 527e9fcaa8aSmrg <para> 528e9fcaa8aSmrgSpecifies the length of writing data. 529e9fcaa8aSmrg </para> 530e9fcaa8aSmrg </listitem> 531e9fcaa8aSmrg </varlistentry> 532e9fcaa8aSmrg <varlistentry> 533e9fcaa8aSmrg <term> 534e9fcaa8aSmrg <emphasis remap='I'>data</emphasis> 535e9fcaa8aSmrg </term> 536e9fcaa8aSmrg <listitem> 537e9fcaa8aSmrg <para> 538e9fcaa8aSmrgSpecifies the writing data. 539e9fcaa8aSmrg </para> 540e9fcaa8aSmrg </listitem> 541e9fcaa8aSmrg </varlistentry> 542e9fcaa8aSmrg</variablelist> 543e9fcaa8aSmrg 544e9fcaa8aSmrg</sect2> 545e9fcaa8aSmrg<sect2 id="Reading_data"> 546e9fcaa8aSmrg<title>Reading data</title> 547e9fcaa8aSmrg<para> 548e9fcaa8aSmrgThe following function is called when Xlib waits for response from IM 549e9fcaa8aSmrgserver synchronously. 550e9fcaa8aSmrg</para> 551e9fcaa8aSmrg 552e9fcaa8aSmrg<funcsynopsis> 553e9fcaa8aSmrg<funcprototype> 554e9fcaa8aSmrg <funcdef>Bool <function> _XimRead</function></funcdef> 555e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 556e9fcaa8aSmrg <paramdef>XPointer<parameter> read_buf</parameter></paramdef> 557e9fcaa8aSmrg <paramdef>int<parameter> buf_len</parameter></paramdef> 558e9fcaa8aSmrg <paramdef>int<parameter> *ret_len</parameter></paramdef> 559e9fcaa8aSmrg</funcprototype> 560e9fcaa8aSmrg</funcsynopsis> 561e9fcaa8aSmrg 562e9fcaa8aSmrg<variablelist> 563e9fcaa8aSmrg <varlistentry> 564e9fcaa8aSmrg <term> 565e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 566e9fcaa8aSmrg </term> 567e9fcaa8aSmrg <listitem> 568e9fcaa8aSmrg <para> 569e9fcaa8aSmrgSpecifies XIM structure address. 570e9fcaa8aSmrg </para> 571e9fcaa8aSmrg </listitem> 572e9fcaa8aSmrg </varlistentry> 573e9fcaa8aSmrg <varlistentry> 574e9fcaa8aSmrg <term> 575e9fcaa8aSmrg <emphasis remap='I'>read_buf</emphasis> 576e9fcaa8aSmrg </term> 577e9fcaa8aSmrg <listitem> 578e9fcaa8aSmrg <para> 579e9fcaa8aSmrgSpecifies the buffer to store data. 580e9fcaa8aSmrg </para> 581e9fcaa8aSmrg </listitem> 582e9fcaa8aSmrg </varlistentry> 583e9fcaa8aSmrg <varlistentry> 584e9fcaa8aSmrg <term> 585e9fcaa8aSmrg <emphasis remap='I'>buf_len</emphasis> 586e9fcaa8aSmrg </term> 587e9fcaa8aSmrg <listitem> 588e9fcaa8aSmrg <para> 589e9fcaa8aSmrgSpecifies the size of the <emphasis remap='I'>buffer</emphasis> 590e9fcaa8aSmrg </para> 591e9fcaa8aSmrg </listitem> 592e9fcaa8aSmrg </varlistentry> 593e9fcaa8aSmrg <varlistentry> 594e9fcaa8aSmrg <term> 595e9fcaa8aSmrg <emphasis remap='I'>ret_len</emphasis> 596e9fcaa8aSmrg </term> 597e9fcaa8aSmrg <listitem> 598e9fcaa8aSmrg <para> 599e9fcaa8aSmrgSpecifies the length of stored data. 600e9fcaa8aSmrg </para> 601e9fcaa8aSmrg </listitem> 602e9fcaa8aSmrg </varlistentry> 603e9fcaa8aSmrg</variablelist> 604e9fcaa8aSmrg 605e9fcaa8aSmrg<para> 606e9fcaa8aSmrgThis function stores the read data in <emphasis remap='I'>read_buf</emphasis>, which size is 607e9fcaa8aSmrgspecified as <emphasis remap='I'>buf_len</emphasis>. The size of data is set to <emphasis remap='I'>ret_len</emphasis>. 608e9fcaa8aSmrgThis function return True, if the data is read normally or reading 609e9fcaa8aSmrgdata is completed. 610e9fcaa8aSmrg</para> 611e9fcaa8aSmrg<para> 612e9fcaa8aSmrgThe Alternative Entry for this function is: 613e9fcaa8aSmrg</para> 614e9fcaa8aSmrg 615e9fcaa8aSmrg<funcsynopsis> 616e9fcaa8aSmrg<funcprototype> 617e9fcaa8aSmrg <funcdef>Bool <function> _XimRead</function></funcdef> 618e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 619e9fcaa8aSmrg <paramdef>INT16<parameter> *ret_len</parameter></paramdef> 620e9fcaa8aSmrg <paramdef>XPointer<parameter> buf</parameter></paramdef> 621e9fcaa8aSmrg <paramdef>int<parameter> buf_len</parameter></paramdef> 622e9fcaa8aSmrg <paramdef>Bool<parameter> (*predicate)()</parameter></paramdef> 623e9fcaa8aSmrg <paramdef>XPointer<parameter> predicate_arg</parameter></paramdef> 624e9fcaa8aSmrg</funcprototype> 625e9fcaa8aSmrg</funcsynopsis> 626e9fcaa8aSmrg 627e9fcaa8aSmrg<variablelist> 628e9fcaa8aSmrg <varlistentry> 629e9fcaa8aSmrg <term> 630e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 631e9fcaa8aSmrg </term> 632e9fcaa8aSmrg <listitem> 633e9fcaa8aSmrg <para> 634e9fcaa8aSmrgSpecifies XIM structure address. 635e9fcaa8aSmrg </para> 636e9fcaa8aSmrg </listitem> 637e9fcaa8aSmrg </varlistentry> 638e9fcaa8aSmrg <varlistentry> 639e9fcaa8aSmrg <term> 640e9fcaa8aSmrg <emphasis remap='I'>ret_len</emphasis> 641e9fcaa8aSmrg </term> 642e9fcaa8aSmrg <listitem> 643e9fcaa8aSmrg <para> 644e9fcaa8aSmrgSpecifies the size of the <emphasis remap='I'>data</emphasis> buffer. 645e9fcaa8aSmrg </para> 646e9fcaa8aSmrg </listitem> 647e9fcaa8aSmrg </varlistentry> 648e9fcaa8aSmrg <varlistentry> 649e9fcaa8aSmrg <term> 650e9fcaa8aSmrg <emphasis remap='I'>buf</emphasis> 651e9fcaa8aSmrg </term> 652e9fcaa8aSmrg <listitem> 653e9fcaa8aSmrg <para> 654e9fcaa8aSmrgSpecifies the buffer to store data. 655e9fcaa8aSmrg </para> 656e9fcaa8aSmrg </listitem> 657e9fcaa8aSmrg </varlistentry> 658e9fcaa8aSmrg <varlistentry> 659e9fcaa8aSmrg <term> 660e9fcaa8aSmrg <emphasis remap='I'>buf_len</emphasis> 661e9fcaa8aSmrg </term> 662e9fcaa8aSmrg <listitem> 663e9fcaa8aSmrg <para> 664e9fcaa8aSmrgSpecifies the length of <emphasis remap='I'>buffer</emphasis>. 665e9fcaa8aSmrg </para> 666e9fcaa8aSmrg </listitem> 667e9fcaa8aSmrg </varlistentry> 668e9fcaa8aSmrg <varlistentry> 669e9fcaa8aSmrg <term> 670e9fcaa8aSmrg <emphasis remap='I'>predicate</emphasis> 671e9fcaa8aSmrg </term> 672e9fcaa8aSmrg <listitem> 673e9fcaa8aSmrg <para> 674e9fcaa8aSmrgSpecifies the predicate for the XIM data. 675e9fcaa8aSmrg </para> 676e9fcaa8aSmrg </listitem> 677e9fcaa8aSmrg </varlistentry> 678e9fcaa8aSmrg <varlistentry> 679e9fcaa8aSmrg <term> 680e9fcaa8aSmrg <emphasis remap='I'>predicate_arg</emphasis> 681e9fcaa8aSmrg </term> 682e9fcaa8aSmrg <listitem> 683e9fcaa8aSmrg <para> 684e9fcaa8aSmrgSpecifies the predicate specific data. 685e9fcaa8aSmrg<!-- .sp 6p --> 686e9fcaa8aSmrg </para> 687e9fcaa8aSmrg </listitem> 688e9fcaa8aSmrg </varlistentry> 689e9fcaa8aSmrg</variablelist> 690e9fcaa8aSmrg 691e9fcaa8aSmrg<para> 692e9fcaa8aSmrgThe predicate procedure indicates whether the <emphasis remap='I'>data</emphasis> is for the 693e9fcaa8aSmrgXIM or not. <emphasis remap='I'>len</emphasis> 694e9fcaa8aSmrgThis function stores the read data in <emphasis remap='I'>buf</emphasis>, which size 695e9fcaa8aSmrgis specified as <emphasis remap='I'>buf_len</emphasis>. The size of data is set to 696e9fcaa8aSmrg<emphasis remap='I'>ret_len</emphasis>. If <emphasis remap='I'>preedicate()</emphasis> 697e9fcaa8aSmrgreturns True, this function returns True. If not, it calls the registered callback function. 698e9fcaa8aSmrg</para> 699e9fcaa8aSmrg 700e9fcaa8aSmrg<para> 701e9fcaa8aSmrgThe procedure and its arguments are: 702e9fcaa8aSmrg</para> 703e9fcaa8aSmrg 704e9fcaa8aSmrg 705e9fcaa8aSmrg<funcsynopsis> 706e9fcaa8aSmrg<funcprototype> 707e9fcaa8aSmrg <funcdef>void <function>(*predicate)</function></funcdef> 708e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 709e9fcaa8aSmrg <paramdef>INT16<parameter> len</parameter></paramdef> 710e9fcaa8aSmrg <paramdef>XPointer<parameter> data</parameter></paramdef> 711e9fcaa8aSmrg <paramdef>XPointer<parameter> predicate_arg</parameter></paramdef> 712e9fcaa8aSmrg</funcprototype> 713e9fcaa8aSmrg</funcsynopsis> 714e9fcaa8aSmrg 715e9fcaa8aSmrg<variablelist> 716e9fcaa8aSmrg <varlistentry> 717e9fcaa8aSmrg <term> 718e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 719e9fcaa8aSmrg </term> 720e9fcaa8aSmrg <listitem> 721e9fcaa8aSmrg <para> 722e9fcaa8aSmrgSpecifies XIM structure address. 723e9fcaa8aSmrg </para> 724e9fcaa8aSmrg </listitem> 725e9fcaa8aSmrg </varlistentry> 726e9fcaa8aSmrg <varlistentry> 727e9fcaa8aSmrg <term> 728e9fcaa8aSmrg <emphasis remap='I'>len</emphasis> 729e9fcaa8aSmrg </term> 730e9fcaa8aSmrg <listitem> 731e9fcaa8aSmrg <para> 732e9fcaa8aSmrgSpecifies the size of the <emphasis remap='I'>data</emphasis> buffer. 733e9fcaa8aSmrg </para> 734e9fcaa8aSmrg </listitem> 735e9fcaa8aSmrg </varlistentry> 736e9fcaa8aSmrg <varlistentry> 737e9fcaa8aSmrg <term> 738e9fcaa8aSmrg <emphasis remap='I'>data</emphasis> 739e9fcaa8aSmrg </term> 740e9fcaa8aSmrg <listitem> 741e9fcaa8aSmrg <para> 742e9fcaa8aSmrgSpecifies the buffer to store data. 743e9fcaa8aSmrg </para> 744e9fcaa8aSmrg </listitem> 745e9fcaa8aSmrg </varlistentry> 746e9fcaa8aSmrg <varlistentry> 747e9fcaa8aSmrg <term> 748e9fcaa8aSmrg <emphasis remap='I'>predicate_arg</emphasis> 749e9fcaa8aSmrg </term> 750e9fcaa8aSmrg <listitem> 751e9fcaa8aSmrg <para> 752e9fcaa8aSmrgSpecifies the predicate specific data. 753e9fcaa8aSmrg </para> 754e9fcaa8aSmrg </listitem> 755e9fcaa8aSmrg </varlistentry> 756e9fcaa8aSmrg</variablelist> 757e9fcaa8aSmrg 758e9fcaa8aSmrg</sect2> 759e9fcaa8aSmrg<sect2 id="Flushing_buffer"> 760e9fcaa8aSmrg<title>Flushing buffer</title> 761e9fcaa8aSmrg<para> 762e9fcaa8aSmrgThe following function is called when Xlib needs to flush the data. 763e9fcaa8aSmrg</para> 764e9fcaa8aSmrg 765e9fcaa8aSmrg<funcsynopsis> 766e9fcaa8aSmrg<funcprototype> 767e9fcaa8aSmrg <funcdef>void <function>(*flush)</function></funcdef> 768e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 769e9fcaa8aSmrg</funcprototype> 770e9fcaa8aSmrg</funcsynopsis> 771e9fcaa8aSmrg 772e9fcaa8aSmrg<variablelist> 773e9fcaa8aSmrg <varlistentry> 774e9fcaa8aSmrg <term> 775e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 776e9fcaa8aSmrg </term> 777e9fcaa8aSmrg <listitem> 778e9fcaa8aSmrg <para> 779e9fcaa8aSmrgSpecifies XIM structure address. 780e9fcaa8aSmrg </para> 781e9fcaa8aSmrg </listitem> 782e9fcaa8aSmrg </varlistentry> 783e9fcaa8aSmrg</variablelist> 784e9fcaa8aSmrg 785e9fcaa8aSmrg<para> 786e9fcaa8aSmrgThis function must flush the data stored in internal buffer on the 787e9fcaa8aSmrgtransport layer. If data transfer is completed, the function returns 788e9fcaa8aSmrgTrue. The Alternative Entry for this function is: 789e9fcaa8aSmrg</para> 790e9fcaa8aSmrg 791e9fcaa8aSmrg<funcsynopsis> 792e9fcaa8aSmrg<funcprototype> 793e9fcaa8aSmrg <funcdef>void <function> _XimFlush</function></funcdef> 794e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 795e9fcaa8aSmrg</funcprototype> 796e9fcaa8aSmrg</funcsynopsis> 797e9fcaa8aSmrg 798e9fcaa8aSmrg<variablelist> 799e9fcaa8aSmrg <varlistentry> 800e9fcaa8aSmrg <term> 801e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 802e9fcaa8aSmrg </term> 803e9fcaa8aSmrg <listitem> 804e9fcaa8aSmrg <para> 805e9fcaa8aSmrgSpecifies XIM structure address. 806e9fcaa8aSmrg </para> 807e9fcaa8aSmrg </listitem> 808e9fcaa8aSmrg </varlistentry> 809e9fcaa8aSmrg</variablelist> 810e9fcaa8aSmrg 811e9fcaa8aSmrg</sect2> 812e9fcaa8aSmrg<sect2 id="Registering_asynchronous_data_handler"> 813e9fcaa8aSmrg<title>Registering asynchronous data handler</title> 814e9fcaa8aSmrg<para> 815e9fcaa8aSmrgXlib needs to handle asynchronous response from IM Server. This is 816e9fcaa8aSmrgbecause some of the XIM data occur asynchronously to X events. 817e9fcaa8aSmrg</para> 818e9fcaa8aSmrg 819e9fcaa8aSmrg<para> 820e9fcaa8aSmrgThose data will be handled in the <emphasis remap='I'>Filter</emphasis>, 821e9fcaa8aSmrgand the <emphasis remap='I'>Filter</emphasis> 822e9fcaa8aSmrgwill call asynchronous data handler in the protocol layer. Then it 823e9fcaa8aSmrgcalls dispatchers in the transport layer. The dispatchers are 824e9fcaa8aSmrgimplemented by the protocol layer. This function must store the 825e9fcaa8aSmrginformation and prepare for later call of the dispatchers using 826e9fcaa8aSmrg<function>_XimCallDispatcher</function>. 827e9fcaa8aSmrg</para> 828e9fcaa8aSmrg 829e9fcaa8aSmrg<para> 830e9fcaa8aSmrgWhen multiple dispatchers are registered, they will be called 831e9fcaa8aSmrgsequentially in order of registration, on arrival of asynchronous 832e9fcaa8aSmrgdata. The register_dispatcher is declared as following: 833e9fcaa8aSmrg</para> 834e9fcaa8aSmrg 835e9fcaa8aSmrg<funcsynopsis> 836e9fcaa8aSmrg<funcprototype> 837e9fcaa8aSmrg <funcdef>Bool <function>(*register_dispatcher)</function></funcdef> 838e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 839e9fcaa8aSmrg <paramdef>Bool<parameter> (*dispatcher)()</parameter></paramdef> 840e9fcaa8aSmrg <paramdef>XPointer<parameter> call_data</parameter></paramdef> 841e9fcaa8aSmrg</funcprototype> 842e9fcaa8aSmrg</funcsynopsis> 843e9fcaa8aSmrg 844e9fcaa8aSmrg<variablelist> 845e9fcaa8aSmrg <varlistentry> 846e9fcaa8aSmrg <term> 847e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 848e9fcaa8aSmrg </term> 849e9fcaa8aSmrg <listitem> 850e9fcaa8aSmrg <para> 851e9fcaa8aSmrgSpecifies XIM structure address. 852e9fcaa8aSmrg </para> 853e9fcaa8aSmrg </listitem> 854e9fcaa8aSmrg </varlistentry> 855e9fcaa8aSmrg <varlistentry> 856e9fcaa8aSmrg <term> 857e9fcaa8aSmrg <emphasis remap='I'>dispatcher</emphasis> 858e9fcaa8aSmrg </term> 859e9fcaa8aSmrg <listitem> 860e9fcaa8aSmrg <para> 861e9fcaa8aSmrgSpecifies the dispatcher function to register. 862e9fcaa8aSmrg </para> 863e9fcaa8aSmrg </listitem> 864e9fcaa8aSmrg </varlistentry> 865e9fcaa8aSmrg <varlistentry> 866e9fcaa8aSmrg <term> 867e9fcaa8aSmrg <emphasis remap='I'>call_data</emphasis> 868e9fcaa8aSmrg </term> 869e9fcaa8aSmrg <listitem> 870e9fcaa8aSmrg <para> 871e9fcaa8aSmrgSpecifies a parameter for the <emphasis remap='I'>dispatcher</emphasis>. 872e9fcaa8aSmrg </para> 873e9fcaa8aSmrg </listitem> 874e9fcaa8aSmrg </varlistentry> 875e9fcaa8aSmrg</variablelist> 876e9fcaa8aSmrg 877e9fcaa8aSmrg<para> 878e9fcaa8aSmrgThe dispatcher is a function of the following type: 879e9fcaa8aSmrg</para> 880e9fcaa8aSmrg 881e9fcaa8aSmrg<funcsynopsis> 882e9fcaa8aSmrg<funcprototype> 883e9fcaa8aSmrg <funcdef>Bool <function>(*dispatcher)</function></funcdef> 884e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 885e9fcaa8aSmrg <paramdef>INT16<parameter> len</parameter></paramdef> 886e9fcaa8aSmrg <paramdef>XPointer<parameter> data</parameter></paramdef> 887e9fcaa8aSmrg <paramdef>XPointer<parameter> call_data</parameter></paramdef> 888e9fcaa8aSmrg</funcprototype> 889e9fcaa8aSmrg</funcsynopsis> 890e9fcaa8aSmrg 891e9fcaa8aSmrg<variablelist> 892e9fcaa8aSmrg <varlistentry> 893e9fcaa8aSmrg <term> 894e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 895e9fcaa8aSmrg </term> 896e9fcaa8aSmrg <listitem> 897e9fcaa8aSmrg <para> 898e9fcaa8aSmrgSpecifies XIM structure address. 899e9fcaa8aSmrg </para> 900e9fcaa8aSmrg </listitem> 901e9fcaa8aSmrg </varlistentry> 902e9fcaa8aSmrg <varlistentry> 903e9fcaa8aSmrg <term> 904e9fcaa8aSmrg <emphasis remap='I'>len</emphasis> 905e9fcaa8aSmrg </term> 906e9fcaa8aSmrg <listitem> 907e9fcaa8aSmrg <para> 908e9fcaa8aSmrgSpecifies the size of the <emphasis remap='I'>data</emphasis> buffer. 909e9fcaa8aSmrg </para> 910e9fcaa8aSmrg </listitem> 911e9fcaa8aSmrg </varlistentry> 912e9fcaa8aSmrg <varlistentry> 913e9fcaa8aSmrg <term> 914e9fcaa8aSmrg <emphasis remap='I'>data</emphasis> 915e9fcaa8aSmrg </term> 916e9fcaa8aSmrg <listitem> 917e9fcaa8aSmrg <para> 918e9fcaa8aSmrgSpecifies the buffer to store data. 919e9fcaa8aSmrg </para> 920e9fcaa8aSmrg </listitem> 921e9fcaa8aSmrg </varlistentry> 922e9fcaa8aSmrg <varlistentry> 923e9fcaa8aSmrg <term> 924e9fcaa8aSmrg <emphasis remap='I'>call_data</emphasis> 925e9fcaa8aSmrg </term> 926e9fcaa8aSmrg <listitem> 927e9fcaa8aSmrg <para> 928e9fcaa8aSmrgSpecifies a parameter passed to the register_dispatcher. 929e9fcaa8aSmrg </para> 930e9fcaa8aSmrg </listitem> 931e9fcaa8aSmrg </varlistentry> 932e9fcaa8aSmrg</variablelist> 933e9fcaa8aSmrg 934e9fcaa8aSmrg<para> 935e9fcaa8aSmrgThe dispatcher is provided by the protocol layer. They are called once 936e9fcaa8aSmrgfor every asynchronous data, in order of registration. If the data is 937e9fcaa8aSmrgused, it must return True. otherwise, it must return False. 938e9fcaa8aSmrg</para> 939e9fcaa8aSmrg 940e9fcaa8aSmrg<para> 941e9fcaa8aSmrgIf the dispatcher function returns True, the Transport Layer assume 942e9fcaa8aSmrgthat the data has been processed by the upper layer. The Alternative 943e9fcaa8aSmrgEntry for this function is: 944e9fcaa8aSmrg</para> 945e9fcaa8aSmrg 946e9fcaa8aSmrg<funcsynopsis> 947e9fcaa8aSmrg<funcprototype> 948e9fcaa8aSmrg <funcdef>Bool <function> _XimRegisterDispatcher</function></funcdef> 949e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 950e9fcaa8aSmrg <paramdef>Bool<parameter> (*dispatcher)()</parameter></paramdef> 951e9fcaa8aSmrg <paramdef>XPointer<parameter> call_data</parameter></paramdef> 952e9fcaa8aSmrg</funcprototype> 953e9fcaa8aSmrg</funcsynopsis> 954e9fcaa8aSmrg 955e9fcaa8aSmrg<variablelist> 956e9fcaa8aSmrg <varlistentry> 957e9fcaa8aSmrg <term> 958e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 959e9fcaa8aSmrg </term> 960e9fcaa8aSmrg <listitem> 961e9fcaa8aSmrg <para> 962e9fcaa8aSmrgSpecifies XIM structure address. 963e9fcaa8aSmrg </para> 964e9fcaa8aSmrg </listitem> 965e9fcaa8aSmrg </varlistentry> 966e9fcaa8aSmrg <varlistentry> 967e9fcaa8aSmrg <term> 968e9fcaa8aSmrg <emphasis remap='I'>dispatcher</emphasis> 969e9fcaa8aSmrg </term> 970e9fcaa8aSmrg <listitem> 971e9fcaa8aSmrg <para> 972e9fcaa8aSmrgSpecifies the dispatcher function to register. 973e9fcaa8aSmrg </para> 974e9fcaa8aSmrg </listitem> 975e9fcaa8aSmrg </varlistentry> 976e9fcaa8aSmrg <varlistentry> 977e9fcaa8aSmrg <term> 978e9fcaa8aSmrg <emphasis remap='I'>call_data</emphasis> 979e9fcaa8aSmrg </term> 980e9fcaa8aSmrg <listitem> 981e9fcaa8aSmrg <para> 982e9fcaa8aSmrgSpecifies a parameter for the <emphasis remap='I'>dispatcher</emphasis>. 983e9fcaa8aSmrg </para> 984e9fcaa8aSmrg </listitem> 985e9fcaa8aSmrg </varlistentry> 986e9fcaa8aSmrg</variablelist> 987e9fcaa8aSmrg 988e9fcaa8aSmrg</sect2> 989e9fcaa8aSmrg<sect2 id="Calling_dispatcher"> 990e9fcaa8aSmrg<title>Calling dispatcher</title> 991e9fcaa8aSmrg<para> 992e9fcaa8aSmrgThe following function is used to call the registered dispatcher 993e9fcaa8aSmrgfunction, when the asynchronous response from IM Server has arrived. 994e9fcaa8aSmrg</para> 995e9fcaa8aSmrg 996e9fcaa8aSmrg<funcsynopsis> 997e9fcaa8aSmrg<funcprototype> 998e9fcaa8aSmrg <funcdef>Bool <function>(*call_dispatcher)</function></funcdef> 999e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 1000e9fcaa8aSmrg <paramdef>INT16<parameter> len</parameter></paramdef> 1001e9fcaa8aSmrg <paramdef>XPointer<parameter> data</parameter></paramdef> 1002e9fcaa8aSmrg</funcprototype> 1003e9fcaa8aSmrg</funcsynopsis> 1004e9fcaa8aSmrg 1005e9fcaa8aSmrg<variablelist> 1006e9fcaa8aSmrg <varlistentry> 1007e9fcaa8aSmrg <term> 1008e9fcaa8aSmrg <emphasis remap='I'>im</emphasis> 1009e9fcaa8aSmrg </term> 1010e9fcaa8aSmrg <listitem> 1011e9fcaa8aSmrg <para> 1012e9fcaa8aSmrgSpecifies XIM structure address. 1013e9fcaa8aSmrg </para> 1014e9fcaa8aSmrg </listitem> 1015e9fcaa8aSmrg </varlistentry> 1016e9fcaa8aSmrg <varlistentry> 1017e9fcaa8aSmrg <term> 1018e9fcaa8aSmrg <emphasis remap='I'>len</emphasis> 1019e9fcaa8aSmrg </term> 1020e9fcaa8aSmrg <listitem> 1021e9fcaa8aSmrg <para> 1022e9fcaa8aSmrgSpecifies the size of <emphasis remap='I'>data</emphasis> buffer. 1023e9fcaa8aSmrg </para> 1024e9fcaa8aSmrg </listitem> 1025e9fcaa8aSmrg </varlistentry> 1026e9fcaa8aSmrg <varlistentry> 1027e9fcaa8aSmrg <term> 1028e9fcaa8aSmrg <emphasis remap='I'>data</emphasis> 1029e9fcaa8aSmrg </term> 1030e9fcaa8aSmrg <listitem> 1031e9fcaa8aSmrg <para> 1032e9fcaa8aSmrgSpecifies the buffer to store data. 1033e9fcaa8aSmrg </para> 1034e9fcaa8aSmrg </listitem> 1035e9fcaa8aSmrg </varlistentry> 1036e9fcaa8aSmrg</variablelist> 1037e9fcaa8aSmrg 1038e9fcaa8aSmrg<para> 1039e9fcaa8aSmrgThe call_dispatcher must call the dispatcher function, in order of 1040e9fcaa8aSmrgtheir registration. <emphasis remap='I'>len</emphasis> and <emphasis remap='I'>data</emphasis> are the data passed to 1041e9fcaa8aSmrgregister_dispatcher. 1042e9fcaa8aSmrg</para> 1043e9fcaa8aSmrg 1044e9fcaa8aSmrg<para> 1045e9fcaa8aSmrgThe return values are checked at each invocation, and if it finds 1046e9fcaa8aSmrgTrue, it immediately return with true for its return value. 1047e9fcaa8aSmrg</para> 1048e9fcaa8aSmrg 1049e9fcaa8aSmrg<para> 1050e9fcaa8aSmrgIt is depend on the upper layer whether the read data is XIM 1051e9fcaa8aSmrgProtocol packet unit or not. 1052e9fcaa8aSmrgThe Alternative Entry for this function is: 1053e9fcaa8aSmrg</para> 1054e9fcaa8aSmrg 1055e9fcaa8aSmrg<funcsynopsis> 1056e9fcaa8aSmrg<funcprototype> 1057e9fcaa8aSmrg <funcdef>Bool <function> _XimCallDispatcher</function></funcdef> 1058e9fcaa8aSmrg <paramdef>XIM<parameter> im</parameter></paramdef> 1059e9fcaa8aSmrg <paramdef>INT16<parameter> len</parameter></paramdef> 1060e9fcaa8aSmrg <paramdef>XPointer<parameter> call_data</parameter></paramdef> 1061e9fcaa8aSmrg</funcprototype> 1062e9fcaa8aSmrg</funcsynopsis> 1063e9fcaa8aSmrg 1064e9fcaa8aSmrg</sect2> 1065e9fcaa8aSmrg</sect1> 1066e9fcaa8aSmrg<sect1 id="Sample_implementations_for_the_Transport_Layer"> 1067e9fcaa8aSmrg<title>Sample implementations for the Transport Layer</title> 1068e9fcaa8aSmrg<para> 1069e9fcaa8aSmrgSample implementations for the transporter using the X connection is 1070e9fcaa8aSmrgdescribed here. 1071e9fcaa8aSmrg</para> 1072e9fcaa8aSmrg 1073e9fcaa8aSmrg<sect2 id="X_Transport"> 1074e9fcaa8aSmrg<title>X Transport</title> 1075e9fcaa8aSmrg<para> 1076e9fcaa8aSmrgAt the beginning of the X Transport connection for the XIM transport 1077e9fcaa8aSmrgmechanism, two different windows must be created either in an Xlib XIM 1078e9fcaa8aSmrgor in an IM Server, with which the Xlib and the IM Server exchange the 1079e9fcaa8aSmrgXIM transports by using the ClientMessage events and Window Properties. 1080e9fcaa8aSmrgIn the following, the window created by the Xlib is referred as the 1081e9fcaa8aSmrg"client communication window", and on the other hand, the window created 1082e9fcaa8aSmrgby the IM Server is referred as the "IMS communication window". 1083e9fcaa8aSmrg</para> 1084e9fcaa8aSmrg 1085e9fcaa8aSmrg<sect3 id="Connection"> 1086e9fcaa8aSmrg<title>Connection</title> 1087e9fcaa8aSmrg<para> 1088e9fcaa8aSmrgIn order to establish a connection, a communication window is created. 1089e9fcaa8aSmrgA ClientMessage in the following event's format is sent to the owner 1090e9fcaa8aSmrgwindow of XIM_SERVER selection, which the IM Server has created. 1091e9fcaa8aSmrg</para> 1092e9fcaa8aSmrg 1093e9fcaa8aSmrg<para> 1094e9fcaa8aSmrg<!-- .LP --> 1095e9fcaa8aSmrgRefer to "The Input Method Protocol" for the XIM_SERVER atom. 1096e9fcaa8aSmrg</para> 1097e9fcaa8aSmrg 1098e9fcaa8aSmrg<table frame="none" id="transport_layer_functions"> 1099e9fcaa8aSmrg <title>The ClientMessage sent to the IMS window.</title> 1100e9fcaa8aSmrg <tgroup cols="3"> 1101e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 1102e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1103e9fcaa8aSmrg <colspec colname="col3" colwidth="3.5*" colsep="0"/> 1104e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/> 1105e9fcaa8aSmrg <thead> 1106e9fcaa8aSmrg <row> 1107e9fcaa8aSmrg <entry align="left" spanname="span-horiz">Structure Member</entry> 1108e9fcaa8aSmrg <entry align="left">Contents</entry> 1109e9fcaa8aSmrg </row> 1110e9fcaa8aSmrg </thead> 1111e9fcaa8aSmrg <tbody> 1112e9fcaa8aSmrg <row rowsep="0"> 1113e9fcaa8aSmrg <entry>int</entry> 1114e9fcaa8aSmrg <entry>type</entry> 1115e9fcaa8aSmrg <entry>ClientMessage</entry> 1116e9fcaa8aSmrg </row> 1117e9fcaa8aSmrg <row rowsep="0"> 1118e9fcaa8aSmrg <entry>u_long</entry> 1119e9fcaa8aSmrg <entry>serial</entry> 1120e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1121e9fcaa8aSmrg </row> 1122e9fcaa8aSmrg <row rowsep="0"> 1123e9fcaa8aSmrg <entry>Bool</entry> 1124e9fcaa8aSmrg <entry>send_event</entry> 1125e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1126e9fcaa8aSmrg </row> 1127e9fcaa8aSmrg <row rowsep="0"> 1128e9fcaa8aSmrg <entry>Display</entry> 1129e9fcaa8aSmrg <entry>*display</entry> 1130e9fcaa8aSmrg <entry>The display to which connects</entry> 1131e9fcaa8aSmrg </row> 1132e9fcaa8aSmrg <row rowsep="0"> 1133e9fcaa8aSmrg <entry>Window</entry> 1134e9fcaa8aSmrg <entry>window</entry> 1135e9fcaa8aSmrg <entry>IMS Window ID</entry> 1136e9fcaa8aSmrg </row> 1137e9fcaa8aSmrg <row rowsep="0"> 1138e9fcaa8aSmrg <entry>Atom</entry> 1139e9fcaa8aSmrg <entry>message_type</entry> 1140e9fcaa8aSmrg <entry>XInternAtom(display, "_XIM_CONNECT", false)</entry> 1141e9fcaa8aSmrg </row> 1142e9fcaa8aSmrg <row rowsep="0"> 1143e9fcaa8aSmrg <entry>int</entry> 1144e9fcaa8aSmrg <entry>format</entry> 1145e9fcaa8aSmrg <entry>32</entry> 1146e9fcaa8aSmrg </row> 1147e9fcaa8aSmrg <row rowsep="0"> 1148e9fcaa8aSmrg <entry>long</entry> 1149e9fcaa8aSmrg <entry>data.1[0]</entry> 1150e9fcaa8aSmrg <entry>client communication window ID</entry> 1151e9fcaa8aSmrg </row> 1152e9fcaa8aSmrg <row rowsep="0"> 1153e9fcaa8aSmrg <entry>long</entry> 1154e9fcaa8aSmrg <entry>data.1[1]</entry> 1155e9fcaa8aSmrg <entry>client-major-transport-version(*1)</entry> 1156e9fcaa8aSmrg </row> 1157e9fcaa8aSmrg <row rowsep="0"> 1158e9fcaa8aSmrg <entry>long</entry> 1159e9fcaa8aSmrg <entry>data.1[2]</entry> 1160e9fcaa8aSmrg <entry>client-major-transport-version(*1)</entry> 1161e9fcaa8aSmrg </row> 1162e9fcaa8aSmrg </tbody> 1163e9fcaa8aSmrg </tgroup> 1164e9fcaa8aSmrg</table> 1165e9fcaa8aSmrg 1166e9fcaa8aSmrg<para> 1167e9fcaa8aSmrgIn order to establish the connection (to notify the IM Server communication 1168e9fcaa8aSmrgwindow), the IM Server sends a ClientMessage in the following event's 1169e9fcaa8aSmrgformat to the client communication window. 1170e9fcaa8aSmrg</para> 1171e9fcaa8aSmrg 1172e9fcaa8aSmrg<table frame="none" id="clientmessage_sent_by_im_server"> 1173e9fcaa8aSmrg <title>The ClientMessage sent by IM Server.</title> 1174e9fcaa8aSmrg <tgroup cols="3"> 1175e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 1176e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1177e9fcaa8aSmrg <colspec colname="col3" colwidth="3.5*" colsep="0"/> 1178e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/> 1179e9fcaa8aSmrg <thead> 1180e9fcaa8aSmrg <row> 1181e9fcaa8aSmrg <entry align="left" spanname="span-horiz">Structure Member</entry> 1182e9fcaa8aSmrg <entry align="left">Contents</entry> 1183e9fcaa8aSmrg </row> 1184e9fcaa8aSmrg </thead> 1185e9fcaa8aSmrg <tbody> 1186e9fcaa8aSmrg <row rowsep="0"> 1187e9fcaa8aSmrg <entry>int</entry> 1188e9fcaa8aSmrg <entry>type</entry> 1189e9fcaa8aSmrg <entry>ClientMessage</entry> 1190e9fcaa8aSmrg </row> 1191e9fcaa8aSmrg <row rowsep="0"> 1192e9fcaa8aSmrg <entry>u_long</entry> 1193e9fcaa8aSmrg <entry>serial</entry> 1194e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1195e9fcaa8aSmrg </row> 1196e9fcaa8aSmrg <row rowsep="0"> 1197e9fcaa8aSmrg <entry>Bool</entry> 1198e9fcaa8aSmrg <entry>send_event</entry> 1199e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1200e9fcaa8aSmrg </row> 1201e9fcaa8aSmrg <row rowsep="0"> 1202e9fcaa8aSmrg <entry>Display</entry> 1203e9fcaa8aSmrg <entry>*display</entry> 1204e9fcaa8aSmrg <entry>The display to which connects</entry> 1205e9fcaa8aSmrg </row> 1206e9fcaa8aSmrg <row rowsep="0"> 1207e9fcaa8aSmrg <entry>Window</entry> 1208e9fcaa8aSmrg <entry>window</entry> 1209e9fcaa8aSmrg <entry>IMS Window ID</entry> 1210e9fcaa8aSmrg </row> 1211e9fcaa8aSmrg <row rowsep="0"> 1212e9fcaa8aSmrg <entry>Atom</entry> 1213e9fcaa8aSmrg <entry>message_type</entry> 1214e9fcaa8aSmrg <entry>XInternAtom(display, "_XIM_CONNECT", false)</entry> 1215e9fcaa8aSmrg </row> 1216e9fcaa8aSmrg <row rowsep="0"> 1217e9fcaa8aSmrg <entry>int</entry> 1218e9fcaa8aSmrg <entry>format</entry> 1219e9fcaa8aSmrg <entry>32</entry> 1220e9fcaa8aSmrg </row> 1221e9fcaa8aSmrg <row rowsep="0"> 1222e9fcaa8aSmrg <entry>long</entry> 1223e9fcaa8aSmrg <entry>data.1[0]</entry> 1224e9fcaa8aSmrg <entry>client communication window ID</entry> 1225e9fcaa8aSmrg </row> 1226e9fcaa8aSmrg <row rowsep="0"> 1227e9fcaa8aSmrg <entry>long</entry> 1228e9fcaa8aSmrg <entry>data.1[1]</entry> 1229e9fcaa8aSmrg <entry>client-major-transport-version(*1)</entry> 1230e9fcaa8aSmrg </row> 1231e9fcaa8aSmrg <row rowsep="0"> 1232e9fcaa8aSmrg <entry>long</entry> 1233e9fcaa8aSmrg <entry>data.1[2]</entry> 1234e9fcaa8aSmrg <entry>client-major-transport-version(*1)</entry> 1235e9fcaa8aSmrg </row> 1236e9fcaa8aSmrg <row rowsep="0"> 1237e9fcaa8aSmrg <entry>long</entry> 1238e9fcaa8aSmrg <entry>data.1[3]</entry> 1239e9fcaa8aSmrg <entry>dividing size between ClientMessage and Property(*2)</entry> 1240e9fcaa8aSmrg </row> 1241e9fcaa8aSmrg </tbody> 1242e9fcaa8aSmrg </tgroup> 1243e9fcaa8aSmrg</table> 1244e9fcaa8aSmrg 1245e9fcaa8aSmrg<para> 1246e9fcaa8aSmrg(*1) major/minor-transport-version 1247e9fcaa8aSmrg</para> 1248e9fcaa8aSmrg 1249e9fcaa8aSmrg<para> 1250e9fcaa8aSmrgThe read/write method is decided by the combination of 1251e9fcaa8aSmrgmajor/minor-transport-version, as follows: 1252e9fcaa8aSmrg</para> 1253e9fcaa8aSmrg 1254e9fcaa8aSmrg<table frame="all" id="readwrite_method_and_the_majorminor_transport_version"> 1255e9fcaa8aSmrg<title>The read/write method and the major/minor-transport-version</title> 1256e9fcaa8aSmrg <tgroup cols="3"> 1257e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="1"/> 1258e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1259e9fcaa8aSmrg <colspec colname="col3" colwidth="3*" colsep="1"/> 1260e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/> 1261e9fcaa8aSmrg <thead> 1262e9fcaa8aSmrg <row> 1263e9fcaa8aSmrg <entry spanname="span-horiz">Transport-version</entry> 1264e9fcaa8aSmrg <entry>read/write</entry> 1265e9fcaa8aSmrg </row> 1266e9fcaa8aSmrg <row> 1267e9fcaa8aSmrg <entry>major</entry> 1268e9fcaa8aSmrg <entry>minor</entry> 1269e9fcaa8aSmrg <entry></entry> 1270e9fcaa8aSmrg </row> 1271e9fcaa8aSmrg </thead> 1272e9fcaa8aSmrg <tbody> 1273e9fcaa8aSmrg <row rowsep="0"> 1274e9fcaa8aSmrg <entry morerows="2">0</entry> 1275e9fcaa8aSmrg <entry>0</entry> 1276e9fcaa8aSmrg <entry>only-CM & Property-with-CM</entry> 1277e9fcaa8aSmrg </row> 1278e9fcaa8aSmrg <row rowsep="0"> 1279e9fcaa8aSmrg <entry>1</entry> 1280e9fcaa8aSmrg <entry>only-CM & multi-CM</entry> 1281e9fcaa8aSmrg </row> 1282e9fcaa8aSmrg <row rowsep="1"> 1283e9fcaa8aSmrg <entry>2</entry> 1284e9fcaa8aSmrg <entry>only-CM & multi-CM & Property-with-CM</entry> 1285e9fcaa8aSmrg </row> 1286e9fcaa8aSmrg <row rowsep="1"> 1287e9fcaa8aSmrg <entry>1</entry> 1288e9fcaa8aSmrg <entry>0</entry> 1289e9fcaa8aSmrg <entry>PropertyNotify</entry> 1290e9fcaa8aSmrg </row> 1291e9fcaa8aSmrg <row rowsep="0"> 1292e9fcaa8aSmrg <entry morerows="1">2</entry> 1293e9fcaa8aSmrg <entry>0</entry> 1294e9fcaa8aSmrg <entry>only-CM & PropertyNotify</entry> 1295e9fcaa8aSmrg </row> 1296e9fcaa8aSmrg <row> 1297e9fcaa8aSmrg <entry>1</entry> 1298e9fcaa8aSmrg <entry>only-CM & multi-CM & PropertyNotify</entry> 1299e9fcaa8aSmrg </row> 1300e9fcaa8aSmrg </tbody> 1301e9fcaa8aSmrg </tgroup> 1302e9fcaa8aSmrg</table> 1303e9fcaa8aSmrg 1304e9fcaa8aSmrg<literallayout class="monospaced"> 1305e9fcaa8aSmrgonly-CM : data is sent via a ClientMessage 1306e9fcaa8aSmrgmulti-CM : data is sent via multiple ClientMessages 1307e9fcaa8aSmrgProperty-with-CM : data is written in Property, and its Atom 1308e9fcaa8aSmrg is send via ClientMessage 1309e9fcaa8aSmrgPropertyNotify : data is written in Property, and its Atom 1310e9fcaa8aSmrg is send via PropertyNotify 1311e9fcaa8aSmrg 1312e9fcaa8aSmrg</literallayout> 1313e9fcaa8aSmrg 1314e9fcaa8aSmrg 1315e9fcaa8aSmrg<para> 1316e9fcaa8aSmrgThe method to decide major/minor-transport-version is as follows: 1317e9fcaa8aSmrg</para> 1318e9fcaa8aSmrg 1319e9fcaa8aSmrg<itemizedlist> 1320e9fcaa8aSmrg <listitem> 1321e9fcaa8aSmrg <para> 1322e9fcaa8aSmrgThe client sends 0 as major/minor-transport-version to the IM Server. 1323e9fcaa8aSmrgThe client must support all methods in Table 4-3. <!-- xref --> 1324e9fcaa8aSmrgThe client may send another number as major/minor-transport-version to 1325e9fcaa8aSmrguse other method than the above in the future. 1326e9fcaa8aSmrg </para> 1327e9fcaa8aSmrg </listitem> 1328e9fcaa8aSmrg <listitem> 1329e9fcaa8aSmrg <para> 1330e9fcaa8aSmrgThe IM Server sends its major/minor-transport-version number to 1331e9fcaa8aSmrgthe client. The client sends data using the method specified by the 1332e9fcaa8aSmrgIM Server. 1333e9fcaa8aSmrg </para> 1334e9fcaa8aSmrg </listitem> 1335e9fcaa8aSmrg <listitem> 1336e9fcaa8aSmrg <para> 1337e9fcaa8aSmrgIf major/minor-transport-version number is not available, it is regarded 1338e9fcaa8aSmrgas 0. 1339e9fcaa8aSmrg </para> 1340e9fcaa8aSmrg </listitem> 1341e9fcaa8aSmrg</itemizedlist> 1342e9fcaa8aSmrg 1343e9fcaa8aSmrg<para> 1344e9fcaa8aSmrg(*2) dividing size between ClientMessage and Property 1345e9fcaa8aSmrg</para> 1346e9fcaa8aSmrg 1347e9fcaa8aSmrg<para> 1348e9fcaa8aSmrgIf data is sent via both of multi-CM and Property, specify the dividing 1349e9fcaa8aSmrgsize between ClientMessage and Property. The data, which is smaller than 1350e9fcaa8aSmrgthis size, is sent via multi-CM (or only-CM), and the data, which is 1351e9fcaa8aSmrglager than this size, is sent via Property. 1352e9fcaa8aSmrg</para> 1353e9fcaa8aSmrg 1354e9fcaa8aSmrg</sect3> 1355e9fcaa8aSmrg 1356e9fcaa8aSmrg<sect3 id="read_write_"> 1357e9fcaa8aSmrg<title>read/write </title> 1358e9fcaa8aSmrg<para> 1359e9fcaa8aSmrgThe data is transferred via either ClientMessage or Window Property in 1360e9fcaa8aSmrgthe X Window System. 1361e9fcaa8aSmrg</para> 1362e9fcaa8aSmrg 1363e9fcaa8aSmrg<sect4 id="Format_for_the_data_from_the_Client_to_the_IM_Server"> 1364e9fcaa8aSmrg<title>Format for the data from the Client to the IM Server</title> 1365e9fcaa8aSmrg<para> 1366e9fcaa8aSmrg<emphasis role="bold">ClientMessage</emphasis> 1367e9fcaa8aSmrg</para> 1368e9fcaa8aSmrg 1369e9fcaa8aSmrg<para> 1370e9fcaa8aSmrgIf data is sent via ClientMessage event, the format is as follows: 1371e9fcaa8aSmrg</para> 1372e9fcaa8aSmrg 1373e9fcaa8aSmrg<table frame="none" id="clientmessage_events_format_first_or_middle"> 1374e9fcaa8aSmrg <title>The ClientMessage event's format (first or middle)</title> 1375e9fcaa8aSmrg <tgroup cols="3"> 1376e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 1377e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1378e9fcaa8aSmrg <colspec colname="col3" colwidth="3.5*" colsep="0"/> 1379e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/> 1380e9fcaa8aSmrg <thead> 1381e9fcaa8aSmrg <row> 1382e9fcaa8aSmrg <entry align="left" spanname="span-horiz">Structure Member</entry> 1383e9fcaa8aSmrg <entry align="left">Contents</entry> 1384e9fcaa8aSmrg </row> 1385e9fcaa8aSmrg </thead> 1386e9fcaa8aSmrg <tbody> 1387e9fcaa8aSmrg <row rowsep="0"> 1388e9fcaa8aSmrg <entry>int</entry> 1389e9fcaa8aSmrg <entry>type</entry> 1390e9fcaa8aSmrg <entry>ClientMessage</entry> 1391e9fcaa8aSmrg </row> 1392e9fcaa8aSmrg <row rowsep="0"> 1393e9fcaa8aSmrg <entry>u_long</entry> 1394e9fcaa8aSmrg <entry>serial</entry> 1395e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1396e9fcaa8aSmrg </row> 1397e9fcaa8aSmrg <row rowsep="0"> 1398e9fcaa8aSmrg <entry>Bool</entry> 1399e9fcaa8aSmrg <entry>send_event</entry> 1400e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1401e9fcaa8aSmrg </row> 1402e9fcaa8aSmrg <row rowsep="0"> 1403e9fcaa8aSmrg <entry>Display</entry> 1404e9fcaa8aSmrg <entry>*display</entry> 1405e9fcaa8aSmrg <entry>The display to which connects</entry> 1406e9fcaa8aSmrg </row> 1407e9fcaa8aSmrg <row rowsep="0"> 1408e9fcaa8aSmrg <entry>Window</entry> 1409e9fcaa8aSmrg <entry>window</entry> 1410e9fcaa8aSmrg <entry>IMS Window ID</entry> 1411e9fcaa8aSmrg </row> 1412e9fcaa8aSmrg <row rowsep="0"> 1413e9fcaa8aSmrg <entry>Atom</entry> 1414e9fcaa8aSmrg <entry>message_type</entry> 1415e9fcaa8aSmrg <entry>XInternAtom(display, "_XIM_MOREDATA", False)</entry> 1416e9fcaa8aSmrg </row> 1417e9fcaa8aSmrg <row rowsep="0"> 1418e9fcaa8aSmrg <entry>int</entry> 1419e9fcaa8aSmrg <entry>format</entry> 1420e9fcaa8aSmrg <entry>8</entry> 1421e9fcaa8aSmrg </row> 1422e9fcaa8aSmrg <row rowsep="0"> 1423e9fcaa8aSmrg <entry>char</entry> 1424e9fcaa8aSmrg <entry>data.b[20]</entry> 1425e9fcaa8aSmrg <entry>(read/write DATA : 20 byte)</entry> 1426e9fcaa8aSmrg </row> 1427e9fcaa8aSmrg </tbody> 1428e9fcaa8aSmrg </tgroup> 1429e9fcaa8aSmrg</table> 1430e9fcaa8aSmrg 1431e9fcaa8aSmrg 1432e9fcaa8aSmrg 1433e9fcaa8aSmrg<table frame="none" id="clientmessage_events_format_only_or_last"> 1434e9fcaa8aSmrg <title>The ClientMessage event's format (only or last)</title> 1435e9fcaa8aSmrg <tgroup cols="3"> 1436e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 1437e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1438e9fcaa8aSmrg <colspec colname="col3" colwidth="3.5*" colsep="0"/> 1439e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/> 1440e9fcaa8aSmrg <thead> 1441e9fcaa8aSmrg <row> 1442e9fcaa8aSmrg <entry align="left" spanname="span-horiz">Structure Member</entry> 1443e9fcaa8aSmrg <entry align="left">Contents</entry> 1444e9fcaa8aSmrg </row> 1445e9fcaa8aSmrg </thead> 1446e9fcaa8aSmrg <tbody> 1447e9fcaa8aSmrg <row rowsep="0"> 1448e9fcaa8aSmrg <entry>int</entry> 1449e9fcaa8aSmrg <entry>type</entry> 1450e9fcaa8aSmrg <entry>ClientMessage</entry> 1451e9fcaa8aSmrg </row> 1452e9fcaa8aSmrg <row rowsep="0"> 1453e9fcaa8aSmrg <entry>u_long</entry> 1454e9fcaa8aSmrg <entry>serial</entry> 1455e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1456e9fcaa8aSmrg </row> 1457e9fcaa8aSmrg <row rowsep="0"> 1458e9fcaa8aSmrg <entry>Bool</entry> 1459e9fcaa8aSmrg <entry>send_event</entry> 1460e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1461e9fcaa8aSmrg </row> 1462e9fcaa8aSmrg <row rowsep="0"> 1463e9fcaa8aSmrg <entry>Display</entry> 1464e9fcaa8aSmrg <entry>*display</entry> 1465e9fcaa8aSmrg <entry>The display to which connects</entry> 1466e9fcaa8aSmrg </row> 1467e9fcaa8aSmrg <row rowsep="0"> 1468e9fcaa8aSmrg <entry>Window</entry> 1469e9fcaa8aSmrg <entry>window</entry> 1470e9fcaa8aSmrg <entry>IMS Window ID</entry> 1471e9fcaa8aSmrg </row> 1472e9fcaa8aSmrg <row rowsep="0"> 1473e9fcaa8aSmrg <entry>Atom</entry> 1474e9fcaa8aSmrg <entry>message_type</entry> 1475e9fcaa8aSmrg <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry> 1476e9fcaa8aSmrg </row> 1477e9fcaa8aSmrg <row rowsep="0"> 1478e9fcaa8aSmrg <entry>int</entry> 1479e9fcaa8aSmrg <entry>format</entry> 1480e9fcaa8aSmrg <entry>8</entry> 1481e9fcaa8aSmrg </row> 1482e9fcaa8aSmrg <row rowsep="0"> 1483e9fcaa8aSmrg <entry>char</entry> 1484e9fcaa8aSmrg <entry>data.b[20]</entry> 1485e9fcaa8aSmrg <entry>(read/write DATA : MAX 20 byte) 1486e9fcaa8aSmrg<footnote><para>If the data is smaller 1487e9fcaa8aSmrgthan 20 bytes, all data other than available data must be 0. 1488e9fcaa8aSmrg</para></footnote> 1489e9fcaa8aSmrg </entry> 1490e9fcaa8aSmrg </row> 1491e9fcaa8aSmrg </tbody> 1492e9fcaa8aSmrg </tgroup> 1493e9fcaa8aSmrg</table> 1494e9fcaa8aSmrg 1495e9fcaa8aSmrg<para> 1496e9fcaa8aSmrg<emphasis role="bold">Property</emphasis> 1497e9fcaa8aSmrg</para> 1498e9fcaa8aSmrg 1499e9fcaa8aSmrg<para> 1500e9fcaa8aSmrgIn the case of large data, data will be sent via the Window Property 1501e9fcaa8aSmrgfor the efficiency. There are the following two methods to notify 1502e9fcaa8aSmrgProperty, and transport-version is decided which method is used. 1503e9fcaa8aSmrg</para> 1504e9fcaa8aSmrg 1505e9fcaa8aSmrg<itemizedlist> 1506e9fcaa8aSmrg <listitem> 1507e9fcaa8aSmrg <para> 1508e9fcaa8aSmrgThe XChangeProperty function is used to store data in the client 1509e9fcaa8aSmrgcommunication window, and Atom of the stored data is notified to the 1510e9fcaa8aSmrgIM Server via ClientMessage event. 1511e9fcaa8aSmrg </para> 1512e9fcaa8aSmrg </listitem> 1513e9fcaa8aSmrg <listitem> 1514e9fcaa8aSmrg <para> 1515e9fcaa8aSmrgThe XChangeProperty function is used to store data in the client 1516e9fcaa8aSmrgcommunication window, and Atom of the stored data is notified to the 1517e9fcaa8aSmrgIM Server via PropertyNotify event. 1518e9fcaa8aSmrg </para> 1519e9fcaa8aSmrg </listitem> 1520e9fcaa8aSmrg</itemizedlist> 1521e9fcaa8aSmrg 1522e9fcaa8aSmrg<para> 1523e9fcaa8aSmrgThe arguments of the XChangeProperty are as follows: 1524e9fcaa8aSmrg</para> 1525e9fcaa8aSmrg 1526e9fcaa8aSmrg 1527e9fcaa8aSmrg<table frame="none" id="xchangeproperty_events_format"> 1528e9fcaa8aSmrg <title>The XChangeProperty event's format</title> 1529e9fcaa8aSmrg <tgroup cols="3"> 1530e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 1531e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1532e9fcaa8aSmrg <colspec colname="col3" colwidth="3.5*" colsep="0"/> 1533e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/> 1534e9fcaa8aSmrg <thead> 1535e9fcaa8aSmrg <row> 1536e9fcaa8aSmrg <entry align="left" spanname="span-horiz">Argument</entry> 1537e9fcaa8aSmrg <entry align="left">Contents</entry> 1538e9fcaa8aSmrg </row> 1539e9fcaa8aSmrg </thead> 1540e9fcaa8aSmrg <tbody> 1541e9fcaa8aSmrg <row rowsep="0"> 1542e9fcaa8aSmrg <entry>Display</entry> 1543e9fcaa8aSmrg <entry>*display</entry> 1544e9fcaa8aSmrg <entry>The display to which connects</entry> 1545e9fcaa8aSmrg </row> 1546e9fcaa8aSmrg <row rowsep="0"> 1547e9fcaa8aSmrg <entry>Window</entry> 1548e9fcaa8aSmrg <entry>window</entry> 1549e9fcaa8aSmrg <entry>IMS communication window ID</entry> 1550e9fcaa8aSmrg </row> 1551e9fcaa8aSmrg <row rowsep="0"> 1552e9fcaa8aSmrg <entry>Atom</entry> 1553e9fcaa8aSmrg <entry>property</entry> 1554e9fcaa8aSmrg <entry>read/write property Atom (*1)</entry> 1555e9fcaa8aSmrg </row> 1556e9fcaa8aSmrg <row rowsep="0"> 1557e9fcaa8aSmrg <entry>int</entry> 1558e9fcaa8aSmrg <entry>format</entry> 1559e9fcaa8aSmrg <entry>8</entry> 1560e9fcaa8aSmrg </row> 1561e9fcaa8aSmrg <row rowsep="0"> 1562e9fcaa8aSmrg <entry>int</entry> 1563e9fcaa8aSmrg <entry>mode</entry> 1564e9fcaa8aSmrg <entry>PropModeAppend</entry> 1565e9fcaa8aSmrg </row> 1566e9fcaa8aSmrg <row rowsep="0"> 1567e9fcaa8aSmrg <entry>u_char</entry> 1568e9fcaa8aSmrg <entry>*data</entry> 1569e9fcaa8aSmrg <entry>read/write DATA</entry> 1570e9fcaa8aSmrg </row> 1571e9fcaa8aSmrg <row rowsep="0"> 1572e9fcaa8aSmrg <entry>int</entry> 1573e9fcaa8aSmrg <entry>nelements</entry> 1574e9fcaa8aSmrg <entry>length of DATA</entry> 1575e9fcaa8aSmrg </row> 1576e9fcaa8aSmrg </tbody> 1577e9fcaa8aSmrg </tgroup> 1578e9fcaa8aSmrg</table> 1579e9fcaa8aSmrg 1580e9fcaa8aSmrg<para> 1581e9fcaa8aSmrg(*1) The read/write property ATOM allocates the following strings by 1582e9fcaa8aSmrg<function>XInternAtom</function>. 1583e9fcaa8aSmrg"_clientXXX" 1584e9fcaa8aSmrg</para> 1585e9fcaa8aSmrg 1586e9fcaa8aSmrg<para> 1587e9fcaa8aSmrgThe client changes the property with the mode of PropModeAppend and 1588e9fcaa8aSmrgthe IM Server will read it with the delete mode i.e. (delete = True). 1589e9fcaa8aSmrg</para> 1590e9fcaa8aSmrg 1591e9fcaa8aSmrg<para> 1592e9fcaa8aSmrgIf Atom is notified via ClientMessage event, the format of the ClientMessage 1593e9fcaa8aSmrgis as follows: 1594e9fcaa8aSmrg</para> 1595e9fcaa8aSmrg 1596e9fcaa8aSmrg<table frame="none" id="clientmessage_events_format_to_send_atom_of_property"> 1597e9fcaa8aSmrg <title>The ClientMessage event's format to send Atom of property</title> 1598e9fcaa8aSmrg <tgroup cols="3"> 1599e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 1600e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1601e9fcaa8aSmrg <colspec colname="col3" colwidth="3.5*" colsep="0"/> 1602e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/> 1603e9fcaa8aSmrg <thead> 1604e9fcaa8aSmrg <row> 1605e9fcaa8aSmrg <entry align="left" spanname="span-horiz">Structure Member</entry> 1606e9fcaa8aSmrg <entry align="left">Contents</entry> 1607e9fcaa8aSmrg </row> 1608e9fcaa8aSmrg </thead> 1609e9fcaa8aSmrg <tbody> 1610e9fcaa8aSmrg <row rowsep="0"> 1611e9fcaa8aSmrg <entry>int</entry> 1612e9fcaa8aSmrg <entry>type</entry> 1613e9fcaa8aSmrg <entry>ClientMessage</entry> 1614e9fcaa8aSmrg </row> 1615e9fcaa8aSmrg <row rowsep="0"> 1616e9fcaa8aSmrg <entry>u_long</entry> 1617e9fcaa8aSmrg <entry>serial</entry> 1618e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1619e9fcaa8aSmrg </row> 1620e9fcaa8aSmrg <row rowsep="0"> 1621e9fcaa8aSmrg <entry>Bool</entry> 1622e9fcaa8aSmrg <entry>send_event</entry> 1623e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1624e9fcaa8aSmrg </row> 1625e9fcaa8aSmrg <row rowsep="0"> 1626e9fcaa8aSmrg <entry>Display</entry> 1627e9fcaa8aSmrg <entry>*display</entry> 1628e9fcaa8aSmrg <entry>The display to which connects</entry> 1629e9fcaa8aSmrg </row> 1630e9fcaa8aSmrg <row rowsep="0"> 1631e9fcaa8aSmrg <entry>Window</entry> 1632e9fcaa8aSmrg <entry>window</entry> 1633e9fcaa8aSmrg <entry>IMS Window ID</entry> 1634e9fcaa8aSmrg </row> 1635e9fcaa8aSmrg <row rowsep="0"> 1636e9fcaa8aSmrg <entry>Atom</entry> 1637e9fcaa8aSmrg <entry>message_type</entry> 1638e9fcaa8aSmrg <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry> 1639e9fcaa8aSmrg </row> 1640e9fcaa8aSmrg <row rowsep="0"> 1641e9fcaa8aSmrg <entry>int</entry> 1642e9fcaa8aSmrg <entry>format</entry> 1643e9fcaa8aSmrg <entry>8</entry> 1644e9fcaa8aSmrg </row> 1645e9fcaa8aSmrg <row rowsep="0"> 1646e9fcaa8aSmrg <entry>long</entry> 1647e9fcaa8aSmrg <entry>data.1[0]</entry> 1648e9fcaa8aSmrg <entry>length of read/write property Atom</entry> 1649e9fcaa8aSmrg </row> 1650e9fcaa8aSmrg <row rowsep="0"> 1651e9fcaa8aSmrg <entry>long</entry> 1652e9fcaa8aSmrg <entry>data.1[1]</entry> 1653e9fcaa8aSmrg <entry>read/write property Atom</entry> 1654e9fcaa8aSmrg </row> 1655e9fcaa8aSmrg </tbody> 1656e9fcaa8aSmrg </tgroup> 1657e9fcaa8aSmrg</table> 1658e9fcaa8aSmrg</sect4> 1659e9fcaa8aSmrg 1660e9fcaa8aSmrg<sect4 id="Format_for_the_data_from_the_IM_Server_to_the_Client"> 1661e9fcaa8aSmrg<title>Format for the data from the IM Server to the Client</title> 1662e9fcaa8aSmrg<para> 1663e9fcaa8aSmrg<emphasis role="bold">ClientMessage</emphasis> 1664e9fcaa8aSmrg</para> 1665e9fcaa8aSmrg 1666e9fcaa8aSmrg<para> 1667e9fcaa8aSmrgThe format of the ClientMessage is as follows: 1668e9fcaa8aSmrg</para> 1669e9fcaa8aSmrg 1670e9fcaa8aSmrg<table frame="none" id="clientmessage_events_format_first_or_middle_2"> 1671e9fcaa8aSmrg <title>The ClientMessage event's format (first or middle)</title> 1672e9fcaa8aSmrg <tgroup cols="3"> 1673e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 1674e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1675e9fcaa8aSmrg <colspec colname="col3" colwidth="3.5*" colsep="0"/> 1676e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/> 1677e9fcaa8aSmrg <thead> 1678e9fcaa8aSmrg <row> 1679e9fcaa8aSmrg <entry align="left" spanname="span-horiz">Structure Member</entry> 1680e9fcaa8aSmrg <entry align="left">Contents</entry> 1681e9fcaa8aSmrg </row> 1682e9fcaa8aSmrg </thead> 1683e9fcaa8aSmrg <tbody> 1684e9fcaa8aSmrg <row rowsep="0"> 1685e9fcaa8aSmrg <entry>int</entry> 1686e9fcaa8aSmrg <entry>type</entry> 1687e9fcaa8aSmrg <entry>ClientMessage</entry> 1688e9fcaa8aSmrg </row> 1689e9fcaa8aSmrg <row rowsep="0"> 1690e9fcaa8aSmrg <entry>u_long</entry> 1691e9fcaa8aSmrg <entry>serial</entry> 1692e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1693e9fcaa8aSmrg </row> 1694e9fcaa8aSmrg <row rowsep="0"> 1695e9fcaa8aSmrg <entry>Bool</entry> 1696e9fcaa8aSmrg <entry>send_event</entry> 1697e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1698e9fcaa8aSmrg </row> 1699e9fcaa8aSmrg <row rowsep="0"> 1700e9fcaa8aSmrg <entry>Display</entry> 1701e9fcaa8aSmrg <entry>*display</entry> 1702e9fcaa8aSmrg <entry>The display to which connects</entry> 1703e9fcaa8aSmrg </row> 1704e9fcaa8aSmrg <row rowsep="0"> 1705e9fcaa8aSmrg <entry>Window</entry> 1706e9fcaa8aSmrg <entry>window</entry> 1707e9fcaa8aSmrg <entry>IMS Window ID</entry> 1708e9fcaa8aSmrg </row> 1709e9fcaa8aSmrg <row rowsep="0"> 1710e9fcaa8aSmrg <entry>Atom</entry> 1711e9fcaa8aSmrg <entry>message_type</entry> 1712e9fcaa8aSmrg <entry>XInternAtom(display, "_XIM_MOREDATA", False)</entry> 1713e9fcaa8aSmrg </row> 1714e9fcaa8aSmrg <row rowsep="0"> 1715e9fcaa8aSmrg <entry>int</entry> 1716e9fcaa8aSmrg <entry>format</entry> 1717e9fcaa8aSmrg <entry>8</entry> 1718e9fcaa8aSmrg </row> 1719e9fcaa8aSmrg <row rowsep="0"> 1720e9fcaa8aSmrg <entry>char</entry> 1721e9fcaa8aSmrg <entry>data.b[20]</entry> 1722e9fcaa8aSmrg <entry>(read/write DATA : 20 byte)</entry> 1723e9fcaa8aSmrg </row> 1724e9fcaa8aSmrg </tbody> 1725e9fcaa8aSmrg </tgroup> 1726e9fcaa8aSmrg</table> 1727e9fcaa8aSmrg 1728e9fcaa8aSmrg 1729e9fcaa8aSmrg 1730e9fcaa8aSmrg 1731e9fcaa8aSmrg 1732e9fcaa8aSmrg<table frame="none" id="clientmessage_events_format_only_or_last_2"> 1733e9fcaa8aSmrg <title>The ClientMessage event's format (only or last)</title> 1734e9fcaa8aSmrg <tgroup cols="3"> 1735e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 1736e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1737e9fcaa8aSmrg <colspec colname="col3" colwidth="3.5*" colsep="0"/> 1738e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/> 1739e9fcaa8aSmrg <thead> 1740e9fcaa8aSmrg <row> 1741e9fcaa8aSmrg <entry align="left" spanname="span-horiz">Structure Member</entry> 1742e9fcaa8aSmrg <entry align="left">Contents</entry> 1743e9fcaa8aSmrg </row> 1744e9fcaa8aSmrg </thead> 1745e9fcaa8aSmrg <tbody> 1746e9fcaa8aSmrg <row rowsep="0"> 1747e9fcaa8aSmrg <entry>int</entry> 1748e9fcaa8aSmrg <entry>type</entry> 1749e9fcaa8aSmrg <entry>ClientMessage</entry> 1750e9fcaa8aSmrg </row> 1751e9fcaa8aSmrg <row rowsep="0"> 1752e9fcaa8aSmrg <entry>u_long</entry> 1753e9fcaa8aSmrg <entry>serial</entry> 1754e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1755e9fcaa8aSmrg </row> 1756e9fcaa8aSmrg <row rowsep="0"> 1757e9fcaa8aSmrg <entry>Bool</entry> 1758e9fcaa8aSmrg <entry>send_event</entry> 1759e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1760e9fcaa8aSmrg </row> 1761e9fcaa8aSmrg <row rowsep="0"> 1762e9fcaa8aSmrg <entry>Display</entry> 1763e9fcaa8aSmrg <entry>*display</entry> 1764e9fcaa8aSmrg <entry>The display to which connects</entry> 1765e9fcaa8aSmrg </row> 1766e9fcaa8aSmrg <row rowsep="0"> 1767e9fcaa8aSmrg <entry>Window</entry> 1768e9fcaa8aSmrg <entry>window</entry> 1769e9fcaa8aSmrg <entry>IMS Window ID</entry> 1770e9fcaa8aSmrg </row> 1771e9fcaa8aSmrg <row rowsep="0"> 1772e9fcaa8aSmrg <entry>Atom</entry> 1773e9fcaa8aSmrg <entry>message_type</entry> 1774e9fcaa8aSmrg <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry> 1775e9fcaa8aSmrg </row> 1776e9fcaa8aSmrg <row rowsep="0"> 1777e9fcaa8aSmrg <entry>int</entry> 1778e9fcaa8aSmrg <entry>format</entry> 1779e9fcaa8aSmrg <entry>8</entry> 1780e9fcaa8aSmrg </row> 1781e9fcaa8aSmrg <row rowsep="0"> 1782e9fcaa8aSmrg <entry>char</entry> 1783e9fcaa8aSmrg <entry>data.b[20]</entry> 1784e9fcaa8aSmrg <entry>(read/write DATA : MAX 20 byte) (*1)</entry> 1785e9fcaa8aSmrg </row> 1786e9fcaa8aSmrg </tbody> 1787e9fcaa8aSmrg </tgroup> 1788e9fcaa8aSmrg</table> 1789e9fcaa8aSmrg 1790e9fcaa8aSmrg<para> 1791e9fcaa8aSmrg(*1) If the data size is smaller than 20 bytes, all data other than available 1792e9fcaa8aSmrgdata must be 0. 1793e9fcaa8aSmrg</para> 1794e9fcaa8aSmrg 1795e9fcaa8aSmrg<para> 1796e9fcaa8aSmrg<emphasis role="bold">Property</emphasis> 1797e9fcaa8aSmrg</para> 1798e9fcaa8aSmrg 1799e9fcaa8aSmrg<para> 1800e9fcaa8aSmrgIn the case of large data, data will be sent via the Window Property 1801e9fcaa8aSmrgfor the efficiency. There are the following two methods to notify 1802e9fcaa8aSmrgProperty, and transport-version is decided which method is used. 1803e9fcaa8aSmrg</para> 1804e9fcaa8aSmrg 1805e9fcaa8aSmrg<itemizedlist> 1806e9fcaa8aSmrg <listitem> 1807e9fcaa8aSmrg <para> 1808e9fcaa8aSmrgThe XChangeProperty function is used to store data in the IMS 1809e9fcaa8aSmrgcommunication window, and Atom of the property is sent via the 1810e9fcaa8aSmrgClientMessage event. 1811e9fcaa8aSmrg </para> 1812e9fcaa8aSmrg </listitem> 1813e9fcaa8aSmrg <listitem> 1814e9fcaa8aSmrg <para> 1815e9fcaa8aSmrgThe XChangeProperty function is used to store data in the IMS 1816e9fcaa8aSmrgcommunication window, and Atom of the property is sent via 1817e9fcaa8aSmrgPropertyNotify event. 1818e9fcaa8aSmrg </para> 1819e9fcaa8aSmrg </listitem> 1820e9fcaa8aSmrg</itemizedlist> 1821e9fcaa8aSmrg 1822e9fcaa8aSmrg<para> 1823e9fcaa8aSmrgThe arguments of the XChangeProperty are as follows: 1824e9fcaa8aSmrg</para> 1825e9fcaa8aSmrg 1826e9fcaa8aSmrg<table frame="none" id="xchangeproperty_events_format_b"> 1827e9fcaa8aSmrg <title>The XChangeProperty event's format</title> 1828e9fcaa8aSmrg <tgroup cols="3"> 1829e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 1830e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1831e9fcaa8aSmrg <colspec colname="col3" colwidth="3.5*" colsep="0"/> 1832e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/> 1833e9fcaa8aSmrg <thead> 1834e9fcaa8aSmrg <row> 1835e9fcaa8aSmrg <entry align="left" spanname="span-horiz">Argument</entry> 1836e9fcaa8aSmrg <entry align="left">Contents</entry> 1837e9fcaa8aSmrg </row> 1838e9fcaa8aSmrg </thead> 1839e9fcaa8aSmrg <tbody> 1840e9fcaa8aSmrg <row rowsep="0"> 1841e9fcaa8aSmrg <entry>Display</entry> 1842e9fcaa8aSmrg <entry>*display</entry> 1843e9fcaa8aSmrg <entry>The display to which connects</entry> 1844e9fcaa8aSmrg </row> 1845e9fcaa8aSmrg <row rowsep="0"> 1846e9fcaa8aSmrg <entry>Window</entry> 1847e9fcaa8aSmrg <entry>window</entry> 1848e9fcaa8aSmrg <entry>IMS communication window ID</entry> 1849e9fcaa8aSmrg </row> 1850e9fcaa8aSmrg <row rowsep="0"> 1851e9fcaa8aSmrg <entry>Atom</entry> 1852e9fcaa8aSmrg <entry>property</entry> 1853e9fcaa8aSmrg <entry>read/write property Atom (*1)</entry> 1854e9fcaa8aSmrg </row> 1855e9fcaa8aSmrg <row rowsep="0"> 1856e9fcaa8aSmrg <entry>int</entry> 1857e9fcaa8aSmrg <entry>format</entry> 1858e9fcaa8aSmrg <entry>8</entry> 1859e9fcaa8aSmrg </row> 1860e9fcaa8aSmrg <row rowsep="0"> 1861e9fcaa8aSmrg <entry>int</entry> 1862e9fcaa8aSmrg <entry>mode</entry> 1863e9fcaa8aSmrg <entry>PropModeAppend</entry> 1864e9fcaa8aSmrg </row> 1865e9fcaa8aSmrg <row rowsep="0"> 1866e9fcaa8aSmrg <entry>u_char</entry> 1867e9fcaa8aSmrg <entry>*data</entry> 1868e9fcaa8aSmrg <entry>read/write DATA</entry> 1869e9fcaa8aSmrg </row> 1870e9fcaa8aSmrg <row rowsep="0"> 1871e9fcaa8aSmrg <entry>int</entry> 1872e9fcaa8aSmrg <entry>nelements</entry> 1873e9fcaa8aSmrg <entry>length of DATA</entry> 1874e9fcaa8aSmrg </row> 1875e9fcaa8aSmrg </tbody> 1876e9fcaa8aSmrg </tgroup> 1877e9fcaa8aSmrg</table> 1878e9fcaa8aSmrg 1879e9fcaa8aSmrg<para> 1880e9fcaa8aSmrg(*1) The read/write property ATOM allocates some strings, which are not 1881e9fcaa8aSmrgallocated by the client, by <function>XInternAtom</function>. 1882e9fcaa8aSmrg</para> 1883e9fcaa8aSmrg 1884e9fcaa8aSmrg<para> 1885e9fcaa8aSmrgThe IM Server changes the property with the mode of PropModeAppend and 1886e9fcaa8aSmrgthe client reads it with the delete mode, i.e. (delete = True). 1887e9fcaa8aSmrg</para> 1888e9fcaa8aSmrg 1889e9fcaa8aSmrg<para> 1890e9fcaa8aSmrgIf Atom is notified via ClientMessage event, the format of the ClientMessage 1891e9fcaa8aSmrgis as follows: 1892e9fcaa8aSmrg</para> 1893e9fcaa8aSmrg 1894e9fcaa8aSmrg<table frame="none" id="clientmessage_events_format_to_send_atom_of_property_2"> 1895e9fcaa8aSmrg <title>The ClientMessage event's format to send Atom of property</title> 1896e9fcaa8aSmrg <tgroup cols="3"> 1897e9fcaa8aSmrg <colspec colname="col1" colwidth="1*" colsep="0"/> 1898e9fcaa8aSmrg <colspec colname="col2" colwidth="1*" colsep="1"/> 1899e9fcaa8aSmrg <colspec colname="col3" colwidth="3.5*" colsep="0"/> 1900e9fcaa8aSmrg <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/> 1901e9fcaa8aSmrg <thead> 1902e9fcaa8aSmrg <row> 1903e9fcaa8aSmrg <entry align="left" spanname="span-horiz">Structure Member</entry> 1904e9fcaa8aSmrg <entry align="left">Contents</entry> 1905e9fcaa8aSmrg </row> 1906e9fcaa8aSmrg </thead> 1907e9fcaa8aSmrg <tbody> 1908e9fcaa8aSmrg <row rowsep="0"> 1909e9fcaa8aSmrg <entry>int</entry> 1910e9fcaa8aSmrg <entry>type</entry> 1911e9fcaa8aSmrg <entry>ClientMessage</entry> 1912e9fcaa8aSmrg </row> 1913e9fcaa8aSmrg <row rowsep="0"> 1914e9fcaa8aSmrg <entry>u_long</entry> 1915e9fcaa8aSmrg <entry>serial</entry> 1916e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1917e9fcaa8aSmrg </row> 1918e9fcaa8aSmrg <row rowsep="0"> 1919e9fcaa8aSmrg <entry>Bool</entry> 1920e9fcaa8aSmrg <entry>send_event</entry> 1921e9fcaa8aSmrg <entry>Set by the X Window System</entry> 1922e9fcaa8aSmrg </row> 1923e9fcaa8aSmrg <row rowsep="0"> 1924e9fcaa8aSmrg <entry>Display</entry> 1925e9fcaa8aSmrg <entry>*display</entry> 1926e9fcaa8aSmrg <entry>The display to which connects</entry> 1927e9fcaa8aSmrg </row> 1928e9fcaa8aSmrg <row rowsep="0"> 1929e9fcaa8aSmrg <entry>Window</entry> 1930e9fcaa8aSmrg <entry>window</entry> 1931e9fcaa8aSmrg <entry>IMS Window ID</entry> 1932e9fcaa8aSmrg </row> 1933e9fcaa8aSmrg <row rowsep="0"> 1934e9fcaa8aSmrg <entry>Atom</entry> 1935e9fcaa8aSmrg <entry>message_type</entry> 1936e9fcaa8aSmrg <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry> 1937e9fcaa8aSmrg </row> 1938e9fcaa8aSmrg <row rowsep="0"> 1939e9fcaa8aSmrg <entry>int</entry> 1940e9fcaa8aSmrg <entry>format</entry> 1941e9fcaa8aSmrg <entry>8</entry> 1942e9fcaa8aSmrg </row> 1943e9fcaa8aSmrg <row rowsep="0"> 1944e9fcaa8aSmrg <entry>long</entry> 1945e9fcaa8aSmrg <entry>data.1[0]</entry> 1946e9fcaa8aSmrg <entry>length of read/write property Atom</entry> 1947e9fcaa8aSmrg </row> 1948e9fcaa8aSmrg <row rowsep="0"> 1949e9fcaa8aSmrg <entry>long</entry> 1950e9fcaa8aSmrg <entry>data.1[1]</entry> 1951e9fcaa8aSmrg <entry>read/write property Atom</entry> 1952e9fcaa8aSmrg </row> 1953e9fcaa8aSmrg </tbody> 1954e9fcaa8aSmrg </tgroup> 1955e9fcaa8aSmrg</table> 1956e9fcaa8aSmrg 1957e9fcaa8aSmrg</sect4> 1958e9fcaa8aSmrg</sect3> 1959e9fcaa8aSmrg<sect3 id="Closing_Connection"> 1960e9fcaa8aSmrg<title>Closing Connection</title> 1961e9fcaa8aSmrg 1962e9fcaa8aSmrg<para> 1963e9fcaa8aSmrgIf the client disconnect with the IM Server, shutdown function should 1964e9fcaa8aSmrgfree the communication window properties and etc.. 1965e9fcaa8aSmrg</para> 1966e9fcaa8aSmrg 1967e9fcaa8aSmrg</sect3> 1968e9fcaa8aSmrg</sect2> 1969e9fcaa8aSmrg</sect1> 1970e9fcaa8aSmrg 1971e9fcaa8aSmrg<sect1 id="References"> 1972e9fcaa8aSmrg<title>References</title> 1973e9fcaa8aSmrg<para> 1974e9fcaa8aSmrg[1] Masahiko Narita and Hideki Hiura, <emphasis remap='I'>"The Input Method Protocol"</emphasis> 1975e9fcaa8aSmrg</para> 1976e9fcaa8aSmrg</sect1> 1977e9fcaa8aSmrg 1978e9fcaa8aSmrg</chapter> 1979e9fcaa8aSmrg</book> 1980