text, input-method: Add surrounding text and selection text request 04/68904/4
authorLi Zhang <li2012.zhang@samsung.com>
Fri, 6 May 2016 13:37:03 +0000 (21:37 +0800)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 7 Jun 2016 09:44:13 +0000 (18:44 +0900)
Change-Id: I372d007c09f5fc9200ba801e775ae3c4e9168931

protocol/input-method.xml
protocol/text.xml

index 1443adba2e3c0f7d35f539fccb31183f5ffa2879..f6cbd6fb160682f488f81215538244e95143a9be 100644 (file)
     <request name="hide_input_panel">
       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
     </request>
+    <request name="get_selection_text">
+      <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+    </request>
+    <request name="get_surrounding_text">
+      <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+      <arg name="maxlen_before" type="uint"/>
+      <arg name="maxlen_after" type="uint"/>
+    </request>
     <event name="surrounding_text">
       <description summary="surrounding text event">
-        The plain surrounding text around the input position. Cursor is the
-        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.
+        The plain surrounding text around the input position requested by get_surrounding_text.
+        Text is the UTF-8 encoded, Cursor_position is offset of characters in insert position.
       </description>
+      <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
       <arg name="text" type="string"/>
-      <arg name="cursor" type="uint"/>
-      <arg name="anchor" type="uint"/>
+      <arg name="cursor_position" type="uint"/>
     </event>
     <event name="reset">
     </event>
       <arg name="direction" type="uint"/>
     </event>
     <event name="selection_text">
+      <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
       <arg name="text" type="string"/>
     </event>
+    <event name="cursor_position">
+      <arg name="cursor_position" type="uint"/>
+    </event>
   </interface>
 
   <interface name="wl_input_method" version="1">
index e1adfd7c6edf1f6248395afe744f2c93d1410e0c..3bb99d44f18ea481d6452fd372d9b120e62c6662 100644 (file)
     <request name="set_surrounding_text">
       <description summary="set the surrounding text">
         Set the plain surrounding text around the input position. Text is
-        UTF-8 encoded. Cursor is the byte offset within the
-        surrounding text. Anchor is the byte offset of the
-        selection anchor within the surrounding text. If there is no selected
-        text anchor is the same as cursor.
+        UTF-8 encoded. Cursor_position is the offset within the
+        surrounding text.
       </description>
+      <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
       <arg name="text" type="string"/>
-      <arg name="cursor" type="uint"/>
-      <arg name="anchor" type="uint"/>
+      <arg name="cursor_position" type="uint"/>
     </request>
     <enum name="content_hint">
       <description summary="content hint">
       <description summary="set the selected text">
         Set the selected text to the input panel.
       </description>
+      <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
       <arg name="text" type="string"/>
     </request>
+    <request name="set_cursor_position">
+      <description summary="set the cursor index">
+        Set the cursor position to the input panel.
+      </description>
+      <arg name="cursor_position" type="uint"/>
+    </request>
     <event name="enter">
       <description summary="enter event">
         Notify the text-input object when it received focus. Typically in
       <arg name="input_panel_data" type="string"/>
       <arg name="input_panel_data_length" type="uint"/>
     </event>
+    <event name="get_selection_text">
+      <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+    </event>
+    <event name="get_surrounding_text">
+      <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+      <arg name="maxlen_before" type="uint"/>
+      <arg name="maxlen_after" type="uint"/>
+    </event>
   </interface>
 
   <interface name="wl_text_input_manager" version="1">