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 = GFileIcon.html 27 * outPack = gio 28 * outFile = FileIcon 29 * strct = GFileIcon 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 * - IconIF 40 * - LoadableIconIF 41 * prefixes: 42 * - g_file_icon_ 43 * omit structs: 44 * omit prefixes: 45 * omit code: 46 * omit signals: 47 * imports: 48 * - gio.IconT 49 * - gio.IconIF 50 * - gio.LoadableIconT 51 * - gio.LoadableIconIF 52 * structWrap: 53 * module aliases: 54 * local aliases: 55 * overrides: 56 */ 57 58 module gio.FileIcon; 59 60 public import gtkc.giotypes; 61 62 private import gtkc.gio; 63 private import glib.ConstructionException; 64 private import gobject.ObjectG; 65 66 private import gio.IconT; 67 private import gio.IconIF; 68 private import gio.LoadableIconT; 69 private import gio.LoadableIconIF; 70 71 72 private import gobject.ObjectG; 73 74 /** 75 * GFileIcon specifies an icon by pointing to an image file 76 * to be used as icon. 77 */ 78 public class FileIcon : ObjectG, IconIF, LoadableIconIF 79 { 80 81 /** the main Gtk struct */ 82 protected GFileIcon* gFileIcon; 83 84 85 /** Get the main Gtk struct */ 86 public GFileIcon* getFileIconStruct() 87 { 88 return gFileIcon; 89 } 90 91 92 /** the main Gtk struct as a void* */ 93 protected override void* getStruct() 94 { 95 return cast(void*)gFileIcon; 96 } 97 98 /** 99 * Sets our main struct and passes it to the parent class 100 */ 101 public this (GFileIcon* gFileIcon) 102 { 103 super(cast(GObject*)gFileIcon); 104 this.gFileIcon = gFileIcon; 105 } 106 107 protected override void setStruct(GObject* obj) 108 { 109 super.setStruct(obj); 110 gFileIcon = cast(GFileIcon*)obj; 111 } 112 113 // add the Icon capabilities 114 mixin IconT!(GFileIcon); 115 116 // add the LoadableIcon capabilities 117 mixin LoadableIconT!(GFileIcon); 118 119 /** 120 */ 121 122 /** 123 * Creates a new icon for a file. 124 * Params: 125 * file = a GFile. 126 * Throws: ConstructionException GTK+ fails to create the object. 127 */ 128 public this (GFile* file) 129 { 130 // GIcon * g_file_icon_new (GFile *file); 131 auto p = g_file_icon_new(file); 132 if(p is null) 133 { 134 throw new ConstructionException("null returned by g_file_icon_new(file)"); 135 } 136 this(cast(GFileIcon*) p); 137 } 138 139 /** 140 * Gets the GFile associated with the given icon. 141 * Returns: a GFile, or NULL. [transfer none] 142 */ 143 public GFile* getFile() 144 { 145 // GFile * g_file_icon_get_file (GFileIcon *icon); 146 return g_file_icon_get_file(gFileIcon); 147 } 148 }