wayland::zwp_input_method_context_v1_t(3)

NAME
wayland::zwp_input_method_context_v1_t - input method context

SYNOPSIS

#include <wayland-client-protocol-unstable.hpp>

Inherits wayland::proxy_t.

  Public Types

enum class wrapper_type { standard, display, foreign, proxy_wrapper }

  Public Member Functions

void commit_string (uint32_t serial, std::string const &text)
commit string
void preedit_string (uint32_t serial, std::string const &text, std::string const &commit)
pre-edit string
void preedit_styling (uint32_t index, uint32_t length, zwp_text_input_v1_preedit_style const &style)
pre-edit styling
void preedit_cursor (int32_t index)
pre-edit cursor
void delete_surrounding_text (int32_t index, uint32_t length)
delete text
void cursor_position (int32_t index, int32_t anchor)
set cursor to a new position
void modifiers_map (array_t const &map)
void keysym (uint32_t serial, uint32_t time, uint32_t sym, keyboard_key_state const &state, uint32_t modifiers)
keysym
keyboard_t grab_keyboard ()
grab hardware keyboard
void key (uint32_t serial, uint32_t time, uint32_t key, keyboard_key_state const &state)
forward key event
void modifiers (uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
forward modifiers event
void language (uint32_t serial, std::string const &language)
void text_direction (uint32_t serial, uint32_t direction)
std::function< void(std::string, uint32_t, uint32_t)> & on_surrounding_text ()
surrounding text event
std::function< void(zwp_text_input_v1_content_hint, zwp_text_input_v1_content_purpose)> & on_content_type ()
std::function< void(uint32_t, uint32_t)> & on_invoke_action ()
std::function< void(uint32_t)> & on_commit_state ()
std::function< void(std::string)> & on_preferred_language ()
uint32_t get_id () const
Get the id of a proxy object.
std::string get_class () const
Get the interface name (class) of a proxy object.
uint32_t get_version () const
Get the protocol object version of a proxy object.
wrapper_type get_wrapper_type () const
Get the type of a proxy object.
void set_queue (event_queue_t queue)
Assign a proxy to an event queue.
wl_proxy * c_ptr () const
Get a pointer to the underlying C struct.
bool proxy_has_object () const
Check whether this wrapper actually wraps an object.
operator bool () const
Check whether this wrapper actually wraps an object.
bool operator== (const proxy_t &right) const
Check whether two wrappers refer to the same object.
bool operator!= (const proxy_t &right) const
Check whether two wrappers refer to different objects.
void proxy_release ()
Release the wrapped object (if any), making this an empty wrapper.

  Static Public Attributes

static constexpr std::uint32_t commit_string_since_version = 1
Minimum protocol version required for the commit_string function.
static constexpr std::uint32_t preedit_string_since_version = 1
Minimum protocol version required for the preedit_string function.
static constexpr std::uint32_t preedit_styling_since_version = 1
Minimum protocol version required for the preedit_styling function.
static constexpr std::uint32_t preedit_cursor_since_version = 1
Minimum protocol version required for the preedit_cursor function.
static constexpr std::uint32_t delete_surrounding_text_since_version = 1
Minimum protocol version required for the delete_surrounding_text function.
static constexpr std::uint32_t cursor_position_since_version = 1
Minimum protocol version required for the cursor_position function.
static constexpr std::uint32_t modifiers_map_since_version = 1
Minimum protocol version required for the modifiers_map function.
static constexpr std::uint32_t keysym_since_version = 1
Minimum protocol version required for the keysym function.
static constexpr std::uint32_t grab_keyboard_since_version = 1
Minimum protocol version required for the grab_keyboard function.
static constexpr std::uint32_t key_since_version = 1
Minimum protocol version required for the key function.
static constexpr std::uint32_t modifiers_since_version = 1
Minimum protocol version required for the modifiers function.
static constexpr std::uint32_t language_since_version = 1
Minimum protocol version required for the language function.
static constexpr std::uint32_t text_direction_since_version = 1
Minimum protocol version required for the text_direction function.

Detailed Description

input method context

Corresponds to a text input on the input method side. An input method context is created on text input activation on the input method side. It allows receiving information about the text input from the application via events. Input method contexts do not keep state after deactivation and should be destroyed after deactivation is handled.

Text is generally UTF-8 encoded, indices and lengths are in bytes.

Serials are used to synchronize the state between the text input and an input method. New serials are sent by the text input in the commit_state request and are used by the input method to indicate the known text input state in events like preedit_string, commit_string, and keysym. The text input can then ignore events from the input method which are based on an outdated state (for example after a reset).

Warning! The protocol described in this file is experimental and backward incompatible changes may be made. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes are done by bumping the version number in the protocol and interface names and resetting the interface version. Once the protocol is to be declared stable, the 'z' prefix and the version number in the protocol and interface names are removed and the interface version number is reset.

Definition at line 704 of file wayland-client-protocol-unstable.hpp.

Member Enumeration Documentation

  enum class wayland::proxy_t::wrapper_type [strong], [inherited]
Underlying wl_proxy type and properties of a proxy_t that affect construction, destruction, and event handling

Enumerator

standard
    C pointer is a standard type compatible with wl_proxy*. Events are dispatched and it is destructed when the proxy_t is destructed. User data is set.

display
    C pointer is a wl_display*. No events are dispatched, wl_display_disconnect is called when the proxy_t is destructed. User data is set.

foreign
    C pointer is a standard type compatible with wl_proxy*, but another library owns it and it should not be touched in a way that could affect the operation of the other library. No events are dispatched, wl_proxy_destroy is not called when the proxy_t is destructed, user data is not touched. Consequently, there is no reference counting for the proxy_t. Lifetime of such wrappers should preferably be short to minimize the chance that the owning library decides to destroy the wl_proxy.

proxy_wrapper
    C pointer is a wl_proxy* that was constructed with wl_proxy_create_wrapper. No events are dispatched, wl_proxy_wrapper_destroy is called when the proxy_t is destroyed. Reference counting is active. A reference to the proxy_t creating this proxy wrapper is held to extend its lifetime until after the proxy wrapper is destroyed.

Definition at line 116 of file wayland-client.hpp.

Member Function Documentation

  wl_proxy * wayland::proxy_t::c_ptr () const [inherited]

Get a pointer to the underlying C struct.

Returns
    The underlying wl_proxy wrapped by this proxy_t if it exists, otherwise an exception is thrown

  void zwp_input_method_context_v1_t::commit_string (uint32_t serial, std::string const & text)

commit string

Parameters
    serial serial of the latest known text input state
    text

Send the commit string text for insertion to the application.

The text to commit could be either just a single character after a key press or the result of some composing (pre-edit). It could be also an empty text when some text should be removed (see delete_surrounding_text) or when the input cursor should be moved (see cursor_position).

Any previously set composing text will be removed.

Definition at line 4543 of file wayland-client-protocol-unstable.cpp.

  void zwp_input_method_context_v1_t::cursor_position (int32_t index, int32_t anchor)

set cursor to a new position

Parameters
    index
    anchor

Set the cursor and anchor to a new position. Index is the new cursor position in bytes (when >= 0 this is relative to the end of the inserted text, otherwise it is relative to the beginning of the inserted text). Anchor is the new anchor position in bytes (when >= 0 this is relative to the end of the inserted text, otherwise it is relative to the beginning of the inserted text). When there should be no selected text, anchor should be the same as index.

This request will be handled on the text_input side directly following a commit_string request.

Definition at line 4573 of file wayland-client-protocol-unstable.cpp.

  void zwp_input_method_context_v1_t::delete_surrounding_text (int32_t index, uint32_t length)

delete text

Parameters
    index
    length

Remove the surrounding text.

This request will be handled on the text_input side directly following a commit_string request.

Definition at line 4567 of file wayland-client-protocol-unstable.cpp.

  std::string wayland::proxy_t::get_class () const [inherited]

Get the interface name (class) of a proxy object.

Returns
    The interface name of the object associated with the proxy

  uint32_t wayland::proxy_t::get_id () const [inherited]

Get the id of a proxy object.

Returns
    The id the object associated with the proxy

  uint32_t wayland::proxy_t::get_version () const [inherited]

Get the protocol object version of a proxy object. Gets the protocol object version of a proxy object, or 0 if the proxy was created with unversioned API.

A returned value of 0 means that no version information is available, so the caller must make safe assumptions about the object's real version.

display_t will always return version 0.

Returns
    The protocol object version of the proxy or 0

  wrapper_type wayland::proxy_t::get_wrapper_type () const [inline], [inherited]

Get the type of a proxy object.

Definition at line 302 of file wayland-client.hpp.

  keyboard_t zwp_input_method_context_v1_t::grab_keyboard ()

grab hardware keyboard Allow an input method to receive hardware keyboard input and process key events to generate text events (with pre-edit) over the wire. This allows input methods which compose multiple key events for inputting text like it is done for CJK languages.

Definition at line 4591 of file wayland-client-protocol-unstable.cpp.

  void zwp_input_method_context_v1_t::key (uint32_t serial, uint32_t time, uint32_t key, keyboard_key_state const & state)

forward key event

Parameters
    serial serial from wl_keyboard::key
    time time from wl_keyboard::key
    key key from wl_keyboard::key
    state state from wl_keyboard::key

Forward a wl_keyboard::key event to the client that was not processed by the input method itself. Should be used when filtering key events with grab_keyboard. The arguments should be the ones from the wl_keyboard::key event.

For generating custom key events use the keysym request instead.

Definition at line 4598 of file wayland-client-protocol-unstable.cpp.

  void zwp_input_method_context_v1_t::keysym (uint32_t serial, uint32_t time, uint32_t sym, keyboard_key_state const & state, uint32_t modifiers)

keysym

Parameters
    serial serial of the latest known text input state
    time
    sym
    state
    modifiers

Notify when a key event was sent. Key events should not be used for normal text input operations, which should be done with commit_string, delete_surrounding_text, etc. The key event follows the wl_keyboard key event convention. Sym is an XKB keysym, state is a wl_keyboard key_state.

Definition at line 4585 of file wayland-client-protocol-unstable.cpp.

  void zwp_input_method_context_v1_t::language (uint32_t serial, std::string const & language)

Parameters
    serial serial of the latest known text input state
    language

Definition at line 4610 of file wayland-client-protocol-unstable.cpp.

  void zwp_input_method_context_v1_t::modifiers (uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)

forward modifiers event

Parameters
    serial serial from wl_keyboard::modifiers
    mods_depressed mods_depressed from wl_keyboard::modifiers
    mods_latched mods_latched from wl_keyboard::modifiers
    mods_locked mods_locked from wl_keyboard::modifiers
    group group from wl_keyboard::modifiers

Forward a wl_keyboard::modifiers event to the client that was not processed by the input method itself. Should be used when filtering key events with grab_keyboard. The arguments should be the ones from the wl_keyboard::modifiers event.

Definition at line 4604 of file wayland-client-protocol-unstable.cpp.

  void zwp_input_method_context_v1_t::modifiers_map (array_t const & map)

Parameters
    map

Definition at line 4579 of file wayland-client-protocol-unstable.cpp.

  std::function< void(uint32_t)> & zwp_input_method_context_v1_t::on_commit_state ()

Parameters
    serial serial of text input state

Definition at line 4642 of file wayland-client-protocol-unstable.cpp.

  std::function< void(zwp_text_input_v1_content_hint, zwp_text_input_v1_content_purpose)> & zwp_input_method_context_v1_t::on_content_type ()

Parameters
    hint
    purpose

Definition at line 4632 of file wayland-client-protocol-unstable.cpp.

  std::function< void(uint32_t, uint32_t)> & zwp_input_method_context_v1_t::on_invoke_action ()

Parameters
    button
    index

Definition at line 4637 of file wayland-client-protocol-unstable.cpp.

  std::function< void(std::string)> & zwp_input_method_context_v1_t::on_preferred_language ()

Parameters
    language

Definition at line 4647 of file wayland-client-protocol-unstable.cpp.

  std::function< void(std::string, uint32_t, uint32_t)> & zwp_input_method_context_v1_t::on_surrounding_text ()

surrounding text event

Parameters
    text
    cursor
    anchor

The plain surrounding text around the input position. Cursor is the position in bytes within the surrounding text relative to the beginning of the text. Anchor is the position in bytes of the selection anchor within the surrounding text relative to the beginning of the text. If there is no selected text then anchor is the same as cursor.

Definition at line 4622 of file wayland-client-protocol-unstable.cpp.

  wayland::proxy_t::operator bool () const [inherited]

Check whether this wrapper actually wraps an object.

Returns
    true if there is an underlying object, false if this wrapper is empty

  bool wayland::proxy_t::operator!= (const proxy_t & right) const [inherited]

Check whether two wrappers refer to different objects.

  bool wayland::proxy_t::operator== (const proxy_t & right) const [inherited]

Check whether two wrappers refer to the same object.

  void zwp_input_method_context_v1_t::preedit_cursor (int32_t index)

pre-edit cursor

Parameters
    index

Set the cursor position inside the composing text (as byte offset) relative to the start of the composing text.

When index is negative no cursor should be displayed.

This request should be sent before sending a preedit_string request.

Definition at line 4561 of file wayland-client-protocol-unstable.cpp.

  void zwp_input_method_context_v1_t::preedit_string (uint32_t serial, std::string const & text, std::string const & commit)

pre-edit string

Parameters
    serial serial of the latest known text input state
    text
    commit

Send the pre-edit string text to the application text input.

The commit text can be used to replace the pre-edit text on reset (for example on unfocus).

Previously sent preedit_style and preedit_cursor requests are also processed by the text_input.

Definition at line 4549 of file wayland-client-protocol-unstable.cpp.

  void zwp_input_method_context_v1_t::preedit_styling (uint32_t index, uint32_t length, zwp_text_input_v1_preedit_style const & style)

pre-edit styling

Parameters
    index
    length
    style

Set the styling information on composing text. The style is applied for length in bytes from index relative to the beginning of the composing text (as byte offset). Multiple styles can be applied to a composing text.

This request should be sent before sending a preedit_string request.

Definition at line 4555 of file wayland-client-protocol-unstable.cpp.

  bool wayland::proxy_t::proxy_has_object () const [inherited]

Check whether this wrapper actually wraps an object.

Returns
    true if there is an underlying object, false if this wrapper is empty

  void wayland::proxy_t::proxy_release () [inherited]

Release the wrapped object (if any), making this an empty wrapper. Note that display_t instances cannot be released this way. Attempts to do so are ignored.

Examples
foreign_display.cpp.

  void wayland::proxy_t::set_queue (event_queue_t queue) [inherited]

Assign a proxy to an event queue.

Parameters
    queue The event queue that will handle this proxy

Assign proxy to event queue. Events coming from proxy will be queued in queue instead of the display's main queue.

See also: display_t::dispatch_queue().

Examples
proxy_wrapper.cpp.

  void zwp_input_method_context_v1_t::text_direction (uint32_t serial, uint32_t direction)

Parameters
    serial serial of the latest known text input state
    direction

Definition at line 4616 of file wayland-client-protocol-unstable.cpp.

Member Data Documentation

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::commit_string_since_version = 1 [static], [constexpr]

Minimum protocol version required for the commit_string function.

Definition at line 751 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::cursor_position_since_version = 1 [static], [constexpr]

Minimum protocol version required for the cursor_position function.

Definition at line 845 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::delete_surrounding_text_since_version = 1 [static], [constexpr]

Minimum protocol version required for the delete_surrounding_text function.

Definition at line 823 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::grab_keyboard_since_version = 1 [static], [constexpr]

Minimum protocol version required for the grab_keyboard function.

Definition at line 888 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::key_since_version = 1 [static], [constexpr]

Minimum protocol version required for the key function.

Definition at line 908 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::keysym_since_version = 1 [static], [constexpr]

Minimum protocol version required for the keysym function.

Definition at line 874 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::language_since_version = 1 [static], [constexpr]

Minimum protocol version required for the language function.

Definition at line 938 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::modifiers_map_since_version = 1 [static], [constexpr]

Minimum protocol version required for the modifiers_map function.

Definition at line 855 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::modifiers_since_version = 1 [static], [constexpr]

Minimum protocol version required for the modifiers function.

Definition at line 927 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::preedit_cursor_since_version = 1 [static], [constexpr]

Minimum protocol version required for the preedit_cursor function.

Definition at line 807 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::preedit_string_since_version = 1 [static], [constexpr]

Minimum protocol version required for the preedit_string function.

Definition at line 771 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::preedit_styling_since_version = 1 [static], [constexpr]

Minimum protocol version required for the preedit_styling function.

Definition at line 790 of file wayland-client-protocol-unstable.hpp.

  constexpr std::uint32_t wayland::zwp_input_method_context_v1_t::text_direction_since_version = 1 [static], [constexpr]

Minimum protocol version required for the text_direction function.

Definition at line 949 of file wayland-client-protocol-unstable.hpp.

Author

Generated automatically by Doxygen for Wayland++ from the source code.