summaryrefslogtreecommitdiff
path: root/protocol
diff options
context:
space:
mode:
authorJan Arne Petersen <jpetersen@openismus.com>2012-09-09 23:08:40 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-09-12 16:38:00 -0400
commitcb08f4d844e9b85744c54a4d6e9179f44a27e3fc (patch)
tree5bfc301a1bea6ebf950b7be440821fbc15af7ebe /protocol
parentc1fbcb7c38f026cca8b14c1316a311c59a8d73e9 (diff)
downloadweston-cb08f4d844e9b85744c54a4d6e9179f44a27e3fc.tar.gz
text: Fix set_surrounding_text request
Add cursor and anchor positions as arguments to the set_surrounding_text request. The cursor and anchor positions are relative to the surrounded text, so it does not make sense to have that separate. Remove the separate set_cursor_index and set_selected_text requests. Also update the corresponding event in input-method-context and add support for it in the weston example keyboard. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Diffstat (limited to 'protocol')
-rw-r--r--protocol/text.xml24
1 files changed, 15 insertions, 9 deletions
diff --git a/protocol/text.xml b/protocol/text.xml
index a196b552..6a99ebac 100644
--- a/protocol/text.xml
+++ b/protocol/text.xml
@@ -11,10 +11,15 @@
and compose text out of them.
</description>
<request name="set_surrounding_text">
+ <description summary="sets the surrounding text">
+ Sets 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.
+ </description>
<arg name="text" type="string"/>
- </request>
- <request name="set_cursor_index">
- <arg name="index" type="uint"/>
+ <arg name="cursor" type="uint"/>
+ <arg name="anchor" type="uint"/>
</request>
<request name="activate">
<description summary="request activation">
@@ -35,10 +40,6 @@
</description>
<arg name="seat" type="object" interface="wl_seat"/>
</request>
- <request name="set_selected_text">
- <arg name="text" type="string"/>
- <arg name="index" type="int"/>
- </request>
<request name="set_micro_focus">
<arg name="x" type="int"/>
<arg name="y" type="int"/>
@@ -104,11 +105,16 @@
<arg name="text" type="string"/>
<arg name="index" type="uint"/>
</request>
- <event name="set_surrounding_text">
+ <event name="surrounding_text">
<description summary="surrounding text event">
- The surrounding text from the model.
+ 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.
</description>
<arg name="text" type="string"/>
+ <arg name="cursor" type="uint"/>
+ <arg name="anchor" type="uint"/>
</event>
</interface>