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