Revert "Revert "Merge remote-tracking branch 'origin/sandbox/mniesluchow/upstream_2_1...
[platform/upstream/atk.git] / atk / atktable.c
index c536c27..082de56 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
+#include "config.h"
+
 #include "atktable.h"
 #include "atkmarshal.h"
 
+/**
+ * SECTION:atktable
+ * @Short_description: The ATK interface implemented for UI components
+ *  which contain tabular or row/column information.
+ * @Title:AtkTable
+ *
+ * #AtkTable should be implemented by components which present
+ * elements ordered via rows and columns.  It may also be used to
+ * present tree-structured information if the nodes of the trees can
+ * be said to contain multiple "columns".  Individual elements of an
+ * #AtkTable are typically referred to as "cells". Those cells should
+ * implement the interface #AtkTableCell, but #Atk doesn't require
+ * them to be direct children of the current #AtkTable. They can be
+ * grand-children, grand-grand-children etc. #AtkTable provides the
+ * API needed to get a individual cell based on the row and column
+ * numbers.
+ *
+ * Children of #AtkTable are frequently "lightweight" objects, that
+ * is, they may not have backing widgets in the host UI toolkit.  They
+ * are therefore often transient.
+ *
+ * Since tables are often very complex, #AtkTable includes provision
+ * for offering simplified summary information, as well as row and
+ * column headers and captions.  Headers and captions are #AtkObjects
+ * which may implement other interfaces (#AtkText, #AtkImage, etc.) as
+ * appropriate.  #AtkTable summaries may themselves be (simplified)
+ * #AtkTables, etc.
+ *
+ * Note for implementors: in the past, #AtkTable required that all the
+ * cells should be direct children of #AtkTable, and provided some
+ * index based methods to request the cells. The practice showed that
+ * that forcing made #AtkTable implementation complex, and hard to
+ * expose other kind of children, like rows or captions. Right now,
+ * index-based methods are deprecated.
+ */
+
 enum {
   ROW_INSERTED,
   ROW_DELETED,
@@ -27,37 +65,31 @@ enum {
   COLUMN_DELETED,
   ROW_REORDERED,
   COLUMN_REORDERED,
+  MODEL_CHANGED,
   LAST_SIGNAL
 };
 
-struct _AtkTableIfaceClass
-{
-  GObjectClass parent;
-};
-
-typedef struct _AtkTableIfaceClass AtkTableIfaceClass;
-
-static void atk_table_base_init (gpointer *g_class);
+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),
       (GBaseInitFunc) atk_table_base_init,
       (GBaseFinalizeFunc) NULL,
-
+      
     };
-
+    
     type = g_type_register_static (G_TYPE_INTERFACE, "AtkTable", &tinfo, 0);
   }
-
+  
   return type;
 }
 
