[g-a-devel]ROLE_APPLICATION



Application toplevel accessibles currently report role "invalid" since
we don't have a role for "application".  That seems suboptimal.

Attached is a patch for at-spi, atk, gail to add this api and set role
to "application" in gail_toplevel_create().

OK to commit?

thanks

-Bill



Index: atk/ChangeLog
===================================================================
RCS file: /cvs/gnome/atk/ChangeLog,v
retrieving revision 1.223
diff -u -r1.223 ChangeLog
--- atk/ChangeLog	18 Nov 2002 17:24:00 -0000	1.223
+++ atk/ChangeLog	20 Nov 2002 14:52:39 -0000
@@ -1,3 +1,15 @@
+2002-11-20  Bill Haneman <bill haneman sun com>
+
+	* atk/atkobject.h:
+	Added ATK_ROLE_APPLICATION.
+
+	* atk/atkobject.c:
+	(atk_role_get_localized_name):
+	Added ATK_ROLE_APPLICATION case.	
+
+	* docs/atk-decl.txt:
+	Added ATK_ROLE_APPLICATION to docs.
+	
 2002-11-18  Abi Brady  <morwen evilmagic org>
 
 	* configure.in: Added "en_GB" to ALL_LINGUAS.
@@ -13,6 +25,7 @@
 	* docs/tmpl/atkhyperlink.sgml docs/tmpl/atkobject.sgml
 	Update docs.
 
+>>>>>>> 1.223
 2002-11-14  Bill Haneman <bill haneman sun com>
 
 	* configure.in:
Index: atk/atk/atkobject.c
===================================================================
RCS file: /cvs/gnome/atk/atk/atkobject.c,v
retrieving revision 1.55
diff -u -r1.55 atkobject.c
--- atk/atk/atkobject.c	14 Nov 2002 17:50:54 -0000	1.55
+++ atk/atk/atkobject.c	20 Nov 2002 14:52:41 -0000
@@ -1398,6 +1398,9 @@
       case ATK_ROLE_RULER:
         name = _("ruler");
         break;
+      case ATK_ROLE_APPLICATION:
+        name = _("application");
+        break;
       default:
         name = atk_role_get_name (role);
         break;
Index: atk/atk/atkobject.h
===================================================================
RCS file: /cvs/gnome/atk/atk/atkobject.h,v
retrieving revision 1.34
diff -u -r1.34 atkobject.h
--- atk/atk/atkobject.h	13 Nov 2002 17:09:04 -0000	1.34
+++ atk/atk/atkobject.h	20 Nov 2002 14:52:43 -0000
@@ -113,6 +113,7 @@
  * ATK_ROLE_FOOTER: An object that serves as a document footer.
  * ATK_ROLE_PARAGRAPH: An object which is contains a paragraph of text content.
  * ATK_ROLE_RULER: An object which describes margins and tab stops, etc. for text objects which it controls (should have CONTROLLER_FOR relation to such).
+ * ATK_ROLE_APPLICATION: The object is an application object, which may contain @ATK_ROLE_FRAME objects or other types of accessibles.
  * ATK_ROLE_LAST_DEFINED: not a valid role, used for finding end of enumeration
  * 
  *Describes the role of an object
@@ -192,6 +193,7 @@
   ATK_ROLE_FOOTER,
   ATK_ROLE_PARAGRAPH,
   ATK_ROLE_RULER,
+  ATK_ROLE_APPLICATION,
   ATK_ROLE_LAST_DEFINED
 } AtkRole;
 
Index: gail/ChangeLog
===================================================================
RCS file: /cvs/gnome/gail/ChangeLog,v
retrieving revision 1.505
diff -u -r1.505 ChangeLog
--- gail/ChangeLog	12 Nov 2002 14:55:36 -0000	1.505
+++ gail/ChangeLog	20 Nov 2002 14:52:50 -0000
@@ -1,3 +1,9 @@
+2002-11-20  Bill Haneman <bill haneman sun com>
+
+	* gail/gailtoplevel.c:
+	(gail_toplevel_new):
+	Set role to ATK_ROLE_APPLICATION.
+
 2002-11-12  Padraig O'Briain  <padraig obriain sun com>
 
 	* gail/gailwindow (filter_func): Add check that GdkWindow in GdkEvent 
Index: gail/gail/gailtoplevel.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailtoplevel.c,v
retrieving revision 1.23
diff -u -r1.23 gailtoplevel.c
--- gail/gail/gailtoplevel.c	30 Aug 2002 07:31:32 -0000	1.23
+++ gail/gail/gailtoplevel.c	20 Nov 2002 14:52:50 -0000
@@ -94,7 +94,7 @@
   g_return_val_if_fail ((object != NULL), NULL);
 
   accessible = ATK_OBJECT (object);
-  accessible->role = ATK_ROLE_INVALID;
+  accessible->role = ATK_ROLE_APPLICATION;
   accessible->name = g_get_prgname();
 
   return accessible;
