Fix off-by-one malloc error in dec_synth_keystring
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_selection.c
index 910e9c8..d369070 100644 (file)
@@ -63,13 +63,11 @@ AccessibleSelection_unref (AccessibleSelection *obj)
 long
 AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj)
 {
-  long retval;
+  dbus_int32_t retval;
 
   cspi_return_val_if_fail (obj != NULL, -1);
 
-  retval =
-    Accessibility_Selection__get_nSelectedChildren (CSPI_OBJREF (obj),
-                                                   cspi_ev ());
+  cspi_dbus_get_property (obj, spi_interface_selection, "nSelectedChildren", NULL, "i", &retval);
 
   cspi_return_val_if_ev ("getNSelectedChildren", -1);
 
@@ -97,15 +95,16 @@ Accessible *
 AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
                                       long int selectedChildIndex)
 {
-  Accessibility_Accessible child;
+  dbus_int32_t d_selectedChildIndex = selectedChildIndex;
+  char *path;
+  Accessible *child;
 
   cspi_return_val_if_fail (obj != NULL, NULL);
   
-  child = Accessibility_Selection_getSelectedChild (
-    CSPI_OBJREF (obj),
-    selectedChildIndex, cspi_ev ());
-
-  return  cspi_object_add (child);
+  cspi_dbus_call (obj, spi_interface_selection, "getSelectedChild", NULL, "i=>o", &d_selectedChildIndex, &path);
+  child = cspi_ref_related_accessible (obj, path);
+  g_free (path);
+  return child;
 }
 
 /**
@@ -125,13 +124,12 @@ SPIBoolean
 AccessibleSelection_selectChild (AccessibleSelection *obj,
                                  long int childIndex)
 {
-  SPIBoolean retval;
+  dbus_int32_t d_childIndex = childIndex;
+  dbus_bool_t retval;
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  retval =
-    Accessibility_Selection_selectChild (CSPI_OBJREF (obj),
-                                        childIndex, cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_selection, "selectChild", NULL, "i=>b", &d_childIndex, &retval);
 
   cspi_return_val_if_ev ("selectChild", FALSE);
 
@@ -156,12 +154,12 @@ SPIBoolean
 AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj,
                                            long int selectedChildIndex)
 {
-  SPIBoolean retval;
+  dbus_int32_t d_selectedChildIndex = selectedChildIndex;
+  dbus_bool_t retval;
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  retval = Accessibility_Selection_deselectSelectedChild (
-    CSPI_OBJREF (obj), selectedChildIndex, cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_selection, "deselectSelectedChild", NULL, "i=>b", &d_selectedChildIndex, &retval);
 
   cspi_return_val_if_ev ("deselectSelectedChild", FALSE);
 
@@ -188,12 +186,12 @@ SPIBoolean
 AccessibleSelection_deselectChild (AccessibleSelection *obj,
                                   long int childIndex)
 {
-  SPIBoolean retval;
+  dbus_int32_t d_childIndex = childIndex;
+  dbus_bool_t retval;
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  retval = Accessibility_Selection_deselectChild (
-    CSPI_OBJREF (obj), childIndex, cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_selection, "deselectChild", NULL, "i=>b", &d_childIndex, &retval);
 
   cspi_return_val_if_ev ("deselectChild", FALSE);
 
@@ -216,13 +214,12 @@ SPIBoolean
 AccessibleSelection_isChildSelected (AccessibleSelection *obj,
                                      long int childIndex)
 {
-  SPIBoolean retval;
+  dbus_int32_t d_childIndex = childIndex;
+  dbus_bool_t retval;
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  retval = Accessibility_Selection_isChildSelected (
-    CSPI_OBJREF (obj),
-    childIndex, cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_selection, "isChildSelected", NULL, "i=>b", &d_childIndex, &retval);
 
   cspi_return_val_if_ev ("isChildSelected", FALSE);
 
@@ -242,11 +239,11 @@ AccessibleSelection_isChildSelected (AccessibleSelection *obj,
 SPIBoolean
 AccessibleSelection_selectAll (AccessibleSelection *obj)
 {
-  SPIBoolean retval;
+  dbus_bool_t retval;
   
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  retval = Accessibility_Selection_selectAll (CSPI_OBJREF (obj), cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_selection, "selectAll", NULL, "=>b", &retval);
 
   cspi_return_val_if_ev ("selectAll", FALSE);
 
@@ -266,14 +263,12 @@ AccessibleSelection_selectAll (AccessibleSelection *obj)
 SPIBoolean
 AccessibleSelection_clearSelection (AccessibleSelection *obj)
 {
-  SPIBoolean retval;
+  dbus_bool_t retval;
   
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  retval = Accessibility_Selection_clearSelection (CSPI_OBJREF (obj), cspi_ev ());
-  cspi_return_val_if_ev ("clearSelection", FALSE);
+  cspi_dbus_call (obj, spi_interface_selection, "clearSelection", NULL, "=>b", &retval);
 
   return retval;
 }
 
-