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 gdk.ToplevelSize;
26 
27 private import gdk.c.functions;
28 public  import gdk.c.types;
29 
30 
31 /**
32  * The `GdkToplevelSize` struct contains information that is useful
33  * to compute the size of a toplevel.
34  */
35 public class ToplevelSize
36 {
37 	/** the main Gtk struct */
38 	protected GdkToplevelSize* gdkToplevelSize;
39 	protected bool ownedRef;
40 
41 	/** Get the main Gtk struct */
42 	public GdkToplevelSize* getToplevelSizeStruct(bool transferOwnership = false)
43 	{
44 		if (transferOwnership)
45 			ownedRef = false;
46 		return gdkToplevelSize;
47 	}
48 
49 	/** the main Gtk struct as a void* */
50 	protected void* getStruct()
51 	{
52 		return cast(void*)gdkToplevelSize;
53 	}
54 
55 	/**
56 	 * Sets our main struct and passes it to the parent class.
57 	 */
58 	public this (GdkToplevelSize* gdkToplevelSize, bool ownedRef = false)
59 	{
60 		this.gdkToplevelSize = gdkToplevelSize;
61 		this.ownedRef = ownedRef;
62 	}
63 
64 
65 	/**
66 	 * Retrieves the bounds the toplevel is placed within.
67 	 *
68 	 * The bounds represent the largest size a toplevel may have while still being
69 	 * able to fit within some type of boundary. Depending on the backend, this may
70 	 * be equivalent to the dimensions of the work area or the monitor on which the
71 	 * window is being presented on, or something else that limits the way a
72 	 * toplevel can be presented.
73 	 *
74 	 * Params:
75 	 *     boundsWidth = return location for width
76 	 *     boundsHeight = return location for height
77 	 */
78 	public void getBounds(out int boundsWidth, out int boundsHeight)
79 	{
80 		gdk_toplevel_size_get_bounds(gdkToplevelSize, &boundsWidth, &boundsHeight);
81 	}
82 
83 	/**
84 	 * Sets the minimum size of the toplevel.
85 	 *
86 	 * The minimum size corresponds to the limitations the toplevel can be shrunk
87 	 * to, without resulting in incorrect painting. A user of a `GdkToplevel` should
88 	 * calculate these given both the existing size, and the bounds retrieved from
89 	 * the `GdkToplevelSize` object.
90 	 *
91 	 * The minimum size should be within the bounds (see
92 	 * [method@Gdk.ToplevelSize.get_bounds]).
93 	 *
94 	 * Params:
95 	 *     minWidth = the minimum width
96 	 *     minHeight = the minimum height
97 	 */
98 	public void setMinSize(int minWidth, int minHeight)
99 	{
100 		gdk_toplevel_size_set_min_size(gdkToplevelSize, minWidth, minHeight);
101 	}
102 
103 	/**
104 	 * Sets the shadows size of the toplevel.
105 	 *
106 	 * The shadow width corresponds to the part of the computed surface size
107 	 * that would consist of the shadow margin surrounding the window, would
108 	 * there be any.
109 	 *
110 	 * Params:
111 	 *     left = width of the left part of the shadow
112 	 *     right = width of the right part of the shadow
113 	 *     top = height of the top part of the shadow
114 	 *     bottom = height of the bottom part of the shadow
115 	 */
116 	public void setShadowWidth(int left, int right, int top, int bottom)
117 	{
118 		gdk_toplevel_size_set_shadow_width(gdkToplevelSize, left, right, top, bottom);
119 	}
120 
121 	/**
122 	 * Sets the size the toplevel prefers to be resized to.
123 	 *
124 	 * The size should be within the bounds (see
125 	 * [method@Gdk.ToplevelSize.get_bounds]). The set size should
126 	 * be considered as a hint, and should not be assumed to be
127 	 * respected by the windowing system, or backend.
128 	 *
129 	 * Params:
130 	 *     width = the width
131 	 *     height = the height
132 	 */
133 	public void setSize(int width, int height)
134 	{
135 		gdk_toplevel_size_set_size(gdkToplevelSize, width, height);
136 	}
137 }