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

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

Initial release

File size: 2.8 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.BytesIcon;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.IconIF;
26private import gio.IconT;
27private import gio.LoadableIconIF;
28private import gio.LoadableIconT;
29private import glib.Bytes;
30private import glib.ConstructionException;
31private import gobject.ObjectG;
32
33
34/**
35 * #GBytesIcon specifies an image held in memory in a common format (usually
36 * png) to be used as icon.
37 */
38public class BytesIcon : ObjectG, IconIF, LoadableIconIF
39{
40        /** the main Gtk struct */
41        protected GBytesIcon* gBytesIcon;
42
43        /** Get the main Gtk struct */
44        public GBytesIcon* getBytesIconStruct()
45        {
46                return gBytesIcon;
47        }
48
49        /** the main Gtk struct as a void* */
50        protected override void* getStruct()
51        {
52                return cast(void*)gBytesIcon;
53        }
54
55        protected override void setStruct(GObject* obj)
56        {
57                gBytesIcon = cast(GBytesIcon*)obj;
58                super.setStruct(obj);
59        }
60
61        /**
62         * Sets our main struct and passes it to the parent class.
63         */
64        public this (GBytesIcon* gBytesIcon, bool ownedRef = false)
65        {
66                this.gBytesIcon = gBytesIcon;
67                super(cast(GObject*)gBytesIcon, ownedRef);
68        }
69
70        // add the Icon capabilities
71        mixin IconT!(GBytesIcon);
72
73        // add the LoadableIcon capabilities
74        mixin LoadableIconT!(GBytesIcon);
75
76
77        /** */
78        public static GType getType()
79        {
80                return g_bytes_icon_get_type();
81        }
82
83        /**
84         * Creates a new icon for a bytes.
85         *
86         * Params:
87         *     bytes = a #GBytes.
88         *
89         * Returns: a #GIcon for the given
90         *     @bytes, or %NULL on error.
91         *
92         * Since: 2.38
93         *
94         * Throws: ConstructionException GTK+ fails to create the object.
95         */
96        public this(Bytes bytes)
97        {
98                auto p = g_bytes_icon_new((bytes is null) ? null : bytes.getBytesStruct());
99               
100                if(p is null)
101                {
102                        throw new ConstructionException("null returned by new");
103                }
104               
105                this(cast(GBytesIcon*) p, true);
106        }
107
108        /**
109         * Gets the #GBytes associated with the given @icon.
110         *
111         * Returns: a #GBytes, or %NULL.
112         *
113         * Since: 2.38
114         */
115        public Bytes getBytes()
116        {
117                auto p = g_bytes_icon_get_bytes(gBytesIcon);
118               
119                if(p is null)
120                {
121                        return null;
122                }
123               
124                return new Bytes(cast(GBytes*) p);
125        }
126}
Note: See TracBrowser for help on using the repository browser.