1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = gio-D-Bus-Introspection-Data.html
27  * outPack = gio
28  * outFile = DBusAnnotationInfo
29  * strct   = GDBusAnnotationInfo
30  * realStrct=
31  * ctorStrct=
32  * clss    = DBusAnnotationInfo
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_dbus_annotation_info_
41  * omit structs:
42  * omit prefixes:
43  * 	- g_dbus_interface_info_
44  * 	- g_dbus_node_info_
45  * 	- g_dbus_method_info_
46  * 	- g_dbus_signal_info_
47  * 	- g_dbus_property_info_
48  * 	- g_dbus_arg_info_
49  * omit code:
50  * 	- g_dbus_annotation_info_lookup
51  * omit signals:
52  * imports:
53  * 	- glib.Str
54  * structWrap:
55  * 	- GDBusAnnotationInfo* -> DBusAnnotationInfo
56  * module aliases:
57  * local aliases:
58  * overrides:
59  */
60 
61 module gio.DBusAnnotationInfo;
62 
63 public  import gtkc.giotypes;
64 
65 private import gtkc.gio;
66 private import glib.ConstructionException;
67 private import gobject.ObjectG;
68 
69 
70 private import glib.Str;
71 
72 
73 
74 private import gobject.Boxed;
75 
76 /**
77  * Various data structures and convenience routines to parse and
78  * generate D-Bus introspection XML. Introspection information is
79  * used when registering objects with g_dbus_connection_register_object().
80  *
81  * The format of D-Bus introspection XML is specified in the
82  * D-Bus specification.
83  */
84 public class DBusAnnotationInfo : Boxed
85 {
86 	
87 	/** the main Gtk struct */
88 	protected GDBusAnnotationInfo* gDBusAnnotationInfo;
89 	
90 	
91 	public GDBusAnnotationInfo* getDBusAnnotationInfoStruct()
92 	{
93 		return gDBusAnnotationInfo;
94 	}
95 	
96 	
97 	/** the main Gtk struct as a void* */
98 	protected void* getStruct()
99 	{
100 		return cast(void*)gDBusAnnotationInfo;
101 	}
102 	
103 	/**
104 	 * Sets our main struct and passes it to the parent class
105 	 */
106 	public this (GDBusAnnotationInfo* gDBusAnnotationInfo)
107 	{
108 		this.gDBusAnnotationInfo = gDBusAnnotationInfo;
109 	}
110 	
111 	/**
112 	 * Looks up the value of an annotation.
113 	 * This cost of this function is O(n) in number of annotations.
114 	 * Since 2.26
115 	 * Params:
116 	 * annotations = A array of annotations or NULL.
117 	 * name = The name of the annotation to look up.
118 	 * Returns: The value or null if not found.
119 	 */
120 	public static string lookup(DBusAnnotationInfo[] annotations, string name)
121 	{
122 		// const gchar * g_dbus_annotation_info_lookup (GDBusAnnotationInfo **annotations,  const gchar *name);
123 		
124 		GDBusAnnotationInfo*[] annotationsArray = new GDBusAnnotationInfo*[annotations.length+1];
125 		for ( int i = 0; i < annotations.length ; i++ )
126 		{
127 			annotationsArray[i] = annotations[i].getDBusAnnotationInfoStruct();
128 		}
129 		annotationsArray[$-1] = null;
130 		
131 		return Str.toString(g_dbus_annotation_info_lookup(annotationsArray.ptr, Str.toStringz(name)));
132 	}
133 	
134 	/**
135 	 */
136 	
137 	/**
138 	 * If info is statically allocated does nothing. Otherwise increases
139 	 * the reference count.
140 	 * Since 2.26
141 	 * Returns: The same info.
142 	 */
143 	public DBusAnnotationInfo doref()
144 	{
145 		// GDBusAnnotationInfo * g_dbus_annotation_info_ref (GDBusAnnotationInfo *info);
146 		auto p = g_dbus_annotation_info_ref(gDBusAnnotationInfo);
147 		
148 		if(p is null)
149 		{
150 			return null;
151 		}
152 		
153 		return ObjectG.getDObject!(DBusAnnotationInfo)(cast(GDBusAnnotationInfo*) p);
154 	}
155 	
156 	/**
157 	 * If info is statically allocated, does nothing. Otherwise decreases
158 	 * the reference count of info. When its reference count drops to 0,
159 	 * the memory used is freed.
160 	 * Since 2.26
161 	 */
162 	public void unref()
163 	{
164 		// void g_dbus_annotation_info_unref (GDBusAnnotationInfo *info);
165 		g_dbus_annotation_info_unref(gDBusAnnotationInfo);
166 	}
167 }