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