Swap height and width arguments to atk_image_get_image_size Swap height EA_1_0
authorPadraig O'Briain <padraigo@src.gnome.org>
Mon, 20 Aug 2001 08:35:46 +0000 (08:35 +0000)
committerPadraig O'Briain <padraigo@src.gnome.org>
Mon, 20 Aug 2001 08:35:46 +0000 (08:35 +0000)
* docs/tmpl/atkimage.sgml atk/atkimage.h:
Swap height and width arguments to atk_image_get_image_size
* atk/atkimage.c:
Swap height and height arguments to atk_image_get_image_size
Do not crash if NULL pointers are passed for return values

ChangeLog
atk/atkimage.c
atk/atkimage.h
docs/tmpl/atkimage.sgml

index 2cd8640..7a08c03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,8 @@
-2001-08-17  Padraig O'Briain  <padraig.obriain@sun.com>
+2001-08-20  Padraig O'Briain  <padraig.obriain@sun.com>
 
-       * docs/tmpl/atkimage.sgml atk/atktext.h:
+       * docs/tmpl/atkimage.sgml atk/atkimage.h:
        Swap height and width arguments to atk_image_get_image_size
-       * atk/atktext.c:
+       * atk/atkimage.c:
        Swap height and height arguments to atk_image_get_image_size
        Do not crash if NULL pointers are passed for return values
 
index 5a3000a..c8a719d 100755 (executable)
@@ -69,30 +69,43 @@ atk_image_get_image_description (AtkImage *image)
 /**
  * atk_image_get_image_size:
  * @image: a #GObject instance that implements AtkImageIface
- * @height: filled with the image height
  * @width: filled with the image width
+ * @height: filled with the image height
  *
- * Get the height and width in pixels for the specified image.
- * The values of @height and @width are returned as -1 if the
+ * Get the wdith and height in pixels for the specified image.
+ * The values of @width and @height are returned as -1 if the
  * values cannot be obtained.
  **/
 void
-atk_image_get_image_size (AtkImage *image, int *height, int *width)
+atk_image_get_image_size (AtkImage *image, 
+                          int      *width,
+                          int      *height)
 {
   AtkImageIface *iface;
+  gint local_width, local_height;
+  gint *real_width, *real_height;
 
   g_return_if_fail (ATK_IS_IMAGE (image));
 
+  if (width)
+    real_width = width;
+  else
+    real_width = &local_width;
+  if (height)
+    real_height = height;
+  else
+    real_height = &local_height;
+  
   iface = ATK_IMAGE_GET_IFACE (image);
 
   if (iface->get_image_size)
   {
-    iface->get_image_size (image, height, width);
+    iface->get_image_size (image, real_width, real_height);
   }
   else
   {
-    *height = -1;
     *width = -1;
+    *height = -1;
   }
 }
 
@@ -108,7 +121,7 @@ atk_image_get_image_size (AtkImage *image, int *height, int *width)
  **/
 gboolean
 atk_image_set_image_description (AtkImage        *image,
-                              const gchar     *description)
+                                 const gchar     *description)
 {
   AtkImageIface *iface;
 
@@ -145,6 +158,21 @@ atk_image_get_image_position (AtkImage *image,
                        AtkCoordType coord_type)
 {
   AtkImageIface *iface;
+  gint local_x, local_y;
+  gint *real_x, *real_y;
+
+  g_return_if_fail (ATK_IS_IMAGE (image));
+
+  if (x)
+    real_x = x;
+  else
+    real_x = &local_x;
+  if (y)
+    real_y = y;
+  else
+    real_y = &local_y;
+  
+  iface = ATK_IMAGE_GET_IFACE (image);
 
   g_return_if_fail (ATK_IS_IMAGE (image));
 
@@ -152,7 +180,7 @@ atk_image_get_image_position (AtkImage *image,
 
   if (iface->get_image_position)
   {
-    (iface->get_image_position) (image, x, y, coord_type);
+    (iface->get_image_position) (image, real_x, real_y, coord_type);
   }
   else
   {
@@ -160,9 +188,3 @@ atk_image_get_image_position (AtkImage *image,
     *y = -1;
   }
 }
-
-
-
-
-
-
index 4e02c90..24e0b08 100755 (executable)
@@ -53,8 +53,8 @@ struct _AtkImageIface
                                                   AtkCoordType          coord_type);
   G_CONST_RETURN gchar* ( *get_image_description) (AtkImage              *image);
   void                  ( *get_image_size)        (AtkImage              *image,
-                                                   gint                  *height,
-                                                   gint                  *width);
+                                                   gint                  *width,
+                                                   gint                  *height);
   gboolean              ( *set_image_description) (AtkImage              *image,
                                                    const gchar           *description);
 };
@@ -64,8 +64,8 @@ GType  atk_image_get_type             (void);
 G_CONST_RETURN gchar* atk_image_get_image_description (AtkImage   *image);
 
 void     atk_image_get_image_size        (AtkImage           *image,
-                                          gint               *height,
-                                          gint               *width);
+                                          gint               *width,
+                                          gint               *height);
 
 gboolean atk_image_set_image_description (AtkImage           *image,
                                           const gchar       *description);
index 4a0bb76..8d0a6bc 100644 (file)
@@ -69,7 +69,7 @@ an assistive technology to get descriptive information about images.
 </para>
 
 @image: 
-@height: 
 @width: 
+@height: