2001-11-23 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_accessible.c
1 #include <stdlib.h> /* for malloc */
2 #include <cspi/spi-private.h>
3
4 #define MAX_ROLES 100
5
6 static char *role_names [MAX_ROLES] =
7 {
8   " ",
9   "accelerator label",
10   "alert",
11   "animation",
12   "arrow",
13   "calendar",
14   "canvas",
15   "check box",
16   "menu item",
17   "color chooser",
18   "column header",
19   "combo box",
20   "date editor",
21   "desktop icon",
22   "desktop frame",
23   "dial",
24   "dialog",
25   "directory pane",
26   "drawing area",
27   "file chooser",
28   "filler",
29   "font chooser",
30   "frame",
31   "glass pane",
32   "HTML container",
33   "icon",
34   "image",
35   "internal frame",
36   "label",
37   "layered pane",
38   "list",
39   "list item",
40   "menu",
41   "menubar",
42   "menu item",
43   "option pane",
44   "page tab",
45   "page tab list",
46   "panel",
47   "password text",
48   "popup menu",
49   "progress bar",
50   "pushbutton",
51   "radiobutton",
52   "radio menu item",
53   "root pane",
54   "row header",
55   "scrollbar",
56   "scrollpane",
57   "separator",
58   "slider",
59   "split pane",
60   "spin button",
61   "status bar",
62   "table",
63   "table cell",
64   "table column header",
65   "table row header",
66   "tearoff menu item",
67   "text",
68   "toggle button",
69   "toolbar",
70   "tooltip",
71   "tree",
72   " ",
73   "viewport",
74   "window",
75 };
76
77 /**
78  * AccessibleRole_getName:
79  * @role: an #AccessibleRole object to query.
80  *
81  * Get a localizeable string that indicates the name of an #AccessibleRole.
82  *
83  * Returns: a localizable string name for an #AccessibleRole enumerated type.
84  **/
85 char*
86 AccessibleRole_getName (AccessibleRole role)
87 {
88   if (role < MAX_ROLES) return role_names [(int) role];
89   else return "";
90 }
91
92
93
94 /**
95  * Accessible_ref:
96  * @obj: a pointer to the #Accessible object on which to operate.
97  *
98  * Increment the reference count for an #Accessible object.
99  *
100  * Returns: (no return code implemented yet).
101  *
102  **/
103 int
104 Accessible_ref (Accessible *obj)
105 {
106   Accessibility_Accessible_ref (*obj, spi_ev ());
107   spi_check_ev (spi_ev (), "ref");
108   return 0;
109 }
110
111
112 /**
113  * Accessible_unref:
114  * @obj: a pointer to the #Accessible object on which to operate.
115  *
116  * Decrement the reference count for an #Accessible object.
117  *
118  * Returns: (no return code implemented yet).
119  *
120  **/
121 int
122 Accessible_unref (Accessible *obj)
123 {
124   Accessibility_Accessible_unref (*obj, spi_ev ());
125   spi_check_ev (spi_ev (), "unref");
126   return 0;
127 }
128
129 /**
130  * Accessible_getName:
131  * @obj: a pointer to the #Accessible object on which to operate.
132  *
133  * Get the name of an #Accessible object.
134  *
135  * Returns: a UTF-8 string indicating the name of the #Accessible object.
136  *
137  **/
138 char *
139 Accessible_getName (Accessible *obj)
140 {
141   char *retval = 
142     (char *)
143     Accessibility_Accessible__get_name (*obj, spi_ev ());
144   spi_check_ev (spi_ev (), "getName"); 
145   return retval;
146 }
147
148 /**
149  * Accessible_getDescription:
150  * @obj: a pointer to the #Accessible object on which to operate.
151  *
152  * Get the description of an #Accessible object.
153  *
154  * Returns: a UTF-8 string describing the #Accessible object.
155  *
156  **/
157 char *
158 Accessible_getDescription (Accessible *obj)
159 {
160   char *retval = (char *)
161     Accessibility_Accessible__get_description (*obj, spi_ev ());
162   spi_check_ev (spi_ev (), "getDescription");
163   return retval;
164 }
165
166 /**
167  * Accessible_getParent:
168  * @obj: a pointer to the #Accessible object to query.
169  *
170  * Get an #Accessible object's parent container.
171  *
172  * Returns: a pointer tothe #Accessible object which contains the given
173  *          #Accessible instance, or NULL if the @obj has no parent container.
174  *
175  **/
176 Accessible *
177 Accessible_getParent (Accessible *obj)
178 {
179   Accessible *retval = 
180       spi_object_add (Accessibility_Accessible__get_parent (*obj, spi_ev ()));
181   spi_check_ev (spi_ev (), "getParent");
182   return retval;
183 }
184
185 /**
186  * Accessible_getChildCount:
187  * @obj: a pointer to the #Accessible object on which to operate.
188  *
189  * Get the number of children contained by an #Accessible object.
190  *
191  * Returns: a #long indicating the number of #Accessible children
192  *          contained by an #Accessible object.
193  *
194  **/
195 long
196 Accessible_getChildCount (Accessible *obj)
197 {
198   long retval = (long) Accessibility_Accessible__get_childCount (*obj, spi_ev ());
199   spi_check_ev (spi_ev (), "getChildCount");
200   return retval;
201 }
202
203 /**
204  * Accessible_getChildAtIndex:
205  * @obj: a pointer to the #Accessible object on which to operate.
206  * @childIndex: a #long indicating which child is specified.
207  *
208  * Get the #Accessible child of an #Accessible object at a given index.
209  *
210  * Returns: a pointer to the #Accessible child object at index
211  *          @childIndex.
212  *
213  **/
214 Accessible *
215 Accessible_getChildAtIndex (Accessible *obj,
216                             long int childIndex)
217 {
218   Accessible *retval = spi_object_add (Accessibility_Accessible_getChildAtIndex (*obj, childIndex, spi_ev ()));
219   spi_check_ev (spi_ev (), "getChildAtIndex");
220   return retval;
221 }
222
223 /**
224  * Accessible_getIndexInParent:
225  * @obj: a pointer to the #Accessible object on which to operate.
226  *
227  * Get the index of an #Accessible object in its containing #Accessible.
228  *
229  * Returns: a #long indicating the index of the #Accessible object
230  *          in its parent (i.e. containing) #Accessible instance,
231  *          or -1 if @obj has no containing parent.
232  *
233  **/
234 long
235 Accessible_getIndexInParent (Accessible *obj)
236 {
237   long retval = (long) Accessibility_Accessible_getIndexInParent (*obj, spi_ev ());
238   spi_check_ev (spi_ev (), "getIndexInParent");
239   return retval;
240 }
241
242 /**
243  * Accessible_getRelationSet:
244  * @obj: a pointer to the #Accessible object on which to operate.
245  *
246  * Get the set of #AccessibleRelation objects which describe this #Accessible object's
247  *       relationships with other #Accessible objects.
248  *
249  * Returns: an array of #AccessibleRelation pointers.
250  *
251  **/
252 AccessibleRelation **
253 Accessible_getRelationSet (Accessible *obj)
254 {
255   AccessibleRelation **relations;
256   int n_relations;
257   int i;
258   Accessibility_RelationSet *relation_set =     
259           Accessibility_Accessible_getRelationSet (*obj, spi_ev ());
260   
261   /* this looks hack-ish, but it's based on the CORBA C bindings spec */
262   n_relations = relation_set->_length;
263   relations = malloc (sizeof (AccessibleRelation *) * n_relations);
264   
265   for (i=0; i<n_relations; ++i)
266     {
267       relations[i] = spi_object_add (relation_set->_buffer[i]);
268     }
269   relations[i] = CORBA_OBJECT_NIL;
270
271   return relations;
272 }
273
274 /**
275  * Accessible_getRole:
276  * @obj: a pointer to the #Accessible object on which to operate.
277  *
278  * Get the UI role of an #Accessible object.
279  *
280  * Returns: a UTF-8 string indicating the UI role of the #Accessible object.
281  *
282  **/
283 char *
284 Accessible_getRole (Accessible *obj)
285 {
286   char *retval = AccessibleRole_getName (
287                   Accessibility_Accessible_getRole (*obj, spi_ev ()));
288   spi_check_ev (spi_ev (), "getRole");
289   return retval;
290 }
291
292 /**
293  * Accessible_getStateSet:
294  * @obj: a pointer to the #Accessible object on which to operate.
295  *
296  * Not Yet Implemented.
297  *
298  * Returns: a pointer to an #AccessibleStateSet representing the object's current state.
299  **/
300 AccessibleStateSet *
301 Accessible_getStateSet (Accessible *obj)
302 {
303   return NULL;
304 }
305
306 /* Interface query methods */
307
308 /**
309  * Accessible_isAction:
310  * @obj: a pointer to the #Accessible instance to query.
311  *
312  * Query whether the specified #Accessible implements #AccessibleAction.
313  *
314  * Returns: #TRUE if @obj implements the #AccessibleAction interface,
315  *          #FALSE otherwise.
316  **/
317 boolean
318 Accessible_isAction (Accessible *obj)
319 {
320   Bonobo_Unknown iface =
321     Accessibility_Accessible_queryInterface (*obj,
322                                              "IDL:Accessibility/Action:1.0",
323                                              spi_ev ());
324   spi_warn_ev (spi_ev (), "isAction");
325
326   return (CORBA_Object_is_nil (iface, spi_ev ())) ? FALSE : TRUE;
327 }
328
329 /**
330  * Accessible_isComponent:
331  * @obj: a pointer to the #Accessible instance to query.
332  *
333  * Query whether the specified #Accessible implements #AccessibleComponent.
334  *
335  * Returns: #TRUE if @obj implements the #AccessibleComponent interface,
336  *          #FALSE otherwise.
337  **/
338 boolean
339 Accessible_isComponent (Accessible *obj)
340 {
341   Bonobo_Unknown iface =
342     Accessibility_Accessible_queryInterface (*obj,
343                                              "IDL:Accessibility/Component:1.0",
344                                              spi_ev ());
345   spi_warn_ev (spi_ev (), "isComponent");
346
347   return (CORBA_Object_is_nil (iface, spi_ev ())) ? FALSE : TRUE;
348 }
349
350 /**
351  * Accessible_isEditableText:
352  * @obj: a pointer to the #Accessible instance to query.
353  *
354  * Query whether the specified #Accessible implements #AccessibleEditableText.
355  *
356  * Returns: #TRUE if @obj implements the #AccessibleEditableText interface,
357  *          #FALSE otherwise.
358  **/
359 boolean
360 Accessible_isEditableText (Accessible *obj)
361 {
362   Bonobo_Unknown iface =
363     Accessibility_Accessible_queryInterface (*obj,
364                                              "IDL:Accessibility/EditableText:1.0",
365                                              spi_ev ());
366   spi_check_ev (spi_ev (), "isEditableText");
367
368   return (CORBA_Object_is_nil (iface, spi_ev ())) ? FALSE : TRUE;
369 }
370
371 /**
372  * Accessible_isHypertext:
373  * @obj: a pointer to the #Accessible instance to query.
374  *
375  * Query whether the specified #Accessible implements #AccessibleHypertext.
376  *
377  * Returns: #TRUE if @obj implements the #AccessibleHypertext interface,
378  *          #FALSE otherwise.
379  **/
380 boolean
381 Accessible_isHypertext (Accessible *obj)
382 {
383   Bonobo_Unknown iface =
384     Accessibility_Accessible_queryInterface (*obj,
385                                              "IDL:Accessibility/Hypertext:1.0",
386                                              spi_ev ());
387
388   spi_check_ev (spi_ev (), "isHypertext");
389
390   return (CORBA_Object_is_nil (iface, spi_ev ())) ? FALSE : TRUE;
391 }
392
393 /**
394  * Accessible_isImage:
395  * @obj: a pointer to the #Accessible instance to query.
396  *
397  * Query whether the specified #Accessible implements #AccessibleImage.
398  *
399  * Returns: #TRUE if @obj implements the #AccessibleImage interface,
400  *          #FALSE otherwise.
401 **/
402 boolean
403 Accessible_isImage (Accessible *obj)
404 {
405   Bonobo_Unknown iface =
406     Accessibility_Accessible_queryInterface (*obj,
407                                              "IDL:Accessibility/Image:1.0",
408                                              spi_ev ());
409   spi_check_ev (spi_ev (), "isImage");
410
411   return (CORBA_Object_is_nil (iface, spi_ev ())) ? FALSE : TRUE;
412 }
413
414 /**
415  * Accessible_isSelection:
416  * @obj: a pointer to the #Accessible instance to query.
417  *
418  * Query whether the specified #Accessible implements #AccessibleSelection.
419  *
420  * Returns: #TRUE if @obj implements the #AccessibleSelection interface,
421  *          #FALSE otherwise.
422 **/
423 boolean
424 Accessible_isSelection (Accessible *obj)
425 {
426   Bonobo_Unknown iface =
427     Accessibility_Accessible_queryInterface (*obj,
428                                              "IDL:Accessibility/Selection:1.0",
429                                              spi_ev ());
430   spi_warn_ev (spi_ev (), "isSelection");
431
432   return (CORBA_Object_is_nil (iface, spi_ev ())) ? FALSE : TRUE;
433
434 }
435
436 /**
437  * Accessible_isTable:
438  * @obj: a pointer to the #Accessible instance to query.
439  *
440  * Query whether the specified #Accessible implements #AccessibleTable.
441  *
442  * Returns: #TRUE if @obj implements the #AccessibleTable interface,
443  *          #FALSE otherwise.
444 **/
445 boolean
446 Accessible_isTable (Accessible *obj)
447 {
448   Bonobo_Unknown iface =
449     Accessibility_Accessible_queryInterface (*obj,
450                                              "IDL:Accessibility/Table:1.0",
451                                              spi_ev ());
452   spi_check_ev (spi_ev (), "isTable");
453
454   return (CORBA_Object_is_nil (iface, spi_ev ())) ? FALSE : TRUE;
455
456 }
457
458 /**
459  * Accessible_isText:
460  * @obj: a pointer to the #Accessible instance to query.
461  *
462  * Query whether the specified #Accessible implements #AccessibleText.
463  *
464  * Returns: #TRUE if @obj implements the #AccessibleText interface,
465  *          #FALSE otherwise.
466 **/
467 boolean
468 Accessible_isText (Accessible *obj)
469 {
470   Bonobo_Unknown iface =
471     Accessibility_Accessible_queryInterface (*obj,
472                                              "IDL:Accessibility/Text:1.0",
473                                              spi_ev ());
474   spi_warn_ev (spi_ev (), "isText");
475
476   return (CORBA_Object_is_nil (iface, spi_ev ())) ? FALSE : TRUE;
477 }
478
479 /**
480  * Accessible_isValue:
481  * @obj: a pointer to the #Accessible instance to query.
482  *
483  * Query whether the specified #Accessible implements #AccessibleValue.
484  *
485  * Returns: #TRUE if @obj implements the #AccessibleValue interface,
486  *          #FALSE otherwise.
487 **/
488 boolean
489 Accessible_isValue (Accessible *obj)
490 {
491   Bonobo_Unknown iface =
492     Accessibility_Accessible_queryInterface (*obj,
493                                              "IDL:Accessibility/Value:1.0",
494                                              spi_ev ());
495   spi_check_ev (spi_ev (), "isValue");
496
497   return (CORBA_Object_is_nil (iface, spi_ev ())) ? FALSE : TRUE;
498 }
499
500 /**
501  * Accessible_getAction:
502  * @obj: a pointer to the #Accessible instance to query.
503  *
504  * Get the #AccessibleAction interface for an #Accessible.
505  *
506  * Returns: a pointer to an #AccessibleAction interface instance, or
507  *          NULL if @obj does not implement #AccessibleAction.
508  **/
509 AccessibleAction *
510 Accessible_getAction (Accessible *obj)
511 {
512   Bonobo_Unknown iface =
513     Accessibility_Accessible_queryInterface (*obj,
514                                              "IDL:Accessibility/Action:1.0",
515                                              spi_ev ());
516   spi_check_ev (spi_ev (), "getAction");
517
518   return (AccessibleAction *) spi_object_add (iface);
519 }
520
521 /**
522  * Accessible_getComponent:
523  * @obj: a pointer to the #Accessible instance to query.
524  *
525  * Get the #AccessibleComponent interface for an #Accessible.
526  *
527  * Returns: a pointer to an #AccessibleComponent interface instance, or
528  *          NULL if @obj does not implement #AccessibleComponent.
529  **/
530 AccessibleComponent *
531 Accessible_getComponent (Accessible *obj)
532 {
533   Bonobo_Unknown iface =
534     Accessibility_Accessible_queryInterface (*obj,
535                                              "IDL:Accessibility/Component:1.0",
536                                              spi_ev ());
537   spi_check_ev (spi_ev (), "getComponent");
538
539   return (AccessibleComponent *) spi_object_add (iface);
540 }
541
542 /**
543  * Accessible_getEditableText:
544  * @obj: a pointer to the #Accessible instance to query.
545  *
546  * Get the #AccessibleEditableText interface for an #Accessible.
547  *
548  * Returns: a pointer to an #AccessibleEditableText interface instance, or
549  *          NULL if @obj does not implement #AccessibleEditableText.
550  **/
551 AccessibleEditableText *
552 Accessible_getEditableText (Accessible *obj)
553 {
554   Bonobo_Unknown iface =
555     Accessibility_Accessible_queryInterface (*obj,
556                                              "IDL:Accessibility/EditableText:1.0",
557                                              spi_ev ());
558   spi_check_ev (spi_ev (), "getEditableText");
559
560   return (AccessibleEditableText *) spi_object_add (iface);
561 }
562
563
564
565 /**
566  * Accessible_getHypertext:
567  * @obj: a pointer to the #Accessible instance to query.
568  *
569  * Get the #AccessibleHypertext interface for an #Accessible.
570  *
571  * Returns: a pointer to an #AccessibleHypertext interface instance, or
572  *          NULL if @obj does not implement #AccessibleHypertext.
573  **/
574 AccessibleHypertext *
575 Accessible_getHypertext (Accessible *obj)
576 {
577   Bonobo_Unknown iface =
578     Accessibility_Accessible_queryInterface (*obj,
579                                              "IDL:Accessibility/Hypertext:1.0",
580                                              spi_ev ());
581   spi_check_ev (spi_ev (), "getHypertext");
582
583   return (AccessibleHypertext *) spi_object_add (iface);
584 }
585
586
587
588 /**
589  * Accessible_getImage:
590  * @obj: a pointer to the #Accessible instance to query.
591  *
592  * Get the #AccessibleImage interface for an #Accessible.
593  *
594  * Returns: a pointer to an #AccessibleImage interface instance, or
595  *          NULL if @obj does not implement #AccessibleImage.
596  **/
597 AccessibleImage *
598 Accessible_getImage (Accessible *obj)
599 {
600   Bonobo_Unknown iface =
601     Accessibility_Accessible_queryInterface (*obj,
602                                              "IDL:Accessibility/Image:1.0",
603                                              spi_ev ());
604   spi_check_ev (spi_ev (), "getImage");
605
606   return (AccessibleImage *) spi_object_add (iface);
607 }
608
609
610
611 /**
612  * Accessible_getSelection:
613  * @obj: a pointer to the #Accessible instance to query.
614  *
615  * Get the #AccessibleSelection interface for an #Accessible.
616  *
617  * Returns: a pointer to an #AccessibleSelection interface instance, or
618  *          NULL if @obj does not implement #AccessibleSelection.
619  **/
620 AccessibleSelection *
621 Accessible_getSelection (Accessible *obj)
622 {
623   Bonobo_Unknown iface =
624     Accessibility_Accessible_queryInterface (*obj,
625                                              "IDL:Accessibility/Selection:1.0",
626                                              spi_ev ());
627   spi_warn_ev (spi_ev (), "getSelection");
628
629   return (AccessibleSelection *) spi_object_add (iface);
630 }
631
632
633
634 /**
635  * Accessible_getTable:
636  * @obj: a pointer to the #Accessible instance to query.
637  *
638  * Get the #AccessibleTable interface for an #Accessible.
639  *
640  * Returns: a pointer to an #AccessibleTable interface instance, or
641  *          NULL if @obj does not implement #AccessibleTable.
642  **/
643 AccessibleTable *
644 Accessible_getTable (Accessible *obj)
645 {
646   Bonobo_Unknown iface =
647     Accessibility_Accessible_queryInterface (*obj,
648                                              "IDL:Accessibility/Table:1.0",
649                                              spi_ev ());
650   spi_check_ev (spi_ev (), "getTable");
651
652   return (AccessibleTable *) spi_object_add (iface);
653 }
654
655 /**
656  * Accessible_getText:
657  * @obj: a pointer to the #Accessible instance to query.
658  *
659  * Get the #AccessibleText interface for an #Accessible.
660  *
661  * Returns: a pointer to an #AccessibleText interface instance, or
662  *          NULL if @obj does not implement #AccessibleText.
663  **/
664 AccessibleText *
665 Accessible_getText (Accessible *obj)
666 {
667   Bonobo_Unknown iface =
668     Accessibility_Accessible_queryInterface (*obj,
669                                              "IDL:Accessibility/Text:1.0",
670                                              spi_ev ());
671
672   spi_check_ev (spi_ev (), "getText"); 
673
674   return (AccessibleText *) spi_object_add (iface);
675 }
676
677
678
679 /**
680  * Accessible_getValue:
681  * @obj: a pointer to the #Accessible instance to query.
682  *
683  * Get the #AccessibleValue interface for an #Accessible.
684  *
685  * Returns: a pointer to an #AccessibleValue interface instance, or
686  *          NULL if @obj does not implement #AccessibleValue.
687  **/
688 AccessibleValue *
689 Accessible_getValue (Accessible *obj)
690 {
691   Bonobo_Unknown iface =
692     Accessibility_Accessible_queryInterface (*obj,
693                                              "IDL:Accessibility/Value:1.0",
694                                              spi_ev ());
695   return (AccessibleValue *) spi_object_add (iface);
696 }
697
698
699
700 /**
701  * Accessible_queryInterface:
702  * @obj: a pointer to the #Accessible instance to query.
703  * @interface_name: a UTF-8 character string specifiying the requested interface.
704  *
705  * Query an #Accessible object to for a named interface.
706  *
707  * Returns: an instance of the named interface object, if it is implemented
708  *          by @obj, or NULL otherwise.
709  *
710  **/
711 GenericInterface *
712 Accessible_queryInterface (Accessible *obj, char *interface_name)
713 {
714   GenericInterface iface;
715   iface = Accessibility_Accessible_queryInterface (*obj,
716                                                     interface_name,
717                                                     spi_ev ());
718   return spi_object_add (iface);
719 }
720
721
722 /**
723  * AccessibleRelation_ref:
724  * @obj: a pointer to the #AccessibleRelation object on which to operate.
725  *
726  * Increment the reference count for an #AccessibleRelation object.
727  *
728  * Returns: (no return code implemented yet).
729  *
730  **/
731 int
732 AccessibleRelation_ref (AccessibleRelation *obj)
733 {
734   Accessibility_Relation_ref (*obj, spi_ev ());
735   spi_check_ev (spi_ev (), "ref");
736   return 0;
737 }
738
739 /**
740  * AccessibleRelation_unref:
741  * @obj: a pointer to the #AccessibleRelation object on which to operate.
742  *
743  * Decrement the reference count for an #AccessibleRelation object.
744  *
745  * Returns: (no return code implemented yet).
746  *
747  **/
748 int
749 AccessibleRelation_unref (AccessibleRelation *obj)
750 {
751   Accessibility_Relation_unref (*obj, spi_ev ());
752   spi_check_ev (spi_ev (), "unref");
753   return 0;
754 }
755
756 /**
757  * AccessibleRelation_getRelationType:
758  * @obj: a pointer to the #AccessibleRelation object to query.
759  *
760  * Get the type of relationship represented by an #AccessibleRelation.
761  *
762  * Returns: an #AccessibleRelationType indicating the type of relation
763  *         encapsulated in this #AccessibleRelation object.
764  *
765  **/
766 AccessibleRelationType
767 AccessibleRelation_getRelationType (AccessibleRelation *obj)
768 {
769   return 0;
770 }
771
772 /**
773  * AccessibleRelation_getNTargets:
774  * @obj: a pointer to the #AccessibleRelation object to query.
775  *
776  * Get the number of objects which this relationship has as its
777  *       target objects (the subject is the #Accessible from which this
778  *       #AccessibleRelation originated).
779  *
780  * Returns: a short integer indicating how many target objects which the
781  *       originating #Accessible object has the #AccessibleRelation
782  *       relationship with.
783  **/
784 int
785 AccessibleRelation_getNTargets (AccessibleRelation *obj)
786 {
787   return 0;
788 }
789
790 /**
791  * AccessibleRelation_getTarget:
792  * @obj: a pointer to the #AccessibleRelation object to query.
793  * @i: a (zero-index) integer indicating which (of possibly several) target is requested.
794  *
795  * Get the @i-th target of a specified #AccessibleRelation relationship.
796  *
797  * Returns: an #Accessible which is the @i-th object with which the
798  *      originating #Accessible has relationship specified in the
799  *      #AccessibleRelation object.
800  *
801  **/
802 Accessible *
803 AccessibleRelation_getTarget (AccessibleRelation *obj, int i)
804 {
805   return NULL;
806 }
807
808 /**
809  * AccessibleStateSet_ref:
810  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
811  *
812  * Increment the reference count for an #AccessibleStateSet object.
813  *
814  * Returns: (no return code implemented yet).
815  *
816  **/
817 int
818 AccessibleStateSet_ref (AccessibleStateSet *obj)
819 {
820 /*  Accessibility_StateSet_ref (*obj, spi_ev ()); */
821   spi_check_ev (spi_ev (), "ref");
822   return 0;
823 }
824
825 /**
826  * AccessibleStateSet_unref:
827  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
828  *
829  * Decrement the reference count for an #AccessibleStateSet object.
830  *
831  * Returns: (no return code implemented yet).
832  *
833  **/
834 int
835 AccessibleStateSet_unref (AccessibleStateSet *obj)
836 {
837 /*  Accessibility_StateSet_unref (*obj, spi_ev ()); */
838   spi_check_ev (spi_ev (), "unref");
839   return 0;
840 }
841
842
843 /**
844  * AccessibleStateSet_contains:
845  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
846  * @state: an #AccessibleState for which the specified #AccessibleStateSet
847  *       will be queried.
848  *
849  * Determine whether a given #AccessibleStateSet includes a given state; that is,
850  *       whether @state is true for the stateset in question.
851  *
852  * Returns: #TRUE if @state is true/included in the given #AccessibleStateSet,
853  *          otherwise #FALSE.
854  *
855  **/
856 boolean
857 AccessibleStateSet_contains (AccessibleStateSet *obj,
858                              AccessibleState state)
859 {
860   CORBA_boolean retval = Accessibility_StateSet_contains (*obj, state, spi_ev ());
861   spi_check_ev (spi_ev (), "contains");
862   return (boolean) retval;
863 }
864
865 /**
866  * AccessibleStateSet_add:
867  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
868  * @state: an #AccessibleState to be added to the specified #AccessibleStateSet
869  *
870  * Add a particular #AccessibleState to an #AccessibleStateSet (i.e. set the
871  *       given state to #TRUE in the stateset.
872  *
873  **/
874 void
875 AccessibleStateSet_add (AccessibleStateSet *obj,
876                         AccessibleState state)
877 {
878   Accessibility_StateSet_add (*obj, state, spi_ev ());
879   spi_check_ev (spi_ev (), "contains");
880 }
881
882
883 /**
884  * AccessibleStateSet_remove:
885  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
886  * @state: an #AccessibleState to be removed from the specified #AccessibleStateSet
887  *
888  * Remove a particular #AccessibleState to an #AccessibleStateSet (i.e. set the
889  *       given state to #FALSE in the stateset.)
890  *
891  **/
892 void
893 AccessibleStateSet_remove (AccessibleStateSet *obj,
894                            AccessibleState state)
895 {
896   Accessibility_StateSet_remove (*obj, state, spi_ev ());
897   spi_check_ev (spi_ev (), "contains");
898 }
899
900 /**
901  * AccessibleStateSet_equals:
902  * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
903  * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
904  *
905  * Determine whether two instances of #AccessibleStateSet are equivalent (i.e.
906  *         consist of the same #AccessibleStates).  Useful for checking multiple
907  *         state variables at once; construct the target state then compare against it.
908  *
909  * @see AccessibleStateSet_compare().
910  *
911  * Returns: #TRUE if the two #AccessibleStateSets are equivalent,
912  *          otherwise #FALSE.
913  *
914  **/
915 boolean
916 AccessibleStateSet_equals (AccessibleStateSet *obj,
917                            AccessibleStateSet *obj2)
918 {
919   return Accessibility_StateSet_equals (*obj, *obj2, spi_ev ());
920 }
921
922 /**
923  * AccessibleStateSet_compare:
924  * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
925  * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
926  * @differenceSet: a pointer to an array of #AccessibleStates, which is set when the
927  *        fuction returns to point to an array of states representing the states which
928  *        the two state sets do not have in common.
929  *
930  * Determine the differences between two instances of #AccessibleStateSet.
931  *.
932  * @see AccessibleStateSet_equals().
933  *
934  * Returns: an #AccessibleStateSet object containing all states contained on one of
935  *          the two sets but not the other.
936  *
937  **/
938 void
939 AccessibleStateSet_compare (AccessibleStateSet *obj,
940                             AccessibleStateSet *obj2,
941                             AccessibleStateSet **differenceSet);
942
943
944 /**
945  * AccessibleStateSet_isEmpty:
946  * @obj: a pointer to the #AccessibleStateSet object on which to operate.
947  *
948  * Determine whether a given #AccessibleStateSet is the empty set.
949  *
950  * Returns: #TRUE if the given #AccessibleStateSet contains no (true) states,
951  *          otherwise #FALSE.
952  *
953  **/
954 boolean
955 AccessibleStateSet_isEmpty (AccessibleStateSet *obj)
956 {
957   return TRUE;  
958   /*  return Accessibility_StateSet_isEmpty (*obj, spi_ev ());*/
959 }
960
961
962
963