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
28 * strct = AtkComponent
50 private import atk
.atktypes
;
52 private import lib
.atk
;
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()
80 /** the main Gtk struct as a void* */
81 protected void* getStruct()
83 return cast(void*)atkComponent
;
87 * Sets our main struct and passes it to the parent class
89 public this (AtkComponent
* atkComponent
)
91 this.atkComponent
= atkComponent
;
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
) )
110 cast(GCallback
)&callBackBoundsChanged
,
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
);
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
137 * The AtkComponent to attach the handler to
139 * The AtkFocusHandler to be attached to component
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.
159 * specifies whether the coordinates are relative to the screen
160 * or to the components top level window
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.
176 * address of gint to put x coordinate
178 * address of gint to put y coordinate
180 * address of gint to put width
182 * address of gint to put height
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.
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.
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
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.
228 * address of gint to put x coordinate position
230 * address of gint to put y coordinate position
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.
246 * address of gint to put width of component
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.
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.
279 * specifies whether the coordinates are relative to the screen
280 * or to the components top level window
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
295 * the AtkComponent to remove the focus handler from
297 * the handler id of the focus handler to be removed
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.
315 * width to set for component
317 * height to set for component
319 * specifies whether the coordinates are relative to the screen
320 * or to the components top level window
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.
339 * specifies whether the coordinates are relative to the screen
340 * or to the components top level window
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.
355 * width to set for component
357 * height to set for component
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
374 * An alpha value from 0 to 1.0, inclusive.
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.
384 * the object which received the signal.
386 * The AtkRectangle giving the new position and size.
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
);