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.HPaned;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.Paned;
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  * The HPaned widget is a container widget with two
38  * children arranged horizontally. The division between
39  * the two panes is adjustable by the user by dragging
40  * a handle. See #GtkPaned for details.
41  * 
42  * GtkHPaned has been deprecated, use #GtkPaned instead.
43  */
44 public class HPaned : Paned
45 {
46 	/** the main Gtk struct */
47 	protected GtkHPaned* gtkHPaned;
48 
49 	/** Get the main Gtk struct */
50 	public GtkHPaned* getHPanedStruct(bool transferOwnership = false)
51 	{
52 		if (transferOwnership)
53 			ownedRef = false;
54 		return gtkHPaned;
55 	}
56 
57 	/** the main Gtk struct as a void* */
58 	protected override void* getStruct()
59 	{
60 		return cast(void*)gtkHPaned;
61 	}
62 
63 	protected override void setStruct(GObject* obj)
64 	{
65 		gtkHPaned = cast(GtkHPaned*)obj;
66 		super.setStruct(obj);
67 	}
68 
69 	/**
70 	 * Sets our main struct and passes it to the parent class.
71 	 */
72 	public this (GtkHPaned* gtkHPaned, bool ownedRef = false)
73 	{
74 		this.gtkHPaned = gtkHPaned;
75 		super(cast(GtkPaned*)gtkHPaned, ownedRef);
76 	}
77 
78 	/**
79 	 * Creates a new HPaned and adds two widgets as it's children
80 	 * Params:
81 	 *  child1 =
82 	 *  child2 =
83 	 */
84 	this(Widget child1, Widget child2)
85 	{
86 		this();
87 		add1(child1);
88 		add2(child2);
89 	}
90 
91 	/**
92 	 */
93 
94 	/** */
95 	public static GType getType()
96 	{
97 		return gtk_hpaned_get_type();
98 	}
99 
100 	/**
101 	 * Create a new #GtkHPaned
102 	 *
103 	 * Deprecated: Use gtk_paned_new() with %GTK_ORIENTATION_HORIZONTAL instead
104 	 *
105 	 * Returns: the new #GtkHPaned
106 	 *
107 	 * Throws: ConstructionException GTK+ fails to create the object.
108 	 */
109 	public this()
110 	{
111 		auto p = gtk_hpaned_new();
112 
113 		if(p is null)
114 		{
115 			throw new ConstructionException("null returned by new");
116 		}
117 
118 		this(cast(GtkHPaned*) p);
119 	}
120 }