Improved gtk-doc comments.
[platform/upstream/atk.git] / atk / atkimage.c
1 /* ATK -  Accessibility Toolkit
2  * Copyright 2001 Sun Microsystems Inc.
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 #include "atkimage.h"
21
22 GType
23 atk_image_get_type ()
24 {
25   static GType type = 0;
26
27   if (!type) {
28     static const GTypeInfo tinfo =
29     {
30       sizeof (AtkImageIface),
31       NULL,
32       NULL,
33
34     };
35
36     type = g_type_register_static (G_TYPE_INTERFACE, "AtkImage", &tinfo, 0);
37   }
38
39   return type;
40 }
41
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
46  *
47  * [maybe this method will be replaced, watch this space.]
48  *
49  **/
50 AtkImageType
51 atk_image_get_storage_type (AtkImage *obj)
52 {
53   AtkImageIface *iface;
54
55   g_return_val_if_fail (obj != NULL, 0);
56   g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
57
58   iface = ATK_IMAGE_GET_IFACE (obj);
59
60   if (iface->get_storage_type)
61     {
62       return (iface->get_storage_type) (obj);
63     }
64   else
65     {
66       return 0;
67     }
68 }
69
70 /**
71  * atk_image_get_image_description:
72  * @obj: a GObject instance that implements AtkImageIface
73  * return values: a gchar* representing the image description
74  *
75  * Get a textual description of this image.
76  **/
77 G_CONST_RETURN gchar*
78 atk_image_get_image_description (AtkImage *obj)
79 {
80   AtkImageIface *iface;
81
82   g_return_val_if_fail (obj != NULL, NULL);
83   g_return_val_if_fail (ATK_IS_IMAGE (obj), NULL);
84
85   iface = ATK_IMAGE_GET_IFACE (obj);
86
87   if (iface->get_image_description)
88     {
89       return (iface->get_image_description) (obj);
90     }
91   else
92     {
93       return NULL;
94     }
95 }
96
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
101  *
102  * Get the height, in pixels/screen coords, of this image.
103  *
104  **/
105 gint
106 atk_image_get_image_height (AtkImage *obj)
107 {
108   AtkImageIface *iface;
109
110   g_return_val_if_fail (obj != NULL, 0);
111   g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
112
113   iface = ATK_IMAGE_GET_IFACE (obj);
114
115   if (iface->get_image_height)
116     {
117       return (iface->get_image_height) (obj);
118     }
119   else
120     {
121       return 0;
122     }
123 }
124
125 /**
126  * atk_image_get_image_width:
127  * @obj: a GObject instance that implements AtkImageIface
128  * return values: a gint representing the image width
129  *
130  * Get the width, in pixel/screen coords, of this image.
131  *
132  **/
133 gint
134 atk_image_get_image_width (AtkImage *obj)
135 {
136   AtkImageIface *iface;
137
138   g_return_val_if_fail (obj != NULL, 0);
139   g_return_val_if_fail (ATK_IS_IMAGE (obj), 0);
140
141   iface = ATK_IMAGE_GET_IFACE (obj);
142
143   if (iface->get_image_width)
144     {
145       return (iface->get_image_width) (obj);
146     }
147   else
148     {
149       return 0;
150     }
151 }
152
153 /**
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.
158  *
159  * Sets the textual description for this image.
160  *
161  **/
162 gboolean
163 atk_image_set_image_description (AtkImage        *obj,
164                               const gchar     *description)
165 {
166   AtkImageIface *iface;
167
168   g_return_val_if_fail (obj != NULL, FALSE);
169   g_return_val_if_fail (ATK_IS_IMAGE (obj), FALSE);
170
171   iface = ATK_IMAGE_GET_IFACE (obj);
172
173   if (iface->set_image_description)
174     {
175       return (iface->set_image_description) (obj, description);
176     }
177   else
178     {
179       return FALSE;
180     }
181 }