Do not dist gir_DATA
[platform/upstream/atk.git] / atk / atktable.c
index 06a435a..5cecaf6 100755 (executable)
  */
 
 #include "atktable.h"
+#include "atkmarshal.h"
+
+enum {
+  ROW_INSERTED,
+  ROW_DELETED,
+  COLUMN_INSERTED,
+  COLUMN_DELETED,
+  ROW_REORDERED,
+  COLUMN_REORDERED,
+  MODEL_CHANGED,
+  LAST_SIGNAL
+};
+
+static void  atk_table_base_init (gpointer *g_class);
+
+static guint atk_table_signals[LAST_SIGNAL] = { 0 };
 
 GType
-atk_table_get_type ()
+atk_table_get_type (void)
 {
   static GType type = 0;
-
+  
   if (!type) {
     GTypeInfo tinfo =
     {
       sizeof (AtkTableIface),
-      NULL,
-      NULL,
-
+      (GBaseInitFunc) atk_table_base_init,
+      (GBaseFinalizeFunc) NULL,
+      
     };
-
+    
     type = g_type_register_static (G_TYPE_INTERFACE, "AtkTable", &tinfo, 0);
   }
-
+  
   return type;
 }
 
+
+static void
+atk_table_base_init (gpointer *g_class)
+{
+  static gboolean initialized = FALSE;
+  
+  if (!initialized)
+    {
+      atk_table_signals[ROW_INSERTED] =
+       g_signal_new ("row_inserted",
+                     ATK_TYPE_TABLE,
+                     G_SIGNAL_RUN_LAST,
+                     G_STRUCT_OFFSET (AtkTableIface, row_inserted),
+                     (GSignalAccumulator) NULL, NULL,
+                     atk_marshal_VOID__INT_INT,
+                     G_TYPE_NONE,
+                     2, G_TYPE_INT, G_TYPE_INT);
+      atk_table_signals[COLUMN_INSERTED] =
+       g_signal_new ("column_inserted",
+                     ATK_TYPE_TABLE,
+                     G_SIGNAL_RUN_LAST,
+                     G_STRUCT_OFFSET (AtkTableIface, column_inserted),
+                     (GSignalAccumulator) NULL, NULL,
+                     atk_marshal_VOID__INT_INT,
+                     G_TYPE_NONE,
+                     2, G_TYPE_INT, G_TYPE_INT);
+      atk_table_signals[ROW_DELETED] =
+       g_signal_new ("row_deleted",
+                     ATK_TYPE_TABLE,
+                     G_SIGNAL_RUN_LAST,
+                     G_STRUCT_OFFSET (AtkTableIface, row_deleted),
+                     (GSignalAccumulator) NULL, NULL,
+                     atk_marshal_VOID__INT_INT,
+                     G_TYPE_NONE,
+                     2, G_TYPE_INT, G_TYPE_INT);
+      atk_table_signals[COLUMN_DELETED] =
+       g_signal_new ("column_deleted",
+                     ATK_TYPE_TABLE,
+                     G_SIGNAL_RUN_LAST,
+                     G_STRUCT_OFFSET (AtkTableIface, column_deleted),
+                     (GSignalAccumulator) NULL, NULL,
+                     atk_marshal_VOID__INT_INT,
+                     G_TYPE_NONE,
+                     2, G_TYPE_INT, G_TYPE_INT);
+      atk_table_signals[ROW_REORDERED] =
+       g_signal_new ("row_reordered",
+                     ATK_TYPE_TABLE,
+                     G_SIGNAL_RUN_LAST,
+                     G_STRUCT_OFFSET (AtkTableIface, row_reordered),
+                     (GSignalAccumulator) NULL, NULL,
+                     g_cclosure_marshal_VOID__VOID,
+                     G_TYPE_NONE,
+                     0);
+      atk_table_signals[COLUMN_REORDERED] =
+       g_signal_new ("column_reordered",
+                     ATK_TYPE_TABLE,
+                     G_SIGNAL_RUN_LAST,
+                     G_STRUCT_OFFSET (AtkTableIface, column_reordered),
+                     (GSignalAccumulator) NULL, NULL,
+                     g_cclosure_marshal_VOID__VOID,
+                     G_TYPE_NONE,
+                     0);
+      atk_table_signals[MODEL_CHANGED] =
+        g_signal_new ("model_changed",
+                      ATK_TYPE_TABLE,
+                      G_SIGNAL_RUN_LAST,
+                      G_STRUCT_OFFSET (AtkTableIface, model_changed),
+                      (GSignalAccumulator) NULL, NULL,
+                      g_cclosure_marshal_VOID__VOID,
+                      G_TYPE_NONE, 0);
+
+      initialized = TRUE;
+    }
+}
+
 /**
  * atk_table_ref_at:
- * @obj: a GObject instance that implements AtkTableIface
- * return values: a AtkObject* representing the referred to accessible
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
+ * @column: a #gint representing a column in @table
  *
- * Get a reference to the table cell at #row, #column
+ * Get a reference to the table cell at @row, @column.
  *
+ * Returns: a AtkObject* representing the referred to accessible
  **/
 AtkObject*
