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