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 	public void setStockId(StockID stockId)
69 	{
70 		setStockId(cast(string)stockId);
71 	}
72 
73 	/**
74 	 */
75 
76 	/** */
77 	public static GType getType()
78 	{
79 		return gtk_source_gutter_renderer_pixbuf_get_type();
80 	}
81 
82 	/**
83 	 * Create a new #GtkSourceGutterRendererPixbuf.
84 	 *
85 	 * Returns: A #GtkSourceGutterRenderer
86 	 *
87 	 * Throws: ConstructionException GTK+ fails to create the object.
88 	 */
89 	public this()
90 	{
91 		auto p = gtk_source_gutter_renderer_pixbuf_new();
92 
93 		if(p is null)
94 		{
95 			throw new ConstructionException("null returned by new");
96 		}
97 
98 		this(cast(GtkSourceGutterRendererPixbuf*) p, true);
99 	}
100 
101 	/**
102 	 * Get the gicon of the renderer
103 	 *
104 	 * Returns: a #GIcon
105 	 */
106 	public IconIF getGicon()
107 	{
108 		auto p = gtk_source_gutter_renderer_pixbuf_get_gicon(gtkSourceGutterRendererPixbuf);
109 
110 		if(p is null)
111 		{
112 			return null;
113 		}
114 
115 		return ObjectG.getDObject!(IconIF)(cast(GIcon*) p);
116 	}
117 
118 	/** */
119 	public string getIconName()
120 	{
121 		return Str.toString(gtk_source_gutter_renderer_pixbuf_get_icon_name(gtkSourceGutterRendererPixbuf));
122 	}
123 
124 	/**
125 	 * Get the pixbuf of the renderer.
126 	 *
127 	 * Returns: a #GdkPixbuf
128 	 */
129 	public Pixbuf getPixbuf()
130 	{
131 		auto p = gtk_source_gutter_renderer_pixbuf_get_pixbuf(gtkSourceGutterRendererPixbuf);
132 
133 		if(p is null)
134 		{
135 			return null;
136 		}
137 
138 		return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p);
139 	}
140 
141 	/**
142 	 *
143 	 *
144 	 * Deprecated: Don't use this function.
145 	 *
146 	 * Returns: the stock id.
147 	 */
148 	public string getStockId()
149 	{
150 		return Str.toString(gtk_source_gutter_renderer_pixbuf_get_stock_id(gtkSourceGutterRendererPixbuf));
151 	}
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 	/** */
160 	public void setIconName(string iconName)
161 	{
162 		gtk_source_gutter_renderer_pixbuf_set_icon_name(gtkSourceGutterRendererPixbuf, Str.toStringz(iconName));
163 	}
164 
165 	/** */
166 	public void setPixbuf(Pixbuf pixbuf)
167 	{
168 		gtk_source_gutter_renderer_pixbuf_set_pixbuf(gtkSourceGutterRendererPixbuf, (pixbuf is null) ? null : pixbuf.getPixbufStruct());
169 	}
170 
171 	/**
172 	 *
173 	 *
174 	 * Deprecated: Don't use this function.
175 	 *
176 	 * Params:
177 	 *     stockId = the stock id
178 	 */
179 	public void setStockId(string stockId)
180 	{
181 		gtk_source_gutter_renderer_pixbuf_set_stock_id(gtkSourceGutterRendererPixbuf, Str.toStringz(stockId));
182 	}
183 }