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  = GtkCellAreaContext.html
27  * outPack = gtk
28  * outFile = CellAreaContext
29  * strct   = GtkCellAreaContext
30  * realStrct=
31  * ctorStrct=
32  * clss    = CellAreaContext
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_cell_renderer_accel_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- gtk.CellArea
47  * structWrap:
48  * 	- GtkCellArea* -> CellArea
49  * module aliases:
50  * local aliases:
51  * overrides:
52  */
53 
54 module gtk.CellAreaContext;
55 
56 public  import gtkc.gtktypes;
57 
58 private import gtkc.gtk;
59 private import glib.ConstructionException;
60 private import gobject.ObjectG;
61 
62 private import gtk.CellArea;
63 
64 
65 private import gobject.ObjectG;
66 
67 /**
68  * The GtkCellAreaContext object is created by a given GtkCellArea
69  * implementation via its GtkCellAreaClass.create_context() virtual
70  * method and is used to store cell sizes and alignments for a series of
71  * GtkTreeModel rows that are requested and rendered in the same context.
72  *
73  * GtkCellLayout widgets can create any number of contexts in which to
74  * request and render groups of data rows. However, it's important that the
75  * same context which was used to request sizes for a given GtkTreeModel
76  * row also be used for the same row when calling other GtkCellArea APIs
77  * such as gtk_cell_area_render() and gtk_cell_area_event().
78  */
79 public class CellAreaContext : ObjectG
80 {
81 	
82 	/** the main Gtk struct */
83 	protected GtkCellAreaContext* gtkCellAreaContext;
84 	
85 	
86 	/** Get the main Gtk struct */
87 	public GtkCellAreaContext* getCellAreaContextStruct()
88 	{
89 		return gtkCellAreaContext;
90 	}
91 	
92 	
93 	/** the main Gtk struct as a void* */
94 	protected override void* getStruct()
95 	{
96 		return cast(void*)gtkCellAreaContext;
97 	}
98 	
99 	/**
100 	 * Sets our main struct and passes it to the parent class
101 	 */
102 	public this (GtkCellAreaContext* gtkCellAreaContext)
103 	{
104 		super(cast(GObject*)gtkCellAreaContext);
105 		this.gtkCellAreaContext = gtkCellAreaContext;
106 	}
107 	
108 	protected override void setStruct(GObject* obj)
109 	{
110 		super.setStruct(obj);
111 		gtkCellAreaContext = cast(GtkCellAreaContext*)obj;
112 	}
113 	
114 	/**
115 	 */
116 	
117 	/**
118 	 * Fetches the GtkCellArea this context was created by.
119 	 * This is generally unneeded by layouting widgets; however,
120 	 * it is important for the context implementation itself to
121 	 * fetch information about the area it is being used for.
122 	 * For instance at GtkCellAreaContextClass.allocate() time
123 	 * it's important to know details about any cell spacing
124 	 * that the GtkCellArea is configured with in order to
125 	 * compute a proper allocation.
126 	 * Returns: the GtkCellArea this context was created by. [transfer none] Since 3.0
127 	 */
128 	public CellArea gtkCellAreaContextGetArea()
129 	{
130 		// GtkCellArea * gtk_cell_area_context_get_area (GtkCellAreaContext *context);
131 		auto p = gtk_cell_area_context_get_area(gtkCellAreaContext);
132 		
133 		if(p is null)
134 		{
135 			return null;
136 		}
137 		
138 		return ObjectG.getDObject!(CellArea)(cast(GtkCellArea*) p);
139 	}
140 	
141 	/**
142 	 * Allocates a width and/or a height for all rows which are to be
143 	 * rendered with context.
144 	 * Usually allocation is performed only horizontally or sometimes
145 	 * vertically since a group of rows are usually rendered side by
146 	 * side vertically or horizontally and share either the same width
147 	 * or the same height. Sometimes they are allocated in both horizontal
148 	 * and vertical orientations producing a homogeneous effect of the
149 	 * rows. This is generally the case for GtkTreeView when
150 	 * "fixed-height-mode" is enabled.
151 	 * Since 3.0
152 	 * Params:
153 	 * width = the allocated width for all GtkTreeModel rows rendered
154 	 * with context, or -1.
155 	 * height = the allocated height for all GtkTreeModel rows rendered
156 	 * with context, or -1.
157 	 */
158 	public void gtkCellAreaContextAllocate(int width, int height)
159 	{
160 		// void gtk_cell_area_context_allocate (GtkCellAreaContext *context,  gint width,  gint height);
161 		gtk_cell_area_context_allocate(gtkCellAreaContext, width, height);
162 	}
163 	
164 	/**
165 	 * Resets any previously cached request and allocation
166 	 * data.
167 	 * When underlying GtkTreeModel data changes its
168 	 * important to reset the context if the content
169 	 * size is allowed to shrink. If the content size
170 	 * is only allowed to grow (this is usually an option
171 	 * for views rendering large data stores as a measure
172 	 * of optimization), then only the row that changed
173 	 * or was inserted needs to be (re)requested with
174 	 * gtk_cell_area_get_preferred_width().
175 	 * When the new overall size of the context requires
176 	 * that the allocated size changes (or whenever this
177 	 * allocation changes at all), the variable row
178 	 * sizes need to be re-requested for every row.
179 	 * For instance, if the rows are displayed all with
180 	 * the same width from top to bottom then a change
181 	 * in the allocated width necessitates a recalculation
182 	 * of all the displayed row heights using
183 	 * gtk_cell_area_get_preferred_height_for_width().
184 	 * Since 3.0
185 	 */
186 	public void gtkCellAreaContextReset()
187 	{
188 		// void gtk_cell_area_context_reset (GtkCellAreaContext *context);
189 		gtk_cell_area_context_reset(gtkCellAreaContext);
190 	}
191 	
192 	/**
193 	 * Gets the accumulative preferred width for all rows which have been
194 	 * requested with this context.
195 	 * After gtk_cell_area_context_reset() is called and/or before ever
196 	 * requesting the size of a GtkCellArea, the returned values are 0.
197 	 * Params:
198 	 * minimumWidth = location to store the minimum width,
199 	 * or NULL. [out][allow-none]
200 	 * naturalWidth = location to store the natural width,
201 	 * or NULL. [out][allow-none]
202 	 * Since 3.0
203 	 */
204 	public void gtkCellAreaContextGetPreferredWidth(out int minimumWidth, out int naturalWidth)
205 	{
206 		// void gtk_cell_area_context_get_preferred_width  (GtkCellAreaContext *context,  gint *minimum_width,  gint *natural_width);
207 		gtk_cell_area_context_get_preferred_width(gtkCellAreaContext, &minimumWidth, &naturalWidth);
208 	}
209 	
210 	/**
211 	 * Gets the accumulative preferred height for all rows which have been
212 	 * requested with this context.
213 	 * After gtk_cell_area_context_reset() is called and/or before ever
214 	 * requesting the size of a GtkCellArea, the returned values are 0.
215 	 * Params:
216 	 * minimumHeight = location to store the minimum height,
217 	 * or NULL. [out][allow-none]
218 	 * naturalHeight = location to store the natural height,
219 	 * or NULL. [out][allow-none]
220 	 * Since 3.0
221 	 */
222 	public void gtkCellAreaContextGetPreferredHeight(out int minimumHeight, out int naturalHeight)
223 	{
224 		// void gtk_cell_area_context_get_preferred_height  (GtkCellAreaContext *context,  gint *minimum_height,  gint *natural_height);
225 		gtk_cell_area_context_get_preferred_height(gtkCellAreaContext, &minimumHeight, &naturalHeight);
226 	}
227 	
228 	/**
229 	 * Gets the accumulative preferred height for width for all rows
230 	 * which have been requested for the same said width with this context.
231 	 * After gtk_cell_area_context_reset() is called and/or before ever
232 	 * requesting the size of a GtkCellArea, the returned values are -1.
233 	 * Params:
234 	 * width = a proposed width for allocation
235 	 * minimumHeight = location to store the minimum height,
236 	 * or NULL. [out][allow-none]
237 	 * naturalHeight = location to store the natural height,
238 	 * or NULL. [out][allow-none]
239 	 * Since 3.0
240 	 */
241 	public void gtkCellAreaContextGetPreferredHeightForWidth(int width, out int minimumHeight, out int naturalHeight)
242 	{
243 		// void gtk_cell_area_context_get_preferred_height_for_width  (GtkCellAreaContext *context,  gint width,  gint *minimum_height,  gint *natural_height);
244 		gtk_cell_area_context_get_preferred_height_for_width(gtkCellAreaContext, width, &minimumHeight, &naturalHeight);
245 	}
246 	
247 	/**
248 	 * Gets the accumulative preferred width for height for all rows which
249 	 * have been requested for the same said height with this context.
250 	 * After gtk_cell_area_context_reset() is called and/or before ever
251 	 * requesting the size of a GtkCellArea, the returned values are -1.
252 	 * Params:
253 	 * height = a proposed height for allocation
254 	 * minimumWidth = location to store the minimum width,
255 	 * or NULL. [out][allow-none]
256 	 * naturalWidth = location to store the natural width,
257 	 * or NULL. [out][allow-none]
258 	 * Since 3.0
259 	 */
260 	public void gtkCellAreaContextGetPreferredWidthForHeight(int height, out int minimumWidth, out int naturalWidth)
261 	{
262 		// void gtk_cell_area_context_get_preferred_width_for_height  (GtkCellAreaContext *context,  gint height,  gint *minimum_width,  gint *natural_width);
263 		gtk_cell_area_context_get_preferred_width_for_height(gtkCellAreaContext, height, &minimumWidth, &naturalWidth);
264 	}
265 	
266 	/**
267 	 * Fetches the current allocation size for context.
268 	 * If the context was not allocated in width or height, or if the
269 	 * context was recently reset with gtk_cell_area_context_reset(),
270 	 * the returned value will be -1.
271 	 * Params:
272 	 * width = location to store the allocated width, or NULL. [out][allow-none]
273 	 * height = location to store the allocated height, or NULL. [out][allow-none]
274 	 * Since 3.0
275 	 */
276 	public void gtkCellAreaContextGetAllocation(out int width, out int height)
277 	{
278 		// void gtk_cell_area_context_get_allocation  (GtkCellAreaContext *context,  gint *width,  gint *height);
279 		gtk_cell_area_context_get_allocation(gtkCellAreaContext, &width, &height);
280 	}
281 	
282 	/**
283 	 * Causes the minimum and/or natural width to grow if the new
284 	 * proposed sizes exceed the current minimum and natural width.
285 	 * This is used by GtkCellAreaContext implementations during
286 	 * the request process over a series of GtkTreeModel rows to
287 	 * progressively push the requested width over a series of
288 	 * gtk_cell_area_get_preferred_width() requests.
289 	 * Params:
290 	 * minimumWidth = the proposed new minimum width for context
291 	 * naturalWidth = the proposed new natural width for context
292 	 * Since 3.0
293 	 */
294 	public void gtkCellAreaContextPushPreferredWidth(int minimumWidth, int naturalWidth)
295 	{
296 		// void gtk_cell_area_context_push_preferred_width  (GtkCellAreaContext *context,  gint minimum_width,  gint natural_width);
297 		gtk_cell_area_context_push_preferred_width(gtkCellAreaContext, minimumWidth, naturalWidth);
298 	}
299 	
300 	/**
301 	 * Causes the minimum and/or natural height to grow if the new
302 	 * proposed sizes exceed the current minimum and natural height.
303 	 * This is used by GtkCellAreaContext implementations during
304 	 * the request process over a series of GtkTreeModel rows to
305 	 * progressively push the requested height over a series of
306 	 * gtk_cell_area_get_preferred_height() requests.
307 	 * Params:
308 	 * minimumHeight = the proposed new minimum height for context
309 	 * naturalHeight = the proposed new natural height for context
310 	 * Since 3.0
311 	 */
312 	public void gtkCellAreaContextPushPreferredHeight(int minimumHeight, int naturalHeight)
313 	{
314 		// void gtk_cell_area_context_push_preferred_height  (GtkCellAreaContext *context,  gint minimum_height,  gint natural_height);
315 		gtk_cell_area_context_push_preferred_height(gtkCellAreaContext, minimumHeight, naturalHeight);
316 	}
317 }