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 <cspi/spi-private.h>
27 * AccessibleImage_ref:
28 * @obj: a pointer to the #AccessibleImage implementor on which to operate.
30 * Increment the reference count for an #AccessibleImage object.
33 AccessibleImage_ref (AccessibleImage *obj)
35 cspi_object_ref (obj);
39 * AccessibleImage_unref:
40 * @obj: a pointer to the #AccessibleImage implementor on which to operate.
42 * Decrement the reference count for an #AccessibleImage object.
45 AccessibleImage_unref (AccessibleImage *obj)
47 cspi_object_unref (obj);
51 * AccessibleImage_getImageDescription:
52 * @obj: a pointer to the #AccessibleImage implementor on which to operate.
54 * Get the description of the image displayed in an #AccessibleImage object.
56 * Returns: a UTF-8 string describing the image.
59 AccessibleImage_getImageDescription (AccessibleImage *obj)
63 cspi_return_val_if_fail (obj != NULL, NULL);
65 cspi_dbus_get_property (obj, spi_interface_image, "description", NULL, "s", &retval);
67 cspi_return_val_if_ev ("getImageDescription", NULL);
73 * AccessibleImage_getImageSize:
74 * @obj: a pointer to the #AccessibleImage to query.
75 * @width: a pointer to a #long into which the x extents (width) will be returned.
76 * @height: a pointer to a #long into which the y extents (height) will be returned.
78 * Get the size of the image displayed in a specified #AccessibleImage object.
81 AccessibleImage_getImageSize (AccessibleImage *obj,
87 cspi_return_if_fail (obj != NULL);
89 cspi_dbus_call (obj, spi_interface_image, "getImageSize", NULL, "=>ii", &w, &h);
91 if (!cspi_check_ev ("getImageSize"))
104 * AccessibleImage_getImagePosition:
105 * @obj: a pointer to the #AccessibleImage implementor to query.
106 * @x: a pointer to a #long into which the minimum x coordinate will be returned.
107 * @y: a pointer to a #long into which the minimum y coordinate will be returned.
108 * @ctype: the desired coordinate system into which to return the results,
109 * (e.g. SPI_COORD_TYPE_WINDOW, SPI_COORD_TYPE_SCREEN).
111 * Get the minimum x and y coordinates of the image displayed in a
112 * specified #AccessibleImage implementor.
115 AccessibleImage_getImagePosition (AccessibleImage *obj,
118 AccessibleCoordType ctype)
122 cspi_return_if_fail (obj != NULL);
124 cspi_dbus_call (obj, spi_interface_image, "getImagePosition", NULL, "=>ii", &dx, &dy);
126 if (!cspi_check_ev ("getImagePosition"))
139 * AccessibleImage_getImageExtents:
140 * @obj: a pointer to the #AccessibleImage implementor to query.
141 * @x: a pointer to a #long into which the minimum x coordinate will be returned.
142 * @y: a pointer to a #long into which the minimum y coordinate will be returned.
143 * @width: a pointer to a #long into which the image x extent will be returned.
144 * @height: a pointer to a #long into which the image y extent will be returned.
145 * @ctype: the desired coordinate system into which to return the results,
146 * (e.g. SPI_COORD_TYPE_WINDOW, SPI_COORD_TYPE_SCREEN).
148 * Get the bounding box of the image displayed in a
149 * specified #AccessibleImage implementor.
152 AccessibleImage_getImageExtents (AccessibleImage *obj,
157 AccessibleCoordType ctype)
159 Accessibility_BoundingBox bbox;
161 cspi_return_if_fail (obj != NULL);
163 cspi_dbus_call (obj, spi_interface_image, "getImageExtents", NULL, "=>(iiii)", &bbox);
165 if (!cspi_check_ev ("getImageExtents"))
167 *x = *y = *width = *height = 0;
174 *height = bbox.height;
179 * AccessibleImage_getImageLocale:
180 * @obj: The #AccessibleImage being queried.
182 * Get the locale associated with an image and its textual representation.
184 * Returns: A POSIX LC_MESSAGES-style Locale value for image description and text.
187 AccessibleImage_getImageLocale (AccessibleImage *obj)
191 cspi_return_val_if_fail (obj != NULL, "C");
193 cspi_dbus_get_property (obj, spi_interface_image, "imageLocale", NULL, "=>s", &retval);
195 cspi_return_val_if_ev ("getImageLocale", NULL);