1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.HBox;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.Box;
30 private import gtk.Widget;
31 private import gtk.c.functions;
32 public  import gtk.c.types;
33 public  import gtkc.gtktypes;
34 
35 
36 /**
37  * #GtkHBox is a container that organizes child widgets into a single row.
38  * 
39  * Use the #GtkBox packing interface to determine the arrangement,
40  * spacing, width, and alignment of #GtkHBox children.
41  * 
42  * All children are allocated the same height.
43  * 
44  * GtkHBox has been deprecated. You can use #GtkBox instead, which is a
45  * very quick and easy change. If you have derived your own classes from
46  * GtkHBox, you can simply change the inheritance to derive directly
47  * from #GtkBox. No further changes are needed, since the default
48  * value of the #GtkOrientable:orientation property is
49  * %GTK_ORIENTATION_HORIZONTAL.
50  * If you don’t need first-child or last-child styling, and want your code
51  * to be future-proof, the recommendation is to switch to #GtkGrid instead
52  * of nested boxes. For more information about migrating to #GtkGrid,
53  * see [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
54  */
55 public class HBox : Box
56 {
57 	/** the main Gtk struct */
58 	protected GtkHBox* gtkHBox;
59 
60 	/** Get the main Gtk struct */
61 	public GtkHBox* getHBoxStruct(bool transferOwnership = false)
62 	{
63 		if (transferOwnership)
64 			ownedRef = false;
65 		return gtkHBox;
66 	}
67 
68 	/** the main Gtk struct as a void* */
69 	protected override void* getStruct()
70 	{
71 		return cast(void*)gtkHBox;
72 	}
73 
74 	/**
75 	 * Sets our main struct and passes it to the parent class.
76 	 */
77 	public this (GtkHBox* gtkHBox, bool ownedRef = false)
78 	{
79 		this.gtkHBox = gtkHBox;
80 		super(cast(GtkBox*)gtkHBox, ownedRef);
81 	}
82 
83 
84 	/** */
85 	public static GType getType()
86 	{
87 		return gtk_hbox_get_type();
88 	}
89 
90 	/**
91 	 * Creates a new #GtkHBox.
92 	 *
93 	 * Deprecated: You can use gtk_box_new() with %GTK_ORIENTATION_HORIZONTAL instead,
94 	 * which is a quick and easy change. But the recommendation is to switch to
95 	 * #GtkGrid, since #GtkBox is going to go away eventually.
96 	 * See [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
97 	 *
98 	 * Params:
99 	 *     homogeneous = %TRUE if all children are to be given equal space allotments.
100 	 *     spacing = the number of pixels to place by default between children.
101 	 *
102 	 * Returns: a new #GtkHBox.
103 	 *
104 	 * Throws: ConstructionException GTK+ fails to create the object.
105 	 */
106 	public this(bool homogeneous, int spacing)
107 	{
108 		auto p = gtk_hbox_new(homogeneous, spacing);
109 
110 		if(p is null)
111 		{
112 			throw new ConstructionException("null returned by new");
113 		}
114 
115 		this(cast(GtkHBox*) p);
116 	}
117 }