text: add pre-edit styling support to protocol

Also add a separate preedit-cursor event and add a commit argument to
preedit-string to allow to support commit on reset. Fix editor and
keyboard example to adapt to the protocol changes.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
This commit is contained in:
Jan Arne Petersen
2013-01-16 21:26:38 +01:00
committed by Kristian Høgsberg
parent 18639f8d4a
commit 4653531e7a
6 changed files with 129 additions and 42 deletions
+12
View File
@@ -47,7 +47,19 @@
Send the pre-edit string text to the applications text model.
</description>
<arg name="text" type="string"/>
<arg name="commit" type="string"/>
</request>
<request name="preedit_styling">
<arg name="index" type="uint"/>
<arg name="length" type="uint"/>
<arg name="style" type="uint"/>
</request>
<request name="preedit_cursor">
<description summary="pre-edit cursor">
Sets the cursor position inside the composing text (as byte index)
relative to the start of the composing text.
</description>
<arg name="index" type="int"/>
</request>
<request name="delete_surrounding_text">
<arg name="index" type="int"/>
+23 -3
View File
@@ -73,7 +73,7 @@
be reseted, for example after the text was changed outside of the
normal input method flow.
</description>
</request>
</request>
<request name="set_micro_focus">
<arg name="x" type="int"/>
<arg name="y" type="int"/>
@@ -101,7 +101,7 @@
to the start of the composing text.
</description>
<arg name="text" type="string"/>
<arg name="index" type="uint"/>
<arg name="commit" type="string"/>
</event>
<event name="delete_surrounding_text">
<description summary="delete surrounding text">
@@ -112,7 +112,27 @@
<arg name="index" type="int"/>
<arg name="length" type="uint"/>
</event>
<event name="preedit_styling"/>
<enum name="preedit_style">
<entry name="default" value="1"/>
<entry name="active" value="2"/>
<entry name="inactive" value="3"/>
<entry name="highlight" value="4"/>
<entry name="underline" value="5"/>
<entry name="selection" value="6"/>
<entry name="incorrect" value="7"/>
</enum>
<event name="preedit_styling">
<arg name="index" type="uint"/>
<arg name="length" type="uint"/>
<arg name="style" type="uint"/>
</event>
<event name="preedit_cursor">
<description summary="pre-edit cursor">
Sets the cursor position inside the composing text (as byte index)
relative to the start of the composing text.
</description>
<arg name="index" type="int"/>
</event>
<event name="modifiers_map">
<description summary="modifiers map">
Transfer an array of 0-terminated modifiers names. The position in