v0.2.2 9100209

gdbusproxy.go RawHistoryFolder

1// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gio
3
4import (
5	"fmt"
6	"structs"
7	"unsafe"
8
9	"github.com/ebitengine/purego"
10
11	"github.com/bnema/puregotk/pkg/core"
12	"github.com/bnema/puregotk/v4/glib"
13	"github.com/bnema/puregotk/v4/gobject"
14	"github.com/bnema/puregotk/v4/gobject/types"
15)
16
17// Class structure for #GDBusProxy.
18type DBusProxyClass struct {
19	_ structs.HostLayout
20
21	ParentClass gobject.ObjectClass
22
23	xGPropertiesChanged uintptr
24
25	xGSignal uintptr
26
27	Padding [32]uintptr
28}
29
30func (x *DBusProxyClass) GoPointer() uintptr {
31	return uintptr(unsafe.Pointer(x))
32}
33
34// OverrideGPropertiesChanged sets the "g_properties_changed" callback function.
35// Signal class handler for the #GDBusProxy::g-properties-changed signal.
36func (x *DBusProxyClass) OverrideGPropertiesChanged(cb func(*DBusProxy, *glib.Variant, string)) {
37	if cb == nil {
38		x.xGPropertiesChanged = 0
39	} else {
40		x.xGPropertiesChanged = purego.NewCallback(func(ProxyVarp uintptr, ChangedPropertiesVarp *glib.Variant, InvalidatedPropertiesVarp string) {
41			cb(DBusProxyNewFromInternalPtr(ProxyVarp), ChangedPropertiesVarp, InvalidatedPropertiesVarp)
42		})
43	}
44}
45
46// GetGPropertiesChanged gets the "g_properties_changed" callback function.
47// Signal class handler for the #GDBusProxy::g-properties-changed signal.
48func (x *DBusProxyClass) GetGPropertiesChanged() func(*DBusProxy, *glib.Variant, string) {
49	if x.xGPropertiesChanged == 0 {
50		return nil
51	}
52	var rawCallback func(ProxyVarp uintptr, ChangedPropertiesVarp *glib.Variant, InvalidatedPropertiesVarp string)
53	purego.RegisterFunc(&rawCallback, x.xGPropertiesChanged)
54	return func(ProxyVar *DBusProxy, ChangedPropertiesVar *glib.Variant, InvalidatedPropertiesVar string) {
55		rawCallback(ProxyVar.GoPointer(), ChangedPropertiesVar, InvalidatedPropertiesVar)
56	}
57}
58
59// OverrideGSignal sets the "g_signal" callback function.
60// Signal class handler for the #GDBusProxy::g-signal signal.
61func (x *DBusProxyClass) OverrideGSignal(cb func(*DBusProxy, string, string, *glib.Variant)) {
62	if cb == nil {
63		x.xGSignal = 0
64	} else {
65		x.xGSignal = purego.NewCallback(func(ProxyVarp uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp *glib.Variant) {
66			cb(DBusProxyNewFromInternalPtr(ProxyVarp), SenderNameVarp, SignalNameVarp, ParametersVarp)
67		})
68	}
69}
70
71// GetGSignal gets the "g_signal" callback function.
72// Signal class handler for the #GDBusProxy::g-signal signal.
73func (x *DBusProxyClass) GetGSignal() func(*DBusProxy, string, string, *glib.Variant) {
74	if x.xGSignal == 0 {
75		return nil
76	}
77	var rawCallback func(ProxyVarp uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp *glib.Variant)
78	purego.RegisterFunc(&rawCallback, x.xGSignal)
79	return func(ProxyVar *DBusProxy, SenderNameVar string, SignalNameVar string, ParametersVar *glib.Variant) {
80		rawCallback(ProxyVar.GoPointer(), SenderNameVar, SignalNameVar, ParametersVar)
81	}
82}
83
84type DBusProxyPrivate struct {
85	_ structs.HostLayout
86}
87
88func (x *DBusProxyPrivate) GoPointer() uintptr {
89	return uintptr(unsafe.Pointer(x))
90}
91
92// `GDBusProxy` is a base class used for proxies to access a D-Bus
93// interface on a remote object. A `GDBusProxy` can be constructed for
94// both well-known and unique names.
95//
96// By default, `GDBusProxy` will cache all properties (and listen to
97// changes) of the remote object, and proxy all signals that get
98// emitted. This behaviour can be changed by passing suitable
99// [flags@Gio.DBusProxyFlags] when the proxy is created. If the proxy is for a
100// well-known name, the property cache is flushed when the name owner
101// vanishes and reloaded when a name owner appears.
102//
103// The unique name owner of the proxy’s name is tracked and can be read from
104// [property@Gio.DBusProxy:g-name-owner]. Connect to the
105// [signal@GObject.Object::notify] signal to get notified of changes.
106// Additionally, only signals and property changes emitted from the current name
107// owner are considered and calls are always sent to the current name owner.
108// This avoids a number of race conditions when the name is lost by one owner
109// and claimed by another. However, if no name owner currently exists,
110// then calls will be sent to the well-known name which may result in
111// the message bus launching an owner (unless
112// `G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START` is set).
113//
114// If the proxy is for a stateless D-Bus service, where the name owner may
115// be started and stopped between calls, the
116// [property@Gio.DBusProxy:g-name-owner] tracking of `GDBusProxy` will cause the
117// proxy to drop signal and property changes from the service after it has
118// restarted for the first time. When interacting with a stateless D-Bus
119// service, do not use `GDBusProxy` — use direct D-Bus method calls and signal
120// connections.
121//
122// The generic [signal@Gio.DBusProxy::g-properties-changed] and
123// [signal@Gio.DBusProxy::g-signal] signals are not very convenient to work
124// with. Therefore, the recommended way of working with proxies is to subclass
125// `GDBusProxy`, and have more natural properties and signals in your derived
126// class. This [example](migrating-gdbus.html#using-gdbus-codegen) shows how
127// this can easily be done using the [`gdbus-codegen`](gdbus-codegen.html) tool.
128//
129// A `GDBusProxy` instance can be used from multiple threads but note
130// that all signals (e.g. [signal@Gio.DBusProxy::g-signal],
131// [signal@Gio.DBusProxy::g-properties-changed] and
132// [signal@GObject.Object::notify]) are emitted in the thread-default main
133// context (see [method@GLib.MainContext.push_thread_default]) of the thread
134// where the instance was constructed.
135//
136// ## A watch proxy example
137// An example using a proxy for a well-known name can be found in
138// [`gdbus-example-watch-proxy.c`](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/gio/tests/gdbus-example-watch-proxy.c).
139type DBusProxy struct {
140	gobject.Object
141}
142
143var xDBusProxyGLibType func() types.GType
144
145func DBusProxyGLibType() types.GType {
146	return xDBusProxyGLibType()
147}
148
149func DBusProxyNewFromInternalPtr(ptr uintptr) *DBusProxy {
150	cls := &DBusProxy{}
151	cls.Ptr = ptr
152	return cls
153}
154
155var xNewDBusProxyFinish func(uintptr, **glib.Error) uintptr
156
157// Finishes creating a #GDBusProxy.
158func NewDBusProxyFinish(ResVar AsyncResult) (*DBusProxy, error) {
159	var cls *DBusProxy
160	var cerr *glib.Error
161
162	cret := xNewDBusProxyFinish(ResVar.GoPointer(), &cerr)
163
164	if cret == 0 {
165		return nil, cerr
166	}
167	cls = &DBusProxy{}
168	cls.Ptr = cret
169	if cerr == nil {
170		return cls, nil
171	}
172	return cls, cerr
173
174}
175
176var xNewDBusProxyForBusFinish func(uintptr, **glib.Error) uintptr
177
178// Finishes creating a #GDBusProxy.
179func NewDBusProxyForBusFinish(ResVar AsyncResult) (*DBusProxy, error) {
180	var cls *DBusProxy
181	var cerr *glib.Error
182
183	cret := xNewDBusProxyForBusFinish(ResVar.GoPointer(), &cerr)
184
185	if cret == 0 {
186		return nil, cerr
187	}
188	cls = &DBusProxy{}
189	cls.Ptr = cret
190	if cerr == nil {
191		return cls, nil
192	}
193	return cls, cerr
194
195}
196
197var xNewDBusProxyForBusSync func(BusType, DBusProxyFlags, *DBusInterfaceInfo, string, string, string, uintptr, **glib.Error) uintptr
198
199// Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
200//
201// #GDBusProxy is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example].
202func NewDBusProxyForBusSync(BusTypeVar BusType, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable) (*DBusProxy, error) {
203	var cls *DBusProxy
204	var cerr *glib.Error
205
206	cret := xNewDBusProxyForBusSync(BusTypeVar, FlagsVar, InfoVar, NameVar, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), &cerr)
207
208	if cret == 0 {
209		return nil, cerr
210	}
211	cls = &DBusProxy{}
212	cls.Ptr = cret
213	if cerr == nil {
214		return cls, nil
215	}
216	return cls, cerr
217
218}
219
220var xNewDBusProxySync func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, uintptr, string, string, uintptr, **glib.Error) uintptr
221
222// Creates a proxy for accessing @interface_name on the remote object
223// at @object_path owned by @name at @connection and synchronously
224// loads D-Bus properties unless the
225// %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
226//
227// If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
228// match rules for signals. Connect to the #GDBusProxy::g-signal signal
229// to handle signals from the remote object.
230//
231// If both %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES and
232// %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS are set, this constructor is
233// guaranteed to return immediately without blocking.
234//
235// If @name is a well-known name and the
236// %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START and %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION
237// flags aren't set and no name owner currently exists, the message bus
238// will be requested to launch a name owner for the name.
239//
240// This is a synchronous failable constructor. See g_dbus_proxy_new()
241// and g_dbus_proxy_new_finish() for the asynchronous version.
242//
243// #GDBusProxy is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example].
244func NewDBusProxySync(ConnectionVar *DBusConnection, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar *string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable) (*DBusProxy, error) {
245	var cls *DBusProxy
246	var cerr *glib.Error
247
248	NameVarPtr := core.GStrdupNullable(NameVar)
249	defer core.GFreeNullable(NameVarPtr)
250
251	cret := xNewDBusProxySync(ConnectionVar.GoPointer(), FlagsVar, InfoVar, NameVarPtr, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), &cerr)
252
253	if cret == 0 {
254		return nil, cerr
255	}
256	cls = &DBusProxy{}
257	cls.Ptr = cret
258	if cerr == nil {
259		return cls, nil
260	}
261	return cls, cerr
262
263}
264
265var xDBusProxyCall func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr, uintptr, uintptr)
266
267// Asynchronously invokes the @method_name method on @proxy.
268//
269// If @method_name contains any dots, then @name is split into interface and
270// method name parts. This allows using @proxy for invoking methods on
271// other interfaces.
272//
273// If the #GDBusConnection associated with @proxy is closed then
274// the operation will fail with %G_IO_ERROR_CLOSED. If
275// @cancellable is canceled, the operation will fail with
276// %G_IO_ERROR_CANCELLED. If @parameters contains a value not
277// compatible with the D-Bus protocol, the operation fails with
278// %G_IO_ERROR_INVALID_ARGUMENT.
279//
280// If the @parameters #GVariant is floating, it is consumed. This allows
281// convenient 'inline' use of g_variant_new(), e.g.:
282// |[<!-- language="C" -->
283//
284//	g_dbus_proxy_call (proxy,
285//	                   "TwoStrings",
286//	                   g_variant_new ("(ss)",
287//	                                  "Thing One",
288//	                                  "Thing Two"),
289//	                   G_DBUS_CALL_FLAGS_NONE,
290//	                   -1,
291//	                   NULL,
292//	                   (GAsyncReadyCallback) two_strings_done,
293//	                   &data);
294//
295// ]|
296//
297// If @proxy has an expected interface (see
298// #GDBusProxy:g-interface-info) and @method_name is referenced by it,
299// then the return value is checked against the return type.
300//
301// This is an asynchronous method. When the operation is finished,
302// @callback will be invoked in the thread-default main context
303// (see [method@GLib.MainContext.push_thread_default])
304// of the thread you are calling this method from.
305// You can then call g_dbus_proxy_call_finish() to get the result of
306// the operation. See g_dbus_proxy_call_sync() for the synchronous
307// version of this method.
308//
309// If @callback is %NULL then the D-Bus method call message will be sent with
310// the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
311func (x *DBusProxy) Call(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) {
312
313	var CallbackVarRef uintptr
314	if CallbackVar != nil {
315		CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar))
316		if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok {
317			CallbackVarRef = cbRefPtr
318		} else {
319			fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) {
320				cbFn := *CallbackVar
321				cbFn(arg0, arg1, arg2)
322			}
323			CallbackVarRef = purego.NewCallback(fcb)
324			glib.SaveCallbackWithClosure(CallbackVarPtr, CallbackVarRef, CallbackVar)
325		}
326	}
327
328	xDBusProxyCall(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar)
329
330}
331
332var xDBusProxyCallFinish func(uintptr, uintptr, **glib.Error) *glib.Variant
333
334// Finishes an operation started with g_dbus_proxy_call().
335func (x *DBusProxy) CallFinish(ResVar AsyncResult) (*glib.Variant, error) {
336	var cerr *glib.Error
337
338	cret := xDBusProxyCallFinish(x.GoPointer(), ResVar.GoPointer(), &cerr)
339	if cerr == nil {
340		return cret, nil
341	}
342	return cret, cerr
343
344}
345
346var xDBusProxyCallSync func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr, **glib.Error) *glib.Variant
347
348// Synchronously invokes the @method_name method on @proxy.
349//
350// If @method_name contains any dots, then @name is split into interface and
351// method name parts. This allows using @proxy for invoking methods on
352// other interfaces.
353//
354// If the #GDBusConnection associated with @proxy is disconnected then
355// the operation will fail with %G_IO_ERROR_CLOSED. If
356// @cancellable is canceled, the operation will fail with
357// %G_IO_ERROR_CANCELLED. If @parameters contains a value not
358// compatible with the D-Bus protocol, the operation fails with
359// %G_IO_ERROR_INVALID_ARGUMENT.
360//
361// If the @parameters #GVariant is floating, it is consumed. This allows
362// convenient 'inline' use of g_variant_new(), e.g.:
363// |[<!-- language="C" -->
364//
365//	g_dbus_proxy_call_sync (proxy,
366//	                        "TwoStrings",
367//	                        g_variant_new ("(ss)",
368//	                                       "Thing One",
369//	                                       "Thing Two"),
370//	                        G_DBUS_CALL_FLAGS_NONE,
371//	                        -1,
372//	                        NULL,
373//	                        &error);
374//
375// ]|
376//
377// The calling thread is blocked until a reply is received. See
378// g_dbus_proxy_call() for the asynchronous version of this
379// method.
380//
381// If @proxy has an expected interface (see
382// #GDBusProxy:g-interface-info) and @method_name is referenced by it,
383// then the return value is checked against the return type.
384func (x *DBusProxy) CallSync(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, CancellableVar *Cancellable) (*glib.Variant, error) {
385	var cerr *glib.Error
386
387	cret := xDBusProxyCallSync(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, CancellableVar.GoPointer(), &cerr)
388	if cerr == nil {
389		return cret, nil
390	}
391	return cret, cerr
392
393}
394
395var xDBusProxyCallWithUnixFdList func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr, uintptr, uintptr, uintptr)
396
397// Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
398//
399// This method is only available on UNIX.
400func (x *DBusProxy) CallWithUnixFdList(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, FdListVar *UnixFDList, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) {
401
402	var CallbackVarRef uintptr
403	if CallbackVar != nil {
404		CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar))
405		if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok {
406			CallbackVarRef = cbRefPtr
407		} else {
408			fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) {
409				cbFn := *CallbackVar
410				cbFn(arg0, arg1, arg2)
411			}
412			CallbackVarRef = purego.NewCallback(fcb)
413			glib.SaveCallbackWithClosure(CallbackVarPtr, CallbackVarRef, CallbackVar)
414		}
415	}
416
417	xDBusProxyCallWithUnixFdList(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), CancellableVar.GoPointer(), CallbackVarRef, UserDataVar)
418
419}
420
421var xDBusProxyCallWithUnixFdListFinish func(uintptr, **UnixFDList, uintptr, **glib.Error) *glib.Variant
422
423// Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
424func (x *DBusProxy) CallWithUnixFdListFinish(OutFdListVar **UnixFDList, ResVar AsyncResult) (*glib.Variant, error) {
425	var cerr *glib.Error
426
427	cret := xDBusProxyCallWithUnixFdListFinish(x.GoPointer(), OutFdListVar, ResVar.GoPointer(), &cerr)
428	if cerr == nil {
429		return cret, nil
430	}
431	return cret, cerr
432
433}
434
435var xDBusProxyCallWithUnixFdListSync func(uintptr, string, *glib.Variant, DBusCallFlags, int, uintptr, **UnixFDList, uintptr, **glib.Error) *glib.Variant
436
437// Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
438//
439// This method is only available on UNIX.
440func (x *DBusProxy) CallWithUnixFdListSync(MethodNameVar string, ParametersVar *glib.Variant, FlagsVar DBusCallFlags, TimeoutMsecVar int, FdListVar *UnixFDList, OutFdListVar **UnixFDList, CancellableVar *Cancellable) (*glib.Variant, error) {
441	var cerr *glib.Error
442
443	cret := xDBusProxyCallWithUnixFdListSync(x.GoPointer(), MethodNameVar, ParametersVar, FlagsVar, TimeoutMsecVar, FdListVar.GoPointer(), OutFdListVar, CancellableVar.GoPointer(), &cerr)
444	if cerr == nil {
445		return cret, nil
446	}
447	return cret, cerr
448
449}
450
451var xDBusProxyGetCachedProperty func(uintptr, string) *glib.Variant
452
453// Looks up the value for a property from the cache. This call does no
454// blocking IO.
455//
456// If @proxy has an expected interface (see
457// #GDBusProxy:g-interface-info) and @property_name is referenced by
458// it, then @value is checked against the type of the property.
459func (x *DBusProxy) GetCachedProperty(PropertyNameVar string) *glib.Variant {
460
461	cret := xDBusProxyGetCachedProperty(x.GoPointer(), PropertyNameVar)
462	return cret
463}
464
465var xDBusProxyGetCachedPropertyNames func(uintptr) []string
466
467// Gets the names of all cached properties on @proxy.
468func (x *DBusProxy) GetCachedPropertyNames() []string {
469
470	cret := xDBusProxyGetCachedPropertyNames(x.GoPointer())
471	return cret
472}
473
474var xDBusProxyGetConnection func(uintptr) uintptr
475
476// Gets the connection @proxy is for.
477func (x *DBusProxy) GetConnection() *DBusConnection {
478	var cls *DBusConnection
479
480	cret := xDBusProxyGetConnection(x.GoPointer())
481
482	if cret == 0 {
483		return nil
484	}
485	gobject.IncreaseRef(cret)
486	cls = &DBusConnection{}
487	cls.Ptr = cret
488	return cls
489}
490
491var xDBusProxyGetDefaultTimeout func(uintptr) int
492
493// Gets the timeout to use if -1 (specifying default timeout) is
494// passed as @timeout_msec in the g_dbus_proxy_call() and
495// g_dbus_proxy_call_sync() functions.
496//
497// See the #GDBusProxy:g-default-timeout property for more details.
498func (x *DBusProxy) GetDefaultTimeout() int {
499
500	cret := xDBusProxyGetDefaultTimeout(x.GoPointer())
501	return cret
502}
503
504var xDBusProxyGetFlags func(uintptr) DBusProxyFlags
505
506// Gets the flags that @proxy was constructed with.
507func (x *DBusProxy) GetFlags() DBusProxyFlags {
508
509	cret := xDBusProxyGetFlags(x.GoPointer())
510	return cret
511}
512
513var xDBusProxyGetInterfaceInfo func(uintptr) *DBusInterfaceInfo
514
515// Returns the #GDBusInterfaceInfo, if any, specifying the interface
516// that @proxy conforms to. See the #GDBusProxy:g-interface-info
517// property for more details.
518func (x *DBusProxy) GetInterfaceInfo() *DBusInterfaceInfo {
519
520	cret := xDBusProxyGetInterfaceInfo(x.GoPointer())
521	return cret
522}
523
524var xDBusProxyGetInterfaceName func(uintptr) string
525
526// Gets the D-Bus interface name @proxy is for.
527func (x *DBusProxy) GetInterfaceName() string {
528
529	cret := xDBusProxyGetInterfaceName(x.GoPointer())
530	return cret
531}
532
533var xDBusProxyGetName func(uintptr) string
534
535// Gets the name that @proxy was constructed for.
536//
537// When connected to a message bus, this will usually be non-%NULL.
538// However, it may be %NULL for a proxy that communicates using a peer-to-peer
539// pattern.
540func (x *DBusProxy) GetName() string {
541
542	cret := xDBusProxyGetName(x.GoPointer())
543	return cret
544}
545
546var xDBusProxyGetNameOwner func(uintptr) string
547
548// The unique name that owns the name that @proxy is for or %NULL if
549// no-one currently owns that name. You may connect to the
550// #GObject::notify signal to track changes to the
551// #GDBusProxy:g-name-owner property.
552func (x *DBusProxy) GetNameOwner() string {
553
554	cret := xDBusProxyGetNameOwner(x.GoPointer())
555	return cret
556}
557
558var xDBusProxyGetObjectPath func(uintptr) string
559
560// Gets the object path @proxy is for.
561func (x *DBusProxy) GetObjectPath() string {
562
563	cret := xDBusProxyGetObjectPath(x.GoPointer())
564	return cret
565}
566
567var xDBusProxySetCachedProperty func(uintptr, string, *glib.Variant)
568
569// If @value is not %NULL, sets the cached value for the property with
570// name @property_name to the value in @value.
571//
572// If @value is %NULL, then the cached value is removed from the
573// property cache.
574//
575// If @proxy has an expected interface (see
576// #GDBusProxy:g-interface-info) and @property_name is referenced by
577// it, then @value is checked against the type of the property.
578//
579// If the @value #GVariant is floating, it is consumed. This allows
580// convenient 'inline' use of g_variant_new(), e.g.
581// |[<!-- language="C" -->
582//
583//	g_dbus_proxy_set_cached_property (proxy,
584//	                                  "SomeProperty",
585//	                                  g_variant_new ("(si)",
586//	                                                "A String",
587//	                                                42));
588//
589// ]|
590//
591// Normally you will not need to use this method since @proxy
592// is tracking changes using the
593// `org.freedesktop.DBus.Properties.PropertiesChanged`
594// D-Bus signal. However, for performance reasons an object may
595// decide to not use this signal for some properties and instead
596// use a proprietary out-of-band mechanism to transmit changes.
597//
598// As a concrete example, consider an object with a property
599// `ChatroomParticipants` which is an array of strings. Instead of
600// transmitting the same (long) array every time the property changes,
601// it is more efficient to only transmit the delta using e.g. signals
602// `ChatroomParticipantJoined(String name)` and
603// `ChatroomParticipantParted(String name)`.
604func (x *DBusProxy) SetCachedProperty(PropertyNameVar string, ValueVar *glib.Variant) {
605
606	xDBusProxySetCachedProperty(x.GoPointer(), PropertyNameVar, ValueVar)
607
608}
609
610var xDBusProxySetDefaultTimeout func(uintptr, int)
611
612// Sets the timeout to use if -1 (specifying default timeout) is
613// passed as @timeout_msec in the g_dbus_proxy_call() and
614// g_dbus_proxy_call_sync() functions.
615//
616// See the #GDBusProxy:g-default-timeout property for more details.
617func (x *DBusProxy) SetDefaultTimeout(TimeoutMsecVar int) {
618
619	xDBusProxySetDefaultTimeout(x.GoPointer(), TimeoutMsecVar)
620
621}
622
623var xDBusProxySetInterfaceInfo func(uintptr, *DBusInterfaceInfo)
624
625// Ensure that interactions with @proxy conform to the given
626// interface. See the #GDBusProxy:g-interface-info property for more
627// details.
628func (x *DBusProxy) SetInterfaceInfo(InfoVar *DBusInterfaceInfo) {
629
630	xDBusProxySetInterfaceInfo(x.GoPointer(), InfoVar)
631
632}
633
634func (c *DBusProxy) GoPointer() uintptr {
635	if c == nil {
636		return 0
637	}
638	return c.Ptr
639}
640
641func (c *DBusProxy) SetGoPointer(ptr uintptr) {
642	c.Ptr = ptr
643}
644
645// SetPropertyGDefaultTimeout sets the "g-default-timeout" property.
646// The timeout to use if -1 (specifying default timeout) is passed
647// as @timeout_msec in the g_dbus_proxy_call() and
648// g_dbus_proxy_call_sync() functions.
649//
650// This allows applications to set a proxy-wide timeout for all
651// remote method invocations on the proxy. If this property is -1,
652// the default timeout (typically 25 seconds) is used. If set to
653// %G_MAXINT, then no timeout is used.
654func (x *DBusProxy) SetPropertyGDefaultTimeout(value int) {
655	var v gobject.Value
656	v.Init(gobject.TypeIntVal)
657	v.SetInt(value)
658	x.SetProperty("g-default-timeout", &v)
659}
660
661// GetPropertyGDefaultTimeout gets the "g-default-timeout" property.
662// The timeout to use if -1 (specifying default timeout) is passed
663// as @timeout_msec in the g_dbus_proxy_call() and
664// g_dbus_proxy_call_sync() functions.
665//
666// This allows applications to set a proxy-wide timeout for all
667// remote method invocations on the proxy. If this property is -1,
668// the default timeout (typically 25 seconds) is used. If set to
669// %G_MAXINT, then no timeout is used.
670func (x *DBusProxy) GetPropertyGDefaultTimeout() int {
671	var v gobject.Value
672	x.GetProperty("g-default-timeout", &v)
673	return v.GetInt()
674}
675
676// SetPropertyGInterfaceInfo sets the "g-interface-info" property.
677// Ensure that interactions with this proxy conform to the given
678// interface. This is mainly to ensure that malformed data received
679// from the other peer is ignored. The given #GDBusInterfaceInfo is
680// said to be the "expected interface".
681//
682// The checks performed are:
683//
684//   - When completing a method call, if the type signature of
685//     the reply message isn't what's expected, the reply is
686//     discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT.
687//
688//   - Received signals that have a type signature mismatch are dropped and
689//     a warning is logged via g_warning().
690//
691//   - Properties received via the initial `GetAll()` call or via the
692//     `::PropertiesChanged` signal (on the
693//     [org.freedesktop.DBus.Properties](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties)
694//     interface) or set using g_dbus_proxy_set_cached_property()
695//     with a type signature mismatch are ignored and a warning is
696//     logged via g_warning().
697//
698// Note that these checks are never done on methods, signals and
699// properties that are not referenced in the given
700// #GDBusInterfaceInfo, since extending a D-Bus interface on the
701// service-side is not considered an ABI break.
702func (x *DBusProxy) SetPropertyGInterfaceInfo(value uintptr) {
703	var v gobject.Value
704	v.Init(gobject.TypePointerVal)
705	v.SetPointer(value)
706	x.SetProperty("g-interface-info", &v)
707}
708
709// GetPropertyGInterfaceInfo gets the "g-interface-info" property.
710// Ensure that interactions with this proxy conform to the given
711// interface. This is mainly to ensure that malformed data received
712// from the other peer is ignored. The given #GDBusInterfaceInfo is
713// said to be the "expected interface".
714//
715// The checks performed are:
716//
717//   - When completing a method call, if the type signature of
718//     the reply message isn't what's expected, the reply is
719//     discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT.
720//
721//   - Received signals that have a type signature mismatch are dropped and
722//     a warning is logged via g_warning().
723//
724//   - Properties received via the initial `GetAll()` call or via the
725//     `::PropertiesChanged` signal (on the
726//     [org.freedesktop.DBus.Properties](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties)
727//     interface) or set using g_dbus_proxy_set_cached_property()
728//     with a type signature mismatch are ignored and a warning is
729//     logged via g_warning().
730//
731// Note that these checks are never done on methods, signals and
732// properties that are not referenced in the given
733// #GDBusInterfaceInfo, since extending a D-Bus interface on the
734// service-side is not considered an ABI break.
735func (x *DBusProxy) GetPropertyGInterfaceInfo() uintptr {
736	var v gobject.Value
737	x.GetProperty("g-interface-info", &v)
738	return v.GetPointer()
739}
740
741// SetPropertyGInterfaceName sets the "g-interface-name" property.
742// The D-Bus interface name the proxy is for.
743func (x *DBusProxy) SetPropertyGInterfaceName(value string) {
744	var v gobject.Value
745	v.Init(gobject.TypeStringVal)
746	v.SetString(&value)
747	x.SetProperty("g-interface-name", &v)
748}
749
750// GetPropertyGInterfaceName gets the "g-interface-name" property.
751// The D-Bus interface name the proxy is for.
752func (x *DBusProxy) GetPropertyGInterfaceName() string {
753	var v gobject.Value
754	x.GetProperty("g-interface-name", &v)
755	return v.GetString()
756}
757
758// SetPropertyGName sets the "g-name" property.
759// The well-known or unique name that the proxy is for.
760func (x *DBusProxy) SetPropertyGName(value string) {
761	var v gobject.Value
762	v.Init(gobject.TypeStringVal)
763	v.SetString(&value)
764	x.SetProperty("g-name", &v)
765}
766
767// GetPropertyGName gets the "g-name" property.
768// The well-known or unique name that the proxy is for.
769func (x *DBusProxy) GetPropertyGName() string {
770	var v gobject.Value
771	x.GetProperty("g-name", &v)
772	return v.GetString()
773}
774
775// GetPropertyGNameOwner gets the "g-name-owner" property.
776// The unique name that owns #GDBusProxy:g-name or %NULL if no-one
777// currently owns that name. You may connect to #GObject::notify signal to
778// track changes to this property.
779func (x *DBusProxy) GetPropertyGNameOwner() string {
780	var v gobject.Value
781	x.GetProperty("g-name-owner", &v)
782	return v.GetString()
783}
784
785// SetPropertyGObjectPath sets the "g-object-path" property.
786// The object path the proxy is for.
787func (x *DBusProxy) SetPropertyGObjectPath(value string) {
788	var v gobject.Value
789	v.Init(gobject.TypeStringVal)
790	v.SetString(&value)
791	x.SetProperty("g-object-path", &v)
792}
793
794// GetPropertyGObjectPath gets the "g-object-path" property.
795// The object path the proxy is for.
796func (x *DBusProxy) GetPropertyGObjectPath() string {
797	var v gobject.Value
798	x.GetProperty("g-object-path", &v)
799	return v.GetString()
800}
801
802// Emitted when one or more D-Bus properties on @proxy changes. The
803// local cache has already been updated when this signal fires. Note
804// that both @changed_properties and @invalidated_properties are
805// guaranteed to never be %NULL (either may be empty though).
806//
807// If the proxy has the flag
808// %G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then
809// @invalidated_properties will always be empty.
810//
811// This signal corresponds to the
812// `PropertiesChanged` D-Bus signal on the
813// `org.freedesktop.DBus.Properties` interface.
814func (x *DBusProxy) ConnectGPropertiesChanged(cb *func(DBusProxy, uintptr, []string)) uint {
815	cbPtr := uintptr(unsafe.Pointer(cb))
816	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
817		handlerID := gobject.SignalConnect(x.GoPointer(), "g-properties-changed", cbRefPtr)
818		glib.SaveHandlerMapping(handlerID, cbPtr)
819		return handlerID
820	}
821
822	fcb := func(clsPtr uintptr, ChangedPropertiesVarp uintptr, InvalidatedPropertiesVarp []string) {
823		fa := DBusProxy{}
824		fa.Ptr = clsPtr
825		cbFn := *cb
826
827		cbFn(fa, ChangedPropertiesVarp, InvalidatedPropertiesVarp)
828
829	}
830	cbRefPtr := purego.NewCallback(fcb)
831	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
832	handlerID := gobject.SignalConnect(x.GoPointer(), "g-properties-changed", cbRefPtr)
833	glib.SaveHandlerMapping(handlerID, cbPtr)
834	return handlerID
835}
836
837// Emitted when a signal from the remote object and interface that @proxy is for, has been received.
838//
839// Since 2.72 this signal supports detailed connections. You can connect to
840// the detailed signal `g-signal::x` in order to receive callbacks only when
841// signal `x` is received from the remote object.
842func (x *DBusProxy) ConnectGSignal(cb *func(DBusProxy, string, string, uintptr)) uint {
843	cbPtr := uintptr(unsafe.Pointer(cb))
844	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
845		handlerID := gobject.SignalConnect(x.GoPointer(), "g-signal", cbRefPtr)
846		glib.SaveHandlerMapping(handlerID, cbPtr)
847		return handlerID
848	}
849
850	fcb := func(clsPtr uintptr, SenderNameVarp uintptr, SignalNameVarp uintptr, ParametersVarp uintptr) {
851		fa := DBusProxy{}
852		fa.Ptr = clsPtr
853		cbFn := *cb
854
855		cbFn(fa, core.GoString(SenderNameVarp), core.GoString(SignalNameVarp), ParametersVarp)
856
857	}
858	cbRefPtr := purego.NewCallback(fcb)
859	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
860	handlerID := gobject.SignalConnect(x.GoPointer(), "g-signal", cbRefPtr)
861	glib.SaveHandlerMapping(handlerID, cbPtr)
862	return handlerID
863}
864
865// ConnectGSignalWithDetail connects to the "g-signal" signal with a detail string.
866// The detail is appended as "g-signal::<detail>".
867func (x *DBusProxy) ConnectGSignalWithDetail(detail string, cb *func(DBusProxy, string, string, uintptr)) uint {
868	cbPtr := uintptr(unsafe.Pointer(cb))
869	signalName := fmt.Sprintf("g-signal::%s", detail)
870	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
871		handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
872		glib.SaveHandlerMapping(handlerID, cbPtr)
873		return handlerID
874	}
875
876	fcb := func(clsPtr uintptr, SenderNameVarp uintptr, SignalNameVarp uintptr, ParametersVarp uintptr) {
877		fa := DBusProxy{}
878		fa.Ptr = clsPtr
879		cbFn := *cb
880
881		cbFn(fa, core.GoString(SenderNameVarp), core.GoString(SignalNameVarp), ParametersVarp)
882
883	}
884	cbRefPtr := purego.NewCallback(fcb)
885	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
886	handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
887	glib.SaveHandlerMapping(handlerID, cbPtr)
888	return handlerID
889}
890
891// Starts asynchronous initialization of the object implementing the
892// interface. This must be done before any real use of the object after
893// initial construction. If the object also implements #GInitable you can
894// optionally call g_initable_init() instead.
895//
896// This method is intended for language bindings. If writing in C,
897// g_async_initable_new_async() should typically be used instead.
898//
899// When the initialization is finished, @callback will be called. You can
900// then call g_async_initable_init_finish() to get the result of the
901// initialization.
902//
903// Implementations may also support cancellation. If @cancellable is not
904// %NULL, then initialization can be cancelled by triggering the cancellable
905// object from another thread. If the operation was cancelled, the error
906// %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
907// the object doesn't support cancellable initialization, the error
908// %G_IO_ERROR_NOT_SUPPORTED will be returned.
909//
910// As with #GInitable, if the object is not initialized, or initialization
911// returns with an error, then all operations on the object except
912// g_object_ref() and g_object_unref() are considered to be invalid, and
913// have undefined behaviour. They will often fail with g_critical() or
914// g_warning(), but this must not be relied on.
915//
916// Callers should not assume that a class which implements #GAsyncInitable can
917// be initialized multiple times; for more information, see g_initable_init().
918// If a class explicitly supports being initialized multiple times,
919// implementation requires yielding all subsequent calls to init_async() on the
920// results of the first call.
921//
922// For classes that also support the #GInitable interface, the default
923// implementation of this method will run the g_initable_init() function
924// in a thread, so if you want to support asynchronous initialization via
925// threads, just implement the #GAsyncInitable interface without overriding
926// any interface methods.
927func (x *DBusProxy) InitAsync(IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) {
928
929	XGAsyncInitableInitAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar)
930
931}
932
933// Finishes asynchronous initialization and returns the result.
934// See g_async_initable_init_async().
935func (x *DBusProxy) InitFinish(ResVar AsyncResult) (bool, error) {
936	var cerr *glib.Error
937
938	cret := XGAsyncInitableInitFinish(x.GoPointer(), ResVar.GoPointer(), &cerr)
939	if cerr == nil {
940		return cret, nil
941	}
942	return cret, cerr
943
944}
945
946// Finishes the async construction for the various g_async_initable_new
947// calls, returning the created object or %NULL on error.
948func (x *DBusProxy) NewFinish(ResVar AsyncResult) (*gobject.Object, error) {
949	var cls *gobject.Object
950	var cerr *glib.Error
951
952	cret := XGAsyncInitableNewFinish(x.GoPointer(), ResVar.GoPointer(), &cerr)
953
954	if cret == 0 {
955		return nil, cerr
956	}
957	cls = &gobject.Object{}
958	cls.Ptr = cret
959	if cerr == nil {
960		return cls, nil
961	}
962	return cls, cerr
963
964}
965
966// Gets the #GDBusObject that @interface_ belongs to, if any.
967func (x *DBusProxy) DupObject() *DBusObjectBase {
968	var cls *DBusObjectBase
969
970	cret := XGDbusInterfaceDupObject(x.GoPointer())
971
972	if cret == 0 {
973		return nil
974	}
975	cls = &DBusObjectBase{}
976	cls.Ptr = cret
977	return cls
978}
979
980// Gets D-Bus introspection information for the D-Bus interface
981// implemented by @interface_.
982func (x *DBusProxy) GetInfo() *DBusInterfaceInfo {
983
984	cret := XGDbusInterfaceGetInfo(x.GoPointer())
985	return cret
986}
987
988// Gets the #GDBusObject that @interface_ belongs to, if any.
989//
990// It is not safe to use the returned object if @interface_ or
991// the returned object is being used from other threads. See
992// g_dbus_interface_dup_object() for a thread-safe alternative.
993func (x *DBusProxy) GetObject() *DBusObjectBase {
994	var cls *DBusObjectBase
995
996	cret := XGDbusInterfaceGetObject(x.GoPointer())
997
998	if cret == 0 {
999		return nil
1000	}
1001	gobject.IncreaseRef(cret)
1002	cls = &DBusObjectBase{}
1003	cls.Ptr = cret
1004	return cls
1005}
1006
1007// Sets the #GDBusObject for @interface_ to @object.
1008//
1009// Note that @interface_ will hold a weak reference to @object.
1010func (x *DBusProxy) SetObject(ObjectVar DBusObject) {
1011
1012	XGDbusInterfaceSetObject(x.GoPointer(), ObjectVar.GoPointer())
1013
1014}
1015
1016// Initializes the object implementing the interface.
1017//
1018// This method is intended for language bindings. If writing in C,
1019// g_initable_new() should typically be used instead.
1020//
1021// The object must be initialized before any real use after initial
1022// construction, either with this function or g_async_initable_init_async().
1023//
1024// Implementations may also support cancellation. If @cancellable is not %NULL,
1025// then initialization can be cancelled by triggering the cancellable object
1026// from another thread. If the operation was cancelled, the error
1027// %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
1028// the object doesn't support cancellable initialization the error
1029// %G_IO_ERROR_NOT_SUPPORTED will be returned.
1030//
1031// If the object is not initialized, or initialization returns with an
1032// error, then all operations on the object except g_object_ref() and
1033// g_object_unref() are considered to be invalid, and have undefined
1034// behaviour. See the [description][iface@Gio.Initable#description] for more details.
1035//
1036// Callers should not assume that a class which implements #GInitable can be
1037// initialized multiple times, unless the class explicitly documents itself as
1038// supporting this. Generally, a class’ implementation of init() can assume
1039// (and assert) that it will only be called once. Previously, this documentation
1040// recommended all #GInitable implementations should be idempotent; that
1041// recommendation was relaxed in GLib 2.54.
1042//
1043// If a class explicitly supports being initialized multiple times, it is
1044// recommended that the method is idempotent: multiple calls with the same
1045// arguments should return the same results. Only the first call initializes
1046// the object; further calls return the result of the first call.
1047//
1048// One reason why a class might need to support idempotent initialization is if
1049// it is designed to be used via the singleton pattern, with a
1050// #GObjectClass.constructor that sometimes returns an existing instance.
1051// In this pattern, a caller would expect to be able to call g_initable_init()
1052// on the result of g_object_new(), regardless of whether it is in fact a new
1053// instance.
1054func (x *DBusProxy) Init(CancellableVar *Cancellable) (bool, error) {
1055	var cerr *glib.Error
1056
1057	cret := XGInitableInit(x.GoPointer(), CancellableVar.GoPointer(), &cerr)
1058	if cerr == nil {
1059		return cret, nil
1060	}
1061	return cret, cerr
1062
1063}
1064
1065var xDBusProxyNew func(uintptr, DBusProxyFlags, *DBusInterfaceInfo, uintptr, string, string, uintptr, uintptr, uintptr)
1066
1067// Creates a proxy for accessing @interface_name on the remote object
1068// at @object_path owned by @name at @connection and asynchronously
1069// loads D-Bus properties unless the
1070// %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
1071// the #GDBusProxy::g-properties-changed signal to get notified about
1072// property changes.
1073//
1074// If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
1075// match rules for signals. Connect to the #GDBusProxy::g-signal signal
1076// to handle signals from the remote object.
1077//
1078// If both %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES and
1079// %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS are set, this constructor is
1080// guaranteed to complete immediately without blocking.
1081//
1082// If @name is a well-known name and the
1083// %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START and %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION
1084// flags aren't set and no name owner currently exists, the message bus
1085// will be requested to launch a name owner for the name.
1086//
1087// This is a failable asynchronous constructor - when the proxy is
1088// ready, @callback will be invoked and you can use
1089// g_dbus_proxy_new_finish() to get the result.
1090//
1091// See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
1092//
1093// #GDBusProxy is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example].
1094func DBusProxyNew(ConnectionVar *DBusConnection, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar *string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) {
1095
1096	var CallbackVarRef uintptr
1097	if CallbackVar != nil {
1098		CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar))
1099		if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok {
1100			CallbackVarRef = cbRefPtr
1101		} else {
1102			fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) {
1103				cbFn := *CallbackVar
1104				cbFn(arg0, arg1, arg2)
1105			}
1106			CallbackVarRef = purego.NewCallback(fcb)
1107			glib.SaveCallbackWithClosure(CallbackVarPtr, CallbackVarRef, CallbackVar)
1108		}
1109	}
1110
1111	NameVarPtr := core.GStrdupNullable(NameVar)
1112	defer core.GFreeNullable(NameVarPtr)
1113
1114	xDBusProxyNew(ConnectionVar.GoPointer(), FlagsVar, InfoVar, NameVarPtr, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar)
1115
1116}
1117
1118var xDBusProxyNewForBus func(BusType, DBusProxyFlags, *DBusInterfaceInfo, string, string, string, uintptr, uintptr, uintptr)
1119
1120// Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1121//
1122// #GDBusProxy is used in this [example][class@Gio.DBusProxy#a-watch-proxy-example].
1123func DBusProxyNewForBus(BusTypeVar BusType, FlagsVar DBusProxyFlags, InfoVar *DBusInterfaceInfo, NameVar string, ObjectPathVar string, InterfaceNameVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) {
1124
1125	var CallbackVarRef uintptr
1126	if CallbackVar != nil {
1127		CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar))
1128		if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok {
1129			CallbackVarRef = cbRefPtr
1130		} else {
1131			fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) {
1132				cbFn := *CallbackVar
1133				cbFn(arg0, arg1, arg2)
1134			}
1135			CallbackVarRef = purego.NewCallback(fcb)
1136			glib.SaveCallbackWithClosure(CallbackVarPtr, CallbackVarRef, CallbackVar)
1137		}
1138	}
1139
1140	xDBusProxyNewForBus(BusTypeVar, FlagsVar, InfoVar, NameVar, ObjectPathVar, InterfaceNameVar, CancellableVar.GoPointer(), CallbackVarRef, UserDataVar)
1141
1142}
1143
1144func init() {
1145	core.SetPackageName("GIO", "gio-2.0")
1146	core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
1147	var libs []uintptr
1148	for _, libPath := range core.GetPaths("GIO") {
1149		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1150		if err != nil {
1151			panic(err)
1152		}
1153		libs = append(libs, lib)
1154	}
1155
1156	core.PuregoSafeRegister(&xDBusProxyGLibType, libs, "g_dbus_proxy_get_type")
1157
1158	core.PuregoSafeRegister(&xNewDBusProxyFinish, libs, "g_dbus_proxy_new_finish")
1159	core.PuregoSafeRegister(&xNewDBusProxyForBusFinish, libs, "g_dbus_proxy_new_for_bus_finish")
1160	core.PuregoSafeRegister(&xNewDBusProxyForBusSync, libs, "g_dbus_proxy_new_for_bus_sync")
1161	core.PuregoSafeRegister(&xNewDBusProxySync, libs, "g_dbus_proxy_new_sync")
1162
1163	core.PuregoSafeRegister(&xDBusProxyCall, libs, "g_dbus_proxy_call")
1164	core.PuregoSafeRegister(&xDBusProxyCallFinish, libs, "g_dbus_proxy_call_finish")
1165	core.PuregoSafeRegister(&xDBusProxyCallSync, libs, "g_dbus_proxy_call_sync")
1166	core.PuregoSafeRegister(&xDBusProxyCallWithUnixFdList, libs, "g_dbus_proxy_call_with_unix_fd_list")
1167	core.PuregoSafeRegister(&xDBusProxyCallWithUnixFdListFinish, libs, "g_dbus_proxy_call_with_unix_fd_list_finish")
1168	core.PuregoSafeRegister(&xDBusProxyCallWithUnixFdListSync, libs, "g_dbus_proxy_call_with_unix_fd_list_sync")
1169	core.PuregoSafeRegister(&xDBusProxyGetCachedProperty, libs, "g_dbus_proxy_get_cached_property")
1170	core.PuregoSafeRegister(&xDBusProxyGetCachedPropertyNames, libs, "g_dbus_proxy_get_cached_property_names")
1171	core.PuregoSafeRegister(&xDBusProxyGetConnection, libs, "g_dbus_proxy_get_connection")
1172	core.PuregoSafeRegister(&xDBusProxyGetDefaultTimeout, libs, "g_dbus_proxy_get_default_timeout")
1173	core.PuregoSafeRegister(&xDBusProxyGetFlags, libs, "g_dbus_proxy_get_flags")
1174	core.PuregoSafeRegister(&xDBusProxyGetInterfaceInfo, libs, "g_dbus_proxy_get_interface_info")
1175	core.PuregoSafeRegister(&xDBusProxyGetInterfaceName, libs, "g_dbus_proxy_get_interface_name")
1176	core.PuregoSafeRegister(&xDBusProxyGetName, libs, "g_dbus_proxy_get_name")
1177	core.PuregoSafeRegister(&xDBusProxyGetNameOwner, libs, "g_dbus_proxy_get_name_owner")
1178	core.PuregoSafeRegister(&xDBusProxyGetObjectPath, libs, "g_dbus_proxy_get_object_path")
1179	core.PuregoSafeRegister(&xDBusProxySetCachedProperty, libs, "g_dbus_proxy_set_cached_property")
1180	core.PuregoSafeRegister(&xDBusProxySetDefaultTimeout, libs, "g_dbus_proxy_set_default_timeout")
1181	core.PuregoSafeRegister(&xDBusProxySetInterfaceInfo, libs, "g_dbus_proxy_set_interface_info")
1182
1183	core.PuregoSafeRegister(&xDBusProxyNew, libs, "g_dbus_proxy_new")
1184	core.PuregoSafeRegister(&xDBusProxyNewForBus, libs, "g_dbus_proxy_new_for_bus")
1185
1186}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close