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.FixedLayout;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.LayoutManager;
30 private import gtk.c.functions;
31 public  import gtk.c.types;
32 
33 
34 /**
35  * `GtkFixedLayout` is a layout manager which can place child widgets
36  * at fixed positions.
37  * 
38  * Most applications should never use this layout manager; fixed positioning
39  * and sizing requires constant recalculations on where children need to be
40  * positioned and sized. Other layout managers perform this kind of work
41  * internally so that application developers don't need to do it. Specifically,
42  * widgets positioned in a fixed layout manager will need to take into account:
43  * 
44  * - Themes, which may change widget sizes.
45  * 
46  * - Fonts other than the one you used to write the app will of course
47  * change the size of widgets containing text; keep in mind that
48  * users may use a larger font because of difficulty reading the
49  * default, or they may be using a different OS that provides different
50  * fonts.
51  * 
52  * - Translation of text into other languages changes its size. Also,
53  * display of non-English text will use a different font in many
54  * cases.
55  * 
56  * In addition, `GtkFixedLayout` does not pay attention to text direction and
57  * thus may produce unwanted results if your app is run under right-to-left
58  * languages such as Hebrew or Arabic. That is: normally GTK will order
59  * containers appropriately depending on the text direction, e.g. to put labels
60  * to the right of the thing they label when using an RTL language;
61  * `GtkFixedLayout` won't be able to do that for you.
62  * 
63  * Finally, fixed positioning makes it kind of annoying to add/remove UI
64  * elements, since you have to reposition all the other  elements. This is a
65  * long-term maintenance problem for your application.
66  */
67 public class FixedLayout : LayoutManager
68 {
69 	/** the main Gtk struct */
70 	protected GtkFixedLayout* gtkFixedLayout;
71 
72 	/** Get the main Gtk struct */
73 	public GtkFixedLayout* getFixedLayoutStruct(bool transferOwnership = false)
74 	{
75 		if (transferOwnership)
76 			ownedRef = false;
77 		return gtkFixedLayout;
78 	}
79 
80 	/** the main Gtk struct as a void* */
81 	protected override void* getStruct()
82 	{
83 		return cast(void*)gtkFixedLayout;
84 	}
85 
86 	/**
87 	 * Sets our main struct and passes it to the parent class.
88 	 */
89 	public this (GtkFixedLayout* gtkFixedLayout, bool ownedRef = false)
90 	{
91 		this.gtkFixedLayout = gtkFixedLayout;
92 		super(cast(GtkLayoutManager*)gtkFixedLayout, ownedRef);
93 	}
94 
95 
96 	/** */
97 	public static GType getType()
98 	{
99 		return gtk_fixed_layout_get_type();
100 	}
101 
102 	/**
103 	 * Creates a new `GtkFixedLayout`.
104 	 *
105 	 * Returns: the newly created `GtkFixedLayout`
106 	 *
107 	 * Throws: ConstructionException GTK+ fails to create the object.
108 	 */
109 	public this()
110 	{
111 		auto __p = gtk_fixed_layout_new();
112 
113 		if(__p is null)
114 		{
115 			throw new ConstructionException("null returned by new");
116 		}
117 
118 		this(cast(GtkFixedLayout*) __p, true);
119 	}
120 }