-atk_table_ref_at (AtkTable *obj,
+atk_table_ref_at (AtkTable *table,
                   gint     row,
                   gint     column)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, NULL);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
+  g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
+  g_return_val_if_fail (row >= 0, NULL);
+  g_return_val_if_fail (column >= 0, NULL);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->ref_at)
-    return (iface->ref_at) (obj, row, column);
+    return (iface->ref_at) (table, row, column);
   else
     return NULL;
 }
 
 /**
  * atk_table_get_index_at:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a gint representing the index at specified position, or 0
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
+ * @column: a #gint representing a column in @table
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Gets a #gint representing the index at the specified @row and @column.
+ *
+ * Returns: a #gint representing the index at specified position.
+ * The value -1 is returned if the object at row,column is not a child
+ * of table or table does not implement this interface.
  **/
 gint
-atk_table_get_index_at (AtkTable *obj,
+atk_table_get_index_at (AtkTable *table,
                         gint     row,
                         gint     column)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, 0);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), 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 (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_index_at)
-    return (iface->get_index_at) (obj, row, column);
+    return (iface->get_index_at) (table, row, column);
   else
-    return 0;
+    return -1;
 }
 
 /**
  * atk_table_get_row_at_index:
- * @value: a GObject instance that implements AtkTableInterface
- * @return: a gint representing the row at the specified  index, or 0
- * if value does not implement this interface.
+ * @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_.
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Returns: a gint representing the row at the specified index,
+ * or -1 if the table does not implement this interface
  **/
 gint
-atk_table_get_row_at_index (AtkTable *obj,
+atk_table_get_row_at_index (AtkTable *table,
                             gint     index)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, 0);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
+  g_return_val_if_fail (ATK_IS_TABLE (table), -1);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_row_at_index)
-    return (iface->get_row_at_index) (obj, index);
+    return (iface->get_row_at_index) (table, index);
   else
-    return 0;
+    return -1;
 }
 
 /**
  * atk_table_get_column_at_index:
- * @value: a GObject instance that implements AtkTableInterface
- * @return: a gint representing the column at the specified  index, or 0
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableInterface
+ * @index_: a #gint representing an index in @table
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Gets a #gint representing the column at the specified @index_. 
+ *
+ * Returns: a gint representing the column at the specified index,
+ * or -1 if the table does not implement this interface
  **/
 gint
-atk_table_get_column_at_index (AtkTable *obj,
+atk_table_get_column_at_index (AtkTable *table,
                                gint     index)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, 0);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
+  g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_column_at_index)
-    return (iface->get_column_at_index) (obj, index);
+    return (iface->get_column_at_index) (table, index);
   else
-    return 0;
+    return -1;
 }
 
 /**
  * atk_table_get_caption:
- * @value: a GObject instance that implements AtkTableInterface
- * @return: a AtkObject* representing the table caption, or NULL
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableInterface
+ *
+ * Gets the caption for the @table.
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Returns: a AtkObject* representing the table caption, or %NULL
+ * if value does not implement this interface.
  **/
 AtkObject*
-atk_table_get_caption (AtkTable *obj)
+atk_table_get_caption (AtkTable *table)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, NULL);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
+  g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_caption)
-    return (iface->get_caption) (obj);
+    return (iface->get_caption) (table);
   else
     return NULL;
 }
 
 /**
  * atk_table_get_n_columns:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a gint representing the number of columns, or 0
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Gets the number of columns in the table.
+ *
+ * Returns: a gint representing the number of columns, or 0
+ * if value does not implement this interface.
  **/
 gint
