Fix NSelectedRows and NSelectedColumns
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / adaptors / table-adaptor.c
index 212004a..051234a 100644 (file)
@@ -25,8 +25,9 @@
 #include <atk/atk.h>
 #include <droute/droute.h>
 
-#include "accessible-marshaller.h"
 #include "common/spi-dbus.h"
+#include "object.h"
+#include "introspection.h"
 
 static dbus_bool_t
 impl_get_NRows (DBusMessageIter * iter, void *user_data)
@@ -49,8 +50,8 @@ impl_get_Caption (DBusMessageIter * iter, void *user_data)
 {
   AtkTable *table = (AtkTable *) user_data;
   g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
-  return spi_dbus_return_v_object (iter, atk_table_get_caption (table),
-                                   FALSE);
+  spi_object_append_v_reference (iter, atk_table_get_caption (table));
+  return TRUE;
 }
 
 static dbus_bool_t
@@ -58,8 +59,8 @@ impl_get_Summary (DBusMessageIter * iter, void *user_data)
 {
   AtkTable *table = (AtkTable *) user_data;
   g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
-  return spi_dbus_return_v_object (iter, atk_table_get_summary (table),
-                                   FALSE);
+  spi_object_append_v_reference (iter, atk_table_get_summary (table));
+  return TRUE;
 }
 
 static dbus_bool_t
@@ -107,7 +108,7 @@ impl_GetAccessibleAt (DBusConnection * bus, DBusMessage * message,
       return droute_invalid_arguments_error (message);
     }
   obj = atk_table_ref_at (table, row, column);
-  return spi_dbus_return_object (message, obj, TRUE, TRUE);
+  return spi_object_return_reference (message, obj);
 }
 
 static DBusMessage *
@@ -319,7 +320,7 @@ impl_GetRowHeader (DBusConnection * bus, DBusMessage * message,
   AtkTable *table = (AtkTable *) user_data;
   dbus_int32_t row;
   DBusError error;
-  AtkObject *obj;
+  AtkObject *obj = NULL;
 
   g_return_val_if_fail (ATK_IS_TABLE (user_data),
                         droute_not_yet_handled_error (message));
@@ -330,8 +331,7 @@ impl_GetRowHeader (DBusConnection * bus, DBusMessage * message,
       return droute_invalid_arguments_error (message);
     }
   obj = atk_table_get_row_header (table, row);
-  obj = atk_table_get_row_header (table, row);
-  return spi_dbus_return_object (message, obj, TRUE, FALSE);
+  return spi_object_return_reference (message, obj);
 }
 
 static DBusMessage *
@@ -353,7 +353,7 @@ impl_GetColumnHeader (DBusConnection * bus, DBusMessage * message,
     }
   obj = atk_table_get_column_header (table, column);
   obj = atk_table_get_column_header (table, column);
-  return spi_dbus_return_object (message, obj, TRUE, FALSE);
+  return spi_object_return_reference (message, obj);
 }
 
 static DBusMessage *
@@ -678,8 +678,8 @@ static DRouteProperty properties[] = {
   {impl_get_NColumns, NULL, "NColumns"},
   {impl_get_Caption, NULL, "Caption"},
   {impl_get_Summary, NULL, "Summary"},
-  {impl_get_NSelectedRows, NULL, "nSelectedRows"},
-  {impl_get_NSelectedColumns, NULL, "nSelectedColumns"},
+  {impl_get_NSelectedRows, NULL, "NSelectedRows"},
+  {impl_get_NSelectedColumns, NULL, "NSelectedColumns"},
   {NULL, NULL, NULL}
 };
 
@@ -687,5 +687,5 @@ void
 spi_initialize_table (DRoutePath * path)
 {
   droute_path_add_interface (path,
-                             SPI_DBUS_INTERFACE_TABLE, methods, properties);
+                             SPI_DBUS_INTERFACE_TABLE, spi_org_a11y_atspi_Table, methods, properties);
 };