-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
/**
* 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;
}
}
**/
gboolean
atk_image_set_image_description (AtkImage *image,
- const gchar *description)
+ const gchar *description)
{
AtkImageIface *iface;
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));
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
{
*y = -1;
}
}
-
-
-
-
-
-
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);
};
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);