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