gnativevolumemonitor.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/v4/gobject/types"
11)
12
13type NativeVolumeMonitorClass struct {
14 _ structs.HostLayout
15
16 ParentClass VolumeMonitorClass
17
18 xGetMountForMountPath uintptr
19}
20
21func (x *NativeVolumeMonitorClass) GoPointer() uintptr {
22 return uintptr(unsafe.Pointer(x))
23}
24
25// OverrideGetMountForMountPath sets the "get_mount_for_mount_path" callback function.
26func (x *NativeVolumeMonitorClass) OverrideGetMountForMountPath(cb func(string, *Cancellable) *MountBase) {
27 if cb == nil {
28 x.xGetMountForMountPath = 0
29 } else {
30 x.xGetMountForMountPath = purego.NewCallback(func(MountPathVarp string, CancellableVarp uintptr) uintptr {
31 ret := cb(MountPathVarp, CancellableNewFromInternalPtr(CancellableVarp))
32 if ret == nil {
33 return 0
34 }
35 return ret.GoPointer()
36 })
37 }
38}
39
40// GetGetMountForMountPath gets the "get_mount_for_mount_path" callback function.
41func (x *NativeVolumeMonitorClass) GetGetMountForMountPath() func(string, *Cancellable) *MountBase {
42 if x.xGetMountForMountPath == 0 {
43 return nil
44 }
45 var rawCallback func(MountPathVarp string, CancellableVarp uintptr) uintptr
46 purego.RegisterFunc(&rawCallback, x.xGetMountForMountPath)
47 return func(MountPathVar string, CancellableVar *Cancellable) *MountBase {
48 rawRet := rawCallback(MountPathVar, CancellableVar.GoPointer())
49 if rawRet == 0 {
50 return nil
51 }
52 ret := &MountBase{}
53 ret.Ptr = rawRet
54 return ret
55 }
56}
57
58const (
59 NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME string = "gio-native-volume-monitor"
60)
61
62type NativeVolumeMonitor struct {
63 VolumeMonitor
64}
65
66var xNativeVolumeMonitorGLibType func() types.GType
67
68func NativeVolumeMonitorGLibType() types.GType {
69 return xNativeVolumeMonitorGLibType()
70}
71
72func NativeVolumeMonitorNewFromInternalPtr(ptr uintptr) *NativeVolumeMonitor {
73 cls := &NativeVolumeMonitor{}
74 cls.Ptr = ptr
75 return cls
76}
77
78func (c *NativeVolumeMonitor) GoPointer() uintptr {
79 if c == nil {
80 return 0
81 }
82 return c.Ptr
83}
84
85func (c *NativeVolumeMonitor) SetGoPointer(ptr uintptr) {
86 c.Ptr = ptr
87}