Version 3 protocol tentative design.
--------------------------------------------------------------------------------

Fundamental data types:

SYMBOL-ID
4 : CARD32 :  MSB  ----> LSB
              +----------+---------+-+-----------+
              | reserved | TYPEBIT |1|  IDBITS   |
              +----------+---------+-+-----------+
              |<--8bits->|<--8bit->| |<-15bits-->|
TYPEBITS : 0:RESERVED for ATTRIBID
           1:EIMIL, 2: operation,  3: variable(number),
           4: valriable(bool), 5: variable(char),
           6: variable(mtext), 7: variable(event),
	   0x13:property(number), 0x14:property(bool),
           0x15:property(char), 0x16:property(mtext),
           0x17:property(event)
IDBITS : ID

SYMBOL
4n : STRING            : symbol's canonical class & name
4m : SYMBOL-ID         :

DIFFERENTIAL
4  : SYMBOL-ID : type must be number, bool, event, char, or mtext.
4  : CARD32    : FLAG
                +----------------------------------+-+
                | RESERVED(31bits)                 |N|
                +----------------------------------+-+
                If N is 1, data is NIL.

If data is non-nil, and...

if data type is number
4  : INT32    : number (but the absolute value MUST NOT exceeds 2^23-1)

if data type is bool
4  : INT32    : 0 means false, 1 means true.

if data type is event
4n : CONTENTS :

if data type is char
4  : CARD32   : UTF-32 char

if data type is mtext
4  : INT32    : change-first
4  : INT32    : change-length
4n : TEXT     : replaced mtext

Replace mtext intervarl that is defined by change-first and change-length
with replaced-mtext.  All the properties that exists in the interval will
be stripped, but properties of the replaced mtext will be "ADDED".

SYNC_DATA
4 : 4n                  : byte length of differencials
4n: LISTofDIFFERENTIALS : 

TRANSACTION
4 : CARD32              : operation-id
4 : CARD32              : transaction-id

INPUT_METHOD_DESCRIPTOR
2 : ATTRIBID		input method identifier
2 : padding		Pad(2) = 2
4m: STRING		input method ID name.
4l: STRING		Human Readable Name
4 : 4n			byte length
4n: LISTofSTRING	supported language list
4k: STRING		reverse domain name

--------------------------------------------------------------------------------

ICATTRIBUTES.

IC_PREFERED_OBJECTS(04)  : LISTofOBJECTDESCRIPTOR
IC_SUPPORTED_CLASSES(05) : LISTofSYMBOL

--------------------------------------------------------------------------------

IM_PROTOCOL_VERSION (S->C)
2 : CARD16		input method ID
1 : CARD8		protocol version number
1 : padding		Pad(3) = 1

IM_ERROR (C<->S)
2  : CARD16		input method id
2  : CARD16		input context id
4  : CARD32		error code
                +----+--------+--------------------+
                |R(4)| CAT(8) |    STATUS(20bit)   |
                +----+--------+--------------------+
                R means "RESERVED".  CAT shows how the error
		is serious.
		00: informative
		01: warning
		02: critical (the request was canceled).
		03: fatal (it may break the communication).

		STATUS:
4n : STRING		error message
4k : STRING		error message (input locale specific)

IM_TRIGGER_NOTIFY_EVENT (C<->S):
2 : CARD16		input method id
2 : CARD16		input context id
2 : CARD16		flag
2 : CARD16              have contents (0 or 1)
4n: CONTENTS		trigger event

IM_TRIGGER_NOTIFY_EVENT (C<->S):
2 : CARD16		input method id
2 : CARD16		input context id
2 : CARD16		flag
2 : Padding		Pad(2) = 2
4n: CONTENTS		trigger event

IM_ISSUE_OPERATION (C<->S)
2  : CARD16       : input method id
2  : CARD16       : input context id
4  : 4n           : byte length of operation-id
4n : LISTofCARD32 : operation-id
4m : SYNC_DATA    : data for synchronization.

IM_ISSUE_OPERATION_REPLY (C<->S)
2  : CARD16            : input method id
2  : CARD16            : input context id
4  : 8n                : byte length of operation-result
8n : LISTofTRANSACTION : operation-result
4m : SYNC_DATA         : data for synchronization.

IM_GETSYMBOL            (C->S)
2  : CARD16            : input method id
2  : CARD16            : input context id
4  : 4n                : byte length of identifiers
4n : LISTofSTRING      : identifiers

IM_GETSYMBOL_REPLY      (C<-S)
2  : CARD16            : input method id
2  : CARD16            : input context id
4  : 4n                : byte length of symbols
4n : LISTofSYMBOL      : symbols

