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  = GtkCellRenderer.html
27  * outPack = gtk
28  * outFile = CellRenderer
29  * strct   = GtkCellRenderer
30  * realStrct=
31  * ctorStrct=
32  * clss    = CellRenderer
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_cell_renderer_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- cairo.Context
47  * 	- glib.Str
48  * 	- gdk.Event
49  * 	- gtk.CellEditable
50  * 	- gtk.CellEditableIF
51  * 	- gtk.Widget
52  * structWrap:
53  * 	- GdkEvent* -> Event
54  * 	- GtkCellEditable* -> CellEditableIF
55  * 	- GtkWidget* -> Widget
56  * 	- cairo_t* -> Context
57  * module aliases:
58  * local aliases:
59  * overrides:
60  */
61 
62 module gtk.CellRenderer;
63 
64 public  import gtkc.gtktypes;
65 
66 private import gtkc.gtk;
67 private import glib.ConstructionException;
68 private import gobject.ObjectG;
69 
70 private import gobject.Signals;
71 public  import gtkc.gdktypes;
72 
73 private import cairo.Context;
74 private import glib.Str;
75 private import gdk.Event;
76 private import gtk.CellEditable;
77 private import gtk.CellEditableIF;
78 private import gtk.Widget;
79 
80 
81 
82 private import gobject.ObjectG;
83 
84 /**
85  * The GtkCellRenderer is a base class of a set of objects used for
86  * rendering a cell to a cairo_t. These objects are used primarily by
87  * the GtkTreeView widget, though they aren't tied to them in any
88  * specific way. It is worth noting that GtkCellRenderer is not a
89  * GtkWidget and cannot be treated as such.
90  *
91  * The primary use of a GtkCellRenderer is for drawing a certain graphical
92  * elements on a cairo_t. Typically, one cell renderer is used to
93  * draw many cells on the screen. To this extent, it isn't expected that a
94  * CellRenderer keep any permanent state around. Instead, any state is set
95  * just prior to use using GObjects property system. Then, the
96  * cell is measured using gtk_cell_renderer_get_size(). Finally, the cell
97  * is rendered in the correct location using gtk_cell_renderer_render().
98  *
99  * There are a number of rules that must be followed when writing a new
100  * GtkCellRenderer. First and foremost, it's important that a certain set
101  * of properties will always yield a cell renderer of the same size,
102  * barring a GtkStyle change. The GtkCellRenderer also has a number of
103  * generic properties that are expected to be honored by all children.
104  *
105  * Beyond merely rendering a cell, cell renderers can optionally
106  * provide active user interface elements. A cell renderer can be
107  * activatable like GtkCellRendererToggle,
108  * which toggles when it gets activated by a mouse click, or it can be
109  * editable like GtkCellRendererText, which
110  * allows the user to edit the text using a GtkEntry.
111  * To make a cell renderer activatable or editable, you have to
112  * implement the GtkCellRendererClass.activate or
113  * GtkCellRendererClass.start_editing virtual functions, respectively.
114  *
115  * Many properties of GtkCellRenderer and its subclasses have a
116  * corresponding "set" property, e.g. "cell-background-set" corresponds
117  * to "cell-background". These "set" properties reflect whether a property
118  * has been set or not. You should not set them independently.
119  */
120 public class CellRenderer : ObjectG
121 {
122 	
123 	/** the main Gtk struct */
124 	protected GtkCellRenderer* gtkCellRenderer;
125 	
126 	
127 	public GtkCellRenderer* getCellRendererStruct()
128 	{
129 		return gtkCellRenderer;
130 	}
131 	
132 	
133 	/** the main Gtk struct as a void* */
134 	protected override void* getStruct()
135 	{
136 		return cast(void*)gtkCellRenderer;
137 	}
138 	
139 	/**
140 	 * Sets our main struct and passes it to the parent class
141 	 */
142 	public this (GtkCellRenderer* gtkCellRenderer)
143 	{
144 		super(cast(GObject*)gtkCellRenderer);
145 		this.gtkCellRenderer = gtkCellRenderer;
146 	}
147 	
148 	protected override void setStruct(GObject* obj)
149 	{
150 		super.setStruct(obj);
151 		gtkCellRenderer = cast(GtkCellRenderer*)obj;
152 	}
153 	
154 	/**
155 	 */
156 	int[string] connectedSignals;
157 	
158 	void delegate(CellRenderer)[] onEditingCanceledListeners;
159 	/**
160 	 * This signal gets emitted when the user cancels the process of editing a
161 	 * cell. For example, an editable cell renderer could be written to cancel
162 	 * editing when the user presses Escape.
163 	 * See also: gtk_cell_renderer_stop_editing().
164 	 * Since 2.4
165 	 */
166 	void addOnEditingCanceled(void delegate(CellRenderer) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
167 	{
168 		if ( !("editing-canceled" in connectedSignals) )
169 		{
170 			Signals.connectData(
171 			getStruct(),
172 			"editing-canceled",
173 			cast(GCallback)&callBackEditingCanceled,
174 			cast(void*)this,
175 			null,
176 			connectFlags);
177 			connectedSignals["editing-canceled"] = 1;
178 		}
179 		onEditingCanceledListeners ~= dlg;
180 	}
181 	extern(C) static void callBackEditingCanceled(GtkCellRenderer* rendererStruct, CellRenderer _cellRenderer)
182 	{
183 		foreach ( void delegate(CellRenderer) dlg ; _cellRenderer.onEditingCanceledListeners )
184 		{
185 			dlg(_cellRenderer);
186 		}
187 	}
188 	
189 	void delegate(CellEditableIF, string, CellRenderer)[] onEditingStartedListeners;
190 	/**
191 	 * This signal gets emitted when a cell starts to be edited.
192 	 * The intended use of this signal is to do special setup
193 	 * on editable, e.g. adding a GtkEntryCompletion or setting
194 	 * up additional columns in a GtkComboBox.
195 	 * Note that GTK+ doesn't guarantee that cell renderers will
196 	 * continue to use the same kind of widget for editing in future
197 	 * releases, therefore you should check the type of editable
198 	 * $(DDOC_COMMENT example)
199 	 * Since 2.6
200 	 * See Also
201 	 * GtkCellRendererText, GtkCellRendererPixbuf, GtkCellRendererToggle
202 	 */
203 	void addOnEditingStarted(void delegate(CellEditableIF, string, CellRenderer) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
204 	{
205 		if ( !("editing-started" in connectedSignals) )
206 		{
207 			Signals.connectData(
208 			getStruct(),
209 			"editing-started",
210 			cast(GCallback)&callBackEditingStarted,
211 			cast(void*)this,
212 			null,
213 			connectFlags);
214 			connectedSignals["editing-started"] = 1;
215 		}
216 		onEditingStartedListeners ~= dlg;
217 	}
218 	extern(C) static void callBackEditingStarted(GtkCellRenderer* rendererStruct, GtkCellEditable* editable, gchar* path, CellRenderer _cellRenderer)
219 	{
220 		foreach ( void delegate(CellEditableIF, string, CellRenderer) dlg ; _cellRenderer.onEditingStartedListeners )
221 		{
222 			dlg(ObjectG.getDObject!(CellEditable, CellEditableIF)(editable), Str.toString(path), _cellRenderer);
223 		}
224 	}
225 	
226 	
227 	/**
228 	 * Sets the type to be used for creating accessibles for cells rendered by
229 	 * cell renderers of renderer_class. Note that multiple accessibles will
230 	 * be created.
231 	 * This function should only be called from class init functions of cell
232 	 * renderers.
233 	 * Params:
234 	 * rendererClass = class to set the accessible type for
235 	 * type = The object type that implements the accessible for widget_class.
236 	 * The type must be a subtype of GtkRendererCellAccessible
237 	 */
238 	public static void classSetAccessibleType(GtkCellRendererClass* rendererClass, GType type)
239 	{
240 		// void gtk_cell_renderer_class_set_accessible_type  (GtkCellRendererClass *renderer_class,  GType type);
241 		gtk_cell_renderer_class_set_accessible_type(rendererClass, type);
242 	}
243 	
244 	/**
245 	 * Gets the aligned area used by cell inside cell_area. Used for finding
246 	 * the appropriate edit and focus rectangle.
247 	 * Params:
248 	 * cell = a GtkCellRenderer instance
249 	 * widget = the GtkWidget this cell will be rendering to
250 	 * flags = render flags
251 	 * cellArea = cell area which would be passed to gtk_cell_renderer_render()
252 	 * alignedArea = the return location for the space inside cell_area
253 	 * that would acually be used to render. [out]
254 	 * Since 3.0
255 	 */
256 	public void getAlignedArea(Widget widget, GtkCellRendererState flags, ref Rectangle cellArea, out Rectangle alignedArea)
257 	{
258 		// void gtk_cell_renderer_get_aligned_area (GtkCellRenderer *cell,  GtkWidget *widget,  GtkCellRendererState flags,  const GdkRectangle *cell_area,  GdkRectangle *aligned_area);
259 		gtk_cell_renderer_get_aligned_area(gtkCellRenderer, (widget is null) ? null : widget.getWidgetStruct(), flags, &cellArea, &alignedArea);
260 	}
261 	
262 	/**
263 	 * Warning
264 	 * gtk_cell_renderer_get_size has been deprecated since version 3.0 and should not be used in newly-written code. Use gtk_cell_renderer_get_preferred_size() instead.
265 	 * Obtains the width and height needed to render the cell. Used by view
266 	 * widgets to determine the appropriate size for the cell_area passed to
267 	 * gtk_cell_renderer_render(). If cell_area is not NULL, fills in the
268 	 * x and y offsets (if set) of the cell relative to this location.
269 	 * Please note that the values set in width and height, as well as those
270 	 * in x_offset and y_offset are inclusive of the xpad and ypad properties.
271 	 * Params:
272 	 * cell = a GtkCellRenderer
273 	 * widget = the widget the renderer is rendering to
274 	 * cellArea = The area a cell will be allocated, or NULL. [allow-none]
275 	 * xOffset = location to return x offset of cell relative to cell_area, or NULL. [out][allow-none]
276 	 * yOffset = location to return y offset of cell relative to cell_area, or NULL. [out][allow-none]
277 	 * width = location to return width needed to render a cell, or NULL. [out][allow-none]
278 	 * height = location to return height needed to render a cell, or NULL. [out][allow-none]
279 	 */
280 	public void getSize(Widget widget, Rectangle* cellArea, out int xOffset, out int yOffset, out int width, out int height)
281 	{
282 		// void gtk_cell_renderer_get_size (GtkCellRenderer *cell,  GtkWidget *widget,  const GdkRectangle *cell_area,  gint *x_offset,  gint *y_offset,  gint *width,  gint *height);
283 		gtk_cell_renderer_get_size(gtkCellRenderer, (widget is null) ? null : widget.getWidgetStruct(), cellArea, &xOffset, &yOffset, &width, &height);
284 	}
285 	
286 	/**
287 	 * Invokes the virtual render function of the GtkCellRenderer. The three
288 	 * passed-in rectangles are areas in cr. Most renderers will draw within
289 	 * cell_area; the xalign, yalign, xpad, and ypad fields of the GtkCellRenderer
290 	 * should be honored with respect to cell_area. background_area includes the
291 	 * blank space around the cell, and also the area containing the tree expander;
292 	 * so the background_area rectangles for all cells tile to cover the entire
293 	 * window.
294 	 * Params:
295 	 * cell = a GtkCellRenderer
296 	 * cr = a cairo context to draw to
297 	 * widget = the widget owning window
298 	 * backgroundArea = entire cell area (including tree expanders and maybe
299 	 * padding on the sides)
300 	 * cellArea = area normally rendered by a cell renderer
301 	 * flags = flags that affect rendering
302 	 */
303 	public void render(Context cr, Widget widget, ref Rectangle backgroundArea, ref Rectangle cellArea, GtkCellRendererState flags)
304 	{
305 		// void gtk_cell_renderer_render (GtkCellRenderer *cell,  cairo_t *cr,  GtkWidget *widget,  const GdkRectangle *background_area,  const GdkRectangle *cell_area,  GtkCellRendererState flags);
306 		gtk_cell_renderer_render(gtkCellRenderer, (cr is null) ? null : cr.getContextStruct(), (widget is null) ? null : widget.getWidgetStruct(), &backgroundArea, &cellArea, flags);
307 	}
308 	
309 	/**
310 	 * Passes an activate event to the cell renderer for possible processing.
311 	 * Some cell renderers may use events; for example, GtkCellRendererToggle
312 	 * toggles when it gets a mouse click.
313 	 * Params:
314 	 * cell = a GtkCellRenderer
315 	 * event = a GdkEvent
316 	 * widget = widget that received the event
317 	 * path = widget-dependent string representation of the event location;
318 	 * e.g. for GtkTreeView, a string representation of GtkTreePath
319 	 * backgroundArea = background area as passed to gtk_cell_renderer_render()
320 	 * cellArea = cell area as passed to gtk_cell_renderer_render()
321 	 * flags = render flags
322 	 * Returns: TRUE if the event was consumed/handled
323 	 */
324 	public int activate(Event event, Widget widget, string path, ref Rectangle backgroundArea, ref Rectangle cellArea, GtkCellRendererState flags)
325 	{
326 		// gboolean gtk_cell_renderer_activate (GtkCellRenderer *cell,  GdkEvent *event,  GtkWidget *widget,  const gchar *path,  const GdkRectangle *background_area,  const GdkRectangle *cell_area,  GtkCellRendererState flags);
327 		return gtk_cell_renderer_activate(gtkCellRenderer, (event is null) ? null : event.getEventStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(path), &backgroundArea, &cellArea, flags);
328 	}
329 	
330 	/**
331 	 * Passes an activate event to the cell renderer for possible processing.
332 	 * Params:
333 	 * cell = a GtkCellRenderer
334 	 * event = a GdkEvent
335 	 * widget = widget that received the event
336 	 * path = widget-dependent string representation of the event location;
337 	 * e.g. for GtkTreeView, a string representation of GtkTreePath
338 	 * backgroundArea = background area as passed to gtk_cell_renderer_render()
339 	 * cellArea = cell area as passed to gtk_cell_renderer_render()
340 	 * flags = render flags
341 	 * Returns: A new GtkCellEditable, or NULL. [transfer none]
342 	 */
343 	public CellEditableIF startEditing(Event event, Widget widget, string path, ref Rectangle backgroundArea, ref Rectangle cellArea, GtkCellRendererState flags)
344 	{
345 		// GtkCellEditable * gtk_cell_renderer_start_editing (GtkCellRenderer *cell,  GdkEvent *event,  GtkWidget *widget,  const gchar *path,  const GdkRectangle *background_area,  const GdkRectangle *cell_area,  GtkCellRendererState flags);
346 		auto p = gtk_cell_renderer_start_editing(gtkCellRenderer, (event is null) ? null : event.getEventStruct(), (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(path), &backgroundArea, &cellArea, flags);
347 		
348 		if(p is null)
349 		{
350 			return null;
351 		}
352 		
353 		return ObjectG.getDObject!(CellEditable, CellEditableIF)(cast(GtkCellEditable*) p);
354 	}
355 	
356 	/**
357 	 * Informs the cell renderer that the editing is stopped.
358 	 * If canceled is TRUE, the cell renderer will emit the
359 	 * "editing-canceled" signal.
360 	 * This function should be called by cell renderer implementations
361 	 * in response to the "editing-done" signal of
362 	 * GtkCellEditable.
363 	 * Since 2.6
364 	 * Params:
365 	 * canceled = TRUE if the editing has been canceled
366 	 */
367 	public void stopEditing(int canceled)
368 	{
369 		// void gtk_cell_renderer_stop_editing (GtkCellRenderer *cell,  gboolean canceled);
370 		gtk_cell_renderer_stop_editing(gtkCellRenderer, canceled);
371 	}
372 	
373 	/**
374 	 * Fills in width and height with the appropriate size of cell.
375 	 * Params:
376 	 * width = location to fill in with the fixed width of the cell, or NULL. [out][allow-none]
377 	 * height = location to fill in with the fixed height of the cell, or NULL. [out][allow-none]
378 	 */
379 	public void getFixedSize(out int width, out int height)
380 	{
381 		// void gtk_cell_renderer_get_fixed_size (GtkCellRenderer *cell,  gint *width,  gint *height);
382 		gtk_cell_renderer_get_fixed_size(gtkCellRenderer, &width, &height);
383 	}
384 	
385 	/**
386 	 * Sets the renderer size to be explicit, independent of the properties set.
387 	 * Params:
388 	 * width = the width of the cell renderer, or -1
389 	 * height = the height of the cell renderer, or -1
390 	 */
391 	public void setFixedSize(int width, int height)
392 	{
393 		// void gtk_cell_renderer_set_fixed_size (GtkCellRenderer *cell,  gint width,  gint height);
394 		gtk_cell_renderer_set_fixed_size(gtkCellRenderer, width, height);
395 	}
396 	
397 	/**
398 	 * Returns the cell renderer's visibility.
399 	 * Since 2.18
400 	 * Returns: TRUE if the cell renderer is visible
401 	 */
402 	public int getVisible()
403 	{
404 		// gboolean gtk_cell_renderer_get_visible (GtkCellRenderer *cell);
405 		return gtk_cell_renderer_get_visible(gtkCellRenderer);
406 	}
407 	
408 	/**
409 	 * Sets the cell renderer's visibility.
410 	 * Since 2.18
411 	 * Params:
412 	 * visible = the visibility of the cell
413 	 */
414 	public void setVisible(int visible)
415 	{
416 		// void gtk_cell_renderer_set_visible (GtkCellRenderer *cell,  gboolean visible);
417 		gtk_cell_renderer_set_visible(gtkCellRenderer, visible);
418 	}
419 	
420 	/**
421 	 * Returns the cell renderer's sensitivity.
422 	 * Since 2.18
423 	 * Returns: TRUE if the cell renderer is sensitive
424 	 */
425 	public int getSensitive()
426 	{
427 		// gboolean gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell);
428 		return gtk_cell_renderer_get_sensitive(gtkCellRenderer);
429 	}
430 	
431 	/**
432 	 * Sets the cell renderer's sensitivity.
433 	 * Since 2.18
434 	 * Params:
435 	 * sensitive = the sensitivity of the cell
436 	 */
437 	public void setSensitive(int sensitive)
438 	{
439 		// void gtk_cell_renderer_set_sensitive (GtkCellRenderer *cell,  gboolean sensitive);
440 		gtk_cell_renderer_set_sensitive(gtkCellRenderer, sensitive);
441 	}
442 	
443 	/**
444 	 * Fills in xalign and yalign with the appropriate values of cell.
445 	 * Since 2.18
446 	 * Params:
447 	 * xalign = location to fill in with the x alignment of the cell, or NULL. [out][allow-none]
448 	 * yalign = location to fill in with the y alignment of the cell, or NULL. [out][allow-none]
449 	 */
450 	public void getAlignment(out float xalign, out float yalign)
451 	{
452 		// void gtk_cell_renderer_get_alignment (GtkCellRenderer *cell,  gfloat *xalign,  gfloat *yalign);
453 		gtk_cell_renderer_get_alignment(gtkCellRenderer, &xalign, &yalign);
454 	}
455 	
456 	/**
457 	 * Sets the renderer's alignment within its available space.
458 	 * Since 2.18
459 	 * Params:
460 	 * xalign = the x alignment of the cell renderer
461 	 * yalign = the y alignment of the cell renderer
462 	 */
463 	public void setAlignment(float xalign, float yalign)
464 	{
465 		// void gtk_cell_renderer_set_alignment (GtkCellRenderer *cell,  gfloat xalign,  gfloat yalign);
466 		gtk_cell_renderer_set_alignment(gtkCellRenderer, xalign, yalign);
467 	}
468 	
469 	/**
470 	 * Fills in xpad and ypad with the appropriate values of cell.
471 	 * Since 2.18
472 	 * Params:
473 	 * xpad = location to fill in with the x padding of the cell, or NULL. [out][allow-none]
474 	 * ypad = location to fill in with the y padding of the cell, or NULL. [out][allow-none]
475 	 */
476 	public void getPadding(out int xpad, out int ypad)
477 	{
478 		// void gtk_cell_renderer_get_padding (GtkCellRenderer *cell,  gint *xpad,  gint *ypad);
479 		gtk_cell_renderer_get_padding(gtkCellRenderer, &xpad, &ypad);
480 	}
481 	
482 	/**
483 	 * Sets the renderer's padding.
484 	 * Since 2.18
485 	 * Params:
486 	 * xpad = the x padding of the cell renderer
487 	 * ypad = the y padding of the cell renderer
488 	 */
489 	public void setPadding(int xpad, int ypad)
490 	{
491 		// void gtk_cell_renderer_set_padding (GtkCellRenderer *cell,  gint xpad,  gint ypad);
492 		gtk_cell_renderer_set_padding(gtkCellRenderer, xpad, ypad);
493 	}
494 	
495 	/**
496 	 * Translates the cell renderer state to GtkStateFlags,
497 	 * based on the cell renderer and widget sensitivity, and
498 	 * the given GtkCellRendererState.
499 	 * Params:
500 	 * cell = a GtkCellRenderer, or NULL
501 	 * widget = a GtkWidget, or NULL
502 	 * cellState = cell renderer state
503 	 * Returns: the widget state flags applying to cell Since 3.0
504 	 */
505 	public GtkStateFlags getState(Widget widget, GtkCellRendererState cellState)
506 	{
507 		// GtkStateFlags gtk_cell_renderer_get_state (GtkCellRenderer *cell,  GtkWidget *widget,  GtkCellRendererState cell_state);
508 		return gtk_cell_renderer_get_state(gtkCellRenderer, (widget is null) ? null : widget.getWidgetStruct(), cellState);
509 	}
510 	
511 	/**
512 	 * Checks whether the cell renderer can do something when activated.
513 	 * Returns: TRUE if the cell renderer can do anything when activated Since 3.0
514 	 */
515 	public int isActivatable()
516 	{
517 		// gboolean gtk_cell_renderer_is_activatable (GtkCellRenderer *cell);
518 		return gtk_cell_renderer_is_activatable(gtkCellRenderer);
519 	}
520 	
521 	/**
522 	 * Retreives a renderer's natural size when rendered to widget.
523 	 * Params:
524 	 * widget = the GtkWidget this cell will be rendering to
525 	 * minimumSize = location to store the minimum size, or NULL. [out][allow-none]
526 	 * naturalSize = location to store the natural size, or NULL. [out][allow-none]
527 	 * Since 3.0
528 	 */
529 	public void getPreferredHeight(Widget widget, out int minimumSize, out int naturalSize)
530 	{
531 		// void gtk_cell_renderer_get_preferred_height  (GtkCellRenderer *cell,  GtkWidget *widget,  gint *minimum_size,  gint *natural_size);
532 		gtk_cell_renderer_get_preferred_height(gtkCellRenderer, (widget is null) ? null : widget.getWidgetStruct(), &minimumSize, &naturalSize);
533 	}
534 	
535 	/**
536 	 * Retreives a cell renderers's minimum and natural height if it were rendered to
537 	 * widget with the specified width.
538 	 * Params:
539 	 * widget = the GtkWidget this cell will be rendering to
540 	 * width = the size which is available for allocation
541 	 * minimumHeight = location for storing the minimum size, or NULL. [out][allow-none]
542 	 * naturalHeight = location for storing the preferred size, or NULL. [out][allow-none]
543 	 * Since 3.0
544 	 */
545 	public void getPreferredHeightForWidth(Widget widget, int width, out int minimumHeight, out int naturalHeight)
546 	{
547 		// void gtk_cell_renderer_get_preferred_height_for_width  (GtkCellRenderer *cell,  GtkWidget *widget,  gint width,  gint *minimum_height,  gint *natural_height);
548 		gtk_cell_renderer_get_preferred_height_for_width(gtkCellRenderer, (widget is null) ? null : widget.getWidgetStruct(), width, &minimumHeight, &naturalHeight);
549 	}
550 	
551 	/**
552 	 * Retrieves the minimum and natural size of a cell taking
553 	 * into account the widget's preference for height-for-width management.
554 	 * Params:
555 	 * widget = the GtkWidget this cell will be rendering to
556 	 * minimumSize = location for storing the minimum size, or NULL. [out][allow-none]
557 	 * naturalSize = location for storing the natural size, or NULL. [out][allow-none]
558 	 * Since 3.0
559 	 */
560 	public void getPreferredSize(Widget widget, out GtkRequisition minimumSize, out GtkRequisition naturalSize)
561 	{
562 		// void gtk_cell_renderer_get_preferred_size  (GtkCellRenderer *cell,  GtkWidget *widget,  GtkRequisition *minimum_size,  GtkRequisition *natural_size);
563 		gtk_cell_renderer_get_preferred_size(gtkCellRenderer, (widget is null) ? null : widget.getWidgetStruct(), &minimumSize, &naturalSize);
564 	}
565 	
566 	/**
567 	 * Retreives a renderer's natural size when rendered to widget.
568 	 * Params:
569 	 * widget = the GtkWidget this cell will be rendering to
570 	 * minimumSize = location to store the minimum size, or NULL. [out][allow-none]
571 	 * naturalSize = location to store the natural size, or NULL. [out][allow-none]
572 	 * Since 3.0
573 	 */
574 	public void getPreferredWidth(Widget widget, out int minimumSize, out int naturalSize)
575 	{
576 		// void gtk_cell_renderer_get_preferred_width  (GtkCellRenderer *cell,  GtkWidget *widget,  gint *minimum_size,  gint *natural_size);
577 		gtk_cell_renderer_get_preferred_width(gtkCellRenderer, (widget is null) ? null : widget.getWidgetStruct(), &minimumSize, &naturalSize);
578 	}
579 	
580 	/**
581 	 * Retreives a cell renderers's minimum and natural width if it were rendered to
582 	 * widget with the specified height.
583 	 * Params:
584 	 * widget = the GtkWidget this cell will be rendering to
585 	 * height = the size which is available for allocation
586 	 * minimumWidth = location for storing the minimum size, or NULL. [out][allow-none]
587 	 * naturalWidth = location for storing the preferred size, or NULL. [out][allow-none]
588 	 * Since 3.0
589 	 */
590 	public void getPreferredWidthForHeight(Widget widget, int height, out int minimumWidth, out int naturalWidth)
591 	{
592 		// void gtk_cell_renderer_get_preferred_width_for_height  (GtkCellRenderer *cell,  GtkWidget *widget,  gint height,  gint *minimum_width,  gint *natural_width);
593 		gtk_cell_renderer_get_preferred_width_for_height(gtkCellRenderer, (widget is null) ? null : widget.getWidgetStruct(), height, &minimumWidth, &naturalWidth);
594 	}
595 	
596 	/**
597 	 * Gets whether the cell renderer prefers a height-for-width layout
598 	 * or a width-for-height layout.
599 	 * Returns: The GtkSizeRequestMode preferred by this renderer. Since 3.0
600 	 */
601 	public GtkSizeRequestMode getRequestMode()
602 	{
603 		// GtkSizeRequestMode gtk_cell_renderer_get_request_mode (GtkCellRenderer *cell);
604 		return gtk_cell_renderer_get_request_mode(gtkCellRenderer);
605 	}
606 }