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 change21 // find conversion definition on APILookup.txt22 // implement new conversion functionalities on the wrap.utils pakage23 24 25 modulegio.DBusNodeInfo;
26 27 privateimportgio.DBusAnnotationInfo;
28 privateimportgio.DBusInterfaceInfo;
29 privateimportgio.c.functions;
30 publicimportgio.c.types;
31 privateimportglib.ConstructionException;
32 privateimportglib.ErrorG;
33 privateimportglib.GException;
34 privateimportglib.MemorySlice;
35 privateimportglib.Str;
36 privateimportglib.StringG;
37 privateimportgobject.ObjectG;
38 publicimportgtkc.giotypes;
39 privateimportgtkd.Loader;
40 41 42 /**
43 * Information about nodes in a remote object hierarchy.
44 *
45 * Since: 2.26
46 */47 publicfinalclassDBusNodeInfo48 {
49 /** the main Gtk struct */50 protectedGDBusNodeInfo* gDBusNodeInfo;
51 protectedboolownedRef;
52 53 /** Get the main Gtk struct */54 publicGDBusNodeInfo* getDBusNodeInfoStruct(booltransferOwnership = false)
55 {
56 if (transferOwnership)
57 ownedRef = false;
58 returngDBusNodeInfo;
59 }
60 61 /** the main Gtk struct as a void* */62 protectedvoid* getStruct()
63 {
64 returncast(void*)gDBusNodeInfo;
65 }
66 67 /**
68 * Sets our main struct and passes it to the parent class.
69 */70 publicthis (GDBusNodeInfo* gDBusNodeInfo, boolownedRef = false)
71 {
72 this.gDBusNodeInfo = gDBusNodeInfo;
73 this.ownedRef = ownedRef;
74 }
75 76 ~this ()
77 {
78 if ( Linker.isLoaded(LIBRARY_GIO) && ownedRef )
79 g_dbus_node_info_unref(gDBusNodeInfo);
80 }
81 82 83 /**
84 * The reference count or -1 if statically allocated.
85 */86 public @propertyintrefCount()
87 {
88 returngDBusNodeInfo.refCount;
89 }
90 91 /** Ditto */92 public @propertyvoidrefCount(intvalue)
93 {
94 gDBusNodeInfo.refCount = value;
95 }
96 97 /**
98 * The path of the node or %NULL if omitted. Note that this may be a relative path. See the D-Bus specification for more details.
99 */100 public @propertystringpath()
101 {
102 returnStr.toString(gDBusNodeInfo.path);
103 }
104 105 /** Ditto */106 public @propertyvoidpath(stringvalue)
107 {
108 gDBusNodeInfo.path = Str.toStringz(value);
109 }
110 111 /**
112 * A pointer to a %NULL-terminated array of pointers to #GDBusInterfaceInfo structures or %NULL if there are no interfaces.
113 */114 public @propertyDBusInterfaceInfo[] interfaces()
115 {
116 DBusInterfaceInfo[] arr = newDBusInterfaceInfo[getArrayLength(gDBusNodeInfo.interfaces)];
117 for ( inti = 0; i < arr.length; i++ )
118 {
119 arr[i] = ObjectG.getDObject!(DBusInterfaceInfo)(gDBusNodeInfo.interfaces[i], false);
120 }
121 122 returnarr;
123 }
124 125 /** Ditto */126 public @propertyvoidinterfaces(DBusInterfaceInfo[] value)
127 {
128 GDBusInterfaceInfo*[] arr = newGDBusInterfaceInfo*[value.length+1];
129 for ( inti = 0; i < value.length; i++ )
130 {
131 arr[i] = value[i].getDBusInterfaceInfoStruct();
132 }
133 arr[value.length] = null;
134 135 gDBusNodeInfo.interfaces = arr.ptr;
136 }
137 138 /**
139 * A pointer to a %NULL-terminated array of pointers to #GDBusNodeInfo structures or %NULL if there are no nodes.
140 */141 public @propertyDBusNodeInfo[] nodes()
142 {
143 DBusNodeInfo[] arr = newDBusNodeInfo[getArrayLength(gDBusNodeInfo.nodes)];
144 for ( inti = 0; i < arr.length; i++ )
145 {
146 arr[i] = ObjectG.getDObject!(DBusNodeInfo)(gDBusNodeInfo.nodes[i], false);
147 }
148 149 returnarr;
150 }
151 152 /** Ditto */153 public @propertyvoidnodes(DBusNodeInfo[] value)
154 {
155 GDBusNodeInfo*[] arr = newGDBusNodeInfo*[value.length+1];
156 for ( inti = 0; i < value.length; i++ )
157 {
158 arr[i] = value[i].getDBusNodeInfoStruct();
159 }
160 arr[value.length] = null;
161 162 gDBusNodeInfo.nodes = arr.ptr;
163 }
164 165 /**
166 * A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
167 */168 public @propertyDBusAnnotationInfo[] annotations()
169 {
170 DBusAnnotationInfo[] arr = newDBusAnnotationInfo[getArrayLength(gDBusNodeInfo.annotations)];
171 for ( inti = 0; i < arr.length; i++ )
172 {
173 arr[i] = ObjectG.getDObject!(DBusAnnotationInfo)(gDBusNodeInfo.annotations[i], false);
174 }
175 176 returnarr;
177 }
178 179 /** Ditto */180 public @propertyvoidannotations(DBusAnnotationInfo[] value)
181 {
182 GDBusAnnotationInfo*[] arr = newGDBusAnnotationInfo*[value.length+1];
183 for ( inti = 0; i < value.length; i++ )
184 {
185 arr[i] = value[i].getDBusAnnotationInfoStruct();
186 }
187 arr[value.length] = null;
188 189 gDBusNodeInfo.annotations = arr.ptr;
190 }
191 192 /** */193 publicstaticGTypegetType()
194 {
195 returng_dbus_node_info_get_type();
196 }
197 198 /**
199 * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
200 *
201 * The introspection XML must contain exactly one top-level
202 * <node> element.
203 *
204 * Note that this routine is using a
205 * [GMarkup][glib-Simple-XML-Subset-Parser.description]-based
206 * parser that only accepts a subset of valid XML documents.
207 *
208 * Params:
209 * xmlData = Valid D-Bus introspection XML.
210 *
211 * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free
212 * with g_dbus_node_info_unref().
213 *
214 * Since: 2.26
215 *
216 * Throws: GException on failure.
217 * Throws: ConstructionException GTK+ fails to create the object.
218 */219 publicthis(stringxmlData)
220 {
221 GError* err = null;
222 223 auto__p = g_dbus_node_info_new_for_xml(Str.toStringz(xmlData), &err);
224 225 if (err !isnull)
226 {
227 thrownewGException( newErrorG(err) );
228 }
229 230 if(__pisnull)
231 {
232 thrownewConstructionException("null returned by new_for_xml");
233 }
234 235 this(cast(GDBusNodeInfo*) __p);
236 }
237 238 /**
239 * Appends an XML representation of @info (and its children) to @string_builder.
240 *
241 * This function is typically used for generating introspection XML documents at run-time for
242 * handling the `org.freedesktop.DBus.Introspectable.Introspect` method.
243 *
244 * Params:
245 * indent = Indentation level.
246 * stringBuilder = A #GString to to append XML data to.
247 *
248 * Since: 2.26
249 */250 publicvoidgenerateXml(uintindent, StringGstringBuilder)
251 {
252 g_dbus_node_info_generate_xml(gDBusNodeInfo, indent, (stringBuilderisnull) ? null : stringBuilder.getStringGStruct());
253 }
254 255 /**
256 * Looks up information about an interface.
257 *
258 * The cost of this function is O(n) in number of interfaces.
259 *
260 * Params:
261 * name = A D-Bus interface name.
262 *
263 * Returns: A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
264 *
265 * Since: 2.26
266 */267 publicDBusInterfaceInfolookupInterface(stringname)
268 {
269 auto__p = g_dbus_node_info_lookup_interface(gDBusNodeInfo, Str.toStringz(name));
270 271 if(__pisnull)
272 {
273 returnnull;
274 }
275 276 returnObjectG.getDObject!(DBusInterfaceInfo)(cast(GDBusInterfaceInfo*) __p);
277 }
278 279 aliasdoref = ref_;
280 /**
281 * If @info is statically allocated does nothing. Otherwise increases
282 * the reference count.
283 *
284 * Returns: The same @info.
285 *
286 * Since: 2.26
287 */288 publicDBusNodeInforef_()
289 {
290 auto__p = g_dbus_node_info_ref(gDBusNodeInfo);
291 292 if(__pisnull)
293 {
294 returnnull;
295 }
296 297 returnObjectG.getDObject!(DBusNodeInfo)(cast(GDBusNodeInfo*) __p, true);
298 }
299 300 /**
301 * If @info is statically allocated, does nothing. Otherwise decreases
302 * the reference count of @info. When its reference count drops to 0,
303 * the memory used is freed.
304 *
305 * Since: 2.26
306 */307 publicvoidunref()
308 {
309 g_dbus_node_info_unref(gDBusNodeInfo);
310 }
311 }