source: appstream-generator/build/girepo/gio/StaticResource.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 2.7 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module gio.StaticResource;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.Resource;
26private import gobject.ObjectG;
27
28
29/**
30 * #GStaticResource is an opaque data structure and can only be accessed
31 * using the following functions.
32 */
33public class StaticResource
34{
35        /** the main Gtk struct */
36        protected GStaticResource* gStaticResource;
37        protected bool ownedRef;
38
39        /** Get the main Gtk struct */
40        public GStaticResource* getStaticResourceStruct()
41        {
42                return gStaticResource;
43        }
44
45        /** the main Gtk struct as a void* */
46        protected void* getStruct()
47        {
48                return cast(void*)gStaticResource;
49        }
50
51        /**
52         * Sets our main struct and passes it to the parent class.
53         */
54        public this (GStaticResource* gStaticResource, bool ownedRef = false)
55        {
56                this.gStaticResource = gStaticResource;
57                this.ownedRef = ownedRef;
58        }
59
60
61        /**
62         * Finalized a GResource initialized by g_static_resource_init().
63         *
64         * This is normally used by code generated by
65         * [glib-compile-resources][glib-compile-resources]
66         * and is not typically used by other code.
67         *
68         * Since: 2.32
69         */
70        public void fini()
71        {
72                g_static_resource_fini(gStaticResource);
73        }
74
75        /**
76         * Gets the GResource that was registered by a call to g_static_resource_init().
77         *
78         * This is normally used by code generated by
79         * [glib-compile-resources][glib-compile-resources]
80         * and is not typically used by other code.
81         *
82         * Returns: a #GResource
83         *
84         * Since: 2.32
85         */
86        public Resource getResource()
87        {
88                auto p = g_static_resource_get_resource(gStaticResource);
89               
90                if(p is null)
91                {
92                        return null;
93                }
94               
95                return ObjectG.getDObject!(Resource)(cast(GResource*) p);
96        }
97
98        /**
99         * Initializes a GResource from static data using a
100         * GStaticResource.
101         *
102         * This is normally used by code generated by
103         * [glib-compile-resources][glib-compile-resources]
104         * and is not typically used by other code.
105         *
106         * Since: 2.32
107         */
108        public void init()
109        {
110                g_static_resource_init(gStaticResource);
111        }
112}
Note: See TracBrowser for help on using the repository browser.