1 /* ATK - Accessibility Toolkit
2 * Copyright 2001 Sun Microsystems Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
25 static GType type = 0;
28 static const GTypeInfo tinfo =
30 sizeof (AtkImageIface),
32 (GBaseFinalizeFunc) NULL
35 type = g_type_register_static (G_TYPE_INTERFACE, "AtkImage", &tinfo, 0);
42 * atk_image_get_image_description:
43 * @image: a #GObject instance that implements AtkImageIface
45 * Get a textual description of this image.
47 * Returns: a string representing the image description
50 atk_image_get_image_description (AtkImage *image)
54 g_return_val_if_fail (ATK_IS_IMAGE (image), NULL);
56 iface = ATK_IMAGE_GET_IFACE (image);
58 if (iface->get_image_description)
60 return (iface->get_image_description) (image);
69 * atk_image_get_image_size:
70 * @image: a #GObject instance that implements AtkImageIface
71 * @width: filled with the image width
72 * @height: filled with the image height
74 * Get the width and height in pixels for the specified image.
75 * The values of @width and @height are returned as -1 if the
76 * values cannot be obtained.
79 atk_image_get_image_size (AtkImage *image,
84 gint local_width, local_height;
85 gint *real_width, *real_height;
87 g_return_if_fail (ATK_IS_IMAGE (image));
92 real_width = &local_width;
96 real_height = &local_height;
98 iface = ATK_IMAGE_GET_IFACE (image);
100 if (iface->get_image_size)
102 iface->get_image_size (image, real_width, real_height);
112 * atk_image_set_image_description:
113 * @image: a #GObject instance that implements AtkImageIface
114 * @description: a string description to set for @image
116 * Sets the textual description for this image.
118 * Returns: boolean TRUE, or FALSE if operation could
122 atk_image_set_image_description (AtkImage *image,
123 const gchar *description)
125 AtkImageIface *iface;
127 g_return_val_if_fail (ATK_IS_IMAGE (image), FALSE);
129 iface = ATK_IMAGE_GET_IFACE (image);
131 if (iface->set_image_description)
133 return (iface->set_image_description) (image, description);
142 * atk_image_get_image_position:
143 * @image: a #GObject instance that implements AtkImageIface
144 * @x: address of #gint to put x coordinate position
145 * @y: address of #gint to put y coordinate position
146 * @coord_type: specifies whether the coordinates are relative to the screen
147 * or to the components top level window
149 * Gets the position of the image in the form of a point specifying the
150 * images top-left corner. The values of @x and @y are returned as -1
151 * if the values cannot be obtained.
154 atk_image_get_image_position (AtkImage *image,
157 AtkCoordType coord_type)
159 AtkImageIface *iface;
160 gint local_x, local_y;
161 gint *real_x, *real_y;
163 g_return_if_fail (ATK_IS_IMAGE (image));
174 iface = ATK_IMAGE_GET_IFACE (image);
176 g_return_if_fail (ATK_IS_IMAGE (image));
178 iface = ATK_IMAGE_GET_IFACE (image);
180 if (iface->get_image_position)
182 (iface->get_image_position) (image, real_x, real_y, coord_type);