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/types"
13)
14
15// The virtual function table for #GRemoteActionGroup.
16type RemoteActionGroupInterface struct {
17 _ structs.HostLayout
18
19 GIface uintptr
20
21 xActivateActionFull uintptr
22
23 xChangeActionStateFull uintptr
24}
25
26func (x *RemoteActionGroupInterface) GoPointer() uintptr {
27 return uintptr(unsafe.Pointer(x))
28}
29
30// OverrideActivateActionFull sets the "activate_action_full" callback function.
31// the virtual function pointer for g_remote_action_group_activate_action_full()
32func (x *RemoteActionGroupInterface) OverrideActivateActionFull(cb func(RemoteActionGroup, string, *glib.Variant, *glib.Variant)) {
33 if cb == nil {
34 x.xActivateActionFull = 0
35 } else {
36 x.xActivateActionFull = purego.NewCallback(func(RemoteVarp uintptr, ActionNameVarp string, ParameterVarp *glib.Variant, PlatformDataVarp *glib.Variant) {
37 cb(&RemoteActionGroupBase{Ptr: RemoteVarp}, ActionNameVarp, ParameterVarp, PlatformDataVarp)
38 })
39 }
40}
41
42// GetActivateActionFull gets the "activate_action_full" callback function.
43// the virtual function pointer for g_remote_action_group_activate_action_full()
44func (x *RemoteActionGroupInterface) GetActivateActionFull() func(RemoteActionGroup, string, *glib.Variant, *glib.Variant) {
45 if x.xActivateActionFull == 0 {
46 return nil
47 }
48 var rawCallback func(RemoteVarp uintptr, ActionNameVarp string, ParameterVarp *glib.Variant, PlatformDataVarp *glib.Variant)
49 purego.RegisterFunc(&rawCallback, x.xActivateActionFull)
50 return func(RemoteVar RemoteActionGroup, ActionNameVar string, ParameterVar *glib.Variant, PlatformDataVar *glib.Variant) {
51 rawCallback(RemoteVar.GoPointer(), ActionNameVar, ParameterVar, PlatformDataVar)
52 }
53}
54
55// OverrideChangeActionStateFull sets the "change_action_state_full" callback function.
56// the virtual function pointer for g_remote_action_group_change_action_state_full()
57func (x *RemoteActionGroupInterface) OverrideChangeActionStateFull(cb func(RemoteActionGroup, string, *glib.Variant, *glib.Variant)) {
58 if cb == nil {
59 x.xChangeActionStateFull = 0
60 } else {
61 x.xChangeActionStateFull = purego.NewCallback(func(RemoteVarp uintptr, ActionNameVarp string, ValueVarp *glib.Variant, PlatformDataVarp *glib.Variant) {
62 cb(&RemoteActionGroupBase{Ptr: RemoteVarp}, ActionNameVarp, ValueVarp, PlatformDataVarp)
63 })
64 }
65}
66
67// GetChangeActionStateFull gets the "change_action_state_full" callback function.
68// the virtual function pointer for g_remote_action_group_change_action_state_full()
69func (x *RemoteActionGroupInterface) GetChangeActionStateFull() func(RemoteActionGroup, string, *glib.Variant, *glib.Variant) {
70 if x.xChangeActionStateFull == 0 {
71 return nil
72 }
73 var rawCallback func(RemoteVarp uintptr, ActionNameVarp string, ValueVarp *glib.Variant, PlatformDataVarp *glib.Variant)
74 purego.RegisterFunc(&rawCallback, x.xChangeActionStateFull)
75 return func(RemoteVar RemoteActionGroup, ActionNameVar string, ValueVar *glib.Variant, PlatformDataVar *glib.Variant) {
76 rawCallback(RemoteVar.GoPointer(), ActionNameVar, ValueVar, PlatformDataVar)
77 }
78}
79
80// The `GRemoteActionGroup` interface is implemented by [iface@Gio.ActionGroup]
81// instances that either transmit action invocations to other processes
82// or receive action invocations in the local process from other
83// processes.
84//
85// The interface has `_full` variants of the two
86// methods on [iface@Gio.ActionGroup] used to activate actions:
87// [method@Gio.ActionGroup.activate_action] and
88// [method@Gio.ActionGroup.change_action_state]. These variants allow a
89// ‘platform data’ [struct@GLib.Variant] to be specified: a dictionary providing
90// context for the action invocation (for example: timestamps, startup
91// notification IDs, etc).
92//
93// [class@Gio.DBusActionGroup] implements `GRemoteActionGroup`. This provides a
94// mechanism to send platform data for action invocations over D-Bus.
95//
96// Additionally, [method@Gio.DBusConnection.export_action_group] will check if
97// the exported [iface@Gio.ActionGroup] implements `GRemoteActionGroup` and use
98// the `_full` variants of the calls if available. This
99// provides a mechanism by which to receive platform data for action
100// invocations that arrive by way of D-Bus.
101type RemoteActionGroup interface {
102 GoPointer() uintptr
103 SetGoPointer(uintptr)
104 ActivateActionFull(ActionNameVar string, ParameterVar *glib.Variant, PlatformDataVar *glib.Variant)
105 ChangeActionStateFull(ActionNameVar string, ValueVar *glib.Variant, PlatformDataVar *glib.Variant)
106}
107
108var xRemoteActionGroupGLibType func() types.GType
109
110func RemoteActionGroupGLibType() types.GType {
111 return xRemoteActionGroupGLibType()
112}
113
114type RemoteActionGroupBase struct {
115 Ptr uintptr
116}
117
118func (x *RemoteActionGroupBase) GoPointer() uintptr {
119 if x == nil {
120 return 0
121 }
122 return x.Ptr
123}
124
125func (x *RemoteActionGroupBase) SetGoPointer(ptr uintptr) {
126 x.Ptr = ptr
127}
128
129// Activates the remote action.
130//
131// This is the same as g_action_group_activate_action() except that it
132// allows for provision of "platform data" to be sent along with the
133// activation request. This typically contains details such as the user
134// interaction timestamp or startup notification information.
135//
136// @platform_data must be non-%NULL and must have the type
137// %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
138func (x *RemoteActionGroupBase) ActivateActionFull(ActionNameVar string, ParameterVar *glib.Variant, PlatformDataVar *glib.Variant) {
139
140 XGRemoteActionGroupActivateActionFull(x.GoPointer(), ActionNameVar, ParameterVar, PlatformDataVar)
141
142}
143
144// Changes the state of a remote action.
145//
146// This is the same as g_action_group_change_action_state() except that
147// it allows for provision of "platform data" to be sent along with the
148// state change request. This typically contains details such as the
149// user interaction timestamp or startup notification information.
150//
151// @platform_data must be non-%NULL and must have the type
152// %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
153func (x *RemoteActionGroupBase) ChangeActionStateFull(ActionNameVar string, ValueVar *glib.Variant, PlatformDataVar *glib.Variant) {
154
155 XGRemoteActionGroupChangeActionStateFull(x.GoPointer(), ActionNameVar, ValueVar, PlatformDataVar)
156
157}
158
159var XGRemoteActionGroupActivateActionFull func(uintptr, string, *glib.Variant, *glib.Variant)
160var XGRemoteActionGroupChangeActionStateFull func(uintptr, string, *glib.Variant, *glib.Variant)
161
162func init() {
163 core.SetPackageName("GIO", "gio-2.0")
164 core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
165 var libs []uintptr
166 for _, libPath := range core.GetPaths("GIO") {
167 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
168 if err != nil {
169 panic(err)
170 }
171 libs = append(libs, lib)
172 }
173
174 core.PuregoSafeRegister(&xRemoteActionGroupGLibType, libs, "g_remote_action_group_get_type")
175
176 core.PuregoSafeRegister(&XGRemoteActionGroupActivateActionFull, libs, "g_remote_action_group_activate_action_full")
177 core.PuregoSafeRegister(&XGRemoteActionGroupChangeActionStateFull, libs, "g_remote_action_group_change_action_state_full")
178
179}