Struct xcb_imdkit::ImeClient[][src]

pub struct ImeClient { /* fields omitted */ }
Expand description

Input Method Editor (IME) client.

ImeClient represents one instance of an Input Method Editor client. It provides callbacks for event handling as well as control over the position of the IME window. There should be only one IME client per application and it is advised to create at most one instance.

Implementations

Set the global logger for xcb-imdkit.

The callback will receive debug messages from the C library this crate is wrapping.

Create a new ImeClient.

The first two arguments correspond to the result of xcb::Connection::connect with the connection wrapped into an Arc to ensure that the Ime does not outlive its connection. For documentation on input_style refer to InputStyle. im_name can be used to specify a custom IME server to connect to using the syntax @im=custom_server.

Create a new ImeClient.

This is the same as new, except that the xcb::Connection is not wrapped into an Arc.

Safety

The caller is responsible to ensure that the ImeClient does not outlive the connection.

Let the IME client process XCB’s events.

Return true if the IME client is handling the event and false if the event is ignored by the IME client and has to be handled separately.

This method should be called on any event from the event queue and not just keypress/keyrelease events as it handles other events as well.

Typically you will want to let the IME client handle all keypress/keyrelease events in your main loop. The IME client will then forward all key events that were not used for input composition to the callback set by set_forward_event_cb. Often those events include all keyrelease events as well as the events for ESC, Enter or key combinations such as CTRL+C. To obtain the text currently typed into the IME and the final string consult set_preedit_draw_cb and set_commit_string_cb.

Set the position at which to place the IME window.

Set the position of the IME window relative to the window specified by win. Coordinates increase from the top left corner of the window.

Return true if an update for the IME window position has been sent to the IME, false if the update has been queued. If there is still an update request queued and this method is called, the previously queued request is discarded in favor of the new one.

Set callback to be called once input composition is done.

The window (set by update_pos) as well as the completed input are passed as arguments.

Often those events include all keyrelease events as well as the events for ESC, Enter or key combinations such as CTRL+C. Please note that xcb::KeyPressEvent == xcb::KeyReleaseEvent (see xcb::ffi::xcb_key_release_event_t) and keyrelease events are also supplied.

Callback called once the IME has been opened.

The current window (set by update_pos) is supplied as argument. Calls callback only if InputStyle::PREEDIT_CALLBACKS is set.

Callback called whenever the text whitin the IME has changed.

The current window (set by update_pos) is supplied as argument as well as PreeditInfo, which contains, among other things, the current text of the IME. Calls callback only if InputStyle::PREEDIT_CALLBACKS is set.

Callback called once the IME has been closed.

The current window (set by update_pos) is supplied as argument. Calls callback only if InputStyle::PREEDIT_CALLBACKS is set.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.