text, input-method: Add protocol for surrounding text 79/290979/1
authorInHong Han <inhong1.han@samsung.com>
Thu, 6 Apr 2023 01:19:29 +0000 (10:19 +0900)
committerInHong Han <inhong1.han@samsung.com>
Thu, 6 Apr 2023 01:19:29 +0000 (10:19 +0900)
Change-Id: I22bc00429fb0418209febf85a75ea141eede9df4

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

index e078568..7fedae4 100644 (file)
     <event name="input_panel_enabled">
       <arg name="enabled" type="uint"/>
     </event>
+
+    <event name="surrounding_text_ex">
+      <description summary="surrounding text extension 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 then anchor is the same as cursor. If the text
+        length exceeds 4000 bytes, the segmented text is delivered multiple times.
+        You can use the block_size to set the number of times the text is delivered.
+        And the block_index is the order of text delivered.
+      </description>
+      <arg name="text" type="string"/>
+      <arg name="cursor" type="uint"/>
+      <arg name="anchor" type="uint"/>
+      <arg name="block_index" type="uint"/>
+      <arg name="block_size" type="uint"/>
+    </event>
   </interface>
 
   <interface name="zwp_input_method_v1" version="1">
index 4e831f0..2e8780e 100644 (file)
     <request name="input_panel_enabled">
       <arg name="enabled" type="uint"/>
     </request>
+    <request name="set_surrounding_text_ex">
+      <description summary="sets the surrounding text">
+        Sets the surrounding plain text around the input, excluding the preedit
+        text.
+
+        The client should notify the compositor of any changes in any of the
+        values carried with this request, including changes caused by handling
+        incoming text-input events as well as changes caused by other
+        mechanisms like keyboard typing.
+
+        If the client is unaware of the text around the cursor, it should not
+        issue this request, to signify lack of support to the compositor.
+
+        Text is UTF-8 encoded, and should include the cursor position, the
+        complete selection and additional characters before and after them.
+
+        Cursor is the byte offset of the cursor within text buffer.
+
+        Anchor is the byte offset of the selection anchor within text buffer.
+        If there is no selected text, anchor is the same as cursor.
+
+        If the text length exceeds 4000 bytes, the segmented text is delivered
+        multiple times. You can use the block_size to set the number of times
+        the text is delivered. And the block_index is the order of text delivered.
+
+        If any preedit text is present, it is replaced with a cursor for the
+        purpose of this event.
+
+        Values set with this request are double-buffered. They will get applied
+        on the next commit request, and stay valid until the next committed
+        enable or disable request.
+
+        The initial state for affected fields is empty, meaning that the text
+        input does not support sending surrounding text. If the empty values
+        get applied, subsequent attempts to change them may have no effect.
+      </description>
+      <arg name="text" type="string"/>
+      <arg name="cursor" type="uint"/>
+      <arg name="anchor" type="uint"/>
+      <arg name="block_index" type="uint"/>
+      <arg name="block_size" type="uint"/>
+    </request>
     <event name="enter">
       <description summary="enter event">
         Notify the text_input object when it received focus. Typically in