Fix for 127463, add api for Accessible_getLocalizedRoleName.
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 1 Dec 2003 17:36:07 +0000 (17:36 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 1 Dec 2003 17:36:07 +0000 (17:36 +0000)
git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@563 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
cspi/spi.h
cspi/spi_accessible.c
idl/Accessibility_Accessible.idl
libspi/accessible.c

index c6d6b76..277828c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2003-12-01  Bill Haneman <billh@gnome.org>
 
+       Fix for bug/rfe #127463.
+       
+       * idl/Accessibility_Accessible.idl:
+       (getLocalizedRoleName): New.
+       (unimplemented4): Removed (replaced by above).
+
+       * libspi/accessible.c:
+       (impl_accessibility_accessible_get_local_role_name): New.
+       (spi_accessible_class_init): Add getLocalizedRoleName entry to
+       epv.
+       
+       * cspi/spi.h:
+       (Accessible_getLocalizedRoleName): New.
+
+       * cspi/spi_accessible.c:
+       (Accessible_getLocalizedRoleName): New.
+       
+2003-12-01  Bill Haneman <billh@gnome.org>
+       
        Fix for bug #118581.
        * idl/Accessibility_Text.idl:
        (getDefaultAttributes): New.
index f9e4b0c..eea3257 100644 (file)
@@ -405,6 +405,7 @@ long                 Accessible_getIndexInParent (Accessible *obj);
 AccessibleRelation **Accessible_getRelationSet   (Accessible *obj);
 AccessibleRole       Accessible_getRole          (Accessible *obj);
 char *               Accessible_getRoleName      (Accessible *obj);
+char *               Accessible_getLocalizedRoleName (Accessible *obj);
 AccessibleStateSet * Accessible_getStateSet      (Accessible *obj);
 
 /* Interface query methods */
index 86e27b6..82ad11d 100644 (file)
@@ -499,6 +499,32 @@ Accessible_getRoleName (Accessible *obj)
 }
 
 /**
+ * Accessible_getLocalizedRoleName:
+ * @obj: a pointer to the #Accessible object on which to operate.
+ *
+ * Get a UTF-8 string describing the (localized) role this object plays in the UI.
+ * This method will return useful values for roles that fall outside the
+ * enumeration used in Accessible_getRole ().
+ *
+ * Returns: a UTF-8 string specifying the role of this #Accessible object.
+ *
+ **/
+char *
+Accessible_getLocalizedRoleName (Accessible *obj)
+{
+  char *retval;
+
+  cspi_return_val_if_fail (obj != NULL, CORBA_string_dup ("invalid"));
+
+  retval = 
+    Accessibility_Accessible_getLocalizedRoleName (CSPI_OBJREF (obj), cspi_ev ());
+
+  cspi_return_val_if_ev ("getLocalizedRoleName", CORBA_string_dup ("invalid")); 
+
+  return retval;
+}
+
+/**
  * Accessible_getStateSet:
  * @obj: a pointer to the #Accessible object on which to operate.
  *
index 191ef7d..d9bccd9 100644 (file)
@@ -118,6 +118,15 @@ module Accessibility {
     string             getRoleName ();
 
     /**
+     * getLocalizedRoleName:
+     * Get a string indicating the type of UI role played by this object,
+     * translated to the current locale.
+     *
+     * Returns: a UTF-8 string indicating the type of UI role played by this object.
+     **/
+    string             getLocalizedRoleName ();
+
+    /**
      * getState:
      *
      * Get the current state of the object as a @StateSet.
@@ -128,7 +137,6 @@ module Accessibility {
     void        unImplemented ();
     void        unImplemented2 ();
     void        unImplemented3 ();
-    void        unImplemented4 ();
   };
 };
 
index 9ff6a38..db49f5b 100644 (file)
@@ -405,6 +405,28 @@ impl_accessibility_accessible_get_role_name (PortableServer_Servant servant,
     return CORBA_string_dup ("");
 }
 
+/*
+ * CORBA Accessibility::Accessible::getLocalizedRole method implementation
+ */
+static CORBA_char *
+impl_accessibility_accessible_get_local_role_name (PortableServer_Servant servant,
+                                                  CORBA_Environment     *ev)
+{
+  const gchar     *role_name;
+  AtkRole    role;
+  AtkObject *object = get_atkobject_from_servant (servant);
+
+  g_return_val_if_fail (object != NULL, 0);
+
+  role = atk_object_get_role (object);
+
+  role_name = atk_role_get_localized_name (role);
+  if (role_name)
+    return CORBA_string_dup (role_name);
+  else
+    return CORBA_string_dup ("");
+}
+
 static void
 spi_accessible_class_init (SpiAccessibleClass *klass)
 {
@@ -424,6 +446,7 @@ spi_accessible_class_init (SpiAccessibleClass *klass)
         epv->getState = impl_accessibility_accessible_get_state;
         epv->getRole = impl_accessibility_accessible_get_role;
         epv->getRoleName = impl_accessibility_accessible_get_role_name;
+       epv->getLocalizedRoleName = impl_accessibility_accessible_get_local_role_name;
 }
 
 static void