I've no idea here...
[gtkD.git] / src / atk / Component.d
blob041f6845492e9e04c73522d9eb42ee3be1120d68
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = AtkComponent.html
26 * outPack = atk
27 * outFile = Component
28 * strct = AtkComponent
29 * realStrct=
30 * ctorStrct=
31 * clss = Component
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_component_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * structWrap:
45 * local aliases:
48 module atk.Component;
50 private import atk.atktypes;
52 private import lib.atk;
55 /**
56 * Description
57 * AtkComponent should be implemented by most if not all UI elements with
58 * an actual on-screen presence, i.e. components which can be said to have
59 * a screen-coordinate bounding box. Virtually all widgets will need to
60 * have AtkComponent implementations provided for their corresponding
61 * AtkObject class. In short, only UI elements which are *not* GUI
62 * elements will omit this ATK interface.
63 * A possible exception might be textual information with a transparent
64 * background, in which case text glyph bounding box information is
65 * provided by AtkText.
67 public class Component
70 /** the main Gtk struct */
71 protected AtkComponent* atkComponent;
74 public AtkComponent* getComponentStruct()
76 return atkComponent;
80 /** the main Gtk struct as a void* */
81 protected void* getStruct()
83 return cast(void*)atkComponent;
86 /**
87 * Sets our main struct and passes it to the parent class
89 public this (AtkComponent* atkComponent)
91 this.atkComponent = atkComponent;
94 /**
97 // imports for the signal processing
98 private import gobject.Signals;
99 private import gdk.gdktypes;
100 int[char[]] connectedSignals;
102 void delegate(AtkRectangle*, Component)[] onBoundsChangedListeners;
103 void addOnBoundsChanged(void delegate(AtkRectangle*, Component) dlg)
105 if ( !("bounds-changed" in connectedSignals) )
107 Signals.connectData(
108 getStruct(),
109 "bounds-changed",
110 cast(GCallback)&callBackBoundsChanged,
111 this,
112 null,
113 cast(ConnectFlags)0);
114 connectedSignals["bounds-changed"] = 1;
116 onBoundsChangedListeners ~= dlg;
118 extern(C) static void callBackBoundsChanged(AtkComponent* atkcomponentStruct, AtkRectangle* arg1, Component component)
120 bit consumed = false;
122 foreach ( void delegate(AtkRectangle*, Component) dlg ; component.onBoundsChangedListeners )
124 dlg(arg1, component);
127 return consumed;
133 * Add the specified handler to the set of functions to be called
134 * when this object receives focus events (in or out). If the handler is
135 * already added it is not added again
136 * component:
137 * The AtkComponent to attach the handler to
138 * handler:
139 * The AtkFocusHandler to be attached to component
140 * Returns:
141 * a handler id which can be used in atk_component_remove_focus_handler
142 * or zero if the handler was already added.
144 public uint addFocusHandler(AtkFocusHandler handler)
146 // guint atk_component_add_focus_handler (AtkComponent *component, AtkFocusHandler handler);
147 return atk_component_add_focus_handler(atkComponent, handler);
151 * Checks whether the specified point is within the extent of the component.
152 * component:
153 * the AtkComponent
154 * x:
155 * x coordinate
156 * y:
157 * y coordinate
158 * coord_type:
159 * specifies whether the coordinates are relative to the screen
160 * or to the components top level window
161 * Returns:
162 * TRUE or FALSE indicating whether the specified point is within
163 * the extent of the component or not
165 public int contains(int x, int y, AtkCoordType coordType)
167 // gboolean atk_component_contains (AtkComponent *component, gint x, gint y, AtkCoordType coord_type);
168 return atk_component_contains(atkComponent, x, y, coordType);
172 * Gets the rectangle which gives the extent of the component.
173 * component:
174 * an AtkComponent
175 * x:
176 * address of gint to put x coordinate
177 * y:
178 * address of gint to put y coordinate
179 * width:
180 * address of gint to put width
181 * height:
182 * address of gint to put height
183 * coord_type:
184 * specifies whether the coordinates are relative to the screen
185 * or to the components top level window
187 public void getExtents(int* x, int* y, int* width, int* height, AtkCoordType coordType)
189 // void atk_component_get_extents (AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type);
190 atk_component_get_extents(atkComponent, x, y, width, height, coordType);
194 * Gets the layer of the component.
195 * component:
196 * an AtkComponent
197 * Returns:
198 * an AtkLayer which is the layer of the component
200 public AtkLayer getLayer()
202 // AtkLayer atk_component_get_layer (AtkComponent *component);
203 return atk_component_get_layer(atkComponent);
207 * Gets the zorder of the component. The value G_MININT will be returned
208 * if the layer of the component is not ATK_LAYER_MDI or ATK_LAYER_WINDOW.
209 * component:
210 * an AtkComponent
211 * Returns:
212 * a gint which is the zorder of the component, i.e. the depth at
213 * which the component is shown in relation to other components in the same
214 * container.
216 public int getMdiZorder()
218 // gint atk_component_get_mdi_zorder (AtkComponent *component);
219 return atk_component_get_mdi_zorder(atkComponent);
223 * Gets the position of component in the form of
224 * a point specifying component's top-left corner.
225 * component:
226 * an AtkComponent
227 * x:
228 * address of gint to put x coordinate position
229 * y:
230 * address of gint to put y coordinate position
231 * coord_type:
232 * specifies whether the coordinates are relative to the screen
233 * or to the components top level window
235 public void getPosition(int* x, int* y, AtkCoordType coordType)
237 // void atk_component_get_position (AtkComponent *component, gint *x, gint *y, AtkCoordType coord_type);
238 atk_component_get_position(atkComponent, x, y, coordType);
242 * Gets the size of the component in terms of width and height.
243 * component:
244 * an AtkComponent
245 * width:
246 * address of gint to put width of component
247 * height:
248 * address of gint to put height of component
250 public void getSize(int* width, int* height)
252 // void atk_component_get_size (AtkComponent *component, gint *width, gint *height);
253 atk_component_get_size(atkComponent, width, height);
257 * Grabs focus for this component.
258 * component:
259 * an AtkComponent
260 * Returns:
261 * TRUE if successful, FALSE otherwise.
263 public int grabFocus()
265 // gboolean atk_component_grab_focus (AtkComponent *component);
266 return atk_component_grab_focus(atkComponent);
270 * Gets a reference to the accessible child, if one exists, at the
271 * coordinate point specified by x and y.
272 * component:
273 * the AtkComponent
274 * x:
275 * x coordinate
276 * y:
277 * y coordinate
278 * coord_type:
279 * specifies whether the coordinates are relative to the screen
280 * or to the components top level window
281 * Returns:
282 * a reference to the accessible child, if one exists
284 public AtkObject* refAccessibleAtPoint(int x, int y, AtkCoordType coordType)
286 // AtkObject* atk_component_ref_accessible_at_point (AtkComponent *component, gint x, gint y, AtkCoordType coord_type);
287 return atk_component_ref_accessible_at_point(atkComponent, x, y, coordType);
291 * Remove the handler specified by handler_id from the list of
292 * functions to be executed when this object receives focus events
293 * (in or out).
294 * component:
295 * the AtkComponent to remove the focus handler from
296 * handler_id:
297 * the handler id of the focus handler to be removed
298 * from component
300 public void removeFocusHandler(uint handlerId)
302 // void atk_component_remove_focus_handler (AtkComponent *component, guint handler_id);
303 atk_component_remove_focus_handler(atkComponent, handlerId);
307 * Sets the extents of component.
308 * component:
309 * an AtkComponent
310 * x:
311 * x coordinate
312 * y:
313 * y coordinate
314 * width:
315 * width to set for component
316 * height:
317 * height to set for component
318 * coord_type:
319 * specifies whether the coordinates are relative to the screen
320 * or to the components top level window
321 * Returns:
322 * TRUE or FALSE whether the extents were set or not
324 public int setExtents(int x, int y, int width, int height, AtkCoordType coordType)
326 // gboolean atk_component_set_extents (AtkComponent *component, gint x, gint y, gint width, gint height, AtkCoordType coord_type);
327 return atk_component_set_extents(atkComponent, x, y, width, height, coordType);
331 * Sets the postition of component.
332 * component:
333 * an AtkComponent
334 * x:
335 * x coordinate
336 * y:
337 * y coordinate
338 * coord_type:
339 * specifies whether the coordinates are relative to the screen
340 * or to the components top level window
341 * Returns:
342 * TRUE or FALSE whether or not the position was set or not
344 public int setPosition(int x, int y, AtkCoordType coordType)
346 // gboolean atk_component_set_position (AtkComponent *component, gint x, gint y, AtkCoordType coord_type);
347 return atk_component_set_position(atkComponent, x, y, coordType);
351 * Set the size of the component in terms of width and height.
352 * component:
353 * an AtkComponent
354 * width:
355 * width to set for component
356 * height:
357 * height to set for component
358 * Returns:
359 * TRUE or FALSE whether the size was set or not
361 public int setSize(int width, int height)
363 // gboolean atk_component_set_size (AtkComponent *component, gint width, gint height);
364 return atk_component_set_size(atkComponent, width, height);
368 * Returns the alpha value (i.e. the opacity) for this
369 * component, on a scale from 0 (fully transparent) to 1.0
370 * (fully opaque).
371 * component:
372 * an AtkComponent
373 * Returns:
374 * An alpha value from 0 to 1.0, inclusive.
375 * Since ATK 1.12
376 * Signal Details
377 * The "bounds-changed" signal
378 * void user_function (AtkComponent *atkcomponent,
379 * AtkRectangle *arg1,
380 * gpointer user_data) : Run last
381 * The 'bounds-changed" signal is emitted when the bposition or size of the
382 * a component changes.
383 * atkcomponent:
384 * the object which received the signal.
385 * arg1:
386 * The AtkRectangle giving the new position and size.
387 * user_data:
388 * user data set when the signal handler was connected.
390 public double getAlpha()
392 // gdouble atk_component_get_alpha (AtkComponent *component);
393 return atk_component_get_alpha(atkComponent);