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  = GtkFixed.html
27  * outPack = gtk
28  * outFile = Fixed
29  * strct   = GtkFixed
30  * realStrct=
31  * ctorStrct=
32  * clss    = Fixed
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_fixed_
41  * 	- gtk_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- gtk.Widget
48  * structWrap:
49  * 	- GtkWidget* -> Widget
50  * module aliases:
51  * local aliases:
52  * overrides:
53  * 	- getHasWindow
54  * 	- setHasWindow
55  */
56 
57 module gtk.Fixed;
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.Widget;
67 
68 
69 
70 private import gtk.Container;
71 
72 /**
73  * Description
74  * The GtkFixed widget is a container which can place child widgets at fixed
75  * positions and with fixed sizes, given in pixels. GtkFixed performs no
76  * automatic layout management.
77  * For most applications, you should not use this container! It keeps
78  * you from having to learn about the other GTK+ containers, but it
79  * results in broken applications.
80  * With GtkFixed, the following things will result in truncated text,
81  * overlapping widgets, and other display bugs:
82  * Themes, which may change widget sizes.
83  * Fonts other than the one you used to write the app will of
84  * course change the size of widgets containing text; keep in mind that
85  * users may use a larger font because of difficulty reading the default,
86  * or they may be using Windows or the framebuffer port of GTK+, where
87  * different fonts are available.
88  * Translation of text into other languages changes its size. Also,
89  * display of non-English text will use a different font in many cases.
90  * In addition, the fixed widget can't properly be mirrored in
91  * right-to-left languages such as Hebrew and Arabic. i.e. normally GTK+
92  * will flip the interface to put labels to the right of the thing they
93  * label, but it can't do that with GtkFixed. So your application will
94  * not be usable in right-to-left languages.
95  * Finally, fixed positioning makes it kind of annoying to add/remove GUI
96  * elements, since you have to reposition all the other elements. This is
97  * a long-term maintenance problem for your application.
98  * If you know none of these things are an issue for your application,
99  * and prefer the simplicity of GtkFixed, by all means use the
100  * widget. But you should be aware of the tradeoffs.
101  */
102 public class Fixed : Container
103 {
104 	
105 	/** the main Gtk struct */
106 	protected GtkFixed* gtkFixed;
107 	
108 	
109 	public GtkFixed* getFixedStruct()
110 	{
111 		return gtkFixed;
112 	}
113 	
114 	
115 	/** the main Gtk struct as a void* */
116 	protected override void* getStruct()
117 	{
118 		return cast(void*)gtkFixed;
119 	}
120 	
121 	/**
122 	 * Sets our main struct and passes it to the parent class
123 	 */
124 	public this (GtkFixed* gtkFixed)
125 	{
126 		super(cast(GtkContainer*)gtkFixed);
127 		this.gtkFixed = gtkFixed;
128 	}
129 	
130 	protected override void setStruct(GObject* obj)
131 	{
132 		super.setStruct(obj);
133 		gtkFixed = cast(GtkFixed*)obj;
134 	}
135 	
136 	/**
137 	 */
138 	
139 	/**
140 	 * Creates a new GtkFixed.
141 	 * Throws: ConstructionException GTK+ fails to create the object.
142 	 */
143 	public this ()
144 	{
145 		// GtkWidget * gtk_fixed_new (void);
146 		auto p = gtk_fixed_new();
147 		if(p is null)
148 		{
149 			throw new ConstructionException("null returned by gtk_fixed_new()");
150 		}
151 		this(cast(GtkFixed*) p);
152 	}
153 	
154 	/**
155 	 * Adds a widget to a GtkFixed container at the given position.
156 	 * Params:
157 	 * widget = the widget to add.
158 	 * x = the horizontal position to place the widget at.
159 	 * y = the vertical position to place the widget at.
160 	 */
161 	public void put(Widget widget, int x, int y)
162 	{
163 		// void gtk_fixed_put (GtkFixed *fixed,  GtkWidget *widget,  gint x,  gint y);
164 		gtk_fixed_put(gtkFixed, (widget is null) ? null : widget.getWidgetStruct(), x, y);
165 	}
166 	
167 	/**
168 	 * Moves a child of a GtkFixed container to the given position.
169 	 * Params:
170 	 * widget = the child widget.
171 	 * x = the horizontal position to move the widget to.
172 	 * y = the vertical position to move the widget to.
173 	 */
174 	public void move(Widget widget, int x, int y)
175 	{
176 		// void gtk_fixed_move (GtkFixed *fixed,  GtkWidget *widget,  gint x,  gint y);
177 		gtk_fixed_move(gtkFixed, (widget is null) ? null : widget.getWidgetStruct(), x, y);
178 	}
179 	
180 	/**
181 	 * Warning
182 	 * gtk_fixed_get_has_window has been deprecated since version 2.20 and should not be used in newly-written code. Use gtk_widget_get_has_window() instead.
183 	 * Gets whether the GtkFixed has its own GdkWindow.
184 	 * See gtk_fixed_set_has_window().
185 	 * Returns: TRUE if fixed has its own window.
186 	 */
187 	public override int getHasWindow()
188 	{
189 		// gboolean gtk_fixed_get_has_window (GtkFixed *fixed);
190 		return gtk_fixed_get_has_window(gtkFixed);
191 	}
192 	
193 	/**
194 	 * Warning
195 	 * gtk_fixed_set_has_window has been deprecated since version 2.20 and should not be used in newly-written code. Use gtk_widget_set_has_window() instead.
196 	 * Sets whether a GtkFixed widget is created with a separate
197 	 * GdkWindow for widget->window or not. (By default, it will be
198 	 * created with no separate GdkWindow). This function must be called
199 	 * while the GtkFixed is not realized, for instance, immediately after the
200 	 * window is created.
201 	 * This function was added to provide an easy migration path for
202 	 * older applications which may expect GtkFixed to have a separate window.
203 	 * Params:
204 	 * hasWindow = TRUE if a separate window should be created
205 	 * Child Property Details
206 	 * The "x" child property
207 	 *  "x" gint : Read / Write
208 	 * X position of child widget.
209 	 * Default value: 0
210 	 */
211 	public override void setHasWindow(int hasWindow)
212 	{
213 		// void gtk_fixed_set_has_window (GtkFixed *fixed,  gboolean has_window);
214 		gtk_fixed_set_has_window(gtkFixed, hasWindow);
215 	}
216 }