Changed IDL for State, Component, and Image to reduce use of out params.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_image.c
index 8c970e1..c351ecf 100644 (file)
@@ -12,7 +12,7 @@
 int
 AccessibleImage_ref (AccessibleImage *obj)
 {
-  Accessibility_Image_ref (*obj, spi_ev ());
+  cspi_object_ref (obj);
   return 0;
 }
 
@@ -30,7 +30,7 @@ AccessibleImage_ref (AccessibleImage *obj)
 int
 AccessibleImage_unref (AccessibleImage *obj)
 {
-  Accessibility_Image_unref (*obj, spi_ev ());
+  cspi_object_unref (obj);
   return 0;
 }
 
@@ -48,7 +48,7 @@ char *
 AccessibleImage_getImageDescription (AccessibleImage *obj)
 {
   return (char *)
-    Accessibility_Image__get_imageDescription (*obj, spi_ev ());
+    Accessibility_Image__get_imageDescription (CSPI_OBJREF (obj), cspi_ev ());
 }
 
 
@@ -67,8 +67,8 @@ AccessibleImage_getImageSize (AccessibleImage *obj,
                               long int *width,
                               long int *height)
 {
-  Accessibility_Image_getImageSize (*obj,
-                                   (CORBA_long *) width, (CORBA_long *) height, spi_ev ());
+  Accessibility_Image_getImageSize (CSPI_OBJREF (obj),
+                                   (CORBA_long *) width, (CORBA_long *) height, cspi_ev ());
 }
 
 
@@ -91,7 +91,39 @@ AccessibleImage_getImagePosition (AccessibleImage *obj,
                                   long *y,
                                   AccessibleCoordType ctype)
 {
-  Accessibility_Image_getImagePosition (*obj,
+  Accessibility_Image_getImagePosition (CSPI_OBJREF (obj),
                                        (CORBA_long *) x, (CORBA_long *) y, (CORBA_short) ctype,
-                                       spi_ev ());
+                                       cspi_ev ());
+}
+
+/**
+ * AccessibleImage_getImageExtents:
+ * @obj: a pointer to the #AccessibleImage implementor to query.
+ * @x: a pointer to a #long into which the minimum x coordinate will be returned.
+ * @y: a pointer to a #long into which the minimum y coordinate will be returned.
+ * @width: a pointer to a #long into which the image x extent will be returned.
+ * @width: a pointer to a #long into which the image y extent will be returned.
+ * @ctype: the desired coordinate system into which to return the results,
+ *         (e.g. SPI_COORD_TYPE_WINDOW, SPI_COORD_TYPE_SCREEN).
+ *
+ * Get the bounding box of the image displayed in a
+ *         specified #AccessibleImage implementor.
+ *
+ **/
+void
+AccessibleImage_getImageExtents (AccessibleImage *obj,
+                                long *x,
+                                long *y,
+                                long *width,
+                                long *height,
+                                AccessibleCoordType ctype)
+{
+  Accessibility_BoundingBox bbox;      
+  bbox = Accessibility_Image_getImageExtents (CSPI_OBJREF (obj),
+                                             (CORBA_short) ctype,
+                                             cspi_ev ());
+  *x = bbox.x;
+  *y = bbox.y;
+  *width = bbox.width;
+  *height = bbox.height;
 }