Merge pull request #349 from bnema/fix/rollback-lazy-puregotk
fix(deps): emergency rollback puregotk lazy registration regression
905 files · +25263 -27842
M go.mod +1 -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.1-0.20260714170452-0b6b9b901234 | |
| 14 | + | github.com/bnema/puregotk v0.7.0 | |
| 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 | |
| @@ -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.1-0.20260714170452-0b6b9b901234 | 14 | + | github.com/bnema/puregotk v0.7.0 |
| 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 | ||
M go.sum +0 -4 generated file: collapsed
M vendor/github.com/bnema/puregotk/internal/core/core.go +4 -197 generated file: collapsed
M vendor/github.com/bnema/puregotk/pkg/core/core.go +0 -10 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-about-dialog.go +64 -99 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-about-window.go +62 -95 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-accent-color.go +15 -7 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-action-row.go +29 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-alert-dialog.go +47 -66 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation-target.go +27 -10 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation-util.go +12 -4 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation.go +26 -24
| @@ -5,6 +5,7 @@ import ( | |||
| 5 | 5 | "structs" | |
| 6 | 6 | "unsafe" | |
| 7 | 7 | ||
| 8 | + | "github.com/bnema/purego" | |
| 8 | 9 | "github.com/bnema/puregotk/pkg/core" | |
| 9 | 10 | "github.com/bnema/puregotk/v4/glib" | |
| 10 | 11 | "github.com/bnema/puregotk/v4/gobject" | |
| @@ -45,7 +46,6 @@ type AnimationState int | |||
| 45 | 46 | var xAnimationStateGLibType func() types.GType | |
| 46 | 47 | ||
| 47 | 48 | func AnimationStateGLibType() types.GType { | |
| 48 | - | core.LazyRegister(&xAnimationStateGLibType, "ADW", "adw_animation_state_get_type", false) | |
| 49 | 49 | return xAnimationStateGLibType() | |
| 50 | 50 | } | |
| 51 | 51 | ||
| @@ -117,7 +117,6 @@ 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) | |
| 121 | 120 | return xAnimationGLibType() | |
| 122 | 121 | } | |
| 123 | 122 | ||
| @@ -131,8 +130,6 @@ var xAnimationGetFollowEnableAnimationsSetting func(uintptr) bool | |||
| 131 | 130 | ||
| 132 | 131 | // Gets whether @self should be skipped when animations are globally disabled. | |
| 133 | 132 | func (x *Animation) GetFollowEnableAnimationsSetting() bool { | |
| 134 | - | core.LazyRegister(&xAnimationGetFollowEnableAnimationsSetting, "ADW", "adw_animation_get_follow_enable_animations_setting", false) | |
| 135 | - | ||
| 136 | 133 | cret := xAnimationGetFollowEnableAnimationsSetting(x.GoPointer()) | |
| 137 | 134 | return cret | |
| 138 | 135 | } | |
| @@ -144,8 +141,6 @@ var xAnimationGetState func(uintptr) AnimationState | |||
| 144 | 141 | // The state indicates whether @self is currently playing, paused, finished or | |
| 145 | 142 | // hasn't been started yet. | |
| 146 | 143 | func (x *Animation) GetState() AnimationState { | |
| 147 | - | core.LazyRegister(&xAnimationGetState, "ADW", "adw_animation_get_state", false) | |
| 148 | - | ||
| 149 | 144 | cret := xAnimationGetState(x.GoPointer()) | |
| 150 | 145 | return cret | |
| 151 | 146 | } | |
| @@ -154,7 +149,6 @@ var xAnimationGetTarget func(uintptr) uintptr | |||
| 154 | 149 | ||
| 155 | 150 | // Gets the target @self animates. | |
| 156 | 151 | func (x *Animation) GetTarget() *AnimationTarget { | |
| 157 | - | core.LazyRegister(&xAnimationGetTarget, "ADW", "adw_animation_get_target", false) | |
| 158 | 152 | var cls *AnimationTarget | |
| 159 | 153 | ||
| 160 | 154 | cret := xAnimationGetTarget(x.GoPointer()) | |
| @@ -172,8 +166,6 @@ var xAnimationGetValue func(uintptr) float64 | |||
| 172 | 166 | ||
| 173 | 167 | // Gets the current value of @self. | |
| 174 | 168 | func (x *Animation) GetValue() float64 { | |
| 175 | - | core.LazyRegister(&xAnimationGetValue, "ADW", "adw_animation_get_value", false) | |
| 176 | - | ||
| 177 | 169 | cret := xAnimationGetValue(x.GoPointer()) | |
| 178 | 170 | return cret | |
| 179 | 171 | } | |
| @@ -189,7 +181,6 @@ var xAnimationGetWidget func(uintptr) uintptr | |||
| 189 | 181 | // mapped, or if it gets unmapped during an ongoing animation, the animation | |
| 190 | 182 | // will be automatically skipped. | |
| 191 | 183 | func (x *Animation) GetWidget() *gtk.Widget { | |
| 192 | - | core.LazyRegister(&xAnimationGetWidget, "ADW", "adw_animation_get_widget", false) | |
| 193 | 184 | var cls *gtk.Widget | |
| 194 | 185 | ||
| 195 | 186 | cret := xAnimationGetWidget(x.GoPointer()) | |
| @@ -212,8 +203,6 @@ var xAnimationPause func(uintptr) | |||
| 212 | 203 | // | |
| 213 | 204 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.paused]. | |
| 214 | 205 | func (x *Animation) Pause() { | |
| 215 | - | core.LazyRegister(&xAnimationPause, "ADW", "adw_animation_pause", false) | |
| 216 | - | ||
| 217 | 206 | xAnimationPause(x.GoPointer()) | |
| 218 | 207 | } | |
| 219 | 208 | ||
| @@ -235,8 +224,6 @@ var xAnimationPlay func(uintptr) | |||
| 235 | 224 | // immediately afterwards, it's entirely possible that the idle callback will | |
| 236 | 225 | // run after the animation has already finished, and not while it's playing. | |
| 237 | 226 | func (x *Animation) Play() { | |
| 238 | - | core.LazyRegister(&xAnimationPlay, "ADW", "adw_animation_play", false) | |
| 239 | - | ||
| 240 | 227 | xAnimationPlay(x.GoPointer()) | |
| 241 | 228 | } | |
| 242 | 229 | ||
| @@ -246,8 +233,6 @@ var xAnimationReset func(uintptr) | |||
| 246 | 233 | // | |
| 247 | 234 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.idle]. | |
| 248 | 235 | func (x *Animation) Reset() { | |
| 249 | - | core.LazyRegister(&xAnimationReset, "ADW", "adw_animation_reset", false) | |
| 250 | - | ||
| 251 | 236 | xAnimationReset(x.GoPointer()) | |
| 252 | 237 | } | |
| 253 | 238 | ||
| @@ -260,8 +245,6 @@ var xAnimationResume func(uintptr) | |||
| 260 | 245 | // | |
| 261 | 246 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.playing]. | |
| 262 | 247 | func (x *Animation) Resume() { | |
| 263 | - | core.LazyRegister(&xAnimationResume, "ADW", "adw_animation_resume", false) | |
| 264 | - | ||
| 265 | 248 | xAnimationResume(x.GoPointer()) | |
| 266 | 249 | } | |
| 267 | 250 | ||
| @@ -277,8 +260,6 @@ var xAnimationSetFollowEnableAnimationsSetting func(uintptr, bool) | |||
| 277 | 260 | // | |
| 278 | 261 | // See [property@Gtk.Settings:gtk-enable-animations]. | |
| 279 | 262 | func (x *Animation) SetFollowEnableAnimationsSetting(SettingVar bool) { | |
| 280 | - | core.LazyRegister(&xAnimationSetFollowEnableAnimationsSetting, "ADW", "adw_animation_set_follow_enable_animations_setting", false) | |
| 281 | - | ||
| 282 | 263 | xAnimationSetFollowEnableAnimationsSetting(x.GoPointer(), SettingVar) | |
| 283 | 264 | } | |
| 284 | 265 | ||
| @@ -286,8 +267,6 @@ var xAnimationSetTarget func(uintptr, uintptr) | |||
| 286 | 267 | ||
| 287 | 268 | // Sets the target @self animates to @target. | |
| 288 | 269 | func (x *Animation) SetTarget(TargetVar *AnimationTarget) { | |
| 289 | - | core.LazyRegister(&xAnimationSetTarget, "ADW", "adw_animation_set_target", false) | |
| 290 | - | ||
| 291 | 270 | xAnimationSetTarget(x.GoPointer(), TargetVar.GoPointer()) | |
| 292 | 271 | } | |
| 293 | 272 | ||
| @@ -301,8 +280,6 @@ var xAnimationSkip func(uintptr) | |||
| 301 | 280 | // | |
| 302 | 281 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.finished]. | |
| 303 | 282 | func (x *Animation) Skip() { | |
| 304 | - | core.LazyRegister(&xAnimationSkip, "ADW", "adw_animation_skip", false) | |
| 305 | - | ||
| 306 | 283 | xAnimationSkip(x.GoPointer()) | |
| 307 | 284 | } | |
| 308 | 285 | ||
| @@ -385,4 +362,29 @@ func (x *Animation) ConnectDone(cb *func(Animation)) uint { | |||
| 385 | 362 | func init() { | |
| 386 | 363 | core.SetPackageName("ADW", "libadwaita-1") | |
| 387 | 364 | 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") | |
| 388 | 390 | } | |
| @@ -5,6 +5,7 @@ import ( | |||||
| 5 | "structs" | 5 | "structs" | ||
| 6 | "unsafe" | 6 | "unsafe" | ||
| 7 | 7 | ||||
| 8 | + | "github.com/bnema/purego" | |||
| 8 | "github.com/bnema/puregotk/pkg/core" | 9 | "github.com/bnema/puregotk/pkg/core" | ||
| 9 | "github.com/bnema/puregotk/v4/glib" | 10 | "github.com/bnema/puregotk/v4/glib" | ||
| 10 | "github.com/bnema/puregotk/v4/gobject" | 11 | "github.com/bnema/puregotk/v4/gobject" | ||
| @@ -45,7 +46,6 @@ type AnimationState int | |||||
| 45 | var xAnimationStateGLibType func() types.GType | 46 | var xAnimationStateGLibType func() types.GType | ||
| 46 | 47 | ||||
| 47 | func AnimationStateGLibType() types.GType { | 48 | 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,7 +117,6 @@ 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) | |||
| 121 | return xAnimationGLibType() | 120 | return xAnimationGLibType() | ||
| 122 | } | 121 | } | ||
| 123 | 122 | ||||
| @@ -131,8 +130,6 @@ var xAnimationGetFollowEnableAnimationsSetting func(uintptr) bool | |||||
| 131 | 130 | ||||
| 132 | // Gets whether @self should be skipped when animations are globally disabled. | 131 | // Gets whether @self should be skipped when animations are globally disabled. | ||
| 133 | func (x *Animation) GetFollowEnableAnimationsSetting() bool { | 132 | func (x *Animation) GetFollowEnableAnimationsSetting() bool { | ||
| 134 | - | core.LazyRegister(&xAnimationGetFollowEnableAnimationsSetting, "ADW", "adw_animation_get_follow_enable_animations_setting", false) | |||
| 135 | - | ||||
| 136 | cret := xAnimationGetFollowEnableAnimationsSetting(x.GoPointer()) | 133 | cret := xAnimationGetFollowEnableAnimationsSetting(x.GoPointer()) | ||
| 137 | return cret | 134 | return cret | ||
| 138 | } | 135 | } | ||
| @@ -144,8 +141,6 @@ var xAnimationGetState func(uintptr) AnimationState | |||||
| 144 | // The state indicates whether @self is currently playing, paused, finished or | 141 | // The state indicates whether @self is currently playing, paused, finished or | ||
| 145 | // hasn't been started yet. | 142 | // hasn't been started yet. | ||
| 146 | func (x *Animation) GetState() AnimationState { | 143 | func (x *Animation) GetState() AnimationState { | ||
| 147 | - | core.LazyRegister(&xAnimationGetState, "ADW", "adw_animation_get_state", false) | |||
| 148 | - | ||||
| 149 | cret := xAnimationGetState(x.GoPointer()) | 144 | cret := xAnimationGetState(x.GoPointer()) | ||
| 150 | return cret | 145 | return cret | ||
| 151 | } | 146 | } | ||
| @@ -154,7 +149,6 @@ var xAnimationGetTarget func(uintptr) uintptr | |||||
| 154 | 149 | ||||
| 155 | // Gets the target @self animates. | 150 | // Gets the target @self animates. | ||
| 156 | func (x *Animation) GetTarget() *AnimationTarget { | 151 | func (x *Animation) GetTarget() *AnimationTarget { | ||
| 157 | - | core.LazyRegister(&xAnimationGetTarget, "ADW", "adw_animation_get_target", false) | |||
| 158 | var cls *AnimationTarget | 152 | var cls *AnimationTarget | ||
| 159 | 153 | ||||
| 160 | cret := xAnimationGetTarget(x.GoPointer()) | 154 | cret := xAnimationGetTarget(x.GoPointer()) | ||
| @@ -172,8 +166,6 @@ var xAnimationGetValue func(uintptr) float64 | |||||
| 172 | 166 | ||||
| 173 | // Gets the current value of @self. | 167 | // Gets the current value of @self. | ||
| 174 | func (x *Animation) GetValue() float64 { | 168 | func (x *Animation) GetValue() float64 { | ||
| 175 | - | core.LazyRegister(&xAnimationGetValue, "ADW", "adw_animation_get_value", false) | |||
| 176 | - | ||||
| 177 | cret := xAnimationGetValue(x.GoPointer()) | 169 | cret := xAnimationGetValue(x.GoPointer()) | ||
| 178 | return cret | 170 | return cret | ||
| 179 | } | 171 | } | ||
| @@ -189,7 +181,6 @@ var xAnimationGetWidget func(uintptr) uintptr | |||||
| 189 | // mapped, or if it gets unmapped during an ongoing animation, the animation | 181 | // mapped, or if it gets unmapped during an ongoing animation, the animation | ||
| 190 | // will be automatically skipped. | 182 | // will be automatically skipped. | ||
| 191 | func (x *Animation) GetWidget() *gtk.Widget { | 183 | func (x *Animation) GetWidget() *gtk.Widget { | ||
| 192 | - | core.LazyRegister(&xAnimationGetWidget, "ADW", "adw_animation_get_widget", false) | |||
| 193 | var cls *gtk.Widget | 184 | var cls *gtk.Widget | ||
| 194 | 185 | ||||
| 195 | cret := xAnimationGetWidget(x.GoPointer()) | 186 | cret := xAnimationGetWidget(x.GoPointer()) | ||
| @@ -212,8 +203,6 @@ var xAnimationPause func(uintptr) | |||||
| 212 | // | 203 | // | ||
| 213 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.paused]. | 204 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.paused]. | ||
| 214 | func (x *Animation) Pause() { | 205 | func (x *Animation) Pause() { | ||
| 215 | - | core.LazyRegister(&xAnimationPause, "ADW", "adw_animation_pause", false) | |||
| 216 | - | ||||
| 217 | xAnimationPause(x.GoPointer()) | 206 | xAnimationPause(x.GoPointer()) | ||
| 218 | } | 207 | } | ||
| 219 | 208 | ||||
| @@ -235,8 +224,6 @@ var xAnimationPlay func(uintptr) | |||||
| 235 | // immediately afterwards, it's entirely possible that the idle callback will | 224 | // immediately afterwards, it's entirely possible that the idle callback will | ||
| 236 | // run after the animation has already finished, and not while it's playing. | 225 | // run after the animation has already finished, and not while it's playing. | ||
| 237 | func (x *Animation) Play() { | 226 | func (x *Animation) Play() { | ||
| 238 | - | core.LazyRegister(&xAnimationPlay, "ADW", "adw_animation_play", false) | |||
| 239 | - | ||||
| 240 | xAnimationPlay(x.GoPointer()) | 227 | xAnimationPlay(x.GoPointer()) | ||
| 241 | } | 228 | } | ||
| 242 | 229 | ||||
| @@ -246,8 +233,6 @@ var xAnimationReset func(uintptr) | |||||
| 246 | // | 233 | // | ||
| 247 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.idle]. | 234 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.idle]. | ||
| 248 | func (x *Animation) Reset() { | 235 | func (x *Animation) Reset() { | ||
| 249 | - | core.LazyRegister(&xAnimationReset, "ADW", "adw_animation_reset", false) | |||
| 250 | - | ||||
| 251 | xAnimationReset(x.GoPointer()) | 236 | xAnimationReset(x.GoPointer()) | ||
| 252 | } | 237 | } | ||
| 253 | 238 | ||||
| @@ -260,8 +245,6 @@ var xAnimationResume func(uintptr) | |||||
| 260 | // | 245 | // | ||
| 261 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.playing]. | 246 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.playing]. | ||
| 262 | func (x *Animation) Resume() { | 247 | func (x *Animation) Resume() { | ||
| 263 | - | core.LazyRegister(&xAnimationResume, "ADW", "adw_animation_resume", false) | |||
| 264 | - | ||||
| 265 | xAnimationResume(x.GoPointer()) | 248 | xAnimationResume(x.GoPointer()) | ||
| 266 | } | 249 | } | ||
| 267 | 250 | ||||
| @@ -277,8 +260,6 @@ var xAnimationSetFollowEnableAnimationsSetting func(uintptr, bool) | |||||
| 277 | // | 260 | // | ||
| 278 | // See [property@Gtk.Settings:gtk-enable-animations]. | 261 | // See [property@Gtk.Settings:gtk-enable-animations]. | ||
| 279 | func (x *Animation) SetFollowEnableAnimationsSetting(SettingVar bool) { | 262 | func (x *Animation) SetFollowEnableAnimationsSetting(SettingVar bool) { | ||
| 280 | - | core.LazyRegister(&xAnimationSetFollowEnableAnimationsSetting, "ADW", "adw_animation_set_follow_enable_animations_setting", false) | |||
| 281 | - | ||||
| 282 | xAnimationSetFollowEnableAnimationsSetting(x.GoPointer(), SettingVar) | 263 | xAnimationSetFollowEnableAnimationsSetting(x.GoPointer(), SettingVar) | ||
| 283 | } | 264 | } | ||
| 284 | 265 | ||||
| @@ -286,8 +267,6 @@ var xAnimationSetTarget func(uintptr, uintptr) | |||||
| 286 | 267 | ||||
| 287 | // Sets the target @self animates to @target. | 268 | // Sets the target @self animates to @target. | ||
| 288 | func (x *Animation) SetTarget(TargetVar *AnimationTarget) { | 269 | func (x *Animation) SetTarget(TargetVar *AnimationTarget) { | ||
| 289 | - | core.LazyRegister(&xAnimationSetTarget, "ADW", "adw_animation_set_target", false) | |||
| 290 | - | ||||
| 291 | xAnimationSetTarget(x.GoPointer(), TargetVar.GoPointer()) | 270 | xAnimationSetTarget(x.GoPointer(), TargetVar.GoPointer()) | ||
| 292 | } | 271 | } | ||
| 293 | 272 | ||||
| @@ -301,8 +280,6 @@ var xAnimationSkip func(uintptr) | |||||
| 301 | // | 280 | // | ||
| 302 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.finished]. | 281 | // Sets [property@Animation:state] to [enum@Adw.AnimationState.finished]. | ||
| 303 | func (x *Animation) Skip() { | 282 | func (x *Animation) Skip() { | ||
| 304 | - | core.LazyRegister(&xAnimationSkip, "ADW", "adw_animation_skip", false) | |||
| 305 | - | ||||
| 306 | xAnimationSkip(x.GoPointer()) | 283 | xAnimationSkip(x.GoPointer()) | ||
| 307 | } | 284 | } | ||
| 308 | 285 | ||||
| @@ -385,4 +362,29 @@ func (x *Animation) ConnectDone(cb *func(Animation)) uint { | |||||
| 385 | func init() { | 362 | func init() { | ||
| 386 | core.SetPackageName("ADW", "libadwaita-1") | 363 | core.SetPackageName("ADW", "libadwaita-1") | ||
| 387 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | 364 | 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") | |||
| 388 | } | 390 | } | ||