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 gio.StaticResource; 26 27 private import gio.Resource; 28 private import gobject.ObjectG; 29 private import gtkc.gio; 30 public import gtkc.giotypes; 31 32 33 /** 34 * #GStaticResource is an opaque data structure and can only be accessed 35 * using the following functions. 36 */ 37 public class StaticResource 38 { 39 /** the main Gtk struct */ 40 protected GStaticResource* gStaticResource; 41 42 /** Get the main Gtk struct */ 43 public GStaticResource* getStaticResourceStruct() 44 { 45 return gStaticResource; 46 } 47 48 /** the main Gtk struct as a void* */ 49 protected void* getStruct() 50 { 51 return cast(void*)gStaticResource; 52 } 53 54 /** 55 * Sets our main struct and passes it to the parent class. 56 */ 57 public this (GStaticResource* gStaticResource) 58 { 59 this.gStaticResource = gStaticResource; 60 } 61 62 63 /** 64 * Finalized a GResource initialized by g_static_resource_init(). 65 * 66 * This is normally used by code generated by 67 * [glib-compile-resources][glib-compile-resources] 68 * and is not typically used by other code. 69 * 70 * Since: 2.32 71 */ 72 public void fini() 73 { 74 g_static_resource_fini(gStaticResource); 75 } 76 77 /** 78 * Gets the GResource that was registered by a call to g_static_resource_init(). 79 * 80 * This is normally used by code generated by 81 * [glib-compile-resources][glib-compile-resources] 82 * and is not typically used by other code. 83 * 84 * Return: a #GResource 85 * 86 * Since: 2.32 87 */ 88 public Resource getResource() 89 { 90 auto p = g_static_resource_get_resource(gStaticResource); 91 92 if(p is null) 93 { 94 return null; 95 } 96 97 return ObjectG.getDObject!(Resource)(cast(GResource*) p); 98 } 99 100 /** 101 * Initializes a GResource from static data using a 102 * GStaticResource. 103 * 104 * This is normally used by code generated by 105 * [glib-compile-resources][glib-compile-resources] 106 * and is not typically used by other code. 107 * 108 * Since: 2.32 109 */ 110 public void init() 111 { 112 g_static_resource_init(gStaticResource); 113 } 114 }