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
47 * [maybe this method will be replaced, watch this space.]
49 * Returns: a AtkStorageType representing the image storage type
52 atk_image_get_storage_type (AtkImage *obj)
56 g_return_val_if_fail (obj != NULL, 0);
57 g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
59 iface = ATK_IMAGE_GET_IFACE (obj);
61 if (iface->get_storage_type)
63 return (iface->get_storage_type) (obj);
72 * atk_image_get_image_description:
73 * @image: a GObject instance that implements AtkImageIface
75 * Get a textual description of this image.
77 * Returns: a gchar* representing the image description
80 atk_image_get_image_description (AtkImage *obj)
84 g_return_val_if_fail (obj != NULL, NULL);
85 g_return_val_if_fail (ATK_IS_IMAGE (obj), NULL);
87 iface = ATK_IMAGE_GET_IFACE (obj);
89 if (iface->get_image_description)
91 return (iface->get_image_description) (obj);
100 * atk_image_get_image_height:
101 * @image: a GObject instance that implements AtkImageIface
103 * Get the height, in pixels/screen coords, of this image.
105 * Returns: a gint representing the image height in pixel coords
108 atk_image_get_image_height (AtkImage *obj)
110 AtkImageIface *iface;
112 g_return_val_if_fail (obj != NULL, 0);
113 g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
115 iface = ATK_IMAGE_GET_IFACE (obj);
117 if (iface->get_image_height)
119 return (iface->get_image_height) (obj);
128 * atk_image_get_image_width:
129 * @image: a GObject instance that implements AtkImageIface
131 * Get the width, in pixel/screen coords, of this image.
133 * Returns: a gint representing the image width
136 atk_image_get_image_width (AtkImage *obj)
138 AtkImageIface *iface;
140 g_return_val_if_fail (obj != NULL, 0);
141 g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
143 iface = ATK_IMAGE_GET_IFACE (obj);
145 if (iface->get_image_width)
147 return (iface->get_image_width) (obj);
156 * atk_image_set_image_description:
157 * @image: a GObject instance that implements AtkImageIface
158 * @description: a #gchar desciption to set for @image
160 * Sets the textual description for this image.
162 * Returns: boolean TRUE, or FALSE if operation could
166 atk_image_set_image_description (AtkImage *obj,
167 const gchar *description)
169 AtkImageIface *iface;
171 g_return_val_if_fail (obj != NULL, FALSE);
172 g_return_val_if_fail (ATK_IS_IMAGE (obj), FALSE);
174 iface = ATK_IMAGE_GET_IFACE (obj);
176 if (iface->set_image_description)
178 return (iface->set_image_description) (obj, description);