Add .po and .pc files from cspi
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_component.c
index 11202b0..93a30c5 100644 (file)
@@ -72,15 +72,14 @@ AccessibleComponent_contains (AccessibleComponent *obj,
                               long int y,
                               AccessibleCoordType ctype)
 {
-  SPIBoolean retval;
+  dbus_bool_t retval;
+  dbus_int32_t d_x = x, d_y = y;
+  dbus_uint16_t d_ctype = ctype;
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  retval = Accessibility_Component_contains (CSPI_OBJREF (obj),
-                                            x,
-                                            y,
-                                            ctype,
-                                            cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_component, "contains", NULL, "iin=>b", d_x, d_y, d_ctype, &retval);
+
   cspi_return_val_if_ev ("contains", FALSE);
 
   return retval;
@@ -105,16 +104,18 @@ AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
                                           long int y,
                                           AccessibleCoordType ctype)
 {
-  Accessibility_Accessible child;
+  dbus_int32_t d_x = x, d_y = y;
+  dbus_uint16_t d_ctype = ctype;
+  char *path = NULL;
+  Accessible *retval;
+
+  cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  cspi_return_val_if_fail (obj != NULL, NULL);
+  cspi_dbus_call (obj, spi_interface_component, "getAccessibleAtPoint", NULL, "iin=>o", d_x, d_y, d_ctype, &path);
 
-  child = Accessibility_Component_getAccessibleAtPoint (CSPI_OBJREF (obj),
-                                                       x,
-                                                       y,
-                                                       ctype,
-                                                       cspi_ev ());
-  return cspi_object_add (child);
+  retval = cspi_ref_related_accessible (obj, path);
+  g_free (path);
+  return retval;
 }
 
 /**
@@ -138,13 +139,12 @@ AccessibleComponent_getExtents (AccessibleComponent *obj,
                                 long int *height,
                                 AccessibleCoordType ctype)
 {
+  dbus_int16_t d_ctype = ctype;
   Accessibility_BoundingBox bbox;
 
   cspi_return_if_fail (obj != NULL);
 
-  bbox = Accessibility_Component_getExtents (CSPI_OBJREF (obj),
-                                            ctype,
-                                            cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_component, "getExtents", NULL, "n=>(iiii)", d_ctype, &bbox);
   if (!cspi_check_ev ("getExtents"))
     {
       *x = *y = *width = *height = 0;    
@@ -175,12 +175,12 @@ AccessibleComponent_getPosition (AccessibleComponent *obj,
                                  long int *y,
                                  AccessibleCoordType ctype)
 {
-  CORBA_long cx, cy;
+  dbus_int32_t d_x, d_y;
+  dbus_uint16_t d_ctype = ctype;
 
   cspi_return_if_fail (obj != NULL);
 
-  Accessibility_Component_getPosition (CSPI_OBJREF (obj),
-                                      &cx, &cy, ctype, cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_component, "getPosition", NULL, "n=>ii", d_ctype, &d_x, &d_y);
 
   if (!cspi_check_ev ("getPosition"))
     {
@@ -188,8 +188,8 @@ AccessibleComponent_getPosition (AccessibleComponent *obj,
     }
   else
     {
-      *x = cx;
-      *y = cy;
+      *x = d_x;
+      *y = d_y;
     }
 }
 
@@ -207,22 +207,19 @@ AccessibleComponent_getSize (AccessibleComponent *obj,
                              long int *width,
                              long int *height)
 {
-  CORBA_long cw, ch;
+  dbus_int32_t d_w, d_h;
 
   cspi_return_if_fail (obj != NULL);
 
-  Accessibility_Component_getSize (CSPI_OBJREF (obj),
-                                   &cw,
-                                   &ch,
-                                   cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_component, "getSize", NULL, "=>ii", &d_w, &d_h);
   if (cspi_check_ev ("getSize"))
   {
     *width = *height = 0;
   }
   else
   {
-    *width = cw;
-    *height = ch;
+    *width = d_w;
+    *height = d_h;
   }
 }
 
@@ -239,12 +236,11 @@ AccessibleComponentLayer
 AccessibleComponent_getLayer (AccessibleComponent *obj)
 {
   AccessibleComponentLayer     retval;
-  Accessibility_ComponentLayer zlayer;
+  dbus_uint32_t zlayer;
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  zlayer = Accessibility_Component_getLayer (CSPI_OBJREF (obj),
-                                            cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_component, "getLayer", NULL, "=>u", &zlayer);
 
   cspi_return_val_if_ev ("getLayer", SPI_LAYER_INVALID);
 
@@ -292,12 +288,11 @@ AccessibleComponent_getLayer (AccessibleComponent *obj)
 short
 AccessibleComponent_getMDIZOrder (AccessibleComponent *obj)
 {
-  short retval;
+  dbus_uint16_t retval;
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  retval = Accessibility_Component_getMDIZOrder (CSPI_OBJREF (obj),
-                                                cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_component, "getMDIZOrder", NULL, "=>n", &retval);
 
   cspi_return_val_if_ev ("getMDIZOrder", FALSE);
 
@@ -317,12 +312,11 @@ AccessibleComponent_getMDIZOrder (AccessibleComponent *obj)
 SPIBoolean
 AccessibleComponent_grabFocus (AccessibleComponent *obj)
 {
-  SPIBoolean retval;
+  dbus_bool_t retval;
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  retval = Accessibility_Component_grabFocus (CSPI_OBJREF (obj),
-                                             cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_component, "grabFocus", NULL, "=>b", &retval);
 
   cspi_return_val_if_ev ("grabFocus", FALSE);
 
@@ -340,12 +334,11 @@ AccessibleComponent_grabFocus (AccessibleComponent *obj)
 double      
 AccessibleComponent_getAlpha    (AccessibleComponent *obj)
 {
-  SPIBoolean retval;
+  double retval;
 
   cspi_return_val_if_fail (obj != NULL, 1.0);
 
-  retval = Accessibility_Component_getAlpha (CSPI_OBJREF (obj),
-                                             cspi_ev ());
+  cspi_dbus_call (obj, spi_interface_component, "getAlpha", NULL, "=>d", &retval);
 
   cspi_return_val_if_ev ("getAlpha", 1.0);