From 6e74f73487ccbb8c914ea3857498aeeae707f3a0 Mon Sep 17 00:00:00 2001 From: Lukasz Stanislawski Date: Tue, 12 May 2015 12:12:17 +0200 Subject: [PATCH] component: add component highlight index getter. Change-Id: I0500fe1a2a509c55ee87627db4ff56d3e2b429dd Signed-off-by: Lukasz Stanislawski --- atspi/atspi-component.c | 17 +++++++++++++++++ atspi/atspi-component.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/atspi/atspi-component.c b/atspi/atspi-component.c index 41adeef..bdbe57c 100644 --- a/atspi/atspi-component.c +++ b/atspi/atspi-component.c @@ -452,6 +452,23 @@ atspi_component_set_size (AtspiComponent *obj, return ret; } +/** + * atspi_component_get_highlight_index + * @obj: a pointer to the #AtspiComponent to query. + * + * Returns: highlight index of object if (>0), 0 if highlight index is not set + * or -1 if an error occured. + **/ +int +atspi_component_get_highlight_index (AtspiComponent *obj, GError **error) +{ + gint ret = -1; + g_return_val_if_fail (obj != NULL, -1); + _atspi_dbus_get_property (obj, atspi_interface_component, + "HighlightIndex", error, "i", &ret); + return ret; +} + static void atspi_component_base_init (AtspiComponent *klass) { diff --git a/atspi/atspi-component.h b/atspi/atspi-component.h index f5ddc62..1388072 100644 --- a/atspi/atspi-component.h +++ b/atspi/atspi-component.h @@ -111,6 +111,8 @@ gboolean atspi_component_grab_highlight (AtspiComponent *obj, GError **error); gboolean atspi_component_clear_highlight (AtspiComponent *obj, GError **error); +int atspi_component_get_highlight_index(AtspiComponent *obj, GError **error); + G_END_DECLS #endif /* _ATSPI_COMPONENT_H_ */ -- 2.7.4