From 8418a0cc8d52dbf3536a0396d2cd8e481df88129 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Thu, 18 Apr 2013 16:47:20 +0200 Subject: [PATCH] text: Fix some text and input-method docs Signed-off-by: Jan Arne Petersen --- protocol/input-method.xml | 40 ++++++++++++++++++++++++++------------- protocol/text.xml | 36 ++++++++++++++++++----------------- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/protocol/input-method.xml b/protocol/input-method.xml index 59ac2448..3fc468c1 100644 --- a/protocol/input-method.xml +++ b/protocol/input-method.xml @@ -37,20 +37,32 @@ - Send the commit string text to the applications text model. + Send the commit string text to the applications text model and + set the cursor at index (as byte index) relative to the + beginning of inserted text. - Send the pre-edit string text to the applications text model. + Send the pre-edit string text to the applications text model. The commit + text can be used to replace the preedit text on reset (for example on + unfocus). + + Sets styling information on composing text. The style is applied for + length (in bytes) characters from index relative to the beginning of the + composing text (as byte index). Multiple styles can be applied to a + composing text. + + This request should be sent before sending preedit_string request. + @@ -60,6 +72,8 @@ Sets the cursor position inside the composing text (as byte index) relative to the start of the composing text. + + This request should be sent before sending preedit_string request. @@ -79,11 +93,10 @@ - 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_surrounfing_text, etc. The key event follows - the wl_keyboard key event convention. State is a XKB keysym, state a - wl_keyboard key_state. + 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_surrounfing_text, etc. The key event follows the wl_keyboard key + event convention. Sym is a XKB keysym, state a wl_keyboard key_state. @@ -94,9 +107,9 @@ Allows an input method to receive hardware keyboard input and process - key events to generate text events (with pre-edit) over the. This allows - input methods which compose multiple key events for inputting text - like it is done for CJK languages. + 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. @@ -124,9 +137,10 @@ The plain surrounding text around the input position. Cursor is the - position within the surrounding text. Anchor is the position of the - selection anchor within the surrounding text. If there is no selected - text anchor is the same as cursor. + 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 anchor is the same as cursor. diff --git a/protocol/text.xml b/protocol/text.xml index dc86c167..508f8de8 100644 --- a/protocol/text.xml +++ b/protocol/text.xml @@ -42,7 +42,7 @@ Sets the plain surrounding text around the input position. Cursor is the byte index within the surrounding text. Anchor is the byte index of the selection anchor within the surrounding text. If there is no selected - text anchor is the same as cursor. + text anchor then it is the same as cursor. @@ -70,9 +70,9 @@ - Should be called by an editor widget when the input state should - be reseted, for example after the text was changed outside of the - normal input method flow. + Should be called by an editor widget when the input state should be + reset, for example after the text was changed outside of the normal + input method flow. @@ -84,7 +84,8 @@ - Content hint is a bitmask to allow to modify the behavior of the text input + Content hint is a bitmask to allow to modify the behavior of the text + input. @@ -94,7 +95,7 @@ - + @@ -102,10 +103,11 @@ - The content purpose allows to specify the primary purpose of a text input. + The content purpose allows to specify the primary purpose of a text + input. - This allows an input method to show special purpose input panels with extra - characters or to disallow some characters. + This allows an input method to show special purpose input panels with + extra characters or to disallow some characters. @@ -164,10 +166,10 @@ - Notify when text should be inserted into the editor widget. The text - to commit could be either just a single character after a key press - or the result of some composing (pre-edit). It also sets the new - cursor position (as byte index) relative to the inserted text. + Notify when text should be inserted into the editor widget. The text to + commit could be either just a single character after a key press or the + result of some composing (pre-edit). It also sets the new cursor + position (as byte index) relative to the beginning of inserted text. Any previously set composing text should be removed. @@ -191,7 +193,7 @@ Notify when the text around the current cursor position should be deleted. Index is relative to the current cursor (as byte index). - Length is the length of deleted text (as bytes). + Length is the length of deleted text (in bytes). @@ -254,9 +256,9 @@ 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_surrounfing_text, etc. The key event follows - the wl_keyboard key event convention. State is a XKB keysym, state a + the wl_keyboard key event convention. Sym is a XKB keysym, state a wl_keyboard key_state. Modifiers are a mask for effective modifiers - (where the modfier indices are set by the modifiers_map event) + (where the modifier indices are set by the modifiers_map event) @@ -312,7 +314,7 @@ - A factory for text models. This object is a singleton global. + A factory for text models. This object is a global singleton.