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 67 private import gio.IconT; 68 private import gio.IconIF; 69 private import gio.LoadableIconT; 70 private import gio.LoadableIconIF; 71 72 73 74 private import gobject.ObjectG; 75 76 /** 77 * GFileIcon specifies an icon by pointing to an image file 78 * to be used as icon. 79 */ 80 public class FileIcon : ObjectG, IconIF, LoadableIconIF 81 { 82 83 /** the main Gtk struct */ 84 protected GFileIcon* gFileIcon; 85 86 87 public GFileIcon* getFileIconStruct() 88 { 89 return gFileIcon; 90 } 91 92 93 /** the main Gtk struct as a void* */ 94 protected override void* getStruct() 95 { 96 return cast(void*)gFileIcon; 97 } 98 99 /** 100 * Sets our main struct and passes it to the parent class 101 */ 102 public this (GFileIcon* gFileIcon) 103 { 104 super(cast(GObject*)gFileIcon); 105 this.gFileIcon = gFileIcon; 106 } 107 108 protected override void setStruct(GObject* obj) 109 { 110 super.setStruct(obj); 111 gFileIcon = cast(GFileIcon*)obj; 112 } 113 114 // add the Icon capabilities 115 mixin IconT!(GFileIcon); 116 117 // add the LoadableIcon capabilities 118 mixin LoadableIconT!(GFileIcon); 119 120 /** 121 */ 122 123 /** 124 * Creates a new icon for a file. 125 * Params: 126 * file = a GFile. 127 * Throws: ConstructionException GTK+ fails to create the object. 128 */ 129 public this (GFile* file) 130 { 131 // GIcon * g_file_icon_new (GFile *file); 132 auto p = g_file_icon_new(file); 133 if(p is null) 134 { 135 throw new ConstructionException("null returned by g_file_icon_new(file)"); 136 } 137 this(cast(GFileIcon*) p); 138 } 139 140 /** 141 * Gets the GFile associated with the given icon. 142 * Returns: a GFile, or NULL. [transfer none] 143 */ 144 public GFile* getFile() 145 { 146 // GFile * g_file_icon_get_file (GFileIcon *icon); 147 return g_file_icon_get_file(gFileIcon); 148 } 149 }