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