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>
This commit is contained in:
Jan Arne Petersen
2012-09-09 23:08:40 +02:00
committed by Kristian Høgsberg
parent c1fbcb7c38
commit cb08f4d844
4 changed files with 44 additions and 28 deletions
+15 -9
View File
@@ -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>