-atk_table_get_n_columns (AtkTable *obj)
+atk_table_get_n_columns (AtkTable *table)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, 0);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
+  g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_n_columns)
-    return (iface->get_n_columns) (obj);
+    return (iface->get_n_columns) (table);
   else
     return 0;
 }
 
 /**
  * atk_table_get_column_description:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a AtkObject* representing the table description, or NULL
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ * @column: a #gint representing a column in @table
+ *
+ * Gets the description text of the specified @column in the table
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Returns: a gchar* representing the column description, or %NULL
+ * if value does not implement this interface.
  **/
-AtkObject*
-atk_table_get_column_description (AtkTable *obj,
+G_CONST_RETURN gchar*
+atk_table_get_column_description (AtkTable *table,
                                   gint     column)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, NULL);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
+  g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_column_description)
-    return (iface->get_column_description) (obj, column);
+    return (iface->get_column_description) (table, column);
   else
     return NULL;
 }
 
 /**
  * atk_table_get_column_extent_at:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a gint representing the column extent at specified position, or 0
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
+ * @column: a #gint representing a column in @table
+ *
+ * Gets the number of columns occupied by the accessible object
+ * at the specified @row and @column in the @table.
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Returns: a gint representing the column extent at specified position, or 0
+ * if value does not implement this interface.
  **/
 gint
-atk_table_get_column_extent_at (AtkTable *obj,
+atk_table_get_column_extent_at (AtkTable *table,
                                 gint     row,
                                 gint     column)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, 0);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
+  g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_column_extent_at)
-    return (iface->get_column_extent_at) (obj, row, column);
+    return (iface->get_column_extent_at) (table, row, column);
   else
     return 0;
 }
 
 /**
  * atk_table_get_column_header:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a AtkObject* representing the column headers, or NULL
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ * @column: a #gint representing a column in the table
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Gets the column header of a specified column in an accessible table.
+ *
+ * Returns: a AtkObject* representing the specified column header, or
+ * %NULL if value does not implement this interface.
  **/
-AtkTable*
-atk_table_get_column_header (AtkTable *obj)
+AtkObject*
+atk_table_get_column_header (AtkTable *table, gint column)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, NULL);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
+  g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_column_header)
-    return (iface->get_column_header) (obj);
+    return (iface->get_column_header) (table, column);
   else
     return NULL;
 }
 
 /**
  * atk_table_get_n_rows:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a gint representing the number of rows, or 0
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ *
+ * Gets the number of rows in the table.
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Returns: a gint representing the number of rows, or 0
+ * if value does not implement this interface.
  **/
 gint
-atk_table_get_n_rows (AtkTable *obj)
+atk_table_get_n_rows (AtkTable *table)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, 0);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
+  g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_n_rows)
-    return (iface->get_n_rows) (obj);
+    return (iface->get_n_rows) (table);
   else
     return 0;
 }
 
 /**
  * atk_table_get_row_description:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a AtkObject* representing the table description, or NULL
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Gets the description text of the specified row in the table
+ *
+ * Returns: a gchar* representing the row description, or %NULL
+ * if value does not implement this interface.
  **/
-AtkObject*
-atk_table_get_row_description (AtkTable *obj,
+G_CONST_RETURN gchar*
+atk_table_get_row_description (AtkTable *table,
                                gint      row)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, NULL);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
+  g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_row_description)
-    return (iface->get_row_description) (obj, row);
+    return (iface->get_row_description) (table, row);
   else
     return NULL;
 }
 
 /**
  * atk_table_get_row_extent_at:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a gint representing the row extent at specified position, or 0
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
+ * @column: a #gint representing a column in @table
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Gets the number of rows occupied by the accessible object
+ * at a specified @row and @column in the @table.
+ *
+ * Returns: a gint representing the row extent at specified position, or 0
+ * if value does not implement this interface.
  **/
 gint
-atk_table_get_row_extent_at (AtkTable *obj,
+atk_table_get_row_extent_at (AtkTable *table,
                              gint     row,
                              gint     column)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, 0);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
+  g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_row_extent_at)
-    return (iface->get_row_extent_at) (obj, row, column);
+    return (iface->get_row_extent_at) (table, row, column);
   else
     return 0;
 }
 
 /**
  * atk_table_get_row_header:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a AtkTable* representing the row headers, or NULL
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in the table
+ *
+ * Gets the row header of a specified row in an accessible table.
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Returns: a AtkObject* representing the specified row header, or
+ * %NULL if value does not implement this interface.
  **/
