ac3739970aff08e4f5176a47fe269f48c5cf63ac
[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
194   return TRUE;
195 }
196
197 static AccessibleRole
198 cspi_role_from_spi_role (Accessibility_Role role)
199 {
200   /* array is sized according to IDL roles because IDL roles are the index */   
201   static AccessibleRole cspi_role_table [Accessibility_ROLE_LAST_DEFINED];
202   static SPIBoolean is_initialized = FALSE;
203   AccessibleRole cspi_role;
204   if (!is_initialized)
205     {
206       is_initialized = cspi_init_role_table (cspi_role_table);      
207     }
208   if (role >= 0 && role < Accessibility_ROLE_LAST_DEFINED)
209     {
210       cspi_role = cspi_role_table [role];           
211     }
212   else
213     {
214       cspi_role = SPI_ROLE_EXTENDED;
215     }
216   return cspi_role; 
217 }
218
219 /**
220  * AccessibleRole_getName:
221  * @role: an #AccessibleRole object to query.
222  *
223  * Get a localizeable string that indicates the name of an #AccessibleRole.
224  * <em>DEPRECATED.</em>
225  *
226  * Returns: a localizable string name for an #AccessibleRole enumerated type.
227  **/
228 char *
229 AccessibleRole_getName (AccessibleRole role)
230 {
231   if (role < MAX_ROLES && role_names [(int) role])
232     {
233       return CORBA_string_dup (role_names [(int) role]);
234     }
235   else
236     {
237       return CORBA_string_dup ("");
238     }
239 }
240
241 /**
242  * Accessible_ref:
243  * @obj: a pointer to the #Accessible object on which to operate.
244  *
245  * Increment the reference count for an #Accessible object.
246  **/
247 void
248 Accessible_ref (Accessible *obj)
249 {
250   cspi_object_ref (obj);
251 }
252
253 /**
254  * Accessible_unref:
255  * @obj: a pointer to the #Accessible object on which to operate.
256  *
257  * Decrement the reference count for an #Accessible object.
258  **/
259 void
260 Accessible_unref (Accessible *obj)
261 {
262   cspi_object_unref (obj);
263 }
264
265 /**
266  * Accessible_getName:
267  * @obj: a pointer to the #Accessible object on which to operate.
268  *
269  * Get the name of an #Accessible object.
270  *
271  * Returns: a UTF-8 string indicating the name of the #Accessible object.
272  * or NULL on exception
273  **/
274 char *
275 Accessible_getName (Accessible *obj)
276 {
277   char *retval;
278
279   cspi_return_val_if_fail (obj != NULL, NULL);
280
281   retval = Accessibility_Accessible__get_name (CSPI_OBJREF (obj), cspi_ev ());
282
283   cspi_return_val_if_ev ("getName", NULL); 
284
285   return retval;
286 }
287
288 /**
289  * Accessible_getDescription:
290  * @obj: a pointer to the #Accessible object on which to operate.
291  *
292  * Get the description of an #Accessible object.
293  *
294  * Returns: a UTF-8 string describing the #Accessible object.
295  * or NULL on exception
296  **/
297 char *
298 Accessible_getDescription (Accessible *obj)
299 {
300   char *retval;
301
302   cspi_return_val_if_fail (obj != NULL, NULL);
303
304   retval = Accessibility_Accessible__get_description (CSPI_OBJREF (obj),
305                                                cspi_ev ());
306
307   cspi_return_val_if_ev ("getDescription", NULL); 
308
309   return retval;
310 }
311
312 /**
313  * Accessible_getParent:
314  * @obj: a pointer to the #Accessible object to query.
315  *
316  * Get an #Accessible object's parent container.
317  *
318  * Returns: a pointer tothe #Accessible object which contains the given
319  *          #Accessible instance, or NULL if the @obj has no parent container.
320  *
321  **/
322 Accessible *
323 Accessible_getParent (Accessible *obj)
324 {
325   Accessible *retval;
326
327   cspi_return_val_if_fail (obj != NULL, NULL);
328
329   retval = cspi_object_add (
330     Accessibility_Accessible__get_parent (CSPI_OBJREF (obj),
331                                           cspi_ev ()));
332
333   cspi_return_val_if_ev ("getParent", NULL); 
334
335   return retval;
336 }
337
338 /**
339  * Accessible_getChildCount:
340  * @obj: a pointer to the #Accessible object on which to operate.
341  *
342  * Get the number of children contained by an #Accessible object.
343  *
344  * Returns: a #long indicating the number of #Accessible children
345  *          contained by an #Accessible object. or -1 on exception
346  *
347  **/
348 long
349 Accessible_getChildCount (Accessible *obj)
350 {
351   long retval;
352
353   cspi_return_val_if_fail (obj != NULL, -1);
354
355   retval = Accessibility_Accessible__get_childCount (CSPI_OBJREF (obj),
356                                               cspi_ev ());
357
358   cspi_return_val_if_ev ("getChildCount", -1); 
359
360   return retval;
361 }
362
363 /**
364  * Accessible_getChildAtIndex:
365  * @obj: a pointer to the #Accessible object on which to operate.
366  * @childIndex: a #long indicating which child is specified.
367  *
368  * Get the #Accessible child of an #Accessible object at a given index.
369  *
370  * Returns: a pointer to the #Accessible child object at index
371  *          @childIndex. or NULL on exception
372  **/
373 Accessible *
374 Accessible_getChildAtIndex (Accessible *obj,
375                             long int    childIndex)
376 {
377   Accessible *retval;
378
379   cspi_return_val_if_fail (obj != NULL, NULL);
380
381   retval = cspi_object_add (
382     Accessibility_Accessible_getChildAtIndex (CSPI_OBJREF (obj),
383                                               childIndex, cspi_ev ()));
384
385   cspi_return_val_if_ev ("getChildAtIndex", NULL);
386   return retval;
387 }
388
389 /**
390  * Accessible_getIndexInParent:
391  * @obj: a pointer to the #Accessible object on which to operate.
392  *
393  * Get the index of an #Accessible object in its containing #Accessible.
394  *
395  * Returns: a #long indicating the index of the #Accessible object
396  *          in its parent (i.e. containing) #Accessible instance,
397  *          or -1 if @obj has no containing parent or on exception.
398  **/
399 long
400 Accessible_getIndexInParent (Accessible *obj)
401 {
402   long retval;
403
404   cspi_return_val_if_fail (obj != NULL, -1);
405
406   retval = Accessibility_Accessible_getIndexInParent (CSPI_OBJREF (obj), cspi_ev ());
407
408   cspi_return_val_if_ev ("getIndexInparent", -1); 
409   return retval;
410 }
411
412 /**
413  * Accessible_getRelationSet:
414  * @obj: a pointer to the #Accessible object on which to operate.
415  *
416  * Get the set of #AccessibleRelation objects which describe this #Accessible object's
417  *       relationships with other #Accessible objects.
418  *
419  * Returns: an array of #AccessibleRelation pointers. or NULL on exception
420  **/
421 AccessibleRelation **
422 Accessible_getRelationSet (Accessible *obj)
423 {
424   int i;
425   int n_relations;
426   AccessibleRelation **relations;
427   Accessibility_RelationSet *relation_set;
428
429   cspi_return_val_if_fail (obj != NULL, NULL);
430
431   g_assert (!cspi_exception ());
432
433   relation_set =
434     Accessibility_Accessible_getRelationSet (CSPI_OBJREF (obj), cspi_ev ());
435
436   cspi_return_val_if_ev ("getRelationSet", NULL); 
437   
438   n_relations = relation_set->_length;
439   relations = malloc (sizeof (AccessibleRelation *) * (n_relations + 1));
440   
441   for (i = 0; i < n_relations; ++i)
442     {
443       relations[i] = cspi_object_add (CORBA_Object_duplicate (
444               relation_set->_buffer[i], cspi_ev ()));
445     }
446   relations[i] = NULL;
447
448   CORBA_free (relation_set);
449
450   return relations;
451 }
452
453 /**
454  * Accessible_getRole:
455  * @obj: a pointer to the #Accessible object on which to operate.
456  *
457  * Get the UI role of an #Accessible object.
458  * A UTF-8 string describing this role can be obtained via Accessible_getRoleName ().
459  *
460  * Returns: the #AccessibleRole of the object.
461  *
462  **/
463 AccessibleRole
464 Accessible_getRole (Accessible *obj)
465 {
466   Accessibility_Role retval;
467
468   cspi_return_val_if_fail (obj != NULL, SPI_ROLE_INVALID);
469
470   retval = 
471     Accessibility_Accessible_getRole (CSPI_OBJREF (obj), cspi_ev ());
472
473   cspi_return_val_if_ev ("getRole", SPI_ROLE_INVALID); 
474
475   return cspi_role_from_spi_role (retval);
476 }
477
478 /**
479  * Accessible_getRoleName:
480  * @obj: a pointer to the #Accessible object on which to operate.
481  *
482  * Get a UTF-8 string describing the role this object plays in the UI.
483  * This method will return useful values for roles that fall outside the
484  * enumeration used in Accessible_getRole ().
485  *
486  * Returns: a UTF-8 string specifying the role of this #Accessible object.
487  *
488  **/
489 char *
490 Accessible_getRoleName (Accessible *obj)
491 {
492   char *retval;
493
494   cspi_return_val_if_fail (obj != NULL, CORBA_string_dup ("invalid"));
495
496   retval = 
497     Accessibility_Accessible_getRoleName (CSPI_OBJREF (obj), cspi_ev ());
498
499   cspi_return_val_if_ev ("getRoleName", CORBA_string_dup ("invalid")); 
500
501   return retval;
502 }
503
504 /**
505  * Accessible_getLocalizedRoleName:
506  * @obj: a pointer to the #Accessible object on which to operate.
507  *
508  * Get a UTF-8 string describing the (localized) role this object plays in the UI.
509  * This method will return useful values for roles that fall outside the
510  * enumeration used in Accessible_getRole ().
511  *
512  * Returns: a UTF-8 string specifying the role of this #Accessible object.
513  *
514  **/
515 char *
516 Accessible_getLocalizedRoleName (Accessible *obj)
517 {
518   char *retval;
519
520   cspi_return_val_if_fail (obj != NULL, CORBA_string_dup ("invalid"));
521
522   retval = 
523     Accessibility_Accessible_getLocalizedRoleName (CSPI_OBJREF (obj), cspi_ev ());
524
525   cspi_return_val_if_ev ("getLocalizedRoleName", CORBA_string_dup ("invalid")); 
526
527   return retval;
528 }
529
530 /**
531  * Accessible_getStateSet:
532  * @obj: a pointer to the #Accessible object on which to operate.
533  *
534  * Returns: a pointer to an #AccessibleStateSet representing the object's current state.
535  **/
536 AccessibleStateSet *
537 Accessible_getStateSet (Accessible *obj)
538 {
539   AccessibleStateSet *retval;
540   Accessibility_StateSet corba_stateset;
541   Accessibility_StateSeq *corba_seq;
542
543   cspi_return_val_if_fail (obj != NULL, NULL);
544
545   corba_stateset = Accessibility_Accessible_getState (
546           CSPI_OBJREF (obj), cspi_ev ());
547   cspi_return_val_if_ev ("getState", NULL);
548
549   cspi_return_val_if_fail (corba_stateset != CORBA_OBJECT_NIL, NULL);
550   cspi_return_val_if_fail (cspi_ping (corba_stateset), NULL);
551   corba_seq = Accessibility_StateSet_getStates (corba_stateset, cspi_ev ());
552   cspi_return_val_if_ev ("getState", NULL);
553
554   retval = spi_state_set_cache_new (corba_seq);
555
556   CORBA_free (corba_seq);
557   cspi_release_unref (corba_stateset);
558
559   return retval;
560 }
561
562 /* Interface query methods */
563
564 /**
565  * Accessible_isAction:
566  * @obj: a pointer to the #Accessible instance to query.
567  *
568  * Query whether the specified #Accessible implements #AccessibleAction.
569  *
570  * Returns: #TRUE if @obj implements the #AccessibleAction interface,
571  *          #FALSE otherwise.
572  **/
573 SPIBoolean
574 Accessible_isAction (Accessible *obj)
575 {
576   return cspi_accessible_is_a (obj,
577                               "IDL:Accessibility/Action:1.0");
578 }
579
580 /**
581  * Accessible_isApplication:
582  * @obj: a pointer to the #Accessible instance to query.
583  *
584  * Query whether the specified #Accessible implements #AccessibleApplication.
585  *
586  * Returns: #TRUE if @obj implements the #AccessibleApplication interface,
587  *          #FALSE otherwise.
588  **/
589 SPIBoolean
590 Accessible_isApplication (Accessible *obj)
591 {
592   return cspi_accessible_is_a (obj,
593                               "IDL:Accessibility/Application:1.0");
594 }
595
596 /**
597  * Accessible_isComponent:
598  * @obj: a pointer to the #Accessible instance to query.
599  *
600  * Query whether the specified #Accessible implements #AccessibleComponent.
601  *
602  * Returns: #TRUE if @obj implements the #AccessibleComponent interface,
603  *          #FALSE otherwise.
604  **/
605 SPIBoolean
606 Accessible_isComponent (Accessible *obj)
607 {
608   return cspi_accessible_is_a (obj,
609                               "IDL:Accessibility/Component:1.0");
610 }
611
612 /**
613  * Accessible_isEditableText:
614  * @obj: a pointer to the #Accessible instance to query.
615  *
616  * Query whether the specified #Accessible implements #AccessibleEditableText.
617  *
618  * Returns: #TRUE if @obj implements the #AccessibleEditableText interface,
619  *          #FALSE otherwise.
620  **/
621 SPIBoolean
622 Accessible_isEditableText (Accessible *obj)
623 {
624   return cspi_accessible_is_a (obj,
625                               "IDL:Accessibility/EditableText:1.0");
626 }
627
628 /**
629  * Accessible_isHypertext:
630  * @obj: a pointer to the #Accessible instance to query.
631  *
632  * Query whether the specified #Accessible implements #AccessibleHypertext.
633  *
634  * Returns: #TRUE if @obj implements the #AccessibleHypertext interface,
635  *          #FALSE otherwise.
636  **/
637 SPIBoolean
638 Accessible_isHypertext (Accessible *obj)
639 {
640   return cspi_accessible_is_a (obj,
641                               "IDL:Accessibility/Hypertext:1.0");
642 }
643
644 /**
645  * Accessible_isImage:
646  * @obj: a pointer to the #Accessible instance to query.
647  *
648  * Query whether the specified #Accessible implements #AccessibleImage.
649  *
650  * Returns: #TRUE if @obj implements the #AccessibleImage interface,
651  *          #FALSE otherwise.
652 **/
653 SPIBoolean
654 Accessible_isImage (Accessible *obj)
655 {
656   return cspi_accessible_is_a (obj,
657                               "IDL:Accessibility/Image:1.0");
658 }
659
660 /**
661  * Accessible_isSelection:
662  * @obj: a pointer to the #Accessible instance to query.
663  *
664  * Query whether the specified #Accessible implements #AccessibleSelection.
665  *
666  * Returns: #TRUE if @obj implements the #AccessibleSelection interface,
667  *          #FALSE otherwise.
668 **/
669 SPIBoolean
670 Accessible_isSelection (Accessible *obj)
671 {
672   return cspi_accessible_is_a (obj,
673                               "IDL:Accessibility/Selection:1.0");
674 }
675
676 /**
677  * Accessible_isTable:
678  * @obj: a pointer to the #Accessible instance to query.
679  *
680  * Query whether the specified #Accessible implements #AccessibleTable.
681  *
682  * Returns: #TRUE if @obj implements the #AccessibleTable interface,
683  *          #FALSE otherwise.
684 **/
685 SPIBoolean
686 Accessible_isTable (Accessible *obj)
687 {
688   return cspi_accessible_is_a (obj,
689                               "IDL:Accessibility/Table:1.0");
690 }
691
692 /**
693  * Accessible_isStreamableContent:
694  * @obj: a pointer to the #Accessible instance to query.
695  *
696  * Query whether the specified #Accessible implements
697  *          #AccessibleStreamableContent.
698  *
699  * Returns: #TRUE if @obj implements the #AccessibleStreamableContent interface,
700  *          #FALSE otherwise.
701 **/
702 SPIBoolean
703 Accessible_isStreamableContent (Accessible *obj)
704 {
705   return cspi_accessible_is_a (obj,
706                               "IDL:Accessibility/StreamableContent:1.0");
707 }
708
709 /**
710  * Accessible_isText:
711  * @obj: a pointer to the #Accessible instance to query.
712  *
713  * Query whether the specified #Accessible implements #AccessibleText.
714  *
715  * Returns: #TRUE if @obj implements the #AccessibleText interface,
716  *          #FALSE otherwise.
717 **/
718 SPIBoolean
719 Accessible_isText (Accessible *obj)
720 {
721   return cspi_accessible_is_a (obj,
722                               "IDL:Accessibility/Text:1.0");
723 }
724
725 /**
726  * Accessible_isValue:
727  * @obj: a pointer to the #Accessible instance to query.
728  *
729  * Query whether the specified #Accessible implements #AccessibleValue.
730  *
731  * Returns: #TRUE if @obj implements the #AccessibleValue interface,
732  *          #FALSE otherwise.
733 **/
734 SPIBoolean
735 Accessible_isValue (Accessible *obj)
736 {
737   return cspi_accessible_is_a (obj,
738                               "IDL:Accessibility/Value:1.0");
739 }
740
741 /**
742  * Accessible_getApplication:
743  * @obj: a pointer to the #Accessible instance to query.
744  *
745  * Get the #AccessibleApplication interface for an #Accessible.
746  *
747  * Returns: a pointer to an #AccessibleApplication interface instance, or
748  *          NULL if @obj does not implement #AccessibleApplication.
749  **/
750 AccessibleApplication *
751 Accessible_getApplication (Accessible *obj)
752 {
753   return (AccessibleApplication *) Accessible_queryInterface (
754           obj, "IDL:Accessibility/Application:1.0");
755 }
756
757 /**
758  * Accessible_getAction:
759  * @obj: a pointer to the #Accessible instance to query.
760  *
761  * Get the #AccessibleAction interface for an #Accessible.
762  *
763  * Returns: a pointer to an #AccessibleAction interface instance, or
764  *          NULL if @obj does not implement #AccessibleAction.
765  **/
766 AccessibleAction *
767 Accessible_getAction (Accessible *obj)
768 {
769   return (AccessibleAction *) Accessible_queryInterface (
770           obj, "IDL:Accessibility/Action:1.0");
771 }
772
773 /**
774  * Accessible_getComponent:
775  * @obj: a pointer to the #Accessible instance to query.
776  *
777  * Get the #AccessibleComponent interface for an #Accessible.
778  *
779  * Returns: a pointer to an #AccessibleComponent interface instance, or
780  *          NULL if @obj does not implement #AccessibleComponent.
781  **/
782 AccessibleComponent *
783 Accessible_getComponent (Accessible *obj)
784 {
785   return (AccessibleComponent *) Accessible_queryInterface (
786           obj, "IDL:Accessibility/Component:1.0");
787 }
788
789 /**
790  * Accessible_getEditableText:
791  * @obj: a pointer to the #Accessible instance to query.
792  *
793  * Get the #AccessibleEditableText interface for an #Accessible.
794  *
795  * Returns: a pointer to an #AccessibleEditableText interface instance, or
796  *          NULL if @obj does not implement #AccessibleEditableText.
797  **/
798 AccessibleEditableText *
799 Accessible_getEditableText (Accessible *obj)
800 {
801   return (AccessibleEditableText *) Accessible_queryInterface (
802           obj, "IDL:Accessibility/EditableText:1.0");
803 }
804
805
806
807 /**
808  * Accessible_getHypertext:
809  * @obj: a pointer to the #Accessible instance to query.
810  *
811  * Get the #AccessibleHypertext interface for an #Accessible.
812  *
813  * Returns: a pointer to an #AccessibleHypertext interface instance, or
814  *          NULL if @obj does not implement #AccessibleHypertext.
815  **/
816 AccessibleHypertext *
817 Accessible_getHypertext (Accessible *obj)
818 {
819   return (AccessibleHypertext *) Accessible_queryInterface (
820           obj, "IDL:Accessibility/Hypertext:1.0");
821 }
822
823
824
825 /**
826  * Accessible_getImage:
827  * @obj: a pointer to the #Accessible instance to query.
828  *
829  * Get the #AccessibleImage interface for an #Accessible.
830  *
831  * Returns: a pointer to an #AccessibleImage interface instance, or
832  *          NULL if @obj does not implement #AccessibleImage.
833  **/
834 AccessibleImage *
835 Accessible_getImage (Accessible *obj)
836 {
837   return (AccessibleImage *) Accessible_queryInterface (
838           obj, "IDL:Accessibility/Image:1.0");
839 }
840
841
842
843 /**
844  * Accessible_getSelection:
845  * @obj: a pointer to the #Accessible instance to query.
846  *
847  * Get the #AccessibleSelection interface for an #Accessible.
848  *
849  * Returns: a pointer to an #AccessibleSelection interface instance, or
850  *          NULL if @obj does not implement #AccessibleSelection.
851  **/
852 AccessibleSelection *
853 Accessible_getSelection (Accessible *obj)
854 {
855   return (AccessibleSelection *) Accessible_queryInterface (
856           obj, "IDL:Accessibility/Selection:1.0");
857 }
858
859
860
861 /**
862  * Accessible_getStreamableContent:
863  * @obj: a pointer to the #Accessible instance to query.
864  *
865  * Get the #AccessibleStreamableContent interface for an #Accessible.
866  *
867  * Returns: a pointer to an #AccessibleStreamableContent interface instance, or
868  *          NULL if @obj does not implement #AccessibleStreamableContent.
869  **/
870 AccessibleStreamableContent *
871 Accessible_getStreamableContent (Accessible *obj)
872 {
873   return (AccessibleStreamableContent *) Accessible_queryInterface (
874           obj, "IDL:Accessibility/StreamableContent:1.0");
875 }
876
877 /**
878  * Accessible_getTable:
879  * @obj: a pointer to the #Accessible instance to query.
880  *
881  * Get the #AccessibleTable interface for an #Accessible.
882  *
883  * Returns: a pointer to an #AccessibleTable interface instance, or
884  *          NULL if @obj does not implement #AccessibleTable.
885  **/
886 AccessibleTable *
887 Accessible_getTable (Accessible *obj)
888 {
889   return (AccessibleTable *) Accessible_queryInterface (
890           obj, "IDL:Accessibility/Table:1.0");
891 }
892
893 /**
894  * Accessible_getText:
895  * @obj: a pointer to the #Accessible instance to query.
896  *
897  * Get the #AccessibleText interface for an #Accessible.
898  *
899  * Returns: a pointer to an #AccessibleText interface instance, or
900  *          NULL if @obj does not implement #AccessibleText.
901  **/
902 AccessibleText *
903 Accessible_getText (Accessible *obj)
904 {
905   return (AccessibleText *) Accessible_queryInterface (
906           obj, "IDL:Accessibility/Text:1.0");
907 }
908
909
910
911 /**
912  * Accessible_getValue:
913  * @obj: a pointer to the #Accessible instance to query.
914  *
915  * Get the #AccessibleValue interface for an #Accessible.
916  *
917  * Returns: a pointer to an #AccessibleValue interface instance, or
918  *          NULL if @obj does not implement #AccessibleValue.
919  **/
920 AccessibleValue *
921 Accessible_getValue (Accessible *obj)
922 {
923   return (AccessibleValue *) Accessible_queryInterface (
924           obj, "IDL:Accessibility/Value:1.0");
925 }
926
927
928
929 /**
930  * Accessible_queryInterface:
931  * @obj: a pointer to the #Accessible instance to query.
932  * @interface_name: a UTF-8 character string specifiying the requested interface.
933  *
934  * Query an #Accessible object to for a named interface.
935  *
936  * Returns: an instance of the named interface object, if it is implemented
937  *          by @obj, or NULL otherwise.
938  *
939  **/
940 AccessibleUnknown *
941 Accessible_queryInterface (Accessible *obj,
942                            const char *interface_name)
943 {
944   Bonobo_Unknown iface;
945   
946   if (!obj)
947     {
948       return NULL;
949     }
950
951   iface = Accessibility_Accessible_queryInterface (CSPI_OBJREF (obj),
952                                                    interface_name,
953                                                    cspi_ev ());
954
955
956   cspi_return_val_if_ev ("queryInterface", NULL); 
957
958   /*
959    * FIXME: we need to be fairly sure that references are going
960    * to mach up if we are going to expose QueryInterface, ie. we
961    * can't allow people to do:
962    * b = a.qi ("b"); b.unref, b.unref to release a's reference.
963    * this should be no real problem though for this level of API
964    * user.
965    */
966
967   return cspi_object_add (iface);
968 }
969
970
971 /**
972  * AccessibleRelation_ref:
973  * @obj: a pointer to the #AccessibleRelation object on which to operate.
974  *
975  * Increment the reference count for an #AccessibleRelation object.
976  *
977  **/
978 void
979 AccessibleRelation_ref (AccessibleRelation *obj)
980 {
981   cspi_object_ref (obj);
982 }
983
984 /**
985  * AccessibleRelation_unref:
986  * @obj: a pointer to the #AccessibleRelation object on which to operate.
987  *
988  * Decrement the reference count for an #AccessibleRelation object.
989  *
990  **/
991 void
992 AccessibleRelation_unref (AccessibleRelation *obj)
993 {
994   cspi_object_unref (obj);
995 }
996
997 static SPIBoolean
998 cspi_init_relation_type_table (AccessibleRelationType *relation_type_table)
999 {
1000   int i;
1001   for (i = 0; i < Accessibility_RELATION_LAST_DEFINED; ++i)
1002     {
1003       relation_type_table [i] = SPI_RELATION_NULL;
1004     }
1005   relation_type_table [Accessibility_RELATION_NULL] = SPI_RELATION_NULL;
1006   relation_type_table [Accessibility_RELATION_LABEL_FOR] = SPI_RELATION_LABEL_FOR;
1007   relation_type_table [Accessibility_RELATION_LABELLED_BY] = SPI_RELATION_LABELED_BY;
1008   relation_type_table [Accessibility_RELATION_CONTROLLER_FOR] = SPI_RELATION_CONTROLLER_FOR;
1009   relation_type_table [Accessibility_RELATION_CONTROLLED_BY] = SPI_RELATION_CONTROLLED_BY;
1010   relation_type_table [Accessibility_RELATION_MEMBER_OF] = SPI_RELATION_MEMBER_OF;
1011   relation_type_table [Accessibility_RELATION_TOOLTIP_FOR] = SPI_RELATION_NULL;
1012   relation_type_table [Accessibility_RELATION_NODE_CHILD_OF] = SPI_RELATION_NODE_CHILD_OF;
1013   relation_type_table [Accessibility_RELATION_EXTENDED] = SPI_RELATION_EXTENDED;
1014   relation_type_table [Accessibility_RELATION_FLOWS_TO] = SPI_RELATION_FLOWS_TO;
1015   relation_type_table [Accessibility_RELATION_FLOWS_FROM] = SPI_RELATION_FLOWS_FROM;
1016   relation_type_table [Accessibility_RELATION_SUBWINDOW_OF] = SPI_RELATION_SUBWINDOW_OF;
1017   relation_type_table [Accessibility_RELATION_EMBEDS] = SPI_RELATION_EMBEDS;
1018   relation_type_table [Accessibility_RELATION_EMBEDDED_BY] = SPI_RELATION_EMBEDDED_BY;
1019   relation_type_table [Accessibility_RELATION_POPUP_FOR] = SPI_RELATION_POPUP_FOR;
1020   return TRUE;
1021 }
1022
1023 static AccessibleRelationType
1024 cspi_relation_type_from_spi_relation_type (Accessibility_RelationType type)
1025 {
1026   /* array is sized according to IDL RelationType because IDL RelationTypes are the index */    
1027   static AccessibleRelationType cspi_relation_type_table [Accessibility_RELATION_LAST_DEFINED];
1028   static SPIBoolean is_initialized = FALSE;
1029   AccessibleRelationType cspi_type;
1030   if (!is_initialized)
1031     {
1032       is_initialized = cspi_init_relation_type_table (cspi_relation_type_table);            
1033     }
1034   if (type >= 0 && type < Accessibility_RELATION_LAST_DEFINED)
1035     {
1036       cspi_type = cspi_relation_type_table [type];          
1037     }
1038   else
1039     {
1040       cspi_type = SPI_RELATION_NULL;
1041     }
1042   return cspi_type; 
1043 }
1044 /**
1045  * AccessibleRelation_getRelationType:
1046  * @obj: a pointer to the #AccessibleRelation object to query.
1047  *
1048  * Get the type of relationship represented by an #AccessibleRelation.
1049  *
1050  * Returns: an #AccessibleRelationType indicating the type of relation
1051  *         encapsulated in this #AccessibleRelation object.
1052  *
1053  **/
1054 AccessibleRelationType
1055 AccessibleRelation_getRelationType (AccessibleRelation *obj)
1056 {
1057   Accessibility_RelationType retval;
1058   
1059   cspi_return_val_if_fail (obj, SPI_RELATION_NULL);
1060   retval =
1061     Accessibility_Relation_getRelationType (CSPI_OBJREF (obj), cspi_ev());
1062   cspi_return_val_if_ev ("getRelationType", SPI_RELATION_NULL);
1063   return cspi_relation_type_from_spi_relation_type (retval);
1064 }
1065
1066 /**
1067  * AccessibleRelation_getNTargets:
1068  * @obj: a pointer to the #AccessibleRelation object to query.
1069  *
1070  * Get the number of objects which this relationship has as its
1071  *       target objects (the subject is the #Accessible from which this
1072  *       #AccessibleRelation originated).
1073  *
1074  * Returns: a short integer indicating how many target objects which the
1075  *       originating #Accessible object has the #AccessibleRelation
1076  *       relationship with.
1077  **/
1078 int
1079 AccessibleRelation_getNTargets (AccessibleRelation *obj)
1080 {
1081   int retval;
1082   
1083   cspi_return_val_if_fail (obj, -1);
1084   retval = Accessibility_Relation_getNTargets (CSPI_OBJREF (obj), cspi_ev());
1085   cspi_return_val_if_ev ("getNTargets", -1);
1086   return retval;
1087 }
1088
1089 /**
1090  * AccessibleRelation_getTarget:
1091  * @obj: a pointer to the #AccessibleRelation object to query.
1092  * @i: a (zero-index) integer indicating which (of possibly several) target is requested.
1093  *
1094  * Get the @i-th target of a specified #AccessibleRelation relationship.
1095  *
1096  * Returns: an #Accessible which is the @i-th object with which the
1097  *      originating #Accessible has relationship specified in the
1098  *      #AccessibleRelation object.
1099  *
1100  **/
1101 Accessible *
1102 AccessibleRelation_getTarget (AccessibleRelation *obj, int i)
1103 {
1104   Accessible *retval;
1105
1106   cspi_return_val_if_fail (obj, NULL);
1107
1108   retval = cspi_object_add (
1109                          Accessibility_Relation_getTarget (CSPI_OBJREF(obj),
1110                                                            i, cspi_ev()));
1111   cspi_return_val_if_ev ("getTarget", NULL);
1112   return retval;
1113 }
1114
1115 /**
1116  * AccessibleStateSet_ref:
1117  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1118  *
1119  * Increment the reference count for an #AccessibleStateSet object.
1120  *
1121  **/
1122 void
1123 AccessibleStateSet_ref (AccessibleStateSet *obj)
1124 {
1125   spi_state_set_cache_ref (obj);
1126 }
1127
1128 /**
1129  * AccessibleStateSet_unref:
1130  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1131  *
1132  * Decrement the reference count for an #AccessibleStateSet object.
1133  *
1134  **/
1135 void
1136 AccessibleStateSet_unref (AccessibleStateSet *obj)
1137 {
1138   spi_state_set_cache_unref (obj);
1139 }
1140
1141 static Accessibility_StateType
1142 spi_state_to_corba (AccessibleState state)
1143 {
1144 #define MAP_STATE(a) \
1145   case SPI_STATE_##a: \
1146     return Accessibility_STATE_##a
1147
1148   switch (state)
1149     {
1150       MAP_STATE (INVALID);
1151       MAP_STATE (ACTIVE);
1152       MAP_STATE (ARMED);
1153       MAP_STATE (BUSY);
1154       MAP_STATE (CHECKED);
1155       MAP_STATE (DEFUNCT);
1156       MAP_STATE (EDITABLE);
1157       MAP_STATE (ENABLED);
1158       MAP_STATE (EXPANDABLE);
1159       MAP_STATE (EXPANDED);
1160       MAP_STATE (FOCUSABLE);
1161       MAP_STATE (FOCUSED);
1162       MAP_STATE (HORIZONTAL);
1163       MAP_STATE (ICONIFIED);
1164       MAP_STATE (MODAL);
1165       MAP_STATE (MULTI_LINE);
1166       MAP_STATE (MULTISELECTABLE);
1167       MAP_STATE (OPAQUE);
1168       MAP_STATE (PRESSED);
1169       MAP_STATE (RESIZABLE);
1170       MAP_STATE (SELECTABLE);
1171       MAP_STATE (SELECTED);
1172       MAP_STATE (SENSITIVE);
1173       MAP_STATE (SHOWING);
1174       MAP_STATE (SINGLE_LINE);
1175       MAP_STATE (STALE);
1176       MAP_STATE (TRANSIENT);
1177       MAP_STATE (VERTICAL);
1178       MAP_STATE (VISIBLE);
1179       MAP_STATE (MANAGES_DESCENDANTS);
1180       MAP_STATE (INDETERMINATE);
1181     default:
1182       return Accessibility_STATE_INVALID;
1183   }
1184 #undef MAP_STATE
1185 }             
1186
1187 /**
1188  * AccessibleStateSet_contains:
1189  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1190  * @state: an #AccessibleState for which the specified #AccessibleStateSet
1191  *       will be queried.
1192  *
1193  * Determine whether a given #AccessibleStateSet includes a given state; that is,
1194  *       whether @state is true for the stateset in question.
1195  *
1196  * Returns: #TRUE if @state is true/included in the given #AccessibleStateSet,
1197  *          otherwise #FALSE.
1198  *
1199  **/
1200 SPIBoolean
1201 AccessibleStateSet_contains (AccessibleStateSet *obj,
1202                              AccessibleState state)
1203 {
1204   return spi_state_set_cache_contains (obj, spi_state_to_corba (state));
1205 }
1206
1207 /**
1208  * AccessibleStateSet_add:
1209  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1210  * @state: an #AccessibleState to be added to the specified #AccessibleStateSet
1211  *
1212  * Add a particular #AccessibleState to an #AccessibleStateSet (i.e. set the
1213  *       given state to #TRUE in the stateset.
1214  *
1215  **/
1216 void
1217 AccessibleStateSet_add (AccessibleStateSet *obj,
1218                         AccessibleState state)
1219 {
1220   spi_state_set_cache_add (obj, spi_state_to_corba (state));
1221 }
1222
1223 /**
1224  * AccessibleStateSet_remove:
1225  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1226  * @state: an #AccessibleState to be removed from the specified #AccessibleStateSet
1227  *
1228  * Remove a particular #AccessibleState to an #AccessibleStateSet (i.e. set the
1229  *       given state to #FALSE in the stateset.)
1230  *
1231  **/
1232 void
1233 AccessibleStateSet_remove (AccessibleStateSet *obj,
1234                            AccessibleState state)
1235 {
1236   spi_state_set_cache_remove (obj, spi_state_to_corba (state));
1237 }
1238
1239 /**
1240  * AccessibleStateSet_equals:
1241  * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
1242  * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
1243  *
1244  * Determine whether two instances of #AccessibleStateSet are equivalent (i.e.
1245  *         consist of the same #AccessibleStates).  Useful for checking multiple
1246  *         state variables at once; construct the target state then compare against it.
1247  *
1248  * @see AccessibleStateSet_compare().
1249  *
1250  * Returns: #TRUE if the two #AccessibleStateSets are equivalent,
1251  *          otherwise #FALSE.
1252  *
1253  **/
1254 SPIBoolean
1255 AccessibleStateSet_equals (AccessibleStateSet *obj,
1256                            AccessibleStateSet *obj2)
1257 {
1258   SPIBoolean   eq;
1259   AtkStateSet *cmp;
1260
1261   if (obj == obj2)
1262     {
1263       return TRUE;
1264     }
1265
1266   cmp = spi_state_set_cache_xor (obj, obj2);
1267   eq = spi_state_set_cache_is_empty (cmp);
1268   spi_state_set_cache_unref (cmp);
1269
1270   return eq;
1271 }
1272
1273 /**
1274  * AccessibleStateSet_compare:
1275  * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
1276  * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
1277  *
1278  * Determine the differences between two instances of #AccessibleStateSet.
1279  * Not Yet Implemented.
1280  *.
1281  * @see AccessibleStateSet_equals().
1282  *
1283  * Returns: an #AccessibleStateSet object containing all states contained on one of
1284  *          the two sets but not the other.
1285  *
1286  **/
1287 AccessibleStateSet *
1288 AccessibleStateSet_compare (AccessibleStateSet *obj,
1289                             AccessibleStateSet *obj2)
1290 {
1291   return spi_state_set_cache_xor (obj, obj2);
1292 }
1293
1294 /**
1295  * AccessibleStateSet_isEmpty:
1296  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
1297  *
1298  * Determine whether a given #AccessibleStateSet is the empty set.
1299  *
1300  * Returns: #TRUE if the given #AccessibleStateSet contains no (true) states,
1301  *          otherwise #FALSE.
1302  *
1303  **/
1304 SPIBoolean
1305 AccessibleStateSet_isEmpty (AccessibleStateSet *obj)
1306 {
1307   return spi_state_set_cache_is_empty (obj);
1308 }
1309
1310