From: Zbigniew Kosinski Date: Tue, 4 Nov 2014 14:57:36 +0000 (+0100) Subject: Implement GrabHighlight and ClearHighligh methods. X-Git-Tag: accepted/tizen/common/20160203.160738~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fat-spi2-core.git;a=commitdiff_plain;h=50ca96de84baae4d908d557b2a6ab39c9db02f92 Implement GrabHighlight and ClearHighligh methods. This commit adds support for new AtkComponent method interfaces. Change-Id: I66de60a86a308dc40107cf65d33c99dcbb1eaab2 Signed-off-by: Lukasz Stanislawski --- diff --git a/atspi/atspi-component.c b/atspi/atspi-component.c index 0ab552b..41adeef 100644 --- a/atspi/atspi-component.c +++ b/atspi/atspi-component.c @@ -271,6 +271,46 @@ atspi_component_grab_focus (AtspiComponent *obj, GError **error) } /** + * atspi_component_grab_highlight: + * @obj: a pointer to the #AtspiComponent on which to operate. + * + * Attempts to set highlight to the specified + * #AtspiComponent. + * + * Returns: #TRUE if successful, #FALSE otherwise. + * + **/ +gboolean +atspi_component_grab_highlight (AtspiComponent *obj, GError **error) +{ + dbus_bool_t retval = FALSE; + + _atspi_dbus_call (obj, atspi_interface_component, "GrabHighlight", error, "=>b", &retval); + + return retval; +} + +/** + * atspi_component_clear_highlight: + * @obj: a pointer to the #AtspiComponent on which to operate. + * + * Attempts to clear highlight on the specified + * #AtspiComponent. + * + * Returns: #TRUE if successful, #FALSE otherwise. + * + **/ +gboolean +atspi_component_clear_highlight (AtspiComponent *obj, GError **error) +{ + dbus_bool_t retval = FALSE; + + _atspi_dbus_call (obj, atspi_interface_component, "ClearHighlight", error, "=>b", &retval); + + return retval; +} + +/** * atspi_component_get_alpha: * @obj: The #AtspiComponent to be queried. * diff --git a/atspi/atspi-component.h b/atspi/atspi-component.h index dd3455a..f5ddc62 100644 --- a/atspi/atspi-component.h +++ b/atspi/atspi-component.h @@ -107,6 +107,10 @@ gboolean atspi_component_set_position (AtspiComponent *obj, gint x, gint y, Atsp gboolean atspi_component_set_size (AtspiComponent *obj, gint width, gint height, GError **error); +gboolean atspi_component_grab_highlight (AtspiComponent *obj, GError **error); + +gboolean atspi_component_clear_highlight (AtspiComponent *obj, GError **error); + G_END_DECLS #endif /* _ATSPI_COMPONENT_H_ */ diff --git a/registryd/introspection.c b/registryd/introspection.c index edcf60d..84ce759 100644 --- a/registryd/introspection.c +++ b/registryd/introspection.c @@ -226,6 +226,14 @@ const char *spi_org_a11y_atspi_Component = " " " " "" +" " +" " +" " +"" +" " +" " +" " +"" " " " " " " diff --git a/registryd/registry.c b/registryd/registry.c index 15bc7a9..0a4e378 100644 --- a/registryd/registry.c +++ b/registryd/registry.c @@ -541,6 +541,30 @@ impl_GrabFocus (DBusConnection * bus, DBusMessage * message, void *user_data) } static DBusMessage * +impl_ClearHighlight (DBusConnection * bus, DBusMessage * message, void *user_data) +{ + DBusMessage *reply; + dbus_bool_t retval = FALSE; + + reply = dbus_message_new_method_return (message); + dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &retval, + DBUS_TYPE_INVALID); + return reply; +} + +static DBusMessage * +impl_GrabHighlight (DBusConnection * bus, DBusMessage * message, void *user_data) +{ + DBusMessage *reply; + dbus_bool_t retval = FALSE; + + reply = dbus_message_new_method_return (message); + dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &retval, + DBUS_TYPE_INVALID); + return reply; +} + +static DBusMessage * impl_GetAlpha (DBusConnection * bus, DBusMessage * message, void *user_data) { double rv = 1.0; @@ -1247,6 +1271,10 @@ handle_method_root (DBusConnection *bus, DBusMessage *message, void *user_data) reply = impl_GetMDIZOrder (bus, message, user_data); else if (!strcmp (member, "GrabFocus")) reply = impl_GrabFocus (bus, message, user_data); + else if (!strcmp (member, "GrabHighlight")) + reply = impl_GrabHighlight (bus, message, user_data); + else if (!strcmp (member, "ClearHighlight")) + reply = impl_ClearHighlight (bus, message, user_data); else if (!strcmp (member, "GetAlpha")) reply = impl_GetAlpha (bus, message, user_data); else