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