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  = GtkCellAreaBox.html
27  * outPack = gtk
28  * outFile = CellAreaBox
29  * strct   = GtkCellAreaBox
30  * realStrct=
31  * ctorStrct=GtkCellArea
32  * clss    = CellAreaBox
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- OrientableIF
40  * prefixes:
41  * 	- gtk_cell_area_box_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- gtk.CellRenderer
48  * 	- gtk.OrientableIF
49  * 	- gtk.OrientableT
50  * structWrap:
51  * 	- GtkCellRenderer* -> CellRenderer
52  * module aliases:
53  * local aliases:
54  * overrides:
55  */
56 
57 module gtk.CellAreaBox;
58 
59 public  import gtkc.gtktypes;
60 
61 private import gtkc.gtk;
62 private import glib.ConstructionException;
63 private import gobject.ObjectG;
64 
65 private import gtk.CellRenderer;
66 private import gtk.OrientableIF;
67 private import gtk.OrientableT;
68 
69 
70 private import gtk.CellArea;
71 
72 /**
73  * The GtkCellAreaBox renders cell renderers into a row or a column
74  * depending on its GtkOrientation.
75  *
76  * GtkCellAreaBox uses a notion of packing. Packing
77  * refers to adding cell renderers with reference to a particular position
78  * in a GtkCellAreaBox. There are two reference positions: the
79  * start and the end of the box.
80  * When the GtkCellAreaBox is oriented in the GTK_ORIENTATION_VERTICAL
81  * orientation, the start is defined as the top of the box and the end is
82  * defined as the bottom. In the GTK_ORIENTATION_HORIZONTAL orientation
83  * start is defined as the left side and the end is defined as the right
84  * side.
85  *
86  * Alignments of GtkCellRenderers rendered in adjacent rows can be
87  * configured by configuring the "align" child cell property
88  * with gtk_cell_area_cell_set_property() or by specifying the "align"
89  * argument to gtk_cell_area_box_pack_start() and gtk_cell_area_box_pack_end().
90  */
91 public class CellAreaBox : CellArea, OrientableIF
92 {
93 	
94 	/** the main Gtk struct */
95 	protected GtkCellAreaBox* gtkCellAreaBox;
96 	
97 	
98 	/** Get the main Gtk struct */
99 	public GtkCellAreaBox* getCellAreaBoxStruct()
100 	{
101 		return gtkCellAreaBox;
102 	}
103 	
104 	
105 	/** the main Gtk struct as a void* */
106 	protected override void* getStruct()
107 	{
108 		return cast(void*)gtkCellAreaBox;
109 	}
110 	
111 	/**
112 	 * Sets our main struct and passes it to the parent class
113 	 */
114 	public this (GtkCellAreaBox* gtkCellAreaBox)
115 	{
116 		super(cast(GtkCellArea*)gtkCellAreaBox);
117 		this.gtkCellAreaBox = gtkCellAreaBox;
118 	}
119 	
120 	protected override void setStruct(GObject* obj)
121 	{
122 		super.setStruct(obj);
123 		gtkCellAreaBox = cast(GtkCellAreaBox*)obj;
124 	}
125 	
126 	// add the Orientable capabilities
127 	mixin OrientableT!(GtkCellAreaBox);
128 	
129 	/**
130 	 */
131 	
132 	/**
133 	 * Creates a new GtkCellAreaBox.
134 	 * Throws: ConstructionException GTK+ fails to create the object.
135 	 */
136 	public this ()
137 	{
138 		// GtkCellArea * gtk_cell_area_box_new (void);
139 		auto p = gtk_cell_area_box_new();
140 		if(p is null)
141 		{
142 			throw new ConstructionException("null returned by gtk_cell_area_box_new()");
143 		}
144 		this(cast(GtkCellAreaBox*) p);
145 	}
146 	
147 	/**
148 	 * Adds renderer to box, packed with reference to the start of box.
149 	 * The renderer is packed after any other GtkCellRenderer packed
150 	 * with reference to the start of box.
151 	 * Params:
152 	 * renderer = the GtkCellRenderer to add
153 	 * expand = whether renderer should receive extra space when the area receives
154 	 * more than its natural size
155 	 * fixed = whether renderer should have the same size in all rows
156 	 * Since 3.0
157 	 */
158 	public void packStart(CellRenderer renderer, int expand, int alig, int fixed)
159 	{
160 		// void gtk_cell_area_box_pack_start (GtkCellAreaBox *box,  GtkCellRenderer *renderer,  gboolean expand,  gboolean align,  gboolean fixed);
161 		gtk_cell_area_box_pack_start(gtkCellAreaBox, (renderer is null) ? null : renderer.getCellRendererStruct(), expand, alig, fixed);
162 	}
163 	
164 	/**
165 	 * Adds renderer to box, packed with reference to the end of box.
166 	 * The renderer is packed after (away from end of) any other
167 	 * GtkCellRenderer packed with reference to the end of box.
168 	 * Params:
169 	 * renderer = the GtkCellRenderer to add
170 	 * expand = whether renderer should receive extra space when the area receives
171 	 * more than its natural size
172 	 * fixed = whether renderer should have the same size in all rows
173 	 * Since 3.0
174 	 */
175 	public void packEnd(CellRenderer renderer, int expand, int alig, int fixed)
176 	{
177 		// void gtk_cell_area_box_pack_end (GtkCellAreaBox *box,  GtkCellRenderer *renderer,  gboolean expand,  gboolean align,  gboolean fixed);
178 		gtk_cell_area_box_pack_end(gtkCellAreaBox, (renderer is null) ? null : renderer.getCellRendererStruct(), expand, alig, fixed);
179 	}
180 	
181 	/**
182 	 * Gets the spacing added between cell renderers.
183 	 * Returns: the space added between cell renderers in box. Since 3.0
184 	 */
185 	public int getSpacing()
186 	{
187 		// gint gtk_cell_area_box_get_spacing (GtkCellAreaBox *box);
188 		return gtk_cell_area_box_get_spacing(gtkCellAreaBox);
189 	}
190 	
191 	/**
192 	 * Sets the spacing to add between cell renderers in box.
193 	 * Params:
194 	 * spacing = the space to add between GtkCellRenderers
195 	 * Since 3.0
196 	 */
197 	public void setSpacing(int spacing)
198 	{
199 		// void gtk_cell_area_box_set_spacing (GtkCellAreaBox *box,  gint spacing);
200 		gtk_cell_area_box_set_spacing(gtkCellAreaBox, spacing);
201 	}
202 }