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.CellAreaBox; 26 27 private import glib.ConstructionException; 28 private import gobject.ObjectG; 29 private import gtk.CellArea; 30 private import gtk.CellRenderer; 31 private import gtk.OrientableIF; 32 private import gtk.OrientableT; 33 private import gtk.c.functions; 34 public import gtk.c.types; 35 36 37 /** 38 * A cell area that renders GtkCellRenderers into a row or a column 39 * 40 * The #GtkCellAreaBox renders cell renderers into a row or a column 41 * depending on its #GtkOrientation. 42 * 43 * GtkCellAreaBox uses a notion of packing. Packing 44 * refers to adding cell renderers with reference to a particular position 45 * in a #GtkCellAreaBox. There are two reference positions: the 46 * start and the end of the box. 47 * When the #GtkCellAreaBox is oriented in the %GTK_ORIENTATION_VERTICAL 48 * orientation, the start is defined as the top of the box and the end is 49 * defined as the bottom. In the %GTK_ORIENTATION_HORIZONTAL orientation 50 * start is defined as the left side and the end is defined as the right 51 * side. 52 * 53 * Alignments of #GtkCellRenderers rendered in adjacent rows can be 54 * configured by configuring the #GtkCellAreaBox align child cell property 55 * with gtk_cell_area_cell_set_property() or by specifying the "align" 56 * argument to gtk_cell_area_box_pack_start() and gtk_cell_area_box_pack_end(). 57 */ 58 public class CellAreaBox : CellArea, OrientableIF 59 { 60 /** the main Gtk struct */ 61 protected GtkCellAreaBox* gtkCellAreaBox; 62 63 /** Get the main Gtk struct */ 64 public GtkCellAreaBox* getCellAreaBoxStruct(bool transferOwnership = false) 65 { 66 if (transferOwnership) 67 ownedRef = false; 68 return gtkCellAreaBox; 69 } 70 71 /** the main Gtk struct as a void* */ 72 protected override void* getStruct() 73 { 74 return cast(void*)gtkCellAreaBox; 75 } 76 77 /** 78 * Sets our main struct and passes it to the parent class. 79 */ 80 public this (GtkCellAreaBox* gtkCellAreaBox, bool ownedRef = false) 81 { 82 this.gtkCellAreaBox = gtkCellAreaBox; 83 super(cast(GtkCellArea*)gtkCellAreaBox, ownedRef); 84 } 85 86 // add the Orientable capabilities 87 mixin OrientableT!(GtkCellAreaBox); 88 89 90 /** */ 91 public static GType getType() 92 { 93 return gtk_cell_area_box_get_type(); 94 } 95 96 /** 97 * Creates a new #GtkCellAreaBox. 98 * 99 * Returns: a newly created #GtkCellAreaBox 100 * 101 * Throws: ConstructionException GTK+ fails to create the object. 102 */ 103 public this() 104 { 105 auto __p = gtk_cell_area_box_new(); 106 107 if(__p is null) 108 { 109 throw new ConstructionException("null returned by new"); 110 } 111 112 this(cast(GtkCellAreaBox*) __p); 113 } 114 115 /** 116 * Gets the spacing added between cell renderers. 117 * 118 * Returns: the space added between cell renderers in @box. 119 */ 120 public int getSpacing() 121 { 122 return gtk_cell_area_box_get_spacing(gtkCellAreaBox); 123 } 124 125 /** 126 * Adds @renderer to @box, packed with reference to the end of @box. 127 * 128 * The @renderer is packed after (away from end of) any other 129 * #GtkCellRenderer packed with reference to the end of @box. 130 * 131 * Params: 132 * renderer = the #GtkCellRenderer to add 133 * expand = whether @renderer should receive extra space when the area receives 134 * more than its natural size 135 * align_ = whether @renderer should be aligned in adjacent rows 136 * fixed = whether @renderer should have the same size in all rows 137 */ 138 public void packEnd(CellRenderer renderer, bool expand, bool align_, bool fixed) 139 { 140 gtk_cell_area_box_pack_end(gtkCellAreaBox, (renderer is null) ? null : renderer.getCellRendererStruct(), expand, align_, fixed); 141 } 142 143 /** 144 * Adds @renderer to @box, packed with reference to the start of @box. 145 * 146 * The @renderer is packed after any other #GtkCellRenderer packed 147 * with reference to the start of @box. 148 * 149 * Params: 150 * renderer = the #GtkCellRenderer to add 151 * expand = whether @renderer should receive extra space when the area receives 152 * more than its natural size 153 * align_ = whether @renderer should be aligned in adjacent rows 154 * fixed = whether @renderer should have the same size in all rows 155 */ 156 public void packStart(CellRenderer renderer, bool expand, bool align_, bool fixed) 157 { 158 gtk_cell_area_box_pack_start(gtkCellAreaBox, (renderer is null) ? null : renderer.getCellRendererStruct(), expand, align_, fixed); 159 } 160 161 /** 162 * Sets the spacing to add between cell renderers in @box. 163 * 164 * Params: 165 * spacing = the space to add between #GtkCellRenderers 166 */ 167 public void setSpacing(int spacing) 168 { 169 gtk_cell_area_box_set_spacing(gtkCellAreaBox, spacing); 170 } 171 }