// Package gobject was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gobject import ( "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject/types" ) // `GBindingGroup` can be used to bind multiple properties // from an object collectively. // // Use the various methods to bind properties from a single source // object to multiple destination objects. Properties can be bound // bidirectionally and are connected when the source object is set // with [method@GObject.BindingGroup.set_source]. type BindingGroup struct { Object } var xBindingGroupGLibType func() types.GType func BindingGroupGLibType() types.GType { return xBindingGroupGLibType() } func BindingGroupNewFromInternalPtr(ptr uintptr) *BindingGroup { cls := &BindingGroup{} cls.Ptr = ptr return cls } var xNewBindingGroup func() uintptr // Creates a new #GBindingGroup. func NewBindingGroup() *BindingGroup { var cls *BindingGroup cret := xNewBindingGroup() if cret == 0 { return nil } cls = &BindingGroup{} cls.Ptr = cret return cls } var xBindingGroupBind func(uintptr, string, uintptr, string, BindingFlags) // Creates a binding between @source_property on the source object // and @target_property on @target. Whenever the @source_property // is changed the @target_property is updated using the same value. // The binding flag %G_BINDING_SYNC_CREATE is automatically specified. // // See g_object_bind_property() for more information. func (x *BindingGroup) Bind(SourcePropertyVar string, TargetVar *Object, TargetPropertyVar string, FlagsVar BindingFlags) { xBindingGroupBind(x.GoPointer(), SourcePropertyVar, TargetVar.GoPointer(), TargetPropertyVar, FlagsVar) } var xBindingGroupBindFull func(uintptr, string, uintptr, string, BindingFlags, uintptr, uintptr, uintptr, uintptr) // Creates a binding between @source_property on the source object and // @target_property on @target, allowing you to set the transformation // functions to be used by the binding. The binding flag // %G_BINDING_SYNC_CREATE is automatically specified. // // See g_object_bind_property_full() for more information. func (x *BindingGroup) BindFull(SourcePropertyVar string, TargetVar *Object, TargetPropertyVar string, FlagsVar BindingFlags, TransformToVar *BindingTransformFunc, TransformFromVar *BindingTransformFunc, UserDataVar uintptr, UserDataDestroyVar *glib.DestroyNotify) { var TransformToVarRef uintptr if TransformToVar != nil { TransformToVarPtr := uintptr(unsafe.Pointer(TransformToVar)) if cbRefPtr, ok := glib.GetCallback(TransformToVarPtr); ok { TransformToVarRef = cbRefPtr } else { fcb := func(arg0 uintptr, arg1 *Value, arg2 *Value, arg3 uintptr) bool { cbFn := *TransformToVar return cbFn(arg0, arg1, arg2, arg3) } TransformToVarRef = purego.NewCallback(fcb) glib.SaveCallbackWithClosure(TransformToVarPtr, TransformToVarRef, TransformToVar) } } var TransformFromVarRef uintptr if TransformFromVar != nil { TransformFromVarPtr := uintptr(unsafe.Pointer(TransformFromVar)) if cbRefPtr, ok := glib.GetCallback(TransformFromVarPtr); ok { TransformFromVarRef = cbRefPtr } else { fcb := func(arg0 uintptr, arg1 *Value, arg2 *Value, arg3 uintptr) bool { cbFn := *TransformFromVar return cbFn(arg0, arg1, arg2, arg3) } TransformFromVarRef = purego.NewCallback(fcb) glib.SaveCallbackWithClosure(TransformFromVarPtr, TransformFromVarRef, TransformFromVar) } } var UserDataDestroyVarRef uintptr if UserDataDestroyVar != nil { UserDataDestroyVarPtr := uintptr(unsafe.Pointer(UserDataDestroyVar)) if cbRefPtr, ok := glib.GetCallback(UserDataDestroyVarPtr); ok { UserDataDestroyVarRef = cbRefPtr } else { fcb := func(arg0 uintptr) { cbFn := *UserDataDestroyVar cbFn(arg0) } UserDataDestroyVarRef = purego.NewCallback(fcb) glib.SaveCallbackWithClosure(UserDataDestroyVarPtr, UserDataDestroyVarRef, UserDataDestroyVar) } } xBindingGroupBindFull(x.GoPointer(), SourcePropertyVar, TargetVar.GoPointer(), TargetPropertyVar, FlagsVar, TransformToVarRef, TransformFromVarRef, UserDataVar, UserDataDestroyVarRef) } var xBindingGroupBindWithClosures func(uintptr, string, uintptr, string, BindingFlags, *Closure, *Closure) // Creates a binding between @source_property on the source object and // @target_property on @target, allowing you to set the transformation // functions to be used by the binding. The binding flag // %G_BINDING_SYNC_CREATE is automatically specified. // // This function is the language bindings friendly version of // g_binding_group_bind_property_full(), using #GClosures // instead of function pointers. // // See g_object_bind_property_with_closures() for more information. func (x *BindingGroup) BindWithClosures(SourcePropertyVar string, TargetVar *Object, TargetPropertyVar string, FlagsVar BindingFlags, TransformToVar *Closure, TransformFromVar *Closure) { xBindingGroupBindWithClosures(x.GoPointer(), SourcePropertyVar, TargetVar.GoPointer(), TargetPropertyVar, FlagsVar, TransformToVar, TransformFromVar) } var xBindingGroupDupSource func(uintptr) uintptr // Gets the source object used for binding properties. func (x *BindingGroup) DupSource() *Object { var cls *Object cret := xBindingGroupDupSource(x.GoPointer()) if cret == 0 { return nil } IncreaseRef(cret) cls = &Object{} cls.Ptr = cret return cls } var xBindingGroupSetSource func(uintptr, uintptr) // Sets @source as the source object used for creating property // bindings. If there is already a source object all bindings from it // will be removed. // // Note that all properties that have been bound must exist on @source. func (x *BindingGroup) SetSource(SourceVar *Object) { xBindingGroupSetSource(x.GoPointer(), SourceVar.GoPointer()) } func (c *BindingGroup) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *BindingGroup) SetGoPointer(ptr uintptr) { c.Ptr = ptr } func init() { core.SetPackageName("GOBJECT", "gobject-2.0") core.SetSharedLibraries("GOBJECT", []string{"libgobject-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GOBJECT") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xBindingGroupGLibType, libs, "g_binding_group_get_type") core.PuregoSafeRegister(&xNewBindingGroup, libs, "g_binding_group_new") core.PuregoSafeRegister(&xBindingGroupBind, libs, "g_binding_group_bind") core.PuregoSafeRegister(&xBindingGroupBindFull, libs, "g_binding_group_bind_full") core.PuregoSafeRegister(&xBindingGroupBindWithClosures, libs, "g_binding_group_bind_with_closures") core.PuregoSafeRegister(&xBindingGroupDupSource, libs, "g_binding_group_dup_source") core.PuregoSafeRegister(&xBindingGroupSetSource, libs, "g_binding_group_set_source") }