Documentation
¶
Index ¶
- Constants
- type TextInputManagerV3
- type TextInputV3
- func (o *TextInputV3) Commit() error
- func (o *TextInputV3) Destroy() error
- func (o *TextInputV3) Disable() error
- func (o *TextInputV3) Dispatch(event *wl.Event)
- func (o *TextInputV3) Enable() error
- func (o *TextInputV3) EventSignature(opcode uint16) (string, bool)
- func (o *TextInputV3) HideInputPanel() error
- func (o *TextInputV3) OnAction(handler func(action uint32, serial uint32))
- func (o *TextInputV3) OnCommitString(handler func(text string))
- func (o *TextInputV3) OnDeleteSurroundingText(handler func(beforeLength uint32, afterLength uint32))
- func (o *TextInputV3) OnDone(handler func(serial uint32))
- func (o *TextInputV3) OnEnter(handler func(surfaceID uint32))
- func (o *TextInputV3) OnLanguage(handler func(language string))
- func (o *TextInputV3) OnLeave(handler func(surfaceID uint32))
- func (o *TextInputV3) OnPreeditHint(handler func(start uint32, end uint32, hint uint32))
- func (o *TextInputV3) OnPreeditString(handler func(text string, cursorBegin int32, cursorEnd int32))
- func (o *TextInputV3) SetAvailableActions(availableActions []byte) error
- func (o *TextInputV3) SetContentType(hint uint32, purpose uint32) error
- func (o *TextInputV3) SetCursorRectangle(x int32, y int32, width int32, height int32) error
- func (o *TextInputV3) SetSurroundingText(text string, cursor int32, anchor int32) error
- func (o *TextInputV3) SetTextChangeCause(cause uint32) error
- func (o *TextInputV3) ShowInputPanel() error
Constants ¶
const ACTION_NONE = 0
ACTION_NONE is the action none value.
const ACTION_SUBMIT = 1
ACTION_SUBMIT is the action submit value.
const CHANGE_CAUSE_INPUT_METHOD = 0
CHANGE_CAUSE_INPUT_METHOD is the change_cause input_method value.
const CHANGE_CAUSE_OTHER = 1
CHANGE_CAUSE_OTHER is the change_cause other value.
const CONTENT_HINT_AUTO_CAPITALIZATION = 0x4
CONTENT_HINT_AUTO_CAPITALIZATION is the content_hint auto_capitalization value.
const CONTENT_HINT_COMPLETION = 0x1
CONTENT_HINT_COMPLETION is the content_hint completion value.
const CONTENT_HINT_HIDDEN_TEXT = 0x40
CONTENT_HINT_HIDDEN_TEXT is the content_hint hidden_text value.
const CONTENT_HINT_LATIN = 0x100
CONTENT_HINT_LATIN is the content_hint latin value.
const CONTENT_HINT_LOWERCASE = 0x8
CONTENT_HINT_LOWERCASE is the content_hint lowercase value.
const CONTENT_HINT_MULTILINE = 0x200
CONTENT_HINT_MULTILINE is the content_hint multiline value.
const CONTENT_HINT_NONE = 0x0
CONTENT_HINT_NONE is the content_hint none value.
const CONTENT_HINT_NO_EMOJI = 0x800
CONTENT_HINT_NO_EMOJI is the content_hint no_emoji value.
const CONTENT_HINT_ON_SCREEN_INPUT_PROVIDED = 0x400
CONTENT_HINT_ON_SCREEN_INPUT_PROVIDED is the content_hint on_screen_input_provided value.
const CONTENT_HINT_PREEDIT_SHOWN = 0x1000
CONTENT_HINT_PREEDIT_SHOWN is the content_hint preedit_shown value.
const CONTENT_HINT_SENSITIVE_DATA = 0x80
CONTENT_HINT_SENSITIVE_DATA is the content_hint sensitive_data value.
const CONTENT_HINT_SPELLCHECK = 0x2
CONTENT_HINT_SPELLCHECK is the content_hint spellcheck value.
const CONTENT_HINT_TITLECASE = 0x20
CONTENT_HINT_TITLECASE is the content_hint titlecase value.
const CONTENT_HINT_UPPERCASE = 0x10
CONTENT_HINT_UPPERCASE is the content_hint uppercase value.
const CONTENT_PURPOSE_ALPHA = 1
CONTENT_PURPOSE_ALPHA is the content_purpose alpha value.
const CONTENT_PURPOSE_DATE = 10
CONTENT_PURPOSE_DATE is the content_purpose date value.
const CONTENT_PURPOSE_DATETIME = 12
CONTENT_PURPOSE_DATETIME is the content_purpose datetime value.
const CONTENT_PURPOSE_DIGITS = 2
CONTENT_PURPOSE_DIGITS is the content_purpose digits value.
const CONTENT_PURPOSE_EMAIL = 6
CONTENT_PURPOSE_EMAIL is the content_purpose email value.
const CONTENT_PURPOSE_NAME = 7
CONTENT_PURPOSE_NAME is the content_purpose name value.
const CONTENT_PURPOSE_NORMAL = 0
CONTENT_PURPOSE_NORMAL is the content_purpose normal value.
const CONTENT_PURPOSE_NUMBER = 3
CONTENT_PURPOSE_NUMBER is the content_purpose number value.
const CONTENT_PURPOSE_PASSWORD = 8
CONTENT_PURPOSE_PASSWORD is the content_purpose password value.
const CONTENT_PURPOSE_PHONE = 4
CONTENT_PURPOSE_PHONE is the content_purpose phone value.
const CONTENT_PURPOSE_PIN = 9
CONTENT_PURPOSE_PIN is the content_purpose pin value.
const CONTENT_PURPOSE_TERMINAL = 13
CONTENT_PURPOSE_TERMINAL is the content_purpose terminal value.
const CONTENT_PURPOSE_TIME = 11
CONTENT_PURPOSE_TIME is the content_purpose time value.
const CONTENT_PURPOSE_URL = 5
CONTENT_PURPOSE_URL is the content_purpose url value.
const ERROR_INVALID_ACTION = 0
ERROR_INVALID_ACTION is the error invalid_action value.
const PREEDIT_HINT_COMPOSE_ERROR = 7
PREEDIT_HINT_COMPOSE_ERROR is the preedit_hint compose_error value.
const PREEDIT_HINT_PREDICTION = 3
PREEDIT_HINT_PREDICTION is the preedit_hint prediction value.
const PREEDIT_HINT_PREFIX = 4
PREEDIT_HINT_PREFIX is the preedit_hint prefix value.
const PREEDIT_HINT_SELECTION = 2
PREEDIT_HINT_SELECTION is the preedit_hint selection value.
const PREEDIT_HINT_SPELLING_ERROR = 6
PREEDIT_HINT_SPELLING_ERROR is the preedit_hint spelling_error value.
const PREEDIT_HINT_SUFFIX = 5
PREEDIT_HINT_SUFFIX is the preedit_hint suffix value.
const PREEDIT_HINT_WHOLE = 1
PREEDIT_HINT_WHOLE is the preedit_hint whole value.
const TextInputManagerV3Interface = "zwp_text_input_manager_v3"
TextInputManagerV3Interface is the protocol interface name.
const TextInputV3Interface = "zwp_text_input_v3"
TextInputV3Interface is the protocol interface name.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TextInputManagerV3 ¶
TextInputManagerV3 is the generated binding for zwp_text_input_manager_v3 version 2.
func NewTextInputManagerV3 ¶
func NewTextInputManagerV3(ctx *wl.Context) *TextInputManagerV3
NewTextInputManagerV3 returns an unbound TextInputManagerV3.
func (*TextInputManagerV3) Destroy ¶
func (o *TextInputManagerV3) Destroy() error
Destroy the wp_text_input_manager object.
func (*TextInputManagerV3) Dispatch ¶
func (o *TextInputManagerV3) Dispatch(event *wl.Event)
Dispatch decodes one event on zwp_text_input_manager_v3 and calls the registered handlers.
func (*TextInputManagerV3) EventSignature ¶
func (o *TextInputManagerV3) EventSignature(opcode uint16) (string, bool)
EventSignature returns the declared event argument types in wire order.
func (*TextInputManagerV3) GetTextInput ¶
func (o *TextInputManagerV3) GetTextInput(seat *cross_wl_seat.Seat) (*TextInputV3, error)
Creates a new text-input object for a given seat.
type TextInputV3 ¶
TextInputV3 is the generated binding for zwp_text_input_v3 version 2.
func NewTextInputV3 ¶
func NewTextInputV3(ctx *wl.Context) *TextInputV3
NewTextInputV3 returns an unbound TextInputV3.
func (*TextInputV3) Commit ¶
func (o *TextInputV3) Commit() error
Atomically applies state changes recently sent to the compositor. The commit request establishes and updates the state of the client, and must be issued after any changes to apply them. Text input state (enabled status, content purpose, content hint, surrounding text and change cause, cursor rectangle) is conceptually double-buffered within the context of a text input, i.e. between a committed enable request and the following committed enable or disable request. Protocol requests modify the pending state, as opposed to the current state in use by the input method. A commit request atomically applies all pending state, replacing the current state. After commit, the new pending state is as documented for each related request. Requests are applied in the order of arrival. Neither current nor pending state are modified unless noted otherwise. The compositor must count the number of commit requests coming from each zwp_text_input_v3 object and use the count as the serial in done events.
func (*TextInputV3) Destroy ¶
func (o *TextInputV3) Destroy() error
Destroy the wp_text_input object. Also disables all surfaces enabled through this wp_text_input object.
func (*TextInputV3) Disable ¶
func (o *TextInputV3) Disable() error
Explicitly disable text input on the current surface (typically when there is no focus on any text entry inside the surface). State set with this request is double-buffered. It will get applied on the next zwp_text_input_v3.commit request.
func (*TextInputV3) Dispatch ¶
func (o *TextInputV3) Dispatch(event *wl.Event)
Dispatch decodes one event on zwp_text_input_v3 and calls the registered handlers.
func (*TextInputV3) Enable ¶
func (o *TextInputV3) Enable() error
Requests text input on the surface previously obtained from the enter event. This request must be issued every time the focused text input changes to a new one, including within the current surface. Use zwp_text_input_v3.disable when there is no longer any input focus on the current surface. Clients must not enable more than one text input on the single seat and should disable the current text input before enabling the new one. Requests to enable a text input when another text input is enabled on the same seat must be ignored by compositor. This request resets all state associated with previous enable, disable, set_surrounding_text, set_text_change_cause, set_content_type, and set_cursor_rectangle requests, as well as the state associated with preedit_string, commit_string, and delete_surrounding_text events. The set_surrounding_text, set_content_type and set_cursor_rectangle requests must follow if the text input supports the necessary functionality. State set with this request is double-buffered. It will get applied on the next zwp_text_input_v3.commit request, and stay valid until the next committed enable or disable request. The changes must be applied by the compositor after issuing a zwp_text_input_v3.commit request.
func (*TextInputV3) EventSignature ¶
func (o *TextInputV3) EventSignature(opcode uint16) (string, bool)
EventSignature returns the declared event argument types in wire order.
func (*TextInputV3) HideInputPanel ¶
func (o *TextInputV3) HideInputPanel() error
Requests an input panel to be hidden. This request only hints the desired interaction pattern from the client side, and its effect may be ignored by compositors given other environmental factors. Repeated calls will be ignored.
func (*TextInputV3) OnAction ¶
func (o *TextInputV3) OnAction(handler func(action uint32, serial uint32))
OnAction registers a handler for the action event.
Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.
func (*TextInputV3) OnCommitString ¶
func (o *TextInputV3) OnCommitString(handler func(text string))
OnCommitString registers a handler for the commit_string event.
Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.
func (*TextInputV3) OnDeleteSurroundingText ¶
func (o *TextInputV3) OnDeleteSurroundingText(handler func(beforeLength uint32, afterLength uint32))
OnDeleteSurroundingText registers a handler for the delete_surrounding_text event.
Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.
func (*TextInputV3) OnDone ¶
func (o *TextInputV3) OnDone(handler func(serial uint32))
OnDone registers a handler for the done event.
Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.
func (*TextInputV3) OnEnter ¶
func (o *TextInputV3) OnEnter(handler func(surfaceID uint32))
OnEnter registers a handler for the enter event.
Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.
func (*TextInputV3) OnLanguage ¶
func (o *TextInputV3) OnLanguage(handler func(language string))
OnLanguage registers a handler for the language event.
Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.
func (*TextInputV3) OnLeave ¶
func (o *TextInputV3) OnLeave(handler func(surfaceID uint32))
OnLeave registers a handler for the leave event.
Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.
func (*TextInputV3) OnPreeditHint ¶
func (o *TextInputV3) OnPreeditHint(handler func(start uint32, end uint32, hint uint32))
OnPreeditHint registers a handler for the preedit_hint event.
Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.
func (*TextInputV3) OnPreeditString ¶
func (o *TextInputV3) OnPreeditString(handler func(text string, cursorBegin int32, cursorEnd int32))
OnPreeditString registers a handler for the preedit_string event.
Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.
func (*TextInputV3) SetAvailableActions ¶
func (o *TextInputV3) SetAvailableActions(availableActions []byte) error
Set the actions available for this text input. Values set with this request are double-buffered. They will get applied on the next zwp_text_input_v3.commit request. If the available_actions array contains the none action, or contains the same action multiple times, the compositor must raise the invalid_action protocol error. Initially, no actions are available.
func (*TextInputV3) SetContentType ¶
func (o *TextInputV3) SetContentType(hint uint32, purpose uint32) error
Sets the content purpose and content hint. While the purpose is the basic purpose of an input field, the hint flags allow to modify some of the behavior. Values set with this request are double-buffered. They will get applied on the next zwp_text_input_v3.commit request. Subsequent attempts to update them may have no effect. The values remain valid until the next committed enable or disable request. The initial value for hint is none, and the initial value for purpose is normal.
func (*TextInputV3) SetCursorRectangle ¶
Marks an area around the cursor as a x, y, width, height rectangle in surface local coordinates. Allows the compositor to put a window with word suggestions near the cursor, without obstructing the text being input. If the client is unaware of the position of edited text, it should not issue this request, to signify lack of support to the compositor. Values set with this request are double-buffered. They will get applied on the next zwp_text_input_v3.commit request, and stay valid until the next committed enable or disable request. The initial values describing a cursor rectangle are empty. That means the text input does not support describing the cursor area. If the empty values get applied, subsequent attempts to change them may have no effect. As of version 2, the zwp_text_input_v3.commit request does not apply values sent with this request. Instead, it stores them in a separate "committed" area. The committed values, if still valid, get applied on the next wl_surface.commit request on the surface with text-input focus. Both committed and applied values get invalidated on: - the next committed enable or disable request, or - a change of the focused surface of the text-input (leave or enter events). This double stage application allows the compositor to position the input method popup in the same frame as the contents of the text on the surface are updated.
func (*TextInputV3) SetSurroundingText ¶
func (o *TextInputV3) SetSurroundingText(text string, cursor int32, anchor int32) error
Sets the surrounding plain text around the input, excluding the preedit text. The client should notify the compositor of any changes in any of the values carried with this request, including changes caused by handling incoming text-input events as well as changes caused by other mechanisms like keyboard typing. If the client is unaware of the text around the cursor, it should not issue this request, to signify lack of support to the compositor. Text is UTF-8 encoded, and should include the cursor position, the complete selection and additional characters before and after them. There is a maximum length of wayland messages, so text can not be longer than 4000 bytes. Cursor is the byte offset of the cursor within text buffer. Anchor is the byte offset of the selection anchor within text buffer. If there is no selected text, anchor is the same as cursor. If any preedit text is present, it is replaced with a cursor for the purpose of this event. Values set with this request are double-buffered. They will get applied on the next zwp_text_input_v3.commit request, and stay valid until the next committed enable or disable request. The initial state for affected fields is empty, meaning that the text input does not support sending surrounding text. If the empty values get applied, subsequent attempts to change them may have no effect.
func (*TextInputV3) SetTextChangeCause ¶
func (o *TextInputV3) SetTextChangeCause(cause uint32) error
Tells the compositor why the text surrounding the cursor changed. Whenever the client detects an external change in text, cursor, or anchor posision, it must issue this request to the compositor. This request is intended to give the input method a chance to update the preedit text in an appropriate way, e.g. by removing it when the user starts typing with a keyboard. cause describes the source of the change. The value set with this request is double-buffered. It must be applied and reset to initial at the next zwp_text_input_v3.commit request. The initial value of cause is input_method.
func (*TextInputV3) ShowInputPanel ¶
func (o *TextInputV3) ShowInputPanel() error
Requests an input panel to be shown (e.g. a on-screen keyboard). This request only hints the desired interaction pattern from the client side, and its effect may be ignored by compositors given other environmental factors. Repeated calls will be ignored.