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 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spring-params.go +21 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-squeezer.go +44 -49 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-status-page.go +24 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-style-manager.go +28 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-swipe-tracker.go +30 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-swipeable.go +21 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-switch-row.go +16 -6 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-bar.go +32 -35 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-button.go +16 -5 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-overview.go +37 -45 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-view.go +87 -123 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-timed-animation.go +28 -30 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toast-overlay.go +18 -9 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toast.go +36 -41 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toggle-group.go +51 -64 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toolbar-view.go +35 -40 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-version.go +16 -7 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-stack.go +62 -78 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-bar.go +18 -9 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-sidebar.go +22 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-title.go +23 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher.go +20 -10 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-window-title.go +18 -10 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-window.go +22 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-wrap-box.go +46 -66 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-wrap-layout.go +46 -57 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/cairo/main.go +79 -36 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkapplaunchcontext.go +17 -10 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcairo.go +16 -12 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcairocontext.go +13 -3 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcicpparams.go +25 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkclipboard.go +32 -34 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcolorstate.go +16 -12
| @@ -4,6 +4,7 @@ package gdk | |||
| 4 | 4 | import ( | |
| 5 | 5 | "unsafe" | |
| 6 | 6 | ||
| 7 | + | "github.com/bnema/purego" | |
| 7 | 8 | "github.com/bnema/puregotk/pkg/core" | |
| 8 | 9 | ) | |
| 9 | 10 | ||
| @@ -13,8 +14,6 @@ var xColorStateGetOklab func() uintptr | |||
| 13 | 14 | // | |
| 14 | 15 | // This is a perceptually uniform color state. | |
| 15 | 16 | func ColorStateGetOklab() *ColorState { | |
| 16 | - | core.LazyRegister(&xColorStateGetOklab, "GDK", "gdk_color_state_get_oklab", false) | |
| 17 | - | ||
| 18 | 17 | cret := xColorStateGetOklab() | |
| 19 | 18 | if cret == 0 { | |
| 20 | 19 | return nil | |
| @@ -29,8 +28,6 @@ var xColorStateGetOklch func() uintptr | |||
| 29 | 28 | // This is the polar variant of oklab, in which the hue is encoded as | |
| 30 | 29 | // a polar coordinate. | |
| 31 | 30 | func ColorStateGetOklch() *ColorState { | |
| 32 | - | core.LazyRegister(&xColorStateGetOklch, "GDK", "gdk_color_state_get_oklch", false) | |
| 33 | - | ||
| 34 | 31 | cret := xColorStateGetOklch() | |
| 35 | 32 | if cret == 0 { | |
| 36 | 33 | return nil | |
| @@ -50,8 +47,6 @@ var xColorStateGetRec2100Linear func() uintptr | |||
| 50 | 47 | // See e.g. [the CSS HDR Module](https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-linear) | |
| 51 | 48 | // for details about this colorstate. | |
| 52 | 49 | func ColorStateGetRec2100Linear() *ColorState { | |
| 53 | - | core.LazyRegister(&xColorStateGetRec2100Linear, "GDK", "gdk_color_state_get_rec2100_linear", false) | |
| 54 | - | ||
| 55 | 50 | cret := xColorStateGetRec2100Linear() | |
| 56 | 51 | if cret == 0 { | |
| 57 | 52 | return nil | |
| @@ -71,8 +66,6 @@ var xColorStateGetRec2100Pq func() uintptr | |||
| 71 | 66 | // See e.g. [the CSS HDR Module](https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-pq) | |
| 72 | 67 | // for details about this colorstate. | |
| 73 | 68 | func ColorStateGetRec2100Pq() *ColorState { | |
| 74 | - | core.LazyRegister(&xColorStateGetRec2100Pq, "GDK", "gdk_color_state_get_rec2100_pq", false) | |
| 75 | - | ||
| 76 | 69 | cret := xColorStateGetRec2100Pq() | |
| 77 | 70 | if cret == 0 { | |
| 78 | 71 | return nil | |
| @@ -92,8 +85,6 @@ var xColorStateGetSrgb func() uintptr | |||
| 92 | 85 | // See e.g. [the CSS Color Module](https://www.w3.org/TR/css-color-4/#predefined-sRGB) | |
| 93 | 86 | // for details about this colorstate. | |
| 94 | 87 | func ColorStateGetSrgb() *ColorState { | |
| 95 | - | core.LazyRegister(&xColorStateGetSrgb, "GDK", "gdk_color_state_get_srgb", false) | |
| 96 | - | ||
| 97 | 88 | cret := xColorStateGetSrgb() | |
| 98 | 89 | if cret == 0 { | |
| 99 | 90 | return nil | |
| @@ -112,8 +103,6 @@ var xColorStateGetSrgbLinear func() uintptr | |||
| 112 | 103 | // See e.g. [the CSS Color Module](https://www.w3.org/TR/css-color-4/#predefined-sRGB-linear) | |
| 113 | 104 | // for details about this colorstate. | |
| 114 | 105 | func ColorStateGetSrgbLinear() *ColorState { | |
| 115 | - | core.LazyRegister(&xColorStateGetSrgbLinear, "GDK", "gdk_color_state_get_srgb_linear", false) | |
| 116 | - | ||
| 117 | 106 | cret := xColorStateGetSrgbLinear() | |
| 118 | 107 | if cret == 0 { | |
| 119 | 108 | return nil | |
| @@ -124,4 +113,19 @@ func ColorStateGetSrgbLinear() *ColorState { | |||
| 124 | 113 | func init() { | |
| 125 | 114 | core.SetPackageName("GDK", "gtk4") | |
| 126 | 115 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | |
| 116 | + | var libs []uintptr | |
| 117 | + | for _, libPath := range core.GetPaths("GDK") { | |
| 118 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 119 | + | if err != nil { | |
| 120 | + | panic(err) | |
| 121 | + | } | |
| 122 | + | libs = append(libs, lib) | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | core.PuregoSafeRegister(&xColorStateGetOklab, libs, "gdk_color_state_get_oklab") | |
| 126 | + | core.PuregoSafeRegister(&xColorStateGetOklch, libs, "gdk_color_state_get_oklch") | |
| 127 | + | core.PuregoSafeRegister(&xColorStateGetRec2100Linear, libs, "gdk_color_state_get_rec2100_linear") | |
| 128 | + | core.PuregoSafeRegister(&xColorStateGetRec2100Pq, libs, "gdk_color_state_get_rec2100_pq") | |
| 129 | + | core.PuregoSafeRegister(&xColorStateGetSrgb, libs, "gdk_color_state_get_srgb") | |
| 130 | + | core.PuregoSafeRegister(&xColorStateGetSrgbLinear, libs, "gdk_color_state_get_srgb_linear") | |
| 127 | 131 | } | |
| @@ -4,6 +4,7 @@ package gdk | |||||
| 4 | import ( | 4 | import ( | ||
| 5 | "unsafe" | 5 | "unsafe" | ||
| 6 | 6 | ||||
| 7 | + | "github.com/bnema/purego" | |||
| 7 | "github.com/bnema/puregotk/pkg/core" | 8 | "github.com/bnema/puregotk/pkg/core" | ||
| 8 | ) | 9 | ) | ||
| 9 | 10 | ||||
| @@ -13,8 +14,6 @@ var xColorStateGetOklab func() uintptr | |||||
| 13 | // | 14 | // | ||
| 14 | // This is a perceptually uniform color state. | 15 | // This is a perceptually uniform color state. | ||
| 15 | func ColorStateGetOklab() *ColorState { | 16 | func ColorStateGetOklab() *ColorState { | ||
| 16 | - | core.LazyRegister(&xColorStateGetOklab, "GDK", "gdk_color_state_get_oklab", false) | |||
| 17 | - | ||||
| 18 | cret := xColorStateGetOklab() | 17 | cret := xColorStateGetOklab() | ||
| 19 | if cret == 0 { | 18 | if cret == 0 { | ||
| 20 | return nil | 19 | return nil | ||
| @@ -29,8 +28,6 @@ var xColorStateGetOklch func() uintptr | |||||
| 29 | // This is the polar variant of oklab, in which the hue is encoded as | 28 | // This is the polar variant of oklab, in which the hue is encoded as | ||
| 30 | // a polar coordinate. | 29 | // a polar coordinate. | ||
| 31 | func ColorStateGetOklch() *ColorState { | 30 | func ColorStateGetOklch() *ColorState { | ||
| 32 | - | core.LazyRegister(&xColorStateGetOklch, "GDK", "gdk_color_state_get_oklch", false) | |||
| 33 | - | ||||
| 34 | cret := xColorStateGetOklch() | 31 | cret := xColorStateGetOklch() | ||
| 35 | if cret == 0 { | 32 | if cret == 0 { | ||
| 36 | return nil | 33 | return nil | ||
| @@ -50,8 +47,6 @@ var xColorStateGetRec2100Linear func() uintptr | |||||
| 50 | // See e.g. [the CSS HDR Module](https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-linear) | 47 | // See e.g. [the CSS HDR Module](https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-linear) | ||
| 51 | // for details about this colorstate. | 48 | // for details about this colorstate. | ||
| 52 | func ColorStateGetRec2100Linear() *ColorState { | 49 | func ColorStateGetRec2100Linear() *ColorState { | ||
| 53 | - | core.LazyRegister(&xColorStateGetRec2100Linear, "GDK", "gdk_color_state_get_rec2100_linear", false) | |||
| 54 | - | ||||
| 55 | cret := xColorStateGetRec2100Linear() | 50 | cret := xColorStateGetRec2100Linear() | ||
| 56 | if cret == 0 { | 51 | if cret == 0 { | ||
| 57 | return nil | 52 | return nil | ||
| @@ -71,8 +66,6 @@ var xColorStateGetRec2100Pq func() uintptr | |||||
| 71 | // See e.g. [the CSS HDR Module](https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-pq) | 66 | // See e.g. [the CSS HDR Module](https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-pq) | ||
| 72 | // for details about this colorstate. | 67 | // for details about this colorstate. | ||
| 73 | func ColorStateGetRec2100Pq() *ColorState { | 68 | func ColorStateGetRec2100Pq() *ColorState { | ||
| 74 | - | core.LazyRegister(&xColorStateGetRec2100Pq, "GDK", "gdk_color_state_get_rec2100_pq", false) | |||
| 75 | - | ||||
| 76 | cret := xColorStateGetRec2100Pq() | 69 | cret := xColorStateGetRec2100Pq() | ||
| 77 | if cret == 0 { | 70 | if cret == 0 { | ||
| 78 | return nil | 71 | return nil | ||
| @@ -92,8 +85,6 @@ var xColorStateGetSrgb func() uintptr | |||||
| 92 | // See e.g. [the CSS Color Module](https://www.w3.org/TR/css-color-4/#predefined-sRGB) | 85 | // See e.g. [the CSS Color Module](https://www.w3.org/TR/css-color-4/#predefined-sRGB) | ||
| 93 | // for details about this colorstate. | 86 | // for details about this colorstate. | ||
| 94 | func ColorStateGetSrgb() *ColorState { | 87 | func ColorStateGetSrgb() *ColorState { | ||
| 95 | - | core.LazyRegister(&xColorStateGetSrgb, "GDK", "gdk_color_state_get_srgb", false) | |||
| 96 | - | ||||
| 97 | cret := xColorStateGetSrgb() | 88 | cret := xColorStateGetSrgb() | ||
| 98 | if cret == 0 { | 89 | if cret == 0 { | ||
| 99 | return nil | 90 | return nil | ||
| @@ -112,8 +103,6 @@ var xColorStateGetSrgbLinear func() uintptr | |||||
| 112 | // See e.g. [the CSS Color Module](https://www.w3.org/TR/css-color-4/#predefined-sRGB-linear) | 103 | // See e.g. [the CSS Color Module](https://www.w3.org/TR/css-color-4/#predefined-sRGB-linear) | ||
| 113 | // for details about this colorstate. | 104 | // for details about this colorstate. | ||
| 114 | func ColorStateGetSrgbLinear() *ColorState { | 105 | func ColorStateGetSrgbLinear() *ColorState { | ||
| 115 | - | core.LazyRegister(&xColorStateGetSrgbLinear, "GDK", "gdk_color_state_get_srgb_linear", false) | |||
| 116 | - | ||||
| 117 | cret := xColorStateGetSrgbLinear() | 106 | cret := xColorStateGetSrgbLinear() | ||
| 118 | if cret == 0 { | 107 | if cret == 0 { | ||
| 119 | return nil | 108 | return nil | ||
| @@ -124,4 +113,19 @@ func ColorStateGetSrgbLinear() *ColorState { | |||||
| 124 | func init() { | 113 | func init() { | ||
| 125 | core.SetPackageName("GDK", "gtk4") | 114 | core.SetPackageName("GDK", "gtk4") | ||
| 126 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | 115 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | ||
| 116 | + | var libs []uintptr | |||
| 117 | + | for _, libPath := range core.GetPaths("GDK") { | |||
| 118 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 119 | + | if err != nil { | |||
| 120 | + | panic(err) | |||
| 121 | + | } | |||
| 122 | + | libs = append(libs, lib) | |||
| 123 | + | } | |||
| 124 | + | ||||
| 125 | + | core.PuregoSafeRegister(&xColorStateGetOklab, libs, "gdk_color_state_get_oklab") | |||
| 126 | + | core.PuregoSafeRegister(&xColorStateGetOklch, libs, "gdk_color_state_get_oklch") | |||
| 127 | + | core.PuregoSafeRegister(&xColorStateGetRec2100Linear, libs, "gdk_color_state_get_rec2100_linear") | |||
| 128 | + | core.PuregoSafeRegister(&xColorStateGetRec2100Pq, libs, "gdk_color_state_get_rec2100_pq") | |||
| 129 | + | core.PuregoSafeRegister(&xColorStateGetSrgb, libs, "gdk_color_state_get_srgb") | |||
| 130 | + | core.PuregoSafeRegister(&xColorStateGetSrgbLinear, libs, "gdk_color_state_get_srgb_linear") | |||
| 127 | } | 131 | } | ||