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.CellRendererPixbuf;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.CellRenderer;
30 private import gtk.c.functions;
31 public  import gtk.c.types;
32 public  import gtkc.gtktypes;
33 
34 
35 /**
36  * A #GtkCellRendererPixbuf can be used to render an image in a cell. It allows
37  * to render either a given #GdkPixbuf (set via the
38  * #GtkCellRendererPixbuf:pixbuf property) or a named icon (set via the
39  * #GtkCellRendererPixbuf:icon-name property).
40  * 
41  * To support the tree view, #GtkCellRendererPixbuf also supports rendering two
42  * alternative pixbufs, when the #GtkCellRenderer:is-expander property is %TRUE.
43  * If the #GtkCellRenderer:is-expanded property is %TRUE and the
44  * #GtkCellRendererPixbuf:pixbuf-expander-open property is set to a pixbuf, it
45  * renders that pixbuf, if the #GtkCellRenderer:is-expanded property is %FALSE
46  * and the #GtkCellRendererPixbuf:pixbuf-expander-closed property is set to a
47  * pixbuf, it renders that one.
48  */
49 public class CellRendererPixbuf : CellRenderer
50 {
51 	/** the main Gtk struct */
52 	protected GtkCellRendererPixbuf* gtkCellRendererPixbuf;
53 
54 	/** Get the main Gtk struct */
55 	public GtkCellRendererPixbuf* getCellRendererPixbufStruct(bool transferOwnership = false)
56 	{
57 		if (transferOwnership)
58 			ownedRef = false;
59 		return gtkCellRendererPixbuf;
60 	}
61 
62 	/** the main Gtk struct as a void* */
63 	protected override void* getStruct()
64 	{
65 		return cast(void*)gtkCellRendererPixbuf;
66 	}
67 
68 	/**
69 	 * Sets our main struct and passes it to the parent class.
70 	 */
71 	public this (GtkCellRendererPixbuf* gtkCellRendererPixbuf, bool ownedRef = false)
72 	{
73 		this.gtkCellRendererPixbuf = gtkCellRendererPixbuf;
74 		super(cast(GtkCellRenderer*)gtkCellRendererPixbuf, ownedRef);
75 	}
76 
77 
78 	/** */
79 	public static GType getType()
80 	{
81 		return gtk_cell_renderer_pixbuf_get_type();
82 	}
83 
84 	/**
85 	 * Creates a new #GtkCellRendererPixbuf. Adjust rendering
86 	 * parameters using object properties. Object properties can be set
87 	 * globally (with g_object_set()). Also, with #GtkTreeViewColumn, you
88 	 * can bind a property to a value in a #GtkTreeModel. For example, you
89 	 * can bind the “pixbuf” property on the cell renderer to a pixbuf value
90 	 * in the model, thus rendering a different image in each row of the
91 	 * #GtkTreeView.
92 	 *
93 	 * Returns: the new cell renderer
94 	 *
95 	 * Throws: ConstructionException GTK+ fails to create the object.
96 	 */
97 	public this()
98 	{
99 		auto p = gtk_cell_renderer_pixbuf_new();
100 
101 		if(p is null)
102 		{
103 			throw new ConstructionException("null returned by new");
104 		}
105 
106 		this(cast(GtkCellRendererPixbuf*) p);
107 	}
108 }