Add two new relations ATK_RELATION_NODE_CHILDREN and
authorPadraig O'Briain <padraigo@src.gnome.org>
Wed, 31 Oct 2001 15:35:58 +0000 (15:35 +0000)
committerPadraig O'Briain <padraigo@src.gnome.org>
Wed, 31 Oct 2001 15:35:58 +0000 (15:35 +0000)
* atk/relation.h, docs/tmpl/atkrelation.sgml:
Add two new relations ATK_RELATION_NODE_CHILDREN and
ATK_RELATION_NODE_PARENT to support compound objects in a
node or cell of a tree or table
Added descriptions of all relations which are defined

* atk/atktable.c:
Remove functions atk_table_real_get_index_at(),
atk_table_real_get_column_at_index() and
atk_table_real_get_row_at_index()
Correct typos in documentation of other functions.

ChangeLog
atk/atkrelation.h
atk/atktable.c
docs/tmpl/atkrelation.sgml

index 6361fdb..20d4310 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2001-10-31  Padraig O'Briain  <padraig.obriain@sun.com>
+
+       * atk/relation.h, docs/tmpl/atkrelation.sgml:
+       Add two new relations ATK_RELATION_NODE_CHILDREN and
+       ATK_RELATION_NODE_PARENT to support compound objects in a
+        node or cell of a tree or table
+       Added descriptions of all relations which are defined
+
+       * atk/atktable.c:
+       Remove functions atk_table_real_get_index_at(),
+       atk_table_real_get_column_at_index() and 
+       atk_table_real_get_row_at_index() 
+       Correct typos in documentation of other functions.
+
 2001-10-28  Tor Lillqvist  <tml@iki.fi>
 
        * atk-zip.sh.in: New file, used to build developer package for
index eb4cebe..b4f3c69 100755 (executable)
@@ -25,17 +25,26 @@ extern "C" {
 #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
 {
@@ -45,6 +54,8 @@ 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;
 
index 06226bf..ea94111 100755 (executable)
@@ -39,14 +39,6 @@ typedef struct _AtkTableIfaceClass AtkTableIfaceClass;
 
 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
@@ -168,11 +160,11 @@ atk_table_ref_at (AtkTable *table,
  * @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,
@@ -181,16 +173,16 @@ 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;
 }
 
 /**
@@ -198,11 +190,10 @@ atk_table_get_index_at (AtkTable *table,
  * @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,
@@ -210,14 +201,14 @@ 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;
 }
 
 /**
@@ -225,11 +216,10 @@ atk_table_get_row_at_index (AtkTable *table,
  * @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,
@@ -244,7 +234,7 @@ 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;
 }
 
 /**
@@ -875,47 +865,3 @@ atk_table_set_summary (AtkTable       *table,
   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);
-}
index a357252..8d32646 100644 (file)
@@ -25,6 +25,8 @@ Defines the functional relationship between two #AtkObjects.
 @ATK_RELATION_LABEL_FOR: 
 @ATK_RELATION_LABELLED_BY: 
 @ATK_RELATION_MEMBER_OF: 
+@ATK_RELATION_NODE_CHILDREN: 
+@ATK_RELATION_NODE_PARENT: 
 @ATK_RELATION_LAST_DEFINED: 
 
 <!-- ##### FUNCTION atk_relation_type_register ##### -->