IBus Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Signals |
struct IBusInputContext; struct IBusInputContextClass; IBusInputContext * ibus_input_context_new (const gchar *path
,GDBusConnection *connection
,GCancellable *cancellable
,GError **error
); void ibus_input_context_new_async (const gchar *path
,GDBusConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); IBusInputContext * ibus_input_context_new_async_finish (GAsyncResult *res
,GError **error
); IBusInputContext * ibus_input_context_get_input_context (const gchar *path
,GDBusConnection *connection
); void ibus_input_context_get_input_context_async (const gchar *path
,GDBusConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); IBusInputContext * ibus_input_context_get_input_context_async_finish (GAsyncResult *res
,GError **error
); void ibus_input_context_process_hand_writing_event (IBusInputContext *context
,const gdouble *coordinates
,guint coordinates_len
); void ibus_input_context_cancel_hand_writing (IBusInputContext *context
,guint n_strokes
); void ibus_input_context_process_key_event_async (IBusInputContext *context
,guint32 keyval
,guint32 keycode
,guint32 state
,gint timeout_msec
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean ibus_input_context_process_key_event_async_finish (IBusInputContext *context
,GAsyncResult *res
,GError **error
); gboolean ibus_input_context_process_key_event (IBusInputContext *context
,guint32 keyval
,guint32 keycode
,guint32 state
); void ibus_input_context_set_cursor_location (IBusInputContext *context
,gint32 x
,gint32 y
,gint32 w
,gint32 h
); void ibus_input_context_set_capabilities (IBusInputContext *context
,guint32 capabilities
); void ibus_input_context_property_activate (IBusInputContext *context
,const gchar *prop_name
,guint32 state
); void ibus_input_context_focus_in (IBusInputContext *context
); void ibus_input_context_focus_out (IBusInputContext *context
); void ibus_input_context_reset (IBusInputContext *context
); void ibus_input_context_get_engine_async (IBusInputContext *context
,gint timeout_msec
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); IBusEngineDesc * ibus_input_context_get_engine_async_finish (IBusInputContext *context
,GAsyncResult *res
,GError **error
); IBusEngineDesc * ibus_input_context_get_engine (IBusInputContext *context
); void ibus_input_context_set_engine (IBusInputContext *context
,const gchar *name
); void ibus_input_context_set_surrounding_text (IBusInputContext *context
,IBusText *text
,guint32 cursor_pos
,guint32 anchor_pos
); gboolean ibus_input_context_needs_surrounding_text (IBusInputContext *context
); void ibus_input_context_set_content_type (IBusInputContext *context
,guint purpose
,guint hints
);
"commit-text" :Run Last
"cursor-down-lookup-table" :Run Last
"cursor-up-lookup-table" :Run Last
"delete-surrounding-text" :Run Last
"disabled" :Run Last
"enabled" :Run Last
"forward-key-event" :Run Last
"hide-auxiliary-text" :Run Last
"hide-lookup-table" :Run Last
"hide-preedit-text" :Run Last
"page-down-lookup-table" :Run Last
"page-up-lookup-table" :Run Last
"register-properties" :Run Last
"show-auxiliary-text" :Run Last
"show-lookup-table" :Run Last
"show-preedit-text" :Run Last
"update-auxiliary-text" :Run Last
"update-lookup-table" :Run Last
"update-preedit-text" :Run Last
"update-property" :Run Last
An IBusInputContext is a proxy object of BusInputContext, which manages the context for input methods that supports text input in various natural languages.
Clients call the IBusInputContext to invoke BusInputContext, through which invokes IBusEngine.
struct IBusInputContext;
An opaque data type representing an IBusInputContext.
IBusInputContext * ibus_input_context_new (const gchar *path
,GDBusConnection *connection
,GCancellable *cancellable
,GError **error
);
New an IBusInputContext.
|
The path to the object that emitting the signal. |
|
An GDBusConnection. |
|
A GCancellable or NULL . |
|
Return location for error or NULL . |
Returns : |
A newly allocated IBusInputContext. |
void ibus_input_context_new_async (const gchar *path
,GDBusConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
New an IBusInputContext asynchronously.
|
The path to the object that emitting the signal. |
|
An GDBusConnection. |
|
A GCancellable or NULL . |
|
A GAsyncReadyCallback to call when the request is satisfied.
The callback should not be NULL . |
|
The data to pass to callback. |
IBusInputContext * ibus_input_context_new_async_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with ibus_input_context_new_async()
.
|
A GAsyncResult obtained from the GAsyncReadyCallback pass to
ibus_input_context_new_async() . |
|
Return location for error or NULL . |
Returns : |
A newly allocated IBusInputContext. |
IBusInputContext * ibus_input_context_get_input_context (const gchar *path
,GDBusConnection *connection
);
Gets an existing IBusInputContext.
|
The path to the object that emitting the signal. |
|
An GDBusConnection. |
Returns : |
An existing IBusInputContext. [transfer none] |
void ibus_input_context_get_input_context_async (const gchar *path
,GDBusConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Get an existing IBusInputContext asynchronously.
|
The path to the object that emitting the signal. |
|
An GDBusConnection. |
|
A GCancellable or NULL . |
|
A GAsyncReadyCallback to call when the request is satisfied.
The callback should not be NULL . |
|
The data to pass to callback. |
IBusInputContext * ibus_input_context_get_input_context_async_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with ibus_input_contex_get_input_context_async()
.
|
A GAsyncResult obtained from the GAsyncReadyCallback pass to
ibus_input_context_get_input_context_async() . |
|
Return location for error or NULL . |
Returns : |
An existing IBusInputContext. [transfer none] |
void ibus_input_context_process_hand_writing_event (IBusInputContext *context
,const gdouble *coordinates
,guint coordinates_len
);
Pass a handwriting stroke to an input method engine.
In this API, a coordinate (0.0, 0.0) represents the top-left corner of an area for handwriting, and (1.0, 1.0) does the bottom-right. Therefore, for example, if a user writes a character 'L', the array would be something like [0.0, 0.0, 0.0, 1.0, 1.0, 1.0] and coordinates_len would be 6.
The function is usually called when a user releases the mouse button in a hand writing area.
see_also: "process-hand-writing-event"
|
An IBusInputContext. |
|
An array of gdouble (0.0 to 1.0) which represents a stroke (i.e. [x1, y1, x2, y2, x3, y3, ...]). |
|
The number of elements in the array. The number should be even and >= 4. |
void ibus_input_context_cancel_hand_writing (IBusInputContext *context
,guint n_strokes
);
Clear handwriting stroke(s) in the current input method engine.
see_also: "cancel-hand-writing"
|
An IBusInputContext. |
|
The number of strokes to be removed. Pass 0 to remove all. |
void ibus_input_context_process_key_event_async (IBusInputContext *context
,guint32 keyval
,guint32 keycode
,guint32 state
,gint timeout_msec
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Pass the key event to input method engine.
Key symbols are characters/symbols produced by key press, for example, pressing "s" generates key symbol "s"; pressing shift-"s" generates key symbol "S". Same key on keyboard may produce different key symbols on different keyboard layout. e.g., "s" key on QWERTY keyboard produces "o" in DVORAK layout.
Unlike key symbol, keycode is only determined by the location of the key, and irrelevant of the keyboard layout.
Briefly speaking, input methods that expect certain keyboard layout should use keycode; otherwise keyval is sufficient. For example, Chewing, Cangjie, Wubi expect an en-US QWERTY keyboard, these should use keycode; while pinyin can rely on keyval only, as it is less sensitive to the keyboard layout change, DVORAK users can still use DVORAK layout to input pinyin.
Use ibus_keymap_lookup_keysym()
to convert keycode to keysym in given keyboard layout.
see_also: "process-key-event"
|
An IBusInputContext. |
|
Key symbol of a key event. |
|
Keycode of a key event. |
|
Key modifier flags. |
|
The timeout in milliseconds or -1 to use the default timeout. |
|
A GCancellable or NULL. |
|
A GAsyncReadyCallback to call when the request is satisfied or NULL if you don't care about the result of the method invocation. |
|
The data to pass to callback. |
gboolean ibus_input_context_process_key_event_async_finish (IBusInputContext *context
,GAsyncResult *res
,GError **error
);
Finishes an operation started with ibus_input_context_process_key_event_async()
.
|
An IBusInputContext. |
|
A GAsyncResult obtained from the GAsyncReadyCallback passed to
ibus_input_context_process_key_event_async() . |
|
Return location for error or NULL. |
Returns : |
TRUE if the key event is processed;
FALSE otherwise or some errors happen and the error will be set. |
gboolean ibus_input_context_process_key_event (IBusInputContext *context
,guint32 keyval
,guint32 keycode
,guint32 state
);
Pass the key event to input method engine and wait for the reply from ibus (i.e. synchronous IPC).
See also: ibus_input_context_process_key_event_async()
|
An IBusInputContext. |
|
Key symbol of a key event. |
|
Keycode of a key event. |
|
Key modifier flags. |
Returns : |
TRUE for successfully process the key; FALSE otherwise. |
void ibus_input_context_set_cursor_location (IBusInputContext *context
,gint32 x
,gint32 y
,gint32 w
,gint32 h
);
Set the cursor location of IBus input context asynchronously.
see_also: "set-cursor-location"
|
An IBusInputContext. |
|
X coordinate of the cursor. |
|
Y coordinate of the cursor. |
|
Width of the cursor. |
|
Height of the cursor. |
void ibus_input_context_set_capabilities (IBusInputContext *context
,guint32 capabilities
);
Set the capabilities flags of client application asynchronously. When IBUS_CAP_FOCUS is not set, IBUS_CAP_PREEDIT_TEXT, IBUS_CAP_AUXILIARY_TEXT, IBUS_CAP_LOOKUP_TABLE, and IBUS_CAP_PROPERTY have to be all set. The panel component does nothing for an application that doesn't support focus.
see_also: "set-capabilities"
|
An IBusInputContext. |
|
Capabilities flags of IBusEngine, see IBusCapabilite |
void ibus_input_context_property_activate (IBusInputContext *context
,const gchar *prop_name
,guint32 state
);
Activate the property asynchronously.
See also: "property_activate"
|
An IBusInputContext. |
|
A property name (e.g. "InputMode.WideLatin") |
|
A status of the property (e.g. PROP_STATE_CHECKED) |
void ibus_input_context_focus_in (IBusInputContext *context
);
Invoked when the client application get focus. An asynchronous IPC will be performed.
see_also: "focus_in".
|
An IBusInputContext. |
void ibus_input_context_focus_out (IBusInputContext *context
);
Invoked when the client application get focus. An asynchronous IPC will be performed.
see_also: "focus_out".
|
An IBusInputContext. |
void ibus_input_context_reset (IBusInputContext *context
);
Invoked when the IME is reset. An asynchronous IPC will be performed.
see_also: "reset"
|
An IBusInputContext. |
void ibus_input_context_get_engine_async (IBusInputContext *context
,gint timeout_msec
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
An asynchronous IPC will be performed.
|
An IBusInputContext. |
|
The timeout in milliseconds or -1 to use the default timeout. |
|
A GCancellable or NULL . |
|
A GAsyncReadyCallback to call when the request is satisfied or NULL
if you don't care about the result of the method invocation. |
|
The data to pass to callback. |
IBusEngineDesc * ibus_input_context_get_engine_async_finish (IBusInputContext *context
,GAsyncResult *res
,GError **error
);
Finishes an operation started with ibus_input_context_get_engine_async()
.
|
An IBusInputContext. |
|
A GAsyncResult obtained from the GAsyncReadyCallback passed to
ibus_input_context_get_engine_async() . |
|
Return location for error or NULL . |
Returns : |
An IME engine description for the context, or NULL . [transfer none]
|
IBusEngineDesc * ibus_input_context_get_engine (IBusInputContext *context
);
Returns an IME engine description for the context. A synchronous IPC will be performed.
|
An IBusInputContext. |
Returns : |
An IME engine description for the context, or NULL. [transfer none] |
void ibus_input_context_set_engine (IBusInputContext *context
,const gchar *name
);
Invoked when the IME engine is changed. An asynchronous IPC will be performed.
|
An IBusInputContext. |
|
A name of the engine. |
void ibus_input_context_set_surrounding_text (IBusInputContext *context
,IBusText *text
,guint32 cursor_pos
,guint32 anchor_pos
);
|
An IBusInputContext. |
|
An IBusText surrounding the current cursor on the application. |
|
Current cursor position in characters in text . |
|
Anchor position of selection in text . |
gboolean ibus_input_context_needs_surrounding_text
(IBusInputContext *context
);
Check whether the current engine requires surrounding-text.
|
An IBusInputContext. |
Returns : |
TRUE if surrounding-text is needed by the current engine;
FALSE otherwise. |
void ibus_input_context_set_content_type (IBusInputContext *context
,guint purpose
,guint hints
);
Set content-type (primary purpose and hints) of the context. This
information is particularly useful to implement intelligent
behavior in engines, such as automatic input-mode switch and text
prediction. For example, to restrict input to numbers, the client
can call this function with purpose
set to
IBUS_INPUT_PURPOSE_NUMBER.
See also: "set-content-type"
|
An IBusInputContext. |
|
Primary purpose of the input context, as an IBusInputPurpose. |
|
Hints that augment purpose , as an IBusInputHints. |
"commit-text"
signalvoid user_function (IBusInputContext *context,
IBusText *text,
gpointer user_data) : Run Last
Emitted when the text is going to be committed.
(Note: The text object is floating, and it will be released after the signal.
If singal handler want to keep the object, the handler should use g_object_ref_sink()
to get the ownership of the object.)
|
An IBusInputContext. |
|
Text to be committed. |
|
user data set when the signal handler was connected. |
"cursor-down-lookup-table"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted to select next candidate of lookup table.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"cursor-up-lookup-table"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted to select previous candidate of lookup table.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"delete-surrounding-text"
signalvoid user_function (IBusInputContext *context,
gint offset,
guint n_chars,
gpointer user_data) : Run Last
Emitted to delete surrounding text event from IME to client of IME.
|
An IBusInputContext. |
|
the character offset from the cursor position of the text to be deleted. A negative value indicates a position before the cursor. |
|
the number of characters to be deleted. |
|
user data set when the signal handler was connected. |
"disabled"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted when an IME is disabled.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"enabled"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted when an IME is enabled.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"forward-key-event"
signalvoid user_function (IBusInputContext *context,
guint keyval,
guint keycode,
guint modifiers,
gpointer user_data) : Run Last
Emitted to forward key event from IME to client of IME.
|
An IBusInputContext. |
|
Key symbol of the keyboard event. |
|
Key symbol of the keyboard event. |
|
Key modifier flags. |
|
user data set when the signal handler was connected. |
"hide-auxiliary-text"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted to hide auxiliary text.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"hide-lookup-table"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted to hide lookup table.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"hide-preedit-text"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted to hide preedit text.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"page-down-lookup-table"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted to view the next page of lookup table.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"page-up-lookup-table"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted to view the previous page of lookup table.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"register-properties"
signalvoid user_function (IBusInputContext *context,
IBusPropList *props,
gpointer user_data) : Run Last
Emitted to register the properties in props
.
(Note: The props object is floating, and it will be released after the signal.
If singal handler want to keep the object, the handler should use g_object_ref_sink()
to get the ownership of the object.)
|
An IBusInputContext. |
|
An IBusPropList that contains properties. |
|
user data set when the signal handler was connected. |
"show-auxiliary-text"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted to show auxiliary text.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"show-lookup-table"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted to show lookup table.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"show-preedit-text"
signalvoid user_function (IBusInputContext *context,
gpointer user_data) : Run Last
Emitted to show preedit text.
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"update-auxiliary-text"
signalvoid user_function (IBusInputContext *context,
IBusText *arg1,
gboolean arg2,
gpointer user_data) : Run Last
Emitted to hide auxilary text.
(Note: The text object is floating, and it will be released after the signal.
If singal handler want to keep the object, the handler should use g_object_ref_sink()
to get the ownership of the object.)
|
An IBusInputContext. |
|
user data set when the signal handler was connected. |
"update-lookup-table"
signalvoid user_function (IBusInputContext *context,
IBusLookupTable *table,
gboolean visible,
gpointer user_data) : Run Last
Emitted to update lookup table.
(Note: The table object is floating, and it will be released after the signal.
If singal handler want to keep the object, the handler should use g_object_ref_sink()
to get the ownership of the object.)
|
An IBusInputContext. |
|
An IBusLookupTable to be updated. |
|
Whether the table should be visible. |
|
user data set when the signal handler was connected. |
"update-preedit-text"
signalvoid user_function (IBusInputContext *context,
IBusText *text,
guint cursor_pos,
gboolean visible,
gpointer user_data) : Run Last
Emitted to update preedit text.
(Note: The text object is floating, and it will be released after the signal.
If singal handler want to keep the object, the handler should use g_object_ref_sink()
to get the ownership of the object.)
|
An IBusInputContext. |
|
Text to be updated. |
|
Cursor position. |
|
Whether the update is visible. |
|
user data set when the signal handler was connected. |
"update-property"
signalvoid user_function (IBusInputContext *context,
IBusProperty *prop,
gpointer user_data) : Run Last
Emitted to update the property prop
.
(Note: The prop object is floating, and it will be released after the signal.
If singal handler want to keep the object, the handler should use g_object_ref_sink()
to get the ownership of the object.)
|
An IBusInputContext. |
|
The IBusProperty to be updated. |
|
user data set when the signal handler was connected. |