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,
36 type = g_type_register_static (G_TYPE_INTERFACE, "AtkImage", &tinfo, 0);
43 * atk_image_get_image_description:
44 * @image: a #GObject instance that implements AtkImageIface
46 * Get a textual description of this image.
48 * Returns: a string representing the image description
51 atk_image_get_image_description (AtkImage *image)
55 g_return_val_if_fail (ATK_IS_IMAGE (image), NULL);
57 iface = ATK_IMAGE_GET_IFACE (image);
59 if (iface->get_image_description)
61 return (iface->get_image_description) (image);
70 * atk_image_get_image_size:
71 * @image: a #GObject instance that implements AtkImageIface
72 * @height: filled with the image height
73 * @width: filled with the image width
75 * Get the height and width in pixels for the specified image.
78 atk_image_get_image_size (AtkImage *image, int *height, int *width)
82 g_return_if_fail (ATK_IS_IMAGE (image));
84 iface = ATK_IMAGE_GET_IFACE (image);
86 if (iface->get_image_size)
87 iface->get_image_size (image, height, width);
91 * atk_image_set_image_description:
92 * @image: a #GObject instance that implements AtkImageIface
93 * @description: a string description to set for @image
95 * Sets the textual description for this image.
97 * Returns: boolean TRUE, or FALSE if operation could
101 atk_image_set_image_description (AtkImage *image,
102 const gchar *description)
104 AtkImageIface *iface;
106 g_return_val_if_fail (ATK_IS_IMAGE (image), FALSE);
108 iface = ATK_IMAGE_GET_IFACE (image);
110 if (iface->set_image_description)
112 return (iface->set_image_description) (image, description);
121 * atk_image_get_position:
122 * @image: a #GObject instance that implements AtkImageIface
123 * @x: address of #gint to put x coordinate position
124 * @y: address of #gint to put y coordinate position
125 * @coord_type: specifies whether the coordinates are relative to the screen
126 * or to the components top level window
128 * Gets the position of the image in the form of a point specifying the
129 * images top-left corner
132 atk_image_get_position (AtkImage *image,
135 AtkCoordType coord_type)
137 AtkImageIface *iface;
139 g_return_if_fail (ATK_IS_IMAGE (image));
141 iface = ATK_IMAGE_GET_IFACE (image);
143 if (iface->get_position)
144 (iface->get_position) (image, x, y, coord_type);