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 = GtkMisc.html 27 * outPack = gtk 28 * outFile = Misc 29 * strct = GtkMisc 30 * realStrct= 31 * ctorStrct= 32 * clss = Misc 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_misc_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * structWrap: 47 * module aliases: 48 * local aliases: 49 * overrides: 50 */ 51 52 module gtk.Misc; 53 54 public import gtkc.gtktypes; 55 56 private import gtkc.gtk; 57 private import glib.ConstructionException; 58 private import gobject.ObjectG; 59 60 61 62 private import gtk.Widget; 63 64 /** 65 * The GtkMisc widget is an abstract widget which is not useful itself, but 66 * is used to derive subclasses which have alignment and padding attributes. 67 * 68 * The horizontal and vertical padding attributes allows extra space to be 69 * added around the widget. 70 * 71 * The horizontal and vertical alignment attributes enable the widget to be 72 * positioned within its allocated area. Note that if the widget is added to 73 * a container in such a way that it expands automatically to fill its 74 * allocated area, the alignment settings will not alter the widgets position. 75 * 76 * Note 77 * 78 * Note that the desired effect can in most cases be achieved by using the 79 * "halign", "valign" and "margin" properties 80 * on the child widget, so GtkMisc should not be used in new code. 81 */ 82 public class Misc : Widget 83 { 84 85 /** the main Gtk struct */ 86 protected GtkMisc* gtkMisc; 87 88 89 /** Get the main Gtk struct */ 90 public GtkMisc* getMiscStruct() 91 { 92 return gtkMisc; 93 } 94 95 96 /** the main Gtk struct as a void* */ 97 protected override void* getStruct() 98 { 99 return cast(void*)gtkMisc; 100 } 101 102 /** 103 * Sets our main struct and passes it to the parent class 104 */ 105 public this (GtkMisc* gtkMisc) 106 { 107 super(cast(GtkWidget*)gtkMisc); 108 this.gtkMisc = gtkMisc; 109 } 110 111 protected override void setStruct(GObject* obj) 112 { 113 super.setStruct(obj); 114 gtkMisc = cast(GtkMisc*)obj; 115 } 116 117 /** 118 */ 119 120 /** 121 * Sets the alignment of the widget. 122 * Params: 123 * xalign = the horizontal alignment, from 0 (left) to 1 (right). 124 * yalign = the vertical alignment, from 0 (top) to 1 (bottom). 125 */ 126 public void setAlignment(float xalign, float yalign) 127 { 128 // void gtk_misc_set_alignment (GtkMisc *misc, gfloat xalign, gfloat yalign); 129 gtk_misc_set_alignment(gtkMisc, xalign, yalign); 130 } 131 132 /** 133 * Sets the amount of space to add around the widget. 134 * Params: 135 * xpad = the amount of space to add on the left and right of the widget, 136 * in pixels. 137 * ypad = the amount of space to add on the top and bottom of the widget, 138 * in pixels. 139 */ 140 public void setPadding(int xpad, int ypad) 141 { 142 // void gtk_misc_set_padding (GtkMisc *misc, gint xpad, gint ypad); 143 gtk_misc_set_padding(gtkMisc, xpad, ypad); 144 } 145 146 /** 147 * Gets the X and Y alignment of the widget within its allocation. 148 * See gtk_misc_set_alignment(). 149 * Params: 150 * xalign = location to store X alignment of misc, or NULL. [out][allow-none] 151 * yalign = location to store Y alignment of misc, or NULL. [out][allow-none] 152 */ 153 public void getAlignment(out float xalign, out float yalign) 154 { 155 // void gtk_misc_get_alignment (GtkMisc *misc, gfloat *xalign, gfloat *yalign); 156 gtk_misc_get_alignment(gtkMisc, &xalign, &yalign); 157 } 158 159 /** 160 * Gets the padding in the X and Y directions of the widget. 161 * See gtk_misc_set_padding(). 162 * Params: 163 * xpad = location to store padding in the X 164 * direction, or NULL. [out][allow-none] 165 * ypad = location to store padding in the Y 166 * direction, or NULL. [out][allow-none] 167 */ 168 public void getPadding(out int xpad, out int ypad) 169 { 170 // void gtk_misc_get_padding (GtkMisc *misc, gint *xpad, gint *ypad); 171 gtk_misc_get_padding(gtkMisc, &xpad, &ypad); 172 } 173 }