Revved to 1.5.3; added ROLE_EMBEDDED (bug #144415).
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_accessible.c
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2001, 2002 Sun Microsystems Inc.,
6  * Copyright 2001, 2002 Ximian, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #include <stdlib.h> /* for malloc */
25 #include <libspi/stateset.h>
26 #include <cspi/spi-private.h>
27
28 static const char *role_names [] =
29 {
30   "invalid",
31   "accel-label",
32   "alert",
33   "animation",
34   "arrow",
35   "calendar",
36   "canvas",
37   "check-box",
38   "check-menu-item",
39   "color-chooser",
40   "column-header",
41   "combo-box",
42   "date-editor",
43   "desktop-icon",
44   "desktop-frame",
45   "dial",
46   "dialog",
47   "directory-pane",
48   "drawing-area",
49   "file-chooser",
50   "filler",
51   "font-chooser",
52   "frame",
53   "glass-pane",
54   "html-container",
55   "icon",
56   "image",
57   "internalframe",
58   "label",
59   "layered-pane",
60   "list",
61   "list-item",
62   "menu",
63   "menu-bar",
64   "menu-item",
65   "option-pane",
66   "page-tab",
67   "page-tab-list",
68   "panel",
69   "password-text",
70   "popup-menu",
71   "progress-bar",
72   "push-button",
73   "radio-button",
74   "radio-menu-item",
75   "root-pane",
76   "row-header",
77   "scroll-bar",
78   "scroll-pane",
79   "separator",
80   "slider",
81   "spin-button",
82   "split-pane",
83   "statusbar",
84   "table",
85   "table-cell",
86   "table-column-header",
87   "table-row-header",
88   "tear-off-menu-item",
89   "terminal",
90   "text",
91   "toggle-button",
92   "tool-bar",
93   "tool-tip",
94   "tree",
95   "tree-table",
96   "unknown",
97   "viewport",
98   "window",
99   NULL,
100   "header",
101   "fooler",
102   "paragraph",
103   "ruler",
104   "application"
105 };
106
107 #define MAX_ROLES (sizeof (role_names) / sizeof (char *))
108
109 static SPIBoolean
110 cspi_init_role_table (AccessibleRole *role_table)
111 {
112   int i;
113   for (i = 0; i < Accessibility_ROLE_LAST_DEFINED; ++i)
114     {
115       role_table [i] = SPI_ROLE_UNKNOWN;
116     }
117   role_table [Accessibility_ROLE_INVALID] = SPI_ROLE_INVALID;
118   role_table [Accessibility_ROLE_ACCELERATOR_LABEL] = SPI_ROLE_ACCEL_LABEL;
119   role_table [Accessibility_ROLE_ALERT] = SPI_ROLE_ALERT;
120   role_table [Accessibility_ROLE_ANIMATION] = SPI_ROLE_ANIMATION;
121   role_table [Accessibility_ROLE_ARROW] = SPI_ROLE_ARROW;
122   role_table [Accessibility_ROLE_CALENDAR] = SPI_ROLE_CALENDAR;
123   role_table [Accessibility_ROLE_CANVAS] = SPI_ROLE_CANVAS;
124   role_table [Accessibility_ROLE_CHECK_BOX] = SPI_ROLE_CHECK_BOX;
125   role_table [Accessibility_ROLE_CHECK_MENU_ITEM] = SPI_ROLE_CHECK_MENU_ITEM;
126   role_table [Accessibility_ROLE_COLOR_CHOOSER] = SPI_ROLE_COLOR_CHOOSER;
127   role_table [Accessibility_ROLE_COLUMN_HEADER] = SPI_ROLE_COLUMN_HEADER;
128   role_table [Accessibility_ROLE_COMBO_BOX] = SPI_ROLE_COMBO_BOX;
129   role_table [Accessibility_ROLE_DATE_EDITOR] = SPI_ROLE_DATE_EDITOR;
130   role_table [Accessibility_ROLE_DESKTOP_ICON] = SPI_ROLE_DESKTOP_ICON;
131   role_table [Accessibility_ROLE_DESKTOP_FRAME] = SPI_ROLE_DESKTOP_FRAME;
132   role_table [Accessibility_ROLE_DIAL] = SPI_ROLE_DIAL;
133   role_table [Accessibility_ROLE_DIALOG] = SPI_ROLE_DIALOG;
134   role_table [Accessibility_ROLE_DIRECTORY_PANE] = SPI_ROLE_DIRECTORY_PANE;
135   role_table [Accessibility_ROLE_DRAWING_AREA] = SPI_ROLE_DRAWING_AREA;
136   role_table [Accessibility_ROLE_FILE_CHOOSER] = SPI_ROLE_FILE_CHOOSER;
137   role_table [Accessibility_ROLE_FILLER] = SPI_ROLE_FILLER;
138   role_table [Accessibility_ROLE_FONT_CHOOSER] = SPI_ROLE_FONT_CHOOSER;
139   role_table [Accessibility_ROLE_FRAME] = SPI_ROLE_FRAME;
140   role_table [Accessibility_ROLE_GLASS_PANE] = SPI_ROLE_GLASS_PANE;
141   role_table [Accessibility_ROLE_HTML_CONTAINER] = SPI_ROLE_HTML_CONTAINER;
142   role_table [Accessibility_ROLE_ICON] = SPI_ROLE_ICON;
143   role_table [Accessibility_ROLE_IMAGE] = SPI_ROLE_IMAGE;
144   role_table [Accessibility_ROLE_INTERNAL_FRAME] = SPI_ROLE_INTERNAL_FRAME;
145   role_table [Accessibility_ROLE_LABEL] = SPI_ROLE_LABEL;
146   role_table [Accessibility_ROLE_LAYERED_PANE] = SPI_ROLE_LAYERED_PANE;
147   role_table [Accessibility_ROLE_LIST] = SPI_ROLE_LIST;
148   role_table [Accessibility_ROLE_LIST_ITEM] = SPI_ROLE_LIST_ITEM;
149   role_table [Accessibility_ROLE_MENU] = SPI_ROLE_MENU;
150   role_table [Accessibility_ROLE_MENU_BAR] = SPI_ROLE_MENU_BAR;
151   role_table [Accessibility_ROLE_MENU_ITEM] = SPI_ROLE_MENU_ITEM;
152   role_table [Accessibility_ROLE_OPTION_PANE] = SPI_ROLE_OPTION_PANE;
153   role_table [Accessibility_ROLE_PAGE_TAB] = SPI_ROLE_PAGE_TAB;
154   role_table [Accessibility_ROLE_PAGE_TAB_LIST] = SPI_ROLE_PAGE_TAB_LIST;
155   role_table [Accessibility_ROLE_PANEL] = SPI_ROLE_PANEL;
156   role_table [Accessibility_ROLE_PASSWORD_TEXT] = SPI_ROLE_PASSWORD_TEXT;
157   role_table [Accessibility_ROLE_POPUP_MENU] = SPI_ROLE_POPUP_MENU;
158   role_table [Accessibility_ROLE_PROGRESS_BAR] = SPI_ROLE_PROGRESS_BAR;
159   role_table [Accessibility_ROLE_PUSH_BUTTON] = SPI_ROLE_PUSH_BUTTON;
160   role_table [Accessibility_ROLE_RADIO_BUTTON] = SPI_ROLE_RADIO_BUTTON;
161   role_table [Accessibility_ROLE_RADIO_MENU_ITEM] = SPI_ROLE_RADIO_MENU_ITEM;
162   role_table [Accessibility_ROLE_ROOT_PANE] = SPI_ROLE_ROOT_PANE;
163   role_table [Accessibility_ROLE_ROW_HEADER] = SPI_ROLE_ROW_HEADER;
164   role_table [Accessibility_ROLE_SCROLL_BAR] = SPI_ROLE_SCROLL_BAR;
165   role_table [Accessibility_ROLE_SCROLL_PANE] = SPI_ROLE_SCROLL_PANE;
166   role_table [Accessibility_ROLE_SEPARATOR] = SPI_ROLE_SEPARATOR;
167   role_table [Accessibility_ROLE_SLIDER] = SPI_ROLE_SLIDER;
168   role_table [Accessibility_ROLE_SPIN_BUTTON] = SPI_ROLE_SPIN_BUTTON;
169   role_table [Accessibility_ROLE_SPLIT_PANE] = SPI_ROLE_SPLIT_PANE;
170   role_table [Accessibility_ROLE_STATUS_BAR] = SPI_ROLE_STATUS_BAR;
171   role_table [Accessibility_ROLE_TABLE] = SPI_ROLE_TABLE;
172   role_table [Accessibility_ROLE_TABLE_CELL] = SPI_ROLE_TABLE_CELL;
173   role_table[Accessibility_ROLE_TABLE_COLUMN_HEADER] = SPI_ROLE_TABLE_COLUMN_HEADER;
174   role_table[Accessibility_ROLE_TABLE_ROW_HEADER] = SPI_ROLE_TABLE_ROW_HEADER;
175   role_table [Accessibility_ROLE_TEAROFF_MENU_ITEM] = SPI_ROLE_TEAROFF_MENU_ITEM;
176   role_table[Accessibility_ROLE_TERMINAL] = SPI_ROLE_TERMINAL;
177   role_table [Accessibility_ROLE_TEXT] = SPI_ROLE_TEXT;
178   role_table [Accessibility_ROLE_TOGGLE_BUTTON] = SPI_ROLE_TOGGLE_BUTTON;
179   role_table [Accessibility_ROLE_TOOL_BAR] = SPI_ROLE_TOOL_BAR;
180   role_table [Accessibility_ROLE_TOOL_TIP] = SPI_ROLE_TOOL_TIP;
181   role_table [Accessibility_ROLE_TREE] = SPI_ROLE_TREE;
182   role_table [Accessibility_ROLE_TREE_TABLE] = SPI_ROLE_TREE_TABLE;
183   role_table [Accessibility_ROLE_VIEWPORT] = SPI_ROLE_VIEWPORT;
184   role_table [Accessibility_ROLE_WINDOW] = SPI_ROLE_WINDOW;
185   role_table [Accessibility_ROLE_EXTENDED] = SPI_ROLE_EXTENDED;
186   role_table [Accessibility_ROLE_HEADER] = SPI_ROLE_HEADER;
187   role_table [Accessibility_ROLE_FOOTER] = SPI_ROLE_FOOTER;
188   role_table [Accessibility_ROLE_PARAGRAPH] = SPI_ROLE_PARAGRAPH;
189   role_table [Accessibility_ROLE_RULER] = SPI_ROLE_RULER;
190   role_table [Accessibility_ROLE_APPLICATION] = SPI_ROLE_APPLICATION;
191   role_table [Accessibility_ROLE_AUTOCOMPLETE] = SPI_ROLE_AUTOCOMPLETE;
192   role_table [Accessibility_ROLE_EDITBAR] = SPI_ROLE_EDITBAR;
193   role_table [Accessibility_ROLE_EMBEDDED] = SPI_ROLE_EMBEDDED;
194
195   return TRUE;
196 }
197
198 static AccessibleRole
199 cspi_role_from_spi_role (Accessibility_Role role)
200 {
201   /* array is sized according to IDL roles because IDL roles are the index */   
202   static AccessibleRole cspi_role_table [Accessibility_ROLE_LAST_DEFINED];
203   static SPIBoolean is_initialized = FALSE;
204   AccessibleRole cspi_role;
205   if (!is_initialized)
206     {
207       is_initialized = cspi_init_role_table (cspi_role_table);      
208     }
209   if (role >= 0 && role < Accessibility_ROLE_LAST_DEFINED)
210     {
211       cspi_role = cspi_role_table [role];           
212     }
213   else
214     {
215       cspi_role = SPI_ROLE_EXTENDED;
216     }
217   return cspi_role; 
218 }
219
220 /**
221  * AccessibleRole_getName:
222  * @role: an #AccessibleRole object to query.
223  *
224  * Get a localizeable string that indicates the name of an #AccessibleRole.
225  * <em>DEPRECATED.</em>
226  *
227  * Returns: a localizable string name for an #AccessibleRole enumerated type.
228  **/
229 char *
230 AccessibleRole_getName (AccessibleRole role)
231 {
232   if (role < MAX_ROLES && role_names [(int) role])
233     {
234       return CORBA_string_dup (role_names [(int) role]);
235     }
236   else
237     {
238       return CORBA_string_dup ("");
239     }
240 }
241
242 /**
243  * Accessible_ref:
244  * @obj: a pointer to the #Accessible object on which to operate.
245  *
246  * Increment the reference count for an #Accessible object.
247  **/
248 void
249 Accessible_ref (Accessible *obj)
250 {
251   cspi_object_ref (obj);
252 }
253
254 /**
255  * Accessible_unref:
256  * @obj: a pointer to the #Accessible object on which to operate.
257  *
258  * Decrement the reference count for an #Accessible object.
259  **/
260 void
261 Accessible_unref (Accessible *obj)
262 {
263   cspi_object_unref (obj);
264 }
265
266 /**
267  * Accessible_getName:
268  * @obj: a pointer to the #Accessible object on which to operate.
269  *
270  * Get the name of an #Accessible object.
271  *
272  * Returns: a UTF-8 string indicating the name of the #Accessible object.
273  * or NULL on exception
274  **/
275 char *
276 Accessible_getName (Accessible *obj)
277 {
278   char *retval;
279
280   cspi_return_val_if_fail (obj != NULL, NULL);
281
282   retval = Accessibility_Accessible__get_name (CSPI_OBJREF (obj), cspi_ev ());
283
284   cspi_return_val_if_ev ("getName", NULL); 
285
286   return retval;
287 }
288
289 /**
290  * Accessible_getDescription:
291  * @obj: a pointer to the #Accessible object on which to operate.
292  *
293  * Get the description of an #Accessible object.
294  *
295  * Returns: a UTF-8 string describing the #Accessible object.
296  * or NULL on exception
297  **/
298 char *
299 Accessible_getDescription (Accessible *obj)
300 {
301   char *retval;
302
303   cspi_return_val_if_fail (obj != NULL, NULL);
304
305   retval = Accessibility_Accessible__get_description (CSPI_OBJREF (obj),
306                                                cspi_ev ());
307
308   cspi_return_val_if_ev ("getDescription", NULL); 
309
310   return retval;
311 }
312
313 /**
314  * Accessible_getParent:
315  * @obj: a pointer to the #Accessible object to query.
316  *
317  * Get an #Accessible object's parent container.
318  *
319  * Returns: a pointer tothe #Accessible object which contains the given
320  *          #Accessible instance, or NULL if the @obj has no parent container.
321  *
322  **/
323 Accessible *
324 Accessible_getParent (Accessible *obj)
325 {
326   Accessible *retval;
327
328   cspi_return_val_if_fail (obj != NULL, NULL);
329
330   retval = cspi_object_add (
331     Accessibility_Accessible__get_parent (CSPI_OBJREF (obj),
332                                           cspi_ev ()));
333
334   cspi_return_val_if_ev ("getParent", NULL); 
335
336   return retval;
337 }
338
339 /**
340  * Accessible_getChildCount:
341  * @obj: a pointer to the #Accessible object on which to operate.
342  *
343  * Get the number of children contained by an #Accessible object.
344  *
345  * Returns: a #long indicating the number of #Accessible children
346  *          contained by an #Accessible object. or -1 on exception
347  *
348  **/
349 long
350 Accessible_getChildCount (Accessible *obj)
351 {
352   long retval;
353
354   cspi_return_val_if_fail (obj != NULL, -1);
355
356   retval = Accessibility_Accessible__get_childCount (CSPI_OBJREF (obj),
357                                               cspi_ev ());
358
359   cspi_return_val_if_ev ("getChildCount", -1); 
360
361   return retval;
362 }
363
364 /**
365  * Accessible_getChildAtIndex:
366  * @obj: a pointer to the #Accessible object on which to operate.
367  * @childIndex: a #long indicating which child is specified.
368  *
369  * Get the #Accessible child of an #Accessible object at a given index.
370  *
371  * Returns: a pointer to the #Accessible child object at index
372  *          @childIndex. or NULL on exception
373  **/
374 Accessible *
375 Accessible_getChildAtIndex (Accessible *obj,
376                             long int    childIndex)
377 {
378   Accessible *retval;
379
380   cspi_return_val_if_fail (obj != NULL, NULL);
381
382   retval = cspi_object_add (
383     Accessibility_Accessible_getChildAtIndex (CSPI_OBJREF (obj),
384                                               childIndex, cspi_ev ()));
385
386   cspi_return_val_if_ev ("getChildAtIndex", NULL);
387   return retval;
388 }
389
390 /**
391  * Accessible_getIndexInParent:
392  * @obj: a pointer to the #Accessible object on which to operate.
393  *
394  * Get the index of an #Accessible object in its containing #Accessible.
395  *
396  * Returns: a #long indicating the index of the #Accessible object
397  *          in its parent (i.e. containing) #Accessible instance,
398  *          or -1 if @obj has no containing parent or on exception.
399  **/
400 long
401 Accessible_getIndexInParent (Accessible *obj)
402 {
403   long retval;
404
405   cspi_return_val_if_fail (obj != NULL, -1);
406
407   retval = Accessibility_Accessible_getIndexInParent (CSPI_OBJREF (obj), cspi_ev ());
408
409   cspi_return_val_if_ev ("getIndexInparent", -1); 
410   return retval;
411 }
412
413 /**
414  * Accessible_getRelationSet:
415  * @obj: a pointer to the #Accessible object on which to operate.
416  *
417  * Get the set of #AccessibleRelation objects which describe this #Accessible object's
418  *       relationships with other #Accessible objects.
419  *
420  * Returns: an array of #AccessibleRelation pointers. or NULL on exception
421  **/
422 AccessibleRelation **
423 Accessible_getRelationSet (Accessible *obj)
424 {
425   int i;
426   int n_relations;
427   AccessibleRelation **relations;
428   Accessibility_RelationSet *relation_set;
429
430   cspi_return_val_if_fail (obj != NULL, NULL);
431
432   g_assert (!cspi_exception ());
433
434   relation_set =
435     Accessibility_Accessible_getRelationSet (CSPI_OBJREF (obj), cspi_ev ());
436
437   cspi_return_val_if_ev ("getRelationSet", NULL); 
438   
439   n_relations = relation_set->_length;
440   relations = malloc (sizeof (AccessibleRelation *) * (n_relations + 1));
441   
442   for (i = 0; i < n_relations; ++i)
443     {
444       relations[i] = cspi_object_add (CORBA_Object_duplicate (
445               relation_set->_buffer[i], cspi_ev ()));
446     }
447   relations[i] = NULL;
448
449   CORBA_free (relation_set);
450
451   return relations;
452 }
453
454 /**
455  * Accessible_getRole:
456  * @obj: a pointer to the #Accessible object on which to operate.
457  *
458  * Get the UI role of an #Accessible object.
459  * A UTF-8 string describing this role can be obtained via Accessible_getRoleName ().
460  *
461  * Returns: the #AccessibleRole of the object.
462  *
463  **/
464 AccessibleRole
465 Accessible_getRole (Accessible *obj)
466 {
467   Accessibility_Role retval;
468
469   cspi_return_val_if_fail (obj != NULL, SPI_ROLE_INVALID);
470
471   retval = 
472     Accessibility_Accessible_getRole (CSPI_OBJREF (obj), cspi_ev ());
473
474   cspi_return_val_if_ev ("getRole", SPI_ROLE_INVALID); 
475
476   return cspi_role_from_spi_role (retval);
477 }
478
479 /**
480  * Accessible_getRoleName:
481  * @obj: a pointer to the #Accessible object on which to operate.
482  *
483  * Get a UTF-8 string describing the role this object plays in the UI.
484  * This method will return useful values for roles that fall outside the
485  * enumeration used in Accessible_getRole ().
486  *
487  * Returns: a UTF-8 string specifying the role of this #Accessible object.
488  *
489  **/
490 char *
491 Accessible_getRoleName (Accessible *obj)
492 {
493   char *retval;
494
495   cspi_return_val_if_fail (obj != NULL, CORBA_string_dup ("invalid"));
496
497   retval = 
498     Accessibility_Accessible_getRoleName (CSPI_OBJREF (obj), cspi_ev ());
499
500   cspi_return_val_if_ev ("getRoleName", CORBA_string_dup ("invalid")); 
501
502   return retval;
503 }
504
505 /**
506  * Accessible_getLocalizedRoleName:
507  * @obj: a pointer to the #Accessible object on which to operate.
508  *
509  * Get a UTF-8 string describing the (localized) role this object plays in the UI.
510  * This method will return useful values for roles that fall outside the
511  * enumeration used in Accessible_getRole ().
512  *
513  * Returns: a UTF-8 string specifying the role of this #Accessible object.
514  *
515  **/
516 char *
517 Accessible_getLocalizedRoleName (Accessible *obj)
518 {
519   char *retval;
520
521   cspi_return_val_if_fail (obj != NULL, CORBA_string_dup ("invalid"));
522
523   retval = 
524     Accessibility_Accessible_getLocalizedRoleName (CSPI_OBJREF (obj), cspi_ev ());
525
526   cspi_return_val_if_ev ("getLocalizedRoleName", CORBA_string_dup ("invalid")); 
527
528   return retval;
529 }
530
531 /**
532  * Accessible_getStateSet:
533  * @obj: a pointer to the #Accessible object on which to operate.
534  *
535  * Returns: a pointer to an #AccessibleStateSet representing the object's current state.
536  **/
537 AccessibleStateSet *
538 Accessible_getStateSet (Accessible *obj)
539 {
540   AccessibleStateSet *retval;
541   Accessibility_StateSet corba_stateset;
542   Accessibility_StateSeq *corba_seq;
543
544   cspi_return_val_if_fail (obj != NULL, NULL);
545
546   corba_stateset = Accessibility_Accessible_getState (
547           CSPI_OBJREF (obj), cspi_ev ());
548   cspi_return_val_if_ev ("getState", NULL);
549
550   cspi_return_val_if_fail (corba_stateset != CORBA_OBJECT_NIL, NULL);
551   cspi_return_val_if_fail (cspi_ping (corba_stateset), NULL);
552   corba_seq = Accessibility_StateSet_getStates (corba_stateset, cspi_ev ());
553   cspi_return_val_if_ev ("getState", NULL);
554
555   retval = spi_state_set_cache_new (corba_seq);
556
557   CORBA_free (corba_seq);
558   cspi_release_unref (corba_stateset);
559
560   return retval;
561 }
562
563 /* Interface query methods */
564
565 /**
566  * Accessible_isAction:
567  * @obj: a pointer to the #Accessible instance to query.
568  *
569  * Query whether the specified #Accessible implements #AccessibleAction.
570  *
571  * Returns: #TRUE if @obj implements the #AccessibleAction interface,
572  *          #FALSE otherwise.
573  **/
574 SPIBoolean
575 Accessible_isAction (Accessible *obj)
576 {
577   return cspi_accessible_is_a (obj,
578                               "IDL:Accessibility/Action:1.0");
579 }
580
581 /**
582  * Accessible_isApplication:
583  * @obj: a pointer to the #Accessible instance to query.
584  *
585  * Query whether the specified #Accessible implements #AccessibleApplication.
586  *
587  * Returns: #TRUE if @obj implements the #AccessibleApplication interface,
588  *          #FALSE otherwise.
589  **/
590 SPIBoolean
591 Accessible_isApplication (Accessible *obj)
592 {
593   return cspi_accessible_is_a (obj,
594                               "IDL:Accessibility/Application:1.0");
595 }
596
597 /**
598  * Accessible_isComponent:
599  * @obj: a pointer to the #Accessible instance to query.
600  *
601  * Query whether the specified #Accessible implements #AccessibleComponent.
602  *
603  * Returns: #TRUE if @obj implements the #AccessibleComponent interface,
604  *          #FALSE otherwise.
605  **/
606 SPIBoolean
607 Accessible_isComponent (Accessible *obj)
608 {
609   return cspi_accessible_is_a (obj,
610                               "IDL:Accessibility/Component:1.0");
611 }
612
613 /**
614  * Accessible_isEditableText:
615  * @obj: a pointer to the #Accessible instance to query.
616  *
617  * Query whether the specified #Accessible implements #AccessibleEditableText.
618  *
619  * Returns: #TRUE if @obj implements the #AccessibleEditableText interface,
620  *          #FALSE otherwise.
621  **/
622 SPIBoolean
623 Accessible_isEditableText (Accessible *obj)
624 {
625   return cspi_accessible_is_a (obj,
626                               "IDL:Accessibility/EditableText:1.0");
627 }
628
629 /**
630  * Accessible_isHypertext:
631  * @obj: a pointer to the #Accessible instance to query.
632  *
633  * Query whether the specified #Accessible implements #AccessibleHypertext.
634  *
635  * Returns: #TRUE if @obj implements the #AccessibleHypertext interface,
636  *          #FALSE otherwise.
637  **/
638 SPIBoolean
639 Accessible_isHypertext (Accessible *obj)
640 {
641   return cspi_accessible_is_a (obj,
642                               "IDL:Accessibility/Hypertext:1.0");
643 }
644
645 /**
646  * Accessible_isImage:
647  * @obj: a pointer to the #Accessible instance to query.
648  *
649  * Query whether the specified #Accessible implements #AccessibleImage.
650  *
651  * Returns: #TRUE if @obj implements the #AccessibleImage interface,
652  *          #FALSE otherwise.
653 **/
654 SPIBoolean
655 Accessible_isImage (Accessible *obj)
656 {
657   return cspi_accessible_is_a (obj,
658                               "IDL:Accessibility/Image:1.0");
659 }
660
661 /**
662  * Accessible_isSelection:
663  * @obj: a pointer to the #Accessible instance to query.
664  *
665  * Query whether the specified #Accessible implements #AccessibleSelection.
666  *
667  * Returns: #TRUE if @obj implements the #AccessibleSelection interface,
668  *          #FALSE otherwise.
669 **/
670 SPIBoolean
671 Accessible_isSelection (Accessible *obj)
672 {
673   return cspi_accessible_is_a (obj,
674                               "IDL:Accessibility/Selection:1.0");
675 }
676
677 /**
678  * Accessible_isTable:
679  * @obj: a pointer to the #Accessible instance to query.
680  *
681  * Query whether the specified #Accessible implements #AccessibleTable.
682  *
683  * Returns: #TRUE if @obj implements the #AccessibleTable interface,
684  *          #FALSE otherwise.
685 **/
686 SPIBoolean
687 Accessible_isTable (Accessible *obj)
688 {
689   return cspi_accessible_is_a (obj,
690                               "IDL:Accessibility/Table:1.0");
691 }
692
693 /**
694  * Accessible_isStreamableContent:
695  * @obj: a pointer to the #Accessible instance to query.
696  *
697  * Query whether the specified #Accessible implements
698  *          #AccessibleStreamableContent.
699  *
700  * Returns: #TRUE if @obj implements the #AccessibleStreamableContent interface,
701  *          #FALSE otherwise.
702 **/
703 SPIBoolean
704 Accessible_isStreamableContent (Accessible *obj)
705 {
706   return cspi_accessible_is_a (obj,
707                               "IDL:Accessibility/StreamableContent:1.0");
708 }
709
710 /**
711  * Accessible_isText:
712  * @obj: a pointer to the #Accessible instance to query.
713  *
714  * Query whether the specified #Accessible implements #AccessibleText.
715  *
716  * Returns: #TRUE if @obj implements the #AccessibleText interface,
717  *          #FALSE otherwise.
718 **/
719 SPIBoolean
720 Accessible_isText (Accessible *obj)
721 {
722   return cspi_accessible_is_a (obj,
723                               "IDL:Accessibility/Text:1.0");
724 }
725
726 /**
727  * Accessible_isValue:
728  * @obj: a pointer to the #Accessible instance to query.
729  *
730  * Query whether the specified #Accessible implements #AccessibleValue.
731  *
732  * Returns: #TRUE if @obj implements the #AccessibleValue interface,
733  *          #FALSE otherwise.
734 **/
735 SPIBoolean
736 Accessible_isValue (Accessible *obj)
737 {
738   return cspi_accessible_is_a (obj,
739                               "IDL:Accessibility/Value:1.0");
740 }
741
742 /**
743  * Accessible_getApplication:
744  * @obj: a pointer to the #Accessible instance to query.
745  *
746  * Get the #AccessibleApplication interface for an #Accessible.
747  *
748  * Returns: a pointer to an #AccessibleApplication interface instance, or
749  *          NULL if @obj does not implement #AccessibleApplication.
750  **/
751 AccessibleApplication *
752 Accessible_getApplication (Accessible *obj)
753 {
754   return (AccessibleApplication *) Accessible_queryInterface (
755           obj, "IDL:Accessibility/Application:1.0");
756 }
757
758 /**
759  * Accessible_getAction:
760  * @obj: a pointer to the #Accessible instance to query.
761  *
762  * Get the #AccessibleAction interface for an #Accessible.
763  *
764  * Returns: a pointer to an #AccessibleAction interface instance, or
765  *          NULL if @obj does not implement #AccessibleAction.
766  **/
767 AccessibleAction *
768 Accessible_getAction (Accessible *obj)
769 {
770   return (AccessibleAction *) Accessible_queryInterface (
771           obj, "IDL:Accessibility/Action:1.0");
772 }
773
774 /**
775  * Accessible_getComponent:
776  * @obj: a pointer to the #Accessible instance to query.
777  *
778  * Get the #AccessibleComponent interface for an #Accessible.
779  *
780  * Returns: a pointer to an #AccessibleComponent interface instance, or
781  *          NULL if @obj does not implement #AccessibleComponent.
782  **/
783 AccessibleComponent *
784 Accessible_getComponent (Accessible *obj)
785 {
786   return (AccessibleComponent *) Accessible_queryInterface (
787           obj, "IDL:Accessibility/Component:1.0");
788 }
789
790 /**
791  * Accessible_getEditableText:
792  * @obj: a pointer to the #Accessible instance to query.
793  *
794  * Get the #AccessibleEditableText interface for an #Accessible.
795  *
796  * Returns: a pointer to an #AccessibleEditableText interface instance, or
797  *          NULL if @obj does not implement #AccessibleEditableText.
798  **/
799 AccessibleEditableText *
800 Accessible_getEditableText (Accessible *obj)
801 {
802   return (AccessibleEditableText *) Accessible_queryInterface (
803           obj, "IDL:Accessibility/EditableText:1.0");
804 }
805
806
807
808 /**
809  * Accessible_getHypertext:
810  * @obj: a pointer to the #Accessible instance to query.
811  *
812  * Get the #AccessibleHypertext interface for an #Accessible.
813  *
814  * Returns: a pointer to an #AccessibleHypertext interface instance, or
815  *          NULL if @obj does not implement #AccessibleHypertext.
816  **/
817 AccessibleHypertext *
818 Accessible_getHypertext (Accessible *obj)
819 {
820   return (AccessibleHypertext *) Accessible_queryInterface (
821           obj, "IDL:Accessibility/Hypertext:1.0");
822 }
823
824
825
826 /**
827  * Accessible_getImage:
828  * @obj: a pointer to the #Accessible instance to query.
829  *
830  * Get the #AccessibleImage interface for an #Accessible.
831  *
832  * Returns: a pointer to an #AccessibleImage interface instance, or
833  *          NULL if @obj does not implement #AccessibleImage.
834  **/
835 AccessibleImage *
836 Accessible_getImage (Accessible *obj)
837 {
838   return (AccessibleImage *) Accessible_queryInterface (
839           obj, "IDL:Accessibility/Image:1.0");
840 }
841
842
843
844 /**
845  * Accessible_getSelection:
846  * @obj: a pointer to the #Accessible instance to query.
847  *
848  * Get the #AccessibleSelection interface for an #Accessible.
849  *
850  * Returns: a pointer to an #AccessibleSelection interface instance, or
851  *          NULL if @obj does not implement #AccessibleSelection.
852  **/
853 AccessibleSelection *
854 Accessible_getSelection (Accessible *obj)
855 {
856   return (AccessibleSelection *) Accessible_queryInterface (
857           obj, "IDL:Accessibility/Selection:1.0");
858 }
859
860
861
862 /**
863  * Accessible_getStreamableContent:
864  * @obj: a pointer to the #Accessible instance to query.
865  *
866  * Get the #AccessibleStreamableContent interface for an #Accessible.
867  *
868  * Returns: a pointer to an #AccessibleStreamableContent interface instance, or
869  *          NULL if @obj does not implement #AccessibleStreamableContent.
870  **/
871 AccessibleStreamableContent *
872 Accessible_getStreamableContent (Accessible *obj)
873 {
874   return (AccessibleStreamableContent *) Accessible_queryInterface (
875           obj, "IDL:Accessibility/StreamableContent:1.0");
876 }
877
878 /**
879  * Accessible_getTable:
880  * @obj: a pointer to the #Accessible instance to query.
881  *
882  * Get the #AccessibleTable interface for an #Accessible.
883  *
884  * Returns: a pointer to an #AccessibleTable interface instance, or
885  *          NULL if @obj does not implement #AccessibleTable.
886  **/
887 AccessibleTable *
888 Accessible_getTable (Accessible *obj)
889 {
890   return (AccessibleTable *) Accessible_queryInterface (
891           obj, "IDL:Accessibility/Table:1.0");
892 }
893
894 /**
895  * Accessible_getText:
896  * @obj: a pointer to the #Accessible instance to query.
897  *
898  * Get the #AccessibleText interface for an #Accessible.
899  *
900  * Returns: a pointer to an #AccessibleText interface instance, or
901  *          NULL if @obj does not implement #AccessibleText.
902  **/
903 AccessibleText *
904 Accessible_getText (Accessible *obj)
905 {
906   return (AccessibleText *) Accessible_queryInterface (
907           obj, "IDL:Accessibility/Text:1.0");
908 }
909
910
911
912 /**
913  * Accessible_getValue:
914  * @obj: a pointer to the #Accessible instance to query.
915  *
916  * Get the #AccessibleValue interface for an #Accessible.
917  *
918  * Returns: a pointer to an #AccessibleValue interface instance, or
919  *          NULL if @obj does not implement #AccessibleValue.
920  **/
921 AccessibleValue *
922 Accessible_getValue (Accessible *obj)
923 {
924   return (AccessibleValue *) Accessible_queryInterface (
925           obj, "IDL:Accessibility/Value:1.0");
926 }
927
928
929
930 /**
931  * Accessible_queryInterface:
932  * @obj: a pointer to the #Accessible instance to query.
933  * @interface_name: a UTF-8 character string specifiying the requested interface.
934  *
935  * Query an #Accessible object to for a named interface.
936  *
937  * Returns: an instance of the named interface object, if it is implemented
938  *          by @obj, or NULL otherwise.
939  *
940  **/
941 AccessibleUnknown *
942 Accessible_queryInterface (Accessible *obj,
943                            const char *interface_name)
944 {
945   Bonobo_Unknown iface;
946   
947   if (!obj)
948     {
949       return NULL;
950     }
951
952   iface = Accessibility_Accessible_queryInterface (CSPI_OBJREF (obj),
953                                                    interface_name,
954                                                    cspi_ev ());
955
956
957   cspi_return_val_if_ev ("queryInterface", NULL); 
958
959   /*
960    * FIXME: we need to be fairly sure that references are going
961    * to mach up if we are going to expose QueryInterface, ie. we
962    * can't allow people to do:
963    * b = a.qi ("b"); b.unref, b.unref to release a's reference.
964    * this should be no real problem though for this level of API
965    * user.
966    */
967
968   return cspi_object_add (iface);
969 }
970
971
972 /**
973  * AccessibleRelation_ref:
974  * @obj: a pointer to the #AccessibleRelation object on which to operate.
975  *
976  * Increment the reference count for an #AccessibleRelation object.
977  *
978  **/
979 void
980 AccessibleRelation_ref (AccessibleRelation *obj)
981 {
982   cspi_object_ref (obj);
983 }
984
985 /**
986  * AccessibleRelation_unref:
987  * @obj: a pointer to the #AccessibleRelation object on which to operate.
988  *
989  * Decrement the reference count for an #AccessibleRelation object.
990  *
991  **/
992 void
993 AccessibleRelation_unref (AccessibleRelation *obj)
994 {
995   cspi_object_unref (obj);
996 }
997
998 static SPIBoolean
999 cspi_init_relation_type_table (AccessibleRelationType *relation_type_table)
1000 {
1001   int i;
1002   for (i = 0; i < Accessibility_RELATION_LAST_DEFINED; ++i)
1003     {
1004       relation_type_table [i] = SPI_RELATION_NULL;
1005     }
1006   relation_type_table [Accessibility_RELATION_NULL] = SPI_RELATION_NULL;
1007   relation_type_table [Accessibility_RELATION_LABEL_FOR] = SPI_RELATION_LABEL_FOR;
1008   relation_type_table [Accessibility_RELATION_LABELLED_BY] = SPI_RELATION_LABELED_BY;
1009   relation_type_table [Accessibility_RELATION_CONTROLLER_FOR] = SPI_RELATION_CONTROLLER_FOR;
1010   relation_type_table [Accessibility_RELATION_CONTROLLED_BY] = SPI_RELATION_CONTROLLED_BY;
1011   relation_type_table [Accessibility_RELATION_MEMBER_OF] = SPI_RELATION_MEMBER_OF;
1012   relation_type_table [Accessibility_RELATION_TOOLTIP_FOR] = SPI_RELATION_NULL;
1013   relation_type_table [Accessibility_RELATION_NODE_CHILD_OF] = SPI_RELATION_NODE_CHILD_OF;
1014   relation_type_table [Accessibility_RELATION_EXTENDED] = SPI_RELATION_EXTENDED;
1015   relation_type_table [Accessibility_RELATION_FLOWS_TO] = SPI_RELATION_FLOWS_TO;
1016   relation_type_table [Accessibility_RELATION_FLOWS_FROM] = SPI_RELATION_FLOWS_FROM;
1017   relation_type_table [Accessibility_RELATION_SUBWINDOW_OF] = SPI_RELATION_SUBWINDOW_OF;
1018   relation_type_table [Accessibility_RELATION_EMBEDS] = SPI_RELATION_EMBEDS;
1019   relation_type_table [Accessibility_RELATION_EMBEDDED_BY] = SPI_RELATION_EMBEDDED_BY;
1020   relation_type_table [Accessibility_RELATION_POPUP_FOR] = SPI_RELATION_POPUP_FOR;
1021   return TRUE;
1022 }
1023
1024 static AccessibleRelationType
1025 cspi_relation_type_from_spi_relation_type (Accessibility_RelationType type)
1026 {
1027   /* array is sized according to IDL RelationType because IDL RelationTypes are the index */    
1028   static AccessibleRelationType cspi_relation_type_table [Accessibility_RELATION_LAST_DEFINED];
1029   static SPIBoolean is_initialized = FALSE;
1030   AccessibleRelationType cspi_type;
1031   if (!is_initialized)
1032     {
1033       is_initialized = cspi_init_relation_type_table (cspi_relation_type_table);            
1034     }
1035   if (type >= 0 && type < Accessibility_RELATION_LAST_DEFINED)
1036     {
1037       cspi_type = cspi_relation_type_table [type];          
1038     }
1039   else
1040     {
1041       cspi_type = SPI_RELATION_NULL;
1042     }
1043   return cspi_type; 
1044 }
1045 /**
1046  * AccessibleRelation_getRelationType:
1047  * @obj: a pointer to the #AccessibleRelation object to query.
1048  *
1049  * Get the type of relationship represented by an #AccessibleRelation.
1050  *
1051  * Returns: an #AccessibleRelationType indicating the type of relation
1052  *         encapsulated in this #AccessibleRelation object.
1053  *
1054  **/
1055 AccessibleRelationType
1056 AccessibleRelation_getRelationType (AccessibleRelation *obj)
1057 {
1058   Accessibility_RelationType retval;
1059   
1060   cspi_return_val_if_fail (obj, SPI_RELATION_NULL);
1061   retval =
1062     Accessibility_Relation_getRelationType (CSPI_OBJREF (obj), cspi_ev());
1063   cspi_return_val_if_ev ("getRelationType", SPI_RELATION_NULL);
1064   return cspi_relation_type_from_spi_relation_type (retval);
1065 }
1066
1067 /**
1068  * AccessibleRelation_getNTargets:
1069  * @obj: a pointer to the #AccessibleRelation object to query.
1070  *
1071  * Get the number of objects which this relationship has as its
1072  *       target objects (the subject is the #Accessible from which this
1073  *       #AccessibleRelation originated).
1074  *
1075  * Returns: a short integer indicating how many target objects which the
1076  *       originating #Accessible object has the #AccessibleRelation
1077  *       relationship with.
1078  **/
1079 int
1080 AccessibleRelation_getNTargets (AccessibleRelation *obj)
1081 {
1082   int retval;
1083   
1084   cspi_return_val_if_fail (obj, -1);
1085   retval = Accessibility_Relation_getNTargets (CSPI_OBJREF (obj), cspi_ev());
1086   cspi_return_val_if_ev ("getNTargets", -1);
1087   return retval;
1088 }
1089
1090 /**
1091  * AccessibleRelation_getTarget:
1092  * @obj: a pointer to the #AccessibleRelation object to query.
1093  * @i: a (zero-index) integer indicating which (of possibly several) target is requested.
1094  *
1095  * Get the @i-th target of a specified #AccessibleRelation relationship.
1096  *
1097  * Returns: an #Accessible which is the @i-th object with which the
1098  *      originating #Accessible has relationship specified in the
1099  *      #AccessibleRelation object.
1100  *
1101  **/
1102 Accessible *
1103 AccessibleRelation_getTarget (AccessibleRelation *obj, int i)
1104 {
1105   Accessible *retval;
1106
1107   cspi_return_val_if_fail (obj, NULL);
1108
1109   retval = cspi_object_add (
1110                          Accessibility_Relation_getTarget (CSPI_OBJREF(obj),
1111                                                            i, cspi_ev()));
1112   cspi_return_val_if_ev ("getTarget", NULL);
1113   return retval;
1114 }
1115
1116 /**
1117  * AccessibleStateSet_ref:
1118  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1119  *
1120  * Increment the reference count for an #AccessibleStateSet object.
1121  *
1122  **/
1123 void
1124 AccessibleStateSet_ref (AccessibleStateSet *obj)
1125 {
1126   spi_state_set_cache_ref (obj);
1127 }
1128
1129 /**
1130  * AccessibleStateSet_unref:
1131  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1132  *
1133  * Decrement the reference count for an #AccessibleStateSet object.
1134  *
1135  **/
1136 void
1137 AccessibleStateSet_unref (AccessibleStateSet *obj)
1138 {
1139   spi_state_set_cache_unref (obj);
1140 }
1141
1142 static Accessibility_StateType
1143 spi_state_to_corba (AccessibleState state)
1144 {
1145 #define MAP_STATE(a) \
1146   case SPI_STATE_##a: \
1147     return Accessibility_STATE_##a
1148
1149   switch (state)
1150     {
1151       MAP_STATE (INVALID);
1152       MAP_STATE (ACTIVE);
1153       MAP_STATE (ARMED);
1154       MAP_STATE (BUSY);
1155       MAP_STATE (CHECKED);
1156       MAP_STATE (DEFUNCT);
1157       MAP_STATE (EDITABLE);
1158       MAP_STATE (ENABLED);
1159       MAP_STATE (EXPANDABLE);
1160       MAP_STATE (EXPANDED);
1161       MAP_STATE (FOCUSABLE);
1162       MAP_STATE (FOCUSED);
1163       MAP_STATE (HORIZONTAL);
1164       MAP_STATE (ICONIFIED);
1165       MAP_STATE (MODAL);
1166       MAP_STATE (MULTI_LINE);
1167       MAP_STATE (MULTISELECTABLE);
1168       MAP_STATE (OPAQUE);
1169       MAP_STATE (PRESSED);
1170       MAP_STATE (RESIZABLE);
1171       MAP_STATE (SELECTABLE);
1172       MAP_STATE (SELECTED);
1173       MAP_STATE (SENSITIVE);
1174       MAP_STATE (SHOWING);
1175       MAP_STATE (SINGLE_LINE);
1176       MAP_STATE (STALE);
1177       MAP_STATE (TRANSIENT);
1178       MAP_STATE (VERTICAL);
1179       MAP_STATE (VISIBLE);
1180       MAP_STATE (MANAGES_DESCENDANTS);
1181       MAP_STATE (INDETERMINATE);
1182     default:
1183       return Accessibility_STATE_INVALID;
1184   }
1185 #undef MAP_STATE
1186 }             
1187
1188 /**
1189  * AccessibleStateSet_contains:
1190  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1191  * @state: an #AccessibleState for which the specified #AccessibleStateSet
1192  *       will be queried.
1193  *
1194  * Determine whether a given #AccessibleStateSet includes a given state; that is,
1195  *       whether @state is true for the stateset in question.
1196  *
1197  * Returns: #TRUE if @state is true/included in the given #AccessibleStateSet,
1198  *          otherwise #FALSE.
1199  *
1200  **/
1201 SPIBoolean
1202 AccessibleStateSet_contains (AccessibleStateSet *obj,
1203                              AccessibleState state)
1204 {
1205   return spi_state_set_cache_contains (obj, spi_state_to_corba (state));
1206 }
1207
1208 /**
1209  * AccessibleStateSet_add:
1210  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1211  * @state: an #AccessibleState to be added to the specified #AccessibleStateSet
1212  *
1213  * Add a particular #AccessibleState to an #AccessibleStateSet (i.e. set the
1214  *       given state to #TRUE in the stateset.
1215  *
1216  **/
1217 void
1218 AccessibleStateSet_add (AccessibleStateSet *obj,
1219                         AccessibleState state)
1220 {
1221   spi_state_set_cache_add (obj, spi_state_to_corba (state));
1222 }
1223
1224 /**
1225  * AccessibleStateSet_remove:
1226  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1227  * @state: an #AccessibleState to be removed from the specified #AccessibleStateSet
1228  *
1229  * Remove a particular #AccessibleState to an #AccessibleStateSet (i.e. set the
1230  *       given state to #FALSE in the stateset.)
1231  *
1232  **/
1233 void
1234 AccessibleStateSet_remove (AccessibleStateSet *obj,
1235                            AccessibleState state)
1236 {
1237   spi_state_set_cache_remove (obj, spi_state_to_corba (state));
1238 }
1239
1240 /**
1241  * AccessibleStateSet_equals:
1242  * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
1243  * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
1244  *
1245  * Determine whether two instances of #AccessibleStateSet are equivalent (i.e.
1246  *         consist of the same #AccessibleStates).  Useful for checking multiple
1247  *         state variables at once; construct the target state then compare against it.
1248  *
1249  * @see AccessibleStateSet_compare().
1250  *
1251  * Returns: #TRUE if the two #AccessibleStateSets are equivalent,
1252  *          otherwise #FALSE.
1253  *
1254  **/
1255 SPIBoolean
1256 AccessibleStateSet_equals (AccessibleStateSet *obj,
1257                            AccessibleStateSet *obj2)
1258 {
1259   SPIBoolean   eq;
1260   AtkStateSet *cmp;
1261
1262   if (obj == obj2)
1263     {
1264       return TRUE;
1265     }
1266
1267   cmp = spi_state_set_cache_xor (obj, obj2);
1268   eq = spi_state_set_cache_is_empty (cmp);
1269   spi_state_set_cache_unref (cmp);
1270
1271   return eq;
1272 }
1273
1274 /**
1275  * AccessibleStateSet_compare:
1276  * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
1277  * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
1278  *
1279  * Determine the differences between two instances of #AccessibleStateSet.
1280  * Not Yet Implemented.
1281  *.
1282  * @see AccessibleStateSet_equals().
1283  *
1284  * Returns: an #AccessibleStateSet object containing all states contained on one of
1285  *          the two sets but not the other.
1286  *
1287  **/
1288 AccessibleStateSet *
1289 AccessibleStateSet_compare (AccessibleStateSet *obj,
1290                             AccessibleStateSet *obj2)
1291 {
1292   return spi_state_set_cache_xor (obj, obj2);
1293 }
1294
1295 /**
1296  * AccessibleStateSet_isEmpty:
1297  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1298  *
1299  * Determine whether a given #AccessibleStateSet is the empty set.
1300  *
1301  * Returns: #TRUE if the given #AccessibleStateSet contains no (true) states,
1302  *          otherwise #FALSE.
1303  *
1304  **/
1305 SPIBoolean
1306 AccessibleStateSet_isEmpty (AccessibleStateSet *obj)
1307 {
1308   return spi_state_set_cache_is_empty (obj);
1309 }
1310
1311