// 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 [type@Gio.ActionGroup]. type ActionGroupInterface struct { _ structs.HostLayout GIface uintptr xHasAction uintptr xListActions uintptr xGetActionEnabled uintptr xGetActionParameterType uintptr xGetActionStateType uintptr xGetActionStateHint uintptr xGetActionState uintptr xChangeActionState uintptr xActivateAction uintptr xActionAdded uintptr xActionRemoved uintptr xActionEnabledChanged uintptr xActionStateChanged uintptr xQueryAction uintptr } func (x *ActionGroupInterface) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // OverrideHasAction sets the "has_action" callback function. // the virtual function pointer for [method@Gio.ActionGroup.has_action] func (x *ActionGroupInterface) OverrideHasAction(cb func(ActionGroup, string) bool) { if cb == nil { x.xHasAction = 0 } else { x.xHasAction = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) bool { return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) }) } } // GetHasAction gets the "has_action" callback function. // the virtual function pointer for [method@Gio.ActionGroup.has_action] func (x *ActionGroupInterface) GetHasAction() func(ActionGroup, string) bool { if x.xHasAction == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) bool purego.RegisterFunc(&rawCallback, x.xHasAction) return func(ActionGroupVar ActionGroup, ActionNameVar string) bool { return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) } } // OverrideListActions sets the "list_actions" callback function. // the virtual function pointer for [method@Gio.ActionGroup.list_actions] func (x *ActionGroupInterface) OverrideListActions(cb func(ActionGroup) []string) { if cb == nil { x.xListActions = 0 } else { x.xListActions = purego.NewCallback(func(ActionGroupVarp uintptr) []string { return cb(&ActionGroupBase{Ptr: ActionGroupVarp}) }) } } // GetListActions gets the "list_actions" callback function. // the virtual function pointer for [method@Gio.ActionGroup.list_actions] func (x *ActionGroupInterface) GetListActions() func(ActionGroup) []string { if x.xListActions == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr) []string purego.RegisterFunc(&rawCallback, x.xListActions) return func(ActionGroupVar ActionGroup) []string { return rawCallback(ActionGroupVar.GoPointer()) } } // OverrideGetActionEnabled sets the "get_action_enabled" callback function. // the virtual function pointer for [method@Gio.ActionGroup.get_action_enabled] func (x *ActionGroupInterface) OverrideGetActionEnabled(cb func(ActionGroup, string) bool) { if cb == nil { x.xGetActionEnabled = 0 } else { x.xGetActionEnabled = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) bool { return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) }) } } // GetGetActionEnabled gets the "get_action_enabled" callback function. // the virtual function pointer for [method@Gio.ActionGroup.get_action_enabled] func (x *ActionGroupInterface) GetGetActionEnabled() func(ActionGroup, string) bool { if x.xGetActionEnabled == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) bool purego.RegisterFunc(&rawCallback, x.xGetActionEnabled) return func(ActionGroupVar ActionGroup, ActionNameVar string) bool { return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) } } // OverrideGetActionParameterType sets the "get_action_parameter_type" callback function. // the virtual function pointer for [method@Gio.ActionGroup.get_action_parameter_type] func (x *ActionGroupInterface) OverrideGetActionParameterType(cb func(ActionGroup, string) *glib.VariantType) { if cb == nil { x.xGetActionParameterType = 0 } else { x.xGetActionParameterType = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.VariantType { return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) }) } } // GetGetActionParameterType gets the "get_action_parameter_type" callback function. // the virtual function pointer for [method@Gio.ActionGroup.get_action_parameter_type] func (x *ActionGroupInterface) GetGetActionParameterType() func(ActionGroup, string) *glib.VariantType { if x.xGetActionParameterType == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.VariantType purego.RegisterFunc(&rawCallback, x.xGetActionParameterType) return func(ActionGroupVar ActionGroup, ActionNameVar string) *glib.VariantType { return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) } } // OverrideGetActionStateType sets the "get_action_state_type" callback function. // the virtual function pointer for [method@Gio.ActionGroup.get_action_state_type] func (x *ActionGroupInterface) OverrideGetActionStateType(cb func(ActionGroup, string) *glib.VariantType) { if cb == nil { x.xGetActionStateType = 0 } else { x.xGetActionStateType = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.VariantType { return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) }) } } // GetGetActionStateType gets the "get_action_state_type" callback function. // the virtual function pointer for [method@Gio.ActionGroup.get_action_state_type] func (x *ActionGroupInterface) GetGetActionStateType() func(ActionGroup, string) *glib.VariantType { if x.xGetActionStateType == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.VariantType purego.RegisterFunc(&rawCallback, x.xGetActionStateType) return func(ActionGroupVar ActionGroup, ActionNameVar string) *glib.VariantType { return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) } } // OverrideGetActionStateHint sets the "get_action_state_hint" callback function. // the virtual function pointer for [method@Gio.ActionGroup.get_action_state_hint] func (x *ActionGroupInterface) OverrideGetActionStateHint(cb func(ActionGroup, string) *glib.Variant) { if cb == nil { x.xGetActionStateHint = 0 } else { x.xGetActionStateHint = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.Variant { return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) }) } } // GetGetActionStateHint gets the "get_action_state_hint" callback function. // the virtual function pointer for [method@Gio.ActionGroup.get_action_state_hint] func (x *ActionGroupInterface) GetGetActionStateHint() func(ActionGroup, string) *glib.Variant { if x.xGetActionStateHint == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.Variant purego.RegisterFunc(&rawCallback, x.xGetActionStateHint) return func(ActionGroupVar ActionGroup, ActionNameVar string) *glib.Variant { return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) } } // OverrideGetActionState sets the "get_action_state" callback function. // the virtual function pointer for [method@Gio.ActionGroup.get_action_state] func (x *ActionGroupInterface) OverrideGetActionState(cb func(ActionGroup, string) *glib.Variant) { if cb == nil { x.xGetActionState = 0 } else { x.xGetActionState = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.Variant { return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) }) } } // GetGetActionState gets the "get_action_state" callback function. // the virtual function pointer for [method@Gio.ActionGroup.get_action_state] func (x *ActionGroupInterface) GetGetActionState() func(ActionGroup, string) *glib.Variant { if x.xGetActionState == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) *glib.Variant purego.RegisterFunc(&rawCallback, x.xGetActionState) return func(ActionGroupVar ActionGroup, ActionNameVar string) *glib.Variant { return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) } } // OverrideChangeActionState sets the "change_action_state" callback function. // the virtual function pointer for [method@Gio.ActionGroup.change_action_state] func (x *ActionGroupInterface) OverrideChangeActionState(cb func(ActionGroup, string, *glib.Variant)) { if cb == nil { x.xChangeActionState = 0 } else { x.xChangeActionState = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string, ValueVarp *glib.Variant) { cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp, ValueVarp) }) } } // GetChangeActionState gets the "change_action_state" callback function. // the virtual function pointer for [method@Gio.ActionGroup.change_action_state] func (x *ActionGroupInterface) GetChangeActionState() func(ActionGroup, string, *glib.Variant) { if x.xChangeActionState == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string, ValueVarp *glib.Variant) purego.RegisterFunc(&rawCallback, x.xChangeActionState) return func(ActionGroupVar ActionGroup, ActionNameVar string, ValueVar *glib.Variant) { rawCallback(ActionGroupVar.GoPointer(), ActionNameVar, ValueVar) } } // OverrideActivateAction sets the "activate_action" callback function. // the virtual function pointer for [method@Gio.ActionGroup.activate_action] func (x *ActionGroupInterface) OverrideActivateAction(cb func(ActionGroup, string, *glib.Variant)) { if cb == nil { x.xActivateAction = 0 } else { x.xActivateAction = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string, ParameterVarp *glib.Variant) { cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp, ParameterVarp) }) } } // GetActivateAction gets the "activate_action" callback function. // the virtual function pointer for [method@Gio.ActionGroup.activate_action] func (x *ActionGroupInterface) GetActivateAction() func(ActionGroup, string, *glib.Variant) { if x.xActivateAction == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string, ParameterVarp *glib.Variant) purego.RegisterFunc(&rawCallback, x.xActivateAction) return func(ActionGroupVar ActionGroup, ActionNameVar string, ParameterVar *glib.Variant) { rawCallback(ActionGroupVar.GoPointer(), ActionNameVar, ParameterVar) } } // OverrideActionAdded sets the "action_added" callback function. // the class closure for the [signal@Gio.ActionGroup::action-added] signal func (x *ActionGroupInterface) OverrideActionAdded(cb func(ActionGroup, string)) { if cb == nil { x.xActionAdded = 0 } else { x.xActionAdded = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) { cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) }) } } // GetActionAdded gets the "action_added" callback function. // the class closure for the [signal@Gio.ActionGroup::action-added] signal func (x *ActionGroupInterface) GetActionAdded() func(ActionGroup, string) { if x.xActionAdded == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) purego.RegisterFunc(&rawCallback, x.xActionAdded) return func(ActionGroupVar ActionGroup, ActionNameVar string) { rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) } } // OverrideActionRemoved sets the "action_removed" callback function. // the class closure for the [signal@Gio.ActionGroup::action-removed] signal func (x *ActionGroupInterface) OverrideActionRemoved(cb func(ActionGroup, string)) { if cb == nil { x.xActionRemoved = 0 } else { x.xActionRemoved = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string) { cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp) }) } } // GetActionRemoved gets the "action_removed" callback function. // the class closure for the [signal@Gio.ActionGroup::action-removed] signal func (x *ActionGroupInterface) GetActionRemoved() func(ActionGroup, string) { if x.xActionRemoved == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string) purego.RegisterFunc(&rawCallback, x.xActionRemoved) return func(ActionGroupVar ActionGroup, ActionNameVar string) { rawCallback(ActionGroupVar.GoPointer(), ActionNameVar) } } // OverrideActionEnabledChanged sets the "action_enabled_changed" callback function. // the class closure for the [signal@Gio.ActionGroup::action-enabled-changed] signal func (x *ActionGroupInterface) OverrideActionEnabledChanged(cb func(ActionGroup, string, bool)) { if cb == nil { x.xActionEnabledChanged = 0 } else { x.xActionEnabledChanged = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string, EnabledVarp bool) { cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp, EnabledVarp) }) } } // GetActionEnabledChanged gets the "action_enabled_changed" callback function. // the class closure for the [signal@Gio.ActionGroup::action-enabled-changed] signal func (x *ActionGroupInterface) GetActionEnabledChanged() func(ActionGroup, string, bool) { if x.xActionEnabledChanged == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string, EnabledVarp bool) purego.RegisterFunc(&rawCallback, x.xActionEnabledChanged) return func(ActionGroupVar ActionGroup, ActionNameVar string, EnabledVar bool) { rawCallback(ActionGroupVar.GoPointer(), ActionNameVar, EnabledVar) } } // OverrideActionStateChanged sets the "action_state_changed" callback function. // the class closure for the [signal@Gio.ActionGroup::action-enabled-changed] signal func (x *ActionGroupInterface) OverrideActionStateChanged(cb func(ActionGroup, string, *glib.Variant)) { if cb == nil { x.xActionStateChanged = 0 } else { x.xActionStateChanged = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string, StateVarp *glib.Variant) { cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp, StateVarp) }) } } // GetActionStateChanged gets the "action_state_changed" callback function. // the class closure for the [signal@Gio.ActionGroup::action-enabled-changed] signal func (x *ActionGroupInterface) GetActionStateChanged() func(ActionGroup, string, *glib.Variant) { if x.xActionStateChanged == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string, StateVarp *glib.Variant) purego.RegisterFunc(&rawCallback, x.xActionStateChanged) return func(ActionGroupVar ActionGroup, ActionNameVar string, StateVar *glib.Variant) { rawCallback(ActionGroupVar.GoPointer(), ActionNameVar, StateVar) } } // OverrideQueryAction sets the "query_action" callback function. // the virtual function pointer for [method@Gio.ActionGroup.query_action] func (x *ActionGroupInterface) OverrideQueryAction(cb func(ActionGroup, string, *bool, **glib.VariantType, **glib.VariantType, **glib.Variant, **glib.Variant) bool) { if cb == nil { x.xQueryAction = 0 } else { x.xQueryAction = purego.NewCallback(func(ActionGroupVarp uintptr, ActionNameVarp string, EnabledVarp *bool, ParameterTypeVarp **glib.VariantType, StateTypeVarp **glib.VariantType, StateHintVarp **glib.Variant, StateVarp **glib.Variant) bool { return cb(&ActionGroupBase{Ptr: ActionGroupVarp}, ActionNameVarp, EnabledVarp, ParameterTypeVarp, StateTypeVarp, StateHintVarp, StateVarp) }) } } // GetQueryAction gets the "query_action" callback function. // the virtual function pointer for [method@Gio.ActionGroup.query_action] func (x *ActionGroupInterface) GetQueryAction() func(ActionGroup, string, *bool, **glib.VariantType, **glib.VariantType, **glib.Variant, **glib.Variant) bool { if x.xQueryAction == 0 { return nil } var rawCallback func(ActionGroupVarp uintptr, ActionNameVarp string, EnabledVarp *bool, ParameterTypeVarp **glib.VariantType, StateTypeVarp **glib.VariantType, StateHintVarp **glib.Variant, StateVarp **glib.Variant) bool purego.RegisterFunc(&rawCallback, x.xQueryAction) return func(ActionGroupVar ActionGroup, ActionNameVar string, EnabledVar *bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { return rawCallback(ActionGroupVar.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) } } // `GActionGroup` represents a group of actions. // // Actions can be used to expose functionality in a structured way, either // from one part of a program to another, or to the outside world. Action // groups are often used together with a [type@Gio.MenuModel] that provides additional // representation data for displaying the actions to the user, e.g. in a menu. // // The main way to interact with the actions in a `GActionGroup` is to // activate them with [method@Gio.ActionGroup.activate_action]. Activating an // action may require a [type@GLib.Variant] parameter. The required type of the // parameter can be inquired with [method@Gio.ActionGroup.get_action_parameter_type]. // Actions may be disabled, see [method@Gio.ActionGroup.get_action_enabled]. // Activating a disabled action has no effect. // // Actions may optionally have a state in the form of a [type@GLib.Variant]. The current // state of an action can be inquired with [method@Gio.ActionGroup.get_action_state]. // Activating a stateful action may change its state, but it is also possible to // set the state by calling [method@Gio.ActionGroup.change_action_state]. // // As typical example, consider a text editing application which has an // option to change the current font to ‘bold’. A good way to represent // this would be a stateful action, with a boolean state. Activating the // action would toggle the state. // // Each action in the group has a unique name (which is a string). All // method calls, except [method@Gio.ActionGroup.list_actions] take the name of // an action as an argument. // // The `GActionGroup` API is meant to be the ‘public’ API to the action // group. The calls here are exactly the interaction that ‘external // forces’ (eg: UI, incoming D-Bus messages, etc.) are supposed to have // with actions. ‘Internal’ APIs (ie: ones meant only to be accessed by // the action group implementation) are found on subclasses. This is // why you will find – for example – [method@Gio.ActionGroup.get_action_enabled] // but not an equivalent `set_action_enabled()` method. // // Signals are emitted on the action group in response to state changes // on individual actions. // // Implementations of `GActionGroup` should provide implementations for // the virtual functions [method@Gio.ActionGroup.list_actions] and // [method@Gio.ActionGroup.query_action]. The other virtual functions should // not be implemented — their ‘wrappers’ are actually implemented with // calls to [method@Gio.ActionGroup.query_action]. type ActionGroup interface { GoPointer() uintptr SetGoPointer(uintptr) ActionAdded(ActionNameVar string) ActionEnabledChanged(ActionNameVar string, EnabledVar bool) ActionRemoved(ActionNameVar string) ActionStateChanged(ActionNameVar string, StateVar *glib.Variant) ActivateAction(ActionNameVar string, ParameterVar *glib.Variant) ChangeActionState(ActionNameVar string, ValueVar *glib.Variant) GetActionEnabled(ActionNameVar string) bool GetActionParameterType(ActionNameVar string) *glib.VariantType GetActionState(ActionNameVar string) *glib.Variant GetActionStateHint(ActionNameVar string) *glib.Variant GetActionStateType(ActionNameVar string) *glib.VariantType HasAction(ActionNameVar string) bool ListActions() []string QueryAction(ActionNameVar string, EnabledVar *bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool } var xActionGroupGLibType func() types.GType func ActionGroupGLibType() types.GType { return xActionGroupGLibType() } type ActionGroupBase struct { Ptr uintptr } func (x *ActionGroupBase) GoPointer() uintptr { if x == nil { return 0 } return x.Ptr } func (x *ActionGroupBase) SetGoPointer(ptr uintptr) { x.Ptr = ptr } // Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group. // // This function should only be called by [type@Gio.ActionGroup] implementations. func (x *ActionGroupBase) ActionAdded(ActionNameVar string) { XGActionGroupActionAdded(x.GoPointer(), ActionNameVar) } // Emits the [signal@Gio.ActionGroup::action-enabled-changed] signal on @action_group. // // This function should only be called by [type@Gio.ActionGroup] implementations. func (x *ActionGroupBase) ActionEnabledChanged(ActionNameVar string, EnabledVar bool) { XGActionGroupActionEnabledChanged(x.GoPointer(), ActionNameVar, EnabledVar) } // Emits the [signal@Gio.ActionGroup::action-removed] signal on @action_group. // // This function should only be called by [type@Gio.ActionGroup] implementations. func (x *ActionGroupBase) ActionRemoved(ActionNameVar string) { XGActionGroupActionRemoved(x.GoPointer(), ActionNameVar) } // Emits the [signal@Gio.ActionGroup::action-state-changed] signal on @action_group. // // This function should only be called by [type@Gio.ActionGroup] implementations. func (x *ActionGroupBase) ActionStateChanged(ActionNameVar string, StateVar *glib.Variant) { XGActionGroupActionStateChanged(x.GoPointer(), ActionNameVar, StateVar) } // Activate the named action within @action_group. // // If the action is expecting a parameter, then the correct type of // parameter must be given as @parameter. If the action is expecting no // parameters then @parameter must be `NULL`. See // [method@Gio.ActionGroup.get_action_parameter_type]. // // If the [type@Gio.ActionGroup] implementation supports asynchronous remote // activation over D-Bus, this call may return before the relevant // D-Bus traffic has been sent, or any replies have been received. In // order to block on such asynchronous activation calls, // [method@Gio.DBusConnection.flush] should be called prior to the code, which // depends on the result of the action activation. Without flushing // the D-Bus connection, there is no guarantee that the action would // have been activated. // // The following code which runs in a remote app instance, shows an // example of a ‘quit’ action being activated on the primary app // instance over D-Bus. Here [method@Gio.DBusConnection.flush] is called // before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action // may fail to be activated on the primary instance. // // ```c // // call ‘quit’ action on primary instance // g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); // // // make sure the action is activated now // g_dbus_connection_flush (…); // // g_debug ("Application has been terminated. Exiting."); // // exit (0); // ``` func (x *ActionGroupBase) ActivateAction(ActionNameVar string, ParameterVar *glib.Variant) { XGActionGroupActivateAction(x.GoPointer(), ActionNameVar, ParameterVar) } // Request for the state of the named action within @action_group to be // changed to @value. // // The action must be stateful and @value must be of the correct type. // See [method@Gio.ActionGroup.get_action_state_type]. // // This call merely requests a change. The action may refuse to change // its state or may change its state to something other than @value. // See [method@Gio.ActionGroup.get_action_state_hint]. // // If the @value GVariant is floating, it is consumed. func (x *ActionGroupBase) ChangeActionState(ActionNameVar string, ValueVar *glib.Variant) { XGActionGroupChangeActionState(x.GoPointer(), ActionNameVar, ValueVar) } // Checks if the named action within @action_group is currently enabled. // // An action must be enabled in order to be activated or in order to // have its state changed from outside callers. func (x *ActionGroupBase) GetActionEnabled(ActionNameVar string) bool { cret := XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) return cret } // Queries the type of the parameter that must be given when activating // the named action within @action_group. // // When activating the action using [method@Gio.ActionGroup.activate_action], // the [type@GLib.Variant] given to that function must be of the type returned // by this function. // // In the case that this function returns `NULL`, you must not give any // [type@GLib.Variant], but `NULL` instead. // // The parameter type of a particular action will never change but it is // possible for an action to be removed and for a new action to be added // with the same name but a different parameter type. func (x *ActionGroupBase) GetActionParameterType(ActionNameVar string) *glib.VariantType { cret := XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) return cret } // Queries the current state of the named action within @action_group. // // If the action is not stateful then `NULL` will be returned. If the // action is stateful then the type of the return value is the type // given by [method@Gio.ActionGroup.get_action_state_type]. // // The return value (if non-`NULL`) should be freed with // [method@GLib.Variant.unref] when it is no longer required. func (x *ActionGroupBase) GetActionState(ActionNameVar string) *glib.Variant { cret := XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) return cret } // Requests a hint about the valid range of values for the state of the // named action within @action_group. // // If `NULL` is returned it either means that the action is not stateful // or that there is no hint about the valid range of values for the // state of the action. // // If a [type@GLib.Variant] array is returned then each item in the array is a // possible value for the state. If a [type@GLib.Variant] pair (ie: two-tuple) is // returned then the tuple specifies the inclusive lower and upper bound // of valid values for the state. // // In any case, the information is merely a hint. It may be possible to // have a state value outside of the hinted range and setting a value // within the range may fail. // // The return value (if non-`NULL`) should be freed with // [method@GLib.Variant.unref] when it is no longer required. func (x *ActionGroupBase) GetActionStateHint(ActionNameVar string) *glib.Variant { cret := XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) return cret } // Queries the type of the state of the named action within // @action_group. // // If the action is stateful then this function returns the // [type@GLib.VariantType] of the state. All calls to // [method@Gio.ActionGroup.change_action_state] must give a [type@GLib.Variant] of this // type and [method@Gio.ActionGroup.get_action_state] will return a [type@GLib.Variant] // of the same type. // // If the action is not stateful then this function will return `NULL`. // In that case, [method@Gio.ActionGroup.get_action_state] will return `NULL` // and you must not call [method@Gio.ActionGroup.change_action_state]. // // The state type of a particular action will never change but it is // possible for an action to be removed and for a new action to be added // with the same name but a different state type. func (x *ActionGroupBase) GetActionStateType(ActionNameVar string) *glib.VariantType { cret := XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) return cret } // Checks if the named action exists within @action_group. func (x *ActionGroupBase) HasAction(ActionNameVar string) bool { cret := XGActionGroupHasAction(x.GoPointer(), ActionNameVar) return cret } // Lists the actions contained within @action_group. // // The caller is responsible for freeing the list with [func@GLib.strfreev] when // it is no longer required. func (x *ActionGroupBase) ListActions() []string { cret := XGActionGroupListActions(x.GoPointer()) return cret } // Queries all aspects of the named action within an @action_group. // // This function acquires the information available from // [method@Gio.ActionGroup.has_action], [method@Gio.ActionGroup.get_action_enabled], // [method@Gio.ActionGroup.get_action_parameter_type], // [method@Gio.ActionGroup.get_action_state_type], // [method@Gio.ActionGroup.get_action_state_hint] and // [method@Gio.ActionGroup.get_action_state] with a single function call. // // This provides two main benefits. // // The first is the improvement in efficiency that comes with not having // to perform repeated lookups of the action in order to discover // different things about it. The second is that implementing // [type@Gio.ActionGroup] can now be done by only overriding this one virtual // function. // // The interface provides a default implementation of this function that // calls the individual functions, as required, to fetch the // information. The interface also provides default implementations of // those functions that call this function. All implementations, // therefore, must override either this function or all of the others. // // If the action exists, `TRUE` is returned and any of the requested // fields (as indicated by having a non-`NULL` reference passed in) are // filled. If the action doesn’t exist, `FALSE` is returned and the // fields may or may not have been modified. func (x *ActionGroupBase) QueryAction(ActionNameVar string, EnabledVar *bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { cret := XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) return cret } var XGActionGroupActionAdded func(uintptr, string) var XGActionGroupActionEnabledChanged func(uintptr, string, bool) var XGActionGroupActionRemoved func(uintptr, string) var XGActionGroupActionStateChanged func(uintptr, string, *glib.Variant) var XGActionGroupActivateAction func(uintptr, string, *glib.Variant) var XGActionGroupChangeActionState func(uintptr, string, *glib.Variant) var XGActionGroupGetActionEnabled func(uintptr, string) bool var XGActionGroupGetActionParameterType func(uintptr, string) *glib.VariantType var XGActionGroupGetActionState func(uintptr, string) *glib.Variant var XGActionGroupGetActionStateHint func(uintptr, string) *glib.Variant var XGActionGroupGetActionStateType func(uintptr, string) *glib.VariantType var XGActionGroupHasAction func(uintptr, string) bool var XGActionGroupListActions func(uintptr) []string var XGActionGroupQueryAction func(uintptr, string, *bool, **glib.VariantType, **glib.VariantType, **glib.Variant, **glib.Variant) bool 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(&xActionGroupGLibType, libs, "g_action_group_get_type") core.PuregoSafeRegister(&XGActionGroupActionAdded, libs, "g_action_group_action_added") core.PuregoSafeRegister(&XGActionGroupActionEnabledChanged, libs, "g_action_group_action_enabled_changed") core.PuregoSafeRegister(&XGActionGroupActionRemoved, libs, "g_action_group_action_removed") core.PuregoSafeRegister(&XGActionGroupActionStateChanged, libs, "g_action_group_action_state_changed") core.PuregoSafeRegister(&XGActionGroupActivateAction, libs, "g_action_group_activate_action") core.PuregoSafeRegister(&XGActionGroupChangeActionState, libs, "g_action_group_change_action_state") core.PuregoSafeRegister(&XGActionGroupGetActionEnabled, libs, "g_action_group_get_action_enabled") core.PuregoSafeRegister(&XGActionGroupGetActionParameterType, libs, "g_action_group_get_action_parameter_type") core.PuregoSafeRegister(&XGActionGroupGetActionState, libs, "g_action_group_get_action_state") core.PuregoSafeRegister(&XGActionGroupGetActionStateHint, libs, "g_action_group_get_action_state_hint") core.PuregoSafeRegister(&XGActionGroupGetActionStateType, libs, "g_action_group_get_action_state_type") core.PuregoSafeRegister(&XGActionGroupHasAction, libs, "g_action_group_has_action") core.PuregoSafeRegister(&XGActionGroupListActions, libs, "g_action_group_list_actions") core.PuregoSafeRegister(&XGActionGroupQueryAction, libs, "g_action_group_query_action") }