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