// Package adw was automatically generated by github.com/bnema/puregotk DO NOT EDIT package adw 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" "github.com/bnema/puregotk/v4/gobject/types" ) // Prototype for animation targets based on user callbacks. type AnimationTargetFunc func(float64, uintptr) type AnimationTargetClass struct { _ structs.HostLayout } func (x *AnimationTargetClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } type CallbackAnimationTargetClass struct { _ structs.HostLayout } func (x *CallbackAnimationTargetClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } type PropertyAnimationTargetClass struct { _ structs.HostLayout } func (x *PropertyAnimationTargetClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Represents a value [class@Animation] can animate. type AnimationTarget struct { gobject.Object } var xAnimationTargetGLibType func() types.GType func AnimationTargetGLibType() types.GType { return xAnimationTargetGLibType() } func AnimationTargetNewFromInternalPtr(ptr uintptr) *AnimationTarget { cls := &AnimationTarget{} cls.Ptr = ptr return cls } func (c *AnimationTarget) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *AnimationTarget) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // An [class@AnimationTarget] that calls a given callback during the // animation. type CallbackAnimationTarget struct { AnimationTarget } var xCallbackAnimationTargetGLibType func() types.GType func CallbackAnimationTargetGLibType() types.GType { return xCallbackAnimationTargetGLibType() } func CallbackAnimationTargetNewFromInternalPtr(ptr uintptr) *CallbackAnimationTarget { cls := &CallbackAnimationTarget{} cls.Ptr = ptr return cls } var xNewCallbackAnimationTarget func(uintptr, uintptr, uintptr) uintptr // Creates a new `AdwAnimationTarget` that calls the given @callback during // the animation. func NewCallbackAnimationTarget(CallbackVar *AnimationTargetFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) *CallbackAnimationTarget { var cls *CallbackAnimationTarget var CallbackVarRef uintptr if CallbackVar != nil { CallbackVarPtr := uintptr(unsafe.Pointer(CallbackVar)) if cbRefPtr, ok := glib.GetCallback(CallbackVarPtr); ok { CallbackVarRef = cbRefPtr } else { fcb := func(arg0 float64, arg1 uintptr) { cbFn := *CallbackVar cbFn(arg0, arg1) } CallbackVarRef = purego.NewCallback(fcb) glib.SaveCallbackWithClosure(CallbackVarPtr, CallbackVarRef, CallbackVar) } } var DestroyVarRef uintptr if DestroyVar != nil { DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok { DestroyVarRef = cbRefPtr } else { fcb := func(arg0 uintptr) { cbFn := *DestroyVar cbFn(arg0) } DestroyVarRef = purego.NewCallback(fcb) glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar) } } cret := xNewCallbackAnimationTarget(CallbackVarRef, UserDataVar, DestroyVarRef) if cret == 0 { return nil } cls = &CallbackAnimationTarget{} cls.Ptr = cret return cls } func (c *CallbackAnimationTarget) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *CallbackAnimationTarget) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // An [class@AnimationTarget] changing the value of a property of a // [class@GObject.Object] instance. type PropertyAnimationTarget struct { AnimationTarget } var xPropertyAnimationTargetGLibType func() types.GType func PropertyAnimationTargetGLibType() types.GType { return xPropertyAnimationTargetGLibType() } func PropertyAnimationTargetNewFromInternalPtr(ptr uintptr) *PropertyAnimationTarget { cls := &PropertyAnimationTarget{} cls.Ptr = ptr return cls } var xNewPropertyAnimationTarget func(uintptr, string) uintptr // Creates a new `AdwPropertyAnimationTarget` for the @property_name property on // @object. func NewPropertyAnimationTarget(ObjectVar *gobject.Object, PropertyNameVar string) *PropertyAnimationTarget { var cls *PropertyAnimationTarget cret := xNewPropertyAnimationTarget(ObjectVar.GoPointer(), PropertyNameVar) if cret == 0 { return nil } cls = &PropertyAnimationTarget{} cls.Ptr = cret return cls } var xNewPropertyAnimationTargetForPspec func(uintptr, uintptr) uintptr // Creates a new `AdwPropertyAnimationTarget` for the @pspec property on // @object. func NewPropertyAnimationTargetForPspec(ObjectVar *gobject.Object, PspecVar *gobject.ParamSpec) *PropertyAnimationTarget { var cls *PropertyAnimationTarget cret := xNewPropertyAnimationTargetForPspec(ObjectVar.GoPointer(), PspecVar.GoPointer()) if cret == 0 { return nil } cls = &PropertyAnimationTarget{} cls.Ptr = cret return cls } var xPropertyAnimationTargetGetObject func(uintptr) uintptr // Gets the object animated by @self. // // The `AdwPropertyAnimationTarget` instance does not hold a strong reference on // the object; make sure the object is kept alive throughout the target's // lifetime. func (x *PropertyAnimationTarget) GetObject() *gobject.Object { var cls *gobject.Object cret := xPropertyAnimationTargetGetObject(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gobject.Object{} cls.Ptr = cret return cls } var xPropertyAnimationTargetGetPspec func(uintptr) uintptr // Gets the `GParamSpec` of the property animated by @self. func (x *PropertyAnimationTarget) GetPspec() *gobject.ParamSpec { var cls *gobject.ParamSpec cret := xPropertyAnimationTargetGetPspec(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gobject.ParamSpec{} cls.Ptr = cret return cls } func (c *PropertyAnimationTarget) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *PropertyAnimationTarget) SetGoPointer(ptr uintptr) { c.Ptr = ptr } func init() { core.SetPackageName("ADW", "libadwaita-1") core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("ADW") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xAnimationTargetGLibType, libs, "adw_animation_target_get_type") core.PuregoSafeRegister(&xCallbackAnimationTargetGLibType, libs, "adw_callback_animation_target_get_type") core.PuregoSafeRegister(&xNewCallbackAnimationTarget, libs, "adw_callback_animation_target_new") core.PuregoSafeRegister(&xPropertyAnimationTargetGLibType, libs, "adw_property_animation_target_get_type") core.PuregoSafeRegister(&xNewPropertyAnimationTarget, libs, "adw_property_animation_target_new") core.PuregoSafeRegister(&xNewPropertyAnimationTargetForPspec, libs, "adw_property_animation_target_new_for_pspec") core.PuregoSafeRegister(&xPropertyAnimationTargetGetObject, libs, "adw_property_animation_target_get_object") core.PuregoSafeRegister(&xPropertyAnimationTargetGetPspec, libs, "adw_property_animation_target_get_pspec") }