summaryrefslogtreecommitdiff
path: root/atspi/atspi-text.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-06-27 15:14:59 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-01-15 23:17:53 +0100
commite1d424a21c2d5afa86a906084fb8f2917ba17cd9 (patch)
tree683576dd5ff0b0e48b7f0de211167cdbeefc818d /atspi/atspi-text.c
parenta2696c2b66f5c8c46200ea2c4ef81266968f908e (diff)
downloadat-spi2-core-e1d424a21c2d5afa86a906084fb8f2917ba17cd9.tar.gz
Add ScrollSubstringTo and ScrollSubstringToPoint text interfaces
Diffstat (limited to 'atspi/atspi-text.c')
-rw-r--r--atspi/atspi-text.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/atspi/atspi-text.c b/atspi/atspi-text.c
index 1e887d39..009d07bf 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)
{