From: Mike Gorse Date: Mon, 18 Apr 2011 20:38:32 +0000 (-0500) Subject: Add atspi_accessible_get_id X-Git-Tag: AT_SPI2_CORE_2_0_1~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35f7666c4db37d8d20303ff8242182ed22bed4d1;p=platform%2Fupstream%2Fat-spi2-core.git Add atspi_accessible_get_id --- diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c index d163d68..c78af49 100644 --- a/atspi/atspi-accessible.c +++ b/atspi/atspi-accessible.c @@ -787,6 +787,29 @@ atspi_accessible_get_toolkit_version (AtspiAccessible *obj, GError **error) return NULL; return g_strdup (ret); } +/** + * atspi_accessible_get_toolkit_version: + * @obj: a pointer to the #AtspiAccessible object on which to operate. + * + * Get the application id for a #AtspiAccessible object. + * Only works on application root objects. + * + * Returns: a gint indicating the id for the #AtspiAccessible object. + * or -1 on exception + **/ +gint +atspi_accessible_get_id (AtspiAccessible *obj, GError **error) +{ + gint ret = -1; + + g_return_val_if_fail (obj != NULL, -1); + + if (!_atspi_dbus_get_property (obj, atspi_interface_application, "Id", error, "i", &ret)) + return -1; + return ret; +} + + /* Interface query methods */ static gboolean diff --git a/atspi/atspi-accessible.h b/atspi/atspi-accessible.h index e7c0a5e..3dca620 100644 --- a/atspi/atspi-accessible.h +++ b/atspi/atspi-accessible.h @@ -97,6 +97,8 @@ gchar * atspi_accessible_get_toolkit_name (AtspiAccessible *obj, GError **error) gchar * atspi_accessible_get_toolkit_version (AtspiAccessible *obj, GError **error); +gint atspi_accessible_get_id (AtspiAccessible *obj, GError **error); + AtspiAccessible * atspi_accessible_get_application (AtspiAccessible *obj, GError **error); AtspiAction * atspi_accessible_get_action (AtspiAccessible *obj);