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 * @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.]
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 * @obj: a GObject instance that implements AtkImageIface
73 * return values: a gchar* representing the image description
75 * Get a textual description of this image.
78 atk_image_get_image_description (AtkImage
*obj
)
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
);
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.
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
);
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.
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
);
154 * atk_image_set_image_description:
155 * @obj: a GObject instance that implements AtkImageIface
156 * return values: boolean TRUE, or FALSE if operation could
159 * Sets the textual description for this image.
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
);