[at-spi2-atk: 1/2] Add ScrollSubstringTo and ScrollSubstringToPoint text interfaces



commit 11c1a655ab4a9670dfc8ace9b5a9d6b722054980
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Wed Jun 27 15:41:49 2018 +0200

    Add ScrollSubstringTo and ScrollSubstringToPoint text interfaces

 NEWS                                |  4 +++
 atk-adaptor/adaptors/text-adaptor.c | 71 +++++++++++++++++++++++++++++++++++++
 atk-adaptor/introspection.c         | 14 ++++++++
 meson.build                         |  4 +--
 4 files changed, 91 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 7dde170..83cf13d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+What's new in at-spi2-atk 2.31.1:
+
+* Add ScrollSubstringTo and ScrollSubstringToPoint interfaces.
+
 What's new in at-spi2-atk 2.29.1:
 
 * Fix a case where we could return without unlocking a mutex (bgo#793625).
diff --git a/atk-adaptor/adaptors/text-adaptor.c b/atk-adaptor/adaptors/text-adaptor.c
index 69dbdfa..6f9d4fa 100644
--- a/atk-adaptor/adaptors/text-adaptor.c
+++ b/atk-adaptor/adaptors/text-adaptor.c
@@ -845,6 +845,75 @@ impl_GetDefaultAttributeSet (DBusConnection * bus, DBusMessage * message,
   return reply;
 }
 
+static DBusMessage *
+impl_ScrollSubstringTo (DBusConnection * bus,
+                        DBusMessage * message, void *user_data)
+{
+  AtkText *text = (AtkText *) user_data;
+  dbus_int32_t startOffset, endOffset;
+  dbus_uint32_t type;
+  dbus_bool_t ret;
+  DBusMessage *reply = NULL;
+
+  g_return_val_if_fail (ATK_IS_TEXT (user_data),
+                        droute_not_yet_handled_error (message));
+
+  if (!dbus_message_get_args
+       (message, NULL, DBUS_TYPE_INT32, &startOffset,
+                       DBUS_TYPE_INT32, &endOffset,
+                       DBUS_TYPE_UINT32, &type,
+                       DBUS_TYPE_INVALID))
+    {
+      return droute_invalid_arguments_error (message);
+    }
+
+  ret = atk_text_scroll_substring_to (text, startOffset, endOffset, type);
+
+  reply = dbus_message_new_method_return (message);
+  if (reply)
+    {
+      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
+                                DBUS_TYPE_INVALID);
+    }
+  return reply;
+}
+
+static DBusMessage *
+impl_ScrollSubstringToPoint (DBusConnection * bus,
+                             DBusMessage * message, void *user_data)
+{
+  AtkText *text = (AtkText *) user_data;
+  dbus_int32_t startOffset, endOffset;
+  dbus_uint32_t type;
+  dbus_int32_t x, y;
+  dbus_bool_t ret;
+  DBusMessage *reply = NULL;
+
+  g_return_val_if_fail (ATK_IS_TEXT (user_data),
+                        droute_not_yet_handled_error (message));
+
+  if (!dbus_message_get_args
+       (message, NULL, DBUS_TYPE_INT32, &startOffset,
+                       DBUS_TYPE_INT32, &endOffset,
+                       DBUS_TYPE_UINT32, &type,
+                       DBUS_TYPE_INT32, &x,
+                       DBUS_TYPE_INT32, &y,
+                       DBUS_TYPE_INVALID))
+    {
+      return droute_invalid_arguments_error (message);
+    }
+
+  ret = atk_text_scroll_substring_to_point (text, startOffset, endOffset, type, x, y);
+
+  reply = dbus_message_new_method_return (message);
+  if (reply)
+    {
+      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
+                                DBUS_TYPE_INVALID);
+    }
+  return reply;
+}
+
 static DRouteMethod methods[] = {
   {impl_GetText, "GetText"},
   {impl_SetCaretOffset, "SetCaretOffset"},
@@ -867,6 +936,8 @@ static DRouteMethod methods[] = {
   {impl_GetBoundedRanges, "GetBoundedRanges"},
   {impl_GetAttributeRun, "GetAttributeRun"},
   {impl_GetDefaultAttributeSet, "GetDefaultAttributeSet"},
+  {impl_ScrollSubstringTo, "ScrollSubstringTo"},
+  {impl_ScrollSubstringToPoint, "ScrollSubstringToPoint"},
   {NULL, NULL}
 };
 
diff --git a/atk-adaptor/introspection.c b/atk-adaptor/introspection.c
index 20911a8..e017449 100644
--- a/atk-adaptor/introspection.c
+++ b/atk-adaptor/introspection.c
@@ -724,6 +724,20 @@ const char *spi_org_a11y_atspi_Text =
 "    <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>"
 "";
 
diff --git a/meson.build b/meson.build
index dbe6f8f..1451e1f 100644
--- a/meson.build
+++ b/meson.build
@@ -38,8 +38,8 @@ libdbus_req_version = '>= 1.5'
 glib_req_version = '>= 2.32.0'
 gobject_req_version = '>= 2.0.0'
 gmodule_req_version = '>= 2.0.0'
-atk_req_version = '>= 2.29.2'
-atspi_req_version = '>= 2.29.1'
+atk_req_version = '>= 2.31.1'
+atspi_req_version = '>= 2.31.2'
 libxml_req_version = '>= 2.9.1'
 
 libdbus_dep = dependency('dbus-1', version: libdbus_req_version)


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