Index: at-spi/ChangeLog
===================================================================
RCS file: /cvs/gnome/at-spi/ChangeLog,v
retrieving revision 1.261
diff -u -r1.261 ChangeLog
--- at-spi/ChangeLog	20 Nov 2002 11:23:09 -0000	1.261
+++ at-spi/ChangeLog	20 Nov 2002 14:52:56 -0000
@@ -1,3 +1,21 @@
+2002-11-20  Bill Haneman  <bill haneman sun com>
+
+	* cspi/spi_accessible.c:
+	(AccessibleRole_getName):
+	Added necessary strings for making this (deprecated) 
+	method work with the new role types. 
+	(init_role_table, role_table):
+	Added definition of SPI_ROLE_APPLICATION.
+
+	* libspi/spi-roletypes.h:
+	Added SPI_ROLE_APPLICATION.
+
+	* idl/Accessibility_Role.idl:
+	Added ROLE_APPLICATION.	
+
+	* docs/reference/cspi/at-spi-cspi-decl.txt:
+	Added SPI_ROLE_APPLICATION to docs.
+
 2002-11-20  Padraig O'Briain  <padraig obriain sun com>
 
 	* cspi/spi_accessible.c
Index: at-spi/cspi/spi-roletypes.h
===================================================================
RCS file: /cvs/gnome/at-spi/cspi/spi-roletypes.h,v
retrieving revision 1.17
diff -u -r1.17 spi-roletypes.h
--- at-spi/cspi/spi-roletypes.h	19 Nov 2002 13:48:54 -0000	1.17
+++ at-spi/cspi/spi-roletypes.h	20 Nov 2002 14:52:56 -0000
@@ -136,6 +136,8 @@
  * @SPI_ROLE_PARAGRAPH: An object which is contains a paragraph of text content.
  * @SPI_ROLE_RULER: An object which describes margins and tab stops, etc.  for text objects 
  *                  which it controls (should have CONTROLLER_FOR relation to such). 
+ * @SPI_ROLE_APPLICATION: An object which corresponds to a desktop application,
+ *                  which may have children of @SPI_ROLE_FRAME or other type.
  * @SPI_ROLE_LAST_DEFINED: Used to determine the end of the role enumeration.
  **/
 typedef enum
@@ -214,6 +216,7 @@
   SPI_ROLE_FOOTER,
   SPI_ROLE_PARAGRAPH,
   SPI_ROLE_RULER,
+  SPI_ROLE_APPLICATION,
   SPI_ROLE_LAST_DEFINED
 } AccessibleRole;
 
Index: at-spi/cspi/spi_accessible.c
===================================================================
RCS file: /cvs/gnome/at-spi/cspi/spi_accessible.c,v
retrieving revision 1.43
diff -u -r1.43 spi_accessible.c
--- at-spi/cspi/spi_accessible.c	20 Nov 2002 11:23:11 -0000	1.43
+++ at-spi/cspi/spi_accessible.c	20 Nov 2002 14:52:57 -0000
@@ -95,7 +95,12 @@
   "unknown",
   "viewport",
   "window",
-
+  NULL,
+  "header",
+  "fooler",
+  "paragraph",
+  "ruler",
+  "application"
 };
 
 #define MAX_ROLES (sizeof (role_names) / sizeof (char *))
@@ -181,6 +186,7 @@
   role_table [Accessibility_ROLE_FOOTER] = SPI_ROLE_FOOTER;
   role_table [Accessibility_ROLE_PARAGRAPH] = SPI_ROLE_PARAGRAPH;
   role_table [Accessibility_ROLE_RULER] = SPI_ROLE_RULER;
+  role_table [Accessibility_ROLE_APPLICATION] = SPI_ROLE_APPLICATION;
 
   return TRUE;
 }
@@ -281,7 +287,7 @@
 char *
 AccessibleRole_getName (AccessibleRole role)
 {
-  if (role < MAX_ROLES)
+  if (role < MAX_ROLES && role_names [(int) role])
     {
       return CORBA_string_dup (role_names [(int) role]);
     }
Index: at-spi/idl/Accessibility_Role.idl
===================================================================
RCS file: /cvs/gnome/at-spi/idl/Accessibility_Role.idl,v
retrieving revision 1.8
diff -u -r1.8 Accessibility_Role.idl
--- at-spi/idl/Accessibility_Role.idl	15 Nov 2002 15:58:10 -0000	1.8
+++ at-spi/idl/Accessibility_Role.idl	20 Nov 2002 14:52:57 -0000
@@ -257,6 +257,13 @@
    * (should have CONTROLLER_FOR relation to such). 
    */
   ROLE_RULER,
+  /*
+   * An object corresponding to the toplevel accessible of an 
+   * application, which may contain ROLE_FRAME objects or other
+   * accessible objects.  Children of AccessibleDesktop objects 
+   * are generally ROLE_APPLICATION objects.
+   */
+  ROLE_APPLICATION,
   /* not a valid role, used for finding end of enumeration. */
   ROLE_LAST_DEFINED
   };


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