Renamed SpiAccessibleEventListener to (just) SpiEventListener.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_component.c
1 /*
2  *
3  * AccessibleComponent function implementations
4  *
5  */
6
7 /**
8  * AccessibleComponent_ref:
9  * @obj: a pointer to an object implementing #AccessibleComponent on which to operate.
10  *
11  * Increment the reference count for an #AccessibleComponent.
12  *
13  * Returns: (no return code implemented yet).
14  *
15  **/
16 int
17 AccessibleComponent_ref (AccessibleComponent *obj)
18 {
19   Accessibility_Component_ref (*obj, &ev);
20   return 0;
21 }
22
23 /**
24  * AccessibleComponent_unref:
25  * @obj: a pointer to the object implementing #AccessibleComponent on which to operate.
26  *
27  * Decrement the reference count for an #AccessibleComponent.
28  *
29  * Returns: (no return code implemented yet).
30  *
31  **/
32 int
33 AccessibleComponent_unref (AccessibleComponent *obj)
34 {
35   Accessibility_Component_unref (*obj, &ev);
36   return 0;
37 }
38
39 /**
40  * AccessibleComponent_contains:
41  * @obj: a pointer to the #AccessibleComponent to query.
42  * @x: a #long specifying the x coordinate in question.
43  * @y: a #long specifying the y coordinate in question.
44  * @ctype: the desired coordinate system of the point (@x, @y)
45  *         (e.g. SPI_COORD_TYPE_WINDOW, SPI_COORD_TYPE_SCREEN).
46  *
47  * Query whether a given #AccessibleComponent contains a particular point.
48  *
49  * Returns: a #TRUE if the specified component contains the point (@x, @y),
50  *          otherwise #FALSE.
51  **/
52 boolean
53 AccessibleComponent_contains (AccessibleComponent *obj,
54                               long int x,
55                               long int y,
56                               AccessibleCoordType ctype)
57 {
58   return Accessibility_Component_contains (*obj,
59                                            (CORBA_long) x,
60                                            (CORBA_long) y,
61                                            ctype,
62                                            &ev);
63 }
64
65 /**
66  * AccessibleComponent_getAccessibleAtPoint:
67  * @obj: a pointer to the #AccessibleComponent to query.
68  * @x: a #long specifying the x coordinate of the point in question.
69  * @y: a #long specifying the y coordinate of the point in question.
70  * @ctype: the coordinate system of the point (@x, @y)
71  *         (e.g. SPI_COORD_TYPE_WINDOW, SPI_COORD_TYPE_SCREEN).
72  *
73  * Get the accessible child at a given coordinate within an #AccessibleComponent.
74  *
75  * Returns: a pointer to an #Accessible child of the specified component which
76  *          contains the point (@x, @y), or NULL of no child contains the point.
77  **/
78 Accessible *
79 AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
80                                           long int x,
81                                           long int y,
82                                           AccessibleCoordType ctype)
83 {
84   Accessible child;
85   child = Accessibility_Component_getAccessibleAtPoint(*obj,
86                                                        (CORBA_long) x,
87                                                        (CORBA_long) y,
88                                                        ctype,
89                                                        &ev);
90   return (child != NULL) ? Obj_Add (child) : NULL;
91 }
92
93 /**
94  * AccessibleComponent_getExtents:
95  * @obj: a pointer to the #AccessibleComponent to query.
96  * @x: a pointer to a #long into which the minimum x coordinate will be returned.
97  * @y: a pointer to a #long into which the minimum y coordinate will be returned.
98  * @width: a pointer to a #long into which the x extents (width) will be returned.
99  * @height: a pointer to a #long into which the y extents (height) will be returned.
100  * @ctype: the desired coordinate system into which to return the results,
101  *         (e.g. SPI_COORD_TYPE_WINDOW, SPI_COORD_TYPE_SCREEN).
102  *
103  * Get the bounding box of the specified #AccessibleComponent.
104  *
105  **/
106 void
107 AccessibleComponent_getExtents (AccessibleComponent *obj,
108                                 long int *x,
109                                 long int *y,
110                                 long int *width,
111                                 long int *height,
112                                 AccessibleCoordType ctype)
113 {
114   CORBA_long cx, cy, cw, ch;    
115   Accessibility_Component_getExtents (*obj,
116                                       &cx,
117                                       &cy,
118                                       &cw,
119                                       &ch,
120                                       ctype,
121                                       &ev);
122   spi_warn_ev (&ev, "AccessibleComponent_getExtents");
123   *x = (long) cx;
124   *y = (long) cy;
125   *width = (long) cw;
126   *height = (long) ch;
127 }
128
129 /**
130  * AccessibleComponent_getPosition:
131  * @obj: a pointer to the #AccessibleComponent to query.
132  * @x: a pointer to a #long into which the minimum x coordinate will be returned.
133  * @y: a pointer to a #long into which the minimum y coordinate will be returned.
134  * @ctype: the desired coordinate system into which to return the results,
135  *         (e.g. SPI_COORD_TYPE_WINDOW, SPI_COORD_TYPE_SCREEN).
136  *
137  * Get the minimum x and y coordinates of the specified #AccessibleComponent.
138  *
139  **/
140 void
141 AccessibleComponent_getPosition (AccessibleComponent *obj,
142                                  long int *x,
143                                  long int *y,
144                                  AccessibleCoordType ctype)
145 {
146   Accessibility_Component_getPosition (*obj,
147                                        (CORBA_long *) x,
148                                        (CORBA_long *) y,
149                                        ctype,
150                                        &ev);
151 }
152
153 /**
154  * AccessibleComponent_getSize:
155  * @obj: a pointer to the #AccessibleComponent to query.
156  * @width: a pointer to a #long into which the x extents (width) will be returned.
157  * @height: a pointer to a #long into which the y extents (height) will be returned.
158  *
159  * Get the size of the specified #AccessibleComponent.
160  *
161  **/
162 void
163 AccessibleComponent_getSize (AccessibleComponent *obj,
164                              long int *width,
165                              long int *height)
166 {
167   Accessibility_Component_getSize (*obj,
168                                    (CORBA_long *) width,
169                                    (CORBA_long *) height,
170                                    &ev);
171 }
172
173 /**
174  * AccessibleComponent_grabFocus:
175  * @obj: a pointer to the #AccessibleComponent on which to operate.
176  *
177  * Attempt to set the keyboard input focus to the specified
178  *         #AccessibleComponent.
179  *
180  **/
181 void
182 AccessibleComponent_grabFocus (AccessibleComponent *obj)
183 {
184   ;
185 }