@@ -66,65 +98,135 @@ static void
 atk_table_base_init (gpointer *g_class)
 {
   static gboolean initialized = FALSE;
-
-  if (! initialized)
-  {
-    atk_table_signals[ROW_INSERTED] =
-      g_signal_newc ("row_inserted",
-                     ATK_TYPE_TABLE,
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET (AtkTableIface, model_changed),
-                     (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_newc ("column_inserted",
-                     ATK_TYPE_TABLE,
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET (AtkTableIface, model_changed),
-                     (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_newc ("row_deleted",
-                     ATK_TYPE_TABLE,
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET (AtkTableIface, model_changed),
-                     (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_newc ("column_deleted",
-                     ATK_TYPE_TABLE,
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET (AtkTableIface, model_changed),
-                     (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_newc ("row_reordered",
-                     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);
-    atk_table_signals[COLUMN_REORDERED] =
-      g_signal_newc ("column_reordered",
-                     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;
-  }
+  
+  if (!initialized)
+    {
+      /**
+       * AtkTable::row-inserted:
+       * @atktable: the object which received the signal.
+       * @arg1: The index of the first row inserted.
+       * @arg2: The number of rows inserted.
+       *
+       * The "row-inserted" signal is emitted by an object which
+       * implements the AtkTable interface when a row is inserted.
+       */
+      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);
+      /**
+       * AtkTable::column-inserted:
+       * @atktable: the object which received the signal.
+       * @arg1: The index of the column inserted.
+       * @arg2: The number of colums inserted.
+       *
+       * The "column-inserted" signal is emitted by an object which
+       * implements the AtkTable interface when a column is inserted.
+       */
+      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);
+      /**
+       * AtkTable::row-deleted:
+       * @atktable: the object which received the signal.
+       * @arg1: The index of the first row deleted.
+       * @arg2: The number of rows deleted.
+       *
+       * The "row-deleted" signal is emitted by an object which
+       * implements the AtkTable interface when a row is deleted.
+       */
+      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);
+      /**
+       * AtkTable::column-deleted:
+       * @atktable: the object which received the signal.
+       * @arg1: The index of the first column deleted.
+       * @arg2: The number of columns deleted.
+       *
+       * The "column-deleted" signal is emitted by an object which
+       * implements the AtkTable interface when a column is deleted.
+       */
+      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);
+      /**
+       * AtkTable::row-reordered:
+       * @atktable: the object which received the signal.
+       *
+       * The "row-reordered" signal is emitted by an object which
+       * implements the AtkTable interface when the rows are
+       * reordered.
+       */
+      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);
+      /**
+       * AtkTable::column-reordered:
+       * @atktable: the object which received the signal.
+       *
+       * The "column-reordered" signal is emitted by an object which
+       * implements the AtkTable interface when the columns are
+       * reordered.
+       */
+      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);
+
+      /**
+       * AtkTable::model-changed:
+       * @atktable: the object which received the signal.
+       *
+       * The "model-changed" signal is emitted by an object which
+       * implements the AtkTable interface when the model displayed by
+       * the table changes.
+       */
+      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;
+    }
 }
 
 /**
@@ -133,9 +235,11 @@ atk_table_base_init (gpointer *g_class)
  * @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. This cell
+ * should implement the interface #AtkTableCell
  *
- * Returns: a AtkObject* representing the referred to accessible
+ * Returns: (transfer full): an #AtkObject representing the referred
+ * to accessible
  **/
 AtkObject*
 atk_table_ref_at (AtkTable *table,
@@ -144,8 +248,9 @@ atk_table_ref_at (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, 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 (table);
 
@@ -161,15 +266,15 @@ 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.
- * Note: 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, or 0
- * if value does not implement this interface.
+ * Deprecated: Since 2.12. Use atk_table_ref_at() in order to get the
+ * accessible that represents the cell at (@row, @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 *table,
@@ -178,31 +283,29 @@ atk_table_get_index_at (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, 0);
-  g_return_val_if_fail (ATK_IS_TABLE (table), 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 0;
+    return -1;
 }
 
 /**
  * atk_table_get_row_at_index:
  * @table: a GObject instance that implements AtkTableInterface
- * @index: a #gint representing an index in @table
+ * @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
- * Note: 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 row at the specified @index_.
  *
- * Returns: a gint representing the row at the specified  index, or 0
- * if value does not implement this interface.
+ * Deprecated: since 2.12.
+ *
+ * Returns: a gint representing the row at the specified index,
+ * or -1 if the table does not implement this method.
  **/
 gint
 atk_table_get_row_at_index (AtkTable *table,
@@ -210,31 +313,27 @@ atk_table_get_row_at_index (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, 0);
-  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 0;
+    return -1;
 }
 
 /**
  * atk_table_get_column_at_index:
  * @table: a GObject instance that implements AtkTableInterface
- * @index: a #gint representing an index in @table
+ * @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
- * Note: 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 0
- * if value does not implement this interface.
+ * Deprecated: Since 2.12.
+ *
+ * Returns: a gint representing the column at the specified index,
+ * or -1 if the table does not implement this method.
  **/
 gint
 atk_table_get_column_at_index (AtkTable *table,
@@ -242,7 +341,6 @@ atk_table_get_column_at_index (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, 0);
   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -250,7 +348,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 0;
+    return -1;
 }
 
 /**
@@ -258,20 +356,15 @@ atk_table_get_column_at_index (AtkTable *table,
  * @table: a GObject instance that implements AtkTableInterface
  *
  * Gets the caption for the @table.
- * Note: 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 table caption, or %NULL
- * if value does not implement this interface.
+ * Returns: (nullable) (transfer none): a AtkObject* representing the
+ * table caption, or %NULL if value does not implement this interface.
  **/
-gchar*
+AtkObject*
 atk_table_get_caption (AtkTable *table)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, NULL);
   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -287,10 +380,6 @@ atk_table_get_caption (AtkTable *table)
  * @table: a GObject instance that implements AtkTableIface
  *
  * Gets the number of columns in the table.
- * Note: 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 columns, or 0
  * if value does not implement this interface.
@@ -300,7 +389,6 @@ atk_table_get_n_columns (AtkTable *table)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, 0);
   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -317,21 +405,16 @@ atk_table_get_n_columns (AtkTable *table)
  * @column: a #gint representing a column in @table
  *
  * Gets the description text of the specified @column in the table
- * Note: 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.
  **/
-gchar*
+const gchar*
 atk_table_get_column_description (AtkTable *table,
                                   gint     column)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, NULL);
   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -350,10 +433,6 @@ atk_table_get_column_description (AtkTable *table,
  *
  * Gets the number of columns occupied by the accessible object
  * at the specified @row and @column in the @table.
- * Note: 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.
@@ -365,7 +444,6 @@ atk_table_get_column_extent_at (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, 0);
   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -382,20 +460,16 @@ atk_table_get_column_extent_at (AtkTable *table,
  * @column: a #gint representing a column in the table
  *
  * Gets the column header of a specified column in an accessible table.
- * Note: 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 column header, or
- * %NULL if value does not implement this interface.
+ * Returns: (nullable) (transfer none): a AtkObject* representing the
+ * specified column header, or %NULL if value does not implement this
+ * interface.
  **/
 AtkObject*
 atk_table_get_column_header (AtkTable *table, gint column)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, NULL);
   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -411,10 +485,6 @@ atk_table_get_column_header (AtkTable *table, gint column)
  * @table: a GObject instance that implements AtkTableIface
  *
  * Gets the number of rows in the table.
- * Note: 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.
@@ -424,7 +494,6 @@ atk_table_get_n_rows (AtkTable *table)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, 0);
   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -438,24 +507,19 @@ atk_table_get_n_rows (AtkTable *table)
 /**
  * atk_table_get_row_description:
  * @table: a GObject instance that implements AtkTableIface
- * @r: a #gint representing a row in @table
+ * @row: a #gint representing a row in @table
  *
  * Gets the description text of the specified row in the table
- * Note: 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 row description, or %NULL
- * if value does not implement this interface.
+ * Returns: (nullable): a gchar* representing the row description, or
+ * %NULL if value does not implement this interface.
  **/
-gchar*
+const gchar*
 atk_table_get_row_description (AtkTable *table,
                                gint      row)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, NULL);
   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -474,10 +538,6 @@ atk_table_get_row_description (AtkTable *table,
  *
  * Gets the number of rows occupied by the accessible object
  * at a specified @row and @column in the @table.
- * Note: 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 extent at specified position, or 0
  * if value does not implement this interface.
@@ -489,7 +549,6 @@ atk_table_get_row_extent_at (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, 0);
   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -506,20 +565,16 @@ atk_table_get_row_extent_at (AtkTable *table,
  * @row: a #gint representing a row in the table
  *
  * Gets the row header of a specified row in an accessible table.
- * Note: 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.
+ * Returns: (nullable) (transfer none): a AtkObject* representing the
+ * specified row header, or %NULL if value does not implement this
+ * interface.
  **/
 AtkObject*
 atk_table_get_row_header (AtkTable *table, gint row)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, NULL);
   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -535,20 +590,15 @@ atk_table_get_row_header (AtkTable *table, gint row)
  * @table: a GObject instance that implements AtkTableIface
  *
  * Gets the summary description of the table.
- * Note: 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 a sumary description of the table,
- * or zero if value does not implement this interface.
+ * Returns: (transfer full): a AtkObject* representing a summary description
+ * of the table, or zero if value does not implement this interface.
  **/
 AtkObject*
 atk_table_get_summary (AtkTable *table)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, NULL);
   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -566,10 +616,6 @@ atk_table_get_summary (AtkTable *table)
  *
  * Gets the selected rows of the table by initializing **selected with 
  * the selected row numbers. This array should be freed by the caller.
- * Note: 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 selected rows,
  * or zero if value does not implement this interface.
@@ -579,7 +625,6 @@ atk_table_get_selected_rows (AtkTable *table, gint **selected)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, 0);
   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -597,21 +642,15 @@ atk_table_get_selected_rows (AtkTable *table, gint **selected)
  *
  * Gets the selected columns of the table by initializing **selected with 
  * the selected column numbers. This array should be freed by the caller.
- * Note: 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 selected columns,
  * or %0 if value does not implement this interface.
- *
  **/
 gint 
 atk_table_get_selected_columns (AtkTable *table, gint **selected)
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, 0);
   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -629,10 +668,6 @@ atk_table_get_selected_columns (AtkTable *table, gint **selected)
  *
  * Gets a boolean value indicating whether the specified @column
  * is selected
