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),
36 type = g_type_register_static (G_TYPE_INTERFACE, "AtkImage", &tinfo, 0);
43 * atk_image_get_storage_type:
44 * @image: a #GObject instance that implements AtkImageIface
46 * Gets the type of representation being used to store image data
48 * Returns: an #AtkStorageType representing the image storage type
51 atk_image_get_storage_type (AtkImage *obj)
55 g_return_val_if_fail (obj != NULL, 0);
56 g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
58 iface = ATK_IMAGE_GET_IFACE (obj);
60 if (iface->get_storage_type)
62 return (iface->get_storage_type) (obj);
71 * atk_image_get_image_description:
72 * @image: a #GObject instance that implements AtkImageIface
74 * Get a textual description of this image.
76 * Returns: a string representing the image description
79 atk_image_get_image_description (AtkImage *obj)
83 g_return_val_if_fail (obj != NULL, NULL);
84 g_return_val_if_fail (ATK_IS_IMAGE (obj), NULL);
86 iface = ATK_IMAGE_GET_IFACE (obj);
88 if (iface->get_image_description)
90 return (iface->get_image_description) (obj);
99 * atk_image_get_image_height:
100 * @image: a #GObject instance that implements AtkImageIface
102 * Get the height, in pixels/screen coords, of this image.
104 * Returns: an integer representing the image height in pixel coords
107 atk_image_get_image_height (AtkImage *obj)
109 AtkImageIface *iface;
111 g_return_val_if_fail (obj != NULL, 0);
112 g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
114 iface = ATK_IMAGE_GET_IFACE (obj);
116 if (iface->get_image_height)
118 return (iface->get_image_height) (obj);
127 * atk_image_get_image_width:
128 * @image: a #GObject instance that implements AtkImageIface
130 * Get the width, in pixel/screen coords, of this image.
132 * Returns: an integer representing the image width
135 atk_image_get_image_width (AtkImage *obj)
137 AtkImageIface *iface;
139 g_return_val_if_fail (obj != NULL, 0);
140 g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
142 iface = ATK_IMAGE_GET_IFACE (obj);
144 if (iface->get_image_width)
146 return (iface->get_image_width) (obj);
155 * atk_image_set_image_description:
156 * @image: a #GObject instance that implements AtkImageIface
157 * @description: a string desciption to set for @image
159 * Sets the textual description for this image.
161 * Returns: boolean TRUE, or FALSE if operation could
165 atk_image_set_image_description (AtkImage *obj,
166 const gchar *description)
168 AtkImageIface *iface;
170 g_return_val_if_fail (obj != NULL, FALSE);
171 g_return_val_if_fail (ATK_IS_IMAGE (obj), FALSE);
173 iface = ATK_IMAGE_GET_IFACE (obj);
175 if (iface->set_image_description)
177 return (iface->set_image_description) (obj, description);