COMPOSITIONSTR


typedef struct tagCOMPOSITIONSTR {
  DWORD  dwSize;
  DWORD  dwCompReadAttrLen;
  DWORD  dwCompReadAttrOffset;
  DWORD  dwCompReadClsLen;
  DWORD  dwCompReadClsOffset;
  DWORD  dwCompReadStrLen;
  DWORD  dwCompReadStrOffset;
  DWORD  dwCompAttrLen;
  DWORD  dwCompAttrOffset;
  DWORD  dwCompClsLen;
  DWORD  dwCompClsOffset;
  DWORD  dwCompStrLen;
  DWORD  dwCompStrOffset;
  DWORD  dwCursorPos;
  DWORD  dwDeltaStart;
  DWORD  dwResultReadClsLen;
  DWORD  dwResultReadClsOffset;
  DWORD  dwResultReadStrLen;
  DWORD  dwResultReadStrOffset;
  DWORD  dwResultClsLen;
  DWORD  dwResultClsOffset;
  DWORD  dwResultStrLen;
  DWORD  dwResultStrOffset;
  DWORD  dwPrivateSize;
  DWORD  dwPrivateOffset; 
} COMPOSITIONSTR;

Contains composition information. During conversion, IME puts conversion information into this structure.

dwSize

Size, in bytes, of this structure.

dwCompReadAttrLen

Length of the attribute information of the reading string of the composition string.

dwCompReadAttrOffset

Offset from the beginning of this structure to the attribute information.

dwCompReadClsLen

Length of the clause information of the reading string of the composition.

dwCompReadClsOffset

Offset from the beginning of this structure to the clause information.

dwCompReadStrLen

Length of the reading string of the composition string.

dwCompReadStrOffset

Offset from the beginning of this structure to the reading string of the composition string.

dwCompAttrLen

Length of the attribute information of the composition string.

dwCompAttrOffset

Offset from the beginning of this structure to the attribute information.

dwCompClsLen

Length of the clause information of the composition string.

dwCompClsOffset

Offset from the beginning of this structure to the clause information.

dwCompStrLen

Length of the composition string.

dwCompStrOffset

Offset from the beginning of this structure to the composition string.

dwCursorPos

Cursor position in the composition string.

dwDeltaStart

Start position of change in the composition string. If the composition string has changed from the previous state, the first position of such a change is stored here.

dwResultReadClsLen

Length of the clause information of the reading string of the result string.

dwResultReadClsOffset

Offset from the beginning of this structure to the clause information of the reading string of the result string..

dwResultReadStrLen

Length of the reading string of the result string.

dwResultReadStrOffset

Offset from the beginning of this structure to the reading string of the result string.

dwResultClsLen

Length of the clause information of the result string.

dwResultClsOffset

Offset from the beginning of this structure to the clause information of the result string.

dwResultStrLen

Length of the result string.

dwResultStrOffset

Offset from the beginning of this structure to the result string.

dwPrivateSize

Private area in this memory block.

dwPrivateOffset

Offset from the beginning of this structure to the private area.

The attribute information is a single-byte array and specifies the attributes of the string. The contents of the array are as follows:

Value

Meaning

ATTR_xxxxxxxxxxxx

Specifies the status of composition string.

ATTR_INPUT

Character currently being entered.

ATTR_TARGET_CONVERTED

Character currently being converted (already converted).

ATTR_CONVERTED

Character given from conversion.

ATTR_TARGET_NOTCONVERTED

Character currently being converted (yet to be converted).

ATTR_INPUT_ERROR

The character is error character and can not be converted by IME.

Other than above:

Reserved


Each content is as follows:

Value

Meaning

Character currently being entered:

The character the user is entering. In Japanese, this character is a hiragana, katakana, or alphanumeric, which is yet to be converted by the IME.

Character currently being converted (already converted):

The character that has been selected for conversion by the user and converted by the IME.

Character given from conversion:

The character to which the IME has converted.

Character currently being converted (yet to be converted):

The character that has been selected for conversion by the user and not yet converted by the IME. In Japanese, this character is a hiragana, katakana, or alphanumeric, which the user has entered.

Character is error character and can not be converted by IME:

The character is an error character, the IME can not convert this character. For example, some consonants can not put together.


The length of the attribute information is the same as the length of the string. Each byte corresponds to each byte of the string. Even if the string includes DBCS characters, the attribute information has the information bytes of both the lead byte and the second byte.

The clause information is a double word array and specifies the numbers that are the positions of the clause. The position of the clause is one of the positions of the composition string and this clause starts from this position. At a minimum, the length of this information is two double words. This means the length of the clause information is 8 bytes. The first double word has to be 0. This is the starting position of the first clause. The last double word has to be the length of this string. For example, if the string has three clauses, the clause information has four double words. The first double word is 0. The second double word specifies the starting position of the second clause. The third double word specifies the starting position of the third clause. The last double word is the length of this string.

The dwCursorPos member specifies the character in the composition string where the cursor is located, in terms of the count of that character. The counting starts at 0. If the cursor is to be positioned immediately after the composition string, this value is equal to the length of the composition string. In case there is no cursor (if such a condition exists), a value -1 is specified here. If a composition string does not exist, this member is invalid.