summaryrefslogtreecommitdiff
path: root/atk-adaptor
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-06-27 15:41:49 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-01-26 13:02:56 +0100
commit11c1a655ab4a9670dfc8ace9b5a9d6b722054980 (patch)
treeae2ceb4774d1a8ab1e6c24b73253a3a7e9b064b6 /atk-adaptor
parent8cce3d9fa7eabfb484d9515767a80bfaca2ed8e9 (diff)
downloadat-spi2-core-11c1a655ab4a9670dfc8ace9b5a9d6b722054980.tar.gz
Add ScrollSubstringTo and ScrollSubstringToPoint text interfaces
Diffstat (limited to 'atk-adaptor')
-rw-r--r--atk-adaptor/adaptors/text-adaptor.c71
-rw-r--r--atk-adaptor/introspection.c14
2 files changed, 85 insertions, 0 deletions
diff --git a/atk-adaptor/adaptors/text-adaptor.c b/atk-adaptor/adaptors/text-adaptor.c
index 69dbdfa5..6f9d4fac 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 20911a83..e017449d 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>"
"";