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()
55 	{
56 		return gtkCellRendererPixbuf;
57 	}
58 
59 	/** the main Gtk struct as a void* */
60 	protected override void* getStruct()
61 	{
62 		return cast(void*)gtkCellRendererPixbuf;
63 	}
64 
65 	protected override void setStruct(GObject* obj)
66 	{
67 		gtkCellRendererPixbuf = cast(GtkCellRendererPixbuf*)obj;
68 		super.setStruct(obj);
69 	}
70 
71 	/**
72 	 * Sets our main struct and passes it to the parent class.
73 	 */
74 	public this (GtkCellRendererPixbuf* gtkCellRendererPixbuf, bool ownedRef = false)
75 	{
76 		this.gtkCellRendererPixbuf = gtkCellRendererPixbuf;
77 		super(cast(GtkCellRenderer*)gtkCellRendererPixbuf, ownedRef);
78 	}
79 
80 
81 	/** */
82 	public static GType getType()
83 	{
84 		return gtk_cell_renderer_pixbuf_get_type();
85 	}
86 
87 	/**
88 	 * Creates a new #GtkCellRendererPixbuf. Adjust rendering
89 	 * parameters using object properties. Object properties can be set
90 	 * globally (with g_object_set()). Also, with #GtkTreeViewColumn, you
91 	 * can bind a property to a value in a #GtkTreeModel. For example, you
92 	 * can bind the “pixbuf” property on the cell renderer to a pixbuf value
93 	 * in the model, thus rendering a different image in each row of the
94 	 * #GtkTreeView.
95 	 *
96 	 * Return: the new cell renderer
97 	 *
98 	 * Throws: ConstructionException GTK+ fails to create the object.
99 	 */
100 	public this()
101 	{
102 		auto p = gtk_cell_renderer_pixbuf_new();
103 		
104 		if(p is null)
105 		{
106 			throw new ConstructionException("null returned by new");
107 		}
108 		
109 		this(cast(GtkCellRendererPixbuf*) p);
110 	}
111 }