fix(deps): repin puregotk lazy registration fix
- commit
- d685b6e820d6baba0d0dea254169664012ed203d
- author
- brice · · 2026-07-14 18:24 UTC
- parent
- ec6db2e
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
907 files · +27874 -25294
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.20260714181430-679a9ed72959 | |
| 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.20260714181430-679a9ed72959 |
| 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 -16 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 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-application-window.go +14 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-application.go +3 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-avatar.go +22 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-banner.go +23 -26 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-bin.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-bottom-sheet.go +47 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-breakpoint-bin.go +10 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-breakpoint.go +33 -37
| @@ -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" | |
| @@ -39,6 +38,7 @@ type BreakpointCondition struct { | |||
| 39 | 38 | var xBreakpointConditionGLibType func() types.GType | |
| 40 | 39 | ||
| 41 | 40 | func BreakpointConditionGLibType() types.GType { | |
| 41 | + | core.LazyRegister(&xBreakpointConditionGLibType, "ADW", "adw_breakpoint_condition_get_type", false) | |
| 42 | 42 | return xBreakpointConditionGLibType() | |
| 43 | 43 | } | |
| 44 | 44 | ||
| @@ -59,6 +59,8 @@ var xNewBreakpointConditionAnd func(*BreakpointCondition, *BreakpointCondition) | |||
| 59 | 59 | // Creates a condition that triggers when @condition_1 and @condition_2 are both | |
| 60 | 60 | // true. | |
| 61 | 61 | func NewBreakpointConditionAnd(Condition1Var *BreakpointCondition, Condition2Var *BreakpointCondition) *BreakpointCondition { | |
| 62 | + | core.LazyRegister(&xNewBreakpointConditionAnd, "ADW", "adw_breakpoint_condition_new_and", false) | |
| 63 | + | ||
| 62 | 64 | cret := xNewBreakpointConditionAnd(Condition1Var, Condition2Var) | |
| 63 | 65 | if cret == 0 { | |
| 64 | 66 | return nil | |
| @@ -70,6 +72,8 @@ var xNewBreakpointConditionLength func(BreakpointConditionLengthType, float64, L | |||
| 70 | 72 | ||
| 71 | 73 | // Creates a condition that triggers on length changes. | |
| 72 | 74 | func NewBreakpointConditionLength(TypeVar BreakpointConditionLengthType, ValueVar float64, UnitVar LengthUnit) *BreakpointCondition { | |
| 75 | + | core.LazyRegister(&xNewBreakpointConditionLength, "ADW", "adw_breakpoint_condition_new_length", false) | |
| 76 | + | ||
| 73 | 77 | cret := xNewBreakpointConditionLength(TypeVar, ValueVar, UnitVar) | |
| 74 | 78 | if cret == 0 { | |
| 75 | 79 | return nil | |
| @@ -82,6 +86,8 @@ var xNewBreakpointConditionOr func(*BreakpointCondition, *BreakpointCondition) u | |||
| 82 | 86 | // Creates a condition that triggers when either @condition_1 or @condition_2 is | |
| 83 | 87 | // true. | |
| 84 | 88 | func NewBreakpointConditionOr(Condition1Var *BreakpointCondition, Condition2Var *BreakpointCondition) *BreakpointCondition { | |
| 89 | + | core.LazyRegister(&xNewBreakpointConditionOr, "ADW", "adw_breakpoint_condition_new_or", false) | |
| 90 | + | ||
| 85 | 91 | cret := xNewBreakpointConditionOr(Condition1Var, Condition2Var) | |
| 86 | 92 | if cret == 0 { | |
| 87 | 93 | return nil | |
| @@ -95,6 +101,8 @@ var xNewBreakpointConditionRatio func(BreakpointConditionRatioType, int, int) ui | |||
| 95 | 101 | // | |
| 96 | 102 | // The ratio is represented as @width divided by @height. | |
| 97 | 103 | func NewBreakpointConditionRatio(TypeVar BreakpointConditionRatioType, WidthVar int, HeightVar int) *BreakpointCondition { | |
| 104 | + | core.LazyRegister(&xNewBreakpointConditionRatio, "ADW", "adw_breakpoint_condition_new_ratio", false) | |
| 105 | + | ||
| 98 | 106 | cret := xNewBreakpointConditionRatio(TypeVar, WidthVar, HeightVar) | |
| 99 | 107 | if cret == 0 { | |
| 100 | 108 | return nil | |
| @@ -106,6 +114,8 @@ var xBreakpointConditionCopy func(uintptr) uintptr | |||
| 106 | 114 | ||
| 107 | 115 | // Copies @self. | |
| 108 | 116 | func (x *BreakpointCondition) Copy() *BreakpointCondition { | |
| 117 | + | core.LazyRegister(&xBreakpointConditionCopy, "ADW", "adw_breakpoint_condition_copy", false) | |
| 118 | + | ||
| 109 | 119 | cret := xBreakpointConditionCopy(x.GoPointer()) | |
| 110 | 120 | if cret == 0 { | |
| 111 | 121 | return nil | |
| @@ -117,6 +127,8 @@ var xBreakpointConditionFree func(uintptr) | |||
| 117 | 127 | ||
| 118 | 128 | // Frees @self. | |
| 119 | 129 | func (x *BreakpointCondition) Free() { | |
| 130 | + | core.LazyRegister(&xBreakpointConditionFree, "ADW", "adw_breakpoint_condition_free", false) | |
| 131 | + | ||
| 120 | 132 | xBreakpointConditionFree(x.GoPointer()) | |
| 121 | 133 | } | |
| 122 | 134 | ||
| @@ -126,6 +138,8 @@ var xBreakpointConditionToString func(uintptr) string | |||
| 126 | 138 | // | |
| 127 | 139 | // The returned string can be parsed by [func@BreakpointCondition.parse]. | |
| 128 | 140 | func (x *BreakpointCondition) ToString() string { | |
| 141 | + | core.LazyRegister(&xBreakpointConditionToString, "ADW", "adw_breakpoint_condition_to_string", false) | |
| 142 | + | ||
| 129 | 143 | cret := xBreakpointConditionToString(x.GoPointer()) | |
| 130 | 144 | return cret | |
| 131 | 145 | } | |
| @@ -140,6 +154,7 @@ type BreakpointConditionLengthType int | |||
| 140 | 154 | var xBreakpointConditionLengthTypeGLibType func() types.GType | |
| 141 | 155 | ||
| 142 | 156 | func BreakpointConditionLengthTypeGLibType() types.GType { | |
| 157 | + | core.LazyRegister(&xBreakpointConditionLengthTypeGLibType, "ADW", "adw_breakpoint_condition_length_type_get_type", false) | |
| 143 | 158 | return xBreakpointConditionLengthTypeGLibType() | |
| 144 | 159 | } | |
| 145 | 160 | ||
| @@ -169,6 +184,7 @@ type BreakpointConditionRatioType int | |||
| 169 | 184 | var xBreakpointConditionRatioTypeGLibType func() types.GType | |
| 170 | 185 | ||
| 171 | 186 | func BreakpointConditionRatioTypeGLibType() types.GType { | |
| 187 | + | core.LazyRegister(&xBreakpointConditionRatioTypeGLibType, "ADW", "adw_breakpoint_condition_ratio_type_get_type", false) | |
| 172 | 188 | return xBreakpointConditionRatioTypeGLibType() | |
| 173 | 189 | } | |
| 174 | 190 | ||
| @@ -240,6 +256,8 @@ var xBreakpointConditionParse func(string) uintptr | |||
| 240 | 256 | // | |
| 241 | 257 | // If parentheses are omitted, the first operator takes priority. | |
| 242 | 258 | func BreakpointConditionParse(StrVar string) *BreakpointCondition { | |
| 259 | + | core.LazyRegister(&xBreakpointConditionParse, "ADW", "adw_breakpoint_condition_parse", false) | |
| 260 | + | ||
| 243 | 261 | cret := xBreakpointConditionParse(StrVar) | |
| 244 | 262 | if cret == 0 { | |
| 245 | 263 | return nil | |
| @@ -302,6 +320,7 @@ type Breakpoint struct { | |||
| 302 | 320 | var xBreakpointGLibType func() types.GType | |
| 303 | 321 | ||
| 304 | 322 | func BreakpointGLibType() types.GType { | |
| 323 | + | core.LazyRegister(&xBreakpointGLibType, "ADW", "adw_breakpoint_get_type", false) | |
| 305 | 324 | return xBreakpointGLibType() | |
| 306 | 325 | } | |
| 307 | 326 | ||
| @@ -315,6 +334,7 @@ var xNewBreakpoint func(*BreakpointCondition) uintptr | |||
| 315 | 334 | ||
| 316 | 335 | // Creates a new `AdwBreakpoint` with @condition. | |
| 317 | 336 | func NewBreakpoint(ConditionVar *BreakpointCondition) *Breakpoint { | |
| 337 | + | core.LazyRegister(&xNewBreakpoint, "ADW", "adw_breakpoint_new", false) | |
| 318 | 338 | var cls *Breakpoint | |
| 319 | 339 | ||
| 320 | 340 | cret := xNewBreakpoint(ConditionVar) | |
| @@ -373,6 +393,8 @@ var xBreakpointAddSetter func(uintptr, uintptr, string, *gobject.Value) | |||
| 373 | 393 | // | |
| 374 | 394 | // ``` | |
| 375 | 395 | func (x *Breakpoint) AddSetter(ObjectVar *gobject.Object, PropertyVar string, ValueVar *gobject.Value) { | |
| 396 | + | core.LazyRegister(&xBreakpointAddSetter, "ADW", "adw_breakpoint_add_setter", false) | |
| 397 | + | ||
| 376 | 398 | xBreakpointAddSetter(x.GoPointer(), ObjectVar.GoPointer(), PropertyVar, ValueVar) | |
| 377 | 399 | } | |
| 378 | 400 | ||
| @@ -394,6 +416,8 @@ var xBreakpointAddSetters func(uintptr, uintptr, string, ...interface{}) | |||
| 394 | 416 | // | |
| 395 | 417 | // ``` | |
| 396 | 418 | func (x *Breakpoint) AddSetters(FirstObjectVar *gobject.Object, FirstPropertyVar string, varArgs ...interface{}) { | |
| 419 | + | core.LazyRegister(&xBreakpointAddSetters, "ADW", "adw_breakpoint_add_setters", false) | |
| 420 | + | ||
| 397 | 421 | xBreakpointAddSetters(x.GoPointer(), FirstObjectVar.GoPointer(), FirstPropertyVar, varArgs...) | |
| 398 | 422 | } | |
| 399 | 423 | ||
| @@ -403,6 +427,8 @@ var xBreakpointAddSettersValist func(uintptr, uintptr, string, []interface{}) | |||
| 403 | 427 | // | |
| 404 | 428 | // See [method@Breakpoint.add_setters]. | |
| 405 | 429 | func (x *Breakpoint) AddSettersValist(FirstObjectVar *gobject.Object, FirstPropertyVar string, ArgsVar []interface{}) { | |
| 430 | + | core.LazyRegister(&xBreakpointAddSettersValist, "ADW", "adw_breakpoint_add_setters_valist", false) | |
| 431 | + | ||
| 406 | 432 | xBreakpointAddSettersValist(x.GoPointer(), FirstObjectVar.GoPointer(), FirstPropertyVar, ArgsVar) | |
| 407 | 433 | } | |
| 408 | 434 | ||
| @@ -416,6 +442,8 @@ var xBreakpointAddSettersv func(uintptr, int, uintptr, []string, uintptr) | |||
| 416 | 442 | // | |
| 417 | 443 | // This function is meant to be used by language bindings. | |
| 418 | 444 | func (x *Breakpoint) AddSettersv(NSettersVar int, ObjectsVar uintptr, NamesVar []string, ValuesVar uintptr) { | |
| 445 | + | core.LazyRegister(&xBreakpointAddSettersv, "ADW", "adw_breakpoint_add_settersv", false) | |
| 446 | + | ||
| 419 | 447 | xBreakpointAddSettersv(x.GoPointer(), NSettersVar, ObjectsVar, NamesVar, ValuesVar) | |
| 420 | 448 | } | |
| 421 | 449 | ||
| @@ -423,6 +451,8 @@ var xBreakpointGetCondition func(uintptr) uintptr | |||
| 423 | 451 | ||
| 424 | 452 | // Gets the condition for @self. | |
| 425 | 453 | func (x *Breakpoint) GetCondition() *BreakpointCondition { | |
| 454 | + | core.LazyRegister(&xBreakpointGetCondition, "ADW", "adw_breakpoint_get_condition", false) | |
| 455 | + | ||
| 426 | 456 | cret := xBreakpointGetCondition(x.GoPointer()) | |
| 427 | 457 | if cret == 0 { | |
| 428 | 458 | return nil | |
| @@ -434,6 +464,8 @@ var xBreakpointSetCondition func(uintptr, *BreakpointCondition) | |||
| 434 | 464 | ||
| 435 | 465 | // Sets the condition for @self. | |
| 436 | 466 | func (x *Breakpoint) SetCondition(ConditionVar *BreakpointCondition) { | |
| 467 | + | core.LazyRegister(&xBreakpointSetCondition, "ADW", "adw_breakpoint_set_condition", false) | |
| 468 | + | ||
| 437 | 469 | xBreakpointSetCondition(x.GoPointer(), ConditionVar) | |
| 438 | 470 | } | |
| 439 | 471 | ||
| @@ -527,40 +559,4 @@ func (x *Breakpoint) GetBuildableId() string { | |||
| 527 | 559 | func init() { | |
| 528 | 560 | core.SetPackageName("ADW", "libadwaita-1") | |
| 529 | 561 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | |
| 530 | - | var libs []uintptr | |
| 531 | - | for _, libPath := range core.GetPaths("ADW") { | |
| 532 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 533 | - | if err != nil { | |
| 534 | - | panic(err) | |
| 535 | - | } | |
| 536 | - | libs = append(libs, lib) | |
| 537 | - | } | |
| 538 | - | ||
| 539 | - | core.PuregoSafeRegister(&xBreakpointConditionLengthTypeGLibType, libs, "adw_breakpoint_condition_length_type_get_type") | |
| 540 | - | ||
| 541 | - | core.PuregoSafeRegister(&xBreakpointConditionRatioTypeGLibType, libs, "adw_breakpoint_condition_ratio_type_get_type") | |
| 542 | - | ||
| 543 | - | core.PuregoSafeRegister(&xBreakpointConditionParse, libs, "adw_breakpoint_condition_parse") | |
| 544 | - | ||
| 545 | - | core.PuregoSafeRegister(&xBreakpointConditionGLibType, libs, "adw_breakpoint_condition_get_type") | |
| 546 | - | ||
| 547 | - | core.PuregoSafeRegister(&xNewBreakpointConditionAnd, libs, "adw_breakpoint_condition_new_and") | |
| 548 | - | core.PuregoSafeRegister(&xNewBreakpointConditionLength, libs, "adw_breakpoint_condition_new_length") | |
| 549 | - | core.PuregoSafeRegister(&xNewBreakpointConditionOr, libs, "adw_breakpoint_condition_new_or") | |
| 550 | - | core.PuregoSafeRegister(&xNewBreakpointConditionRatio, libs, "adw_breakpoint_condition_new_ratio") | |
| 551 | - | ||
| 552 | - | core.PuregoSafeRegister(&xBreakpointConditionCopy, libs, "adw_breakpoint_condition_copy") | |
| 553 | - | core.PuregoSafeRegister(&xBreakpointConditionFree, libs, "adw_breakpoint_condition_free") | |
| 554 | - | core.PuregoSafeRegister(&xBreakpointConditionToString, libs, "adw_breakpoint_condition_to_string") | |
| 555 | - | ||
| 556 | - | core.PuregoSafeRegister(&xBreakpointGLibType, libs, "adw_breakpoint_get_type") | |
| 557 | - | ||
| 558 | - | core.PuregoSafeRegister(&xNewBreakpoint, libs, "adw_breakpoint_new") | |
| 559 | - | ||
| 560 | - | core.PuregoSafeRegister(&xBreakpointAddSetter, libs, "adw_breakpoint_add_setter") | |
| 561 | - | core.PuregoSafeRegister(&xBreakpointAddSetters, libs, "adw_breakpoint_add_setters") | |
| 562 | - | core.PuregoSafeRegister(&xBreakpointAddSettersValist, libs, "adw_breakpoint_add_setters_valist") | |
| 563 | - | core.PuregoSafeRegister(&xBreakpointAddSettersv, libs, "adw_breakpoint_add_settersv") | |
| 564 | - | core.PuregoSafeRegister(&xBreakpointGetCondition, libs, "adw_breakpoint_get_condition") | |
| 565 | - | core.PuregoSafeRegister(&xBreakpointSetCondition, libs, "adw_breakpoint_set_condition") | |
| 566 | 562 | } | |
| @@ -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" | ||
| @@ -39,6 +38,7 @@ type BreakpointCondition struct { | |||||
| 39 | var xBreakpointConditionGLibType func() types.GType | 38 | var xBreakpointConditionGLibType func() types.GType | ||
| 40 | 39 | ||||
| 41 | func BreakpointConditionGLibType() types.GType { | 40 | func BreakpointConditionGLibType() types.GType { | ||
| 41 | + | core.LazyRegister(&xBreakpointConditionGLibType, "ADW", "adw_breakpoint_condition_get_type", false) | |||
| 42 | return xBreakpointConditionGLibType() | 42 | return xBreakpointConditionGLibType() | ||
| 43 | } | 43 | } | ||
| 44 | 44 | ||||
| @@ -59,6 +59,8 @@ var xNewBreakpointConditionAnd func(*BreakpointCondition, *BreakpointCondition) | |||||
| 59 | // Creates a condition that triggers when @condition_1 and @condition_2 are both | 59 | // Creates a condition that triggers when @condition_1 and @condition_2 are both | ||
| 60 | // true. | 60 | // true. | ||
| 61 | func NewBreakpointConditionAnd(Condition1Var *BreakpointCondition, Condition2Var *BreakpointCondition) *BreakpointCondition { | 61 | func NewBreakpointConditionAnd(Condition1Var *BreakpointCondition, Condition2Var *BreakpointCondition) *BreakpointCondition { | ||
| 62 | + | core.LazyRegister(&xNewBreakpointConditionAnd, "ADW", "adw_breakpoint_condition_new_and", false) | |||
| 63 | + | ||||
| 62 | cret := xNewBreakpointConditionAnd(Condition1Var, Condition2Var) | 64 | cret := xNewBreakpointConditionAnd(Condition1Var, Condition2Var) | ||
| 63 | if cret == 0 { | 65 | if cret == 0 { | ||
| 64 | return nil | 66 | return nil | ||
| @@ -70,6 +72,8 @@ var xNewBreakpointConditionLength func(BreakpointConditionLengthType, float64, L | |||||
| 70 | 72 | ||||
| 71 | // Creates a condition that triggers on length changes. | 73 | // Creates a condition that triggers on length changes. | ||
| 72 | func NewBreakpointConditionLength(TypeVar BreakpointConditionLengthType, ValueVar float64, UnitVar LengthUnit) *BreakpointCondition { | 74 | func NewBreakpointConditionLength(TypeVar BreakpointConditionLengthType, ValueVar float64, UnitVar LengthUnit) *BreakpointCondition { | ||
| 75 | + | core.LazyRegister(&xNewBreakpointConditionLength, "ADW", "adw_breakpoint_condition_new_length", false) | |||
| 76 | + | ||||
| 73 | cret := xNewBreakpointConditionLength(TypeVar, ValueVar, UnitVar) | 77 | cret := xNewBreakpointConditionLength(TypeVar, ValueVar, UnitVar) | ||
| 74 | if cret == 0 { | 78 | if cret == 0 { | ||
| 75 | return nil | 79 | return nil | ||
| @@ -82,6 +86,8 @@ var xNewBreakpointConditionOr func(*BreakpointCondition, *BreakpointCondition) u | |||||
| 82 | // Creates a condition that triggers when either @condition_1 or @condition_2 is | 86 | // Creates a condition that triggers when either @condition_1 or @condition_2 is | ||
| 83 | // true. | 87 | // true. | ||
| 84 | func NewBreakpointConditionOr(Condition1Var *BreakpointCondition, Condition2Var *BreakpointCondition) *BreakpointCondition { | 88 | func NewBreakpointConditionOr(Condition1Var *BreakpointCondition, Condition2Var *BreakpointCondition) *BreakpointCondition { | ||
| 89 | + | core.LazyRegister(&xNewBreakpointConditionOr, "ADW", "adw_breakpoint_condition_new_or", false) | |||
| 90 | + | ||||
| 85 | cret := xNewBreakpointConditionOr(Condition1Var, Condition2Var) | 91 | cret := xNewBreakpointConditionOr(Condition1Var, Condition2Var) | ||
| 86 | if cret == 0 { | 92 | if cret == 0 { | ||
| 87 | return nil | 93 | return nil | ||
| @@ -95,6 +101,8 @@ var xNewBreakpointConditionRatio func(BreakpointConditionRatioType, int, int) ui | |||||
| 95 | // | 101 | // | ||
| 96 | // The ratio is represented as @width divided by @height. | 102 | // The ratio is represented as @width divided by @height. | ||
| 97 | func NewBreakpointConditionRatio(TypeVar BreakpointConditionRatioType, WidthVar int, HeightVar int) *BreakpointCondition { | 103 | func NewBreakpointConditionRatio(TypeVar BreakpointConditionRatioType, WidthVar int, HeightVar int) *BreakpointCondition { | ||
| 104 | + | core.LazyRegister(&xNewBreakpointConditionRatio, "ADW", "adw_breakpoint_condition_new_ratio", false) | |||
| 105 | + | ||||
| 98 | cret := xNewBreakpointConditionRatio(TypeVar, WidthVar, HeightVar) | 106 | cret := xNewBreakpointConditionRatio(TypeVar, WidthVar, HeightVar) | ||
| 99 | if cret == 0 { | 107 | if cret == 0 { | ||
| 100 | return nil | 108 | return nil | ||
| @@ -106,6 +114,8 @@ var xBreakpointConditionCopy func(uintptr) uintptr | |||||
| 106 | 114 | ||||
| 107 | // Copies @self. | 115 | // Copies @self. | ||
| 108 | func (x *BreakpointCondition) Copy() *BreakpointCondition { | 116 | func (x *BreakpointCondition) Copy() *BreakpointCondition { | ||
| 117 | + | core.LazyRegister(&xBreakpointConditionCopy, "ADW", "adw_breakpoint_condition_copy", false) | |||
| 118 | + | ||||
| 109 | cret := xBreakpointConditionCopy(x.GoPointer()) | 119 | cret := xBreakpointConditionCopy(x.GoPointer()) | ||
| 110 | if cret == 0 { | 120 | if cret == 0 { | ||
| 111 | return nil | 121 | return nil | ||
| @@ -117,6 +127,8 @@ var xBreakpointConditionFree func(uintptr) | |||||
| 117 | 127 | ||||
| 118 | // Frees @self. | 128 | // Frees @self. | ||
| 119 | func (x *BreakpointCondition) Free() { | 129 | func (x *BreakpointCondition) Free() { | ||
| 130 | + | core.LazyRegister(&xBreakpointConditionFree, "ADW", "adw_breakpoint_condition_free", false) | |||
| 131 | + | ||||
| 120 | xBreakpointConditionFree(x.GoPointer()) | 132 | xBreakpointConditionFree(x.GoPointer()) | ||
| 121 | } | 133 | } | ||
| 122 | 134 | ||||
| @@ -126,6 +138,8 @@ var xBreakpointConditionToString func(uintptr) string | |||||
| 126 | // | 138 | // | ||
| 127 | // The returned string can be parsed by [func@BreakpointCondition.parse]. | 139 | // The returned string can be parsed by [func@BreakpointCondition.parse]. | ||
| 128 | func (x *BreakpointCondition) ToString() string { | 140 | func (x *BreakpointCondition) ToString() string { | ||
| 141 | + | core.LazyRegister(&xBreakpointConditionToString, "ADW", "adw_breakpoint_condition_to_string", false) | |||
| 142 | + | ||||
| 129 | cret := xBreakpointConditionToString(x.GoPointer()) | 143 | cret := xBreakpointConditionToString(x.GoPointer()) | ||
| 130 | return cret | 144 | return cret | ||
| 131 | } | 145 | } | ||
| @@ -140,6 +154,7 @@ type BreakpointConditionLengthType int | |||||
| 140 | var xBreakpointConditionLengthTypeGLibType func() types.GType | 154 | var xBreakpointConditionLengthTypeGLibType func() types.GType | ||
| 141 | 155 | ||||
| 142 | func BreakpointConditionLengthTypeGLibType() types.GType { | 156 | func BreakpointConditionLengthTypeGLibType() types.GType { | ||
| 157 | + | core.LazyRegister(&xBreakpointConditionLengthTypeGLibType, "ADW", "adw_breakpoint_condition_length_type_get_type", false) | |||
| 143 | return xBreakpointConditionLengthTypeGLibType() | 158 | return xBreakpointConditionLengthTypeGLibType() | ||
| 144 | } | 159 | } | ||
| 145 | 160 | ||||
| @@ -169,6 +184,7 @@ type BreakpointConditionRatioType int | |||||
| 169 | var xBreakpointConditionRatioTypeGLibType func() types.GType | 184 | var xBreakpointConditionRatioTypeGLibType func() types.GType | ||
| 170 | 185 | ||||
| 171 | func BreakpointConditionRatioTypeGLibType() types.GType { | 186 | func BreakpointConditionRatioTypeGLibType() types.GType { | ||
| 187 | + | core.LazyRegister(&xBreakpointConditionRatioTypeGLibType, "ADW", "adw_breakpoint_condition_ratio_type_get_type", false) | |||
| 172 | return xBreakpointConditionRatioTypeGLibType() | 188 | return xBreakpointConditionRatioTypeGLibType() | ||
| 173 | } | 189 | } | ||
| 174 | 190 | ||||
| @@ -240,6 +256,8 @@ var xBreakpointConditionParse func(string) uintptr | |||||
| 240 | // | 256 | // | ||
| 241 | // If parentheses are omitted, the first operator takes priority. | 257 | // If parentheses are omitted, the first operator takes priority. | ||
| 242 | func BreakpointConditionParse(StrVar string) *BreakpointCondition { | 258 | func BreakpointConditionParse(StrVar string) *BreakpointCondition { | ||
| 259 | + | core.LazyRegister(&xBreakpointConditionParse, "ADW", "adw_breakpoint_condition_parse", false) | |||
| 260 | + | ||||
| 243 | cret := xBreakpointConditionParse(StrVar) | 261 | cret := xBreakpointConditionParse(StrVar) | ||
| 244 | if cret == 0 { | 262 | if cret == 0 { | ||
| 245 | return nil | 263 | return nil | ||
| @@ -302,6 +320,7 @@ type Breakpoint struct { | |||||
| 302 | var xBreakpointGLibType func() types.GType | 320 | var xBreakpointGLibType func() types.GType | ||
| 303 | 321 | ||||
| 304 | func BreakpointGLibType() types.GType { | 322 | func BreakpointGLibType() types.GType { | ||
| 323 | + | core.LazyRegister(&xBreakpointGLibType, "ADW", "adw_breakpoint_get_type", false) | |||
| 305 | return xBreakpointGLibType() | 324 | return xBreakpointGLibType() | ||
| 306 | } | 325 | } | ||
| 307 | 326 | ||||
| @@ -315,6 +334,7 @@ var xNewBreakpoint func(*BreakpointCondition) uintptr | |||||
| 315 | 334 | ||||
| 316 | // Creates a new `AdwBreakpoint` with @condition. | 335 | // Creates a new `AdwBreakpoint` with @condition. | ||
| 317 | func NewBreakpoint(ConditionVar *BreakpointCondition) *Breakpoint { | 336 | func NewBreakpoint(ConditionVar *BreakpointCondition) *Breakpoint { | ||
| 337 | + | core.LazyRegister(&xNewBreakpoint, "ADW", "adw_breakpoint_new", false) | |||
| 318 | var cls *Breakpoint | 338 | var cls *Breakpoint | ||
| 319 | 339 | ||||
| 320 | cret := xNewBreakpoint(ConditionVar) | 340 | cret := xNewBreakpoint(ConditionVar) | ||
| @@ -373,6 +393,8 @@ var xBreakpointAddSetter func(uintptr, uintptr, string, *gobject.Value) | |||||
| 373 | // | 393 | // | ||
| 374 | // ``` | 394 | // ``` | ||
| 375 | func (x *Breakpoint) AddSetter(ObjectVar *gobject.Object, PropertyVar string, ValueVar *gobject.Value) { | 395 | func (x *Breakpoint) AddSetter(ObjectVar *gobject.Object, PropertyVar string, ValueVar *gobject.Value) { | ||
| 396 | + | core.LazyRegister(&xBreakpointAddSetter, "ADW", "adw_breakpoint_add_setter", false) | |||
| 397 | + | ||||
| 376 | xBreakpointAddSetter(x.GoPointer(), ObjectVar.GoPointer(), PropertyVar, ValueVar) | 398 | xBreakpointAddSetter(x.GoPointer(), ObjectVar.GoPointer(), PropertyVar, ValueVar) | ||
| 377 | } | 399 | } | ||
| 378 | 400 | ||||
| @@ -394,6 +416,8 @@ var xBreakpointAddSetters func(uintptr, uintptr, string, ...interface{}) | |||||
| 394 | // | 416 | // | ||
| 395 | // ``` | 417 | // ``` | ||
| 396 | func (x *Breakpoint) AddSetters(FirstObjectVar *gobject.Object, FirstPropertyVar string, varArgs ...interface{}) { | 418 | func (x *Breakpoint) AddSetters(FirstObjectVar *gobject.Object, FirstPropertyVar string, varArgs ...interface{}) { | ||
| 419 | + | core.LazyRegister(&xBreakpointAddSetters, "ADW", "adw_breakpoint_add_setters", false) | |||
| 420 | + | ||||
| 397 | xBreakpointAddSetters(x.GoPointer(), FirstObjectVar.GoPointer(), FirstPropertyVar, varArgs...) | 421 | xBreakpointAddSetters(x.GoPointer(), FirstObjectVar.GoPointer(), FirstPropertyVar, varArgs...) | ||
| 398 | } | 422 | } | ||
| 399 | 423 | ||||
| @@ -403,6 +427,8 @@ var xBreakpointAddSettersValist func(uintptr, uintptr, string, []interface{}) | |||||
| 403 | // | 427 | // | ||
| 404 | // See [method@Breakpoint.add_setters]. | 428 | // See [method@Breakpoint.add_setters]. | ||
| 405 | func (x *Breakpoint) AddSettersValist(FirstObjectVar *gobject.Object, FirstPropertyVar string, ArgsVar []interface{}) { | 429 | func (x *Breakpoint) AddSettersValist(FirstObjectVar *gobject.Object, FirstPropertyVar string, ArgsVar []interface{}) { | ||
| 430 | + | core.LazyRegister(&xBreakpointAddSettersValist, "ADW", "adw_breakpoint_add_setters_valist", false) | |||
| 431 | + | ||||
| 406 | xBreakpointAddSettersValist(x.GoPointer(), FirstObjectVar.GoPointer(), FirstPropertyVar, ArgsVar) | 432 | xBreakpointAddSettersValist(x.GoPointer(), FirstObjectVar.GoPointer(), FirstPropertyVar, ArgsVar) | ||
| 407 | } | 433 | } | ||
| 408 | 434 | ||||
| @@ -416,6 +442,8 @@ var xBreakpointAddSettersv func(uintptr, int, uintptr, []string, uintptr) | |||||
| 416 | // | 442 | // | ||
| 417 | // This function is meant to be used by language bindings. | 443 | // This function is meant to be used by language bindings. | ||
| 418 | func (x *Breakpoint) AddSettersv(NSettersVar int, ObjectsVar uintptr, NamesVar []string, ValuesVar uintptr) { | 444 | func (x *Breakpoint) AddSettersv(NSettersVar int, ObjectsVar uintptr, NamesVar []string, ValuesVar uintptr) { | ||
| 445 | + | core.LazyRegister(&xBreakpointAddSettersv, "ADW", "adw_breakpoint_add_settersv", false) | |||
| 446 | + | ||||
| 419 | xBreakpointAddSettersv(x.GoPointer(), NSettersVar, ObjectsVar, NamesVar, ValuesVar) | 447 | xBreakpointAddSettersv(x.GoPointer(), NSettersVar, ObjectsVar, NamesVar, ValuesVar) | ||
| 420 | } | 448 | } | ||
| 421 | 449 | ||||
| @@ -423,6 +451,8 @@ var xBreakpointGetCondition func(uintptr) uintptr | |||||
| 423 | 451 | ||||
| 424 | // Gets the condition for @self. | 452 | // Gets the condition for @self. | ||
| 425 | func (x *Breakpoint) GetCondition() *BreakpointCondition { | 453 | func (x *Breakpoint) GetCondition() *BreakpointCondition { | ||
| 454 | + | core.LazyRegister(&xBreakpointGetCondition, "ADW", "adw_breakpoint_get_condition", false) | |||
| 455 | + | ||||
| 426 | cret := xBreakpointGetCondition(x.GoPointer()) | 456 | cret := xBreakpointGetCondition(x.GoPointer()) | ||
| 427 | if cret == 0 { | 457 | if cret == 0 { | ||
| 428 | return nil | 458 | return nil | ||
| @@ -434,6 +464,8 @@ var xBreakpointSetCondition func(uintptr, *BreakpointCondition) | |||||
| 434 | 464 | ||||
| 435 | // Sets the condition for @self. | 465 | // Sets the condition for @self. | ||
| 436 | func (x *Breakpoint) SetCondition(ConditionVar *BreakpointCondition) { | 466 | func (x *Breakpoint) SetCondition(ConditionVar *BreakpointCondition) { | ||
| 467 | + | core.LazyRegister(&xBreakpointSetCondition, "ADW", "adw_breakpoint_set_condition", false) | |||
| 468 | + | ||||
| 437 | xBreakpointSetCondition(x.GoPointer(), ConditionVar) | 469 | xBreakpointSetCondition(x.GoPointer(), ConditionVar) | ||
| 438 | } | 470 | } | ||
| 439 | 471 | ||||
| @@ -527,40 +559,4 @@ func (x *Breakpoint) GetBuildableId() string { | |||||
| 527 | func init() { | 559 | func init() { | ||
| 528 | core.SetPackageName("ADW", "libadwaita-1") | 560 | core.SetPackageName("ADW", "libadwaita-1") | ||
| 529 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | 561 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | ||
| 530 | - | var libs []uintptr | |||
| 531 | - | for _, libPath := range core.GetPaths("ADW") { | |||
| 532 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 533 | - | if err != nil { | |||
| 534 | - | panic(err) | |||
| 535 | - | } | |||
| 536 | - | libs = append(libs, lib) | |||
| 537 | - | } | |||
| 538 | - | ||||
| 539 | - | core.PuregoSafeRegister(&xBreakpointConditionLengthTypeGLibType, libs, "adw_breakpoint_condition_length_type_get_type") | |||
| 540 | - | ||||
| 541 | - | core.PuregoSafeRegister(&xBreakpointConditionRatioTypeGLibType, libs, "adw_breakpoint_condition_ratio_type_get_type") | |||
| 542 | - | ||||
| 543 | - | core.PuregoSafeRegister(&xBreakpointConditionParse, libs, "adw_breakpoint_condition_parse") | |||
| 544 | - | ||||
| 545 | - | core.PuregoSafeRegister(&xBreakpointConditionGLibType, libs, "adw_breakpoint_condition_get_type") | |||
| 546 | - | ||||
| 547 | - | core.PuregoSafeRegister(&xNewBreakpointConditionAnd, libs, "adw_breakpoint_condition_new_and") | |||
| 548 | - | core.PuregoSafeRegister(&xNewBreakpointConditionLength, libs, "adw_breakpoint_condition_new_length") | |||
| 549 | - | core.PuregoSafeRegister(&xNewBreakpointConditionOr, libs, "adw_breakpoint_condition_new_or") | |||
| 550 | - | core.PuregoSafeRegister(&xNewBreakpointConditionRatio, libs, "adw_breakpoint_condition_new_ratio") | |||
| 551 | - | ||||
| 552 | - | core.PuregoSafeRegister(&xBreakpointConditionCopy, libs, "adw_breakpoint_condition_copy") | |||
| 553 | - | core.PuregoSafeRegister(&xBreakpointConditionFree, libs, "adw_breakpoint_condition_free") | |||
| 554 | - | core.PuregoSafeRegister(&xBreakpointConditionToString, libs, "adw_breakpoint_condition_to_string") | |||
| 555 | - | ||||
| 556 | - | core.PuregoSafeRegister(&xBreakpointGLibType, libs, "adw_breakpoint_get_type") | |||
| 557 | - | ||||
| 558 | - | core.PuregoSafeRegister(&xNewBreakpoint, libs, "adw_breakpoint_new") | |||
| 559 | - | ||||
| 560 | - | core.PuregoSafeRegister(&xBreakpointAddSetter, libs, "adw_breakpoint_add_setter") | |||
| 561 | - | core.PuregoSafeRegister(&xBreakpointAddSetters, libs, "adw_breakpoint_add_setters") | |||
| 562 | - | core.PuregoSafeRegister(&xBreakpointAddSettersValist, libs, "adw_breakpoint_add_setters_valist") | |||
| 563 | - | core.PuregoSafeRegister(&xBreakpointAddSettersv, libs, "adw_breakpoint_add_settersv") | |||
| 564 | - | core.PuregoSafeRegister(&xBreakpointGetCondition, libs, "adw_breakpoint_get_condition") | |||
| 565 | - | core.PuregoSafeRegister(&xBreakpointSetCondition, libs, "adw_breakpoint_set_condition") | |||
| 566 | } | 562 | } | ||