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-Extension-Points.html 27 * outPack = gio 28 * outFile = IOExtension 29 * strct = GIOExtension 30 * realStrct= 31 * ctorStrct= 32 * clss = IOExtension 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - g_io_extension_ 41 * omit structs: 42 * omit prefixes: 43 * - g_io_extension_point_ 44 * omit code: 45 * omit signals: 46 * imports: 47 * - glib.Str 48 * structWrap: 49 * - GIOExtension* -> IOExtension 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module gio.IOExtension; 56 57 public import gtkc.giotypes; 58 59 private import gtkc.gio; 60 private import glib.ConstructionException; 61 private import gobject.ObjectG; 62 63 private import glib.Str; 64 65 66 67 /** 68 * GIOExtensionPoint provides a mechanism for modules to extend the 69 * functionality of the library or application that loaded it in an 70 * organized fashion. 71 * 72 * An extension point is identified by a name, and it may optionally 73 * require that any implementation must by of a certain type (or derived 74 * thereof). Use g_io_extension_point_register() to register an 75 * extension point, and g_io_extension_point_set_required_type() to 76 * set a required type. 77 * 78 * A module can implement an extension point by specifying the GType 79 * that implements the functionality. Additionally, each implementation 80 * of an extension point has a name, and a priority. Use 81 * g_io_extension_point_implement() to implement an extension point. 82 * 83 * $(DDOC_COMMENT example) 84 * 85 * $(DDOC_COMMENT example) 86 * 87 * It is up to the code that registered the extension point how 88 * it uses the implementations that have been associated with it. 89 * Depending on the use case, it may use all implementations, or 90 * only the one with the highest priority, or pick a specific 91 * one by name. 92 * 93 * To avoid opening all modules just to find out what extension 94 * points they implement, GIO makes use of a caching mechanism, 95 * see gio-querymodules. 96 * You are expected to run this command after installing a 97 * GIO module. 98 * 99 * The GIO_EXTRA_MODULES environment variable can be 100 * used to specify additional directories to automatically load modules 101 * from. This environment variable has the same syntax as the 102 * PATH. If two modules have the same base name in different 103 * directories, then the latter one will be ignored. If additional 104 * directories are specified GIO will load modules from the built-in 105 * directory last. 106 */ 107 public class IOExtension 108 { 109 110 /** the main Gtk struct */ 111 protected GIOExtension* gIOExtension; 112 113 114 /** Get the main Gtk struct */ 115 public GIOExtension* getIOExtensionStruct() 116 { 117 return gIOExtension; 118 } 119 120 121 /** the main Gtk struct as a void* */ 122 protected void* getStruct() 123 { 124 return cast(void*)gIOExtension; 125 } 126 127 /** 128 * Sets our main struct and passes it to the parent class 129 */ 130 public this (GIOExtension* gIOExtension) 131 { 132 this.gIOExtension = gIOExtension; 133 } 134 135 /** 136 */ 137 138 /** 139 * Gets the name under which extension was registered. 140 * Note that the same type may be registered as extension 141 * for multiple extension points, under different names. 142 * Returns: the name of extension. 143 */ 144 public string getName() 145 { 146 // const char * g_io_extension_get_name (GIOExtension *extension); 147 return Str.toString(g_io_extension_get_name(gIOExtension)); 148 } 149 150 /** 151 * Gets the priority with which extension was registered. 152 * Returns: the priority of extension 153 */ 154 public int getPriority() 155 { 156 // gint g_io_extension_get_priority (GIOExtension *extension); 157 return g_io_extension_get_priority(gIOExtension); 158 } 159 160 /** 161 * Gets the type associated with extension. 162 * Returns: the type of extension 163 */ 164 public GType getType() 165 { 166 // GType g_io_extension_get_type (GIOExtension *extension); 167 return g_io_extension_get_type(gIOExtension); 168 } 169 170 /** 171 * Gets a reference to the class for the type that is 172 * associated with extension. 173 * Returns: the GTypeClass for the type of extension. [transfer full] 174 */ 175 public GTypeClass* refClass() 176 { 177 // GTypeClass * g_io_extension_ref_class (GIOExtension *extension); 178 return g_io_extension_ref_class(gIOExtension); 179 } 180 }