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

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

Initial release

File size: 4.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.IconIF;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.Icon;
26private import gio.IconIF;
27private import glib.ConstructionException;
28private import glib.ErrorG;
29private import glib.GException;
30private import glib.Str;
31private import glib.Variant;
32private import gobject.ObjectG;
33
34
35/**
36 * #GIcon is a very minimal interface for icons. It provides functions
37 * for checking the equality of two icons, hashing of icons and
38 * serializing an icon to and from strings.
39 *
40 * #GIcon does not provide the actual pixmap for the icon as this is out
41 * of GIO's scope, however implementations of #GIcon may contain the name
42 * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
43 *
44 * To obtain a hash of a #GIcon, see g_icon_hash().
45 *
46 * To check if two #GIcons are equal, see g_icon_equal().
47 *
48 * For serializing a #GIcon, use g_icon_serialize() and
49 * g_icon_deserialize().
50 *
51 * If you want to consume #GIcon (for example, in a toolkit) you must
52 * be prepared to handle at least the three following cases:
53 * #GLoadableIcon, #GThemedIcon and #GEmblemedIcon.  It may also make
54 * sense to have fast-paths for other cases (like handling #GdkPixbuf
55 * directly, for example) but all compliant #GIcon implementations
56 * outside of GIO must implement #GLoadableIcon.
57 *
58 * If your application or library provides one or more #GIcon
59 * implementations you need to ensure that your new implementation also
60 * implements #GLoadableIcon.  Additionally, you must provide an
61 * implementation of g_icon_serialize() that gives a result that is
62 * understood by g_icon_deserialize(), yielding one of the built-in icon
63 * types.
64 */
65public interface IconIF{
66        /** Get the main Gtk struct */
67        public GIcon* getIconStruct();
68
69        /** the main Gtk struct as a void* */
70        protected void* getStruct();
71
72
73        /**
74         * Deserializes a #GIcon previously serialized using g_icon_serialize().
75         *
76         * Params:
77         *     value = a #GVariant created with g_icon_serialize()
78         *
79         * Returns: a #GIcon, or %NULL when deserialization fails.
80         *
81         * Since: 2.38
82         */
83        public static IconIF deserialize(Variant value);
84
85        /**
86         * Gets a hash for an icon.
87         *
88         * Params:
89         *     icon = #gconstpointer to an icon object.
90         *
91         * Returns: a #guint containing a hash for the @icon, suitable for
92         *     use in a #GHashTable or similar data structure.
93         */
94        public static uint hash(void* icon);
95
96        /**
97         * Checks if two icons are equal.
98         *
99         * Params:
100         *     icon2 = pointer to the second #GIcon.
101         *
102         * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
103         */
104        public bool equal(IconIF icon2);
105
106        /**
107         * Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved
108         * back by calling g_icon_deserialize() on the returned value.
109         * As serialization will avoid using raw icon data when possible, it only
110         * makes sense to transfer the #GVariant between processes on the same machine,
111         * (as opposed to over the network), and within the same file system namespace.
112         *
113         * Returns: a #GVariant, or %NULL when serialization fails.
114         *
115         * Since: 2.38
116         */
117        public Variant serialize();
118
119        /**
120         * Generates a textual representation of @icon that can be used for
121         * serialization such as when passing @icon to a different process or
122         * saving it to persistent storage. Use g_icon_new_for_string() to
123         * get @icon back from the returned string.
124         *
125         * The encoding of the returned string is proprietary to #GIcon except
126         * in the following two cases
127         *
128         * - If @icon is a #GFileIcon, the returned string is a native path
129         * (such as `/path/to/my icon.png`) without escaping
130         * if the #GFile for @icon is a native file.  If the file is not
131         * native, the returned string is the result of g_file_get_uri()
132         * (such as `sftp://path/to/my%20icon.png`).
133         *
134         * - If @icon is a #GThemedIcon with exactly one name, the encoding is
135         * simply the name (such as `network-server`).
136         *
137         * Returns: An allocated NUL-terminated UTF8 string or
138         *     %NULL if @icon can't be serialized. Use g_free() to free.
139         *
140         * Since: 2.20
141         */
142        public string toString();
143}
Note: See TracBrowser for help on using the repository browser.