Merge pull request #350 from bnema/fix/repin-fixed-puregotk
fix(deps): validate puregotk lazy registration fix
907 files · +27874 -25296
M go.mod +3 -1
| @@ -11,7 +11,7 @@ require ( | |||
| 11 | 11 | github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a | |
| 12 | 12 | github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c | |
| 13 | 13 | github.com/bnema/purego-webp v0.2.1-0.20260714152238-7bc9c402fdf6 | |
| 14 | - | github.com/bnema/puregotk v0.7.0 | |
| 14 | + | github.com/bnema/puregotk v0.7.1-0.20260714200603-7370c78950ef | |
| 15 | 15 | github.com/charmbracelet/bubbles v1.0.0 | |
| 16 | 16 | github.com/charmbracelet/bubbletea v1.3.10 | |
| 17 | 17 | github.com/charmbracelet/lipgloss v1.1.0 | |
| @@ -47,6 +47,7 @@ require ( | |||
| 47 | 47 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | |
| 48 | 48 | github.com/fatih/color v1.19.0 // indirect | |
| 49 | 49 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | |
| 50 | + | github.com/google/go-cmp v0.7.0 // indirect | |
| 50 | 51 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | |
| 51 | 52 | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | |
| 52 | 53 | github.com/mattn/go-colorable v0.1.14 // indirect | |
| @@ -80,6 +81,7 @@ require ( | |||
| 80 | 81 | golang.org/x/text v0.40.0 // indirect | |
| 81 | 82 | golang.org/x/tools v0.47.0 // indirect | |
| 82 | 83 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | |
| 84 | + | mvdan.cc/gofumpt v0.9.2 // indirect | |
| 83 | 85 | ) | |
| 84 | 86 | ||
| 85 | 87 | tool github.com/a-h/templ/cmd/templ | |
| @@ -11,7 +11,7 @@ require ( | |||||
| 11 | github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a | 11 | github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a | ||
| 12 | github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c | 12 | github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c | ||
| 13 | github.com/bnema/purego-webp v0.2.1-0.20260714152238-7bc9c402fdf6 | 13 | github.com/bnema/purego-webp v0.2.1-0.20260714152238-7bc9c402fdf6 | ||
| 14 | - | github.com/bnema/puregotk v0.7.0 | 14 | + | github.com/bnema/puregotk v0.7.1-0.20260714200603-7370c78950ef |
| 15 | github.com/charmbracelet/bubbles v1.0.0 | 15 | github.com/charmbracelet/bubbles v1.0.0 | ||
| 16 | github.com/charmbracelet/bubbletea v1.3.10 | 16 | github.com/charmbracelet/bubbletea v1.3.10 | ||
| 17 | github.com/charmbracelet/lipgloss v1.1.0 | 17 | github.com/charmbracelet/lipgloss v1.1.0 | ||
| @@ -47,6 +47,7 @@ require ( | |||||
| 47 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | 47 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | ||
| 48 | github.com/fatih/color v1.19.0 // indirect | 48 | github.com/fatih/color v1.19.0 // indirect | ||
| 49 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | 49 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | ||
| 50 | + | github.com/google/go-cmp v0.7.0 // indirect | |||
| 50 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | 51 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
| 51 | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | 52 | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | ||
| 52 | github.com/mattn/go-colorable v0.1.14 // indirect | 53 | github.com/mattn/go-colorable v0.1.14 // indirect | ||
| @@ -80,6 +81,7 @@ require ( | |||||
| 80 | golang.org/x/text v0.40.0 // indirect | 81 | golang.org/x/text v0.40.0 // indirect | ||
| 81 | golang.org/x/tools v0.47.0 // indirect | 82 | golang.org/x/tools v0.47.0 // indirect | ||
| 82 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | 83 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | ||
| 84 | + | mvdan.cc/gofumpt v0.9.2 // indirect | |||
| 83 | ) | 85 | ) | ||
| 84 | 86 | ||||
| 85 | tool github.com/a-h/templ/cmd/templ | 87 | tool github.com/a-h/templ/cmd/templ | ||
M go.sum +4 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/internal/core/core.go +197 -4 generated file: collapsed
M vendor/github.com/bnema/puregotk/pkg/core/core.go +10 -0 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-about-dialog.go +99 -64 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-about-window.go +95 -62 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-accent-color.go +7 -15
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | package adw | |
| 3 | 3 | ||
| 4 | 4 | import ( | |
| 5 | - | "github.com/bnema/purego" | |
| 6 | 5 | "github.com/bnema/puregotk/pkg/core" | |
| 7 | 6 | "github.com/bnema/puregotk/v4/gdk" | |
| 8 | 7 | "github.com/bnema/puregotk/v4/gobject/types" | |
| @@ -14,6 +13,7 @@ type AccentColor int | |||
| 14 | 13 | var xAccentColorGLibType func() types.GType | |
| 15 | 14 | ||
| 16 | 15 | func AccentColorGLibType() types.GType { | |
| 16 | + | core.LazyRegister(&xAccentColorGLibType, "ADW", "adw_accent_color_get_type", false) | |
| 17 | 17 | return xAccentColorGLibType() | |
| 18 | 18 | } | |
| 19 | 19 | ||
| @@ -45,6 +45,8 @@ 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 | + | ||
| 48 | 50 | xAccentColorToRgba(SelfVar, RgbaVar) | |
| 49 | 51 | } | |
| 50 | 52 | ||
| @@ -55,6 +57,8 @@ var xAccentColorToStandaloneRgba func(AccentColor, bool, *gdk.RGBA) | |||
| 55 | 57 | // It will typically be darker for light background, and lighter for dark | |
| 56 | 58 | // background, ensuring contrast. | |
| 57 | 59 | func AccentColorToStandaloneRgba(SelfVar AccentColor, DarkVar bool, RgbaVar *gdk.RGBA) { | |
| 60 | + | core.LazyRegister(&xAccentColorToStandaloneRgba, "ADW", "adw_accent_color_to_standalone_rgba", false) | |
| 61 | + | ||
| 58 | 62 | xAccentColorToStandaloneRgba(SelfVar, DarkVar, RgbaVar) | |
| 59 | 63 | } | |
| 60 | 64 | ||
| @@ -65,24 +69,12 @@ var xRgbaToStandalone func(*gdk.RGBA, bool, *gdk.RGBA) | |||
| 65 | 69 | // It will typically be darker for light background, and lighter for dark | |
| 66 | 70 | // background, ensuring contrast. | |
| 67 | 71 | func RgbaToStandalone(RgbaVar *gdk.RGBA, DarkVar bool, StandaloneRgbaVar *gdk.RGBA) { | |
| 72 | + | core.LazyRegister(&xRgbaToStandalone, "ADW", "adw_rgba_to_standalone", false) | |
| 73 | + | ||
| 68 | 74 | xRgbaToStandalone(RgbaVar, DarkVar, StandaloneRgbaVar) | |
| 69 | 75 | } | |
| 70 | 76 | ||
| 71 | 77 | func init() { | |
| 72 | 78 | core.SetPackageName("ADW", "libadwaita-1") | |
| 73 | 79 | 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") | |
| 88 | 80 | } | |
| @@ -2,7 +2,6 @@ | |||||
| 2 | package adw | 2 | package adw | ||
| 3 | 3 | ||||
| 4 | import ( | 4 | import ( | ||
| 5 | - | "github.com/bnema/purego" | |||
| 6 | "github.com/bnema/puregotk/pkg/core" | 5 | "github.com/bnema/puregotk/pkg/core" | ||
| 7 | "github.com/bnema/puregotk/v4/gdk" | 6 | "github.com/bnema/puregotk/v4/gdk" | ||
| 8 | "github.com/bnema/puregotk/v4/gobject/types" | 7 | "github.com/bnema/puregotk/v4/gobject/types" | ||
| @@ -14,6 +13,7 @@ type AccentColor int | |||||
| 14 | var xAccentColorGLibType func() types.GType | 13 | var xAccentColorGLibType func() types.GType | ||
| 15 | 14 | ||||
| 16 | func AccentColorGLibType() types.GType { | 15 | 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,6 +45,8 @@ 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 | + | ||||
| 48 | xAccentColorToRgba(SelfVar, RgbaVar) | 50 | xAccentColorToRgba(SelfVar, RgbaVar) | ||
| 49 | } | 51 | } | ||
| 50 | 52 | ||||
| @@ -55,6 +57,8 @@ var xAccentColorToStandaloneRgba func(AccentColor, bool, *gdk.RGBA) | |||||
| 55 | // It will typically be darker for light background, and lighter for dark | 57 | // It will typically be darker for light background, and lighter for dark | ||
| 56 | // background, ensuring contrast. | 58 | // background, ensuring contrast. | ||
| 57 | func AccentColorToStandaloneRgba(SelfVar AccentColor, DarkVar bool, RgbaVar *gdk.RGBA) { | 59 | func AccentColorToStandaloneRgba(SelfVar AccentColor, DarkVar bool, RgbaVar *gdk.RGBA) { | ||
| 60 | + | core.LazyRegister(&xAccentColorToStandaloneRgba, "ADW", "adw_accent_color_to_standalone_rgba", false) | |||
| 61 | + | ||||
| 58 | xAccentColorToStandaloneRgba(SelfVar, DarkVar, RgbaVar) | 62 | xAccentColorToStandaloneRgba(SelfVar, DarkVar, RgbaVar) | ||
| 59 | } | 63 | } | ||
| 60 | 64 | ||||
| @@ -65,24 +69,12 @@ var xRgbaToStandalone func(*gdk.RGBA, bool, *gdk.RGBA) | |||||
| 65 | // It will typically be darker for light background, and lighter for dark | 69 | // It will typically be darker for light background, and lighter for dark | ||
| 66 | // background, ensuring contrast. | 70 | // background, ensuring contrast. | ||
| 67 | func RgbaToStandalone(RgbaVar *gdk.RGBA, DarkVar bool, StandaloneRgbaVar *gdk.RGBA) { | 71 | func RgbaToStandalone(RgbaVar *gdk.RGBA, DarkVar bool, StandaloneRgbaVar *gdk.RGBA) { | ||
| 72 | + | core.LazyRegister(&xRgbaToStandalone, "ADW", "adw_rgba_to_standalone", false) | |||
| 73 | + | ||||
| 68 | xRgbaToStandalone(RgbaVar, DarkVar, StandaloneRgbaVar) | 74 | xRgbaToStandalone(RgbaVar, DarkVar, StandaloneRgbaVar) | ||
| 69 | } | 75 | } | ||
| 70 | 76 | ||||
| 71 | func init() { | 77 | func init() { | ||
| 72 | core.SetPackageName("ADW", "libadwaita-1") | 78 | core.SetPackageName("ADW", "libadwaita-1") | ||
| 73 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | 79 | 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") | |||
| 88 | } | 80 | } | ||