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

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

Initial release

File size: 3.1 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.DBusAnnotationInfo;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import glib.Str;
26private import gobject.ObjectG;
27
28
29/**
30 * Information about an annotation.
31 *
32 * Since: 2.26
33 */
34public class DBusAnnotationInfo
35{
36        /** the main Gtk struct */
37        protected GDBusAnnotationInfo* gDBusAnnotationInfo;
38        protected bool ownedRef;
39
40        /** Get the main Gtk struct */
41        public GDBusAnnotationInfo* getDBusAnnotationInfoStruct()
42        {
43                return gDBusAnnotationInfo;
44        }
45
46        /** the main Gtk struct as a void* */
47        protected void* getStruct()
48        {
49                return cast(void*)gDBusAnnotationInfo;
50        }
51
52        /**
53         * Sets our main struct and passes it to the parent class.
54         */
55        public this (GDBusAnnotationInfo* gDBusAnnotationInfo, bool ownedRef = false)
56        {
57                this.gDBusAnnotationInfo = gDBusAnnotationInfo;
58                this.ownedRef = ownedRef;
59        }
60
61        /**
62         * Looks up the value of an annotation.
63         *
64         * The cost of this function is O(n) in number of annotations.
65         *
66         * Params:
67         *     annotations = A %NULL-terminated array of annotations or %NULL.
68         *     name = The name of the annotation to look up.
69         *
70         * Return: The value or %NULL if not found. Do not free, it is owned by @annotations.
71         *
72         * Since: 2.26
73         */
74        public static string lookup(DBusAnnotationInfo[] annotations, string name)
75        {
76                GDBusAnnotationInfo*[] annotationsArray = new GDBusAnnotationInfo*[annotations.length+1];
77                for ( int i = 0; i < annotations.length ; i++ )
78                {
79                        annotationsArray[i] = annotations[i].getDBusAnnotationInfoStruct();
80                }
81                annotationsArray[$-1] = null;
82               
83                return Str.toString(g_dbus_annotation_info_lookup(annotationsArray.ptr, Str.toStringz(name)));
84        }
85
86        /**
87         */
88
89        /** */
90        public static GType getType()
91        {
92                return g_dbus_annotation_info_get_type();
93        }
94
95        /**
96         * If @info is statically allocated does nothing. Otherwise increases
97         * the reference count.
98         *
99         * Returns: The same @info.
100         *
101         * Since: 2.26
102         */
103        public DBusAnnotationInfo doref()
104        {
105                auto p = g_dbus_annotation_info_ref(gDBusAnnotationInfo);
106               
107                if(p is null)
108                {
109                        return null;
110                }
111               
112                return ObjectG.getDObject!(DBusAnnotationInfo)(cast(GDBusAnnotationInfo*) p, true);
113        }
114
115        /**
116         * If @info is statically allocated, does nothing. Otherwise decreases
117         * the reference count of @info. When its reference count drops to 0,
118         * the memory used is freed.
119         *
120         * Since: 2.26
121         */
122        public void unref()
123        {
124                g_dbus_annotation_info_unref(gDBusAnnotationInfo);
125        }
126}
Note: See TracBrowser for help on using the repository browser.