+#define MAX_ROLES 100
+
+static char *role_names [MAX_ROLES] =
+{
+ " ",
+ "accelerator label",
+ "alert",
+ "animation",
+ "arrow",
+ "calendar",
+ "canvas",
+ "check box",
+ "menu item",
+ "color chooser",
+ "column header",
+ "combo box",
+ "date editor",
+ "desktop icon",
+ "desktop frame",
+ "dial",
+ "dialog",
+ "directory pane",
+ "drawing area",
+ "file chooser",
+ "filler",
+ "font chooser",
+ "frame",
+ "glass pane",
+ "HTML container",
+ "icon",
+ "image",
+ "internal frame",
+ "label",
+ "layered pane",
+ "list",
+ "list item",
+ "menu",
+ "menubar",
+ "menu item",
+ "option pane",
+ "page tab",
+ "page tab list",
+ "panel",
+ "password text",
+ "popup menu",
+ "progress bar",
+ "pushbutton",
+ "radiobutton",
+ "radio menu item",
+ "root pane",
+ "row header",
+ "scrollbar",
+ "scrollpane",
+ "separator",
+ "slider",
+ "split pane",
+ "spin button",
+ "status bar",
+ "table",
+ "table cell",
+ "table column header",
+ "table row header",
+ "tearoff menu item",
+ "text",
+ "toggle button",
+ "toolbar",
+ "tooltip",
+ "tree",
+ " ",
+ "viewport",
+ "window",
+};
/*
- *
- * Accessible function prototypes
- *
+ * Returns a localizable string name for an AtkRole enumerated type.
*/
+char*
+Accessible_Role_getName (Accessibility_Role role)
+{
+ if (role < MAX_ROLES) return role_names [(int) role];
+ else return "";
+}
+
+
/**
* Accessible_ref:
Accessible_ref (Accessible *obj)
{
Accessibility_Accessible_ref (*obj, &ev);
+ spi_check_ev (&ev, "ref");
return 0;
}
Accessible_unref (Accessible *obj)
{
Accessibility_Accessible_unref (*obj, &ev);
+ spi_check_ev (&ev, "unref");
return 0;
}
char *
Accessible_getName (Accessible *obj)
{
- return Accessibility_Accessible__get_name (*obj, &ev);
+ char *retval =
+ (char *)
+ Accessibility_Accessible__get_name (*obj, &ev);
+ spi_check_ev (&ev, "getName");
+ return retval;
}
/**
char *
Accessible_getDescription (Accessible *obj)
{
- return Accessibility_Accessible__get_description (*obj, &ev);
+ char *retval = (char *)
+ Accessibility_Accessible__get_description (*obj, &ev);
+ spi_check_ev (&ev, "getDescription");
+ return retval;
}
/**
*
* Get an #Accessible object's parent container.
*
- * Returns: a pointer to the #Accessible object which contains the given
+ * Returns: a pointer tothe #Accessible object which contains the given
* #Accessible instance, or NULL if the @obj has no parent container.
*
**/
Accessible *
Accessible_getParent (Accessible *obj)
{
- return Obj_Add (Accessibility_Accessible__get_parent (*obj, &ev));
+ Accessible *retval =
+ Obj_Add (Accessibility_Accessible__get_parent (*obj, &ev));
+ spi_check_ev (&ev, "getParent");
+ return retval;
}
/**
long
Accessible_getChildCount (Accessible *obj)
{
- return Accessibility_Accessible__get_childCount (*obj, &ev);
+ long retval = (long) Accessibility_Accessible__get_childCount (*obj, &ev);
+ spi_check_ev (&ev, "getChildCount");
+ return retval;
}
/**
Accessible_getChildAtIndex (Accessible *obj,
long childIndex)
{
- return Obj_Add (Accessibility_Accessible_getChildAtIndex (*obj, childIndex, &ev));
+ Accessible *retval = Obj_Add (Accessibility_Accessible_getChildAtIndex (*obj, childIndex, &ev));
+ spi_check_ev (&ev, "getChildAtIndex");
+ return retval;
}
/**
long
Accessible_getIndexInParent (Accessible *obj)
{
- return Accessibility_Accessible_getIndexInParent (*obj, &ev);
+ long retval = (long) Accessibility_Accessible_getIndexInParent (*obj, &ev);
+ spi_check_ev (&ev, "getIndexInParent");
+ return retval;
}
/**
char *
Accessible_getRole (Accessible *obj)
{
- return "";
+ char *retval = Accessible_Role_getName (
+ Accessibility_Accessible_getRole (*obj, &ev));
+ spi_check_ev (&ev, "getRole");
+ return retval;
}
/**
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Action:1.0",
&ev);
- return (iface != NULL) ? TRUE : FALSE;
+ spi_warn_ev (&ev, "isAction");
+
+ return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
}
/**
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Component:1.0",
&ev);
- return (iface != NULL) ? TRUE : FALSE;
+ spi_warn_ev (&ev, "isComponent");
+
+ return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
}
/**
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/EditableText:1.0",
&ev);
- return (iface != NULL) ? TRUE : FALSE;
+ spi_check_ev (&ev, "isEditableText");
+
+ return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
}
/**
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Hypertext:1.0",
&ev);
- return (iface != NULL) ? TRUE : FALSE;
+
+ spi_check_ev (&ev, "isHypertext");
+
+ return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
}
/**
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Image:1.0",
&ev);
- return (iface != NULL) ? TRUE : FALSE;
+ spi_check_ev (&ev, "isImage");
+
+ return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
}
/**
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Selection:1.0",
&ev);
- return (iface != NULL) ? TRUE : FALSE;
+ spi_warn_ev (&ev, "isSelection");
+
+ return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
+
}
/**
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Table:1.0",
&ev);
- return (iface != NULL) ? TRUE : FALSE;
+ spi_check_ev (&ev, "isTable");
+
+ return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
+
}
/**
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Text:1.0",
&ev);
- return (iface != NULL) ? TRUE : FALSE;
+ spi_warn_ev (&ev, "isText");
+
+ return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
+}
+
+/**
+ * Accessible_isValue:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleValue.
+ * Not Yet Implemented.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleValue interface,
+ * #FALSE otherwise.
+**/
+boolean
+Accessible_isValue (Accessible *obj)
+{
+ Bonobo_Unknown iface =
+ Accessibility_Accessible_queryInterface (*obj,
+ "IDL:Accessibility/Value:1.0",
+ &ev);
+ spi_check_ev (&ev, "isValue");
+
+ return (CORBA_Object_is_nil (iface, &ev)) ? FALSE : TRUE;
}
/**
AccessibleAction *
Accessible_getAction (Accessible *obj)
{
- AccessibleComponent iface =
+ Bonobo_Unknown iface =
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Action:1.0",
&ev);
- return Obj_Add (iface);
+ spi_check_ev (&ev, "getAction");
+
+ return (AccessibleAction *)
+ ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
}
/**
AccessibleComponent *
Accessible_getComponent (Accessible *obj)
{
- AccessibleComponent iface =
+ Bonobo_Unknown iface =
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Component:1.0",
&ev);
- return Obj_Add (iface);
+ spi_check_ev (&ev, "getComponent");
+
+ return (AccessibleComponent *) ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
}
AccessibleEditableText *
Accessible_getEditableText (Accessible *obj)
{
- AccessibleComponent iface =
+ Bonobo_Unknown iface =
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/EditableText:1.0",
&ev);
- return Obj_Add (iface);
+ spi_check_ev (&ev, "getEditableText");
+
+ return (AccessibleEditableText *)
+ ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
}
AccessibleHypertext *
Accessible_getHypertext (Accessible *obj)
{
- AccessibleComponent iface =
+ Bonobo_Unknown iface =
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Hypertext:1.0",
&ev);
- return Obj_Add (iface);
+ spi_check_ev (&ev, "getHypertext");
+
+ return (AccessibleHypertext *)
+ ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
}
AccessibleImage *
Accessible_getImage (Accessible *obj)
{
- AccessibleComponent iface =
+ Bonobo_Unknown iface =
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Image:1.0",
&ev);
- return Obj_Add (iface);
+ spi_check_ev (&ev, "getImage");
+
+ return (AccessibleImage *)
+ ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
}
AccessibleSelection *
Accessible_getSelection (Accessible *obj)
{
- AccessibleComponent iface =
+ Bonobo_Unknown iface =
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Selection:1.0",
&ev);
- return Obj_Add (iface);
+ spi_warn_ev (&ev, "getSelection");
+
+ return (AccessibleSelection *)
+ ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
}
AccessibleTable *
Accessible_getTable (Accessible *obj)
{
- AccessibleComponent iface =
+ Bonobo_Unknown iface =
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Table:1.0",
&ev);
- return Obj_Add (iface);
-}
-
+ spi_check_ev (&ev, "getTable");
+ return (AccessibleTable *)
+ ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
+}
AccessibleText *
Accessible_getText (Accessible *obj)
{
- AccessibleComponent iface =
+ Bonobo_Unknown iface =
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Text:1.0",
&ev);
- return Obj_Add (iface);
+
+ spi_check_ev (&ev, "getText");
+
+ return (AccessibleText *)
+ ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
}
AccessibleValue *
Accessible_getValue (Accessible *obj)
{
- AccessibleComponent iface =
+ Bonobo_Unknown iface =
Accessibility_Accessible_queryInterface (*obj,
"IDL:Accessibility/Value:1.0",
&ev);
- return Obj_Add (iface);
+ return (AccessibleValue *)
+ ((CORBA_Object_is_nil (iface, &ev)) ? 0 : Obj_Add (iface));
}