Merge pull request #350 from bnema/fix/repin-fixed-puregotk
fix(deps): validate puregotk lazy registration fix
907 files · +27874 -25296
M go.mod +3 -1
| @@ -11,7 +11,7 @@ require ( | |||
| 11 | 11 | github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a | |
| 12 | 12 | github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c | |
| 13 | 13 | github.com/bnema/purego-webp v0.2.1-0.20260714152238-7bc9c402fdf6 | |
| 14 | - | github.com/bnema/puregotk v0.7.0 | |
| 14 | + | github.com/bnema/puregotk v0.7.1-0.20260714200603-7370c78950ef | |
| 15 | 15 | github.com/charmbracelet/bubbles v1.0.0 | |
| 16 | 16 | github.com/charmbracelet/bubbletea v1.3.10 | |
| 17 | 17 | github.com/charmbracelet/lipgloss v1.1.0 | |
| @@ -47,6 +47,7 @@ require ( | |||
| 47 | 47 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | |
| 48 | 48 | github.com/fatih/color v1.19.0 // indirect | |
| 49 | 49 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | |
| 50 | + | github.com/google/go-cmp v0.7.0 // indirect | |
| 50 | 51 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | |
| 51 | 52 | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | |
| 52 | 53 | github.com/mattn/go-colorable v0.1.14 // indirect | |
| @@ -80,6 +81,7 @@ require ( | |||
| 80 | 81 | golang.org/x/text v0.40.0 // indirect | |
| 81 | 82 | golang.org/x/tools v0.47.0 // indirect | |
| 82 | 83 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | |
| 84 | + | mvdan.cc/gofumpt v0.9.2 // indirect | |
| 83 | 85 | ) | |
| 84 | 86 | ||
| 85 | 87 | tool github.com/a-h/templ/cmd/templ | |
| @@ -11,7 +11,7 @@ require ( | |||||
| 11 | github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a | 11 | github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a | ||
| 12 | github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c | 12 | github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c | ||
| 13 | github.com/bnema/purego-webp v0.2.1-0.20260714152238-7bc9c402fdf6 | 13 | github.com/bnema/purego-webp v0.2.1-0.20260714152238-7bc9c402fdf6 | ||
| 14 | - | github.com/bnema/puregotk v0.7.0 | 14 | + | github.com/bnema/puregotk v0.7.1-0.20260714200603-7370c78950ef |
| 15 | github.com/charmbracelet/bubbles v1.0.0 | 15 | github.com/charmbracelet/bubbles v1.0.0 | ||
| 16 | github.com/charmbracelet/bubbletea v1.3.10 | 16 | github.com/charmbracelet/bubbletea v1.3.10 | ||
| 17 | github.com/charmbracelet/lipgloss v1.1.0 | 17 | github.com/charmbracelet/lipgloss v1.1.0 | ||
| @@ -47,6 +47,7 @@ require ( | |||||
| 47 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | 47 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | ||
| 48 | github.com/fatih/color v1.19.0 // indirect | 48 | github.com/fatih/color v1.19.0 // indirect | ||
| 49 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | 49 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | ||
| 50 | + | github.com/google/go-cmp v0.7.0 // indirect | |||
| 50 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | 51 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
| 51 | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | 52 | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | ||
| 52 | github.com/mattn/go-colorable v0.1.14 // indirect | 53 | github.com/mattn/go-colorable v0.1.14 // indirect | ||
| @@ -80,6 +81,7 @@ require ( | |||||
| 80 | golang.org/x/text v0.40.0 // indirect | 81 | golang.org/x/text v0.40.0 // indirect | ||
| 81 | golang.org/x/tools v0.47.0 // indirect | 82 | golang.org/x/tools v0.47.0 // indirect | ||
| 82 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | 83 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | ||
| 84 | + | mvdan.cc/gofumpt v0.9.2 // indirect | |||
| 83 | ) | 85 | ) | ||
| 84 | 86 | ||||
| 85 | tool github.com/a-h/templ/cmd/templ | 87 | tool github.com/a-h/templ/cmd/templ | ||
M go.sum +4 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/internal/core/core.go +197 -4 generated file: collapsed
M vendor/github.com/bnema/puregotk/pkg/core/core.go +10 -0 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-about-dialog.go +99 -64 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-about-window.go +95 -62 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-accent-color.go +7 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-action-row.go +33 -29 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-alert-dialog.go +66 -47 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation-target.go +10 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation-util.go +4 -12 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation.go +24 -26
| @@ -5,7 +5,6 @@ import ( | |||
| 5 | 5 | "structs" | |
| 6 | 6 | "unsafe" | |
| 7 | 7 | ||
| 8 | - | "github.com/bnema/purego" | |
| 9 | 8 | "github.com/bnema/puregotk/pkg/core" | |
| 10 | 9 | "github.com/bnema/puregotk/v4/glib" | |
| 11 | 10 | "github.com/bnema/puregotk/v4/gobject" | |
| @@ -46,6 +45,7 @@ type AnimationState int | |||
| 46 | 45 | var xAnimationStateGLibType func() types.GType | |
| 47 | 46 | ||
| 48 | 47 | func AnimationStateGLibType() types.GType { | |
| 48 | + | core.LazyRegister(&xAnimationStateGLibType, "ADW", "adw_animation_state_get_type", false) | |
| 49 | 49 | return xAnimationStateGLibType() | |
| 50 | 50 | } | |
| 51 | 51 | ||
| @@ -117,6 +117,7 @@ type Animation struct { | |||
| 117 | 117 | var xAnimationGLibType func() types.GType | |
| 118 | 118 | ||
| 119 | 119 | func AnimationGLibType() types.GType { | |
| 120 | + | core.LazyRegister(&xAnimationGLibType, "ADW", "adw_animation_get_type", false) | |
| 120 | 121 | return xAnimationGLibType() | |
| 121 | 122 | } | |
| 122 | 123 | ||
| @@ -130,6 +131,8 @@ var xAnimationGetFollowEnableAnimationsSetting func(uintptr) bool | |||
| 130 | 131 | ||
| 131 | 132 | // Gets whether @self should be skipped when animations are globally disabled. | |
| 132 | 133 | func (x *Animation) GetFollowEnableAnimationsSetting() bool { | |
| 134 | + | core.LazyRegister(&xAnimationGetFollowEnableAnimationsSetting, "ADW", "adw_animation_get_follow_enable_animations_setting", false) | |
| 135 | + | ||
| 133 | 136 | cret := xAnimationGetFollowEnableAnimationsSetting(x.GoPointer()) | |
| 134 | 137 | return cret | |
| 135 | 138 | } | |
| @@ -141,6 +144,8 @@ var xAnimationGetState func(uintptr) AnimationState | |||
| 141 | 144 | // The state indicates whether @self is currently playing, paused, finished or | |
| 142 | 145 | // hasn't been started yet. | |
| 143 | 146 | func (x *Animation) GetState() AnimationState { | |
| 147 | + | core.LazyRegister(&xAnimationGetState, "ADW", "adw_animation_get_state", false) | |
| 148 | + | ||
| 144 | 149 | cret := xAnimationGetState(x.GoPointer()) | |
| 145 | 150 | return cret | |
| 146 | 151 | } | |
| @@ -149,6 +154,7 @@ var xAnimationGetTarget func(uintptr) uintptr | |||
| 149 | 154 | ||
| 150 | 155 | // Gets the target @self animates. | |
| 151 | 156 | func (x *Animation) GetTarget() *AnimationTarget { | |
| 157 | + | core.LazyRegister(&xAnimationGetTarget, "ADW", "adw_animation_get_target", false) | |
| 152 | 158 | var cls *AnimationTarget | |
| 153 | 159 | ||
| 154 | 160 | cret := xAnimationGetTarget(x.GoPointer()) | |
| @@ -166,6 +172,8 @@ var xAnimationGetValue func(uintptr) float64 | |||
| 166 | 172 | ||
| 167 | 173 | // Gets the current value of @self. | |
| 168 | 174 | func (x *Animation) GetValue() float64 { | |
| 175 | + | core.LazyRegister(&xAnimationGetValue, "ADW", "adw_animation_get_value", false) | |
| 176 | + | ||
| 169 | 177 | cret := xAnimationGetValue(x.GoPointer()) | |
| 170 | 178 | return cret | |
| 171 | 179 | } | |
| @@ -181,6 +189,7 @@ var xAnimationGetWidget func(uintptr) uintptr | |||
| 181 | 189 | // mapped, or if it gets unmapped during an ongoing animation, the animation | |
| 182 | 190 | // will be automatically skipped. | |
| 183 | 191 | func (x *Animation) GetWidget() *gtk.Widget { | |
| 192 | + | core.LazyRegister(&xAnimationGetWidget, "ADW", "adw_animation_get_widget", false) | |
| 184 | 193 | var cls *gtk.Widget | |
| 185 | 194 | ||
| 186 | 195 | cret := xAnimationGetWidget(x.GoPointer()) | |
| @@ -203,6 +212,8 @@ var xAnimationPause func(uintptr) | |||
| 203 | 212 | // | |
| 204 | 213 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.paused]. | |
| 205 | 214 | func (x *Animation) Pause() { | |
| 215 | + | core.LazyRegister(&xAnimationPause, "ADW", "adw_animation_pause", false) | |
| 216 | + | ||
| 206 | 217 | xAnimationPause(x.GoPointer()) | |
| 207 | 218 | } | |
| 208 | 219 | ||
| @@ -224,6 +235,8 @@ var xAnimationPlay func(uintptr) | |||
| 224 | 235 | // immediately afterwards, it's entirely possible that the idle callback will | |
| 225 | 236 | // run after the animation has already finished, and not while it's playing. | |
| 226 | 237 | func (x *Animation) Play() { | |
| 238 | + | core.LazyRegister(&xAnimationPlay, "ADW", "adw_animation_play", false) | |
| 239 | + | ||
| 227 | 240 | xAnimationPlay(x.GoPointer()) | |
| 228 | 241 | } | |
| 229 | 242 | ||
| @@ -233,6 +246,8 @@ var xAnimationReset func(uintptr) | |||
| 233 | 246 | // | |
| 234 | 247 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.idle]. | |
| 235 | 248 | func (x *Animation) Reset() { | |
| 249 | + | core.LazyRegister(&xAnimationReset, "ADW", "adw_animation_reset", false) | |
| 250 | + | ||
| 236 | 251 | xAnimationReset(x.GoPointer()) | |
| 237 | 252 | } | |
| 238 | 253 | ||
| @@ -245,6 +260,8 @@ var xAnimationResume func(uintptr) | |||
| 245 | 260 | // | |
| 246 | 261 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.playing]. | |
| 247 | 262 | func (x *Animation) Resume() { | |
| 263 | + | core.LazyRegister(&xAnimationResume, "ADW", "adw_animation_resume", false) | |
| 264 | + | ||
| 248 | 265 | xAnimationResume(x.GoPointer()) | |
| 249 | 266 | } | |
| 250 | 267 | ||
| @@ -260,6 +277,8 @@ var xAnimationSetFollowEnableAnimationsSetting func(uintptr, bool) | |||
| 260 | 277 | // | |
| 261 | 278 | // See [property@Gtk.Settings:gtk-enable-animations]. | |
| 262 | 279 | func (x *Animation) SetFollowEnableAnimationsSetting(SettingVar bool) { | |
| 280 | + | core.LazyRegister(&xAnimationSetFollowEnableAnimationsSetting, "ADW", "adw_animation_set_follow_enable_animations_setting", false) | |
| 281 | + | ||
| 263 | 282 | xAnimationSetFollowEnableAnimationsSetting(x.GoPointer(), SettingVar) | |
| 264 | 283 | } | |
| 265 | 284 | ||
| @@ -267,6 +286,8 @@ var xAnimationSetTarget func(uintptr, uintptr) | |||
| 267 | 286 | ||
| 268 | 287 | // Sets the target @self animates to @target. | |
| 269 | 288 | func (x *Animation) SetTarget(TargetVar *AnimationTarget) { | |
| 289 | + | core.LazyRegister(&xAnimationSetTarget, "ADW", "adw_animation_set_target", false) | |
| 290 | + | ||
| 270 | 291 | xAnimationSetTarget(x.GoPointer(), TargetVar.GoPointer()) | |
| 271 | 292 | } | |
| 272 | 293 | ||
| @@ -280,6 +301,8 @@ var xAnimationSkip func(uintptr) | |||
| 280 | 301 | // | |
| 281 | 302 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.finished]. | |
| 282 | 303 | func (x *Animation) Skip() { | |
| 304 | + | core.LazyRegister(&xAnimationSkip, "ADW", "adw_animation_skip", false) | |
| 305 | + | ||
| 283 | 306 | xAnimationSkip(x.GoPointer()) | |
| 284 | 307 | } | |
| 285 | 308 | ||
| @@ -362,29 +385,4 @@ func (x *Animation) ConnectDone(cb *func(Animation)) uint { | |||
| 362 | 385 | func init() { | |
| 363 | 386 | core.SetPackageName("ADW", "libadwaita-1") | |
| 364 | 387 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | |
| 365 | - | var libs []uintptr | |
| 366 | - | for _, libPath := range core.GetPaths("ADW") { | |
| 367 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 368 | - | if err != nil { | |
| 369 | - | panic(err) | |
| 370 | - | } | |
| 371 | - | libs = append(libs, lib) | |
| 372 | - | } | |
| 373 | - | ||
| 374 | - | core.PuregoSafeRegister(&xAnimationStateGLibType, libs, "adw_animation_state_get_type") | |
| 375 | - | ||
| 376 | - | core.PuregoSafeRegister(&xAnimationGLibType, libs, "adw_animation_get_type") | |
| 377 | - | ||
| 378 | - | core.PuregoSafeRegister(&xAnimationGetFollowEnableAnimationsSetting, libs, "adw_animation_get_follow_enable_animations_setting") | |
| 379 | - | core.PuregoSafeRegister(&xAnimationGetState, libs, "adw_animation_get_state") | |
| 380 | - | core.PuregoSafeRegister(&xAnimationGetTarget, libs, "adw_animation_get_target") | |
| 381 | - | core.PuregoSafeRegister(&xAnimationGetValue, libs, "adw_animation_get_value") | |
| 382 | - | core.PuregoSafeRegister(&xAnimationGetWidget, libs, "adw_animation_get_widget") | |
| 383 | - | core.PuregoSafeRegister(&xAnimationPause, libs, "adw_animation_pause") | |
| 384 | - | core.PuregoSafeRegister(&xAnimationPlay, libs, "adw_animation_play") | |
| 385 | - | core.PuregoSafeRegister(&xAnimationReset, libs, "adw_animation_reset") | |
| 386 | - | core.PuregoSafeRegister(&xAnimationResume, libs, "adw_animation_resume") | |
| 387 | - | core.PuregoSafeRegister(&xAnimationSetFollowEnableAnimationsSetting, libs, "adw_animation_set_follow_enable_animations_setting") | |
| 388 | - | core.PuregoSafeRegister(&xAnimationSetTarget, libs, "adw_animation_set_target") | |
| 389 | - | core.PuregoSafeRegister(&xAnimationSkip, libs, "adw_animation_skip") | |
| 390 | 388 | } | |
| @@ -5,7 +5,6 @@ import ( | |||||
| 5 | "structs" | 5 | "structs" | ||
| 6 | "unsafe" | 6 | "unsafe" | ||
| 7 | 7 | ||||
| 8 | - | "github.com/bnema/purego" | |||
| 9 | "github.com/bnema/puregotk/pkg/core" | 8 | "github.com/bnema/puregotk/pkg/core" | ||
| 10 | "github.com/bnema/puregotk/v4/glib" | 9 | "github.com/bnema/puregotk/v4/glib" | ||
| 11 | "github.com/bnema/puregotk/v4/gobject" | 10 | "github.com/bnema/puregotk/v4/gobject" | ||
| @@ -46,6 +45,7 @@ type AnimationState int | |||||
| 46 | var xAnimationStateGLibType func() types.GType | 45 | var xAnimationStateGLibType func() types.GType | ||
| 47 | 46 | ||||
| 48 | func AnimationStateGLibType() types.GType { | 47 | func AnimationStateGLibType() types.GType { | ||
| 48 | + | core.LazyRegister(&xAnimationStateGLibType, "ADW", "adw_animation_state_get_type", false) | |||
| 49 | return xAnimationStateGLibType() | 49 | return xAnimationStateGLibType() | ||
| 50 | } | 50 | } | ||
| 51 | 51 | ||||
| @@ -117,6 +117,7 @@ type Animation struct { | |||||
| 117 | var xAnimationGLibType func() types.GType | 117 | var xAnimationGLibType func() types.GType | ||
| 118 | 118 | ||||
| 119 | func AnimationGLibType() types.GType { | 119 | func AnimationGLibType() types.GType { | ||
| 120 | + | core.LazyRegister(&xAnimationGLibType, "ADW", "adw_animation_get_type", false) | |||
| 120 | return xAnimationGLibType() | 121 | return xAnimationGLibType() | ||
| 121 | } | 122 | } | ||
| 122 | 123 | ||||
| @@ -130,6 +131,8 @@ var xAnimationGetFollowEnableAnimationsSetting func(uintptr) bool | |||||
| 130 | 131 | ||||
| 131 | // Gets whether @self should be skipped when animations are globally disabled. | 132 | // Gets whether @self should be skipped when animations are globally disabled. | ||
| 132 | func (x *Animation) GetFollowEnableAnimationsSetting() bool { | 133 | func (x *Animation) GetFollowEnableAnimationsSetting() bool { | ||
| 134 | + | core.LazyRegister(&xAnimationGetFollowEnableAnimationsSetting, "ADW", "adw_animation_get_follow_enable_animations_setting", false) | |||
| 135 | + | ||||
| 133 | cret := xAnimationGetFollowEnableAnimationsSetting(x.GoPointer()) | 136 | cret := xAnimationGetFollowEnableAnimationsSetting(x.GoPointer()) | ||
| 134 | return cret | 137 | return cret | ||
| 135 | } | 138 | } | ||
| @@ -141,6 +144,8 @@ var xAnimationGetState func(uintptr) AnimationState | |||||
| 141 | // The state indicates whether @self is currently playing, paused, finished or | 144 | // The state indicates whether @self is currently playing, paused, finished or | ||
| 142 | // hasn't been started yet. | 145 | // hasn't been started yet. | ||
| 143 | func (x *Animation) GetState() AnimationState { | 146 | func (x *Animation) GetState() AnimationState { | ||
| 147 | + | core.LazyRegister(&xAnimationGetState, "ADW", "adw_animation_get_state", false) | |||
| 148 | + | ||||
| 144 | cret := xAnimationGetState(x.GoPointer()) | 149 | cret := xAnimationGetState(x.GoPointer()) | ||
| 145 | return cret | 150 | return cret | ||
| 146 | } | 151 | } | ||
| @@ -149,6 +154,7 @@ var xAnimationGetTarget func(uintptr) uintptr | |||||
| 149 | 154 | ||||
| 150 | // Gets the target @self animates. | 155 | // Gets the target @self animates. | ||
| 151 | func (x *Animation) GetTarget() *AnimationTarget { | 156 | func (x *Animation) GetTarget() *AnimationTarget { | ||
| 157 | + | core.LazyRegister(&xAnimationGetTarget, "ADW", "adw_animation_get_target", false) | |||
| 152 | var cls *AnimationTarget | 158 | var cls *AnimationTarget | ||
| 153 | 159 | ||||
| 154 | cret := xAnimationGetTarget(x.GoPointer()) | 160 | cret := xAnimationGetTarget(x.GoPointer()) | ||
| @@ -166,6 +172,8 @@ var xAnimationGetValue func(uintptr) float64 | |||||
| 166 | 172 | ||||
| 167 | // Gets the current value of @self. | 173 | // Gets the current value of @self. | ||
| 168 | func (x *Animation) GetValue() float64 { | 174 | func (x *Animation) GetValue() float64 { | ||
| 175 | + | core.LazyRegister(&xAnimationGetValue, "ADW", "adw_animation_get_value", false) | |||
| 176 | + | ||||
| 169 | cret := xAnimationGetValue(x.GoPointer()) | 177 | cret := xAnimationGetValue(x.GoPointer()) | ||
| 170 | return cret | 178 | return cret | ||
| 171 | } | 179 | } | ||
| @@ -181,6 +189,7 @@ var xAnimationGetWidget func(uintptr) uintptr | |||||
| 181 | // mapped, or if it gets unmapped during an ongoing animation, the animation | 189 | // mapped, or if it gets unmapped during an ongoing animation, the animation | ||
| 182 | // will be automatically skipped. | 190 | // will be automatically skipped. | ||
| 183 | func (x *Animation) GetWidget() *gtk.Widget { | 191 | func (x *Animation) GetWidget() *gtk.Widget { | ||
| 192 | + | core.LazyRegister(&xAnimationGetWidget, "ADW", "adw_animation_get_widget", false) | |||
| 184 | var cls *gtk.Widget | 193 | var cls *gtk.Widget | ||
| 185 | 194 | ||||
| 186 | cret := xAnimationGetWidget(x.GoPointer()) | 195 | cret := xAnimationGetWidget(x.GoPointer()) | ||
| @@ -203,6 +212,8 @@ var xAnimationPause func(uintptr) | |||||
| 203 | // | 212 | // | ||
| 204 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.paused]. | 213 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.paused]. | ||
| 205 | func (x *Animation) Pause() { | 214 | func (x *Animation) Pause() { | ||
| 215 | + | core.LazyRegister(&xAnimationPause, "ADW", "adw_animation_pause", false) | |||
| 216 | + | ||||
| 206 | xAnimationPause(x.GoPointer()) | 217 | xAnimationPause(x.GoPointer()) | ||
| 207 | } | 218 | } | ||
| 208 | 219 | ||||
| @@ -224,6 +235,8 @@ var xAnimationPlay func(uintptr) | |||||
| 224 | // immediately afterwards, it's entirely possible that the idle callback will | 235 | // immediately afterwards, it's entirely possible that the idle callback will | ||
| 225 | // run after the animation has already finished, and not while it's playing. | 236 | // run after the animation has already finished, and not while it's playing. | ||
| 226 | func (x *Animation) Play() { | 237 | func (x *Animation) Play() { | ||
| 238 | + | core.LazyRegister(&xAnimationPlay, "ADW", "adw_animation_play", false) | |||
| 239 | + | ||||
| 227 | xAnimationPlay(x.GoPointer()) | 240 | xAnimationPlay(x.GoPointer()) | ||
| 228 | } | 241 | } | ||
| 229 | 242 | ||||
| @@ -233,6 +246,8 @@ var xAnimationReset func(uintptr) | |||||
| 233 | // | 246 | // | ||
| 234 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.idle]. | 247 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.idle]. | ||
| 235 | func (x *Animation) Reset() { | 248 | func (x *Animation) Reset() { | ||
| 249 | + | core.LazyRegister(&xAnimationReset, "ADW", "adw_animation_reset", false) | |||
| 250 | + | ||||
| 236 | xAnimationReset(x.GoPointer()) | 251 | xAnimationReset(x.GoPointer()) | ||
| 237 | } | 252 | } | ||
| 238 | 253 | ||||
| @@ -245,6 +260,8 @@ var xAnimationResume func(uintptr) | |||||
| 245 | // | 260 | // | ||
| 246 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.playing]. | 261 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.playing]. | ||
| 247 | func (x *Animation) Resume() { | 262 | func (x *Animation) Resume() { | ||
| 263 | + | core.LazyRegister(&xAnimationResume, "ADW", "adw_animation_resume", false) | |||
| 264 | + | ||||
| 248 | xAnimationResume(x.GoPointer()) | 265 | xAnimationResume(x.GoPointer()) | ||
| 249 | } | 266 | } | ||
| 250 | 267 | ||||
| @@ -260,6 +277,8 @@ var xAnimationSetFollowEnableAnimationsSetting func(uintptr, bool) | |||||
| 260 | // | 277 | // | ||
| 261 | // See [property@Gtk.Settings:gtk-enable-animations]. | 278 | // See [property@Gtk.Settings:gtk-enable-animations]. | ||
| 262 | func (x *Animation) SetFollowEnableAnimationsSetting(SettingVar bool) { | 279 | func (x *Animation) SetFollowEnableAnimationsSetting(SettingVar bool) { | ||
| 280 | + | core.LazyRegister(&xAnimationSetFollowEnableAnimationsSetting, "ADW", "adw_animation_set_follow_enable_animations_setting", false) | |||
| 281 | + | ||||
| 263 | xAnimationSetFollowEnableAnimationsSetting(x.GoPointer(), SettingVar) | 282 | xAnimationSetFollowEnableAnimationsSetting(x.GoPointer(), SettingVar) | ||
| 264 | } | 283 | } | ||
| 265 | 284 | ||||
| @@ -267,6 +286,8 @@ var xAnimationSetTarget func(uintptr, uintptr) | |||||
| 267 | 286 | ||||
| 268 | // Sets the target @self animates to @target. | 287 | // Sets the target @self animates to @target. | ||
| 269 | func (x *Animation) SetTarget(TargetVar *AnimationTarget) { | 288 | func (x *Animation) SetTarget(TargetVar *AnimationTarget) { | ||
| 289 | + | core.LazyRegister(&xAnimationSetTarget, "ADW", "adw_animation_set_target", false) | |||
| 290 | + | ||||
| 270 | xAnimationSetTarget(x.GoPointer(), TargetVar.GoPointer()) | 291 | xAnimationSetTarget(x.GoPointer(), TargetVar.GoPointer()) | ||
| 271 | } | 292 | } | ||
| 272 | 293 | ||||
| @@ -280,6 +301,8 @@ var xAnimationSkip func(uintptr) | |||||
| 280 | // | 301 | // | ||
| 281 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.finished]. | 302 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.finished]. | ||
| 282 | func (x *Animation) Skip() { | 303 | func (x *Animation) Skip() { | ||
| 304 | + | core.LazyRegister(&xAnimationSkip, "ADW", "adw_animation_skip", false) | |||
| 305 | + | ||||
| 283 | xAnimationSkip(x.GoPointer()) | 306 | xAnimationSkip(x.GoPointer()) | ||
| 284 | } | 307 | } | ||
| 285 | 308 | ||||
| @@ -362,29 +385,4 @@ func (x *Animation) ConnectDone(cb *func(Animation)) uint { | |||||
| 362 | func init() { | 385 | func init() { | ||
| 363 | core.SetPackageName("ADW", "libadwaita-1") | 386 | core.SetPackageName("ADW", "libadwaita-1") | ||
| 364 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | 387 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | ||
| 365 | - | var libs []uintptr | |||
| 366 | - | for _, libPath := range core.GetPaths("ADW") { | |||
| 367 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 368 | - | if err != nil { | |||
| 369 | - | panic(err) | |||
| 370 | - | } | |||
| 371 | - | libs = append(libs, lib) | |||
| 372 | - | } | |||
| 373 | - | ||||
| 374 | - | core.PuregoSafeRegister(&xAnimationStateGLibType, libs, "adw_animation_state_get_type") | |||
| 375 | - | ||||
| 376 | - | core.PuregoSafeRegister(&xAnimationGLibType, libs, "adw_animation_get_type") | |||
| 377 | - | ||||
| 378 | - | core.PuregoSafeRegister(&xAnimationGetFollowEnableAnimationsSetting, libs, "adw_animation_get_follow_enable_animations_setting") | |||
| 379 | - | core.PuregoSafeRegister(&xAnimationGetState, libs, "adw_animation_get_state") | |||
| 380 | - | core.PuregoSafeRegister(&xAnimationGetTarget, libs, "adw_animation_get_target") | |||
| 381 | - | core.PuregoSafeRegister(&xAnimationGetValue, libs, "adw_animation_get_value") | |||
| 382 | - | core.PuregoSafeRegister(&xAnimationGetWidget, libs, "adw_animation_get_widget") | |||
| 383 | - | core.PuregoSafeRegister(&xAnimationPause, libs, "adw_animation_pause") | |||
| 384 | - | core.PuregoSafeRegister(&xAnimationPlay, libs, "adw_animation_play") | |||
| 385 | - | core.PuregoSafeRegister(&xAnimationReset, libs, "adw_animation_reset") | |||
| 386 | - | core.PuregoSafeRegister(&xAnimationResume, libs, "adw_animation_resume") | |||
| 387 | - | core.PuregoSafeRegister(&xAnimationSetFollowEnableAnimationsSetting, libs, "adw_animation_set_follow_enable_animations_setting") | |||
| 388 | - | core.PuregoSafeRegister(&xAnimationSetTarget, libs, "adw_animation_set_target") | |||
| 389 | - | core.PuregoSafeRegister(&xAnimationSkip, libs, "adw_animation_skip") | |||
| 390 | } | 388 | } | ||