#include <stdlib.h> /* for malloc */
#include <cspi/spi-private.h>
-#define MAX_ROLES 100
-
-static char *role_names [MAX_ROLES] =
+static const char *role_names [] =
{
- " ",
+ "<invalid>",
"accelerator label",
"alert",
"animation",
"calendar",
"canvas",
"check box",
- "menu item",
"color chooser",
"column header",
"combo box",
"dial",
"dialog",
"directory pane",
- "drawing area",
"file chooser",
"filler",
+ "focus traversable",
"font chooser",
"frame",
"glass pane",
"scrollpane",
"separator",
"slider",
- "split pane",
"spin button",
+ "split pane",
"status bar",
"table",
"table cell",
"toolbar",
"tooltip",
"tree",
- " ",
+ "tree-table",
+ "<unknown>",
"viewport",
"window",
+
};
+#define MAX_ROLES (sizeof (role_names) / sizeof (char *))
+
+static SPIBoolean
+cspi_init_role_table (AccessibleRole *role_table)
+{
+ int i;
+ for (i = 0; i < Accessibility_ROLE_LAST_DEFINED; ++i)
+ {
+ role_table [i] = SPI_ROLE_UNKNOWN;
+ }
+ role_table [Accessibility_ROLE_INVALID] = SPI_ROLE_INVALID;
+ role_table [Accessibility_ROLE_ACCELERATOR_LABEL] = SPI_ROLE_ACCEL_LABEL;
+ role_table [Accessibility_ROLE_ALERT] = SPI_ROLE_ALERT;
+ role_table [Accessibility_ROLE_ANIMATION] = SPI_ROLE_ANIMATION;
+ role_table [Accessibility_ROLE_ARROW] = SPI_ROLE_ARROW;
+ role_table [Accessibility_ROLE_CALENDAR] = SPI_ROLE_CALENDAR;
+ role_table [Accessibility_ROLE_CANVAS] = SPI_ROLE_CANVAS;
+ role_table [Accessibility_ROLE_CHECK_BOX] = SPI_ROLE_CHECK_BOX;
+ role_table [Accessibility_ROLE_COLOR_CHOOSER] = SPI_ROLE_COLOR_CHOOSER;
+ role_table [Accessibility_ROLE_COLUMN_HEADER] = SPI_ROLE_COLUMN_HEADER;
+ role_table [Accessibility_ROLE_COMBO_BOX] = SPI_ROLE_COMBO_BOX;
+ role_table [Accessibility_ROLE_DATE_EDITOR] = SPI_ROLE_DATE_EDITOR;
+ role_table [Accessibility_ROLE_DESKTOP_ICON] = SPI_ROLE_DESKTOP_ICON;
+ role_table [Accessibility_ROLE_DESKTOP_FRAME] = SPI_ROLE_DESKTOP_FRAME;
+ role_table [Accessibility_ROLE_DIAL] = SPI_ROLE_DIAL;
+ role_table [Accessibility_ROLE_DIALOG] = SPI_ROLE_DIALOG;
+ role_table [Accessibility_ROLE_DIRECTORY_PANE] = SPI_ROLE_DIRECTORY_PANE;
+ role_table [Accessibility_ROLE_FILE_CHOOSER] = SPI_ROLE_FILE_CHOOSER;
+ role_table [Accessibility_ROLE_FILLER] = SPI_ROLE_FILLER;
+ role_table [Accessibility_ROLE_FONT_CHOOSER] = SPI_ROLE_FONT_CHOOSER;
+ role_table [Accessibility_ROLE_FRAME] = SPI_ROLE_FRAME;
+ role_table [Accessibility_ROLE_GLASS_PANE] = SPI_ROLE_GLASS_PANE;
+ role_table [Accessibility_ROLE_HTML_CONTAINER] = SPI_ROLE_HTML_CONTAINER;
+ role_table [Accessibility_ROLE_ICON] = SPI_ROLE_ICON;
+ role_table [Accessibility_ROLE_IMAGE] = SPI_ROLE_IMAGE;
+ role_table [Accessibility_ROLE_INTERNAL_FRAME] = SPI_ROLE_INTERNAL_FRAME;
+ role_table [Accessibility_ROLE_LABEL] = SPI_ROLE_LABEL;
+ role_table [Accessibility_ROLE_LAYERED_PANE] = SPI_ROLE_LAYERED_PANE;
+ role_table [Accessibility_ROLE_LIST] = SPI_ROLE_LIST;
+ role_table [Accessibility_ROLE_LIST_ITEM] = SPI_ROLE_LIST_ITEM;
+ role_table [Accessibility_ROLE_MENU] = SPI_ROLE_MENU;
+ role_table [Accessibility_ROLE_MENU_BAR] = SPI_ROLE_MENU_BAR;
+ role_table [Accessibility_ROLE_MENU_ITEM] = SPI_ROLE_MENU_ITEM;
+ role_table [Accessibility_ROLE_OPTION_PANE] = SPI_ROLE_OPTION_PANE;
+ role_table [Accessibility_ROLE_PAGE_TAB] = SPI_ROLE_PAGE_TAB;
+ role_table [Accessibility_ROLE_PAGE_TAB_LIST] = SPI_ROLE_PAGE_TAB_LIST;
+ role_table [Accessibility_ROLE_PANEL] = SPI_ROLE_PANEL;
+ role_table [Accessibility_ROLE_PASSWORD_TEXT] = SPI_ROLE_PASSWORD_TEXT;
+ role_table [Accessibility_ROLE_POPUP_MENU] = SPI_ROLE_POPUP_MENU;
+ role_table [Accessibility_ROLE_PROGRESS_BAR] = SPI_ROLE_PROGRESS_BAR;
+ role_table [Accessibility_ROLE_PUSH_BUTTON] = SPI_ROLE_PUSH_BUTTON;
+ role_table [Accessibility_ROLE_RADIO_BUTTON] = SPI_ROLE_RADIO_BUTTON;
+ role_table [Accessibility_ROLE_RADIO_MENU_ITEM] = SPI_ROLE_RADIO_MENU_ITEM;
+ role_table [Accessibility_ROLE_ROOT_PANE] = SPI_ROLE_ROOT_PANE;
+ role_table [Accessibility_ROLE_ROW_HEADER] = SPI_ROLE_ROW_HEADER;
+ role_table [Accessibility_ROLE_SCROLL_BAR] = SPI_ROLE_SCROLL_BAR;
+ role_table [Accessibility_ROLE_SCROLL_PANE] = SPI_ROLE_SCROLL_PANE;
+ role_table [Accessibility_ROLE_SEPARATOR] = SPI_ROLE_SEPARATOR;
+ role_table [Accessibility_ROLE_SLIDER] = SPI_ROLE_SLIDER;
+ role_table [Accessibility_ROLE_SPIN_BUTTON] = SPI_ROLE_SPIN_BUTTON;
+ role_table [Accessibility_ROLE_SPLIT_PANE] = SPI_ROLE_SPLIT_PANE;
+ role_table [Accessibility_ROLE_STATUS_BAR] = SPI_ROLE_STATUS_BAR;
+ role_table [Accessibility_ROLE_TABLE] = SPI_ROLE_TABLE;
+ role_table [Accessibility_ROLE_TABLE_CELL] = SPI_ROLE_TABLE_CELL;
+ role_table [Accessibility_ROLE_TEAROFF_MENU_ITEM] = SPI_ROLE_TEAROFF_MENU_ITEM;
+ role_table [Accessibility_ROLE_TEXT] = SPI_ROLE_TEXT;
+ role_table [Accessibility_ROLE_TOGGLE_BUTTON] = SPI_ROLE_TOGGLE_BUTTON;
+ role_table [Accessibility_ROLE_TOOL_BAR] = SPI_ROLE_TOOL_BAR;
+ role_table [Accessibility_ROLE_TOOL_TIP] = SPI_ROLE_TOOL_TIP;
+ role_table [Accessibility_ROLE_TREE] = SPI_ROLE_TREE;
+ role_table [Accessibility_ROLE_TREE_TABLE] = SPI_ROLE_TREE_TABLE;
+ role_table [Accessibility_ROLE_UNKNOWN] = SPI_ROLE_UNKNOWN;
+ role_table [Accessibility_ROLE_VIEWPORT] = SPI_ROLE_VIEWPORT;
+ role_table [Accessibility_ROLE_WINDOW] = SPI_ROLE_WINDOW;
+ role_table [Accessibility_ROLE_EXTENDED] = SPI_ROLE_EXTENDED;
+ role_table [Accessibility_ROLE_LAST_DEFINED] = SPI_ROLE_EXTENDED;
+
+ return TRUE;
+}
+
+static AccessibleRole
+cspi_role_from_spi_role (Accessibility_Role role)
+{
+ /* array is sized according to IDL roles because IDL roles are the index */
+ static AccessibleRole cspi_role_table [Accessibility_ROLE_LAST_DEFINED];
+ static SPIBoolean is_initialized = FALSE;
+ AccessibleRole cspi_role;
+ if (!is_initialized)
+ {
+ is_initialized = cspi_init_role_table (cspi_role_table);
+ }
+ if (role >= 0 && role < Accessibility_ROLE_LAST_DEFINED)
+ {
+ cspi_role = cspi_role_table [role];
+ }
+ else
+ {
+ cspi_role = SPI_ROLE_EXTENDED;
+ }
+ return cspi_role;
+}
+
/**
* AccessibleRole_getName:
* @role: an #AccessibleRole object to query.
*
* Get a localizeable string that indicates the name of an #AccessibleRole.
+ * <em>DEPRECATED.</em>
*
* Returns: a localizable string name for an #AccessibleRole enumerated type.
**/
-char*
+char *
AccessibleRole_getName (AccessibleRole role)
{
- /*
- * TODO: replace with implementation linked to ATK, which
- * now supports Role/Name mapping
- */
-
- if (role < MAX_ROLES) return role_names [(int) role];
- else return "";
+ if (role < MAX_ROLES)
+ {
+ return g_strdup (role_names [(int) role]);
+ }
+ else
+ {
+ return g_strdup ("");
+ }
}
/**
* @obj: a pointer to the #Accessible object on which to operate.
*
* Increment the reference count for an #Accessible object.
- *
- * Returns: (no return code implemented yet).
- *
**/
-int
+void
Accessible_ref (Accessible *obj)
{
cspi_object_ref (obj);
- return 0;
}
/**
* @obj: a pointer to the #Accessible object on which to operate.
*
* Decrement the reference count for an #Accessible object.
- *
- * Returns: (no return code implemented yet).
- *
**/
-int
+void
Accessible_unref (Accessible *obj)
{
cspi_object_unref (obj);
- return 0;
}
/**
* Get the name of an #Accessible object.
*
* Returns: a UTF-8 string indicating the name of the #Accessible object.
- *
+ * or NULL on exception
**/
char *
Accessible_getName (Accessible *obj)
{
- char *retval =
- (char *)
+ char *retval;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+ retval = (char *)
Accessibility_Accessible__get_name (CSPI_OBJREF (obj), cspi_ev ());
- cspi_check_ev (cspi_ev (), "getName");
+
+ cspi_return_val_if_ev ("getName", NULL);
+
return retval;
}
* Get the description of an #Accessible object.
*
* Returns: a UTF-8 string describing the #Accessible object.
- *
+ * or NULL on exception
**/
char *
Accessible_getDescription (Accessible *obj)
{
- char *retval = (char *)
- Accessibility_Accessible__get_description (CSPI_OBJREF (obj), cspi_ev ());
- cspi_check_ev (cspi_ev (), "getDescription");
+ char *retval;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+ retval = (char *)
+ Accessibility_Accessible__get_description (CSPI_OBJREF (obj),
+ cspi_ev ());
+
+ cspi_return_val_if_ev ("getDescription", NULL);
+
return retval;
}
Accessible *
Accessible_getParent (Accessible *obj)
{
- Accessible *retval =
- cspi_object_add (Accessibility_Accessible__get_parent (CSPI_OBJREF (obj), cspi_ev ()));
- cspi_check_ev (cspi_ev (), "getParent");
+ Accessible *retval;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+ retval = cspi_object_add (
+ Accessibility_Accessible__get_parent (CSPI_OBJREF (obj),
+ cspi_ev ()));
+
+ cspi_return_val_if_ev ("getParent", NULL);
+
return retval;
}
* Get the number of children contained by an #Accessible object.
*
* Returns: a #long indicating the number of #Accessible children
- * contained by an #Accessible object.
+ * contained by an #Accessible object. or -1 on exception
*
**/
long
Accessible_getChildCount (Accessible *obj)
{
- long retval = (long) Accessibility_Accessible__get_childCount (CSPI_OBJREF (obj), cspi_ev ());
- cspi_check_ev (cspi_ev (), "getChildCount");
+ long retval;
+
+ cspi_return_val_if_fail (obj != NULL, -1);
+
+ retval = (long)
+ Accessibility_Accessible__get_childCount (CSPI_OBJREF (obj),
+ cspi_ev ());
+
+ cspi_return_val_if_ev ("getChildCount", -1);
+
return retval;
}
* Get the #Accessible child of an #Accessible object at a given index.
*
* Returns: a pointer to the #Accessible child object at index
- * @childIndex.
- *
+ * @childIndex. or NULL on exception
**/
Accessible *
Accessible_getChildAtIndex (Accessible *obj,
- long int childIndex)
+ long int childIndex)
{
- Accessible *retval = cspi_object_add (Accessibility_Accessible_getChildAtIndex (CSPI_OBJREF (obj), childIndex, cspi_ev ()));
- cspi_check_ev (cspi_ev (), "getChildAtIndex");
+ Accessible *retval;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+ retval = cspi_object_add (
+ Accessibility_Accessible_getChildAtIndex (CSPI_OBJREF (obj),
+ childIndex, cspi_ev ()));
+
return retval;
}
*
* Returns: a #long indicating the index of the #Accessible object
* in its parent (i.e. containing) #Accessible instance,
- * or -1 if @obj has no containing parent.
- *
+ * or -1 if @obj has no containing parent or on exception.
**/
long
Accessible_getIndexInParent (Accessible *obj)
{
- long retval = (long) Accessibility_Accessible_getIndexInParent (CSPI_OBJREF (obj), cspi_ev ());
- cspi_check_ev (cspi_ev (), "getIndexInParent");
+ long retval;
+
+ cspi_return_val_if_fail (obj != NULL, -1);
+
+ retval = (long)
+ Accessibility_Accessible_getIndexInParent (CSPI_OBJREF (obj), cspi_ev ());
+
+ cspi_return_val_if_ev ("getIndexInparent", -1);
return retval;
}
* Get the set of #AccessibleRelation objects which describe this #Accessible object's
* relationships with other #Accessible objects.
*
- * Returns: an array of #AccessibleRelation pointers.
- *
+ * Returns: an array of #AccessibleRelation pointers. or NULL on exception
**/
AccessibleRelation **
Accessible_getRelationSet (Accessible *obj)
{
- AccessibleRelation **relations;
- int n_relations;
int i;
- Accessibility_RelationSet *relation_set =
- Accessibility_Accessible_getRelationSet (CSPI_OBJREF (obj), cspi_ev ());
+ int n_relations;
+ AccessibleRelation **relations;
+ Accessibility_RelationSet *relation_set;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+ relation_set =
+ Accessibility_Accessible_getRelationSet (CSPI_OBJREF (obj), cspi_ev ());
+
+ cspi_return_val_if_ev ("getRelationSet", NULL);
/* this looks hack-ish, but it's based on the CORBA C bindings spec */
n_relations = relation_set->_length;
relations = malloc (sizeof (AccessibleRelation *) * n_relations);
- for (i=0; i<n_relations; ++i)
+ for (i = 0; i < n_relations; ++i)
{
- relations[i] = cspi_object_add (relation_set->_buffer[i]);
+ relations[i] = cspi_object_add (CORBA_Object_duplicate (
+ relation_set->_buffer[i], cspi_ev ()));
}
relations[i] = CORBA_OBJECT_NIL;
+ CORBA_free (relation_set);
+
return relations;
}
* @obj: a pointer to the #Accessible object on which to operate.
*
* Get the UI role of an #Accessible object.
+ * A UTF-8 string describing this role can be obtained via Accessible_getRoleName ().
*
- * Returns: a UTF-8 string indicating the UI role of the #Accessible object.
+ * Returns: the #AccessibleRole of the object.
*
**/
-char *
+AccessibleRole
Accessible_getRole (Accessible *obj)
{
- char *retval = AccessibleRole_getName (
- Accessibility_Accessible_getRole (CSPI_OBJREF (obj), cspi_ev ()));
- cspi_check_ev (cspi_ev (), "getRole");
+ AccessibleRole retval;
+
+ cspi_return_val_if_fail (obj != NULL, SPI_ROLE_INVALID);
+
+ retval =
+ Accessibility_Accessible_getRole (CSPI_OBJREF (obj), cspi_ev ());
+
+ cspi_return_val_if_ev ("getRole", SPI_ROLE_INVALID);
+
+ return cspi_role_from_spi_role (retval);
+}
+
+/**
+ * Accessible_getRoleName:
+ * @obj: a pointer to the #Accessible object on which to operate.
+ *
+ * Get a UTF-8 string describing the role this object plays in the UI.
+ * This method will return useful values for roles that fall outside the
+ * enumeration used in Accessible_getRole ().
+ *
+ * Returns: a UTF-8 string specifying the role of this #Accessible object.
+ *
+ **/
+char *
+Accessible_getRoleName (Accessible *obj)
+{
+ char *retval;
+
+ cspi_return_val_if_fail (obj != NULL, CORBA_string_dup ("invalid"));
+
+ retval =
+ Accessibility_Accessible_getRoleName (CSPI_OBJREF (obj), cspi_ev ());
+
+ cspi_return_val_if_ev ("getRoleName", CORBA_string_dup ("invalid"));
+
return retval;
}
/* Interface query methods */
-static SPIBoolean
-cspi_accessible_is_a (Accessible *obj,
- const char *interface_name)
-{
- SPIBoolean retval;
- Bonobo_Unknown unknown;
-
- unknown = Bonobo_Unknown_queryInterface (CSPI_OBJREF (obj),
- interface_name, cspi_ev ());
-
- if (BONOBO_EX (cspi_ev ()))
- {
- g_error ("Exception '%s' checking if is '%s'",
- bonobo_exception_get_text (cspi_ev ()),
- interface_name);
- }
-
- if (unknown != CORBA_OBJECT_NIL)
- {
- retval = TRUE;
- bonobo_object_release_unref (unknown, NULL);
- }
- else
- {
- retval= FALSE;
- }
-
- return retval;
-}
-
/**
* Accessible_isAction:
* @obj: a pointer to the #Accessible instance to query.
}
/**
+ * Accessible_isApplication:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleApplication.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleApplication interface,
+ * #FALSE otherwise.
+ **/
+SPIBoolean
+Accessible_isApplication (Accessible *obj)
+{
+ return cspi_accessible_is_a (obj,
+ "IDL:Accessibility/Application:1.0");
+}
+
+/**
* Accessible_isComponent:
* @obj: a pointer to the #Accessible instance to query.
*
}
/**
+ * Accessible_isStreamableContent:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements
+ * #AccessibleStreamableContent.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleStreamableContent interface,
+ * #FALSE otherwise.
+**/
+SPIBoolean
+Accessible_isStreamableContent (Accessible *obj)
+{
+ return cspi_accessible_is_a (obj,
+ "IDL:Accessibility/StreamableContent:1.0");
+}
+
+/**
* Accessible_isText:
* @obj: a pointer to the #Accessible instance to query.
*
}
/**
+ * Accessible_getApplication:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Get the #AccessibleApplication interface for an #Accessible.
+ *
+ * Returns: a pointer to an #AccessibleApplication interface instance, or
+ * NULL if @obj does not implement #AccessibleApplication.
+ **/
+AccessibleApplication *
+Accessible_getApplication (Accessible *obj)
+{
+ return (AccessibleApplication *) Accessible_queryInterface (
+ obj, "IDL:Accessibility/Application:1.0");
+}
+
+/**
* Accessible_getAction:
* @obj: a pointer to the #Accessible instance to query.
*
/**
+ * Accessible_getStreamableContent:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Get the #AccessibleStreamableContent interface for an #Accessible.
+ *
+ * Returns: a pointer to an #AccessibleStreamableContent interface instance, or
+ * NULL if @obj does not implement #AccessibleStreamableContent.
+ **/
+AccessibleStreamableContent *
+Accessible_getStreamableContent (Accessible *obj)
+{
+ return (AccessibleStreamableContent *) Accessible_queryInterface (
+ obj, "IDL:Accessibility/StreamableContent:1.0");
+}
+
+/**
* Accessible_getTable:
* @obj: a pointer to the #Accessible instance to query.
*
* by @obj, or NULL otherwise.
*
**/
-GenericInterface *
-Accessible_queryInterface (Accessible *obj, char *interface_name)
+AccessibleUnknown *
+Accessible_queryInterface (Accessible *obj,
+ const char *interface_name)
{
Bonobo_Unknown iface;
+
+ if (!obj)
+ {
+ return NULL;
+ }
iface = Accessibility_Accessible_queryInterface (CSPI_OBJREF (obj),
interface_name,
cspi_ev ());
+
+ cspi_return_val_if_ev ("queryInterface", NULL);
+
/*
* FIXME: we need to be fairly sure that references are going
* to mach up if we are going to expose QueryInterface, ie. we
*
* Increment the reference count for an #AccessibleRelation object.
*
- * Returns: (no return code implemented yet).
- *
**/
-int
+void
AccessibleRelation_ref (AccessibleRelation *obj)
{
cspi_object_ref (obj);
- return 0;
}
/**
*
* Decrement the reference count for an #AccessibleRelation object.
*
- * Returns: (no return code implemented yet).
- *
**/
-int
+void
AccessibleRelation_unref (AccessibleRelation *obj)
{
cspi_object_unref (obj);
- return 0;
}
/**
AccessibleRelationType
AccessibleRelation_getRelationType (AccessibleRelation *obj)
{
- return 0;
+ AccessibleRelationType retval;
+
+ cspi_return_val_if_fail (obj, SPI_RELATION_NULL);
+ retval =
+ Accessibility_Relation_getRelationType (CSPI_OBJREF (obj), cspi_ev());
+ cspi_return_val_if_ev ("getRelationType", SPI_RELATION_NULL);
+ return retval;
}
/**
int
AccessibleRelation_getNTargets (AccessibleRelation *obj)
{
- return 0;
+ int retval;
+
+ cspi_return_val_if_fail (obj, -1);
+ retval = (int)
+ Accessibility_Relation_getNTargets (CSPI_OBJREF (obj), cspi_ev());
+ cspi_return_val_if_ev ("getNTargets", -1);
+ return retval;
}
/**
Accessible *
AccessibleRelation_getTarget (AccessibleRelation *obj, int i)
{
- return NULL;
+ Accessible *retval;
+
+ cspi_return_val_if_fail (obj, NULL);
+
+ retval = cspi_object_add (
+ Accessibility_Relation_getTarget (CSPI_OBJREF(obj),
+ (CORBA_short) i, cspi_ev()));
+ cspi_return_val_if_ev ("getTarget", NULL);
+ return retval;
}
/**
*
* Increment the reference count for an #AccessibleStateSet object.
*
- * Returns: (no return code implemented yet).
- *
**/
-int
+void
AccessibleStateSet_ref (AccessibleStateSet *obj)
{
cspi_object_ref (obj);
- return 0;
}
/**
*
* Decrement the reference count for an #AccessibleStateSet object.
*
- * Returns: (no return code implemented yet).
- *
**/
-int
+void
AccessibleStateSet_unref (AccessibleStateSet *obj)
{
cspi_object_unref (obj);
- return 0;
}
-
/**
* AccessibleStateSet_contains:
* @obj: a pointer to the #AccessibleStateSet object on which to operate.
AccessibleStateSet_contains (AccessibleStateSet *obj,
AccessibleState state)
{
- CORBA_boolean retval = Accessibility_StateSet_contains (CSPI_OBJREF (obj), state, cspi_ev ());
- cspi_check_ev (cspi_ev (), "contains");
+ CORBA_boolean retval;
+
+ cspi_return_val_if_fail (obj != NULL, FALSE);
+
+ retval = Accessibility_StateSet_contains (CSPI_OBJREF (obj),
+ state, cspi_ev ());
+
+ cspi_return_val_if_ev ("contains", FALSE);
+
return (SPIBoolean) retval;
}
AccessibleStateSet_add (AccessibleStateSet *obj,
AccessibleState state)
{
+ cspi_return_if_fail (obj != NULL);
+
Accessibility_StateSet_add (CSPI_OBJREF (obj), state, cspi_ev ());
- cspi_check_ev (cspi_ev (), "contains");
+ cspi_check_ev ("add");
}
-
/**
* AccessibleStateSet_remove:
* @obj: a pointer to the #AccessibleStateSet object on which to operate.
AccessibleStateSet_remove (AccessibleStateSet *obj,
AccessibleState state)
{
+ cspi_return_if_fail (obj != NULL);
+
Accessibility_StateSet_remove (CSPI_OBJREF (obj), state, cspi_ev ());
- cspi_check_ev (cspi_ev (), "contains");
+ cspi_check_ev ("remove");
}
/**
AccessibleStateSet_equals (AccessibleStateSet *obj,
AccessibleStateSet *obj2)
{
- return Accessibility_StateSet_equals (CSPI_OBJREF (obj), CSPI_OBJREF (obj2), cspi_ev ());
+ if (obj == obj2)
+ {
+ return TRUE;
+ }
+
+ cspi_return_val_if_fail (obj != NULL, FALSE);
+ cspi_return_val_if_fail (obj2 != NULL, FALSE);
+
+ return Accessibility_StateSet_equals (CSPI_OBJREF (obj),
+ CSPI_OBJREF (obj2), cspi_ev ());
}
/**
* AccessibleStateSet_compare:
* @obj: a pointer to the first #AccessibleStateSet object on which to operate.
* @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
- * @differenceSet: a pointer to an array of #AccessibleStates, which is set when the
- * fuction returns to point to an array of states representing the states which
- * the two state sets do not have in common.
*
* Determine the differences between two instances of #AccessibleStateSet.
+ * Not Yet Implemented.
*.
* @see AccessibleStateSet_equals().
*
* the two sets but not the other.
*
**/
-void
+AccessibleStateSet *
AccessibleStateSet_compare (AccessibleStateSet *obj,
- AccessibleStateSet *obj2,
- AccessibleStateSet **differenceSet);
-
+ AccessibleStateSet *obj2)
+{
+ cspi_return_val_if_fail (obj != NULL, NULL);
+ cspi_return_val_if_fail (obj2 != NULL, NULL);
+ return NULL;
+}
/**
* AccessibleStateSet_isEmpty:
SPIBoolean
AccessibleStateSet_isEmpty (AccessibleStateSet *obj)
{
+ cspi_return_val_if_fail (obj != NULL, FALSE);
return TRUE;
/* return Accessibility_StateSet_isEmpty (CSPI_OBJREF (obj), cspi_ev ());*/
}
-
-