Data Structures | |
struct | MInputDriver |
Structure of input method driver. More... | |
struct | MInputMethod |
Structure of input method. More... | |
struct | MInputContext |
Structure of input context. More... | |
Variables: Predefined symbols for callback commands. | |
These are the predefined symbols that are used as the COMMAND argument of callback functions of an input method driver (see MInputDriver::callback_list ).Most of them don't require extra argument nor return any value; exceptions are these: Minput_get_surrounding_text: When a callback function assigned for this command is called, the first element of MInputContext::plist has key Msymbol and the value specifies which portion of the surrounding text should be retrieved. If the value is positive, it specifies the number of characters following the current cursor position. If the value is negative, the absolute value specifies the number of characters preceding the current cursor position. The callback function must set the key of this element to Mtext and the value to the retrieved M-text (whose length may be shorter than the requested number of characters if the available text is not that long, or it may be longer if an application thinks it's more efficient to return that length).
Minput_delete_surrounding_text: When a callback function assigned for this command is called, the first element of MInputContext::plist has key Msymbol and the value specifies which portion of the surrounding text should be deleted in the same way as the case of Minput_get_surrounding_text. The callback function must delete the specified text. It should not alter MInputContext::plist. | |
MSymbol | Minput_preedit_start |
MSymbol | Minput_preedit_done |
MSymbol | Minput_preedit_draw |
MSymbol | Minput_status_start |
MSymbol | Minput_status_done |
MSymbol | Minput_status_draw |
MSymbol | Minput_candidates_start |
MSymbol | Minput_candidates_done |
MSymbol | Minput_candidates_draw |
MSymbol | Minput_set_spot |
MSymbol | Minput_toggle |
MSymbol | Minput_reset |
MSymbol | Minput_get_surrounding_text |
MSymbol | Minput_delete_surrounding_text |
Variables: Predefined symbols for special input events. | |
These are the predefined symbols that are used as the KEY argument of minput_filter(). | |
MSymbol | Minput_focus_out |
MSymbol | Minput_focus_in |
MSymbol | Minput_focus_move |
Typedefs | |
typedef MInputMethod | MInputMethod |
typedef MInputContext | MInputContext |
typedef void(* | MInputCallbackFunc )(MInputContext *ic, MSymbol command) |
Type of input method callback functions. | |
Enumerations | |
enum | MInputCandidatesChanged { MINPUT_CANDIDATES_LIST_CHANGED = 1, MINPUT_CANDIDATES_INDEX_CHANGED = 2, MINPUT_CANDIDATES_SHOW_CHANGED = 4, MINPUT_CANDIDATES_CHANGED_MAX } |
Bit-masks to specify how candidates of input method is changed. More... | |
Functions | |
MInputMethod * | minput_open_im (MSymbol language, MSymbol name, void *arg) |
Open an input method. | |
void | minput_close_im (MInputMethod *im) |
Close an input method. | |
MInputContext * | minput_create_ic (MInputMethod *im, void *arg) |
Create an input context. | |
void | minput_destroy_ic (MInputContext *ic) |
Destroy an input context. | |
int | minput_filter (MInputContext *ic, MSymbol key, void *arg) |
Filter an input key. | |
int | minput_lookup (MInputContext *ic, MSymbol key, void *arg, MText *mt) |
Look up a text produced in the input context. | |
void | minput_set_spot (MInputContext *ic, int x, int y, int ascent, int descent, int fontsize, MText *mt, int pos) |
Set the spot of the input context. | |
void | minput_toggle (MInputContext *ic) |
Toggle input method. | |
void | minput_reset_ic (MInputContext *ic) |
Reset an input context. | |
MText * | minput_get_description (MSymbol language, MSymbol name) |
Get description text of an input method. | |
MPlist * | minput_get_title_icon (MSymbol language, MSymbol name) |
Get title and icon filename of an input method. | |
MPlist * | minput_get_commands (MSymbol language, MSymbol name) |
Get information about input method commands. | |
int | minput_assign_command_keys (MSymbol language, MSymbol name, MSymbol command, MPlist *keyseq) |
Assign a key sequence to an input method command. | |
MPlist * | minput_get_variables (MSymbol language, MSymbol name) |
Get a list of variables of an input method. | |
int | minput_set_variable (MSymbol language, MSymbol name, MSymbol variable, void *value) |
Set the initial value of an input method variable. | |
Variables | |
MInputDriver | minput_default_driver |
The default driver for internal input methods. | |
MSymbol | Minput_driver |
MInputDriver * | minput_driver |
The driver for internal input methods. | |
MSymbol | Minput_preedit_start |
MSymbol | Minput_preedit_draw |
MSymbol | Minput_preedit_done |
MSymbol | Minput_status_start |
MSymbol | Minput_status_draw |
MSymbol | Minput_status_done |
MSymbol | Minput_candidates_start |
MSymbol | Minput_candidates_draw |
MSymbol | Minput_candidates_done |
MSymbol | Minput_set_spot |
MSymbol | Minput_toggle |
MSymbol | Minput_reset |
MSymbol | Minput_get_surrounding_text |
MSymbol | Minput_delete_surrounding_text |
MSymbol | Minput_focus_move |
MSymbol | Minput_focus_in |
MSymbol | Minput_focus_out |
MInputDriver | minput_default_driver |
The default driver for internal input methods. | |
MInputDriver * | minput_driver |
The driver for internal input methods. | |
MSymbol | Minput_driver |
An internal input method has non Mnil
LANGUAGE, and its body is defined in the m17n database by the tag <Minput_method, LANGUAGE, NAME>. For this kind of input methods, the m17n library uses two predefined input method drivers, one for CUI use and the other for GUI use. Those drivers utilize the input processing engine provided by the m17n library itself. The m17n database may provide input methods that are not limited to a specific language. The database uses Mt
as LANGUAGE of those input methods.
An internal input method accepts an input key which is a symbol associated with an input event. As there is no way for the m17n
library
to know how input events are represented in an application program, an application programmer has to convert an input event to an input key by himself. See the documentation of the function minput_event_to_key() for the detail.
A foreign input method has Mnil
LANGUAGE, and its body is defined in an external resource (e.g. XIM of X Window System). For this kind of input methods, the symbol NAME must have a property of key Minput_driver
, and the value must be a pointer to an input method driver. Therefore, by preparing a proper driver, any kind of input method can be treated in the framework of the m17n
library
.
For convenience, the m17n-X library provides an input method driver that enables the input style of OverTheSpot for XIM, and stores Minput_driver
property of the symbol Mxim
with a pointer to the driver. See the documentation of m17n GUI API for the detail.
PROCESSING FLOW
The typical processing flow of handling an input method is:
|
|
|
|