From 9471ef4c8bc15fc315fa78900de17c3818990ae0 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 23 Nov 2018 10:49:49 +0100 Subject: [PATCH] debian/patches/1002-scrollsubtringto: Support scrollto interface --- debian/changelog | 1 + debian/patches/1002-scrollsubstringto | 145 ++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 147 insertions(+) create mode 100644 debian/patches/1002-scrollsubstringto diff --git a/debian/changelog b/debian/changelog index b6b2bd0f..244ca030 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ at-spi2-atk (2.14.0-2+hypra1) UNRELEASED; urgency=medium * debian/patches/1001-scrollto: Support scrollto interface. * control: Bump atk and at-spi2-core build-deps accordingly. + * debian/patches/1002-scrollsubtringto: Support scrollto interface. -- Samuel Thibault Mon, 19 Nov 2018 17:11:33 +0100 diff --git a/debian/patches/1002-scrollsubstringto b/debian/patches/1002-scrollsubstringto new file mode 100644 index 00000000..cd0a6f4f --- /dev/null +++ b/debian/patches/1002-scrollsubstringto @@ -0,0 +1,145 @@ +commit bb4e5163510bb380c43702e62afe986596871b3c +Author: Samuel Thibault +Date: Wed Jun 27 15:41:49 2018 +0200 + + Add ScrollSubstringTo and ScrollSubstringToPoint text interfaces + +#diff --git a/NEWS b/NEWS +#index 7dde170..7e005ba 100644 +#--- a/NEWS +#+++ b/NEWS +#@@ -1,3 +1,7 @@ +#+What's new in at-spi2-atk 2.31.0: +#+ +#+* 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 = + " " + " " + "" ++" " ++" " ++" " ++" " ++" " ++"" ++" " ++" " ++" " ++" " ++" " ++" " ++" " ++"" + "" + ""; + +#diff --git a/meson.build b/meson.build +#index dbe6f8f..c47e4b1 100644 +#--- a/meson.build +#+++ b/meson.build +#@@ -39,7 +39,7 @@ 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' +#+atspi_req_version = '>= 2.31.0' +# libxml_req_version = '>= 2.9.1' +# +# libdbus_dep = dependency('dbus-1', version: libdbus_req_version) diff --git a/debian/patches/series b/debian/patches/series index 9d53bc5d..9f06a0af 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ git-c8cda37e28307ad195996ad54b9ee1680cca3ec3 1001-scrollto +1002-scrollsubstringto -- GitLab