// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gio import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) // Class structure for #GDBusObjectManagerServer. type DBusObjectManagerServerClass struct { _ structs.HostLayout ParentClass gobject.ObjectClass Padding [8]uintptr } func (x *DBusObjectManagerServerClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } type DBusObjectManagerServerPrivate struct { _ structs.HostLayout } func (x *DBusObjectManagerServerPrivate) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // `GDBusObjectManagerServer` is used to export [iface@Gio.DBusObject] instances // using the standardized // [`org.freedesktop.DBus.ObjectManager`](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager) // interface. For example, remote D-Bus clients can get all objects // and properties in a single call. Additionally, any change in the // object hierarchy is broadcast using signals. This means that D-Bus // clients can keep caches up to date by only listening to D-Bus // signals. // // The recommended path to export an object manager at is the path form of the // well-known name of a D-Bus service, or below. For example, if a D-Bus service // is available at the well-known name `net.example.ExampleService1`, the object // manager should typically be exported at `/net/example/ExampleService1`, or // below (to allow for multiple object managers in a service). // // It is supported, but not recommended, to export an object manager at the root // path, `/`. // // See [class@Gio.DBusObjectManagerClient] for the client-side code that is // intended to be used with `GDBusObjectManagerServer` or any D-Bus // object implementing the `org.freedesktop.DBus.ObjectManager` interface. type DBusObjectManagerServer struct { gobject.Object } var xDBusObjectManagerServerGLibType func() types.GType func DBusObjectManagerServerGLibType() types.GType { return xDBusObjectManagerServerGLibType() } func DBusObjectManagerServerNewFromInternalPtr(ptr uintptr) *DBusObjectManagerServer { cls := &DBusObjectManagerServer{} cls.Ptr = ptr return cls } var xNewDBusObjectManagerServer func(string) uintptr // Creates a new #GDBusObjectManagerServer object. // // The returned server isn't yet exported on any connection. To do so, // use g_dbus_object_manager_server_set_connection(). Normally you // want to export all of your objects before doing so to avoid // [InterfacesAdded](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager) // signals being emitted. func NewDBusObjectManagerServer(ObjectPathVar string) *DBusObjectManagerServer { var cls *DBusObjectManagerServer cret := xNewDBusObjectManagerServer(ObjectPathVar) if cret == 0 { return nil } cls = &DBusObjectManagerServer{} cls.Ptr = cret return cls } var xDBusObjectManagerServerExport func(uintptr, uintptr) // Exports @object on @manager. // // If there is already a #GDBusObject exported at the object path, // then the old object is removed. // // The object path for @object must be in the hierarchy rooted by the // object path for @manager. // // Note that @manager will take a reference on @object for as long as // it is exported. func (x *DBusObjectManagerServer) Export(ObjectVar *DBusObjectSkeleton) { xDBusObjectManagerServerExport(x.GoPointer(), ObjectVar.GoPointer()) } var xDBusObjectManagerServerExportUniquely func(uintptr, uintptr) // Like g_dbus_object_manager_server_export() but appends a string of // the form _N (with N being a natural number) to @object's object path // if an object with the given path already exists. As such, the // #GDBusObjectProxy:g-object-path property of @object may be modified. func (x *DBusObjectManagerServer) ExportUniquely(ObjectVar *DBusObjectSkeleton) { xDBusObjectManagerServerExportUniquely(x.GoPointer(), ObjectVar.GoPointer()) } var xDBusObjectManagerServerGetConnection func(uintptr) uintptr // Gets the #GDBusConnection used by @manager. func (x *DBusObjectManagerServer) GetConnection() *DBusConnection { var cls *DBusConnection cret := xDBusObjectManagerServerGetConnection(x.GoPointer()) if cret == 0 { return nil } cls = &DBusConnection{} cls.Ptr = cret return cls } var xDBusObjectManagerServerIsExported func(uintptr, uintptr) bool // Returns whether @object is currently exported on @manager. func (x *DBusObjectManagerServer) IsExported(ObjectVar *DBusObjectSkeleton) bool { cret := xDBusObjectManagerServerIsExported(x.GoPointer(), ObjectVar.GoPointer()) return cret } var xDBusObjectManagerServerSetConnection func(uintptr, uintptr) // Exports all objects managed by @manager on @connection. If // @connection is %NULL, stops exporting objects. func (x *DBusObjectManagerServer) SetConnection(ConnectionVar *DBusConnection) { xDBusObjectManagerServerSetConnection(x.GoPointer(), ConnectionVar.GoPointer()) } var xDBusObjectManagerServerUnexport func(uintptr, string) bool // If @manager has an object at @path, removes the object. Otherwise // does nothing. // // Note that @object_path must be in the hierarchy rooted by the // object path for @manager. func (x *DBusObjectManagerServer) Unexport(ObjectPathVar string) bool { cret := xDBusObjectManagerServerUnexport(x.GoPointer(), ObjectPathVar) return cret } func (c *DBusObjectManagerServer) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *DBusObjectManagerServer) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyObjectPath sets the "object-path" property. // The object path to register the manager object at. func (x *DBusObjectManagerServer) SetPropertyObjectPath(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("object-path", &v) } // GetPropertyObjectPath gets the "object-path" property. // The object path to register the manager object at. func (x *DBusObjectManagerServer) GetPropertyObjectPath() string { var v gobject.Value x.GetProperty("object-path", &v) return v.GetString() } // Gets the interface proxy for @interface_name at @object_path, if // any. func (x *DBusObjectManagerServer) GetInterface(ObjectPathVar string, InterfaceNameVar string) *DBusInterfaceBase { var cls *DBusInterfaceBase cret := XGDbusObjectManagerGetInterface(x.GoPointer(), ObjectPathVar, InterfaceNameVar) if cret == 0 { return nil } cls = &DBusInterfaceBase{} cls.Ptr = cret return cls } // Gets the #GDBusObject at @object_path, if any. func (x *DBusObjectManagerServer) GetObject(ObjectPathVar string) *DBusObjectBase { var cls *DBusObjectBase cret := XGDbusObjectManagerGetObject(x.GoPointer(), ObjectPathVar) if cret == 0 { return nil } cls = &DBusObjectBase{} cls.Ptr = cret return cls } // Gets the object path that @manager is for. func (x *DBusObjectManagerServer) GetObjectPath() string { cret := XGDbusObjectManagerGetObjectPath(x.GoPointer()) return cret } // Gets all #GDBusObject objects known to @manager. func (x *DBusObjectManagerServer) GetObjects() *glib.List { cret := XGDbusObjectManagerGetObjects(x.GoPointer()) return cret } func init() { core.SetPackageName("GIO", "gio-2.0") core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GIO") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xDBusObjectManagerServerGLibType, libs, "g_dbus_object_manager_server_get_type") core.PuregoSafeRegister(&xNewDBusObjectManagerServer, libs, "g_dbus_object_manager_server_new") core.PuregoSafeRegister(&xDBusObjectManagerServerExport, libs, "g_dbus_object_manager_server_export") core.PuregoSafeRegister(&xDBusObjectManagerServerExportUniquely, libs, "g_dbus_object_manager_server_export_uniquely") core.PuregoSafeRegister(&xDBusObjectManagerServerGetConnection, libs, "g_dbus_object_manager_server_get_connection") core.PuregoSafeRegister(&xDBusObjectManagerServerIsExported, libs, "g_dbus_object_manager_server_is_exported") core.PuregoSafeRegister(&xDBusObjectManagerServerSetConnection, libs, "g_dbus_object_manager_server_set_connection") core.PuregoSafeRegister(&xDBusObjectManagerServerUnexport, libs, "g_dbus_object_manager_server_unexport") }