2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001, 2002 Sun Microsystems Inc.,
6 * Copyright 2001, 2002 Ximian, Inc.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 #include "atspi-private.h"
27 * atspi_image_get_image_description:
28 * @obj: a pointer to the #AtspiImage implementor on which to operate.
30 * Get the description of the image displayed in an #AtspiImage object.
32 * Returns: a UTF-8 string describing the image.
35 atspi_image_get_image_description (AtspiImage *obj, GError **error)
39 g_return_val_if_fail (obj != NULL, NULL);
41 _atspi_dbus_get_property (obj, atspi_interface_image, "ImageDescription", error, "s", &retval);
47 * atspi_image_get_image_size:
48 * @obj: a pointer to the #AtspiImage to query.
50 * Get the size of the image displayed in a specified #AtspiImage object.
53 atspi_image_get_image_size (AtspiImage *obj, GError **error)
55 dbus_int32_t d_w, d_h;
60 return atspi_point_copy (&ret);
62 _atspi_dbus_call (obj, atspi_interface_image, "GetImageSize", error, "=>ii", &d_w, &d_h);
65 return atspi_point_copy (&ret);
69 * atspi_image_get_image_position:
70 * @obj: a pointer to the #AtspiImage implementor to query.
71 * @ctype: the desired coordinate system into which to return the results,
72 * (e.g. ATSPI_COORD_TYPE_WINDOW, ATSPI_COORD_TYPE_SCREEN).
74 * Get the minimum x and y coordinates of the image displayed in a
75 * specified #AtspiImage implementor.
78 atspi_image_get_image_position (AtspiImage *obj,
82 dbus_int32_t d_x, d_y;
83 dbus_uint16_t d_ctype = ctype;
89 return atspi_point_copy (&ret);
91 _atspi_dbus_call (obj, atspi_interface_image, "GetImagePosition", error, "u=>ii", d_ctype, &d_x, &d_y);
95 return atspi_point_copy (&ret);
99 * atspi_image_get_image_extents:
100 * @obj: a pointer to the #AtspiImage implementor to query.
101 * @ctype: the desired coordinate system into which to return the results,
102 * (e.g. ATSPI_COORD_TYPE_WINDOW, ATSPI_COORD_TYPE_SCREEN).
104 * Get the bounding box of the image displayed in a
105 * specified #AtspiImage implementor.
108 atspi_image_get_image_extents (AtspiImage *obj,
109 AtspiCoordType ctype,
112 dbus_uint32_t d_ctype = ctype;
115 bbox.x = bbox.y = bbox.width = bbox.height = -1;
116 g_return_val_if_fail (obj != NULL, atspi_rect_copy (&bbox));
118 _atspi_dbus_call (obj, atspi_interface_image, "GetImageExtents", error, "u=>(iiii)", d_ctype, &bbox);
120 return atspi_rect_copy (&bbox);
124 * atspi_image_get_image_locale:
125 * @obj: The #AtspiImage being queried.
127 * Get the locale associated with an image and its textual representation.
129 * Returns: A POSIX LC_MESSAGES-style Locale value for image description and text.
132 atspi_image_get_image_locale (AtspiImage *obj, GError **error)
134 gchar *retval = NULL;
136 g_return_val_if_fail (obj != NULL, g_strdup ("C"));
138 _atspi_dbus_get_property (obj, atspi_interface_image, "ImageLocale", error, "s", &retval);
144 atspi_image_base_init (AtspiImage *klass)
149 atspi_image_get_type (void)
151 static GType type = 0;
154 static const GTypeInfo tinfo =
157 (GBaseInitFunc) atspi_image_base_init,
158 (GBaseFinalizeFunc) NULL,
161 type = g_type_register_static (G_TYPE_INTERFACE, "AtspiImage", &tinfo, 0);