- * Note: 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.
@@ -643,7 +678,6 @@ atk_table_is_column_selected (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, FALSE);
   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -661,10 +695,6 @@ atk_table_is_column_selected (AtkTable *table,
  *
  * Gets a boolean value indicating whether the specified @row
  * is selected
- * Note: 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 row is selected, or 0
  * if value does not implement this interface.
@@ -675,7 +705,6 @@ atk_table_is_row_selected (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, FALSE);
   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -692,12 +721,8 @@ atk_table_is_row_selected (AtkTable *table,
  * @row: a #gint representing a row in @table
  * @column: a #gint representing a column in @table
  *
- * Gets a boolean value indicating whether the acessible object
+ * Gets a boolean value indicating whether the accessible object
  * at the specified @row and @column is selected
- * Note: 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 cell is selected, or 0
  * if value does not implement this interface.
@@ -709,7 +734,6 @@ atk_table_is_selected (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, FALSE);
   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -726,10 +750,6 @@ atk_table_is_selected (AtkTable *table,
  * @row: a #gint representing a row in @table
  *
  * Adds the specified @row to the selection. 
- * Note: 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 row was successfully added to selection,
  * or 0 if value does not implement this interface.
@@ -740,7 +760,6 @@ atk_table_add_row_selection (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, FALSE);
   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -756,10 +775,6 @@ atk_table_add_row_selection (AtkTable *table,
  * @row: a #gint representing a row in @table
  *
  * Removes the specified @row from the selection. 
- * Note: 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 row was successfully removed from
  * the selection, or 0 if value does not implement this interface.
@@ -770,7 +785,6 @@ atk_table_remove_row_selection (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, FALSE);
   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -786,10 +800,6 @@ atk_table_remove_row_selection (AtkTable *table,
  * @column: a #gint representing a column in @table
  *
  * Adds the specified @column to the selection. 
- * Note: 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 was successfully added to 
  * the selection, or 0 if value does not implement this interface.
@@ -800,7 +810,6 @@ atk_table_add_column_selection (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, FALSE);
   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -816,10 +825,6 @@ atk_table_add_column_selection (AtkTable *table,
  * @column: a #gint representing a column in @table
  *
  * Adds the specified @column to the selection. 
- * Note: 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 was successfully removed from
  * the selection, or 0 if value does not implement this interface.
@@ -830,7 +835,6 @@ atk_table_remove_column_selection (AtkTable *table,
 {
   AtkTableIface *iface;
 
-  g_return_val_if_fail (table != NULL, FALSE);
   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -844,17 +848,16 @@ atk_table_remove_column_selection (AtkTable *table,
 /**
  * atk_table_set_caption:
  * @table: a GObject instance that implements AtkTableIface
- * @caption: a #gchar representing the caption to set for @table
+ * @caption: a #AtkObject representing the caption to set for @table
  *
  * Sets the caption for the table.
  **/
 void
 atk_table_set_caption (AtkTable       *table,
-                       gchar          *caption)
+                       AtkObject      *caption)
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (table != NULL);
   g_return_if_fail (ATK_IS_TABLE (table));
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -875,11 +878,10 @@ atk_table_set_caption (AtkTable       *table,
 void
 atk_table_set_column_description (AtkTable       *table,
                                   gint           column,
-                                  gchar          *description)
+                                  const gchar    *description)
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (table != NULL);
   g_return_if_fail (ATK_IS_TABLE (table));
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -894,7 +896,7 @@ atk_table_set_column_description (AtkTable       *table,
  * @column: a #gint representing a column in @table
  * @header: an #AtkTable
  *
- * Sets the specified column header to @header
+ * Sets the specified column header to @header.
  **/
 void
 atk_table_set_column_header (AtkTable  *table,
@@ -903,7 +905,6 @@ atk_table_set_column_header (AtkTable  *table,
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (table != NULL);
   g_return_if_fail (ATK_IS_TABLE (table));
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -924,11 +925,10 @@ atk_table_set_column_header (AtkTable  *table,
 void
 atk_table_set_row_description (AtkTable       *table,
                                gint           row,
-                               gchar          *description)
+                               const gchar    *description)
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (table != NULL);
   g_return_if_fail (ATK_IS_TABLE (table));
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -943,7 +943,7 @@ atk_table_set_row_description (AtkTable       *table,
  * @row: a #gint representing a row in @table
  * @header: an #AtkTable 
  *
- * Sets the specified row header to @header
+ * Sets the specified row header to @header.
  **/
 void
 atk_table_set_row_header (AtkTable  *table,
@@ -952,7 +952,6 @@ atk_table_set_row_header (AtkTable  *table,
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (table != NULL);
   g_return_if_fail (ATK_IS_TABLE (table));
 
   iface = ATK_TABLE_GET_IFACE (table);
@@ -967,7 +966,7 @@ atk_table_set_row_header (AtkTable  *table,
  * @accessible: an #AtkObject representing the summary description
  * to set for @table
  *
- * Sets the summary description of the table
+ * Sets the summary description of the table.
  **/
 void
 atk_table_set_summary (AtkTable       *table,
@@ -975,7 +974,6 @@ atk_table_set_summary (AtkTable       *table,
 {
   AtkTableIface *iface;
 
-  g_return_if_fail (table != NULL);
   g_return_if_fail (ATK_IS_TABLE (table));
 
   iface = ATK_TABLE_GET_IFACE (table);