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.
15 * Returns: (no return code implemented yet).
19 AccessibleComponent_ref (AccessibleComponent *obj)
21 cspi_object_ref (obj);
25 * AccessibleComponent_unref:
26 * @obj: a pointer to the object implementing #AccessibleComponent on which to operate.
28 * Decrement the reference count for an #AccessibleComponent.
30 * Returns: (no return code implemented yet).
34 AccessibleComponent_unref (AccessibleComponent *obj)
36 cspi_object_unref (obj);
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. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
47 * Query whether a given #AccessibleComponent contains a particular point.
49 * Returns: a #TRUE if the specified component contains the point (@x, @y),
53 AccessibleComponent_contains (AccessibleComponent *obj,
56 AccessibleCoordType ctype)
60 cspi_return_val_if_fail (obj != NULL, FALSE);
62 retval = Accessibility_Component_contains (CSPI_OBJREF (obj),
67 cspi_return_val_if_ev ("contains", FALSE);
73 * AccessibleComponent_getAccessibleAtPoint:
74 * @obj: a pointer to the #AccessibleComponent to query.
75 * @x: a #long specifying the x coordinate of the point in question.
76 * @y: a #long specifying the y coordinate of the point in question.
77 * @ctype: the coordinate system of the point (@x, @y)
78 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
80 * Get the accessible child at a given coordinate within an #AccessibleComponent.
82 * Returns: a pointer to an #Accessible child of the specified component which
83 * contains the point (@x, @y), or NULL of no child contains the point.
86 AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
89 AccessibleCoordType ctype)
91 Accessibility_Accessible child;
93 cspi_return_val_if_fail (obj != NULL, NULL);
95 child = Accessibility_Component_getAccessibleAtPoint (CSPI_OBJREF (obj),
100 return cspi_object_add (child);
104 * AccessibleComponent_getExtents:
105 * @obj: a pointer to the #AccessibleComponent 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 * @width: a pointer to a #long into which the x extents (width) will be returned.
109 * @height: a pointer to a #long into which the y extents (height) will be returned.
110 * @ctype: the desired coordinate system into which to return the results,
111 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
113 * Get the bounding box of the specified #AccessibleComponent.
117 AccessibleComponent_getExtents (AccessibleComponent *obj,
122 AccessibleCoordType ctype)
124 Accessibility_BoundingBox bbox;
126 cspi_return_if_fail (obj != NULL);
128 bbox = Accessibility_Component_getExtents (CSPI_OBJREF (obj),
131 if (!cspi_check_ev ("AccessibleComponent_getExtents"))
133 *x = *y = *width = *height = 0;
140 *height = bbox.height;
145 * AccessibleComponent_getPosition:
146 * @obj: a pointer to the #AccessibleComponent to query.
147 * @x: a pointer to a #long into which the minimum x coordinate will be returned.
148 * @y: a pointer to a #long into which the minimum y coordinate will be returned.
149 * @ctype: the desired coordinate system into which to return the results,
150 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
152 * Get the minimum x and y coordinates of the specified #AccessibleComponent.
156 AccessibleComponent_getPosition (AccessibleComponent *obj,
159 AccessibleCoordType ctype)
163 cspi_return_if_fail (obj != NULL);
165 Accessibility_Component_getPosition (CSPI_OBJREF (obj),
166 &cx, &cy, ctype, cspi_ev ());
168 if (!cspi_check_ev ("getPosition"))
180 * AccessibleComponent_getSize:
181 * @obj: a pointer to the #AccessibleComponent to query.
182 * @width: a pointer to a #long into which the x extents (width) will be returned.
183 * @height: a pointer to a #long into which the y extents (height) will be returned.
185 * Get the size of the specified #AccessibleComponent.
189 AccessibleComponent_getSize (AccessibleComponent *obj,
193 cspi_return_if_fail (obj != NULL);
195 Accessibility_Component_getSize (CSPI_OBJREF (obj),
196 (CORBA_long *) width,
197 (CORBA_long *) height,
202 * AccessibleComponent_getLayer:
203 * @obj: a pointer to the #AccessibleComponent to query.
205 * Query which layer the component is painted into, to help determine its
206 * visibility in terms of stacking order.
208 * Returns: the #AccessibleComponentLayer into which this component is painted.
210 AccessibleComponentLayer
211 AccessibleComponent_getLayer (AccessibleComponent *obj)
213 AccessibleComponentLayer retval;
214 Accessibility_ComponentLayer zlayer;
216 cspi_return_val_if_fail (obj != NULL, FALSE);
218 zlayer = Accessibility_Component_getLayer (CSPI_OBJREF (obj),
221 cspi_return_val_if_ev ("getLayer", SPI_LAYER_INVALID);
225 case Accessibility_LAYER_BACKGROUND:
226 retval = SPI_LAYER_BACKGROUND;
228 case Accessibility_LAYER_CANVAS:
229 retval = SPI_LAYER_CANVAS;
231 case Accessibility_LAYER_WIDGET:
232 retval = SPI_LAYER_WIDGET;
234 case Accessibility_LAYER_MDI:
235 retval = SPI_LAYER_MDI;
237 case Accessibility_LAYER_POPUP:
238 retval = SPI_LAYER_POPUP;
240 case Accessibility_LAYER_OVERLAY:
241 retval = SPI_LAYER_OVERLAY;
244 retval = SPI_LAYER_INVALID;
252 * AccessibleComponent_getMDIZOrder:
253 * @obj: a pointer to the #AccessibleComponent to query.
255 * Query the z stacking order of a component which is in the MDI layer.
256 * (Bigger z-order numbers mean nearer the top)
258 * Returns: a short integer indicating the stacking order of the component
259 * in the MDI layer, or -1 if the component is not in the MDI layer.
262 AccessibleComponent_getMDIZOrder (AccessibleComponent *obj)
266 cspi_return_val_if_fail (obj != NULL, FALSE);
268 retval = Accessibility_Component_getMDIZOrder (CSPI_OBJREF (obj),
271 cspi_return_val_if_ev ("getMDIZOrder", FALSE);
277 * AccessibleComponent_grabFocus:
278 * @obj: a pointer to the #AccessibleComponent on which to operate.
280 * Attempt to set the keyboard input focus to the specified
281 * #AccessibleComponent.
284 AccessibleComponent_grabFocus (AccessibleComponent *obj)