gdbusobjectproxy.go RawHistoryFolder
1// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gio
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/glib"
12 "github.com/bnema/puregotk/v4/gobject"
13 "github.com/bnema/puregotk/v4/gobject/types"
14)
15
16// Class structure for #GDBusObjectProxy.
17type DBusObjectProxyClass struct {
18 _ structs.HostLayout
19
20 ParentClass gobject.ObjectClass
21
22 Padding [8]uintptr
23}
24
25func (x *DBusObjectProxyClass) GoPointer() uintptr {
26 return uintptr(unsafe.Pointer(x))
27}
28
29type DBusObjectProxyPrivate struct {
30 _ structs.HostLayout
31}
32
33func (x *DBusObjectProxyPrivate) GoPointer() uintptr {
34 return uintptr(unsafe.Pointer(x))
35}
36
37// A `GDBusObjectProxy` is an object used to represent a remote object
38// with one or more D-Bus interfaces. Normally, you don’t instantiate
39// a `GDBusObjectProxy` yourself — typically [class@Gio.DBusObjectManagerClient]
40// is used to obtain it.
41type DBusObjectProxy struct {
42 gobject.Object
43}
44
45var xDBusObjectProxyGLibType func() types.GType
46
47func DBusObjectProxyGLibType() types.GType {
48 return xDBusObjectProxyGLibType()
49}
50
51func DBusObjectProxyNewFromInternalPtr(ptr uintptr) *DBusObjectProxy {
52 cls := &DBusObjectProxy{}
53 cls.Ptr = ptr
54 return cls
55}
56
57var xNewDBusObjectProxy func(uintptr, string) uintptr
58
59// Creates a new #GDBusObjectProxy for the given connection and
60// object path.
61func NewDBusObjectProxy(ConnectionVar *DBusConnection, ObjectPathVar string) *DBusObjectProxy {
62 var cls *DBusObjectProxy
63
64 cret := xNewDBusObjectProxy(ConnectionVar.GoPointer(), ObjectPathVar)
65
66 if cret == 0 {
67 return nil
68 }
69 cls = &DBusObjectProxy{}
70 cls.Ptr = cret
71 return cls
72}
73
74var xDBusObjectProxyGetConnection func(uintptr) uintptr
75
76// Gets the connection that @proxy is for.
77func (x *DBusObjectProxy) GetConnection() *DBusConnection {
78 var cls *DBusConnection
79
80 cret := xDBusObjectProxyGetConnection(x.GoPointer())
81
82 if cret == 0 {
83 return nil
84 }
85 gobject.IncreaseRef(cret)
86 cls = &DBusConnection{}
87 cls.Ptr = cret
88 return cls
89}
90
91func (c *DBusObjectProxy) GoPointer() uintptr {
92 if c == nil {
93 return 0
94 }
95 return c.Ptr
96}
97
98func (c *DBusObjectProxy) SetGoPointer(ptr uintptr) {
99 c.Ptr = ptr
100}
101
102// SetPropertyGObjectPath sets the "g-object-path" property.
103// The object path of the proxy.
104func (x *DBusObjectProxy) SetPropertyGObjectPath(value string) {
105 var v gobject.Value
106 v.Init(gobject.TypeStringVal)
107 v.SetString(&value)
108 x.SetProperty("g-object-path", &v)
109}
110
111// GetPropertyGObjectPath gets the "g-object-path" property.
112// The object path of the proxy.
113func (x *DBusObjectProxy) GetPropertyGObjectPath() string {
114 var v gobject.Value
115 x.GetProperty("g-object-path", &v)
116 return v.GetString()
117}
118
119// Gets the D-Bus interface with name @interface_name associated with
120// @object, if any.
121func (x *DBusObjectProxy) GetInterface(InterfaceNameVar string) *DBusInterfaceBase {
122 var cls *DBusInterfaceBase
123
124 cret := XGDbusObjectGetInterface(x.GoPointer(), InterfaceNameVar)
125
126 if cret == 0 {
127 return nil
128 }
129 cls = &DBusInterfaceBase{}
130 cls.Ptr = cret
131 return cls
132}
133
134// Gets the D-Bus interfaces associated with @object.
135func (x *DBusObjectProxy) GetInterfaces() *glib.List {
136
137 cret := XGDbusObjectGetInterfaces(x.GoPointer())
138 return cret
139}
140
141// Gets the object path for @object.
142func (x *DBusObjectProxy) GetObjectPath() string {
143
144 cret := XGDbusObjectGetObjectPath(x.GoPointer())
145 return cret
146}
147
148func init() {
149 core.SetPackageName("GIO", "gio-2.0")
150 core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
151 var libs []uintptr
152 for _, libPath := range core.GetPaths("GIO") {
153 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
154 if err != nil {
155 panic(err)
156 }
157 libs = append(libs, lib)
158 }
159
160 core.PuregoSafeRegister(&xDBusObjectProxyGLibType, libs, "g_dbus_object_proxy_get_type")
161
162 core.PuregoSafeRegister(&xNewDBusObjectProxy, libs, "g_dbus_object_proxy_new")
163
164 core.PuregoSafeRegister(&xDBusObjectProxyGetConnection, libs, "g_dbus_object_proxy_get_connection")
165
166}