From e1d424a21c2d5afa86a906084fb8f2917ba17cd9 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 27 Jun 2018 15:14:59 +0200 Subject: Add ScrollSubstringTo and ScrollSubstringToPoint text interfaces --- atspi/atspi-text.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'atspi/atspi-text.c') 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) { -- cgit v1.2.1