gdbusmenumodel.go RawHistoryFolder
1// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gio
3
4import (
5 "github.com/ebitengine/purego"
6
7 "github.com/bnema/puregotk/pkg/core"
8 "github.com/bnema/puregotk/v4/gobject/types"
9)
10
11// `GDBusMenuModel` is an implementation of [class@Gio.MenuModel] that can be
12// used as a proxy for a menu model that is exported over D-Bus with
13// [method@Gio.DBusConnection.export_menu_model].
14type DBusMenuModel struct {
15 MenuModel
16}
17
18var xDBusMenuModelGLibType func() types.GType
19
20func DBusMenuModelGLibType() types.GType {
21 return xDBusMenuModelGLibType()
22}
23
24func DBusMenuModelNewFromInternalPtr(ptr uintptr) *DBusMenuModel {
25 cls := &DBusMenuModel{}
26 cls.Ptr = ptr
27 return cls
28}
29
30func (c *DBusMenuModel) GoPointer() uintptr {
31 if c == nil {
32 return 0
33 }
34 return c.Ptr
35}
36
37func (c *DBusMenuModel) SetGoPointer(ptr uintptr) {
38 c.Ptr = ptr
39}
40
41var xDBusMenuModelGet func(uintptr, uintptr, string) uintptr
42
43// Obtains a #GDBusMenuModel for the menu model which is exported
44// at the given @bus_name and @object_path.
45//
46// The thread default main context is taken at the time of this call.
47// All signals on the menu model (and any linked models) are reported
48// with respect to this context. All calls on the returned menu model
49// (and linked models) must also originate from this same context, with
50// the thread default main context unchanged.
51func DBusMenuModelGet(ConnectionVar *DBusConnection, BusNameVar *string, ObjectPathVar string) *DBusMenuModel {
52 var cls *DBusMenuModel
53
54 BusNameVarPtr := core.GStrdupNullable(BusNameVar)
55 defer core.GFreeNullable(BusNameVarPtr)
56
57 cret := xDBusMenuModelGet(ConnectionVar.GoPointer(), BusNameVarPtr, ObjectPathVar)
58
59 if cret == 0 {
60 return nil
61 }
62 cls = &DBusMenuModel{}
63 cls.Ptr = cret
64 return cls
65}
66
67func init() {
68 core.SetPackageName("GIO", "gio-2.0")
69 core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
70 var libs []uintptr
71 for _, libPath := range core.GetPaths("GIO") {
72 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
73 if err != nil {
74 panic(err)
75 }
76 libs = append(libs, lib)
77 }
78
79 core.PuregoSafeRegister(&xDBusMenuModelGLibType, libs, "g_dbus_menu_model_get_type")
80
81 core.PuregoSafeRegister(&xDBusMenuModelGet, libs, "g_dbus_menu_model_get")
82
83}