source: appstream-generator/build/girepo/gobject/Flags.d @ 4841

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

Initial release

File size: 3.5 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 gobject.Flags;
22
23private import gi.gobject;
24public  import gi.gobjecttypes;
25private import glib.Str;
26
27
28/** */
29public struct Flags
30{
31
32        /**
33         * This function is meant to be called from the complete_type_info()
34         * function of a #GTypePlugin implementation, see the example for
35         * g_enum_complete_type_info() above.
36         *
37         * Params:
38         *     gFlagsType = the type identifier of the type being completed
39         *     info = the #GTypeInfo struct to be filled in
40         *     constValues = An array of #GFlagsValue structs for the possible
41         *         enumeration values. The array is terminated by a struct with all
42         *         members being 0.
43         */
44        public static void completeTypeInfo(GType gFlagsType, out GTypeInfo info, GFlagsValue* constValues)
45        {
46                g_flags_complete_type_info(gFlagsType, &info, constValues);
47        }
48
49        /**
50         * Returns the first #GFlagsValue which is set in @value.
51         *
52         * Params:
53         *     flagsClass = a #GFlagsClass
54         *     value = the value
55         *
56         * Returns: the first #GFlagsValue which is set in
57         *     @value, or %NULL if none is set
58         */
59        public static GFlagsValue* getFirstValue(GFlagsClass* flagsClass, uint value)
60        {
61                return g_flags_get_first_value(flagsClass, value);
62        }
63
64        /**
65         * Looks up a #GFlagsValue by name.
66         *
67         * Params:
68         *     flagsClass = a #GFlagsClass
69         *     name = the name to look up
70         *
71         * Returns: the #GFlagsValue with name @name,
72         *     or %NULL if there is no flag with that name
73         */
74        public static GFlagsValue* getValueByName(GFlagsClass* flagsClass, string name)
75        {
76                return g_flags_get_value_by_name(flagsClass, Str.toStringz(name));
77        }
78
79        /**
80         * Looks up a #GFlagsValue by nickname.
81         *
82         * Params:
83         *     flagsClass = a #GFlagsClass
84         *     nick = the nickname to look up
85         *
86         * Returns: the #GFlagsValue with nickname @nick,
87         *     or %NULL if there is no flag with that nickname
88         */
89        public static GFlagsValue* getValueByNick(GFlagsClass* flagsClass, string nick)
90        {
91                return g_flags_get_value_by_nick(flagsClass, Str.toStringz(nick));
92        }
93
94        /**
95         * Registers a new static flags type with the name @name.
96         *
97         * It is normally more convenient to let [glib-mkenums][glib-mkenums]
98         * generate a my_flags_get_type() function from a usual C enumeration
99         * definition than to write one yourself using g_flags_register_static().
100         *
101         * Params:
102         *     name = A nul-terminated string used as the name of the new type.
103         *     constStaticValues = An array of #GFlagsValue structs for the possible
104         *         flags values. The array is terminated by a struct with all members being 0.
105         *         GObject keeps a reference to the data, so it cannot be stack-allocated.
106         *
107         * Returns: The new type identifier.
108         */
109        public static GType registerStatic(string name, GFlagsValue* constStaticValues)
110        {
111                return g_flags_register_static(Str.toStringz(name), constStaticValues);
112        }
113}
Note: See TracBrowser for help on using the repository browser.