3 static char *role_names [MAX_ROLES] =
61 "table column header",
75 * AccessibleRole_getName:
76 * @role: an #AccessibleRole object to query.
78 * Get a localizeable string that indicates the name of an #AccessibleRole.
80 * Returns: a localizable string name for an #AccessibleRole enumerated type.
83 AccessibleRole_getName (AccessibleRole role)
85 if (role < MAX_ROLES) return role_names [(int) role];
93 * @obj: a pointer to the #Accessible object on which to operate.
95 * Increment the reference count for an #Accessible object.
97 * Returns: (no return code implemented yet).
101 Accessible_ref (Accessible *obj)
103 Accessibility_Accessible_ref (*obj, &ev);
104 spi_check_ev (&ev, "ref");
111 * @obj: a pointer to the #Accessible object on which to operate.
113 * Decrement the reference count for an #Accessible object.
115 * Returns: (no return code implemented yet).
119 Accessible_unref (Accessible *obj)
121 Accessibility_Accessible_unref (*obj, &ev);
122 spi_check_ev (&ev, "unref");
127 * Accessible_getName:
128 * @obj: a pointer to the #Accessible object on which to operate.
130 * Get the name of an #Accessible object.
132 * Returns: a UTF-8 string indicating the name of the #Accessible object.
136 Accessible_getName (Accessible *obj)
140 Accessibility_Accessible__get_name (*obj, &ev);
141 spi_check_ev (&ev, "getName");
146 * Accessible_getDescription:
147 * @obj: a pointer to the #Accessible object on which to operate.
149 * Get the description of an #Accessible object.
151 * Returns: a UTF-8 string describing the #Accessible object.
155 Accessible_getDescription (Accessible *obj)
157 char *retval = (char *)
158 Accessibility_Accessible__get_description (*obj, &ev);
159 spi_check_ev (&ev, "getDescription");
164 * Accessible_getParent:
165 * @obj: a pointer to the #Accessible object to query.
167 * Get an #Accessible object's parent container.
169 * Returns: a pointer tothe #Accessible object which contains the given
170 * #Accessible instance, or NULL if the @obj has no parent container.
174 Accessible_getParent (Accessible *obj)
177 Obj_Add (Accessibility_Accessible__get_parent (*obj, &ev));
178 spi_check_ev (&ev, "getParent");
183 * Accessible_getChildCount:
184 * @obj: a pointer to the #Accessible object on which to operate.
186 * Get the number of children contained by an #Accessible object.
188 * Returns: a #long indicating the number of #Accessible children
189 * contained by an #Accessible object.
193 Accessible_getChildCount (Accessible *obj)
195 long retval = (long) Accessibility_Accessible__get_childCount (*obj, &ev);
196 spi_check_ev (&ev, "getChildCount");
201 * Accessible_getChildAtIndex:
202 * @obj: a pointer to the #Accessible object on which to operate.
203 * @childIndex: a #long indicating which child is specified.
205 * Get the #Accessible child of an #Accessible object at a given index.
207 * Returns: a pointer to the #Accessible child object at index
212 Accessible_getChildAtIndex (Accessible *obj,
215 Accessible *retval = Obj_Add (Accessibility_Accessible_getChildAtIndex (*obj, childIndex, &ev));
216 spi_check_ev (&ev, "getChildAtIndex");
221 * Accessible_getIndexInParent:
222 * @obj: a pointer to the #Accessible object on which to operate.
224 * Get the index of an #Accessible object in its containing #Accessible.
226 * Returns: a #long indicating the index of the #Accessible object
227 * in its parent (i.e. containing) #Accessible instance,
228 * or -1 if @obj has no containing parent.
232 Accessible_getIndexInParent (Accessible *obj)
234 long retval = (long) Accessibility_Accessible_getIndexInParent (*obj, &ev);
235 spi_check_ev (&ev, "getIndexInParent");
240 * Accessible_getRelationSet:
241 * @obj: a pointer to the #Accessible object on which to operate.
243 * Get the set of #AccessibleRelation objects which describe this #Accessible object's
244 * relationships with other #Accessible objects.
246 * Returns: an array of #AccessibleRelation pointers.
249 AccessibleRelation **
250 Accessible_getRelationSet (Accessible *obj)
252 AccessibleRelation **relations;
255 Accessibility_RelationSet *relation_set =
256 Accessibility_Accessible_getRelationSet (*obj, &ev);
258 /* this looks hack-ish, but it's based on the CORBA C bindings spec */
259 n_relations = relation_set->_length;
260 relations = malloc (sizeof (AccessibleRelation *) * n_relations);
262 for (i=0; i<n_relations; ++i)
264 relations[i] = Obj_Add (relation_set->_buffer[i]);
266 relations[i] = CORBA_OBJECT_NIL;
272 * Accessible_getRole:
273 * @obj: a pointer to the #Accessible object on which to operate.
275 * Get the UI role of an #Accessible object.
277 * Returns: a UTF-8 string indicating the UI role of the #Accessible object.
281 Accessible_getRole (Accessible *obj)
283 char *retval = AccessibleRole_getName (
284 Accessibility_Accessible_getRole (*obj, &ev));
285 spi_check_ev (&ev, "getRole");
290 * Accessible_getStateSet:
291 * @obj: a pointer to the #Accessible object on which to operate.
293 * Not Yet Implemented.
295 * Returns: a pointer to an #AccessibleStateSet representing the object's current state.
298 Accessible_getStateSet (Accessible *obj)
303 /* Interface query methods */
306 * Accessible_isAction:
307 * @obj: a pointer to the #Accessible instance to query.
309 * Query whether the specified #Accessible implements #AccessibleAction.
311 * Returns: #TRUE if @obj implements the #AccessibleAction interface,
315 Accessible_isAction (Accessible *obj)
317 Bonobo_Unknown iface =
318 Accessibility_Accessible_queryInterface (*obj,
319 "IDL:Accessibility/Action:1.0",
321 spi_warn_ev (&ev, "isAction");
323 return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
327 * Accessible_isComponent:
328 * @obj: a pointer to the #Accessible instance to query.
330 * Query whether the specified #Accessible implements #AccessibleComponent.
332 * Returns: #TRUE if @obj implements the #AccessibleComponent interface,
336 Accessible_isComponent (Accessible *obj)
338 Bonobo_Unknown iface =
339 Accessibility_Accessible_queryInterface (*obj,
340 "IDL:Accessibility/Component:1.0",
342 spi_warn_ev (&ev, "isComponent");
344 return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
348 * Accessible_isEditableText:
349 * @obj: a pointer to the #Accessible instance to query.
351 * Query whether the specified #Accessible implements #AccessibleEditableText.
353 * Returns: #TRUE if @obj implements the #AccessibleEditableText interface,
357 Accessible_isEditableText (Accessible *obj)
359 Bonobo_Unknown iface =
360 Accessibility_Accessible_queryInterface (*obj,
361 "IDL:Accessibility/EditableText:1.0",
363 spi_check_ev (&ev, "isEditableText");
365 return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
369 * Accessible_isHypertext:
370 * @obj: a pointer to the #Accessible instance to query.
372 * Query whether the specified #Accessible implements #AccessibleHypertext.
374 * Returns: #TRUE if @obj implements the #AccessibleHypertext interface,
378 Accessible_isHypertext (Accessible *obj)
380 Bonobo_Unknown iface =
381 Accessibility_Accessible_queryInterface (*obj,
382 "IDL:Accessibility/Hypertext:1.0",
385 spi_check_ev (&ev, "isHypertext");
387 return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
391 * Accessible_isImage:
392 * @obj: a pointer to the #Accessible instance to query.
394 * Query whether the specified #Accessible implements #AccessibleImage.
396 * Returns: #TRUE if @obj implements the #AccessibleImage interface,
400 Accessible_isImage (Accessible *obj)
402 Bonobo_Unknown iface =
403 Accessibility_Accessible_queryInterface (*obj,
404 "IDL:Accessibility/Image:1.0",
406 spi_check_ev (&ev, "isImage");
408 return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
412 * Accessible_isSelection:
413 * @obj: a pointer to the #Accessible instance to query.
415 * Query whether the specified #Accessible implements #AccessibleSelection.
417 * Returns: #TRUE if @obj implements the #AccessibleSelection interface,
421 Accessible_isSelection (Accessible *obj)
423 Bonobo_Unknown iface =
424 Accessibility_Accessible_queryInterface (*obj,
425 "IDL:Accessibility/Selection:1.0",
427 spi_warn_ev (&ev, "isSelection");
429 return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
434 * Accessible_isTable:
435 * @obj: a pointer to the #Accessible instance to query.
437 * Query whether the specified #Accessible implements #AccessibleTable.
439 * Returns: #TRUE if @obj implements the #AccessibleTable interface,
443 Accessible_isTable (Accessible *obj)
445 Bonobo_Unknown iface =
446 Accessibility_Accessible_queryInterface (*obj,
447 "IDL:Accessibility/Table:1.0",
449 spi_check_ev (&ev, "isTable");
451 return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
457 * @obj: a pointer to the #Accessible instance to query.
459 * Query whether the specified #Accessible implements #AccessibleText.
461 * Returns: #TRUE if @obj implements the #AccessibleText interface,
465 Accessible_isText (Accessible *obj)
467 Bonobo_Unknown iface =
468 Accessibility_Accessible_queryInterface (*obj,
469 "IDL:Accessibility/Text:1.0",
471 spi_warn_ev (&ev, "isText");
473 return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
477 * Accessible_isValue:
478 * @obj: a pointer to the #Accessible instance to query.
480 * Query whether the specified #Accessible implements #AccessibleValue.
482 * Returns: #TRUE if @obj implements the #AccessibleValue interface,
486 Accessible_isValue (Accessible *obj)
488 Bonobo_Unknown iface =
489 Accessibility_Accessible_queryInterface (*obj,
490 "IDL:Accessibility/Value:1.0",
492 spi_check_ev (&ev, "isValue");
494 return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
498 * Accessible_getAction:
499 * @obj: a pointer to the #Accessible instance to query.
501 * Get the #AccessibleAction interface for an #Accessible.
503 * Returns: a pointer to an #AccessibleAction interface instance, or
504 * NULL if @obj does not implement #AccessibleAction.
507 Accessible_getAction (Accessible *obj)
509 Bonobo_Unknown iface =
510 Accessibility_Accessible_queryInterface (*obj,
511 "IDL:Accessibility/Action:1.0",
513 spi_check_ev (&ev, "getAction");
515 return (AccessibleAction *)
516 ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
520 * Accessible_getComponent:
521 * @obj: a pointer to the #Accessible instance to query.
523 * Get the #AccessibleComponent interface for an #Accessible.
525 * Returns: a pointer to an #AccessibleComponent interface instance, or
526 * NULL if @obj does not implement #AccessibleComponent.
528 AccessibleComponent *
529 Accessible_getComponent (Accessible *obj)
531 Bonobo_Unknown iface =
532 Accessibility_Accessible_queryInterface (*obj,
533 "IDL:Accessibility/Component:1.0",
535 spi_check_ev (&ev, "getComponent");
537 return (AccessibleComponent *) ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
541 * Accessible_getEditableText:
542 * @obj: a pointer to the #Accessible instance to query.
544 * Get the #AccessibleEditableText interface for an #Accessible.
546 * Returns: a pointer to an #AccessibleEditableText interface instance, or
547 * NULL if @obj does not implement #AccessibleEditableText.
549 AccessibleEditableText *
550 Accessible_getEditableText (Accessible *obj)
552 Bonobo_Unknown iface =
553 Accessibility_Accessible_queryInterface (*obj,
554 "IDL:Accessibility/EditableText:1.0",
556 spi_check_ev (&ev, "getEditableText");
558 return (AccessibleEditableText *)
559 ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
565 * Accessible_getHypertext:
566 * @obj: a pointer to the #Accessible instance to query.
568 * Get the #AccessibleHypertext interface for an #Accessible.
570 * Returns: a pointer to an #AccessibleHypertext interface instance, or
571 * NULL if @obj does not implement #AccessibleHypertext.
573 AccessibleHypertext *
574 Accessible_getHypertext (Accessible *obj)
576 Bonobo_Unknown iface =
577 Accessibility_Accessible_queryInterface (*obj,
578 "IDL:Accessibility/Hypertext:1.0",
580 spi_check_ev (&ev, "getHypertext");
582 return (AccessibleHypertext *)
583 ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
589 * Accessible_getImage:
590 * @obj: a pointer to the #Accessible instance to query.
592 * Get the #AccessibleImage interface for an #Accessible.
594 * Returns: a pointer to an #AccessibleImage interface instance, or
595 * NULL if @obj does not implement #AccessibleImage.
598 Accessible_getImage (Accessible *obj)
600 Bonobo_Unknown iface =
601 Accessibility_Accessible_queryInterface (*obj,
602 "IDL:Accessibility/Image:1.0",
604 spi_check_ev (&ev, "getImage");
606 return (AccessibleImage *)
607 ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
613 * Accessible_getSelection:
614 * @obj: a pointer to the #Accessible instance to query.
616 * Get the #AccessibleSelection interface for an #Accessible.
618 * Returns: a pointer to an #AccessibleSelection interface instance, or
619 * NULL if @obj does not implement #AccessibleSelection.
621 AccessibleSelection *
622 Accessible_getSelection (Accessible *obj)
624 Bonobo_Unknown iface =
625 Accessibility_Accessible_queryInterface (*obj,
626 "IDL:Accessibility/Selection:1.0",
628 spi_warn_ev (&ev, "getSelection");
630 return (AccessibleSelection *)
631 ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
637 * Accessible_getTable:
638 * @obj: a pointer to the #Accessible instance to query.
640 * Get the #AccessibleTable interface for an #Accessible.
642 * Returns: a pointer to an #AccessibleTable interface instance, or
643 * NULL if @obj does not implement #AccessibleTable.
646 Accessible_getTable (Accessible *obj)
648 Bonobo_Unknown iface =
649 Accessibility_Accessible_queryInterface (*obj,
650 "IDL:Accessibility/Table:1.0",
652 spi_check_ev (&ev, "getTable");
654 return (AccessibleTable *)
655 ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
659 * Accessible_getText:
660 * @obj: a pointer to the #Accessible instance to query.
662 * Get the #AccessibleText interface for an #Accessible.
664 * Returns: a pointer to an #AccessibleText interface instance, or
665 * NULL if @obj does not implement #AccessibleText.
668 Accessible_getText (Accessible *obj)
670 Bonobo_Unknown iface =
671 Accessibility_Accessible_queryInterface (*obj,
672 "IDL:Accessibility/Text:1.0",
675 spi_check_ev (&ev, "getText");
677 return (AccessibleText *)
678 ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
684 * Accessible_getValue:
685 * @obj: a pointer to the #Accessible instance to query.
687 * Get the #AccessibleValue interface for an #Accessible.
689 * Returns: a pointer to an #AccessibleValue interface instance, or
690 * NULL if @obj does not implement #AccessibleValue.
693 Accessible_getValue (Accessible *obj)
695 Bonobo_Unknown iface =
696 Accessibility_Accessible_queryInterface (*obj,
697 "IDL:Accessibility/Value:1.0",
699 return (AccessibleValue *)
700 ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
706 * Accessible_queryInterface:
707 * @obj: a pointer to the #Accessible instance to query.
708 * @interface_name: a UTF-8 character string specifiying the requested interface.
710 * Query an #Accessible object to for a named interface.
712 * Returns: an instance of the named interface object, if it is implemented
713 * by @obj, or NULL otherwise.
717 Accessible_queryInterface (Accessible *obj, char *interface_name)
719 GenericInterface iface;
720 iface = Accessibility_Accessible_queryInterface (*obj,
723 return (iface != NULL) ? Obj_Add (iface) : NULL;
728 * AccessibleRelation_ref:
729 * @obj: a pointer to the #AccessibleRelation object on which to operate.
731 * Increment the reference count for an #AccessibleRelation object.
733 * Returns: (no return code implemented yet).
737 AccessibleRelation_ref (AccessibleRelation *obj)
739 Accessibility_Relation_ref (*obj, &ev);
740 spi_check_ev (&ev, "ref");
745 * AccessibleRelation_unref:
746 * @obj: a pointer to the #AccessibleRelation object on which to operate.
748 * Decrement the reference count for an #AccessibleRelation object.
750 * Returns: (no return code implemented yet).
754 AccessibleRelation_unref (AccessibleRelation *obj)
756 Accessibility_Relation_unref (*obj, &ev);
757 spi_check_ev (&ev, "unref");
762 * AccessibleRelation_getRelationType:
763 * @obj: a pointer to the #AccessibleRelation object to query.
765 * Get the type of relationship represented by an #AccessibleRelation.
767 * Returns: an #AccessibleRelationType indicating the type of relation
768 * encapsulated in this #AccessibleRelation object.
771 AccessibleRelationType
772 AccessibleRelation_getRelationType (AccessibleRelation *obj)
778 * AccessibleRelation_getNTargets:
779 * @obj: a pointer to the #AccessibleRelation object to query.
781 * Get the number of objects which this relationship has as its
782 * target objects (the subject is the #Accessible from which this
783 * #AccessibleRelation originated).
785 * Returns: a short integer indicating how many target objects which the
786 * originating #Accessible object has the #AccessibleRelation
790 AccessibleRelation_getNTargets (AccessibleRelation *obj)
796 * AccessibleRelation_getTarget:
797 * @obj: a pointer to the #AccessibleRelation object to query.
798 * @i: a (zero-index) integer indicating which (of possibly several) target is requested.
800 * Get the @i-th target of a specified #AccessibleRelation relationship.
802 * Returns: an #Accessible which is the @i-th object with which the
803 * originating #Accessible has relationship specified in the
804 * #AccessibleRelation object.
808 AccessibleRelation_getTarget (AccessibleRelation *obj, int i)
814 * AccessibleStateSet_ref:
815 * @obj: a pointer to the #AccessibleStateSet object on which to operate.
817 * Increment the reference count for an #AccessibleStateSet object.
819 * Returns: (no return code implemented yet).
823 AccessibleStateSet_ref (AccessibleStateSet *obj)
825 /* Accessibility_StateSet_ref (*obj, &ev); */
826 spi_check_ev (&ev, "ref");
831 * AccessibleStateSet_unref:
832 * @obj: a pointer to the #AccessibleStateSet object on which to operate.
834 * Decrement the reference count for an #AccessibleStateSet object.
836 * Returns: (no return code implemented yet).
840 AccessibleStateSet_unref (AccessibleStateSet *obj)
842 /* Accessibility_StateSet_unref (*obj, &ev); */
843 spi_check_ev (&ev, "unref");
849 * AccessibleStateSet_contains:
850 * @obj: a pointer to the #AccessibleStateSet object on which to operate.
851 * @state: an #AccessibleState for which the specified #AccessibleStateSet
854 * Determine whether a given #AccessibleStateSet includes a given state; that is,
855 * whether @state is true for the stateset in question.
857 * Returns: #TRUE if @state is true/included in the given #AccessibleStateSet,
862 AccessibleStateSet_contains (AccessibleStateSet *obj,
863 AccessibleState state)
865 CORBA_boolean retval = Accessibility_StateSet_contains (*obj, state, &ev);
866 spi_check_ev (&ev, "contains");
867 return (boolean) retval;
871 * AccessibleStateSet_add:
872 * @obj: a pointer to the #AccessibleStateSet object on which to operate.
873 * @state: an #AccessibleState to be added to the specified #AccessibleStateSet
875 * Add a particular #AccessibleState to an #AccessibleStateSet (i.e. set the
876 * given state to #TRUE in the stateset.
880 AccessibleStateSet_add (AccessibleStateSet *obj,
881 AccessibleState state)
883 Accessibility_StateSet_add (*obj, state, &ev);
884 spi_check_ev (&ev, "contains");
889 * AccessibleStateSet_remove:
890 * @obj: a pointer to the #AccessibleStateSet object on which to operate.
891 * @state: an #AccessibleState to be removed from the specified #AccessibleStateSet
893 * Remove a particular #AccessibleState to an #AccessibleStateSet (i.e. set the
894 * given state to #FALSE in the stateset.)
898 AccessibleStateSet_remove (AccessibleStateSet *obj,
899 AccessibleState state)
901 Accessibility_StateSet_remove (*obj, state, &ev);
902 spi_check_ev (&ev, "contains");
906 * AccessibleStateSet_equals:
907 * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
908 * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
910 * Determine whether two instances of #AccessibleStateSet are equivalent (i.e.
911 * consist of the same #AccessibleStates). Useful for checking multiple
912 * state variables at once; construct the target state then compare against it.
914 * @see AccessibleStateSet_compare().
916 * Returns: #TRUE if the two #AccessibleStateSets are equivalent,
921 AccessibleStateSet_equals (AccessibleStateSet *obj,
922 AccessibleStateSet *obj2)
924 return Accessibility_StateSet_equals (*obj, *obj2, &ev);
928 * AccessibleStateSet_compare:
929 * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
930 * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
932 * Determine the differences between two instances of #AccessibleStateSet.
934 * @see AccessibleStateSet_equals().
936 * Returns: an #AccessibleStateSet object containing all states contained on one of
937 * the two sets but not the other.
941 AccessibleStateSet_compare (AccessibleStateSet *obj,
942 AccessibleStateSet *obj2,
943 AccessibleStateSet **differenceSet);
947 * AccessibleStateSet_isEmpty:
948 * @obj: a pointer to the #AccessibleStateSet object on which to operate.
950 * Determine whether a given #AccessibleStateSet is the empty set.
952 * Returns: #TRUE if the given #AccessibleStateSet contains no (true) states,
957 AccessibleStateSet_isEmpty (AccessibleStateSet *obj)
960 /* return Accessibility_StateSet_isEmpty (*obj, &ev);*/