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