Update configure.in to create Makefile in tests directory.
[atk.git] / atk / atkimage.c
blob863210e24880f6d8249715c0d6597e7975f71b21
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.
20 #include "atkimage.h"
22 GType
23 atk_image_get_type ()
25 static GType type = 0;
27 if (!type) {
28 static const GTypeInfo tinfo =
30 sizeof (AtkImageIface),
31 NULL,
32 NULL,
36 type = g_type_register_static (G_TYPE_INTERFACE, "AtkImage", &tinfo, 0);
39 return type;
42 /**
43 * atk_image_get_storage_type:
44 * @obj: a GObject instance that implements AtkImageIface
45 * return values: a AtkStorageType representing the image storage type
47 * [maybe this method will be replaced, watch this space.]
49 **/
50 AtkImageType
51 atk_image_get_storage_type (AtkImage *obj)
53 AtkImageIface *iface;
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);
64 else
66 return 0;
70 /**
71 * atk_image_get_image_description:
72 * @obj: a GObject instance that implements AtkImageIface
73 * return values: a gchar* representing the image description
75 * Get a textual description of this image.
76 **/
77 G_CONST_RETURN gchar*
78 atk_image_get_image_description (AtkImage *obj)
80 AtkImageIface *iface;
82 g_return_val_if_fail (obj != NULL, NULL);
83 g_return_val_if_fail (ATK_IS_IMAGE (obj), NULL);
85 iface = ATK_IMAGE_GET_IFACE (obj);
87 if (iface->get_image_description)
89 return (iface->get_image_description) (obj);
91 else
93 return NULL;
97 /**
98 * atk_image_get_image_height:
99 * @obj: a GObject instance that implements AtkImageIface
100 * return values: a gint representing the image height in pixel coords
102 * Get the height, in pixels/screen coords, of this image.
105 gint
106 atk_image_get_image_height (AtkImage *obj)
108 AtkImageIface *iface;
110 g_return_val_if_fail (obj != NULL, 0);
111 g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
113 iface = ATK_IMAGE_GET_IFACE (obj);
115 if (iface->get_image_height)
117 return (iface->get_image_height) (obj);
119 else
121 return 0;
126 * atk_image_get_image_width:
127 * @obj: a GObject instance that implements AtkImageIface
128 * return values: a gint representing the image width
130 * Get the width, in pixel/screen coords, of this image.
133 gint
134 atk_image_get_image_width (AtkImage *obj)
136 AtkImageIface *iface;
138 g_return_val_if_fail (obj != NULL, 0);
139 g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
141 iface = ATK_IMAGE_GET_IFACE (obj);
143 if (iface->get_image_width)
145 return (iface->get_image_width) (obj);
147 else
149 return 0;
154 * atk_image_set_image_description:
155 * @obj: a GObject instance that implements AtkImageIface
156 * return values: boolean TRUE, or FALSE if operation could
157 * not be completed.
159 * Sets the textual description for this image.
162 gboolean
163 atk_image_set_image_description (AtkImage *obj,
164 const gchar *description)
166 AtkImageIface *iface;
168 g_return_val_if_fail (obj != NULL, FALSE);
169 g_return_val_if_fail (ATK_IS_IMAGE (obj), FALSE);
171 iface = ATK_IMAGE_GET_IFACE (obj);
173 if (iface->set_image_description)
175 return (iface->set_image_description) (obj, description);
177 else
179 return FALSE;