[at-spi2-core] Fix get_toolkit_version, and add get_atspi_version for accessibles



commit 0c73fcca6252a95beea2fcf6d5ea39c0e5e16b6f
Author: Mike Gorse <mgorse novell com>
Date:   Mon May 23 18:04:01 2011 -0500

    Fix get_toolkit_version, and add get_atspi_version for accessibles

 atspi/atspi-accessible.c |   25 ++++++++++++++++++++++++-
 atspi/atspi-accessible.h |    2 ++
 idl/application.didl     |    4 ++++
 xml/Application.xml      |    1 +
 4 files changed, 31 insertions(+), 1 deletions(-)
---
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index d9bdeef..90acb55 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -782,7 +782,30 @@ atspi_accessible_get_toolkit_version (AtspiAccessible *obj, GError **error)
 
   g_return_val_if_fail (obj != NULL, NULL);
 
-  if (!_atspi_dbus_get_property (obj, atspi_interface_application, "ToolkitVersion", error, "s", &ret))
+  if (!_atspi_dbus_get_property (obj, atspi_interface_application, "Version", error, "s", &ret))
+      return NULL;
+  return ret;
+}
+
+/**
+ * atspi_accessible_get_atspi_version:
+ * @obj: a pointer to the #AtspiAccessible object on which to operate.
+ *
+ * Get the AT-SPI IPC specification version supported by the application
+ * pointed to by the #AtspiAccessible object.
+ * Only works on application root objects.
+ *
+ * Returns: a UTF-8 string indicating the AT-SPI ersion for the #AtspiAccessible object.
+ * or NULL on exception
+ **/
+gchar *
+atspi_accessible_get_atspi_version (AtspiAccessible *obj, GError **error)
+{
+  gchar *ret = NULL;
+
+  g_return_val_if_fail (obj != NULL, NULL);
+
+  if (!_atspi_dbus_get_property (obj, atspi_interface_application, "AtspiVersion", error, "s", &ret))
       return NULL;
   return ret;
 }
diff --git a/atspi/atspi-accessible.h b/atspi/atspi-accessible.h
index 72c2bbe..60972aa 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);
 
+gchar * atspi_accessible_get_atspi_version (AtspiAccessible *obj, GError **error);
+
 gint atspi_accessible_get_id (AtspiAccessible *obj, GError **error);
 
 AtspiAccessible * atspi_accessible_get_application (AtspiAccessible *obj, GError **error);
diff --git a/idl/application.didl b/idl/application.didl
index 19383f6..546fcfd 100644
--- a/idl/application.didl
+++ b/idl/application.didl
@@ -11,6 +11,10 @@ interface org.freestandards.atspi.Application {
 	/* A string indicating the version of the applications accessibility bridge. */
 	read property string Version;
 
+	/* A string indicating the version of the AT-SPI specification
+           supported by the application */
+	read property string AtspiVersion;
+
 	/* Gets the locale in which the application is currently running. */
 	method GetLocale {
 		LocaleType locale_type;
diff --git a/xml/Application.xml b/xml/Application.xml
index 0fbb92b..04a2e70 100644
--- a/xml/Application.xml
+++ b/xml/Application.xml
@@ -6,6 +6,7 @@
 
   <property name="Version" type="s" access="read"/>
 
+  <property name="AtspiVersion" type="s" access="read"/>
   <property name="Id" type="i" access="read"/>
 
   <method name="GetLocale">



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]