2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 = GtkLayout.html
48 * - GtkAdjustment* -> Adjustment
49 * - GtkWidget* -> Widget
60 import tango
.io
.Stdout
; // use the tango loging?
64 private import gtkc
.gtktypes
;
66 private import gtkc
.gtk
;
69 private import gtk
.Adjustment
;
70 private import gtk
.Widget
;
77 * GtkLayout is similar to GtkDrawingArea in that it's a "blank slate"
78 * and doesn't do anything but paint a blank background by default. It's
79 * different in that it supports scrolling natively (you can add it to a
80 * GtkScrolledWindow), and it can contain child widgets, since it's a
81 * GtkContainer. However if you're just going to draw, a GtkDrawingArea
82 * is a better choice since it has lower overhead.
83 * When handling expose events on a GtkLayout, you must draw to
84 * GTK_LAYOUT (layout)->bin_window, rather than to
85 * GTK_WIDGET (layout)->window, as you would for a drawing
88 private import gtk
.Container
;
89 public class Layout
: Container
92 /** the main Gtk struct */
93 protected GtkLayout
* gtkLayout
;
96 public GtkLayout
* getLayoutStruct()
102 /** the main Gtk struct as a void* */
103 protected void* getStruct()
105 return cast(void*)gtkLayout
;
109 * Sets our main struct and passes it to the parent class
111 public this (GtkLayout
* gtkLayout
)
115 if ( gtkLayout
is null )
120 Stdout("struct gtkLayout is null on constructor").newline
;
124 printf("struct gtkLayout is null on constructor");
131 assert(gtkLayout
!is null, "struct gtkLayout is null on constructor");
133 super(cast(GtkContainer
*)gtkLayout
);
134 this.gtkLayout
= gtkLayout
;
140 // imports for the signal processing
141 private import gobject
.Signals
;
142 private import gtkc
.gdktypes
;
143 int[char[]] connectedSignals
;
145 void delegate(Adjustment
, Adjustment
, Layout
)[] onSetScrollAdjustmentsListeners
;
146 void addOnSetScrollAdjustments(void delegate(Adjustment
, Adjustment
, Layout
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
148 if ( !("set-scroll-adjustments" in connectedSignals
) )
152 "set-scroll-adjustments",
153 cast(GCallback
)&callBackSetScrollAdjustments
,
157 connectedSignals
["set-scroll-adjustments"] = 1;
159 onSetScrollAdjustmentsListeners
~= dlg
;
161 extern(C
) static void callBackSetScrollAdjustments(GtkLayout
* layoutStruct
, GtkAdjustment
* arg1
, GtkAdjustment
* arg2
, Layout layout
)
163 bool consumed
= false;
165 foreach ( void delegate(Adjustment
, Adjustment
, Layout
) dlg
; layout
.onSetScrollAdjustmentsListeners
)
167 dlg(new Adjustment(arg1
), new Adjustment(arg2
), layout
);
176 * Creates a new GtkLayout. Unless you have a specific adjustment
177 * you'd like the layout to use for scrolling, pass NULL for
178 * hadjustment and vadjustment.
180 * horizontal scroll adjustment, or NULL
182 * vertical scroll adjustment, or NULL
186 public this (Adjustment hadjustment
, Adjustment vadjustment
)
188 // GtkWidget* gtk_layout_new (GtkAdjustment *hadjustment, GtkAdjustment *vadjustment);
189 this(cast(GtkLayout
*)gtk_layout_new((hadjustment
is null) ?
null : hadjustment
.getAdjustmentStruct(), (vadjustment
is null) ?
null : vadjustment
.getAdjustmentStruct()) );
193 * Adds child_widget to layout, at position (x,y).
194 * layout becomes the new parent container of child_widget.
200 * X position of child widget
202 * Y position of child widget
204 public void put(Widget childWidget
, int x
, int y
)
206 // void gtk_layout_put (GtkLayout *layout, GtkWidget *child_widget, gint x, gint y);
207 gtk_layout_put(gtkLayout
, (childWidget
is null) ?
null : childWidget
.getWidgetStruct(), x
, y
);
211 * Moves a current child of layout to a new position.
215 * a current child of layout
217 * X position to move to
219 * Y position to move to
221 public void move(Widget childWidget
, int x
, int y
)
223 // void gtk_layout_move (GtkLayout *layout, GtkWidget *child_widget, gint x, gint y);
224 gtk_layout_move(gtkLayout
, (childWidget
is null) ?
null : childWidget
.getWidgetStruct(), x
, y
);
228 * Sets the size of the scrollable area of the layout.
232 * width of entire scrollable area
234 * height of entire scrollable area
236 public void setSize(uint width
, uint height
)
238 // void gtk_layout_set_size (GtkLayout *layout, guint width, guint height);
239 gtk_layout_set_size(gtkLayout
, width
, height
);
243 * Gets the size that has been set on the layout, and that determines
244 * the total extents of the layout's scrollbar area. See
245 * gtk_layout_set_size().
249 * location to store the width set on layout, or NULL
251 * location to store the height set on layout, or NULL
253 public void getSize(uint* width
, uint* height
)
255 // void gtk_layout_get_size (GtkLayout *layout, guint *width, guint *height);
256 gtk_layout_get_size(gtkLayout
, width
, height
);
261 * gtk_layout_freeze is deprecated and should not be used in newly-written code.
262 * This is a deprecated function, it doesn't do anything useful.
268 // void gtk_layout_freeze (GtkLayout *layout);
269 gtk_layout_freeze(gtkLayout
);
274 * gtk_layout_thaw is deprecated and should not be used in newly-written code.
275 * This is a deprecated function, it doesn't do anything useful.
281 // void gtk_layout_thaw (GtkLayout *layout);
282 gtk_layout_thaw(gtkLayout
);
286 * This function should only be called after the layout has been
287 * placed in a GtkScrolledWindow or otherwise configured for
288 * scrolling. It returns the GtkAdjustment used for communication
289 * between the horizontal scrollbar and layout.
290 * See GtkScrolledWindow, GtkScrollbar, GtkAdjustment for details.
294 * horizontal scroll adjustment
296 public Adjustment
getHadjustment()
298 // GtkAdjustment* gtk_layout_get_hadjustment (GtkLayout *layout);
299 return new Adjustment( gtk_layout_get_hadjustment(gtkLayout
) );
303 * This function should only be called after the layout has been
304 * placed in a GtkScrolledWindow or otherwise configured for
305 * scrolling. It returns the GtkAdjustment used for communication
306 * between the vertical scrollbar and layout.
307 * See GtkScrolledWindow, GtkScrollbar, GtkAdjustment for details.
311 * vertical scroll adjustment
313 public Adjustment
getVadjustment()
315 // GtkAdjustment* gtk_layout_get_vadjustment (GtkLayout *layout);
316 return new Adjustment( gtk_layout_get_vadjustment(gtkLayout
) );
320 * Sets the horizontal scroll adjustment for the layout.
321 * See GtkScrolledWindow, GtkScrollbar, GtkAdjustment for details.
325 * new scroll adjustment
327 public void setHadjustment(Adjustment adjustment
)
329 // void gtk_layout_set_hadjustment (GtkLayout *layout, GtkAdjustment *adjustment);
330 gtk_layout_set_hadjustment(gtkLayout
, (adjustment
is null) ?
null : adjustment
.getAdjustmentStruct());
334 * Sets the vertical scroll adjustment for the layout.
335 * See GtkScrolledWindow, GtkScrollbar, GtkAdjustment for details.
339 * new scroll adjustment
341 * The "hadjustment" property
342 * "hadjustment" GtkAdjustment : Read / Write
343 * The GtkAdjustment for the horizontal position.
345 public void setVadjustment(Adjustment adjustment
)
347 // void gtk_layout_set_vadjustment (GtkLayout *layout, GtkAdjustment *adjustment);
348 gtk_layout_set_vadjustment(gtkLayout
, (adjustment
is null) ?
null : adjustment
.getAdjustmentStruct());