[at-spi2-core] Add ScrollSubstringTo and ScrollSubstringToPoint text interfaces



commit e1d424a21c2d5afa86a906084fb8f2917ba17cd9
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Wed Jun 27 15:14:59 2018 +0200

    Add ScrollSubstringTo and ScrollSubstringToPoint text interfaces

 NEWS                               |  4 +++
 atspi/atspi-text.c                 | 66 ++++++++++++++++++++++++++++++++++++++
 atspi/atspi-text.h                 |  4 +++
 doc/libatspi/libatspi-sections.txt |  2 ++
 idl/text.didl                      | 16 +++++++++
 xml/Text.xml                       | 14 ++++++++
 6 files changed, 106 insertions(+)
---
diff --git a/NEWS b/NEWS
index 0dd86dc..0bdac24 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+What's new in at-spi2-core 2.31.2:
+
+* Add ScrollSubstringTo and ScrollSubstringToPoint text interfaces.
+
 What's new in at-spi2-core 2.31.1:
 
 * Bus launcher: fix an issue where the error wasn't cleared on failure.
diff --git a/atspi/atspi-text.c b/atspi/atspi-text.c
index 1e887d3..009d07b 100644
--- a/atspi/atspi-text.c
+++ b/atspi/atspi-text.c
@@ -892,6 +892,72 @@ atspi_text_set_selection (AtspiText *obj,
   return retval;
 }
 
+/**
+ * atspi_text_scroll_substring_to:
+ * @obj: a pointer to the #AtspiText object on which to operate.
+ * @start_offset: a #gint indicating the start of the desired text range.
+ * @end_offset: a #gint indicating the first character past the desired range.
+ * @type: a #AtspiScrollType indicating where the object should be placed on the
+ *        screen.
+ *
+ * Scrolls whatever container of the #AtspiText text range so it becomes
+ * visible on the screen.
+ *
+ * Returns: #TRUE if successful, #FALSE otherwise.
+ **/
+gboolean
+atspi_text_scroll_substring_to (AtspiText *obj,
+                               gint start_offset,
+                               gint end_offset,
+                               AtspiScrollType type,
+                               GError **error)
+{
+  dbus_bool_t retval = FALSE;
+
+  g_return_val_if_fail (obj != NULL, FALSE);
+
+  _atspi_dbus_call (obj, atspi_interface_text, "ScrollSubstringTo",
+                    error, "iiu=>b",
+                    start_offset, end_offset, type, &retval);
+
+  return retval;
+}
+
+/**
+ * atspi_text_scroll_substring_to_point:
+ * @obj: a pointer to the #AtspiText object on which to operate.
+ * @start_offset: a #gint indicating the start of the desired text range.
+ * @end_offset: a #gint indicating the first character past the desired range.
+ * @coords: a #AtspiCoordType indicating whether the coordinates are relative to
+ *          the screen, to the window, or to the parent object.
+ * @x: the x coordinate of the point to reach
+ * @y: the y coordinate of the point to reach
+ *
+ * Scrolls whatever container of the #AtspiText text range so it becomes
+ * visible on the screen at a given position.
+ *
+ * Returns: #TRUE if successful, #FALSE otherwise.
+ **/
+gboolean
+atspi_text_scroll_substring_to_point (AtspiText *obj,
+                                     gint start_offset,
+                                     gint end_offset,
+                                     AtspiCoordType coords,
+                                     gint x,
+                                     gint y,
+                                     GError **error)
+{
+  dbus_bool_t retval = FALSE;
+
+  g_return_val_if_fail (obj != NULL, FALSE);
+
+  _atspi_dbus_call (obj, atspi_interface_text, "ScrollSubstringToPoint",
+                    error, "iiuii=>b",
+                    start_offset, end_offset, coords, x, y, &retval);
+
+  return retval;
+}
+
 static void
 atspi_text_base_init (AtspiText *klass)
 {
diff --git a/atspi/atspi-text.h b/atspi/atspi-text.h
index 8e11eb0..05b99dc 100644
--- a/atspi/atspi-text.h
+++ b/atspi/atspi-text.h
@@ -137,6 +137,10 @@ gboolean atspi_text_remove_selection (AtspiText *obj, gint selection_num, GError
 
 gboolean atspi_text_set_selection (AtspiText *obj, gint selection_num, gint start_offset, gint end_offset, 
GError **error);
 
+gboolean atspi_text_scroll_substring_to (AtspiText *obj, gint start_offset, gint end_offset, AtspiScrollType 
type, GError **error);
+
+gboolean atspi_text_scroll_substring_to_point (AtspiText *obj, gint start_offset, gint end_offset, 
AtspiCoordType coords, gint x, gint y, GError **error);
+
 G_END_DECLS
 
 #endif /* _ATSPI_TEXT_H_ */
diff --git a/doc/libatspi/libatspi-sections.txt b/doc/libatspi/libatspi-sections.txt
index 14304ff..adb9130 100644
--- a/doc/libatspi/libatspi-sections.txt
+++ b/doc/libatspi/libatspi-sections.txt
@@ -30,6 +30,8 @@ atspi_text_set_selection
 atspi_text_get_string_at_offset
 atspi_text_get_text_attribute_value
 atspi_text_get_text_attributes
+atspi_text_scroll_substring_to
+atspi_text_scroll_substring_to_point
 <SUBSECTION Standard>
 ATSPI_TEXT
 ATSPI_IS_TEXT
diff --git a/idl/text.didl b/idl/text.didl
index 07ce85e..d5ae66c 100644
--- a/idl/text.didl
+++ b/idl/text.didl
@@ -241,6 +241,22 @@ namespace org.freestandards.atspi {
                method GetAttributeSet reply {
                        Attributes attributes'
                }
+
+               /*
+                 Scroll this text range so it becomes visible on the screen.
+                */
+               method ScrollSubstringTo {
+                       ScrollType type;
+               }
+
+               /*
+                 Scroll this text range so it becomes visible on the screen at a given position.
+                */
+               method ScrollSubstringToPoint {
+                       CoordType type;
+                       int32 x;
+                       int32 y;
+               }
        }
 
        /*
diff --git a/xml/Text.xml b/xml/Text.xml
index 320ee5e..313131e 100644
--- a/xml/Text.xml
+++ b/xml/Text.xml
@@ -152,5 +152,19 @@
     <arg direction="out" type="a{ss}"/>
   </method>
 
+  <method name="ScrollSubstringTo">
+    <arg direction="in" name="startOffset" type="i"/>
+    <arg direction="in" name="endOffset" type="i"/>
+    <arg direction="in" name="type" type="u"/>
+  </method>
+
+  <method name="ScrollSubstringToPoint">
+    <arg direction="in" name="startOffset" type="i"/>
+    <arg direction="in" name="endOffset" type="i"/>
+    <arg direction="in" name="type" type="u"/>
+    <arg direction="in" name="x" type="i"/>
+    <arg direction="in" name="y" type="i"/>
+  </method>
+
 </interface>
 </node>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]