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.
17 AccessibleComponent_ref (AccessibleComponent *obj)
19 cspi_object_ref (obj);
23 * AccessibleComponent_unref:
24 * @obj: a pointer to the object implementing #AccessibleComponent on which to operate.
26 * Decrement the reference count for an #AccessibleComponent.
30 AccessibleComponent_unref (AccessibleComponent *obj)
32 cspi_object_unref (obj);
36 * AccessibleComponent_contains:
37 * @obj: a pointer to the #AccessibleComponent to query.
38 * @x: a #long specifying the x coordinate in question.
39 * @y: a #long specifying the y coordinate in question.
40 * @ctype: the desired coordinate system of the point (@x, @y)
41 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
43 * Query whether a given #AccessibleComponent contains a particular point.
45 * Returns: a #TRUE if the specified component contains the point (@x, @y),
49 AccessibleComponent_contains (AccessibleComponent *obj,
52 AccessibleCoordType ctype)
56 cspi_return_val_if_fail (obj != NULL, FALSE);
58 retval = Accessibility_Component_contains (CSPI_OBJREF (obj),
63 cspi_return_val_if_ev ("contains", FALSE);
69 * AccessibleComponent_getAccessibleAtPoint:
70 * @obj: a pointer to the #AccessibleComponent to query.
71 * @x: a #long specifying the x coordinate of the point in question.
72 * @y: a #long specifying the y coordinate of the point in question.
73 * @ctype: the coordinate system of the point (@x, @y)
74 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
76 * Get the accessible child at a given coordinate within an #AccessibleComponent.
78 * Returns: a pointer to an #Accessible child of the specified component which
79 * contains the point (@x, @y), or NULL of no child contains the point.
82 AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
85 AccessibleCoordType ctype)
87 Accessibility_Accessible child;
89 cspi_return_val_if_fail (obj != NULL, NULL);
91 child = Accessibility_Component_getAccessibleAtPoint (CSPI_OBJREF (obj),
96 return cspi_object_add (child);
100 * AccessibleComponent_getExtents:
101 * @obj: a pointer to the #AccessibleComponent 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 x extents (width) will be returned.
105 * @height: a pointer to a #long into which the y extents (height) will be returned.
106 * @ctype: the desired coordinate system into which to return the results,
107 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
109 * Get the bounding box of the specified #AccessibleComponent.
113 AccessibleComponent_getExtents (AccessibleComponent *obj,
118 AccessibleCoordType ctype)
120 Accessibility_BoundingBox bbox;
122 cspi_return_if_fail (obj != NULL);
124 bbox = Accessibility_Component_getExtents (CSPI_OBJREF (obj),
127 if (!cspi_check_ev ("AccessibleComponent_getExtents"))
129 *x = *y = *width = *height = 0;
136 *height = bbox.height;
141 * AccessibleComponent_getPosition:
142 * @obj: a pointer to the #AccessibleComponent to query.
143 * @x: a pointer to a #long into which the minimum x coordinate will be returned.
144 * @y: a pointer to a #long into which the minimum y coordinate will be returned.
145 * @ctype: the desired coordinate system into which to return the results,
146 * (e.g. CSPI_COORD_TYPE_WINDOW, CSPI_COORD_TYPE_SCREEN).
148 * Get the minimum x and y coordinates of the specified #AccessibleComponent.
152 AccessibleComponent_getPosition (AccessibleComponent *obj,
155 AccessibleCoordType ctype)
159 cspi_return_if_fail (obj != NULL);
161 Accessibility_Component_getPosition (CSPI_OBJREF (obj),
162 &cx, &cy, ctype, cspi_ev ());
164 if (!cspi_check_ev ("getPosition"))
176 * AccessibleComponent_getSize:
177 * @obj: a pointer to the #AccessibleComponent to query.
178 * @width: a pointer to a #long into which the x extents (width) will be returned.
179 * @height: a pointer to a #long into which the y extents (height) will be returned.
181 * Get the size of the specified #AccessibleComponent.
185 AccessibleComponent_getSize (AccessibleComponent *obj,
189 cspi_return_if_fail (obj != NULL);
191 Accessibility_Component_getSize (CSPI_OBJREF (obj),
192 (CORBA_long *) width,
193 (CORBA_long *) height,
198 * AccessibleComponent_getLayer:
199 * @obj: a pointer to the #AccessibleComponent to query.
201 * Query which layer the component is painted into, to help determine its
202 * visibility in terms of stacking order.
204 * Returns: the #AccessibleComponentLayer into which this component is painted.
206 AccessibleComponentLayer
207 AccessibleComponent_getLayer (AccessibleComponent *obj)
209 AccessibleComponentLayer retval;
210 Accessibility_ComponentLayer zlayer;
212 cspi_return_val_if_fail (obj != NULL, FALSE);
214 zlayer = Accessibility_Component_getLayer (CSPI_OBJREF (obj),
217 cspi_return_val_if_ev ("getLayer", SPI_LAYER_INVALID);
221 case Accessibility_LAYER_BACKGROUND:
222 retval = SPI_LAYER_BACKGROUND;
224 case Accessibility_LAYER_CANVAS:
225 retval = SPI_LAYER_CANVAS;
227 case Accessibility_LAYER_WIDGET:
228 retval = SPI_LAYER_WIDGET;
230 case Accessibility_LAYER_MDI:
231 retval = SPI_LAYER_MDI;
233 case Accessibility_LAYER_POPUP:
234 retval = SPI_LAYER_POPUP;
236 case Accessibility_LAYER_OVERLAY:
237 retval = SPI_LAYER_OVERLAY;
240 retval = SPI_LAYER_INVALID;
248 * AccessibleComponent_getMDIZOrder:
249 * @obj: a pointer to the #AccessibleComponent to query.
251 * Query the z stacking order of a component which is in the MDI layer.
252 * (Bigger z-order numbers mean nearer the top)
254 * Returns: a short integer indicating the stacking order of the component
255 * in the MDI layer, or -1 if the component is not in the MDI layer.
258 AccessibleComponent_getMDIZOrder (AccessibleComponent *obj)
262 cspi_return_val_if_fail (obj != NULL, FALSE);
264 retval = Accessibility_Component_getMDIZOrder (CSPI_OBJREF (obj),
267 cspi_return_val_if_ev ("getMDIZOrder", FALSE);
273 * AccessibleComponent_grabFocus:
274 * @obj: a pointer to the #AccessibleComponent on which to operate.
276 * Attempt to set the keyboard input focus to the specified
277 * #AccessibleComponent.
280 AccessibleComponent_grabFocus (AccessibleComponent *obj)