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 gsv.SourceGutterRendererPixbuf;
26 
27 private import gdkpixbuf.Pixbuf;
28 private import gio.IconIF;
29 private import glib.ConstructionException;
30 private import glib.Str;
31 private import gobject.ObjectG;
32 private import gsv.SourceGutterRenderer;
33 private import gsv.c.functions;
34 public  import gsv.c.types;
35 public  import gsvc.gsvtypes;
36 
37 
38 /** */
39 public class SourceGutterRendererPixbuf : SourceGutterRenderer
40 {
41 	/** the main Gtk struct */
42 	protected GtkSourceGutterRendererPixbuf* gtkSourceGutterRendererPixbuf;
43 
44 	/** Get the main Gtk struct */
45 	public GtkSourceGutterRendererPixbuf* getSourceGutterRendererPixbufStruct(bool transferOwnership = false)
46 	{
47 		if (transferOwnership)
48 			ownedRef = false;
49 		return gtkSourceGutterRendererPixbuf;
50 	}
51 
52 	/** the main Gtk struct as a void* */
53 	protected override void* getStruct()
54 	{
55 		return cast(void*)gtkSourceGutterRendererPixbuf;
56 	}
57 
58 	/**
59 	 * Sets our main struct and passes it to the parent class.
60 	 */
61 	public this (GtkSourceGutterRendererPixbuf* gtkSourceGutterRendererPixbuf, bool ownedRef = false)
62 	{
63 		this.gtkSourceGutterRendererPixbuf = gtkSourceGutterRendererPixbuf;
64 		super(cast(GtkSourceGutterRenderer*)gtkSourceGutterRendererPixbuf, ownedRef);
65 	}
66 
67 
68 	/** */
69 	public static GType getType()
70 	{
71 		return gtk_source_gutter_renderer_pixbuf_get_type();
72 	}
73 
74 	/**
75 	 * Create a new #GtkSourceGutterRendererPixbuf.
76 	 *
77 	 * Returns: A #GtkSourceGutterRenderer
78 	 *
79 	 * Throws: ConstructionException GTK+ fails to create the object.
80 	 */
81 	public this()
82 	{
83 		auto p = gtk_source_gutter_renderer_pixbuf_new();
84 
85 		if(p is null)
86 		{
87 			throw new ConstructionException("null returned by new");
88 		}
89 
90 		this(cast(GtkSourceGutterRendererPixbuf*) p, true);
91 	}
92 
93 	/**
94 	 * Get the gicon of the renderer
95 	 *
96 	 * Returns: a #GIcon
97 	 */
98 	public IconIF getGicon()
99 	{
100 		auto p = gtk_source_gutter_renderer_pixbuf_get_gicon(gtkSourceGutterRendererPixbuf);
101 
102 		if(p is null)
103 		{
104 			return null;
105 		}
106 
107 		return ObjectG.getDObject!(IconIF)(cast(GIcon*) p);
108 	}
109 
110 	/** */
111 	public string getIconName()
112 	{
113 		return Str.toString(gtk_source_gutter_renderer_pixbuf_get_icon_name(gtkSourceGutterRendererPixbuf));
114 	}
115 
116 	/**
117 	 * Get the pixbuf of the renderer.
118 	 *
119 	 * Returns: a #GdkPixbuf
120 	 */
121 	public Pixbuf getPixbuf()
122 	{
123 		auto p = gtk_source_gutter_renderer_pixbuf_get_pixbuf(gtkSourceGutterRendererPixbuf);
124 
125 		if(p is null)
126 		{
127 			return null;
128 		}
129 
130 		return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p);
131 	}
132 
133 	/** */
134 	public void setGicon(IconIF icon)
135 	{
136 		gtk_source_gutter_renderer_pixbuf_set_gicon(gtkSourceGutterRendererPixbuf, (icon is null) ? null : icon.getIconStruct());
137 	}
138 
139 	/** */
140 	public void setIconName(string iconName)
141 	{
142 		gtk_source_gutter_renderer_pixbuf_set_icon_name(gtkSourceGutterRendererPixbuf, Str.toStringz(iconName));
143 	}
144 
145 	/** */
146 	public void setPixbuf(Pixbuf pixbuf)
147 	{
148 		gtk_source_gutter_renderer_pixbuf_set_pixbuf(gtkSourceGutterRendererPixbuf, (pixbuf is null) ? null : pixbuf.getPixbufStruct());
149 	}
150 }