7b4d6a462b13acb7b825c26c26f4b1588326db8e
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_image.c
1 #include <cspi/spi-private.h>
2
3 /**
4  * AccessibleImage_ref:
5  * @obj: a pointer to the #AccessibleImage implementor on which to operate.
6  *
7  * Increment the reference count for an #AccessibleImage object.
8  *
9  * Returns: (no return code implemented yet).
10  *
11  **/
12 int
13 AccessibleImage_ref (AccessibleImage *obj)
14 {
15   cspi_object_ref (obj);
16   return 0;
17 }
18
19
20
21 /**
22  * AccessibleImage_unref:
23  * @obj: a pointer to the #AccessibleImage implementor on which to operate.
24  *
25  * Decrement the reference count for an #AccessibleImage object.
26  *
27  * Returns: (no return code implemented yet).
28  *
29  **/
30 int
31 AccessibleImage_unref (AccessibleImage *obj)
32 {
33   cspi_object_unref (obj);
34   return 0;
35 }
36
37
38 /**
39  * AccessibleImage_getImageDescription:
40  * @obj: a pointer to the #AccessibleImage implementor on which to operate.
41  *
42  * Get the description of the image displayed in an #AccessibleImage object.
43  *
44  * Returns: a UTF-8 string describing the image.
45  *
46  **/
47 char *
48 AccessibleImage_getImageDescription (AccessibleImage *obj)
49 {
50   return (char *)
51     Accessibility_Image__get_imageDescription (CSPI_OBJREF (obj), cspi_ev ());
52 }
53
54
55
56 /**
57  * AccessibleImage_getImageSize:
58  * @obj: a pointer to the #AccessibleImage to query.
59  * @width: a pointer to a #long into which the x extents (width) will be returned.
60  * @height: a pointer to a #long into which the y extents (height) will be returned.
61  *
62  * Get the size of the image displayed in a specified #AccessibleImage object.
63  *
64  **/
65 void
66 AccessibleImage_getImageSize (AccessibleImage *obj,
67                               long int *width,
68                               long int *height)
69 {
70   Accessibility_Image_getImageSize (CSPI_OBJREF (obj),
71                                     (CORBA_long *) width, (CORBA_long *) height, cspi_ev ());
72 }
73
74
75
76 /**
77  * AccessibleImage_getImagePosition:
78  * @obj: a pointer to the #AccessibleImage implementor to query.
79  * @x: a pointer to a #long into which the minimum x coordinate will be returned.
80  * @y: a pointer to a #long into which the minimum y coordinate will be returned.
81  * @ctype: the desired coordinate system into which to return the results,
82  *         (e.g. SPI_COORD_TYPE_WINDOW, SPI_COORD_TYPE_SCREEN).
83  *
84  * Get the minimum x and y coordinates of the image displayed in a
85  *         specified #AccessibleImage implementor.
86  *
87  **/
88 void
89 AccessibleImage_getImagePosition (AccessibleImage *obj,
90                                   long *x,
91                                   long *y,
92                                   AccessibleCoordType ctype)
93 {
94   Accessibility_Image_getImagePosition (CSPI_OBJREF (obj),
95                                         (CORBA_long *) x, (CORBA_long *) y, (CORBA_short) ctype,
96                                         cspi_ev ());
97 }
98
99 /**
100  * AccessibleImage_getImageExtents:
101  * @obj: a pointer to the #AccessibleImage implementor to query.
102  * @x: a pointer to a #long into which the minimum x coordinate will be returned.
103  * @y: a pointer to a #long into which the minimum y coordinate will be returned.
104  * @width: a pointer to a #long into which the image x extent will be returned.
105  * @height: a pointer to a #long into which the image y extent will be returned.
106  * @ctype: the desired coordinate system into which to return the results,
107  *         (e.g. SPI_COORD_TYPE_WINDOW, SPI_COORD_TYPE_SCREEN).
108  *
109  * Get the bounding box of the image displayed in a
110  *         specified #AccessibleImage implementor.
111  *
112  **/
113 void
114 AccessibleImage_getImageExtents (AccessibleImage *obj,
115                                  long *x,
116                                  long *y,
117                                  long *width,
118                                  long *height,
119                                  AccessibleCoordType ctype)
120 {
121   Accessibility_BoundingBox bbox;       
122   bbox = Accessibility_Image_getImageExtents (CSPI_OBJREF (obj),
123                                               (CORBA_short) ctype,
124                                               cspi_ev ());
125   *x = bbox.x;
126   *y = bbox.y;
127   *width = bbox.width;
128   *height = bbox.height;
129 }