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  * Conversion parameters:
26  * inFile  = GtkBin.html
27  * outPack = gtk
28  * outFile = Bin
29  * strct   = GtkBin
30  * realStrct=
31  * ctorStrct=
32  * clss    = Bin
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_bin_
41  * 	- gtk_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- gtk.Widget
48  * structWrap:
49  * 	- GtkWidget* -> Widget
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54 
55 module gtk.Bin;
56 
57 public  import gtkc.gtktypes;
58 
59 private import gtkc.gtk;
60 private import glib.ConstructionException;
61 private import gobject.ObjectG;
62 
63 
64 private import gtk.Widget;
65 
66 
67 
68 private import gtk.Container;
69 
70 /**
71  * Description
72  * The GtkBin widget is a container with just one child.
73  * It is not very useful itself, but it is useful for deriving subclasses,
74  * since it provides common code needed for handling a single child widget.
75  * Many GTK+ widgets are subclasses of GtkBin, including GtkWindow,
76  * GtkButton, GtkFrame, GtkHandleBox or GtkScrolledWindow.
77  */
78 public class Bin : Container
79 {
80 	
81 	/** the main Gtk struct */
82 	protected GtkBin* gtkBin;
83 	
84 	
85 	public GtkBin* getBinStruct()
86 	{
87 		return gtkBin;
88 	}
89 	
90 	
91 	/** the main Gtk struct as a void* */
92 	protected override void* getStruct()
93 	{
94 		return cast(void*)gtkBin;
95 	}
96 	
97 	/**
98 	 * Sets our main struct and passes it to the parent class
99 	 */
100 	public this (GtkBin* gtkBin)
101 	{
102 		super(cast(GtkContainer*)gtkBin);
103 		this.gtkBin = gtkBin;
104 	}
105 	
106 	protected override void setStruct(GObject* obj)
107 	{
108 		super.setStruct(obj);
109 		gtkBin = cast(GtkBin*)obj;
110 	}
111 	
112 	/**
113 	 */
114 	
115 	/**
116 	 * Gets the child of the GtkBin, or NULL if the bin contains
117 	 * no child widget. The returned widget does not have a reference
118 	 * added, so you do not need to unref it.
119 	 * Returns: pointer to child of the GtkBin. [transfer none]
120 	 */
121 	public Widget getChild()
122 	{
123 		// GtkWidget * gtk_bin_get_child (GtkBin *bin);
124 		auto p = gtk_bin_get_child(gtkBin);
125 		
126 		if(p is null)
127 		{
128 			return null;
129 		}
130 		
131 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
132 	}
133 }