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

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

Initial release

File size: 66.4 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.DBusConnection;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.ActionGroupIF;
26private import gio.AsyncInitableIF;
27private import gio.AsyncInitableT;
28private import gio.AsyncResultIF;
29private import gio.Cancellable;
30private import gio.Credentials;
31private import gio.DBusAuthObserver;
32private import gio.DBusInterfaceInfo;
33private import gio.DBusMessage;
34private import gio.IOStream;
35private import gio.InitableIF;
36private import gio.InitableT;
37private import gio.MenuModel;
38private import gio.UnixFDList;
39private import glib.ConstructionException;
40private import glib.ErrorG;
41private import glib.GException;
42private import glib.Str;
43private import glib.Variant;
44private import glib.VariantType;
45private import gobject.Closure;
46private import gobject.ObjectG;
47private import gobject.Signals;
48private import std.algorithm;
49
50
51/**
52 * The #GDBusConnection type is used for D-Bus connections to remote
53 * peers such as a message buses. It is a low-level API that offers a
54 * lot of flexibility. For instance, it lets you establish a connection
55 * over any transport that can by represented as an #GIOStream.
56 *
57 * This class is rarely used directly in D-Bus clients. If you are writing
58 * a D-Bus client, it is often easier to use the g_bus_own_name(),
59 * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
60 *
61 * As an exception to the usual GLib rule that a particular object must not
62 * be used by two threads at the same time, #GDBusConnection's methods may be
63 * called from any thread. This is so that g_bus_get() and g_bus_get_sync()
64 * can safely return the same #GDBusConnection when called from any thread.
65 *
66 * Most of the ways to obtain a #GDBusConnection automatically initialize it
67 * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
68 * g_bus_get(), and the synchronous versions of those methods, give you an
69 * initialized connection. Language bindings for GIO should use
70 * g_initable_new() or g_async_initable_new_async(), which also initialize the
71 * connection.
72 *
73 * If you construct an uninitialized #GDBusConnection, such as via
74 * g_object_new(), you must initialize it via g_initable_init() or
75 * g_async_initable_init_async() before using its methods or properties.
76 * Calling methods or accessing properties on a #GDBusConnection that has not
77 * completed initialization successfully is considered to be invalid, and leads
78 * to undefined behaviour. In particular, if initialization fails with a
79 * #GError, the only valid thing you can do with that #GDBusConnection is to
80 * free it with g_object_unref().
81 *
82 * ## An example D-Bus server # {#gdbus-server}
83 *
84 * Here is an example for a D-Bus server:
85 * [gdbus-example-server.c](https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-example-server.c)
86 *
87 * ## An example for exporting a subtree # {#gdbus-subtree-server}
88 *
89 * Here is an example for exporting a subtree:
90 * [gdbus-example-subtree.c](https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-example-subtree.c)
91 *
92 * ## An example for file descriptor passing # {#gdbus-unix-fd-client}
93 *
94 * Here is an example for passing UNIX file descriptors:
95 * [gdbus-unix-fd-client.c](https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-unix-fd-client.c)
96 *
97 * ## An example for exporting a GObject # {#gdbus-export}
98 *
99 * Here is an example for exporting a #GObject:
100 * [gdbus-example-export.c](https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-example-export.c)
101 *
102 * Since: 2.26
103 */
104public class DBusConnection : ObjectG, AsyncInitableIF, InitableIF
105{
106        /** the main Gtk struct */
107        protected GDBusConnection* gDBusConnection;
108
109        /** Get the main Gtk struct */
110        public GDBusConnection* getDBusConnectionStruct()
111        {
112                return gDBusConnection;
113        }
114
115        /** the main Gtk struct as a void* */
116        protected override void* getStruct()
117        {
118                return cast(void*)gDBusConnection;
119        }
120
121        protected override void setStruct(GObject* obj)
122        {
123                gDBusConnection = cast(GDBusConnection*)obj;
124                super.setStruct(obj);
125        }
126
127        /**
128         * Sets our main struct and passes it to the parent class.
129         */
130        public this (GDBusConnection* gDBusConnection, bool ownedRef = false)
131        {
132                this.gDBusConnection = gDBusConnection;
133                super(cast(GObject*)gDBusConnection, ownedRef);
134        }
135
136        // add the AsyncInitable capabilities
137        mixin AsyncInitableT!(GDBusConnection);
138
139        // add the Initable capabilities
140        mixin InitableT!(GDBusConnection);
141
142        /**
143         * Finishes an operation started with g_dbus_connection_new().
144         *
145         * Params:
146         *     res    = A GAsyncResult obtained from the GAsyncReadyCallback
147         *               passed to g_dbus_connection_new().
148         *     address = If true finish an address.
149         *
150         * Throws: GException on failure.
151         * Throws: ConstructionException GTK+ fails to create the object.
152         *
153         * Since: 2.26
154         */
155        public this (AsyncResultIF res, bool address = false)
156        {
157                GError* err = null;
158                GDBusConnection* p;
159               
160                if ( address )
161                {
162                        p = g_dbus_connection_new_for_address_finish((res is null) ? null : res.getAsyncResultStruct(), &err);
163                }
164                else
165                {
166                        p = g_dbus_connection_new_finish((res is null) ? null : res.getAsyncResultStruct(), &err);
167                }
168               
169                if (err !is null)
170                {
171                        throw new GException( new ErrorG(err) );
172                }
173               
174                if(p is null)
175                {
176                        throw new ConstructionException("null returned by g_dbus_connection_new_finish((res is null) ? null : res.getAsyncResultStruct(), &err)");
177                }
178                this(p, true);
179        }
180
181        /**
182         */
183
184        /** */
185        public static GType getType()
186        {
187                return g_dbus_connection_get_type();
188        }
189
190        /**
191         * Synchronously connects and sets up a D-Bus client connection for
192         * exchanging D-Bus messages with an endpoint specified by @address
193         * which must be in the D-Bus address format.
194         *
195         * This constructor can only be used to initiate client-side
196         * connections - use g_dbus_connection_new_sync() if you need to act
197         * as the server. In particular, @flags cannot contain the
198         * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
199         * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
200         *
201         * This is a synchronous failable constructor. See
202         * g_dbus_connection_new_for_address() for the asynchronous version.
203         *
204         * If @observer is not %NULL it may be used to control the
205         * authentication process.
206         *
207         * Params:
208         *     address = a D-Bus address
209         *     flags = flags describing how to make the connection
210         *     observer = a #GDBusAuthObserver or %NULL
211         *     cancellable = a #GCancellable or %NULL
212         *
213         * Returns: a #GDBusConnection or %NULL if @error is set. Free with
214         *     g_object_unref().
215         *
216         * Since: 2.26
217         *
218         * Throws: GException on failure.
219         * Throws: ConstructionException GTK+ fails to create the object.
220         */
221        public this(string address, GDBusConnectionFlags flags, DBusAuthObserver observer, Cancellable cancellable)
222        {
223                GError* err = null;
224               
225                auto p = g_dbus_connection_new_for_address_sync(Str.toStringz(address), flags, (observer is null) ? null : observer.getDBusAuthObserverStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
226               
227                if (err !is null)
228                {
229                        throw new GException( new ErrorG(err) );
230                }
231               
232                if(p is null)
233                {
234                        throw new ConstructionException("null returned by new_for_address_sync");
235                }
236               
237                this(cast(GDBusConnection*) p, true);
238        }
239
240        /**
241         * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
242         * with the end represented by @stream.
243         *
244         * If @stream is a #GSocketConnection, then the corresponding #GSocket
245         * will be put into non-blocking mode.
246         *
247         * The D-Bus connection will interact with @stream from a worker thread.
248         * As a result, the caller should not interact with @stream after this
249         * method has been called, except by calling g_object_unref() on it.
250         *
251         * If @observer is not %NULL it may be used to control the
252         * authentication process.
253         *
254         * This is a synchronous failable constructor. See
255         * g_dbus_connection_new() for the asynchronous version.
256         *
257         * Params:
258         *     stream = a #GIOStream
259         *     guid = the GUID to use if a authenticating as a server or %NULL
260         *     flags = flags describing how to make the connection
261         *     observer = a #GDBusAuthObserver or %NULL
262         *     cancellable = a #GCancellable or %NULL
263         *
264         * Returns: a #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
265         *
266         * Since: 2.26
267         *
268         * Throws: GException on failure.
269         * Throws: ConstructionException GTK+ fails to create the object.
270         */
271        public this(IOStream stream, string guid, GDBusConnectionFlags flags, DBusAuthObserver observer, Cancellable cancellable)
272        {
273                GError* err = null;
274               
275                auto p = g_dbus_connection_new_sync((stream is null) ? null : stream.getIOStreamStruct(), Str.toStringz(guid), flags, (observer is null) ? null : observer.getDBusAuthObserverStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
276               
277                if (err !is null)
278                {
279                        throw new GException( new ErrorG(err) );
280                }
281               
282                if(p is null)
283                {
284                        throw new ConstructionException("null returned by new_sync");
285                }
286               
287                this(cast(GDBusConnection*) p, true);
288        }
289
290        /**
291         * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
292         * with the end represented by @stream.
293         *
294         * If @stream is a #GSocketConnection, then the corresponding #GSocket
295         * will be put into non-blocking mode.
296         *
297         * The D-Bus connection will interact with @stream from a worker thread.
298         * As a result, the caller should not interact with @stream after this
299         * method has been called, except by calling g_object_unref() on it.
300         *
301         * If @observer is not %NULL it may be used to control the
302         * authentication process.
303         *
304         * When the operation is finished, @callback will be invoked. You can
305         * then call g_dbus_connection_new_finish() to get the result of the
306         * operation.
307         *
308         * This is a asynchronous failable constructor. See
309         * g_dbus_connection_new_sync() for the synchronous
310         * version.
311         *
312         * Params:
313         *     stream = a #GIOStream
314         *     guid = the GUID to use if a authenticating as a server or %NULL
315         *     flags = flags describing how to make the connection
316         *     observer = a #GDBusAuthObserver or %NULL
317         *     cancellable = a #GCancellable or %NULL
318         *     callback = a #GAsyncReadyCallback to call when the request is satisfied
319         *     userData = the data to pass to @callback
320         *
321         * Since: 2.26
322         */
323        public static void newConnection(IOStream stream, string guid, GDBusConnectionFlags flags, DBusAuthObserver observer, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
324        {
325                g_dbus_connection_new((stream is null) ? null : stream.getIOStreamStruct(), Str.toStringz(guid), flags, (observer is null) ? null : observer.getDBusAuthObserverStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
326        }
327
328        /**
329         * Asynchronously connects and sets up a D-Bus client connection for
330         * exchanging D-Bus messages with an endpoint specified by @address
331         * which must be in the D-Bus address format.
332         *
333         * This constructor can only be used to initiate client-side
334         * connections - use g_dbus_connection_new() if you need to act as the
335         * server. In particular, @flags cannot contain the
336         * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
337         * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
338         *
339         * When the operation is finished, @callback will be invoked. You can
340         * then call g_dbus_connection_new_finish() to get the result of the
341         * operation.
342         *
343         * If @observer is not %NULL it may be used to control the
344         * authentication process.
345         *
346         * This is a asynchronous failable constructor. See
347         * g_dbus_connection_new_for_address_sync() for the synchronous
348         * version.
349         *
350         * Params:
351         *     address = a D-Bus address
352         *     flags = flags describing how to make the connection
353         *     observer = a #GDBusAuthObserver or %NULL
354         *     cancellable = a #GCancellable or %NULL
355         *     callback = a #GAsyncReadyCallback to call when the request is satisfied
356         *     userData = the data to pass to @callback
357         *
358         * Since: 2.26
359         */
360        public static void newForAddress(string address, GDBusConnectionFlags flags, DBusAuthObserver observer, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
361        {
362                g_dbus_connection_new_for_address(Str.toStringz(address), flags, (observer is null) ? null : observer.getDBusAuthObserverStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
363        }
364
365        /**
366         * Adds a message filter. Filters are handlers that are run on all
367         * incoming and outgoing messages, prior to standard dispatch. Filters
368         * are run in the order that they were added.  The same handler can be
369         * added as a filter more than once, in which case it will be run more
370         * than once.  Filters added during a filter callback won't be run on
371         * the message being processed. Filter functions are allowed to modify
372         * and even drop messages.
373         *
374         * Note that filters are run in a dedicated message handling thread so
375         * they can't block and, generally, can't do anything but signal a
376         * worker thread. Also note that filters are rarely needed - use API
377         * such as g_dbus_connection_send_message_with_reply(),
378         * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
379         *
380         * If a filter consumes an incoming message the message is not
381         * dispatched anywhere else - not even the standard dispatch machinery
382         * (that API such as g_dbus_connection_signal_subscribe() and
383         * g_dbus_connection_send_message_with_reply() relies on) will see the
384         * message. Similary, if a filter consumes an outgoing message, the
385         * message will not be sent to the other peer.
386         *
387         * If @user_data_free_func is non-%NULL, it will be called (in the
388         * thread-default main context of the thread you are calling this
389         * method from) at some point after @user_data is no longer
390         * needed. (It is not guaranteed to be called synchronously when the
391         * filter is removed, and may be called after @connection has been
392         * destroyed.)
393         *
394         * Params:
395         *     filterFunction = a filter function
396         *     userData = user data to pass to @filter_function
397         *     userDataFreeFunc = function to free @user_data with when filter
398         *         is removed or %NULL
399         *
400         * Returns: a filter identifier that can be used with
401         *     g_dbus_connection_remove_filter()
402         *
403         * Since: 2.26
404         */
405        public uint addFilter(GDBusMessageFilterFunction filterFunction, void* userData, GDestroyNotify userDataFreeFunc)
406        {
407                return g_dbus_connection_add_filter(gDBusConnection, filterFunction, userData, userDataFreeFunc);
408        }
409
410        /**
411         * Asynchronously invokes the @method_name method on the
412         * @interface_name D-Bus interface on the remote object at
413         * @object_path owned by @bus_name.
414         *
415         * If @connection is closed then the operation will fail with
416         * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
417         * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
418         * not compatible with the D-Bus protocol, the operation fails with
419         * %G_IO_ERROR_INVALID_ARGUMENT.
420         *
421         * If @reply_type is non-%NULL then the reply will be checked for having this type and an
422         * error will be raised if it does not match.  Said another way, if you give a @reply_type
423         * then any non-%NULL return value will be of this type.
424         *
425         * If the @parameters #GVariant is floating, it is consumed. This allows
426         * convenient 'inline' use of g_variant_new(), e.g.:
427         * |[<!-- language="C" -->
428         * g_dbus_connection_call (connection,
429         * "org.freedesktop.StringThings",
430         * "/org/freedesktop/StringThings",
431         * "org.freedesktop.StringThings",
432         * "TwoStrings",
433         * g_variant_new ("(ss)",
434         * "Thing One",
435         * "Thing Two"),
436         * NULL,
437         * G_DBUS_CALL_FLAGS_NONE,
438         * -1,
439         * NULL,
440         * (GAsyncReadyCallback) two_strings_done,
441         * NULL);
442         * ]|
443         *
444         * This is an asynchronous method. When the operation is finished,
445         * @callback will be invoked in the
446         * [thread-default main context][g-main-context-push-thread-default]
447         * of the thread you are calling this method from. You can then call
448         * g_dbus_connection_call_finish() to get the result of the operation.
449         * See g_dbus_connection_call_sync() for the synchronous version of this
450         * function.
451         *
452         * If @callback is %NULL then the D-Bus method call message will be sent with
453         * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
454         *
455         * Params:
456         *     busName = a unique or well-known bus name or %NULL if
457         *         @connection is not a message bus connection
458         *     objectPath = path of remote object
459         *     interfaceName = D-Bus interface to invoke method on
460         *     methodName = the name of the method to invoke
461         *     parameters = a #GVariant tuple with parameters for the method
462         *         or %NULL if not passing parameters
463         *     replyType = the expected type of the reply, or %NULL
464         *     flags = flags from the #GDBusCallFlags enumeration
465         *     timeoutMsec = the timeout in milliseconds, -1 to use the default
466         *         timeout or %G_MAXINT for no timeout
467         *     cancellable = a #GCancellable or %NULL
468         *     callback = a #GAsyncReadyCallback to call when the request
469         *         is satisfied or %NULL if you don't care about the result of the
470         *         method invocation
471         *     userData = the data to pass to @callback
472         *
473         * Since: 2.26
474         */
475        public void call(string busName, string objectPath, string interfaceName, string methodName, Variant parameters, VariantType replyType, GDBusCallFlags flags, int timeoutMsec, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
476        {
477                g_dbus_connection_call(gDBusConnection, Str.toStringz(busName), Str.toStringz(objectPath), Str.toStringz(interfaceName), Str.toStringz(methodName), (parameters is null) ? null : parameters.getVariantStruct(), (replyType is null) ? null : replyType.getVariantTypeStruct(), flags, timeoutMsec, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
478        }
479
480        /**
481         * Finishes an operation started with g_dbus_connection_call().
482         *
483         * Params:
484         *     res = a #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call()
485         *
486         * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
487         *     return values. Free with g_variant_unref().
488         *
489         * Since: 2.26
490         *
491         * Throws: GException on failure.
492         */
493        public Variant callFinish(AsyncResultIF res)
494        {
495                GError* err = null;
496               
497                auto p = g_dbus_connection_call_finish(gDBusConnection, (res is null) ? null : res.getAsyncResultStruct(), &err);
498               
499                if (err !is null)
500                {
501                        throw new GException( new ErrorG(err) );
502                }
503               
504                if(p is null)
505                {
506                        return null;
507                }
508               
509                return new Variant(cast(GVariant*) p, true);
510        }
511
512        /**
513         * Synchronously invokes the @method_name method on the
514         * @interface_name D-Bus interface on the remote object at
515         * @object_path owned by @bus_name.
516         *
517         * If @connection is closed then the operation will fail with
518         * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
519         * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
520         * contains a value not compatible with the D-Bus protocol, the operation
521         * fails with %G_IO_ERROR_INVALID_ARGUMENT.
522         *
523         * If @reply_type is non-%NULL then the reply will be checked for having
524         * this type and an error will be raised if it does not match.  Said
525         * another way, if you give a @reply_type then any non-%NULL return
526         * value will be of this type.
527         *
528         * If the @parameters #GVariant is floating, it is consumed.
529         * This allows convenient 'inline' use of g_variant_new(), e.g.:
530         * |[<!-- language="C" -->
531         * g_dbus_connection_call_sync (connection,
532         * "org.freedesktop.StringThings",
533         * "/org/freedesktop/StringThings",
534         * "org.freedesktop.StringThings",
535         * "TwoStrings",
536         * g_variant_new ("(ss)",
537         * "Thing One",
538         * "Thing Two"),
539         * NULL,
540         * G_DBUS_CALL_FLAGS_NONE,
541         * -1,
542         * NULL,
543         * &error);
544         * ]|
545         *
546         * The calling thread is blocked until a reply is received. See
547         * g_dbus_connection_call() for the asynchronous version of
548         * this method.
549         *
550         * Params:
551         *     busName = a unique or well-known bus name or %NULL if
552         *         @connection is not a message bus connection
553         *     objectPath = path of remote object
554         *     interfaceName = D-Bus interface to invoke method on
555         *     methodName = the name of the method to invoke
556         *     parameters = a #GVariant tuple with parameters for the method
557         *         or %NULL if not passing parameters
558         *     replyType = the expected type of the reply, or %NULL
559         *     flags = flags from the #GDBusCallFlags enumeration
560         *     timeoutMsec = the timeout in milliseconds, -1 to use the default
561         *         timeout or %G_MAXINT for no timeout
562         *     cancellable = a #GCancellable or %NULL
563         *
564         * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
565         *     return values. Free with g_variant_unref().
566         *
567         * Since: 2.26
568         *
569         * Throws: GException on failure.
570         */
571        public Variant callSync(string busName, string objectPath, string interfaceName, string methodName, Variant parameters, VariantType replyType, GDBusCallFlags flags, int timeoutMsec, Cancellable cancellable)
572        {
573                GError* err = null;
574               
575                auto p = g_dbus_connection_call_sync(gDBusConnection, Str.toStringz(busName), Str.toStringz(objectPath), Str.toStringz(interfaceName), Str.toStringz(methodName), (parameters is null) ? null : parameters.getVariantStruct(), (replyType is null) ? null : replyType.getVariantTypeStruct(), flags, timeoutMsec, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
576               
577                if (err !is null)
578                {
579                        throw new GException( new ErrorG(err) );
580                }
581               
582                if(p is null)
583                {
584                        return null;
585                }
586               
587                return new Variant(cast(GVariant*) p, true);
588        }
589
590        /**
591         * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
592         *
593         * This method is only available on UNIX.
594         *
595         * Params:
596         *     busName = a unique or well-known bus name or %NULL if
597         *         @connection is not a message bus connection
598         *     objectPath = path of remote object
599         *     interfaceName = D-Bus interface to invoke method on
600         *     methodName = the name of the method to invoke
601         *     parameters = a #GVariant tuple with parameters for the method
602         *         or %NULL if not passing parameters
603         *     replyType = the expected type of the reply, or %NULL
604         *     flags = flags from the #GDBusCallFlags enumeration
605         *     timeoutMsec = the timeout in milliseconds, -1 to use the default
606         *         timeout or %G_MAXINT for no timeout
607         *     fdList = a #GUnixFDList or %NULL
608         *     cancellable = a #GCancellable or %NULL
609         *     callback = a #GAsyncReadyCallback to call when the request is
610         *         satisfied or %NULL if you don't * care about the result of the
611         *         method invocation
612         *     userData = The data to pass to @callback.
613         *
614         * Since: 2.30
615         */
616        public void callWithUnixFdList(string busName, string objectPath, string interfaceName, string methodName, Variant parameters, VariantType replyType, GDBusCallFlags flags, int timeoutMsec, UnixFDList fdList, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
617        {
618                g_dbus_connection_call_with_unix_fd_list(gDBusConnection, Str.toStringz(busName), Str.toStringz(objectPath), Str.toStringz(interfaceName), Str.toStringz(methodName), (parameters is null) ? null : parameters.getVariantStruct(), (replyType is null) ? null : replyType.getVariantTypeStruct(), flags, timeoutMsec, (fdList is null) ? null : fdList.getUnixFDListStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
619        }
620
621        /**
622         * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
623         *
624         * Params:
625         *     outFdList = return location for a #GUnixFDList or %NULL
626         *     res = a #GAsyncResult obtained from the #GAsyncReadyCallback passed to
627         *         g_dbus_connection_call_with_unix_fd_list()
628         *
629         * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
630         *     return values. Free with g_variant_unref().
631         *
632         * Since: 2.30
633         *
634         * Throws: GException on failure.
635         */
636        public Variant callWithUnixFdListFinish(out UnixFDList outFdList, AsyncResultIF res)
637        {
638                GUnixFDList* outoutFdList = null;
639                GError* err = null;
640               
641                auto p = g_dbus_connection_call_with_unix_fd_list_finish(gDBusConnection, &outoutFdList, (res is null) ? null : res.getAsyncResultStruct(), &err);
642               
643                if (err !is null)
644                {
645                        throw new GException( new ErrorG(err) );
646                }
647               
648                outFdList = ObjectG.getDObject!(UnixFDList)(outoutFdList);
649               
650                if(p is null)
651                {
652                        return null;
653                }
654               
655                return new Variant(cast(GVariant*) p, true);
656        }
657
658        /**
659         * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
660         *
661         * This method is only available on UNIX.
662         *
663         * Params:
664         *     busName = a unique or well-known bus name or %NULL
665         *         if @connection is not a message bus connection
666         *     objectPath = path of remote object
667         *     interfaceName = D-Bus interface to invoke method on
668         *     methodName = the name of the method to invoke
669         *     parameters = a #GVariant tuple with parameters for
670         *         the method or %NULL if not passing parameters
671         *     replyType = the expected type of the reply, or %NULL
672         *     flags = flags from the #GDBusCallFlags enumeration
673         *     timeoutMsec = the timeout in milliseconds, -1 to use the default
674         *         timeout or %G_MAXINT for no timeout
675         *     fdList = a #GUnixFDList or %NULL
676         *     outFdList = return location for a #GUnixFDList or %NULL
677         *     cancellable = a #GCancellable or %NULL
678         *
679         * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
680         *     return values. Free with g_variant_unref().
681         *
682         * Since: 2.30
683         *
684         * Throws: GException on failure.
685         */
686        public Variant callWithUnixFdListSync(string busName, string objectPath, string interfaceName, string methodName, Variant parameters, VariantType replyType, GDBusCallFlags flags, int timeoutMsec, UnixFDList fdList, out UnixFDList outFdList, Cancellable cancellable)
687        {
688                GUnixFDList* outoutFdList = null;
689                GError* err = null;
690               
691                auto p = g_dbus_connection_call_with_unix_fd_list_sync(gDBusConnection, Str.toStringz(busName), Str.toStringz(objectPath), Str.toStringz(interfaceName), Str.toStringz(methodName), (parameters is null) ? null : parameters.getVariantStruct(), (replyType is null) ? null : replyType.getVariantTypeStruct(), flags, timeoutMsec, (fdList is null) ? null : fdList.getUnixFDListStruct(), &outoutFdList, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
692               
693                if (err !is null)
694                {
695                        throw new GException( new ErrorG(err) );
696                }
697               
698                outFdList = ObjectG.getDObject!(UnixFDList)(outoutFdList);
699               
700                if(p is null)
701                {
702                        return null;
703                }
704               
705                return new Variant(cast(GVariant*) p, true);
706        }
707
708        /**
709         * Closes @connection. Note that this never causes the process to
710         * exit (this might only happen if the other end of a shared message
711         * bus connection disconnects, see #GDBusConnection:exit-on-close).
712         *
713         * Once the connection is closed, operations such as sending a message
714         * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
715         * will not automatically flush the connection so queued messages may
716         * be lost. Use g_dbus_connection_flush() if you need such guarantees.
717         *
718         * If @connection is already closed, this method fails with
719         * %G_IO_ERROR_CLOSED.
720         *
721         * When @connection has been closed, the #GDBusConnection::closed
722         * signal is emitted in the
723         * [thread-default main context][g-main-context-push-thread-default]
724         * of the thread that @connection was constructed in.
725         *
726         * This is an asynchronous method. When the operation is finished,
727         * @callback will be invoked in the
728         * [thread-default main context][g-main-context-push-thread-default]
729         * of the thread you are calling this method from. You can
730         * then call g_dbus_connection_close_finish() to get the result of the
731         * operation. See g_dbus_connection_close_sync() for the synchronous
732         * version.
733         *
734         * Params:
735         *     cancellable = a #GCancellable or %NULL
736         *     callback = a #GAsyncReadyCallback to call when the request is
737         *         satisfied or %NULL if you don't care about the result
738         *     userData = The data to pass to @callback
739         *
740         * Since: 2.26
741         */
742        public void close(Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
743        {
744                g_dbus_connection_close(gDBusConnection, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
745        }
746
747        /**
748         * Finishes an operation started with g_dbus_connection_close().
749         *
750         * Params:
751         *     res = a #GAsyncResult obtained from the #GAsyncReadyCallback passed
752         *         to g_dbus_connection_close()
753         *
754         * Returns: %TRUE if the operation succeeded, %FALSE if @error is set
755         *
756         * Since: 2.26
757         *
758         * Throws: GException on failure.
759         */
760        public bool closeFinish(AsyncResultIF res)
761        {
762                GError* err = null;
763               
764                auto p = g_dbus_connection_close_finish(gDBusConnection, (res is null) ? null : res.getAsyncResultStruct(), &err) != 0;
765               
766                if (err !is null)
767                {
768                        throw new GException( new ErrorG(err) );
769                }
770               
771                return p;
772        }
773
774        /**
775         * Synchronously closees @connection. The calling thread is blocked
776         * until this is done. See g_dbus_connection_close() for the
777         * asynchronous version of this method and more details about what it
778         * does.
779         *
780         * Params:
781         *     cancellable = a #GCancellable or %NULL
782         *
783         * Returns: %TRUE if the operation succeeded, %FALSE if @error is set
784         *
785         * Since: 2.26
786         *
787         * Throws: GException on failure.
788         */
789        public bool closeSync(Cancellable cancellable)
790        {
791                GError* err = null;
792               
793                auto p = g_dbus_connection_close_sync(gDBusConnection, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err) != 0;
794               
795                if (err !is null)
796                {
797                        throw new GException( new ErrorG(err) );
798                }
799               
800                return p;
801        }
802
803        /**
804         * Emits a signal.
805         *
806         * If the parameters GVariant is floating, it is consumed.
807         *
808         * This can only fail if @parameters is not compatible with the D-Bus protocol.
809         *
810         * Params:
811         *     destinationBusName = the unique bus name for the destination
812         *         for the signal or %NULL to emit to all listeners
813         *     objectPath = path of remote object
814         *     interfaceName = D-Bus interface to emit a signal on
815         *     signalName = the name of the signal to emit
816         *     parameters = a #GVariant tuple with parameters for the signal
817         *         or %NULL if not passing parameters
818         *
819         * Returns: %TRUE unless @error is set
820         *
821         * Since: 2.26
822         *
823         * Throws: GException on failure.
824         */
825        public bool emitSignal(string destinationBusName, string objectPath, string interfaceName, string signalName, Variant parameters)
826        {
827                GError* err = null;
828               
829                auto p = g_dbus_connection_emit_signal(gDBusConnection, Str.toStringz(destinationBusName), Str.toStringz(objectPath), Str.toStringz(interfaceName), Str.toStringz(signalName), (parameters is null) ? null : parameters.getVariantStruct(), &err) != 0;
830               
831                if (err !is null)
832                {
833                        throw new GException( new ErrorG(err) );
834                }
835               
836                return p;
837        }
838
839        /**
840         * Exports @action_group on @connection at @object_path.
841         *
842         * The implemented D-Bus API should be considered private.  It is
843         * subject to change in the future.
844         *
845         * A given object path can only have one action group exported on it.
846         * If this constraint is violated, the export will fail and 0 will be
847         * returned (with @error set accordingly).
848         *
849         * You can unexport the action group using
850         * g_dbus_connection_unexport_action_group() with the return value of
851         * this function.
852         *
853         * The thread default main context is taken at the time of this call.
854         * All incoming action activations and state change requests are
855         * reported from this context.  Any changes on the action group that
856         * cause it to emit signals must also come from this same context.
857         * Since incoming action activations and state change requests are
858         * rather likely to cause changes on the action group, this effectively
859         * limits a given action group to being exported from only one main
860         * context.
861         *
862         * Params:
863         *     objectPath = a D-Bus object path
864         *     actionGroup = a #GActionGroup
865         *
866         * Returns: the ID of the export (never zero), or 0 in case of failure
867         *
868         * Since: 2.32
869         *
870         * Throws: GException on failure.
871         */
872        public uint exportActionGroup(string objectPath, ActionGroupIF actionGroup)
873        {
874                GError* err = null;
875               
876                auto p = g_dbus_connection_export_action_group(gDBusConnection, Str.toStringz(objectPath), (actionGroup is null) ? null : actionGroup.getActionGroupStruct(), &err);
877               
878                if (err !is null)
879                {
880                        throw new GException( new ErrorG(err) );
881                }
882               
883                return p;
884        }
885
886        /**
887         * Exports @menu on @connection at @object_path.
888         *
889         * The implemented D-Bus API should be considered private.
890         * It is subject to change in the future.
891         *
892         * An object path can only have one menu model exported on it. If this
893         * constraint is violated, the export will fail and 0 will be
894         * returned (with @error set accordingly).
895         *
896         * You can unexport the menu model using
897         * g_dbus_connection_unexport_menu_model() with the return value of
898         * this function.
899         *
900         * Params:
901         *     objectPath = a D-Bus object path
902         *     menu = a #GMenuModel
903         *
904         * Returns: the ID of the export (never zero), or 0 in case of failure
905         *
906         * Since: 2.32
907         *
908         * Throws: GException on failure.
909         */
910        public uint exportMenuModel(string objectPath, MenuModel menu)
911        {
912                GError* err = null;
913               
914                auto p = g_dbus_connection_export_menu_model(gDBusConnection, Str.toStringz(objectPath), (menu is null) ? null : menu.getMenuModelStruct(), &err);
915               
916                if (err !is null)
917                {
918                        throw new GException( new ErrorG(err) );
919                }
920               
921                return p;
922        }
923
924        /**
925         * Asynchronously flushes @connection, that is, writes all queued
926         * outgoing message to the transport and then flushes the transport
927         * (using g_output_stream_flush_async()). This is useful in programs
928         * that wants to emit a D-Bus signal and then exit immediately. Without
929         * flushing the connection, there is no guaranteed that the message has
930         * been sent to the networking buffers in the OS kernel.
931         *
932         * This is an asynchronous method. When the operation is finished,
933         * @callback will be invoked in the
934         * [thread-default main context][g-main-context-push-thread-default]
935         * of the thread you are calling this method from. You can
936         * then call g_dbus_connection_flush_finish() to get the result of the
937         * operation. See g_dbus_connection_flush_sync() for the synchronous
938         * version.
939         *
940         * Params:
941         *     cancellable = a #GCancellable or %NULL
942         *     callback = a #GAsyncReadyCallback to call when the
943         *         request is satisfied or %NULL if you don't care about the result
944         *     userData = The data to pass to @callback
945         *
946         * Since: 2.26
947         */
948        public void flush(Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
949        {
950                g_dbus_connection_flush(gDBusConnection, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
951        }
952
953        /**
954         * Finishes an operation started with g_dbus_connection_flush().
955         *
956         * Params:
957         *     res = a #GAsyncResult obtained from the #GAsyncReadyCallback passed
958         *         to g_dbus_connection_flush()
959         *
960         * Returns: %TRUE if the operation succeeded, %FALSE if @error is set
961         *
962         * Since: 2.26
963         *
964         * Throws: GException on failure.
965         */
966        public bool flushFinish(AsyncResultIF res)
967        {
968                GError* err = null;
969               
970                auto p = g_dbus_connection_flush_finish(gDBusConnection, (res is null) ? null : res.getAsyncResultStruct(), &err) != 0;
971               
972                if (err !is null)
973                {
974                        throw new GException( new ErrorG(err) );
975                }
976               
977                return p;
978        }
979
980        /**
981         * Synchronously flushes @connection. The calling thread is blocked
982         * until this is done. See g_dbus_connection_flush() for the
983         * asynchronous version of this method and more details about what it
984         * does.
985         *
986         * Params:
987         *     cancellable = a #GCancellable or %NULL
988         *
989         * Returns: %TRUE if the operation succeeded, %FALSE if @error is set
990         *
991         * Since: 2.26
992         *
993         * Throws: GException on failure.
994         */
995        public bool flushSync(Cancellable cancellable)
996        {
997                GError* err = null;
998               
999                auto p = g_dbus_connection_flush_sync(gDBusConnection, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err) != 0;
1000               
1001                if (err !is null)
1002                {
1003                        throw new GException( new ErrorG(err) );
1004                }
1005               
1006                return p;
1007        }
1008
1009        /**
1010         * Gets the capabilities negotiated with the remote peer
1011         *
1012         * Returns: zero or more flags from the #GDBusCapabilityFlags enumeration
1013         *
1014         * Since: 2.26
1015         */
1016        public GDBusCapabilityFlags getCapabilities()
1017        {
1018                return g_dbus_connection_get_capabilities(gDBusConnection);
1019        }
1020
1021        /**
1022         * Gets whether the process is terminated when @connection is
1023         * closed by the remote peer. See
1024         * #GDBusConnection:exit-on-close for more details.
1025         *
1026         * Returns: whether the process is terminated when @connection is
1027         *     closed by the remote peer
1028         *
1029         * Since: 2.26
1030         */
1031        public bool getExitOnClose()
1032        {
1033                return g_dbus_connection_get_exit_on_close(gDBusConnection) != 0;
1034        }
1035
1036        /**
1037         * The GUID of the peer performing the role of server when
1038         * authenticating. See #GDBusConnection:guid for more details.
1039         *
1040         * Returns: The GUID. Do not free this string, it is owned by
1041         *     @connection.
1042         *
1043         * Since: 2.26
1044         */
1045        public string getGuid()
1046        {
1047                return Str.toString(g_dbus_connection_get_guid(gDBusConnection));
1048        }
1049
1050        /**
1051         * Retrieves the last serial number assigned to a #GDBusMessage on
1052         * the current thread. This includes messages sent via both low-level
1053         * API such as g_dbus_connection_send_message() as well as
1054         * high-level API such as g_dbus_connection_emit_signal(),
1055         * g_dbus_connection_call() or g_dbus_proxy_call().
1056         *
1057         * Returns: the last used serial or zero when no message has been sent
1058         *     within the current thread
1059         *
1060         * Since: 2.34
1061         */
1062        public uint getLastSerial()
1063        {
1064                return g_dbus_connection_get_last_serial(gDBusConnection);
1065        }
1066
1067        /**
1068         * Gets the credentials of the authenticated peer. This will always
1069         * return %NULL unless @connection acted as a server
1070         * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
1071         * when set up and the client passed credentials as part of the
1072         * authentication process.
1073         *
1074         * In a message bus setup, the message bus is always the server and
1075         * each application is a client. So this method will always return
1076         * %NULL for message bus clients.
1077         *
1078         * Returns: a #GCredentials or %NULL if not available.
1079         *     Do not free this object, it is owned by @connection.
1080         *
1081         * Since: 2.26
1082         */
1083        public Credentials getPeerCredentials()
1084        {
1085                auto p = g_dbus_connection_get_peer_credentials(gDBusConnection);
1086               
1087                if(p is null)
1088                {
1089                        return null;
1090                }
1091               
1092                return ObjectG.getDObject!(Credentials)(cast(GCredentials*) p);
1093        }
1094
1095        /**
1096         * Gets the underlying stream used for IO.
1097         *
1098         * While the #GDBusConnection is active, it will interact with this
1099         * stream from a worker thread, so it is not safe to interact with
1100         * the stream directly.
1101         *
1102         * Returns: the stream used for IO
1103         *
1104         * Since: 2.26
1105         */
1106        public IOStream getStream()
1107        {
1108                auto p = g_dbus_connection_get_stream(gDBusConnection);
1109               
1110                if(p is null)
1111                {
1112                        return null;
1113                }
1114               
1115                return ObjectG.getDObject!(IOStream)(cast(GIOStream*) p);
1116        }
1117
1118        /**
1119         * Gets the unique name of @connection as assigned by the message
1120         * bus. This can also be used to figure out if @connection is a
1121         * message bus connection.
1122         *
1123         * Returns: the unique name or %NULL if @connection is not a message
1124         *     bus connection. Do not free this string, it is owned by
1125         *     @connection.
1126         *
1127         * Since: 2.26
1128         */
1129        public string getUniqueName()
1130        {
1131                return Str.toString(g_dbus_connection_get_unique_name(gDBusConnection));
1132        }
1133
1134        /**
1135         * Gets whether @connection is closed.
1136         *
1137         * Returns: %TRUE if the connection is closed, %FALSE otherwise
1138         *
1139         * Since: 2.26
1140         */
1141        public bool isClosed()
1142        {
1143                return g_dbus_connection_is_closed(gDBusConnection) != 0;
1144        }
1145
1146        /**
1147         * Registers callbacks for exported objects at @object_path with the
1148         * D-Bus interface that is described in @interface_info.
1149         *
1150         * Calls to functions in @vtable (and @user_data_free_func) will happen
1151         * in the
1152         * [thread-default main context][g-main-context-push-thread-default]
1153         * of the thread you are calling this method from.
1154         *
1155         * Note that all #GVariant values passed to functions in @vtable will match
1156         * the signature given in @interface_info - if a remote caller passes
1157         * incorrect values, the `org.freedesktop.DBus.Error.InvalidArgs`
1158         * is returned to the remote caller.
1159         *
1160         * Additionally, if the remote caller attempts to invoke methods or
1161         * access properties not mentioned in @interface_info the
1162         * `org.freedesktop.DBus.Error.UnknownMethod` resp.
1163         * `org.freedesktop.DBus.Error.InvalidArgs` errors
1164         * are returned to the caller.
1165         *
1166         * It is considered a programming error if the
1167         * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
1168         * #GVariant of incorrect type.
1169         *
1170         * If an existing callback is already registered at @object_path and
1171         * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
1172         *
1173         * GDBus automatically implements the standard D-Bus interfaces
1174         * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
1175         * and org.freedesktop.Peer, so you don't have to implement those for the
1176         * objects you export. You can implement org.freedesktop.DBus.Properties
1177         * yourself, e.g. to handle getting and setting of properties asynchronously.
1178         *
1179         * Note that the reference count on @interface_info will be
1180         * incremented by 1 (unless allocated statically, e.g. if the
1181         * reference count is -1, see g_dbus_interface_info_ref()) for as long
1182         * as the object is exported. Also note that @vtable will be copied.
1183         *
1184         * See this [server][gdbus-server] for an example of how to use this method.
1185         *
1186         * Params:
1187         *     objectPath = the object path to register at
1188         *     interfaceInfo = introspection data for the interface
1189         *     vtable = a #GDBusInterfaceVTable to call into or %NULL
1190         *     userData = data to pass to functions in @vtable
1191         *     userDataFreeFunc = function to call when the object path is unregistered
1192         *
1193         * Returns: 0 if @error is set, otherwise a registration id (never 0)
1194         *     that can be used with g_dbus_connection_unregister_object()
1195         *
1196         * Since: 2.26
1197         *
1198         * Throws: GException on failure.
1199         */
1200        public uint registerObject(string objectPath, DBusInterfaceInfo interfaceInfo, GDBusInterfaceVTable* vtable, void* userData, GDestroyNotify userDataFreeFunc)
1201        {
1202                GError* err = null;
1203               
1204                auto p = g_dbus_connection_register_object(gDBusConnection, Str.toStringz(objectPath), (interfaceInfo is null) ? null : interfaceInfo.getDBusInterfaceInfoStruct(), vtable, userData, userDataFreeFunc, &err);
1205               
1206                if (err !is null)
1207                {
1208                        throw new GException( new ErrorG(err) );
1209                }
1210               
1211                return p;
1212        }
1213
1214        /**
1215         * Version of g_dbus_connection_register_object() using closures instead of a
1216         * #GDBusInterfaceVTable for easier binding in other languages.
1217         *
1218         * Params:
1219         *     objectPath = The object path to register at.
1220         *     interfaceInfo = Introspection data for the interface.
1221         *     methodCallClosure = #GClosure for handling incoming method calls.
1222         *     getPropertyClosure = #GClosure for getting a property.
1223         *     setPropertyClosure = #GClosure for setting a property.
1224         *
1225         * Returns: 0 if @error is set, otherwise a registration id (never 0)
1226         *     that can be used with g_dbus_connection_unregister_object() .
1227         *
1228         * Since: 2.46
1229         *
1230         * Throws: GException on failure.
1231         */
1232        public uint registerObjectWithClosures(string objectPath, DBusInterfaceInfo interfaceInfo, Closure methodCallClosure, Closure getPropertyClosure, Closure setPropertyClosure)
1233        {
1234                GError* err = null;
1235               
1236                auto p = g_dbus_connection_register_object_with_closures(gDBusConnection, Str.toStringz(objectPath), (interfaceInfo is null) ? null : interfaceInfo.getDBusInterfaceInfoStruct(), (methodCallClosure is null) ? null : methodCallClosure.getClosureStruct(), (getPropertyClosure is null) ? null : getPropertyClosure.getClosureStruct(), (setPropertyClosure is null) ? null : setPropertyClosure.getClosureStruct(), &err);
1237               
1238                if (err !is null)
1239                {
1240                        throw new GException( new ErrorG(err) );
1241                }
1242               
1243                return p;
1244        }
1245
1246        /**
1247         * Registers a whole subtree of dynamic objects.
1248         *
1249         * The @enumerate and @introspection functions in @vtable are used to
1250         * convey, to remote callers, what nodes exist in the subtree rooted
1251         * by @object_path.
1252         *
1253         * When handling remote calls into any node in the subtree, first the
1254         * @enumerate function is used to check if the node exists. If the node exists
1255         * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
1256         * the @introspection function is used to check if the node supports the
1257         * requested method. If so, the @dispatch function is used to determine
1258         * where to dispatch the call. The collected #GDBusInterfaceVTable and
1259         * #gpointer will be used to call into the interface vtable for processing
1260         * the request.
1261         *
1262         * All calls into user-provided code will be invoked in the
1263         * [thread-default main context][g-main-context-push-thread-default]
1264         * of the thread you are calling this method from.
1265         *
1266         * If an existing subtree is already registered at @object_path or
1267         * then @error is set to #G_IO_ERROR_EXISTS.
1268         *
1269         * Note that it is valid to register regular objects (using
1270         * g_dbus_connection_register_object()) in a subtree registered with
1271         * g_dbus_connection_register_subtree() - if so, the subtree handler
1272         * is tried as the last resort. One way to think about a subtree
1273         * handler is to consider it a fallback handler for object paths not
1274         * registered via g_dbus_connection_register_object() or other bindings.
1275         *
1276         * Note that @vtable will be copied so you cannot change it after
1277         * registration.
1278         *
1279         * See this [server][gdbus-subtree-server] for an example of how to use
1280         * this method.
1281         *
1282         * Params:
1283         *     objectPath = the object path to register the subtree at
1284         *     vtable = a #GDBusSubtreeVTable to enumerate, introspect and
1285         *         dispatch nodes in the subtree
1286         *     flags = flags used to fine tune the behavior of the subtree
1287         *     userData = data to pass to functions in @vtable
1288         *     userDataFreeFunc = function to call when the subtree is unregistered
1289         *
1290         * Returns: 0 if @error is set, otherwise a subtree registration id (never 0)
1291         *     that can be used with g_dbus_connection_unregister_subtree() .
1292         *
1293         * Since: 2.26
1294         *
1295         * Throws: GException on failure.
1296         */
1297        public uint registerSubtree(string objectPath, GDBusSubtreeVTable* vtable, GDBusSubtreeFlags flags, void* userData, GDestroyNotify userDataFreeFunc)
1298        {
1299                GError* err = null;
1300               
1301                auto p = g_dbus_connection_register_subtree(gDBusConnection, Str.toStringz(objectPath), vtable, flags, userData, userDataFreeFunc, &err);
1302               
1303                if (err !is null)
1304                {
1305                        throw new GException( new ErrorG(err) );
1306                }
1307               
1308                return p;
1309        }
1310
1311        /**
1312         * Removes a filter.
1313         *
1314         * Note that since filters run in a different thread, there is a race
1315         * condition where it is possible that the filter will be running even
1316         * after calling g_dbus_connection_remove_filter(), so you cannot just
1317         * free data that the filter might be using. Instead, you should pass
1318         * a #GDestroyNotify to g_dbus_connection_add_filter(), which will be
1319         * called when it is guaranteed that the data is no longer needed.
1320         *
1321         * Params:
1322         *     filterId = an identifier obtained from g_dbus_connection_add_filter()
1323         *
1324         * Since: 2.26
1325         */
1326        public void removeFilter(uint filterId)
1327        {
1328                g_dbus_connection_remove_filter(gDBusConnection, filterId);
1329        }
1330
1331        /**
1332         * Asynchronously sends @message to the peer represented by @connection.
1333         *
1334         * Unless @flags contain the
1335         * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
1336         * will be assigned by @connection and set on @message via
1337         * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
1338         * serial number used will be written to this location prior to
1339         * submitting the message to the underlying transport.
1340         *
1341         * If @connection is closed then the operation will fail with
1342         * %G_IO_ERROR_CLOSED. If @message is not well-formed,
1343         * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
1344         *
1345         * See this [server][gdbus-server] and [client][gdbus-unix-fd-client]
1346         * for an example of how to use this low-level API to send and receive
1347         * UNIX file descriptors.
1348         *
1349         * Note that @message must be unlocked, unless @flags contain the
1350         * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
1351         *
1352         * Params:
1353         *     message = a #GDBusMessage
1354         *     flags = flags affecting how the message is sent
1355         *     outSerial = return location for serial number assigned
1356         *         to @message when sending it or %NULL
1357         *
1358         * Returns: %TRUE if the message was well-formed and queued for
1359         *     transmission, %FALSE if @error is set
1360         *
1361         * Since: 2.26
1362         *
1363         * Throws: GException on failure.
1364         */
1365        public bool sendMessage(DBusMessage message, GDBusSendMessageFlags flags, out uint outSerial)
1366        {
1367                GError* err = null;
1368               
1369                auto p = g_dbus_connection_send_message(gDBusConnection, (message is null) ? null : message.getDBusMessageStruct(), flags, &outSerial, &err) != 0;
1370               
1371                if (err !is null)
1372                {
1373                        throw new GException( new ErrorG(err) );
1374                }
1375               
1376                return p;
1377        }
1378
1379        /**
1380         * Asynchronously sends @message to the peer represented by @connection.
1381         *
1382         * Unless @flags contain the
1383         * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
1384         * will be assigned by @connection and set on @message via
1385         * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
1386         * serial number used will be written to this location prior to
1387         * submitting the message to the underlying transport.
1388         *
1389         * If @connection is closed then the operation will fail with
1390         * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
1391         * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
1392         * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
1393         *
1394         * This is an asynchronous method. When the operation is finished, @callback
1395         * will be invoked in the
1396         * [thread-default main context][g-main-context-push-thread-default]
1397         * of the thread you are calling this method from. You can then call
1398         * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
1399         * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
1400         *
1401         * Note that @message must be unlocked, unless @flags contain the
1402         * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
1403         *
1404         * See this [server][gdbus-server] and [client][gdbus-unix-fd-client]
1405         * for an example of how to use this low-level API to send and receive
1406         * UNIX file descriptors.
1407         *
1408         * Params:
1409         *     message = a #GDBusMessage
1410         *     flags = flags affecting how the message is sent
1411         *     timeoutMsec = the timeout in milliseconds, -1 to use the default
1412         *         timeout or %G_MAXINT for no timeout
1413         *     outSerial = return location for serial number assigned
1414         *         to @message when sending it or %NULL
1415         *     cancellable = a #GCancellable or %NULL
1416         *     callback = a #GAsyncReadyCallback to call when the request
1417         *         is satisfied or %NULL if you don't care about the result
1418         *     userData = The data to pass to @callback
1419         *
1420         * Since: 2.26
1421         */
1422        public void sendMessageWithReply(DBusMessage message, GDBusSendMessageFlags flags, int timeoutMsec, out uint outSerial, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
1423        {
1424                g_dbus_connection_send_message_with_reply(gDBusConnection, (message is null) ? null : message.getDBusMessageStruct(), flags, timeoutMsec, &outSerial, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
1425        }
1426
1427        /**
1428         * Finishes an operation started with g_dbus_connection_send_message_with_reply().
1429         *
1430         * Note that @error is only set if a local in-process error
1431         * occurred. That is to say that the returned #GDBusMessage object may
1432         * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
1433         * g_dbus_message_to_gerror() to transcode this to a #GError.
1434         *
1435         * See this [server][gdbus-server] and [client][gdbus-unix-fd-client]
1436         * for an example of how to use this low-level API to send and receive
1437         * UNIX file descriptors.
1438         *
1439         * Params:
1440         *     res = a #GAsyncResult obtained from the #GAsyncReadyCallback passed to
1441         *         g_dbus_connection_send_message_with_reply()
1442         *
1443         * Returns: a locked #GDBusMessage or %NULL if @error is set
1444         *
1445         * Since: 2.26
1446         *
1447         * Throws: GException on failure.
1448         */
1449        public DBusMessage sendMessageWithReplyFinish(AsyncResultIF res)
1450        {
1451                GError* err = null;
1452               
1453                auto p = g_dbus_connection_send_message_with_reply_finish(gDBusConnection, (res is null) ? null : res.getAsyncResultStruct(), &err);
1454               
1455                if (err !is null)
1456                {
1457                        throw new GException( new ErrorG(err) );
1458                }
1459               
1460                if(p is null)
1461                {
1462                        return null;
1463                }
1464               
1465                return ObjectG.getDObject!(DBusMessage)(cast(GDBusMessage*) p, true);
1466        }
1467
1468        /**
1469         * Synchronously sends @message to the peer represented by @connection
1470         * and blocks the calling thread until a reply is received or the
1471         * timeout is reached. See g_dbus_connection_send_message_with_reply()
1472         * for the asynchronous version of this method.
1473         *
1474         * Unless @flags contain the
1475         * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
1476         * will be assigned by @connection and set on @message via
1477         * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
1478         * serial number used will be written to this location prior to
1479         * submitting the message to the underlying transport.
1480         *
1481         * If @connection is closed then the operation will fail with
1482         * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
1483         * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
1484         * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
1485         *
1486         * Note that @error is only set if a local in-process error
1487         * occurred. That is to say that the returned #GDBusMessage object may
1488         * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
1489         * g_dbus_message_to_gerror() to transcode this to a #GError.
1490         *
1491         * See this [server][gdbus-server] and [client][gdbus-unix-fd-client]
1492         * for an example of how to use this low-level API to send and receive
1493         * UNIX file descriptors.
1494         *
1495         * Note that @message must be unlocked, unless @flags contain the
1496         * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
1497         *
1498         * Params:
1499         *     message = a #GDBusMessage
1500         *     flags = flags affecting how the message is sent.
1501         *     timeoutMsec = the timeout in milliseconds, -1 to use the default
1502         *         timeout or %G_MAXINT for no timeout
1503         *     outSerial = return location for serial number
1504         *         assigned to @message when sending it or %NULL
1505         *     cancellable = a #GCancellable or %NULL
1506         *
1507         * Returns: a locked #GDBusMessage that is the reply
1508         *     to @message or %NULL if @error is set
1509         *
1510         * Since: 2.26
1511         *
1512         * Throws: GException on failure.
1513         */
1514        public DBusMessage sendMessageWithReplySync(DBusMessage message, GDBusSendMessageFlags flags, int timeoutMsec, out uint outSerial, Cancellable cancellable)
1515        {
1516                GError* err = null;
1517               
1518                auto p = g_dbus_connection_send_message_with_reply_sync(gDBusConnection, (message is null) ? null : message.getDBusMessageStruct(), flags, timeoutMsec, &outSerial, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
1519               
1520                if (err !is null)
1521                {
1522                        throw new GException( new ErrorG(err) );
1523                }
1524               
1525                if(p is null)
1526                {
1527                        return null;
1528                }
1529               
1530                return ObjectG.getDObject!(DBusMessage)(cast(GDBusMessage*) p, true);
1531        }
1532
1533        /**
1534         * Sets whether the process should be terminated when @connection is
1535         * closed by the remote peer. See #GDBusConnection:exit-on-close for
1536         * more details.
1537         *
1538         * Note that this function should be used with care. Most modern UNIX
1539         * desktops tie the notion of a user session the session bus, and expect
1540         * all of a users applications to quit when their bus connection goes away.
1541         * If you are setting @exit_on_close to %FALSE for the shared session
1542         * bus connection, you should make sure that your application exits
1543         * when the user session ends.
1544         *
1545         * Params:
1546         *     exitOnClose = whether the process should be terminated
1547         *         when @connection is closed by the remote peer
1548         *
1549         * Since: 2.26
1550         */
1551        public void setExitOnClose(bool exitOnClose)
1552        {
1553                g_dbus_connection_set_exit_on_close(gDBusConnection, exitOnClose);
1554        }
1555
1556        /**
1557         * Subscribes to signals on @connection and invokes @callback with a whenever
1558         * the signal is received. Note that @callback will be invoked in the
1559         * [thread-default main context][g-main-context-push-thread-default]
1560         * of the thread you are calling this method from.
1561         *
1562         * If @connection is not a message bus connection, @sender must be
1563         * %NULL.
1564         *
1565         * If @sender is a well-known name note that @callback is invoked with
1566         * the unique name for the owner of @sender, not the well-known name
1567         * as one would expect. This is because the message bus rewrites the
1568         * name. As such, to avoid certain race conditions, users should be
1569         * tracking the name owner of the well-known name and use that when
1570         * processing the received signal.
1571         *
1572         * If one of %G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE or
1573         * %G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH are given, @arg0 is
1574         * interpreted as part of a namespace or path.  The first argument
1575         * of a signal is matched against that part as specified by D-Bus.
1576         *
1577         * If @user_data_free_func is non-%NULL, it will be called (in the
1578         * thread-default main context of the thread you are calling this
1579         * method from) at some point after @user_data is no longer
1580         * needed. (It is not guaranteed to be called synchronously when the
1581         * signal is unsubscribed from, and may be called after @connection
1582         * has been destroyed.)
1583         *
1584         * Params:
1585         *     sender = sender name to match on (unique or well-known name)
1586         *         or %NULL to listen from all senders
1587         *     interfaceName = D-Bus interface name to match on or %NULL to
1588         *         match on all interfaces
1589         *     member = D-Bus signal name to match on or %NULL to match on
1590         *         all signals
1591         *     objectPath = object path to match on or %NULL to match on
1592         *         all object paths
1593         *     arg0 = contents of first string argument to match on or %NULL
1594         *         to match on all kinds of arguments
1595         *     flags = #GDBusSignalFlags describing how arg0 is used in subscribing to the
1596         *         signal
1597         *     callback = callback to invoke when there is a signal matching the requested data
1598         *     userData = user data to pass to @callback
1599         *     userDataFreeFunc = function to free @user_data with when
1600         *         subscription is removed or %NULL
1601         *
1602         * Returns: a subscription identifier that can be used with g_dbus_connection_signal_unsubscribe()
1603         *
1604         * Since: 2.26
1605         */
1606        public uint signalSubscribe(string sender, string interfaceName, string member, string objectPath, string arg0, GDBusSignalFlags flags, GDBusSignalCallback callback, void* userData, GDestroyNotify userDataFreeFunc)
1607        {
1608                return g_dbus_connection_signal_subscribe(gDBusConnection, Str.toStringz(sender), Str.toStringz(interfaceName), Str.toStringz(member), Str.toStringz(objectPath), Str.toStringz(arg0), flags, callback, userData, userDataFreeFunc);
1609        }
1610
1611        /**
1612         * Unsubscribes from signals.
1613         *
1614         * Params:
1615         *     subscriptionId = a subscription id obtained from
1616         *         g_dbus_connection_signal_subscribe()
1617         *
1618         * Since: 2.26
1619         */
1620        public void signalUnsubscribe(uint subscriptionId)
1621        {
1622                g_dbus_connection_signal_unsubscribe(gDBusConnection, subscriptionId);
1623        }
1624
1625        /**
1626         * If @connection was created with
1627         * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
1628         * starts processing messages. Does nothing on if @connection wasn't
1629         * created with this flag or if the method has already been called.
1630         *
1631         * Since: 2.26
1632         */
1633        public void startMessageProcessing()
1634        {
1635                g_dbus_connection_start_message_processing(gDBusConnection);
1636        }
1637
1638        /**
1639         * Reverses the effect of a previous call to
1640         * g_dbus_connection_export_action_group().
1641         *
1642         * It is an error to call this function with an ID that wasn't returned
1643         * from g_dbus_connection_export_action_group() or to call it with the
1644         * same ID more than once.
1645         *
1646         * Params:
1647         *     exportId = the ID from g_dbus_connection_export_action_group()
1648         *
1649         * Since: 2.32
1650         */
1651        public void unexportActionGroup(uint exportId)
1652        {
1653                g_dbus_connection_unexport_action_group(gDBusConnection, exportId);
1654        }
1655
1656        /**
1657         * Reverses the effect of a previous call to
1658         * g_dbus_connection_export_menu_model().
1659         *
1660         * It is an error to call this function with an ID that wasn't returned
1661         * from g_dbus_connection_export_menu_model() or to call it with the
1662         * same ID more than once.
1663         *
1664         * Params:
1665         *     exportId = the ID from g_dbus_connection_export_menu_model()
1666         *
1667         * Since: 2.32
1668         */
1669        public void unexportMenuModel(uint exportId)
1670        {
1671                g_dbus_connection_unexport_menu_model(gDBusConnection, exportId);
1672        }
1673
1674        /**
1675         * Unregisters an object.
1676         *
1677         * Params:
1678         *     registrationId = a registration id obtained from
1679         *         g_dbus_connection_register_object()
1680         *
1681         * Returns: %TRUE if the object was unregistered, %FALSE otherwise
1682         *
1683         * Since: 2.26
1684         */
1685        public bool unregisterObject(uint registrationId)
1686        {
1687                return g_dbus_connection_unregister_object(gDBusConnection, registrationId) != 0;
1688        }
1689
1690        /**
1691         * Unregisters a subtree.
1692         *
1693         * Params:
1694         *     registrationId = a subtree registration id obtained from
1695         *         g_dbus_connection_register_subtree()
1696         *
1697         * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise
1698         *
1699         * Since: 2.26
1700         */
1701        public bool unregisterSubtree(uint registrationId)
1702        {
1703                return g_dbus_connection_unregister_subtree(gDBusConnection, registrationId) != 0;
1704        }
1705
1706        protected class OnClosedDelegateWrapper
1707        {
1708                static OnClosedDelegateWrapper[] listeners;
1709                void delegate(bool, ErrorG, DBusConnection) dlg;
1710                gulong handlerId;
1711               
1712                this(void delegate(bool, ErrorG, DBusConnection) dlg)
1713                {
1714                        this.dlg = dlg;
1715                        this.listeners ~= this;
1716                }
1717               
1718                void remove(OnClosedDelegateWrapper source)
1719                {
1720                        foreach(index, wrapper; listeners)
1721                        {
1722                                if (wrapper.handlerId == source.handlerId)
1723                                {
1724                                        listeners[index] = null;
1725                                        listeners = std.algorithm.remove(listeners, index);
1726                                        break;
1727                                }
1728                        }
1729                }
1730        }
1731
1732        /**
1733         * Emitted when the connection is closed.
1734         *
1735         * The cause of this event can be
1736         *
1737         * - If g_dbus_connection_close() is called. In this case
1738         * @remote_peer_vanished is set to %FALSE and @error is %NULL.
1739         *
1740         * - If the remote peer closes the connection. In this case
1741         * @remote_peer_vanished is set to %TRUE and @error is set.
1742         *
1743         * - If the remote peer sends invalid or malformed data. In this
1744         * case @remote_peer_vanished is set to %FALSE and @error is set.
1745         *
1746         * Upon receiving this signal, you should give up your reference to
1747         * @connection. You are guaranteed that this signal is emitted only
1748         * once.
1749         *
1750         * Params:
1751         *     remotePeerVanished = %TRUE if @connection is closed because the
1752         *         remote peer closed its end of the connection
1753         *     error = a #GError with more details about the event or %NULL
1754         *
1755         * Since: 2.26
1756         */
1757        gulong addOnClosed(void delegate(bool, ErrorG, DBusConnection) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1758        {
1759                auto wrapper = new OnClosedDelegateWrapper(dlg);
1760                wrapper.handlerId = Signals.connectData(
1761                        this,
1762                        "closed",
1763                        cast(GCallback)&callBackClosed,
1764                        cast(void*)wrapper,
1765                        cast(GClosureNotify)&callBackClosedDestroy,
1766                        connectFlags);
1767                return wrapper.handlerId;
1768        }
1769       
1770        extern(C) static void callBackClosed(GDBusConnection* dbusconnectionStruct, bool remotePeerVanished, GError* error, OnClosedDelegateWrapper wrapper)
1771        {
1772                wrapper.dlg(remotePeerVanished, new ErrorG(error), wrapper.outer);
1773        }
1774       
1775        extern(C) static void callBackClosedDestroy(OnClosedDelegateWrapper wrapper, GClosure* closure)
1776        {
1777                wrapper.remove(wrapper);
1778        }
1779
1780        /**
1781         * Asynchronously connects to the message bus specified by @bus_type.
1782         *
1783         * When the operation is finished, @callback will be invoked. You can
1784         * then call g_bus_get_finish() to get the result of the operation.
1785         *
1786         * This is a asynchronous failable function. See g_bus_get_sync() for
1787         * the synchronous version.
1788         *
1789         * Params:
1790         *     busType = a #GBusType
1791         *     cancellable = a #GCancellable or %NULL
1792         *     callback = a #GAsyncReadyCallback to call when the request is satisfied
1793         *     userData = the data to pass to @callback
1794         *
1795         * Since: 2.26
1796         */
1797        public static void get(GBusType busType, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
1798        {
1799                g_bus_get(busType, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
1800        }
1801
1802        /**
1803         * Finishes an operation started with g_bus_get().
1804         *
1805         * The returned object is a singleton, that is, shared with other
1806         * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
1807         * event that you need a private message bus connection, use
1808         * g_dbus_address_get_for_bus_sync() and
1809         * g_dbus_connection_new_for_address().
1810         *
1811         * Note that the returned #GDBusConnection object will (usually) have
1812         * the #GDBusConnection:exit-on-close property set to %TRUE.
1813         *
1814         * Params:
1815         *     res = a #GAsyncResult obtained from the #GAsyncReadyCallback passed
1816         *         to g_bus_get()
1817         *
1818         * Returns: a #GDBusConnection or %NULL if @error is set.
1819         *     Free with g_object_unref().
1820         *
1821         * Since: 2.26
1822         *
1823         * Throws: GException on failure.
1824         */
1825        public static DBusConnection getFinish(AsyncResultIF res)
1826        {
1827                GError* err = null;
1828               
1829                auto p = g_bus_get_finish((res is null) ? null : res.getAsyncResultStruct(), &err);
1830               
1831                if (err !is null)
1832                {
1833                        throw new GException( new ErrorG(err) );
1834                }
1835               
1836                if(p is null)
1837                {
1838                        return null;
1839                }
1840               
1841                return ObjectG.getDObject!(DBusConnection)(cast(GDBusConnection*) p, true);
1842        }
1843
1844        /**
1845         * Synchronously connects to the message bus specified by @bus_type.
1846         * Note that the returned object may shared with other callers,
1847         * e.g. if two separate parts of a process calls this function with
1848         * the same @bus_type, they will share the same object.
1849         *
1850         * This is a synchronous failable function. See g_bus_get() and
1851         * g_bus_get_finish() for the asynchronous version.
1852         *
1853         * The returned object is a singleton, that is, shared with other
1854         * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
1855         * event that you need a private message bus connection, use
1856         * g_dbus_address_get_for_bus_sync() and
1857         * g_dbus_connection_new_for_address().
1858         *
1859         * Note that the returned #GDBusConnection object will (usually) have
1860         * the #GDBusConnection:exit-on-close property set to %TRUE.
1861         *
1862         * Params:
1863         *     busType = a #GBusType
1864         *     cancellable = a #GCancellable or %NULL
1865         *
1866         * Returns: a #GDBusConnection or %NULL if @error is set.
1867         *     Free with g_object_unref().
1868         *
1869         * Since: 2.26
1870         *
1871         * Throws: GException on failure.
1872         */
1873        public static DBusConnection getSync(GBusType busType, Cancellable cancellable)
1874        {
1875                GError* err = null;
1876               
1877                auto p = g_bus_get_sync(busType, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
1878               
1879                if (err !is null)
1880                {
1881                        throw new GException( new ErrorG(err) );
1882                }
1883               
1884                if(p is null)
1885                {
1886                        return null;
1887                }
1888               
1889                return ObjectG.getDObject!(DBusConnection)(cast(GDBusConnection*) p, true);
1890        }
1891}
Note: See TracBrowser for help on using the repository browser.