-AtkTable*
-atk_table_get_row_header (AtkTable *obj)
+AtkObject*
+atk_table_get_row_header (AtkTable *table, gint row)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, NULL);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
+  g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_row_header)
-    return (iface->get_row_header) (obj);
+    return (iface->get_row_header) (table, row);
   else
     return NULL;
 }
 
 /**
  * atk_table_get_summary:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a AtkObject* representing a sumary description of the table,
- * or NULL if value does not implement this interface.
- *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * @table: a GObject instance that implements AtkTableIface
+ *
+ * Gets the summary description of the table.
+ *
+ * Returns: a AtkObject* representing a summary description of the table,
+ * or zero if value does not implement this interface.
  **/
 AtkObject*
-atk_table_get_summary (AtkTable *obj)
+atk_table_get_summary (AtkTable *table)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, NULL);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
+  g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_summary)
-    return (iface->get_summary) (obj);
+    return (iface->get_summary) (table);
   else
     return NULL;
 }
 
 /**
  * atk_table_get_selected_rows:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a gint* representing the selected rows,
- * or NULL if value does not implement this interface.
- *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * @table: a GObject instance that implements AtkTableIface
+ * @selected: a #gint** that is to contain the selected row numbers
+ *
+ * Gets the selected rows of the table by initializing **selected with 
+ * the selected row numbers. This array should be freed by the caller.
+ *
+ * Returns: a gint representing the number of selected rows,
+ * or zero if value does not implement this interface.
  **/
-gint*
-atk_table_get_selected_rows (AtkTable *obj)
+gint
+atk_table_get_selected_rows (AtkTable *table, gint **selected)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, NULL);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
+  g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_selected_rows)
-    return (iface->get_selected_rows) (obj);
+    return (iface->get_selected_rows) (table, selected);
   else
-    return NULL;
+    return 0;
 }
 
 /**
  * atk_table_get_selected_columns:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a gint* representing the selected columns,
- * or NULL if value does not implement this interface.
- *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * @table: a GObject instance that implements AtkTableIface
+ * @selected: a #gint** that is to contain the selected columns numbers
+ *
+ * Gets the selected columns of the table by initializing **selected with 
+ * the selected column numbers. This array should be freed by the caller.
+ *
+ * Returns: a gint representing the number of selected columns,
+ * or %0 if value does not implement this interface.
  **/
-gint*
-atk_table_get_selected_columns (AtkTable *obj)
+gint 
+atk_table_get_selected_columns (AtkTable *table, gint **selected)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, NULL);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
+  g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->get_selected_columns)
-    return (iface->get_selected_columns) (obj);
+    return (iface->get_selected_columns) (table, selected);
   else
-    return NULL;
+    return 0;
 }
 
 /**
  * atk_table_is_column_selected:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a gboolean representing the column is selected, or 0
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ * @column: a #gint representing a column in @table
+ *
+ * Gets a boolean value indicating whether the specified @column
+ * is selected
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Returns: a gboolean representing if the column is selected, or 0
+ * if value does not implement this interface.
  **/
 gboolean
-atk_table_is_column_selected (AtkTable *obj,
+atk_table_is_column_selected (AtkTable *table,
                               gint     column)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, FALSE);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
+  g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->is_column_selected)
-    return (iface->is_column_selected) (obj, column);
+    return (iface->is_column_selected) (table, column);
   else
     return FALSE;
 }
 
 /**
  * atk_table_is_row_selected:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a gboolean representing the row is selected, or 0
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Gets a boolean value indicating whether the specified @row
+ * is selected
+ *
+ * Returns: a gboolean representing if the row is selected, or 0
+ * if value does not implement this interface.
  **/
 gboolean
-atk_table_is_row_selected (AtkTable *obj,
+atk_table_is_row_selected (AtkTable *table,
                            gint     row)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, FALSE);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
