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 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-application-window.go +22 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-application.go +15 -3 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-avatar.go +25 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-banner.go +26 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-bin.go +16 -5 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-bottom-sheet.go +38 -47 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-breakpoint-bin.go +19 -10 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-breakpoint.go +37 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-button-content.go +22 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-button-row.go +18 -10 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel-indicator-dots.go +16 -5 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel-indicator-lines.go +16 -5 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel.go +37 -47 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp-layout.go +20 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp-scrollable.go +22 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp.go +22 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-combo-row.go +33 -34 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-dialog.go +38 -45 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-easing.go +13 -3 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-entry-row.go +33 -40 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-enum-list-model.go +22 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-expander-row.go +33 -40 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-flap.go +48 -61 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-fold-threshold-policy.go +1 -10 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-header-bar.go +33 -36 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-inline-view-switcher.go +24 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-layout-slot.go +15 -4 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-layout.go +17 -7 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-leaflet.go +56 -69 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-length-unit.go +14 -5 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-main.go +15 -5 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-message-dialog.go +44 -63 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-multi-layout-view.go +23 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-direction.go +1 -10 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-split-view.go +32 -36 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-view.go +49 -60 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-overlay-split-view.go +38 -48 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-password-entry-row.go +13 -2 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-dialog.go +25 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-group.go +26 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-page.go +33 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-row.go +22 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-window.go +29 -31 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcut-label.go +18 -10 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-dialog.go +15 -4 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-item.go +25 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-section.go +17 -8 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar-item.go +37 -45 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar-section.go +27 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar.go +39 -41 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spin-row.go +34 -40 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spinner-paintable.go +16 -5 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spinner.go +13 -2 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-split-button.go +34 -39 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spring-animation.go +30 -34
| @@ -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/gobject" | |
| 10 | 11 | "github.com/bnema/puregotk/v4/gobject/types" | |
| @@ -65,7 +66,6 @@ type SpringAnimation struct { | |||
| 65 | 66 | var xSpringAnimationGLibType func() types.GType | |
| 66 | 67 | ||
| 67 | 68 | func SpringAnimationGLibType() types.GType { | |
| 68 | - | core.LazyRegister(&xSpringAnimationGLibType, "ADW", "adw_spring_animation_get_type", false) | |
| 69 | 69 | return xSpringAnimationGLibType() | |
| 70 | 70 | } | |
| 71 | 71 | ||
| @@ -82,7 +82,6 @@ var xNewSpringAnimation func(uintptr, float64, float64, *SpringParams, uintptr) | |||
| 82 | 82 | // The animation will animate @target from @from to @to with the dynamics of a | |
| 83 | 83 | // spring described by @spring_params. | |
| 84 | 84 | func NewSpringAnimation(WidgetVar *gtk.Widget, FromVar float64, ToVar float64, SpringParamsVar *SpringParams, TargetVar *AnimationTarget) *SpringAnimation { | |
| 85 | - | core.LazyRegister(&xNewSpringAnimation, "ADW", "adw_spring_animation_new", false) | |
| 86 | 85 | var cls *SpringAnimation | |
| 87 | 86 | ||
| 88 | 87 | cret := xNewSpringAnimation(WidgetVar.GoPointer(), FromVar, ToVar, SpringParamsVar, TargetVar.GoPointer()) | |
| @@ -105,8 +104,6 @@ var xSpringAnimationCalculateValue func(uintptr, uint) float64 | |||
| 105 | 104 | // | |
| 106 | 105 | // See also [method@SpringAnimation.calculate_velocity]. | |
| 107 | 106 | func (x *SpringAnimation) CalculateValue(TimeVar uint) float64 { | |
| 108 | - | core.LazyRegister(&xSpringAnimationCalculateValue, "ADW", "adw_spring_animation_calculate_value", false) | |
| 109 | - | ||
| 110 | 107 | cret := xSpringAnimationCalculateValue(x.GoPointer(), TimeVar) | |
| 111 | 108 | return cret | |
| 112 | 109 | } | |
| @@ -120,8 +117,6 @@ var xSpringAnimationCalculateVelocity func(uintptr, uint) float64 | |||
| 120 | 117 | // | |
| 121 | 118 | // See also [method@SpringAnimation.calculate_value]. | |
| 122 | 119 | func (x *SpringAnimation) CalculateVelocity(TimeVar uint) float64 { | |
| 123 | - | core.LazyRegister(&xSpringAnimationCalculateVelocity, "ADW", "adw_spring_animation_calculate_velocity", false) | |
| 124 | - | ||
| 125 | 120 | cret := xSpringAnimationCalculateVelocity(x.GoPointer(), TimeVar) | |
| 126 | 121 | return cret | |
| 127 | 122 | } | |
| @@ -130,8 +125,6 @@ var xSpringAnimationGetClamp func(uintptr) bool | |||
| 130 | 125 | ||
| 131 | 126 | // Gets whether @self should be clamped. | |
| 132 | 127 | func (x *SpringAnimation) GetClamp() bool { | |
| 133 | - | core.LazyRegister(&xSpringAnimationGetClamp, "ADW", "adw_spring_animation_get_clamp", false) | |
| 134 | - | ||
| 135 | 128 | cret := xSpringAnimationGetClamp(x.GoPointer()) | |
| 136 | 129 | return cret | |
| 137 | 130 | } | |
| @@ -140,8 +133,6 @@ var xSpringAnimationGetEpsilon func(uintptr) float64 | |||
| 140 | 133 | ||
| 141 | 134 | // Gets the precision of the spring. | |
| 142 | 135 | func (x *SpringAnimation) GetEpsilon() float64 { | |
| 143 | - | core.LazyRegister(&xSpringAnimationGetEpsilon, "ADW", "adw_spring_animation_get_epsilon", false) | |
| 144 | - | ||
| 145 | 136 | cret := xSpringAnimationGetEpsilon(x.GoPointer()) | |
| 146 | 137 | return cret | |
| 147 | 138 | } | |
| @@ -152,8 +143,6 @@ var xSpringAnimationGetEstimatedDuration func(uintptr) uint | |||
| 152 | 143 | // | |
| 153 | 144 | // Can be [const@DURATION_INFINITE] if the spring damping is set to 0. | |
| 154 | 145 | func (x *SpringAnimation) GetEstimatedDuration() uint { | |
| 155 | - | core.LazyRegister(&xSpringAnimationGetEstimatedDuration, "ADW", "adw_spring_animation_get_estimated_duration", false) | |
| 156 | - | ||
| 157 | 146 | cret := xSpringAnimationGetEstimatedDuration(x.GoPointer()) | |
| 158 | 147 | return cret | |
| 159 | 148 | } | |
| @@ -162,8 +151,6 @@ var xSpringAnimationGetInitialVelocity func(uintptr) float64 | |||
| 162 | 151 | ||
| 163 | 152 | // Gets the initial velocity of @self. | |
| 164 | 153 | func (x *SpringAnimation) GetInitialVelocity() float64 { | |
| 165 | - | core.LazyRegister(&xSpringAnimationGetInitialVelocity, "ADW", "adw_spring_animation_get_initial_velocity", false) | |
| 166 | - | ||
| 167 | 154 | cret := xSpringAnimationGetInitialVelocity(x.GoPointer()) | |
| 168 | 155 | return cret | |
| 169 | 156 | } | |
| @@ -172,8 +159,6 @@ var xSpringAnimationGetSpringParams func(uintptr) uintptr | |||
| 172 | 159 | ||
| 173 | 160 | // Gets the physical parameters of the spring of @self. | |
| 174 | 161 | func (x *SpringAnimation) GetSpringParams() *SpringParams { | |
| 175 | - | core.LazyRegister(&xSpringAnimationGetSpringParams, "ADW", "adw_spring_animation_get_spring_params", false) | |
| 176 | - | ||
| 177 | 162 | cret := xSpringAnimationGetSpringParams(x.GoPointer()) | |
| 178 | 163 | if cret == 0 { | |
| 179 | 164 | return nil | |
| @@ -185,8 +170,6 @@ var xSpringAnimationGetValueFrom func(uintptr) float64 | |||
| 185 | 170 | ||
| 186 | 171 | // Gets the value @self will animate from. | |
| 187 | 172 | func (x *SpringAnimation) GetValueFrom() float64 { | |
| 188 | - | core.LazyRegister(&xSpringAnimationGetValueFrom, "ADW", "adw_spring_animation_get_value_from", false) | |
| 189 | - | ||
| 190 | 173 | cret := xSpringAnimationGetValueFrom(x.GoPointer()) | |
| 191 | 174 | return cret | |
| 192 | 175 | } | |
| @@ -195,8 +178,6 @@ var xSpringAnimationGetValueTo func(uintptr) float64 | |||
| 195 | 178 | ||
| 196 | 179 | // Gets the value @self will animate to. | |
| 197 | 180 | func (x *SpringAnimation) GetValueTo() float64 { | |
| 198 | - | core.LazyRegister(&xSpringAnimationGetValueTo, "ADW", "adw_spring_animation_get_value_to", false) | |
| 199 | - | ||
| 200 | 181 | cret := xSpringAnimationGetValueTo(x.GoPointer()) | |
| 201 | 182 | return cret | |
| 202 | 183 | } | |
| @@ -205,8 +186,6 @@ var xSpringAnimationGetVelocity func(uintptr) float64 | |||
| 205 | 186 | ||
| 206 | 187 | // Gets the current velocity of @self. | |
| 207 | 188 | func (x *SpringAnimation) GetVelocity() float64 { | |
| 208 | - | core.LazyRegister(&xSpringAnimationGetVelocity, "ADW", "adw_spring_animation_get_velocity", false) | |
| 209 | - | ||
| 210 | 189 | cret := xSpringAnimationGetVelocity(x.GoPointer()) | |
| 211 | 190 | return cret | |
| 212 | 191 | } | |
| @@ -221,8 +200,6 @@ var xSpringAnimationSetClamp func(uintptr, bool) | |||
| 221 | 200 | // It won't prevent overshooting [property@SpringAnimation:value-from] if a | |
| 222 | 201 | // relative negative [property@SpringAnimation:initial-velocity] is set. | |
| 223 | 202 | func (x *SpringAnimation) SetClamp(ClampVar bool) { | |
| 224 | - | core.LazyRegister(&xSpringAnimationSetClamp, "ADW", "adw_spring_animation_set_clamp", false) | |
| 225 | - | ||
| 226 | 203 | xSpringAnimationSetClamp(x.GoPointer(), ClampVar) | |
| 227 | 204 | } | |
| 228 | 205 | ||
| @@ -241,8 +218,6 @@ var xSpringAnimationSetEpsilon func(uintptr, float64) | |||
| 241 | 218 | // | |
| 242 | 219 | // The default value is 0.001. | |
| 243 | 220 | func (x *SpringAnimation) SetEpsilon(EpsilonVar float64) { | |
| 244 | - | core.LazyRegister(&xSpringAnimationSetEpsilon, "ADW", "adw_spring_animation_set_epsilon", false) | |
| 245 | - | ||
| 246 | 221 | xSpringAnimationSetEpsilon(x.GoPointer(), EpsilonVar) | |
| 247 | 222 | } | |
| 248 | 223 | ||
| @@ -252,8 +227,6 @@ var xSpringAnimationSetInitialVelocity func(uintptr, float64) | |||
| 252 | 227 | // | |
| 253 | 228 | // Initial velocity affects only the animation curve, but not its duration. | |
| 254 | 229 | func (x *SpringAnimation) SetInitialVelocity(VelocityVar float64) { | |
| 255 | - | core.LazyRegister(&xSpringAnimationSetInitialVelocity, "ADW", "adw_spring_animation_set_initial_velocity", false) | |
| 256 | - | ||
| 257 | 230 | xSpringAnimationSetInitialVelocity(x.GoPointer(), VelocityVar) | |
| 258 | 231 | } | |
| 259 | 232 | ||
| @@ -261,8 +234,6 @@ var xSpringAnimationSetSpringParams func(uintptr, *SpringParams) | |||
| 261 | 234 | ||
| 262 | 235 | // Sets the physical parameters of the spring of @self. | |
| 263 | 236 | func (x *SpringAnimation) SetSpringParams(SpringParamsVar *SpringParams) { | |
| 264 | - | core.LazyRegister(&xSpringAnimationSetSpringParams, "ADW", "adw_spring_animation_set_spring_params", false) | |
| 265 | - | ||
| 266 | 237 | xSpringAnimationSetSpringParams(x.GoPointer(), SpringParamsVar) | |
| 267 | 238 | } | |
| 268 | 239 | ||
| @@ -273,8 +244,6 @@ var xSpringAnimationSetValueFrom func(uintptr, float64) | |||
| 273 | 244 | // The animation will start at this value and end at | |
| 274 | 245 | // [property@SpringAnimation:value-to]. | |
| 275 | 246 | func (x *SpringAnimation) SetValueFrom(ValueVar float64) { | |
| 276 | - | core.LazyRegister(&xSpringAnimationSetValueFrom, "ADW", "adw_spring_animation_set_value_from", false) | |
| 277 | - | ||
| 278 | 247 | xSpringAnimationSetValueFrom(x.GoPointer(), ValueVar) | |
| 279 | 248 | } | |
| 280 | 249 | ||
| @@ -285,8 +254,6 @@ var xSpringAnimationSetValueTo func(uintptr, float64) | |||
| 285 | 254 | // The animation will start at [property@SpringAnimation:value-from] and end at | |
| 286 | 255 | // this value. | |
| 287 | 256 | func (x *SpringAnimation) SetValueTo(ValueVar float64) { | |
| 288 | - | core.LazyRegister(&xSpringAnimationSetValueTo, "ADW", "adw_spring_animation_set_value_to", false) | |
| 289 | - | ||
| 290 | 257 | xSpringAnimationSetValueTo(x.GoPointer(), ValueVar) | |
| 291 | 258 | } | |
| 292 | 259 | ||
| @@ -474,4 +441,33 @@ func (x *SpringAnimation) GetPropertyVelocity() float64 { | |||
| 474 | 441 | func init() { | |
| 475 | 442 | core.SetPackageName("ADW", "libadwaita-1") | |
| 476 | 443 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | |
| 444 | + | var libs []uintptr | |
| 445 | + | for _, libPath := range core.GetPaths("ADW") { | |
| 446 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 447 | + | if err != nil { | |
| 448 | + | panic(err) | |
| 449 | + | } | |
| 450 | + | libs = append(libs, lib) | |
| 451 | + | } | |
| 452 | + | ||
| 453 | + | core.PuregoSafeRegister(&xSpringAnimationGLibType, libs, "adw_spring_animation_get_type") | |
| 454 | + | ||
| 455 | + | core.PuregoSafeRegister(&xNewSpringAnimation, libs, "adw_spring_animation_new") | |
| 456 | + | ||
| 457 | + | core.PuregoSafeRegister(&xSpringAnimationCalculateValue, libs, "adw_spring_animation_calculate_value") | |
| 458 | + | core.PuregoSafeRegister(&xSpringAnimationCalculateVelocity, libs, "adw_spring_animation_calculate_velocity") | |
| 459 | + | core.PuregoSafeRegister(&xSpringAnimationGetClamp, libs, "adw_spring_animation_get_clamp") | |
| 460 | + | core.PuregoSafeRegister(&xSpringAnimationGetEpsilon, libs, "adw_spring_animation_get_epsilon") | |
| 461 | + | core.PuregoSafeRegister(&xSpringAnimationGetEstimatedDuration, libs, "adw_spring_animation_get_estimated_duration") | |
| 462 | + | core.PuregoSafeRegister(&xSpringAnimationGetInitialVelocity, libs, "adw_spring_animation_get_initial_velocity") | |
| 463 | + | core.PuregoSafeRegister(&xSpringAnimationGetSpringParams, libs, "adw_spring_animation_get_spring_params") | |
| 464 | + | core.PuregoSafeRegister(&xSpringAnimationGetValueFrom, libs, "adw_spring_animation_get_value_from") | |
| 465 | + | core.PuregoSafeRegister(&xSpringAnimationGetValueTo, libs, "adw_spring_animation_get_value_to") | |
| 466 | + | core.PuregoSafeRegister(&xSpringAnimationGetVelocity, libs, "adw_spring_animation_get_velocity") | |
| 467 | + | core.PuregoSafeRegister(&xSpringAnimationSetClamp, libs, "adw_spring_animation_set_clamp") | |
| 468 | + | core.PuregoSafeRegister(&xSpringAnimationSetEpsilon, libs, "adw_spring_animation_set_epsilon") | |
| 469 | + | core.PuregoSafeRegister(&xSpringAnimationSetInitialVelocity, libs, "adw_spring_animation_set_initial_velocity") | |
| 470 | + | core.PuregoSafeRegister(&xSpringAnimationSetSpringParams, libs, "adw_spring_animation_set_spring_params") | |
| 471 | + | core.PuregoSafeRegister(&xSpringAnimationSetValueFrom, libs, "adw_spring_animation_set_value_from") | |
| 472 | + | core.PuregoSafeRegister(&xSpringAnimationSetValueTo, libs, "adw_spring_animation_set_value_to") | |
| 477 | 473 | } | |
| @@ -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/gobject" | 10 | "github.com/bnema/puregotk/v4/gobject" | ||
| 10 | "github.com/bnema/puregotk/v4/gobject/types" | 11 | "github.com/bnema/puregotk/v4/gobject/types" | ||
| @@ -65,7 +66,6 @@ type SpringAnimation struct { | |||||
| 65 | var xSpringAnimationGLibType func() types.GType | 66 | var xSpringAnimationGLibType func() types.GType | ||
| 66 | 67 | ||||
| 67 | func SpringAnimationGLibType() types.GType { | 68 | func SpringAnimationGLibType() types.GType { | ||
| 68 | - | core.LazyRegister(&xSpringAnimationGLibType, "ADW", "adw_spring_animation_get_type", false) | |||
| 69 | return xSpringAnimationGLibType() | 69 | return xSpringAnimationGLibType() | ||
| 70 | } | 70 | } | ||
| 71 | 71 | ||||
| @@ -82,7 +82,6 @@ var xNewSpringAnimation func(uintptr, float64, float64, *SpringParams, uintptr) | |||||
| 82 | // The animation will animate @target from @from to @to with the dynamics of a | 82 | // The animation will animate @target from @from to @to with the dynamics of a | ||
| 83 | // spring described by @spring_params. | 83 | // spring described by @spring_params. | ||
| 84 | func NewSpringAnimation(WidgetVar *gtk.Widget, FromVar float64, ToVar float64, SpringParamsVar *SpringParams, TargetVar *AnimationTarget) *SpringAnimation { | 84 | func NewSpringAnimation(WidgetVar *gtk.Widget, FromVar float64, ToVar float64, SpringParamsVar *SpringParams, TargetVar *AnimationTarget) *SpringAnimation { | ||
| 85 | - | core.LazyRegister(&xNewSpringAnimation, "ADW", "adw_spring_animation_new", false) | |||
| 86 | var cls *SpringAnimation | 85 | var cls *SpringAnimation | ||
| 87 | 86 | ||||
| 88 | cret := xNewSpringAnimation(WidgetVar.GoPointer(), FromVar, ToVar, SpringParamsVar, TargetVar.GoPointer()) | 87 | cret := xNewSpringAnimation(WidgetVar.GoPointer(), FromVar, ToVar, SpringParamsVar, TargetVar.GoPointer()) | ||
| @@ -105,8 +104,6 @@ var xSpringAnimationCalculateValue func(uintptr, uint) float64 | |||||
| 105 | // | 104 | // | ||
| 106 | // See also [method@SpringAnimation.calculate_velocity]. | 105 | // See also [method@SpringAnimation.calculate_velocity]. | ||
| 107 | func (x *SpringAnimation) CalculateValue(TimeVar uint) float64 { | 106 | func (x *SpringAnimation) CalculateValue(TimeVar uint) float64 { | ||
| 108 | - | core.LazyRegister(&xSpringAnimationCalculateValue, "ADW", "adw_spring_animation_calculate_value", false) | |||
| 109 | - | ||||
| 110 | cret := xSpringAnimationCalculateValue(x.GoPointer(), TimeVar) | 107 | cret := xSpringAnimationCalculateValue(x.GoPointer(), TimeVar) | ||
| 111 | return cret | 108 | return cret | ||
| 112 | } | 109 | } | ||
| @@ -120,8 +117,6 @@ var xSpringAnimationCalculateVelocity func(uintptr, uint) float64 | |||||
| 120 | // | 117 | // | ||
| 121 | // See also [method@SpringAnimation.calculate_value]. | 118 | // See also [method@SpringAnimation.calculate_value]. | ||
| 122 | func (x *SpringAnimation) CalculateVelocity(TimeVar uint) float64 { | 119 | func (x *SpringAnimation) CalculateVelocity(TimeVar uint) float64 { | ||
| 123 | - | core.LazyRegister(&xSpringAnimationCalculateVelocity, "ADW", "adw_spring_animation_calculate_velocity", false) | |||
| 124 | - | ||||
| 125 | cret := xSpringAnimationCalculateVelocity(x.GoPointer(), TimeVar) | 120 | cret := xSpringAnimationCalculateVelocity(x.GoPointer(), TimeVar) | ||
| 126 | return cret | 121 | return cret | ||
| 127 | } | 122 | } | ||
| @@ -130,8 +125,6 @@ var xSpringAnimationGetClamp func(uintptr) bool | |||||
| 130 | 125 | ||||
| 131 | // Gets whether @self should be clamped. | 126 | // Gets whether @self should be clamped. | ||
| 132 | func (x *SpringAnimation) GetClamp() bool { | 127 | func (x *SpringAnimation) GetClamp() bool { | ||
| 133 | - | core.LazyRegister(&xSpringAnimationGetClamp, "ADW", "adw_spring_animation_get_clamp", false) | |||
| 134 | - | ||||
| 135 | cret := xSpringAnimationGetClamp(x.GoPointer()) | 128 | cret := xSpringAnimationGetClamp(x.GoPointer()) | ||
| 136 | return cret | 129 | return cret | ||
| 137 | } | 130 | } | ||
| @@ -140,8 +133,6 @@ var xSpringAnimationGetEpsilon func(uintptr) float64 | |||||
| 140 | 133 | ||||
| 141 | // Gets the precision of the spring. | 134 | // Gets the precision of the spring. | ||
| 142 | func (x *SpringAnimation) GetEpsilon() float64 { | 135 | func (x *SpringAnimation) GetEpsilon() float64 { | ||
| 143 | - | core.LazyRegister(&xSpringAnimationGetEpsilon, "ADW", "adw_spring_animation_get_epsilon", false) | |||
| 144 | - | ||||
| 145 | cret := xSpringAnimationGetEpsilon(x.GoPointer()) | 136 | cret := xSpringAnimationGetEpsilon(x.GoPointer()) | ||
| 146 | return cret | 137 | return cret | ||
| 147 | } | 138 | } | ||
| @@ -152,8 +143,6 @@ var xSpringAnimationGetEstimatedDuration func(uintptr) uint | |||||
| 152 | // | 143 | // | ||
| 153 | // Can be [const@DURATION_INFINITE] if the spring damping is set to 0. | 144 | // Can be [const@DURATION_INFINITE] if the spring damping is set to 0. | ||
| 154 | func (x *SpringAnimation) GetEstimatedDuration() uint { | 145 | func (x *SpringAnimation) GetEstimatedDuration() uint { | ||
| 155 | - | core.LazyRegister(&xSpringAnimationGetEstimatedDuration, "ADW", "adw_spring_animation_get_estimated_duration", false) | |||
| 156 | - | ||||
| 157 | cret := xSpringAnimationGetEstimatedDuration(x.GoPointer()) | 146 | cret := xSpringAnimationGetEstimatedDuration(x.GoPointer()) | ||
| 158 | return cret | 147 | return cret | ||
| 159 | } | 148 | } | ||
| @@ -162,8 +151,6 @@ var xSpringAnimationGetInitialVelocity func(uintptr) float64 | |||||
| 162 | 151 | ||||
| 163 | // Gets the initial velocity of @self. | 152 | // Gets the initial velocity of @self. | ||
| 164 | func (x *SpringAnimation) GetInitialVelocity() float64 { | 153 | func (x *SpringAnimation) GetInitialVelocity() float64 { | ||
| 165 | - | core.LazyRegister(&xSpringAnimationGetInitialVelocity, "ADW", "adw_spring_animation_get_initial_velocity", false) | |||
| 166 | - | ||||
| 167 | cret := xSpringAnimationGetInitialVelocity(x.GoPointer()) | 154 | cret := xSpringAnimationGetInitialVelocity(x.GoPointer()) | ||
| 168 | return cret | 155 | return cret | ||
| 169 | } | 156 | } | ||
| @@ -172,8 +159,6 @@ var xSpringAnimationGetSpringParams func(uintptr) uintptr | |||||
| 172 | 159 | ||||
| 173 | // Gets the physical parameters of the spring of @self. | 160 | // Gets the physical parameters of the spring of @self. | ||
| 174 | func (x *SpringAnimation) GetSpringParams() *SpringParams { | 161 | func (x *SpringAnimation) GetSpringParams() *SpringParams { | ||
| 175 | - | core.LazyRegister(&xSpringAnimationGetSpringParams, "ADW", "adw_spring_animation_get_spring_params", false) | |||
| 176 | - | ||||
| 177 | cret := xSpringAnimationGetSpringParams(x.GoPointer()) | 162 | cret := xSpringAnimationGetSpringParams(x.GoPointer()) | ||
| 178 | if cret == 0 { | 163 | if cret == 0 { | ||
| 179 | return nil | 164 | return nil | ||
| @@ -185,8 +170,6 @@ var xSpringAnimationGetValueFrom func(uintptr) float64 | |||||
| 185 | 170 | ||||
| 186 | // Gets the value @self will animate from. | 171 | // Gets the value @self will animate from. | ||
| 187 | func (x *SpringAnimation) GetValueFrom() float64 { | 172 | func (x *SpringAnimation) GetValueFrom() float64 { | ||
| 188 | - | core.LazyRegister(&xSpringAnimationGetValueFrom, "ADW", "adw_spring_animation_get_value_from", false) | |||
| 189 | - | ||||
| 190 | cret := xSpringAnimationGetValueFrom(x.GoPointer()) | 173 | cret := xSpringAnimationGetValueFrom(x.GoPointer()) | ||
| 191 | return cret | 174 | return cret | ||
| 192 | } | 175 | } | ||
| @@ -195,8 +178,6 @@ var xSpringAnimationGetValueTo func(uintptr) float64 | |||||
| 195 | 178 | ||||
| 196 | // Gets the value @self will animate to. | 179 | // Gets the value @self will animate to. | ||
| 197 | func (x *SpringAnimation) GetValueTo() float64 { | 180 | func (x *SpringAnimation) GetValueTo() float64 { | ||
| 198 | - | core.LazyRegister(&xSpringAnimationGetValueTo, "ADW", "adw_spring_animation_get_value_to", false) | |||
| 199 | - | ||||
| 200 | cret := xSpringAnimationGetValueTo(x.GoPointer()) | 181 | cret := xSpringAnimationGetValueTo(x.GoPointer()) | ||
| 201 | return cret | 182 | return cret | ||
| 202 | } | 183 | } | ||
| @@ -205,8 +186,6 @@ var xSpringAnimationGetVelocity func(uintptr) float64 | |||||
| 205 | 186 | ||||
| 206 | // Gets the current velocity of @self. | 187 | // Gets the current velocity of @self. | ||
| 207 | func (x *SpringAnimation) GetVelocity() float64 { | 188 | func (x *SpringAnimation) GetVelocity() float64 { | ||
| 208 | - | core.LazyRegister(&xSpringAnimationGetVelocity, "ADW", "adw_spring_animation_get_velocity", false) | |||
| 209 | - | ||||
| 210 | cret := xSpringAnimationGetVelocity(x.GoPointer()) | 189 | cret := xSpringAnimationGetVelocity(x.GoPointer()) | ||
| 211 | return cret | 190 | return cret | ||
| 212 | } | 191 | } | ||
| @@ -221,8 +200,6 @@ var xSpringAnimationSetClamp func(uintptr, bool) | |||||
| 221 | // It won't prevent overshooting [property@SpringAnimation:value-from] if a | 200 | // It won't prevent overshooting [property@SpringAnimation:value-from] if a | ||
| 222 | // relative negative [property@SpringAnimation:initial-velocity] is set. | 201 | // relative negative [property@SpringAnimation:initial-velocity] is set. | ||
| 223 | func (x *SpringAnimation) SetClamp(ClampVar bool) { | 202 | func (x *SpringAnimation) SetClamp(ClampVar bool) { | ||
| 224 | - | core.LazyRegister(&xSpringAnimationSetClamp, "ADW", "adw_spring_animation_set_clamp", false) | |||
| 225 | - | ||||
| 226 | xSpringAnimationSetClamp(x.GoPointer(), ClampVar) | 203 | xSpringAnimationSetClamp(x.GoPointer(), ClampVar) | ||
| 227 | } | 204 | } | ||
| 228 | 205 | ||||
| @@ -241,8 +218,6 @@ var xSpringAnimationSetEpsilon func(uintptr, float64) | |||||
| 241 | // | 218 | // | ||
| 242 | // The default value is 0.001. | 219 | // The default value is 0.001. | ||
| 243 | func (x *SpringAnimation) SetEpsilon(EpsilonVar float64) { | 220 | func (x *SpringAnimation) SetEpsilon(EpsilonVar float64) { | ||
| 244 | - | core.LazyRegister(&xSpringAnimationSetEpsilon, "ADW", "adw_spring_animation_set_epsilon", false) | |||
| 245 | - | ||||
| 246 | xSpringAnimationSetEpsilon(x.GoPointer(), EpsilonVar) | 221 | xSpringAnimationSetEpsilon(x.GoPointer(), EpsilonVar) | ||
| 247 | } | 222 | } | ||
| 248 | 223 | ||||
| @@ -252,8 +227,6 @@ var xSpringAnimationSetInitialVelocity func(uintptr, float64) | |||||
| 252 | // | 227 | // | ||
| 253 | // Initial velocity affects only the animation curve, but not its duration. | 228 | // Initial velocity affects only the animation curve, but not its duration. | ||
| 254 | func (x *SpringAnimation) SetInitialVelocity(VelocityVar float64) { | 229 | func (x *SpringAnimation) SetInitialVelocity(VelocityVar float64) { | ||
| 255 | - | core.LazyRegister(&xSpringAnimationSetInitialVelocity, "ADW", "adw_spring_animation_set_initial_velocity", false) | |||
| 256 | - | ||||
| 257 | xSpringAnimationSetInitialVelocity(x.GoPointer(), VelocityVar) | 230 | xSpringAnimationSetInitialVelocity(x.GoPointer(), VelocityVar) | ||
| 258 | } | 231 | } | ||
| 259 | 232 | ||||
| @@ -261,8 +234,6 @@ var xSpringAnimationSetSpringParams func(uintptr, *SpringParams) | |||||
| 261 | 234 | ||||
| 262 | // Sets the physical parameters of the spring of @self. | 235 | // Sets the physical parameters of the spring of @self. | ||
| 263 | func (x *SpringAnimation) SetSpringParams(SpringParamsVar *SpringParams) { | 236 | func (x *SpringAnimation) SetSpringParams(SpringParamsVar *SpringParams) { | ||
| 264 | - | core.LazyRegister(&xSpringAnimationSetSpringParams, "ADW", "adw_spring_animation_set_spring_params", false) | |||
| 265 | - | ||||
| 266 | xSpringAnimationSetSpringParams(x.GoPointer(), SpringParamsVar) | 237 | xSpringAnimationSetSpringParams(x.GoPointer(), SpringParamsVar) | ||
| 267 | } | 238 | } | ||
| 268 | 239 | ||||
| @@ -273,8 +244,6 @@ var xSpringAnimationSetValueFrom func(uintptr, float64) | |||||
| 273 | // The animation will start at this value and end at | 244 | // The animation will start at this value and end at | ||
| 274 | // [property@SpringAnimation:value-to]. | 245 | // [property@SpringAnimation:value-to]. | ||
| 275 | func (x *SpringAnimation) SetValueFrom(ValueVar float64) { | 246 | func (x *SpringAnimation) SetValueFrom(ValueVar float64) { | ||
| 276 | - | core.LazyRegister(&xSpringAnimationSetValueFrom, "ADW", "adw_spring_animation_set_value_from", false) | |||
| 277 | - | ||||
| 278 | xSpringAnimationSetValueFrom(x.GoPointer(), ValueVar) | 247 | xSpringAnimationSetValueFrom(x.GoPointer(), ValueVar) | ||
| 279 | } | 248 | } | ||
| 280 | 249 | ||||
| @@ -285,8 +254,6 @@ var xSpringAnimationSetValueTo func(uintptr, float64) | |||||
| 285 | // The animation will start at [property@SpringAnimation:value-from] and end at | 254 | // The animation will start at [property@SpringAnimation:value-from] and end at | ||
| 286 | // this value. | 255 | // this value. | ||
| 287 | func (x *SpringAnimation) SetValueTo(ValueVar float64) { | 256 | func (x *SpringAnimation) SetValueTo(ValueVar float64) { | ||
| 288 | - | core.LazyRegister(&xSpringAnimationSetValueTo, "ADW", "adw_spring_animation_set_value_to", false) | |||
| 289 | - | ||||
| 290 | xSpringAnimationSetValueTo(x.GoPointer(), ValueVar) | 257 | xSpringAnimationSetValueTo(x.GoPointer(), ValueVar) | ||
| 291 | } | 258 | } | ||
| 292 | 259 | ||||
| @@ -474,4 +441,33 @@ func (x *SpringAnimation) GetPropertyVelocity() float64 { | |||||
| 474 | func init() { | 441 | func init() { | ||
| 475 | core.SetPackageName("ADW", "libadwaita-1") | 442 | core.SetPackageName("ADW", "libadwaita-1") | ||
| 476 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | 443 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | ||
| 444 | + | var libs []uintptr | |||
| 445 | + | for _, libPath := range core.GetPaths("ADW") { | |||
| 446 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 447 | + | if err != nil { | |||
| 448 | + | panic(err) | |||
| 449 | + | } | |||
| 450 | + | libs = append(libs, lib) | |||
| 451 | + | } | |||
| 452 | + | ||||
| 453 | + | core.PuregoSafeRegister(&xSpringAnimationGLibType, libs, "adw_spring_animation_get_type") | |||
| 454 | + | ||||
| 455 | + | core.PuregoSafeRegister(&xNewSpringAnimation, libs, "adw_spring_animation_new") | |||
| 456 | + | ||||
| 457 | + | core.PuregoSafeRegister(&xSpringAnimationCalculateValue, libs, "adw_spring_animation_calculate_value") | |||
| 458 | + | core.PuregoSafeRegister(&xSpringAnimationCalculateVelocity, libs, "adw_spring_animation_calculate_velocity") | |||
| 459 | + | core.PuregoSafeRegister(&xSpringAnimationGetClamp, libs, "adw_spring_animation_get_clamp") | |||
| 460 | + | core.PuregoSafeRegister(&xSpringAnimationGetEpsilon, libs, "adw_spring_animation_get_epsilon") | |||
| 461 | + | core.PuregoSafeRegister(&xSpringAnimationGetEstimatedDuration, libs, "adw_spring_animation_get_estimated_duration") | |||
| 462 | + | core.PuregoSafeRegister(&xSpringAnimationGetInitialVelocity, libs, "adw_spring_animation_get_initial_velocity") | |||
| 463 | + | core.PuregoSafeRegister(&xSpringAnimationGetSpringParams, libs, "adw_spring_animation_get_spring_params") | |||
| 464 | + | core.PuregoSafeRegister(&xSpringAnimationGetValueFrom, libs, "adw_spring_animation_get_value_from") | |||
| 465 | + | core.PuregoSafeRegister(&xSpringAnimationGetValueTo, libs, "adw_spring_animation_get_value_to") | |||
| 466 | + | core.PuregoSafeRegister(&xSpringAnimationGetVelocity, libs, "adw_spring_animation_get_velocity") | |||
| 467 | + | core.PuregoSafeRegister(&xSpringAnimationSetClamp, libs, "adw_spring_animation_set_clamp") | |||
| 468 | + | core.PuregoSafeRegister(&xSpringAnimationSetEpsilon, libs, "adw_spring_animation_set_epsilon") | |||
| 469 | + | core.PuregoSafeRegister(&xSpringAnimationSetInitialVelocity, libs, "adw_spring_animation_set_initial_velocity") | |||
| 470 | + | core.PuregoSafeRegister(&xSpringAnimationSetSpringParams, libs, "adw_spring_animation_set_spring_params") | |||
| 471 | + | core.PuregoSafeRegister(&xSpringAnimationSetValueFrom, libs, "adw_spring_animation_set_value_from") | |||
| 472 | + | core.PuregoSafeRegister(&xSpringAnimationSetValueTo, libs, "adw_spring_animation_set_value_to") | |||
| 477 | } | 473 | } | ||