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 * Conversion parameters: 26 * inFile = gio-GBytesIcon.html 27 * outPack = gio 28 * outFile = BytesIcon 29 * strct = GBytesIcon 30 * realStrct= 31 * ctorStrct=GIcon 32 * clss = FileIcon 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - LoadableIconIF 40 * prefixes: 41 * - g_bytes_icon_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - glib.Bytes 48 * - gio.LoadableIconT 49 * - gio.LoadableIconIF 50 * structWrap: 51 * - GBytes* -> Bytes 52 * module aliases: 53 * local aliases: 54 * overrides: 55 */ 56 57 module gio.BytesIcon; 58 59 public import gtkc.giotypes; 60 61 private import gtkc.gio; 62 private import glib.ConstructionException; 63 private import gobject.ObjectG; 64 65 private import glib.Bytes; 66 private import gio.LoadableIconT; 67 private import gio.LoadableIconIF; 68 69 70 71 /** 72 * GBytesIcon specifies an image held in memory in a common format (usually 73 * png) to be used as icon. 74 */ 75 public class FileIcon : LoadableIconIF 76 { 77 78 /** the main Gtk struct */ 79 protected GBytesIcon* gBytesIcon; 80 81 82 /** Get the main Gtk struct */ 83 public GBytesIcon* getFileIconStruct() 84 { 85 return gBytesIcon; 86 } 87 88 89 /** the main Gtk struct as a void* */ 90 protected void* getStruct() 91 { 92 return cast(void*)gBytesIcon; 93 } 94 95 /** 96 * Sets our main struct and passes it to the parent class 97 */ 98 public this (GBytesIcon* gBytesIcon) 99 { 100 this.gBytesIcon = gBytesIcon; 101 } 102 103 // add the LoadableIcon capabilities 104 mixin LoadableIconT!(GBytesIcon); 105 106 /** 107 */ 108 109 /** 110 * Creates a new icon for a bytes. 111 * Since 2.38 112 * Params: 113 * bytes = a GBytes. 114 * Throws: ConstructionException GTK+ fails to create the object. 115 */ 116 public this (Bytes bytes) 117 { 118 // GIcon * g_bytes_icon_new (GBytes *bytes); 119 auto p = g_bytes_icon_new((bytes is null) ? null : bytes.getBytesStruct()); 120 if(p is null) 121 { 122 throw new ConstructionException("null returned by g_bytes_icon_new((bytes is null) ? null : bytes.getBytesStruct())"); 123 } 124 this(cast(GBytesIcon*) p); 125 } 126 127 /** 128 * Gets the GBytes associated with the given icon. 129 * Since 2.38 130 * Returns: a GBytes, or NULL. [transfer none] 131 */ 132 public Bytes getBytes() 133 { 134 // GBytes * g_bytes_icon_get_bytes (GBytesIcon *icon); 135 auto p = g_bytes_icon_get_bytes(gBytesIcon); 136 137 if(p is null) 138 { 139 return null; 140 } 141 142 return ObjectG.getDObject!(Bytes)(cast(GBytes*) p); 143 } 144 }