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