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
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | package adw | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | + | "github.com/bnema/purego" | |
| 5 | 6 | "github.com/bnema/puregotk/pkg/core" | |
| 6 | 7 | "github.com/bnema/puregotk/v4/gdk" | |
| 7 | 8 | "github.com/bnema/puregotk/v4/gobject/types" | |
| @@ -13,7 +14,6 @@ type AccentColor int | |||
| 13 | 14 | var xAccentColorGLibType func() types.GType | |
| 14 | 15 | ||
| 15 | 16 | func AccentColorGLibType() types.GType { | |
| 16 | - | core.LazyRegister(&xAccentColorGLibType, "ADW", "adw_accent_color_get_type", false) | |
| 17 | 17 | return xAccentColorGLibType() | |
| 18 | 18 | } | |
| 19 | 19 | ||
| @@ -45,8 +45,6 @@ var xAccentColorToRgba func(AccentColor, *gdk.RGBA) | |||
| 45 | 45 | // | |
| 46 | 46 | // The matching foreground color is white. | |
| 47 | 47 | func AccentColorToRgba(SelfVar AccentColor, RgbaVar *gdk.RGBA) { | |
| 48 | - | core.LazyRegister(&xAccentColorToRgba, "ADW", "adw_accent_color_to_rgba", false) | |
| 49 | - | ||
| 50 | 48 | xAccentColorToRgba(SelfVar, RgbaVar) | |
| 51 | 49 | } | |
| 52 | 50 | ||
| @@ -57,8 +55,6 @@ var xAccentColorToStandaloneRgba func(AccentColor, bool, *gdk.RGBA) | |||
| 57 | 55 | // It will typically be darker for light background, and lighter for dark | |
| 58 | 56 | // background, ensuring contrast. | |
| 59 | 57 | func AccentColorToStandaloneRgba(SelfVar AccentColor, DarkVar bool, RgbaVar *gdk.RGBA) { | |
| 60 | - | core.LazyRegister(&xAccentColorToStandaloneRgba, "ADW", "adw_accent_color_to_standalone_rgba", false) | |
| 61 | - | ||
| 62 | 58 | xAccentColorToStandaloneRgba(SelfVar, DarkVar, RgbaVar) | |
| 63 | 59 | } | |
| 64 | 60 | ||
| @@ -69,12 +65,24 @@ var xRgbaToStandalone func(*gdk.RGBA, bool, *gdk.RGBA) | |||
| 69 | 65 | // It will typically be darker for light background, and lighter for dark | |
| 70 | 66 | // background, ensuring contrast. | |
| 71 | 67 | func RgbaToStandalone(RgbaVar *gdk.RGBA, DarkVar bool, StandaloneRgbaVar *gdk.RGBA) { | |
| 72 | - | core.LazyRegister(&xRgbaToStandalone, "ADW", "adw_rgba_to_standalone", false) | |
| 73 | - | ||
| 74 | 68 | xRgbaToStandalone(RgbaVar, DarkVar, StandaloneRgbaVar) | |
| 75 | 69 | } | |
| 76 | 70 | ||
| 77 | 71 | func init() { | |
| 78 | 72 | core.SetPackageName("ADW", "libadwaita-1") | |
| 79 | 73 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | |
| 74 | + | var libs []uintptr | |
| 75 | + | for _, libPath := range core.GetPaths("ADW") { | |
| 76 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 77 | + | if err != nil { | |
| 78 | + | panic(err) | |
| 79 | + | } | |
| 80 | + | libs = append(libs, lib) | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | core.PuregoSafeRegister(&xAccentColorGLibType, libs, "adw_accent_color_get_type") | |
| 84 | + | ||
| 85 | + | core.PuregoSafeRegister(&xAccentColorToRgba, libs, "adw_accent_color_to_rgba") | |
| 86 | + | core.PuregoSafeRegister(&xAccentColorToStandaloneRgba, libs, "adw_accent_color_to_standalone_rgba") | |
| 87 | + | core.PuregoSafeRegister(&xRgbaToStandalone, libs, "adw_rgba_to_standalone") | |
| 80 | 88 | } | |
| @@ -2,6 +2,7 @@ | |||||
| 2 | package adw | 2 | package adw | ||
| 3 | 3 | ||||
| 4 | import ( | 4 | import ( | ||
| 5 | + | "github.com/bnema/purego" | |||
| 5 | "github.com/bnema/puregotk/pkg/core" | 6 | "github.com/bnema/puregotk/pkg/core" | ||
| 6 | "github.com/bnema/puregotk/v4/gdk" | 7 | "github.com/bnema/puregotk/v4/gdk" | ||
| 7 | "github.com/bnema/puregotk/v4/gobject/types" | 8 | "github.com/bnema/puregotk/v4/gobject/types" | ||
| @@ -13,7 +14,6 @@ type AccentColor int | |||||
| 13 | var xAccentColorGLibType func() types.GType | 14 | var xAccentColorGLibType func() types.GType | ||
| 14 | 15 | ||||
| 15 | func AccentColorGLibType() types.GType { | 16 | func AccentColorGLibType() types.GType { | ||
| 16 | - | core.LazyRegister(&xAccentColorGLibType, "ADW", "adw_accent_color_get_type", false) | |||
| 17 | return xAccentColorGLibType() | 17 | return xAccentColorGLibType() | ||
| 18 | } | 18 | } | ||
| 19 | 19 | ||||
| @@ -45,8 +45,6 @@ var xAccentColorToRgba func(AccentColor, *gdk.RGBA) | |||||
| 45 | // | 45 | // | ||
| 46 | // The matching foreground color is white. | 46 | // The matching foreground color is white. | ||
| 47 | func AccentColorToRgba(SelfVar AccentColor, RgbaVar *gdk.RGBA) { | 47 | func AccentColorToRgba(SelfVar AccentColor, RgbaVar *gdk.RGBA) { | ||
| 48 | - | core.LazyRegister(&xAccentColorToRgba, "ADW", "adw_accent_color_to_rgba", false) | |||
| 49 | - | ||||
| 50 | xAccentColorToRgba(SelfVar, RgbaVar) | 48 | xAccentColorToRgba(SelfVar, RgbaVar) | ||
| 51 | } | 49 | } | ||
| 52 | 50 | ||||
| @@ -57,8 +55,6 @@ var xAccentColorToStandaloneRgba func(AccentColor, bool, *gdk.RGBA) | |||||
| 57 | // It will typically be darker for light background, and lighter for dark | 55 | // It will typically be darker for light background, and lighter for dark | ||
| 58 | // background, ensuring contrast. | 56 | // background, ensuring contrast. | ||
| 59 | func AccentColorToStandaloneRgba(SelfVar AccentColor, DarkVar bool, RgbaVar *gdk.RGBA) { | 57 | func AccentColorToStandaloneRgba(SelfVar AccentColor, DarkVar bool, RgbaVar *gdk.RGBA) { | ||
| 60 | - | core.LazyRegister(&xAccentColorToStandaloneRgba, "ADW", "adw_accent_color_to_standalone_rgba", false) | |||
| 61 | - | ||||
| 62 | xAccentColorToStandaloneRgba(SelfVar, DarkVar, RgbaVar) | 58 | xAccentColorToStandaloneRgba(SelfVar, DarkVar, RgbaVar) | ||
| 63 | } | 59 | } | ||
| 64 | 60 | ||||
| @@ -69,12 +65,24 @@ var xRgbaToStandalone func(*gdk.RGBA, bool, *gdk.RGBA) | |||||
| 69 | // It will typically be darker for light background, and lighter for dark | 65 | // It will typically be darker for light background, and lighter for dark | ||
| 70 | // background, ensuring contrast. | 66 | // background, ensuring contrast. | ||
| 71 | func RgbaToStandalone(RgbaVar *gdk.RGBA, DarkVar bool, StandaloneRgbaVar *gdk.RGBA) { | 67 | func RgbaToStandalone(RgbaVar *gdk.RGBA, DarkVar bool, StandaloneRgbaVar *gdk.RGBA) { | ||
| 72 | - | core.LazyRegister(&xRgbaToStandalone, "ADW", "adw_rgba_to_standalone", false) | |||
| 73 | - | ||||
| 74 | xRgbaToStandalone(RgbaVar, DarkVar, StandaloneRgbaVar) | 68 | xRgbaToStandalone(RgbaVar, DarkVar, StandaloneRgbaVar) | ||
| 75 | } | 69 | } | ||
| 76 | 70 | ||||
| 77 | func init() { | 71 | func init() { | ||
| 78 | core.SetPackageName("ADW", "libadwaita-1") | 72 | core.SetPackageName("ADW", "libadwaita-1") | ||
| 79 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | 73 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | ||
| 74 | + | var libs []uintptr | |||
| 75 | + | for _, libPath := range core.GetPaths("ADW") { | |||
| 76 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 77 | + | if err != nil { | |||
| 78 | + | panic(err) | |||
| 79 | + | } | |||
| 80 | + | libs = append(libs, lib) | |||
| 81 | + | } | |||
| 82 | + | ||||
| 83 | + | core.PuregoSafeRegister(&xAccentColorGLibType, libs, "adw_accent_color_get_type") | |||
| 84 | + | ||||
| 85 | + | core.PuregoSafeRegister(&xAccentColorToRgba, libs, "adw_accent_color_to_rgba") | |||
| 86 | + | core.PuregoSafeRegister(&xAccentColorToStandaloneRgba, libs, "adw_accent_color_to_standalone_rgba") | |||
| 87 | + | core.PuregoSafeRegister(&xRgbaToStandalone, libs, "adw_rgba_to_standalone") | |||
| 80 | } | 88 | } | ||