#endif /* __cplusplus */
#include <glib-object.h>
+
+/*
+ * An AtkRelation describes a relation between the object and one or more
+ * other objects. The actual relations that an object has with other objects
+ * are defined as an AtkRelationSet, which is a set of AtkRelations.
+ */
+
/**
*AtkRelationType:
*@ATK_RELATION_NULL:
- *@ATK_RELATION_CONTROLLED_BY:
- *@ATK_RELATION_CONTROLLER_FOR:
- *@ATK_RELATION_LABEL_FOR:
- *@ATK_RELATION_LABELLED_BY:
- *@ATK_RELATION_MEMBER_OF:
+ *@ATK_RELATION_CONTROLLED_BY: Indicates an object controlled by one or more target objects.
+ *@ATK_RELATION_CONTROLLER_FOR: Indicates an object is an controller for one or more target objects.
+ *@ATK_RELATION_LABEL_FOR: Indicates an object is a label for one or more target objects.
+ *@ATK_RELATION_LABELLED_BY: Indicates an object is labelled by one or more target objects.
+ *@ATK_RELATION_MEMBER_OF: Indicates an object is a member of a group of one or more target objects.
+ *@ATK_RELATION_NODE_CHILDREN: Indicates an object is a node in a tree or table and a compound object which more than one subobject
+ *@ATK_RELATION_NODE_PARENT: Indicates an object is a subobject of a compound object which is a node in a tree or table.
*@ATK_RELATION_LAST_DEFINED:
*
- *The possible types of an #AtkRelation
+ *Describes the type of the relation
**/
typedef enum
{
ATK_RELATION_LABEL_FOR,
ATK_RELATION_LABELLED_BY,
ATK_RELATION_MEMBER_OF,
+ ATK_RELATION_NODE_CHILDREN,
+ ATK_RELATION_NODE_PARENT,
ATK_RELATION_LAST_DEFINED
} AtkRelationType;
static void atk_table_base_init (gpointer *g_class);
-static gint atk_table_real_get_index_at (AtkTable *table,
- gint row,
- gint column);
-static gint atk_table_real_get_column_at_index (AtkTable *table,
- gint index);
-static gint atk_table_real_get_row_at_index (AtkTable *table,
- gint index);
-
static guint atk_table_signals[LAST_SIGNAL] = { 0 };
GType
* @row: a #gint representing a row in @table
* @column: a #gint representing a column in @table
*
- * Gets a #gint representing the index at the specified @row and @column,
- * or 0 if value does not implement this interface.
+ * Gets a #gint representing the index at the specified @row and @column.
+ * The value -1 is returned if the object at row,column is not a child
+ * of table or table does not implement this interface.
*
- * Returns: a #gint representing the index at specified position, or 0
- * if value does not implement this interface.
+ * Returns: a #gint representing the index at specified position
**/
gint
atk_table_get_index_at (AtkTable *table,
{
AtkTableIface *iface;
- g_return_val_if_fail (ATK_IS_TABLE (table), 0);
- g_return_val_if_fail (row >= 0, 0);
- g_return_val_if_fail (column >= 0, 0);
+ g_return_val_if_fail (ATK_IS_TABLE (table), -1);
+ g_return_val_if_fail (row >= 0, -1);
+ g_return_val_if_fail (column >= 0, -1);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_index_at)
return (iface->get_index_at) (table, row, column);
else
- return atk_table_real_get_index_at (table, row, column);
+ return -1;
}
/**
* @table: a GObject instance that implements AtkTableInterface
* @index: a #gint representing an index in @table
*
- * Gets a #gint representing the row at the specified @index, or 0
- * if the value does not implement this interface
+ * Gets a #gint representing the row at the specified @index, or -1
+ * if the table does not implement this interface
*
- * Returns: a gint representing the row at the specified index, or 0
- * if value does not implement this interface.
+ * Returns: a gint representing the row at the specified index.
**/
gint
atk_table_get_row_at_index (AtkTable *table,
{
AtkTableIface *iface;
- g_return_val_if_fail (ATK_IS_TABLE (table), 0);
+ g_return_val_if_fail (ATK_IS_TABLE (table), -1);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_row_at_index)
return (iface->get_row_at_index) (table, index);
else
- return atk_table_real_get_row_at_index (table, index);
+ return -1;
}
/**
* @table: a GObject instance that implements AtkTableInterface
* @index: a #gint representing an index in @table
*
- * Gets a #gint representing the column at the specified @index, or 0
- * if the value does not implement this interface
+ * Gets a #gint representing the column at the specified @index, or -1
+ * if the table does not implement this interface
*
- * Returns: a gint representing the column at the specified index, or 0
- * if value does not implement this interface.
+ * Returns: a gint representing the column at the specified index.
**/
gint
atk_table_get_column_at_index (AtkTable *table,
if (iface->get_column_at_index)
return (iface->get_column_at_index) (table, index);
else
- return atk_table_real_get_column_at_index (table, index);
+ return -1;
}
/**
if (iface->set_summary)
(iface->set_summary) (table, accessible);
}
-
-static gint
-atk_table_real_get_index_at (AtkTable *table,
- gint row,
- gint column)
-{
- gint n_cols, n_rows;
-
- n_cols = atk_table_get_n_columns (table);
- n_rows = atk_table_get_n_rows (table);
-
- g_return_val_if_fail (row < n_rows, 0);
- g_return_val_if_fail (column < n_cols, 0);
-
- return row * n_cols + column;
-}
-
-static gint
-atk_table_real_get_column_at_index (AtkTable *table,
- gint index)
-{
- gint n_cols;
-
- n_cols = atk_table_get_n_columns (table);
-
- if (n_cols == 0)
- return 0;
- else
- return (gint) (index % n_cols);
-}
-
-static gint
-atk_table_real_get_row_at_index (AtkTable *table,
- gint index)
-{
- gint n_cols;
-
- n_cols = atk_table_get_n_columns (table);
-
- if (n_cols == 0)
- return 0;
- else
- return (gint) (index / n_cols);
-}