#include <unihan_im.h>
Data Fields | |
| int(* | send_buffer )(UnihanIM *uim, void *buf, size_t buf_size) |
| int(* | config_get )(UnihanIM *uim, char *key, char **value, long *len) |
| Get per-user configuration data. | |
| int(* | config_set )(UnihanIM *uim, char *key, char *value, long len) |
| Set per-user configuration data. | |
| int(* | preedit_draw )(UnihanIM *uim, char *s, UnihanStyleList *styles) |
| Draws preedit text in IM client's window. | |
| int(* | preedit_caret_pos )(UnihanIM *uim, int caretPos) |
| Sets the preedit string's caret (cursor) position. | |
| int(* | preedit_change )(UnihanIM *uim, char *s, UnihanStyleList *styles, int pos, int len, int caretPos) |
| Changes the existing preedit string. | |
| int(* | preedit_erase )(UnihanIM *uim) |
| Clears the preedit text. | |
| int(* | lookup_start )(UnihanIM *uim, UnihanLookupStart *lustart) |
| Specifies the details of the candidate lookup choice window. | |
| int(* | lookup_draw )(UnihanIM *uim, UnihanLookupDraw *ludraw) |
| Draws the candidate lookup choice window. | |
| int(* | lookup_done )(UnihanIM *uim) |
| Closes the candidate lookup choice window. | |
| int(* | status_draw )(UnihanIM *uim, char *s, UnihanStyleList *styles) |
| Shows a string in the status window. | |
| int(* | commit_string )(UnihanIM *uim, char *s) |
| Commits a string to the IM client. | |
| int(* | locale_get )(UnihanIM *uim, char **locale) |
| Gets the locale of the current user. | |
| int(* | tcsc_mode_get )(UnihanIM *uim, UnihanTCSCMode *tcscMode) |
| Gets the current traditional/simplified mode. | |
| int(* | tcsc_do_conv )(UnihanIM *uim, UnihanTCSCMode tcscMode, char *orig, char **converted) |
| Performs traditional/simplified conversion. | |
| int(* | mem_alloc )(UnihanIM *uim, size_t len, void **mem) |
| Allocates temporary memory. | |
| int(* | client_info_get )(UnihanIM *uim, UnihanClientInfoType type, char **info) |
| int(* | is_fullwidth )(UnihanIM *uim) |
| Checks current fullwidth/halfwidth mode. | |
| int(* | is_chinesepunc )(UnihanIM *uim) |
| Checks current Chinese/English punctuation mode. | |
| int(* | is_shuangpin )(UnihanIM *uim) |
| Checks current Shuangpin mode. | |
| int(* | beep )(UnihanIM *uim) |
| Makes the IM client beep. | |
| int(* | match_phrase )(UnihanIM *uim, char *s) |
| Begins phrase matching mode. | |
| void(* | log )(UnihanIM *uim, UnihanLogLevelFlags log_level, const char *format,...) |
| Logs debug information. | |
| int(* _UnihanMethods::send_buffer)(UnihanIM *uim, void *buf, size_t buf_size) |
| int(* _UnihanMethods::config_get)(UnihanIM *uim, char *key, char **value, long *len) |
Get per-user configuration data.
| uim | UnihanIM context | |
| key | key of config data to get | |
| value | pointer to a buffer for receiving the config data. The caller must not free or modify the buffer. | |
| len | pointer to a long for receiving the length of config data |
| int(* _UnihanMethods::config_set)(UnihanIM *uim, char *key, char *value, long len) |
Set per-user configuration data.
| uim | UnihanIM context | |
| key | key of config data to get | |
| value | the config data | |
| len | the length of config data |
| int(* _UnihanMethods::preedit_draw)(UnihanIM *uim, char *s, UnihanStyleList *styles) |
Draws preedit text in IM client's window.
| uim | UnihanIM context | |
| s | the preedit string | |
| styles | an array of UnihanStyleList. The length must be the same as s, eg. if s has 3 characters, styles must also have 3 elements. |
| int(* _UnihanMethods::preedit_caret_pos)(UnihanIM *uim, int caretPos) |
Sets the preedit string's caret (cursor) position.
| uim | UnihanIM context | |
| caretPos | position of the caret, 0 = on the left of first character |
| int(* _UnihanMethods::preedit_change)(UnihanIM *uim, char *s, UnihanStyleList *styles, int pos, int len, int caretPos) |
Changes the existing preedit string.
| uim | UnihanIM context | |
| s | the new preedit string. If NULL, the preedit text between pos and pos + len will be deleted. | |
| styles | an array of UnihanStyleList; same convention as preedit_draw() | |
| pos | the start index of the preedit text to change | |
| len | the length of the text to change. If 0, s is inserted into the preedit text string. |
| int(* _UnihanMethods::preedit_erase)(UnihanIM *uim) |
Clears the preedit text.
| uim | UnihanIM context |
| int(* _UnihanMethods::lookup_start)(UnihanIM *uim, UnihanLookupStart *lustart) |
Specifies the details of the candidate lookup choice window.
| uim | UnihanIM context | |
| lustart | details of the lookup choice window such as height, width, title, etc. |
| int(* _UnihanMethods::lookup_draw)(UnihanIM *uim, UnihanLookupDraw *ludraw) |
Draws the candidate lookup choice window.
lookup_start() must be called first.
| uim | UnihanIM context | |
| ludraw | candidates to draw in the window |
| int(* _UnihanMethods::lookup_done)(UnihanIM *uim) |
Closes the candidate lookup choice window.
| uim | UnihanIM context |
| int(* _UnihanMethods::status_draw)(UnihanIM *uim, char *s, UnihanStyleList *styles) |
Shows a string in the status window.
| uim | UnihanIM context | |
| s | string to show in status window, NULL to clear the window | |
| styles | (currently unused) |
| int(* _UnihanMethods::commit_string)(UnihanIM *uim, char *s) |
Commits a string to the IM client.
| uim | UnihanIM context | |
| s | the string to commit |
| int(* _UnihanMethods::locale_get)(UnihanIM *uim, char **locale) |
Gets the locale of the current user.
| uim | UnihanIM context | |
| locale | pointer to a string to receive the locale, eg. zh_CN, zh_HK, zh_TW. The caller must not free or modify the returned string. |
| int(* _UnihanMethods::tcsc_mode_get)(UnihanIM *uim, UnihanTCSCMode *tcscMode) |
Gets the current traditional/simplified mode.
| uim | UnihanIM context | |
| tcscMode | a pointer to a buffer to receive the current TC/SC mode |
| int(* _UnihanMethods::tcsc_do_conv)(UnihanIM *uim, UnihanTCSCMode tcscMode, char *orig, char **converted) |
Performs traditional/simplified conversion.
| uim | UnihanIM context | |
| tcscMode | the kind of conversion to perform | |
| orig | the string to be converted | |
| converted | the converted string, newly allocated |
| int(* _UnihanMethods::mem_alloc)(UnihanIM *uim, size_t len, void **mem) |
Allocates temporary memory.
The allocated memory will be freed by Unihan after the current event handler callback returns.
| uim | UnihanIM context | |
| len | size of memory to allocate | |
| mem | pointer to a void* to hold the newly allocated memory |
| int(* _UnihanMethods::client_info_get)(UnihanIM *uim, UnihanClientInfoType type, char **info) |
| uim | UnihanIM context |
| int(* _UnihanMethods::is_fullwidth)(UnihanIM *uim) |
Checks current fullwidth/halfwidth mode.
| uim | UnihanIM context |
| int(* _UnihanMethods::is_chinesepunc)(UnihanIM *uim) |
Checks current Chinese/English punctuation mode.
| uim | UnihanIM context |
| int(* _UnihanMethods::is_shuangpin)(UnihanIM *uim) |
Checks current Shuangpin mode.
| uim | UnihanIM context |
| int(* _UnihanMethods::beep)(UnihanIM *uim) |
Makes the IM client beep.
| uim | UnihanIM context |
| int(* _UnihanMethods::match_phrase)(UnihanIM *uim, char *s) |
Begins phrase matching mode.
| uim | UnihanIM context | |
| s | key to match for phrases |
| void(* _UnihanMethods::log)(UnihanIM *uim, UnihanLogLevelFlags log_level, const char *format,...) |
Logs debug information.
| uim | UnihanIM context |
1.5.2