*
* Gets the name of an #AtspiAccessible object.
*
- * Returns: a UTF-8 string indicating the name of the #AtspiAccessible object
+ * Returns: a UTF-8 string indicating the name of the #AtspiAccessible object
* or NULL on exception.
**/
gchar *
}
/**
+ * atspi_accessible_get_path:
+ * @obj: a pointer to the #AtspiAccessible object on which to operate.
+ *
+ * Gets the path, uniquely identifying object.
+ *
+ * Returns: a UTF-8 string describing the #AtspiAccessible object
+ * or empty string on exception or NULL object passed.
+ **/
+gchar *
+atspi_accessible_get_path(AtspiAccessible *obj, GError **error)
+{
+ static const char *prefix = "/org/a11y/atspi/accessible/";
+ static int prefix_len = 27;
+
+ if (!obj)
+ return g_strdup("");
+ AtspiObject *o = ATSPI_OBJECT (obj);
+ if (!o)
+ return g_strdup("");
+ if (strncmp(o->path, prefix, prefix_len) == 0)
+ return g_strdup(o->path + prefix_len);
+ return g_strdup (o->path);
+}
+
+/**
* atspi_accessible_get_description:
* @obj: a pointer to the #AtspiAccessible object on which to operate.
*
* Gets the description of an #AtspiAccessible object.
*
- * Returns: a UTF-8 string describing the #AtspiAccessible object
+ * Returns: a UTF-8 string describing the #AtspiAccessible object
* or NULL on exception.
**/
gchar *
* atspi_accessible_get_index_in_parent:
* @obj: a pointer to the #AtspiAccessible object on which to operate.
*
- * Gets the index of an #AtspiAccessible object within its parent's
+ * Gets the index of an #AtspiAccessible object within its parent's
* #AtspiAccessible children list.
*
* Returns: a #glong indicating the index of the #AtspiAccessible object
* atspi_accessible_get_localized_role_name:
* @obj: a pointer to the #AtspiAccessible object on which to operate.
*
- * Gets a UTF-8 string corresponding to the name of the role played by an
+ * Gets a UTF-8 string corresponding to the name of the role played by an
* object, translated to the current locale.
* This method will return useful values for roles that fall outside the
* enumeration used in atspi_accessible_getRole ().
*
- * Returns: a localized, UTF-8 string specifying the type of UI role played
+ * Returns: a localized, UTF-8 string specifying the type of UI role played
* by an #AtspiAccessible object.
*
**/
dbus_message_unref (reply);
_atspi_accessible_add_cache (obj, ATSPI_CACHE_STATES);
}
-
return g_object_ref (obj->states);
}
* atspi_accessible_get_attributes:
* @obj: The #AtspiAccessible being queried.
*
- * Gets the #AttributeSet representing any assigned
+ * Gets the #AttributeSet representing any assigned
* name-value pair attributes or annotations for this object.
* For typographic, textual, or textually-semantic attributes, see
* atspi_text_get_attributes instead.
* atspi_accessible_get_attributes_as_array:
* @obj: The #AtspiAccessible being queried.
*
- * Gets a #GArray representing any assigned
+ * Gets a #GArray representing any assigned
* name-value pair attributes or annotations for this object.
* For typographic, textual, or textually-semantic attributes, see
* atspi_text_get_attributes_as_array instead.
* Gets the application id for a #AtspiAccessible object.
* Only works on application root objects.
*
- * Returns: a positive #gint indicating the id for the #AtspiAccessible object
+ * Returns: a positive #gint indicating the id for the #AtspiAccessible object
* or -1 on exception.
**/
gint
* atspi_accessible_is_action:
* @obj: a pointer to the #AtspiAccessible instance to query.
*
- * Query whether the specified #AtspiAccessible implements the
+ * Query whether the specified #AtspiAccessible implements the
* #AtspiAction interface.
*
* Returns: #TRUE if @obj implements the #AtspiAction interface,
atspi_interface_application);
}
-/**
+/**
* atspi_accessible_is_collection:
* @obj: a pointer to the #AtspiAccessible instance to query.
*
return _atspi_accessible_is_a (obj,
atspi_interface_editable_text);
}
-
+
/**
* atspi_accessible_is_hypertext:
* @obj: a pointer to the #AtspiAccessible instance to query.
* atspi_accessible_is_hyperlink:
* @obj: a pointer to the #AtspiAccessible instance to query.
*
- * Query whether the specified #AtspiAccessible implements the
+ * Query whether the specified #AtspiAccessible implements the
* #AtspiHyperlink interface.
*
* Returns: #TRUE if @obj implements the #AtspiHypertext interface,
* atspi_accessible_is_text:
* @obj: a pointer to the #AtspiAccessible instance to query.
*
- * Query whether the specified #AtspiAccessible implements the
+ * Query whether the specified #AtspiAccessible implements the
* #AtspiText interface.
*
* Returns: #TRUE if @obj implements the #AtspiText interface,
atspi_accessible_get_action (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_action) ?
- g_object_ref (ATSPI_ACTION (accessible)) : NULL);
+ g_object_ref (ATSPI_ACTION (accessible)) : NULL);
}
/**
atspi_accessible_get_action_iface (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_action) ?
- g_object_ref (ATSPI_ACTION (accessible)) : NULL);
+ g_object_ref (ATSPI_ACTION (accessible)) : NULL);
}
/**
atspi_accessible_get_collection (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_collection) ?
- g_object_ref (ATSPI_COLLECTION (accessible)) : NULL);
+ g_object_ref (ATSPI_COLLECTION (accessible)) : NULL);
}
/**
atspi_accessible_get_collection_iface (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_collection) ?
- g_object_ref (ATSPI_COLLECTION (accessible)) : NULL);
+ g_object_ref (ATSPI_COLLECTION (accessible)) : NULL);
}
/**
atspi_accessible_get_document (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_document) ?
- g_object_ref (ATSPI_DOCUMENT (accessible)) : NULL);
+ g_object_ref (ATSPI_DOCUMENT (accessible)) : NULL);
}
/**
atspi_accessible_get_document_iface (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_document) ?
- g_object_ref (ATSPI_DOCUMENT (accessible)) : NULL);
+ g_object_ref (ATSPI_DOCUMENT (accessible)) : NULL);
}
/**
atspi_accessible_get_editable_text (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_editable_text) ?
- g_object_ref (ATSPI_EDITABLE_TEXT (accessible)) : NULL);
+ g_object_ref (ATSPI_EDITABLE_TEXT (accessible)) : NULL);
}
/**
atspi_accessible_get_editable_text_iface (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_editable_text) ?
- g_object_ref (ATSPI_EDITABLE_TEXT (accessible)) : NULL);
+ g_object_ref (ATSPI_EDITABLE_TEXT (accessible)) : NULL);
}
/**
atspi_accessible_get_hypertext (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_hypertext) ?
- g_object_ref (ATSPI_HYPERTEXT (accessible)) : NULL);
+ g_object_ref (ATSPI_HYPERTEXT (accessible)) : NULL);
}
/**
atspi_accessible_get_hypertext_iface (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_hypertext) ?
- g_object_ref (ATSPI_HYPERTEXT (accessible)) : NULL);
+ g_object_ref (ATSPI_HYPERTEXT (accessible)) : NULL);
}
/**
atspi_accessible_get_image (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_image) ?
- g_object_ref (ATSPI_IMAGE (accessible)) : NULL);
+ g_object_ref (ATSPI_IMAGE (accessible)) : NULL);
}
/**
atspi_accessible_get_image_iface (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_image) ?
- g_object_ref (ATSPI_IMAGE (accessible)) : NULL);
+ g_object_ref (ATSPI_IMAGE (accessible)) : NULL);
}
/**
atspi_accessible_get_selection (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_selection) ?
- g_object_ref (ATSPI_SELECTION (accessible)) : NULL);
+ g_object_ref (ATSPI_SELECTION (accessible)) : NULL);
}
/**
atspi_accessible_get_selection_iface (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_selection) ?
- g_object_ref (ATSPI_SELECTION (accessible)) : NULL);
+ g_object_ref (ATSPI_SELECTION (accessible)) : NULL);
}
#if 0
atspi_accessible_get_streamable_content (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_streamable_content) ?
- accessible : NULL);
+ accessible : NULL);
}
#endif
atspi_accessible_get_table (AtspiAccessible *obj)
{
return (_atspi_accessible_is_a (obj, atspi_interface_table) ?
- g_object_ref (ATSPI_TABLE (obj)) : NULL);
+ g_object_ref (ATSPI_TABLE (obj)) : NULL);
}
/**
atspi_accessible_get_table_iface (AtspiAccessible *obj)
{
return (_atspi_accessible_is_a (obj, atspi_interface_table) ?
- g_object_ref (ATSPI_TABLE (obj)) : NULL);
+ g_object_ref (ATSPI_TABLE (obj)) : NULL);
}
/**
atspi_accessible_get_table_cell (AtspiAccessible *obj)
{
return (_atspi_accessible_is_a (obj, atspi_interface_table_cell) ?
- g_object_ref (ATSPI_TABLE_CELL (obj)) : NULL);
+ g_object_ref (ATSPI_TABLE_CELL (obj)) : NULL);
}
/**
atspi_accessible_get_value (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_value) ?
- g_object_ref (ATSPI_VALUE (accessible)) : NULL);
+ g_object_ref (ATSPI_VALUE (accessible)) : NULL);
}
/**
atspi_accessible_get_value_iface (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_value) ?
- g_object_ref (ATSPI_VALUE (accessible)) : NULL);
+ g_object_ref (ATSPI_VALUE (accessible)) : NULL);
}
static void
return ret;
}
-AtspiAccessible *
+AtspiAccessible *
_atspi_accessible_new (AtspiApplication *app, const gchar *path)
{
AtspiAccessible *accessible;
-
+
accessible = g_object_new (ATSPI_TYPE_ACCESSIBLE, NULL);
g_return_val_if_fail (accessible != NULL, NULL);
return result;
}
-static AtspiAccessible *_get_object_in_relation(AtspiAccessible *source, AtspiRelationType search_type)
+static char *_get_object_in_relation(AtspiAccessible *source, AtspiRelationType search_type)
{
if (source == NULL)
- return NULL;
+ return "";
GArray *relations = atspi_accessible_get_relation_set(source, NULL);
if (relations == NULL)
- return NULL;
+ return "";
AtspiAccessible *ret = NULL;
for (int i = 0; i < relations->len; ++i) {
g_array_free(relations, TRUE);
- return ret;
+ return ret ? atspi_accessible_get_path(ret, NULL) : g_strdup("");
}
static char *_get_info(AtspiAccessible *node, int length_limit)
char *node_name = atspi_accessible_get_name(node, NULL);
char *node_role_name = atspi_accessible_get_role_name(node, NULL);
+ char *path = atspi_accessible_get_path(node, NULL);
char *attributes = _get_attributes(node, length_limit);
Box_Size *box_size = _get_box_size(node);
char *states = _get_states(node, length_limit);
char result[SAFE_BUFFER_SIZE];
- int ret = snprintf(result, SAFE_BUFFER_SIZE, "[[%p],[%s],[%s],[%s,%s,%s,%s],[%s],[%s],[%p,%p]]",
- node,
+ int ret = snprintf(result, SAFE_BUFFER_SIZE, "[[%s],[%s],[%s],[%s,%s,%s,%s],[%s],[%s],[%s,%s]]",
+ path,
node_role_name,
attributes,
box_size->x,
else
snprintf(parent_status, NUMBER_WIDTH, "%d", parent_index);
- snprintf(output, CHECK_OUTPUT_WIDTH, "[FAIL<%d,%s><%p,%p>]", parent_candidate_index, parent_status, parent_candidate, parent);
+ snprintf(output, CHECK_OUTPUT_WIDTH, "[FAIL<%d,%s><%s,%s>]", parent_candidate_index, parent_status,
+ atspi_accessible_get_path(parent_candidate, NULL),
+ atspi_accessible_get_path(parent, NULL));
} else {
snprintf(output, CHECK_OUTPUT_WIDTH, "[OK]");