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