+  g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->is_row_selected)
-    return (iface->is_row_selected) (obj, row);
+    return (iface->is_row_selected) (table, row);
   else
     return FALSE;
 }
 
 /**
  * atk_table_is_selected:
- * @value: a GObject instance that implements AtkTableIface
- * @return: a gboolean representing the cell is selected, or 0
- * if value does not implement this interface.
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
+ * @column: a #gint representing a column in @table
  *
- * WARNING: callers should not rely on %NULL or on a zero value for
- * indication of whether AtkSelectionIface is implemented, they should
- * use type checking/interface checking macros or the
- * atk_get_accessible_table() convenience method.
+ * Gets a boolean value indicating whether the accessible object
+ * at the specified @row and @column is selected
+ *
+ * Returns: a gboolean representing if the cell is selected, or 0
+ * if value does not implement this interface.
  **/
 gboolean
-atk_table_is_selected (AtkTable *obj,
+atk_table_is_selected (AtkTable *table,
                        gint     row,
                        gint     column)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (obj != NULL, FALSE);
-  g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
+  g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->is_selected)
-    return (iface->is_selected) (obj, row, column);
+    return (iface->is_selected) (table, row, column);
+  else
+    return FALSE;
+}
+
+/**
+ * atk_table_add_row_selection:
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
+ *
+ * Adds the specified @row to the selection. 
+ *
+ * Returns: a gboolean representing if row was successfully added to selection,
+ * or 0 if value does not implement this interface.
+ **/
+gboolean
+atk_table_add_row_selection (AtkTable *table,
+                                        gint     row)
+{
+  AtkTableIface *iface;
+
+  g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
+
+  iface = ATK_TABLE_GET_IFACE (table);
+
+  if (iface->add_row_selection)
+    return (iface->add_row_selection) (table, row);
+  else
+    return FALSE;
+}
+/**
+ * atk_table_remove_row_selection:
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
+ *
+ * Removes the specified @row from the selection. 
+ *
+ * Returns: a gboolean representing if the row was successfully removed from
+ * the selection, or 0 if value does not implement this interface.
+ **/
+gboolean
+atk_table_remove_row_selection (AtkTable *table,
+                                           gint     row)
+{
+  AtkTableIface *iface;
+
+  g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
+
+  iface = ATK_TABLE_GET_IFACE (table);
+
+  if (iface->remove_row_selection)
+    return (iface->remove_row_selection) (table, row);
+  else
+    return FALSE;
+}
+/**
+ * atk_table_add_column_selection:
+ * @table: a GObject instance that implements AtkTableIface
+ * @column: a #gint representing a column in @table
+ *
+ * Adds the specified @column to the selection. 
+ *
+ * Returns: a gboolean representing if the column was successfully added to 
+ * the selection, or 0 if value does not implement this interface.
+ **/
+gboolean
+atk_table_add_column_selection (AtkTable *table,
+                                           gint     column)
+{
+  AtkTableIface *iface;
+
+  g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
+
+  iface = ATK_TABLE_GET_IFACE (table);
+
+  if (iface->add_column_selection)
+    return (iface->add_column_selection) (table, column);
+  else
+    return FALSE;
+}
+/**
+ * atk_table_remove_column_selection:
+ * @table: a GObject instance that implements AtkTableIface
+ * @column: a #gint representing a column in @table
+ *
+ * Adds the specified @column to the selection. 
+ *
+ * Returns: a gboolean representing if the column was successfully removed from
+ * the selection, or 0 if value does not implement this interface.
+ **/
+gboolean
+atk_table_remove_column_selection (AtkTable *table,
+                                                  gint     column)
+{
+  AtkTableIface *iface;
+
+  g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
+
+  iface = ATK_TABLE_GET_IFACE (table);
+
+  if (iface->remove_column_selection)
+    return (iface->remove_column_selection) (table, column);
   else
     return FALSE;
 }
 
 /**
  * atk_table_set_caption:
- * @value: a GObject instance that implements AtkTableIface
- * @return: void
+ * @table: a GObject instance that implements AtkTableIface
+ * @caption: a #AtkObject representing the caption to set for @table
+ *
+ * Sets the caption for the table.
  **/
 void
