// Code generated by cmd/cgo; DO NOT EDIT. //line /home/josie/.cache/paru/clone/wiiudownloader/src/pkg/mod/github.com/gotk3/gotk3@v0.6.5-0.20240618185848-ff349ae13f56/glib/gaction.go:1:1 package glib // #include // #include // #include // #include "glib.go.h" import _ "unsafe" import ( "unsafe" ) func init() { tm := []TypeMarshaler{ // Objects/Interfaces {Type(( /*line :15:9*/_Cfunc_g_simple_action_get_type /*line :15:34*/)()), marshalSimpleAction}, {Type(( /*line :16:9*/_Cfunc_g_action_get_type /*line :16:27*/)()), marshalAction}, {Type(( /*line :17:9*/_Cfunc_g_property_action_get_type /*line :17:36*/)()), marshalPropertyAction}, } RegisterGValueMarshalers(tm) } // Action is a representation of glib's GAction GInterface. type Action struct { *Object } // IAction is an interface type implemented by all structs // embedding an Action. It is meant to be used as an argument type // for wrapper functions that wrap around a C function taking a // GAction. type IAction interface { toGAction() * /*line :32:15*/_Ctype_GAction /*line :32:24*/ toAction() *Action } func (v *Action) toGAction() * /*line :36:31*/_Ctype_GAction /*line :36:40*/ { if v == nil { return nil } return v.native() } func (v *Action) toAction() *Action { return v } // gboolean g_action_parse_detailed_name (const gchar *detailed_name, gchar **action_name, GVariant **target_value, GError **error); // ActionPrintDetailedName is a wrapper around g_action_print_detailed_name(). func ActionPrintDetailedName(action_name string, target_value *Variant) string { cstr := ( /*line :51:10*/_Cfunc_CString /*line :51:18*/)(action_name) defer func() func() { _cgo0 := /*line :52:15*/unsafe.Pointer(cstr); return func() { _cgoCheckPointer(_cgo0, nil); /*line :52:36*/_Cfunc_free(_cgo0); }}()() return ( /*line :53:9*/_Cfunc_GoString /*line :53:18*/)((* /*line :53:22*/_Ctype_char /*line :53:28*/)(func() *_Ctype_gchar{ var _cgo0 *_Ctype_gchar = /*line :53:61*/(*_Ctype_gchar /*line :53:70*/)(cstr); _cgo1 := /*line :53:79*/target_value.native(); _cgoCheckPointer(_cgo1, nil); return /*line :53:101*/_Cfunc_g_action_print_detailed_name(_cgo0, _cgo1); }())) } // native() returns a pointer to the underlying GAction. func (v *Action) native() * /*line :57:28*/_Ctype_GAction /*line :57:37*/ { if v == nil || v.GObject == nil { return nil } return func() *_Ctype_struct__GAction{ _cgo0 := /*line :61:21*/unsafe.Pointer(v.GObject); _cgoCheckPointer(_cgo0, nil); return /*line :61:47*/_Cfunc_toGAction(_cgo0); }() } func (v *Action) Native() uintptr { return uintptr(unsafe.Pointer(v.native())) } func marshalAction(p uintptr) (interface{}, error) { c := ( /*line :69:7*/_Cfunc_g_value_get_object /*line :69:26*/)((* /*line :69:30*/_Ctype_GValue /*line :69:38*/)(unsafe.Pointer(p))) return wrapAction(wrapObject(unsafe.Pointer(c))), nil } func wrapAction(obj *Object) *Action { return &Action{obj} } // ActionNameIsValid is a wrapper around g_action_name_is_valid func ActionNameIsValid(actionName string) bool { cstr := (* /*line :79:12*/_Ctype_gchar /*line :79:19*/)(( /*line :79:21*/_Cfunc_CString /*line :79:29*/)(actionName)) return gobool(( /*line :80:16*/_Cfunc_g_action_name_is_valid /*line :80:39*/)(cstr)) } // GetName is a wrapper around g_action_get_name func (v *Action) GetName() string { return ( /*line :85:9*/_Cfunc_GoString /*line :85:18*/)((* /*line :85:22*/_Ctype_char /*line :85:28*/)(func() *_Ctype_gchar{ _cgo0 := /*line :85:50*/v.native(); _cgoCheckPointer(_cgo0, nil); return /*line :85:61*/_Cfunc_g_action_get_name(_cgo0); }())) } // GetEnabled is a wrapper around g_action_get_enabled func (v *Action) GetEnabled() bool { return gobool(func() _Ctype_gboolean{ _cgo0 := /*line :90:39*/v.native(); _cgoCheckPointer(_cgo0, nil); return /*line :90:50*/_Cfunc_g_action_get_enabled(_cgo0); }()) } // GetState is a wrapper around g_action_get_state func (v *Action) GetState() *Variant { c := func() *_Ctype_struct__GVariant{ _cgo0 := /*line :95:28*/v.native(); _cgoCheckPointer(_cgo0, nil); return /*line :95:39*/_Cfunc_g_action_get_state(_cgo0); }() if c == nil { return nil } return newVariant((* /*line :99:22*/_Ctype_GVariant /*line :99:32*/)(c)) } // GetStateHint is a wrapper around g_action_get_state_hint func (v *Action) GetStateHint() *Variant { c := func() *_Ctype_struct__GVariant{ _cgo0 := /*line :104:33*/v.native(); _cgoCheckPointer(_cgo0, nil); return /*line :104:44*/_Cfunc_g_action_get_state_hint(_cgo0); }() if c == nil { return nil } return newVariant((* /*line :108:22*/_Ctype_GVariant /*line :108:32*/)(c)) } // GetParameterType is a wrapper around g_action_get_parameter_type func (v *Action) GetParameterType() *VariantType { c := func() *_Ctype_struct__GVariantType{ _cgo0 := /*line :113:37*/v.native(); _cgoCheckPointer(_cgo0, nil); return /*line :113:48*/_Cfunc_g_action_get_parameter_type(_cgo0); }() if c == nil { return nil } return newVariantType((* /*line :117:26*/_Ctype_GVariantType /*line :117:40*/)(c)) } // GetStateType is a wrapper around g_action_get_state_type func (v *Action) GetStateType() *VariantType { c := func() *_Ctype_struct__GVariantType{ _cgo0 := /*line :122:33*/v.native(); _cgoCheckPointer(_cgo0, nil); return /*line :122:44*/_Cfunc_g_action_get_state_type(_cgo0); }() if c == nil { return nil } return newVariantType((* /*line :126:26*/_Ctype_GVariantType /*line :126:40*/)(c)) } // ChangeState is a wrapper around g_action_change_state func (v *Action) ChangeState(value *Variant) { func() { _cgo0 := /*line :131:26*/v.native(); _cgo1 := /*line :131:38*/value.native(); _cgoCheckPointer(_cgo0, nil); _cgoCheckPointer(_cgo1, nil); /*line :131:53*/_Cfunc_g_action_change_state(_cgo0, _cgo1); }() } // Activate is a wrapper around g_action_activate func (v *Action) Activate(parameter *Variant) { func() { _cgo0 := /*line :136:22*/v.native(); _cgo1 := /*line :136:34*/parameter.native(); _cgoCheckPointer(_cgo0, nil); _cgoCheckPointer(_cgo1, nil); /*line :136:53*/_Cfunc_g_action_activate(_cgo0, _cgo1); }() } // SimpleAction is a representation of GSimpleAction type SimpleAction struct { Action } func (v *SimpleAction) native() * /*line :144:34*/_Ctype_GSimpleAction /*line :144:49*/ { if v == nil || v.GObject == nil { return nil } return func() *_Ctype_struct__GSimpleAction{ _cgo0 := /*line :148:27*/unsafe.Pointer(v.GObject); _cgoCheckPointer(_cgo0, nil); return /*line :148:53*/_Cfunc_toGSimpleAction(_cgo0); }() } func (v *SimpleAction) Native() uintptr { return uintptr(unsafe.Pointer(v.native())) } func marshalSimpleAction(p uintptr) (interface{}, error) { c := ( /*line :156:7*/_Cfunc_g_value_get_object /*line :156:26*/)((* /*line :156:30*/_Ctype_GValue /*line :156:38*/)(unsafe.Pointer(p))) return wrapSimpleAction(wrapObject(unsafe.Pointer(c))), nil } func wrapSimpleAction(obj *Object) *SimpleAction { return &SimpleAction{Action{obj}} } // SimpleActionNew is a wrapper around g_simple_action_new func SimpleActionNew(name string, parameterType *VariantType) *SimpleAction { c := func() *_Ctype_struct__GSimpleAction{ var _cgo0 *_Ctype_gchar = /*line :166:29*/(*_Ctype_gchar /*line :166:38*/)(_Cfunc_CString /*line :166:49*/(name)); _cgo1 := /*line :166:58*/parameterType.native(); _cgoCheckPointer(_cgo1, nil); return /*line :166:81*/_Cfunc_g_simple_action_new(_cgo0, _cgo1); }() if c == nil { return nil } return wrapSimpleAction(wrapObject(unsafe.Pointer(c))) } // SimpleActionNewStateful is a wrapper around g_simple_action_new_stateful func SimpleActionNewStateful(name string, parameterType *VariantType, state *Variant) *SimpleAction { c := func() *_Ctype_struct__GSimpleAction{ var _cgo0 *_Ctype_gchar = /*line :175:38*/(*_Ctype_gchar /*line :175:47*/)(_Cfunc_CString /*line :175:58*/(name)); _cgo1 := /*line :175:67*/parameterType.native(); _cgo2 := /*line :175:91*/state.native(); _cgoCheckPointer(_cgo1, nil); _cgoCheckPointer(_cgo2, nil); return /*line :175:106*/_Cfunc_g_simple_action_new_stateful(_cgo0, _cgo1, _cgo2); }() if c == nil { return nil } return wrapSimpleAction(wrapObject(unsafe.Pointer(c))) } // SetEnabled is a wrapper around g_simple_action_set_enabled func (v *SimpleAction) SetEnabled(enabled bool) { func() { _cgo0 := /*line :184:32*/v.native(); var _cgo1 _Ctype_gboolean = /*line :184:44*/gbool(enabled); _cgoCheckPointer(_cgo0, nil); /*line :184:59*/_Cfunc_g_simple_action_set_enabled(_cgo0, _cgo1); }() } // SetState is a wrapper around g_simple_action_set_state // This should only be called by the implementor of the action. // Users of the action should not attempt to directly modify the 'state' property. // Instead, they should call ChangeState [g_action_change_state()] to request the change. func (v *SimpleAction) SetState(value *Variant) { func() { _cgo0 := /*line :192:30*/v.native(); _cgo1 := /*line :192:42*/value.native(); _cgoCheckPointer(_cgo0, nil); _cgoCheckPointer(_cgo1, nil); /*line :192:57*/_Cfunc_g_simple_action_set_state(_cgo0, _cgo1); }() } // PropertyAction is a representation of GPropertyAction type PropertyAction struct { Action } func (v *PropertyAction) native() * /*line :200:36*/_Ctype_GPropertyAction /*line :200:53*/ { if v == nil || v.GObject == nil { return nil } return func() *_Ctype_struct__GPropertyAction{ _cgo0 := /*line :204:29*/unsafe.Pointer(v.GObject); _cgoCheckPointer(_cgo0, nil); return /*line :204:55*/_Cfunc_toGPropertyAction(_cgo0); }() } func (v *PropertyAction) Native() uintptr { return uintptr(unsafe.Pointer(v.native())) } func marshalPropertyAction(p uintptr) (interface{}, error) { c := ( /*line :212:7*/_Cfunc_g_value_get_object /*line :212:26*/)((* /*line :212:30*/_Ctype_GValue /*line :212:38*/)(unsafe.Pointer(p))) return wrapPropertyAction(wrapObject(unsafe.Pointer(c))), nil } func wrapPropertyAction(obj *Object) *PropertyAction { return &PropertyAction{Action{obj}} } // PropertyActionNew is a wrapper around g_property_action_new func PropertyActionNew(name string, object *Object, propertyName string) *PropertyAction { c := func() *_Ctype_struct__GPropertyAction{ var _cgo0 *_Ctype_gchar = /*line :222:31*/(*_Ctype_gchar /*line :222:40*/)(_Cfunc_CString /*line :222:51*/(name)); _cgo1 := _Ctype_gpointer /*line :222:70*/(unsafe.Pointer(object.native())); var _cgo2 *_Ctype_gchar = /*line :222:105*/(*_Ctype_gchar /*line :222:114*/)(_Cfunc_CString /*line :222:125*/(propertyName)); _cgoCheckPointer(_cgo1, nil); return /*line :222:141*/_Cfunc_g_property_action_new(_cgo0, _cgo1, _cgo2); }() if c == nil { return nil } return wrapPropertyAction(wrapObject(unsafe.Pointer(c))) }