3 * AccessibleComponent function implementations
7 #include <cspi/spi-private.h>
10 * AccessibleComponent_ref:
11 * @obj: a pointer to an object implementing #AccessibleComponent on which to operate.
13 * Increment the reference count for an #AccessibleComponent.
16 AccessibleComponent_ref (AccessibleComponent *obj)
18 cspi_object_ref (obj);
22 * AccessibleComponent_unref:
23 * @obj: a pointer to the object implementing #AccessibleComponent on which to operate.
25 * Decrement the reference count for an #AccessibleComponent.
28 AccessibleComponent_unref (AccessibleComponent *obj)
30 cspi_object_unref (obj);
34 * AccessibleComponent_contains:
35 * @obj: a pointer to the #AccessibleComponent to query.
36 * @x: a #long specifying the x coordinate in question.
37 * @y: a #long specifying the y coordinate in question.
38 * @ctype: the desired coordinate system of the point (@x, @y)
39 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
41 * Query whether a given #AccessibleComponent contains a particular point.
43 * Returns: a #TRUE if the specified component contains the point (@x, @y),
47 AccessibleComponent_contains (AccessibleComponent *obj,
50 AccessibleCoordType ctype)
54 cspi_return_val_if_fail (obj != NULL, FALSE);
56 retval = Accessibility_Component_contains (CSPI_OBJREF (obj),
61 cspi_return_val_if_ev ("contains", FALSE);
67 * AccessibleComponent_getAccessibleAtPoint:
68 * @obj: a pointer to the #AccessibleComponent to query.
69 * @x: a #long specifying the x coordinate of the point in question.
70 * @y: a #long specifying the y coordinate of the point in question.
71 * @ctype: the coordinate system of the point (@x, @y)
72 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
74 * Get the accessible child at a given coordinate within an #AccessibleComponent.
76 * Returns: a pointer to an #Accessible child of the specified component which
77 * contains the point (@x, @y), or NULL of no child contains the point.
80 AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
83 AccessibleCoordType ctype)
85 Accessibility_Accessible child;
87 cspi_return_val_if_fail (obj != NULL, NULL);
89 child = Accessibility_Component_getAccessibleAtPoint (CSPI_OBJREF (obj),
94 return cspi_object_add (child);
98 * AccessibleComponent_getExtents:
99 * @obj: a pointer to the #AccessibleComponent to query.
100 * @x: a pointer to a #long into which the minimum x coordinate will be returned.
101 * @y: a pointer to a #long into which the minimum y coordinate will be returned.
102 * @width: a pointer to a #long into which the x extents (width) will be returned.
103 * @height: a pointer to a #long into which the y extents (height) will be returned.
104 * @ctype: the desired coordinate system into which to return the results,
105 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
107 * Get the bounding box of the specified #AccessibleComponent.
111 AccessibleComponent_getExtents (AccessibleComponent *obj,
116 AccessibleCoordType ctype)
118 Accessibility_BoundingBox bbox;
120 cspi_return_if_fail (obj != NULL);
122 bbox = Accessibility_Component_getExtents (CSPI_OBJREF (obj),
125 if (!cspi_check_ev ("AccessibleComponent_getExtents"))
127 *x = *y = *width = *height = 0;
134 *height = bbox.height;
139 * AccessibleComponent_getPosition:
140 * @obj: a pointer to the #AccessibleComponent 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 * @ctype: the desired coordinate system into which to return the results,
144 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
146 * Get the minimum x and y coordinates of the specified #AccessibleComponent.
150 AccessibleComponent_getPosition (AccessibleComponent *obj,
153 AccessibleCoordType ctype)
157 cspi_return_if_fail (obj != NULL);
159 Accessibility_Component_getPosition (CSPI_OBJREF (obj),
160 &cx, &cy, ctype, cspi_ev ());
162 if (!cspi_check_ev ("getPosition"))
174 * AccessibleComponent_getSize:
175 * @obj: a pointer to the #AccessibleComponent to query.
176 * @width: a pointer to a #long into which the x extents (width) will be returned.
177 * @height: a pointer to a #long into which the y extents (height) will be returned.
179 * Get the size of the specified #AccessibleComponent.
183 AccessibleComponent_getSize (AccessibleComponent *obj,
187 cspi_return_if_fail (obj != NULL);
189 Accessibility_Component_getSize (CSPI_OBJREF (obj),
190 (CORBA_long *) width,
191 (CORBA_long *) height,
196 * AccessibleComponent_getLayer:
197 * @obj: a pointer to the #AccessibleComponent to query.
199 * Query which layer the component is painted into, to help determine its
200 * visibility in terms of stacking order.
202 * Returns: the #AccessibleComponentLayer into which this component is painted.
204 AccessibleComponentLayer
205 AccessibleComponent_getLayer (AccessibleComponent *obj)
207 AccessibleComponentLayer retval;
208 Accessibility_ComponentLayer zlayer;
210 cspi_return_val_if_fail (obj != NULL, FALSE);
212 zlayer = Accessibility_Component_getLayer (CSPI_OBJREF (obj),
215 cspi_return_val_if_ev ("getLayer", SPI_LAYER_INVALID);
219 case Accessibility_LAYER_BACKGROUND:
220 retval = SPI_LAYER_BACKGROUND;
222 case Accessibility_LAYER_CANVAS:
223 retval = SPI_LAYER_CANVAS;
225 case Accessibility_LAYER_WIDGET:
226 retval = SPI_LAYER_WIDGET;
228 case Accessibility_LAYER_MDI:
229 retval = SPI_LAYER_MDI;
231 case Accessibility_LAYER_POPUP:
232 retval = SPI_LAYER_POPUP;
234 case Accessibility_LAYER_OVERLAY:
235 retval = SPI_LAYER_OVERLAY;
238 retval = SPI_LAYER_INVALID;
246 * AccessibleComponent_getMDIZOrder:
247 * @obj: a pointer to the #AccessibleComponent to query.
249 * Query the z stacking order of a component which is in the MDI layer.
250 * (Bigger z-order numbers mean nearer the top)
252 * Returns: a short integer indicating the stacking order of the component
253 * in the MDI layer, or -1 if the component is not in the MDI layer.
256 AccessibleComponent_getMDIZOrder (AccessibleComponent *obj)
260 cspi_return_val_if_fail (obj != NULL, FALSE);
262 retval = Accessibility_Component_getMDIZOrder (CSPI_OBJREF (obj),
265 cspi_return_val_if_ev ("getMDIZOrder", FALSE);
271 * AccessibleComponent_grabFocus:
272 * @obj: a pointer to the #AccessibleComponent on which to operate.
274 * Attempt to set the keyboard input focus to the specified
275 * #AccessibleComponent.
278 AccessibleComponent_grabFocus (AccessibleComponent *obj)