-atk_table_set_caption (AtkTable       *obj,
-                       AtkObject      *accessible)
+atk_table_set_caption (AtkTable       *table,
+                       AtkObject      *caption)
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (obj != NULL);
-  g_return_if_fail (ATK_IS_TABLE (obj));
+  g_return_if_fail (ATK_IS_TABLE (table));
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->set_caption)
-    (iface->set_caption) (obj, accessible);
+    (iface->set_caption) (table, caption);
 }
 
 /**
  * atk_table_set_column_description:
- * @value: a GObject instance that implements AtkTableIface
- * @return: void
+ * @table: a GObject instance that implements AtkTableIface
+ * @column: a #gint representing a column in @table
+ * @description: a #gchar representing the description text
+ * to set for the specified @column of the @table
+ *
+ * Sets the description text for the specified @column of the @table.
  **/
 void
-atk_table_set_column_description (AtkTable       *obj,
+atk_table_set_column_description (AtkTable       *table,
                                   gint           column,
-                                  AtkObject      *accessible)
+                                  const gchar    *description)
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (obj != NULL);
-  g_return_if_fail (ATK_IS_TABLE (obj));
+  g_return_if_fail (ATK_IS_TABLE (table));
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->set_column_description)
-    (iface->set_column_description) (obj, column, accessible);
+    (iface->set_column_description) (table, column, description);
 }
 
 /**
  * atk_table_set_column_header:
- * @value: a GObject instance that implements AtkTableIface
- * @return: void
+ * @table: a GObject instance that implements AtkTableIface
+ * @column: a #gint representing a column in @table
+ * @header: an #AtkTable
+ *
+ * Sets the specified column header to @header.
  **/
 void
-atk_table_set_column_header (AtkTable *obj,
-                             gint     column,
-                             AtkTable *header)
+atk_table_set_column_header (AtkTable  *table,
+                             gint      column,
+                             AtkObject *header)
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (obj != NULL);
-  g_return_if_fail (ATK_IS_TABLE (obj));
+  g_return_if_fail (ATK_IS_TABLE (table));
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->set_column_header)
-    (iface->set_column_header) (obj, column, header);
+    (iface->set_column_header) (table, column, header);
 }
 
 /**
  * atk_table_set_row_description:
- * @value: a GObject instance that implements AtkTableIface
- * @return: void
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
+ * @description: a #gchar representing the description text
+ * to set for the specified @row of @table
+ *
+ * Sets the description text for the specified @row of @table.
  **/
 void
-atk_table_set_row_description (AtkTable       *obj,
+atk_table_set_row_description (AtkTable       *table,
                                gint           row,
-                               AtkObject      *accessible)
+                               const gchar    *description)
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (obj != NULL);
-  g_return_if_fail (ATK_IS_TABLE (obj));
+  g_return_if_fail (ATK_IS_TABLE (table));
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->set_row_description)
-    (iface->set_row_description) (obj, row, accessible);
+    (iface->set_row_description) (table, row, description);
 }
 
 /**
  * atk_table_set_row_header:
- * @value: a GObject instance that implements AtkTableIface
- * @return: void
+ * @table: a GObject instance that implements AtkTableIface
+ * @row: a #gint representing a row in @table
+ * @header: an #AtkTable 
+ *
+ * Sets the specified row header to @header.
  **/
 void
-atk_table_set_row_header (AtkTable *obj,
-                          gint     row,
-                          AtkTable *header)
+atk_table_set_row_header (AtkTable  *table,
+                          gint      row,
+                          AtkObject *header)
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (obj != NULL);
-  g_return_if_fail (ATK_IS_TABLE (obj));
+  g_return_if_fail (ATK_IS_TABLE (table));
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->set_row_header)
-    (iface->set_row_header) (obj, row, header);
+    (iface->set_row_header) (table, row, header);
 }
 
 /**
  * atk_table_set_summary:
- * @value: a GObject instance that implements AtkTableIface
- * @return: void
+ * @table: a GObject instance that implements AtkTableIface
+ * @accessible: an #AtkObject representing the summary description
+ * to set for @table
+ *
+ * Sets the summary description of the table.
  **/
 void
-atk_table_set_summary (AtkTable       *obj,
+atk_table_set_summary (AtkTable       *table,
                        AtkObject      *accessible)
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (obj != NULL);
-  g_return_if_fail (ATK_IS_TABLE (obj));
+  g_return_if_fail (ATK_IS_TABLE (table));
 
-  iface = ATK_TABLE_GET_IFACE (obj);
+  iface = ATK_TABLE_GET_IFACE (table);
 
   if (iface->set_summary)
-    (iface->set_summary) (obj, accessible);
+    (iface->set_summary) (table, accessible);
 }