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.
7 * Copyright 2010, 2011 Novell, Inc.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
25 #include "atspi-private.h"
28 * atspi_image_get_image_description:
29 * @obj: a pointer to the #AtspiImage implementor on which to operate.
31 * Gets the description of the image displayed in an #AtspiImage object.
33 * Returns: a UTF-8 string describing the image.
36 atspi_image_get_image_description (AtspiImage *obj, GError **error)
40 g_return_val_if_fail (obj != NULL, NULL);
42 _atspi_dbus_get_property (obj, atspi_interface_image, "ImageDescription", error, "s", &retval);
48 * atspi_image_get_image_size:
49 * @obj: a pointer to the #AtspiImage to query.
51 * Gets the size of the image displayed in a specified #AtspiImage object.
53 * Returns: a pointer to an #AtspiPoint where x corresponds to
54 * the image's width and y corresponds to the image's height.
58 atspi_image_get_image_size (AtspiImage *obj, GError **error)
60 dbus_int32_t d_w, d_h;
65 return atspi_point_copy (&ret);
67 _atspi_dbus_call (obj, atspi_interface_image, "GetImageSize", error, "=>ii", &d_w, &d_h);
70 return atspi_point_copy (&ret);
74 * atspi_image_get_image_position:
75 * @obj: a pointer to the #AtspiImage implementor to query.
76 * @ctype: the desired coordinate system into which to return the results,
77 * (e.g. ATSPI_COORD_TYPE_WINDOW, ATSPI_COORD_TYPE_SCREEN).
79 * Gets the minimum x and y coordinates of the image displayed in a
80 * specified #AtspiImage implementor.
82 * Returns: a pointer to an #AtspiPoint where x and y correspond to the
83 * minimum coordinates of the displayed image.
87 atspi_image_get_image_position (AtspiImage *obj,
91 dbus_int32_t d_x, d_y;
92 dbus_uint32_t d_ctype = ctype;
98 return atspi_point_copy (&ret);
100 _atspi_dbus_call (obj, atspi_interface_image, "GetImagePosition", error, "u=>ii", d_ctype, &d_x, &d_y);
104 return atspi_point_copy (&ret);
108 * atspi_image_get_image_extents:
109 * @obj: a pointer to the #AtspiImage implementor to query.
110 * @ctype: the desired coordinate system into which to return the results,
111 * (e.g. ATSPI_COORD_TYPE_WINDOW, ATSPI_COORD_TYPE_SCREEN).
113 * Gets the bounding box of the image displayed in a
114 * specified #AtspiImage implementor.
116 * Returns: a pointer to an #AtspiRect corresponding to the image's bounding box. The minimum x and y coordinates,
117 * width, and height are specified.
120 atspi_image_get_image_extents (AtspiImage *obj,
121 AtspiCoordType ctype,
124 dbus_uint32_t d_ctype = ctype;
127 bbox.x = bbox.y = bbox.width = bbox.height = -1;
128 g_return_val_if_fail (obj != NULL, atspi_rect_copy (&bbox));
130 _atspi_dbus_call (obj, atspi_interface_image, "GetImageExtents", error, "u=>(iiii)", d_ctype, &bbox);
132 return atspi_rect_copy (&bbox);
136 * atspi_image_get_image_locale:
137 * @obj: a pointer to the #AtspiImage to query.
139 * Gets the locale associated with an image and its textual representation.
141 * Returns: A POSIX LC_MESSAGES-style locale value for image description and text.
144 atspi_image_get_image_locale (AtspiImage *obj, GError **error)
146 gchar *retval = NULL;
148 g_return_val_if_fail (obj != NULL, g_strdup ("C"));
150 _atspi_dbus_get_property (obj, atspi_interface_image, "ImageLocale", error, "s", &retval);
156 atspi_image_base_init (AtspiImage *klass)
161 atspi_image_get_type (void)
163 static GType type = 0;
166 static const GTypeInfo tinfo =
169 (GBaseInitFunc) atspi_image_base_init,
170 (GBaseFinalizeFunc) NULL,
173 type = g_type_register_static (G_TYPE_INTERFACE, "AtspiImage", &tinfo, 0);