// 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/types" ) // The virtual function table for #GRemoteActionGroup. type RemoteActionGroupInterface struct { _ structs.HostLayout GIface uintptr xActivateActionFull uintptr xChangeActionStateFull uintptr } func (x *RemoteActionGroupInterface) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // OverrideActivateActionFull sets the "activate_action_full" callback function. // the virtual function pointer for g_remote_action_group_activate_action_full() func (x *RemoteActionGroupInterface) OverrideActivateActionFull(cb func(RemoteActionGroup, string, *glib.Variant, *glib.Variant)) { if cb == nil { x.xActivateActionFull = 0 } else { x.xActivateActionFull = purego.NewCallback(func(RemoteVarp uintptr, ActionNameVarp string, ParameterVarp *glib.Variant, PlatformDataVarp *glib.Variant) { cb(&RemoteActionGroupBase{Ptr: RemoteVarp}, ActionNameVarp, ParameterVarp, PlatformDataVarp) }) } } // GetActivateActionFull gets the "activate_action_full" callback function. // the virtual function pointer for g_remote_action_group_activate_action_full() func (x *RemoteActionGroupInterface) GetActivateActionFull() func(RemoteActionGroup, string, *glib.Variant, *glib.Variant) { if x.xActivateActionFull == 0 { return nil } var rawCallback func(RemoteVarp uintptr, ActionNameVarp string, ParameterVarp *glib.Variant, PlatformDataVarp *glib.Variant) purego.RegisterFunc(&rawCallback, x.xActivateActionFull) return func(RemoteVar RemoteActionGroup, ActionNameVar string, ParameterVar *glib.Variant, PlatformDataVar *glib.Variant) { rawCallback(RemoteVar.GoPointer(), ActionNameVar, ParameterVar, PlatformDataVar) } } // OverrideChangeActionStateFull sets the "change_action_state_full" callback function. // the virtual function pointer for g_remote_action_group_change_action_state_full() func (x *RemoteActionGroupInterface) OverrideChangeActionStateFull(cb func(RemoteActionGroup, string, *glib.Variant, *glib.Variant)) { if cb == nil { x.xChangeActionStateFull = 0 } else { x.xChangeActionStateFull = purego.NewCallback(func(RemoteVarp uintptr, ActionNameVarp string, ValueVarp *glib.Variant, PlatformDataVarp *glib.Variant) { cb(&RemoteActionGroupBase{Ptr: RemoteVarp}, ActionNameVarp, ValueVarp, PlatformDataVarp) }) } } // GetChangeActionStateFull gets the "change_action_state_full" callback function. // the virtual function pointer for g_remote_action_group_change_action_state_full() func (x *RemoteActionGroupInterface) GetChangeActionStateFull() func(RemoteActionGroup, string, *glib.Variant, *glib.Variant) { if x.xChangeActionStateFull == 0 { return nil } var rawCallback func(RemoteVarp uintptr, ActionNameVarp string, ValueVarp *glib.Variant, PlatformDataVarp *glib.Variant) purego.RegisterFunc(&rawCallback, x.xChangeActionStateFull) return func(RemoteVar RemoteActionGroup, ActionNameVar string, ValueVar *glib.Variant, PlatformDataVar *glib.Variant) { rawCallback(RemoteVar.GoPointer(), ActionNameVar, ValueVar, PlatformDataVar) } } // The `GRemoteActionGroup` interface is implemented by [iface@Gio.ActionGroup] // instances that either transmit action invocations to other processes // or receive action invocations in the local process from other // processes. // // The interface has `_full` variants of the two // methods on [iface@Gio.ActionGroup] used to activate actions: // [method@Gio.ActionGroup.activate_action] and // [method@Gio.ActionGroup.change_action_state]. These variants allow a // ‘platform data’ [struct@GLib.Variant] to be specified: a dictionary providing // context for the action invocation (for example: timestamps, startup // notification IDs, etc). // // [class@Gio.DBusActionGroup] implements `GRemoteActionGroup`. This provides a // mechanism to send platform data for action invocations over D-Bus. // // Additionally, [method@Gio.DBusConnection.export_action_group] will check if // the exported [iface@Gio.ActionGroup] implements `GRemoteActionGroup` and use // the `_full` variants of the calls if available. This // provides a mechanism by which to receive platform data for action // invocations that arrive by way of D-Bus. type RemoteActionGroup interface { GoPointer() uintptr SetGoPointer(uintptr) ActivateActionFull(ActionNameVar string, ParameterVar *glib.Variant, PlatformDataVar *glib.Variant) ChangeActionStateFull(ActionNameVar string, ValueVar *glib.Variant, PlatformDataVar *glib.Variant) } var xRemoteActionGroupGLibType func() types.GType func RemoteActionGroupGLibType() types.GType { return xRemoteActionGroupGLibType() } type RemoteActionGroupBase struct { Ptr uintptr } func (x *RemoteActionGroupBase) GoPointer() uintptr { if x == nil { return 0 } return x.Ptr } func (x *RemoteActionGroupBase) SetGoPointer(ptr uintptr) { x.Ptr = ptr } // Activates the remote action. // // This is the same as g_action_group_activate_action() except that it // allows for provision of "platform data" to be sent along with the // activation request. This typically contains details such as the user // interaction timestamp or startup notification information. // // @platform_data must be non-%NULL and must have the type // %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed. func (x *RemoteActionGroupBase) ActivateActionFull(ActionNameVar string, ParameterVar *glib.Variant, PlatformDataVar *glib.Variant) { XGRemoteActionGroupActivateActionFull(x.GoPointer(), ActionNameVar, ParameterVar, PlatformDataVar) } // Changes the state of a remote action. // // This is the same as g_action_group_change_action_state() except that // it allows for provision of "platform data" to be sent along with the // state change request. This typically contains details such as the // user interaction timestamp or startup notification information. // // @platform_data must be non-%NULL and must have the type // %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed. func (x *RemoteActionGroupBase) ChangeActionStateFull(ActionNameVar string, ValueVar *glib.Variant, PlatformDataVar *glib.Variant) { XGRemoteActionGroupChangeActionStateFull(x.GoPointer(), ActionNameVar, ValueVar, PlatformDataVar) } var XGRemoteActionGroupActivateActionFull func(uintptr, string, *glib.Variant, *glib.Variant) var XGRemoteActionGroupChangeActionStateFull func(uintptr, string, *glib.Variant, *glib.Variant) 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(&xRemoteActionGroupGLibType, libs, "g_remote_action_group_get_type") core.PuregoSafeRegister(&XGRemoteActionGroupActivateActionFull, libs, "g_remote_action_group_activate_action_full") core.PuregoSafeRegister(&XGRemoteActionGroupChangeActionStateFull, libs, "g_remote_action_group_change_action_state_full") }