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 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 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-button-content.go +18 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-button-row.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel-indicator-dots.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel-indicator-lines.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel.go +47 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp-layout.go +14 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp-scrollable.go +17 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp.go +17 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-combo-row.go +34 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-dialog.go +45 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-easing.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-entry-row.go +40 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-enum-list-model.go +13 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-expander-row.go +40 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-flap.go +61 -48 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-fold-threshold-policy.go +10 -1 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-header-bar.go +36 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-inline-view-switcher.go +18 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-layout-slot.go +4 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-layout.go +7 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-leaflet.go +69 -56 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-length-unit.go +5 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-main.go +5 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-message-dialog.go +63 -44 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-multi-layout-view.go +17 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-direction.go +10 -1 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-split-view.go +36 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-view.go +60 -49 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-overlay-split-view.go +48 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-password-entry-row.go +2 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-dialog.go +23 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-group.go +24 -26 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-page.go +38 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-row.go +18 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-window.go +31 -29 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcut-label.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-dialog.go +4 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-item.go +23 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-section.go +8 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar-item.go +45 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar-section.go +24 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar.go +41 -39 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spin-row.go +40 -34 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spinner-paintable.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spinner.go +2 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-split-button.go +39 -34 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spring-animation.go +34 -30 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spring-params.go +17 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-squeezer.go +49 -44 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-status-page.go +20 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-style-manager.go +25 -28
| @@ -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/gdk" | |
| 11 | 10 | "github.com/bnema/puregotk/v4/gobject" | |
| @@ -36,6 +35,7 @@ type ColorScheme int | |||
| 36 | 35 | var xColorSchemeGLibType func() types.GType | |
| 37 | 36 | ||
| 38 | 37 | func ColorSchemeGLibType() types.GType { | |
| 38 | + | core.LazyRegister(&xColorSchemeGLibType, "ADW", "adw_color_scheme_get_type", false) | |
| 39 | 39 | return xColorSchemeGLibType() | |
| 40 | 40 | } | |
| 41 | 41 | ||
| @@ -74,6 +74,7 @@ type StyleManager struct { | |||
| 74 | 74 | var xStyleManagerGLibType func() types.GType | |
| 75 | 75 | ||
| 76 | 76 | func StyleManagerGLibType() types.GType { | |
| 77 | + | core.LazyRegister(&xStyleManagerGLibType, "ADW", "adw_style_manager_get_type", false) | |
| 77 | 78 | return xStyleManagerGLibType() | |
| 78 | 79 | } | |
| 79 | 80 | ||
| @@ -89,6 +90,8 @@ var xStyleManagerGetAccentColor func(uintptr) AccentColor | |||
| 89 | 90 | // | |
| 90 | 91 | // See also [property@StyleManager:accent-color-rgba]. | |
| 91 | 92 | func (x *StyleManager) GetAccentColor() AccentColor { | |
| 93 | + | core.LazyRegister(&xStyleManagerGetAccentColor, "ADW", "adw_style_manager_get_accent_color", false) | |
| 94 | + | ||
| 92 | 95 | cret := xStyleManagerGetAccentColor(x.GoPointer()) | |
| 93 | 96 | return cret | |
| 94 | 97 | } | |
| @@ -102,6 +105,8 @@ var xStyleManagerGetAccentColorRgba func(uintptr) uintptr | |||
| 102 | 105 | // | |
| 103 | 106 | // This is a background color. The matching foreground color is white. | |
| 104 | 107 | func (x *StyleManager) GetAccentColorRgba() *gdk.RGBA { | |
| 108 | + | core.LazyRegister(&xStyleManagerGetAccentColorRgba, "ADW", "adw_style_manager_get_accent_color_rgba", false) | |
| 109 | + | ||
| 105 | 110 | cret := xStyleManagerGetAccentColorRgba(x.GoPointer()) | |
| 106 | 111 | if cret == 0 { | |
| 107 | 112 | return nil | |
| @@ -113,6 +118,8 @@ var xStyleManagerGetColorScheme func(uintptr) ColorScheme | |||
| 113 | 118 | ||
| 114 | 119 | // Gets the requested application color scheme. | |
| 115 | 120 | func (x *StyleManager) GetColorScheme() ColorScheme { | |
| 121 | + | core.LazyRegister(&xStyleManagerGetColorScheme, "ADW", "adw_style_manager_get_color_scheme", false) | |
| 122 | + | ||
| 116 | 123 | cret := xStyleManagerGetColorScheme(x.GoPointer()) | |
| 117 | 124 | return cret | |
| 118 | 125 | } | |
| @@ -124,6 +131,8 @@ var xStyleManagerGetDark func(uintptr) bool | |||
| 124 | 131 | // This can be used to query the current appearance, as requested via | |
| 125 | 132 | // [property@StyleManager:color-scheme]. | |
| 126 | 133 | func (x *StyleManager) GetDark() bool { | |
| 134 | + | core.LazyRegister(&xStyleManagerGetDark, "ADW", "adw_style_manager_get_dark", false) | |
| 135 | + | ||
| 127 | 136 | cret := xStyleManagerGetDark(x.GoPointer()) | |
| 128 | 137 | return cret | |
| 129 | 138 | } | |
| @@ -135,6 +144,7 @@ var xStyleManagerGetDisplay func(uintptr) uintptr | |||
| 135 | 144 | // The display will be `NULL` for the style manager returned by | |
| 136 | 145 | // [func@StyleManager.get_default]. | |
| 137 | 146 | func (x *StyleManager) GetDisplay() *gdk.Display { | |
| 147 | + | core.LazyRegister(&xStyleManagerGetDisplay, "ADW", "adw_style_manager_get_display", false) | |
| 138 | 148 | var cls *gdk.Display | |
| 139 | 149 | ||
| 140 | 150 | cret := xStyleManagerGetDisplay(x.GoPointer()) | |
| @@ -157,6 +167,8 @@ var xStyleManagerGetDocumentFontName func(uintptr) string | |||
| 157 | 167 | // | |
| 158 | 168 | // Use [func@Pango.FontDescription.from_string] to parse it. | |
| 159 | 169 | func (x *StyleManager) GetDocumentFontName() string { | |
| 170 | + | core.LazyRegister(&xStyleManagerGetDocumentFontName, "ADW", "adw_style_manager_get_document_font_name", false) | |
| 171 | + | ||
| 160 | 172 | cret := xStyleManagerGetDocumentFontName(x.GoPointer()) | |
| 161 | 173 | return cret | |
| 162 | 174 | } | |
| @@ -167,6 +179,8 @@ var xStyleManagerGetHighContrast func(uintptr) bool | |||
| 167 | 179 | // | |
| 168 | 180 | // This cannot be overridden by applications. | |
| 169 | 181 | func (x *StyleManager) GetHighContrast() bool { | |
| 182 | + | core.LazyRegister(&xStyleManagerGetHighContrast, "ADW", "adw_style_manager_get_high_contrast", false) | |
| 183 | + | ||
| 170 | 184 | cret := xStyleManagerGetHighContrast(x.GoPointer()) | |
| 171 | 185 | return cret | |
| 172 | 186 | } | |
| @@ -180,6 +194,8 @@ var xStyleManagerGetMonospaceFontName func(uintptr) string | |||
| 180 | 194 | // | |
| 181 | 195 | // Use [func@Pango.FontDescription.from_string] to parse it. | |
| 182 | 196 | func (x *StyleManager) GetMonospaceFontName() string { | |
| 197 | + | core.LazyRegister(&xStyleManagerGetMonospaceFontName, "ADW", "adw_style_manager_get_monospace_font_name", false) | |
| 198 | + | ||
| 183 | 199 | cret := xStyleManagerGetMonospaceFontName(x.GoPointer()) | |
| 184 | 200 | return cret | |
| 185 | 201 | } | |
| @@ -194,6 +210,8 @@ var xStyleManagerGetSystemSupportsAccentColors func(uintptr) bool | |||
| 194 | 210 | // | |
| 195 | 211 | // See [property@StyleManager:accent-color]. | |
| 196 | 212 | func (x *StyleManager) GetSystemSupportsAccentColors() bool { | |
| 213 | + | core.LazyRegister(&xStyleManagerGetSystemSupportsAccentColors, "ADW", "adw_style_manager_get_system_supports_accent_colors", false) | |
| 214 | + | ||
| 197 | 215 | cret := xStyleManagerGetSystemSupportsAccentColors(x.GoPointer()) | |
| 198 | 216 | return cret | |
| 199 | 217 | } | |
| @@ -206,6 +224,8 @@ var xStyleManagerGetSystemSupportsColorSchemes func(uintptr) bool | |||
| 206 | 224 | // preference. For example, applications might want to show a separate | |
| 207 | 225 | // appearance switcher if it's set to `FALSE`. | |
| 208 | 226 | func (x *StyleManager) GetSystemSupportsColorSchemes() bool { | |
| 227 | + | core.LazyRegister(&xStyleManagerGetSystemSupportsColorSchemes, "ADW", "adw_style_manager_get_system_supports_color_schemes", false) | |
| 228 | + | ||
| 209 | 229 | cret := xStyleManagerGetSystemSupportsColorSchemes(x.GoPointer()) | |
| 210 | 230 | return cret | |
| 211 | 231 | } | |
| @@ -244,6 +264,8 @@ var xStyleManagerSetColorScheme func(uintptr, ColorScheme) | |||
| 244 | 264 | // used to check if the current environment provides a color scheme | |
| 245 | 265 | // preference. | |
| 246 | 266 | func (x *StyleManager) SetColorScheme(ColorSchemeVar ColorScheme) { | |
| 267 | + | core.LazyRegister(&xStyleManagerSetColorScheme, "ADW", "adw_style_manager_set_color_scheme", false) | |
| 268 | + | ||
| 247 | 269 | xStyleManagerSetColorScheme(x.GoPointer(), ColorSchemeVar) | |
| 248 | 270 | } | |
| 249 | 271 | ||
| @@ -355,6 +377,7 @@ var xStyleManagerGetDefault func() uintptr | |||
| 355 | 377 | // | |
| 356 | 378 | // See [func@StyleManager.get_for_display]. | |
| 357 | 379 | func StyleManagerGetDefault() *StyleManager { | |
| 380 | + | core.LazyRegister(&xStyleManagerGetDefault, "ADW", "adw_style_manager_get_default", false) | |
| 358 | 381 | var cls *StyleManager | |
| 359 | 382 | ||
| 360 | 383 | cret := xStyleManagerGetDefault() | |
| @@ -377,6 +400,7 @@ var xStyleManagerGetForDisplay func(uintptr) uintptr | |||
| 377 | 400 | // | |
| 378 | 401 | // Most applications should use [func@StyleManager.get_default] instead. | |
| 379 | 402 | func StyleManagerGetForDisplay(DisplayVar *gdk.Display) *StyleManager { | |
| 403 | + | core.LazyRegister(&xStyleManagerGetForDisplay, "ADW", "adw_style_manager_get_for_display", false) | |
| 380 | 404 | var cls *StyleManager | |
| 381 | 405 | ||
| 382 | 406 | cret := xStyleManagerGetForDisplay(DisplayVar.GoPointer()) | |
| @@ -393,31 +417,4 @@ func StyleManagerGetForDisplay(DisplayVar *gdk.Display) *StyleManager { | |||
| 393 | 417 | func init() { | |
| 394 | 418 | core.SetPackageName("ADW", "libadwaita-1") | |
| 395 | 419 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | |
| 396 | - | var libs []uintptr | |
| 397 | - | for _, libPath := range core.GetPaths("ADW") { | |
| 398 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 399 | - | if err != nil { | |
| 400 | - | panic(err) | |
| 401 | - | } | |
| 402 | - | libs = append(libs, lib) | |
| 403 | - | } | |
| 404 | - | ||
| 405 | - | core.PuregoSafeRegister(&xColorSchemeGLibType, libs, "adw_color_scheme_get_type") | |
| 406 | - | ||
| 407 | - | core.PuregoSafeRegister(&xStyleManagerGLibType, libs, "adw_style_manager_get_type") | |
| 408 | - | ||
| 409 | - | core.PuregoSafeRegister(&xStyleManagerGetAccentColor, libs, "adw_style_manager_get_accent_color") | |
| 410 | - | core.PuregoSafeRegister(&xStyleManagerGetAccentColorRgba, libs, "adw_style_manager_get_accent_color_rgba") | |
| 411 | - | core.PuregoSafeRegister(&xStyleManagerGetColorScheme, libs, "adw_style_manager_get_color_scheme") | |
| 412 | - | core.PuregoSafeRegister(&xStyleManagerGetDark, libs, "adw_style_manager_get_dark") | |
| 413 | - | core.PuregoSafeRegister(&xStyleManagerGetDisplay, libs, "adw_style_manager_get_display") | |
| 414 | - | core.PuregoSafeRegister(&xStyleManagerGetDocumentFontName, libs, "adw_style_manager_get_document_font_name") | |
| 415 | - | core.PuregoSafeRegister(&xStyleManagerGetHighContrast, libs, "adw_style_manager_get_high_contrast") | |
| 416 | - | core.PuregoSafeRegister(&xStyleManagerGetMonospaceFontName, libs, "adw_style_manager_get_monospace_font_name") | |
| 417 | - | core.PuregoSafeRegister(&xStyleManagerGetSystemSupportsAccentColors, libs, "adw_style_manager_get_system_supports_accent_colors") | |
| 418 | - | core.PuregoSafeRegister(&xStyleManagerGetSystemSupportsColorSchemes, libs, "adw_style_manager_get_system_supports_color_schemes") | |
| 419 | - | core.PuregoSafeRegister(&xStyleManagerSetColorScheme, libs, "adw_style_manager_set_color_scheme") | |
| 420 | - | ||
| 421 | - | core.PuregoSafeRegister(&xStyleManagerGetDefault, libs, "adw_style_manager_get_default") | |
| 422 | - | core.PuregoSafeRegister(&xStyleManagerGetForDisplay, libs, "adw_style_manager_get_for_display") | |
| 423 | 420 | } | |
| @@ -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/gdk" | 9 | "github.com/bnema/puregotk/v4/gdk" | ||
| 11 | "github.com/bnema/puregotk/v4/gobject" | 10 | "github.com/bnema/puregotk/v4/gobject" | ||
| @@ -36,6 +35,7 @@ type ColorScheme int | |||||
| 36 | var xColorSchemeGLibType func() types.GType | 35 | var xColorSchemeGLibType func() types.GType | ||
| 37 | 36 | ||||
| 38 | func ColorSchemeGLibType() types.GType { | 37 | func ColorSchemeGLibType() types.GType { | ||
| 38 | + | core.LazyRegister(&xColorSchemeGLibType, "ADW", "adw_color_scheme_get_type", false) | |||
| 39 | return xColorSchemeGLibType() | 39 | return xColorSchemeGLibType() | ||
| 40 | } | 40 | } | ||
| 41 | 41 | ||||
| @@ -74,6 +74,7 @@ type StyleManager struct { | |||||
| 74 | var xStyleManagerGLibType func() types.GType | 74 | var xStyleManagerGLibType func() types.GType | ||
| 75 | 75 | ||||
| 76 | func StyleManagerGLibType() types.GType { | 76 | func StyleManagerGLibType() types.GType { | ||
| 77 | + | core.LazyRegister(&xStyleManagerGLibType, "ADW", "adw_style_manager_get_type", false) | |||
| 77 | return xStyleManagerGLibType() | 78 | return xStyleManagerGLibType() | ||
| 78 | } | 79 | } | ||
| 79 | 80 | ||||
| @@ -89,6 +90,8 @@ var xStyleManagerGetAccentColor func(uintptr) AccentColor | |||||
| 89 | // | 90 | // | ||
| 90 | // See also [property@StyleManager:accent-color-rgba]. | 91 | // See also [property@StyleManager:accent-color-rgba]. | ||
| 91 | func (x *StyleManager) GetAccentColor() AccentColor { | 92 | func (x *StyleManager) GetAccentColor() AccentColor { | ||
| 93 | + | core.LazyRegister(&xStyleManagerGetAccentColor, "ADW", "adw_style_manager_get_accent_color", false) | |||
| 94 | + | ||||
| 92 | cret := xStyleManagerGetAccentColor(x.GoPointer()) | 95 | cret := xStyleManagerGetAccentColor(x.GoPointer()) | ||
| 93 | return cret | 96 | return cret | ||
| 94 | } | 97 | } | ||
| @@ -102,6 +105,8 @@ var xStyleManagerGetAccentColorRgba func(uintptr) uintptr | |||||
| 102 | // | 105 | // | ||
| 103 | // This is a background color. The matching foreground color is white. | 106 | // This is a background color. The matching foreground color is white. | ||
| 104 | func (x *StyleManager) GetAccentColorRgba() *gdk.RGBA { | 107 | func (x *StyleManager) GetAccentColorRgba() *gdk.RGBA { | ||
| 108 | + | core.LazyRegister(&xStyleManagerGetAccentColorRgba, "ADW", "adw_style_manager_get_accent_color_rgba", false) | |||
| 109 | + | ||||
| 105 | cret := xStyleManagerGetAccentColorRgba(x.GoPointer()) | 110 | cret := xStyleManagerGetAccentColorRgba(x.GoPointer()) | ||
| 106 | if cret == 0 { | 111 | if cret == 0 { | ||
| 107 | return nil | 112 | return nil | ||
| @@ -113,6 +118,8 @@ var xStyleManagerGetColorScheme func(uintptr) ColorScheme | |||||
| 113 | 118 | ||||
| 114 | // Gets the requested application color scheme. | 119 | // Gets the requested application color scheme. | ||
| 115 | func (x *StyleManager) GetColorScheme() ColorScheme { | 120 | func (x *StyleManager) GetColorScheme() ColorScheme { | ||
| 121 | + | core.LazyRegister(&xStyleManagerGetColorScheme, "ADW", "adw_style_manager_get_color_scheme", false) | |||
| 122 | + | ||||
| 116 | cret := xStyleManagerGetColorScheme(x.GoPointer()) | 123 | cret := xStyleManagerGetColorScheme(x.GoPointer()) | ||
| 117 | return cret | 124 | return cret | ||
| 118 | } | 125 | } | ||
| @@ -124,6 +131,8 @@ var xStyleManagerGetDark func(uintptr) bool | |||||
| 124 | // This can be used to query the current appearance, as requested via | 131 | // This can be used to query the current appearance, as requested via | ||
| 125 | // [property@StyleManager:color-scheme]. | 132 | // [property@StyleManager:color-scheme]. | ||
| 126 | func (x *StyleManager) GetDark() bool { | 133 | func (x *StyleManager) GetDark() bool { | ||
| 134 | + | core.LazyRegister(&xStyleManagerGetDark, "ADW", "adw_style_manager_get_dark", false) | |||
| 135 | + | ||||
| 127 | cret := xStyleManagerGetDark(x.GoPointer()) | 136 | cret := xStyleManagerGetDark(x.GoPointer()) | ||
| 128 | return cret | 137 | return cret | ||
| 129 | } | 138 | } | ||
| @@ -135,6 +144,7 @@ var xStyleManagerGetDisplay func(uintptr) uintptr | |||||
| 135 | // The display will be `NULL` for the style manager returned by | 144 | // The display will be `NULL` for the style manager returned by | ||
| 136 | // [func@StyleManager.get_default]. | 145 | // [func@StyleManager.get_default]. | ||
| 137 | func (x *StyleManager) GetDisplay() *gdk.Display { | 146 | func (x *StyleManager) GetDisplay() *gdk.Display { | ||
| 147 | + | core.LazyRegister(&xStyleManagerGetDisplay, "ADW", "adw_style_manager_get_display", false) | |||
| 138 | var cls *gdk.Display | 148 | var cls *gdk.Display | ||
| 139 | 149 | ||||
| 140 | cret := xStyleManagerGetDisplay(x.GoPointer()) | 150 | cret := xStyleManagerGetDisplay(x.GoPointer()) | ||
| @@ -157,6 +167,8 @@ var xStyleManagerGetDocumentFontName func(uintptr) string | |||||
| 157 | // | 167 | // | ||
| 158 | // Use [func@Pango.FontDescription.from_string] to parse it. | 168 | // Use [func@Pango.FontDescription.from_string] to parse it. | ||
| 159 | func (x *StyleManager) GetDocumentFontName() string { | 169 | func (x *StyleManager) GetDocumentFontName() string { | ||
| 170 | + | core.LazyRegister(&xStyleManagerGetDocumentFontName, "ADW", "adw_style_manager_get_document_font_name", false) | |||
| 171 | + | ||||
| 160 | cret := xStyleManagerGetDocumentFontName(x.GoPointer()) | 172 | cret := xStyleManagerGetDocumentFontName(x.GoPointer()) | ||
| 161 | return cret | 173 | return cret | ||
| 162 | } | 174 | } | ||
| @@ -167,6 +179,8 @@ var xStyleManagerGetHighContrast func(uintptr) bool | |||||
| 167 | // | 179 | // | ||
| 168 | // This cannot be overridden by applications. | 180 | // This cannot be overridden by applications. | ||
| 169 | func (x *StyleManager) GetHighContrast() bool { | 181 | func (x *StyleManager) GetHighContrast() bool { | ||
| 182 | + | core.LazyRegister(&xStyleManagerGetHighContrast, "ADW", "adw_style_manager_get_high_contrast", false) | |||
| 183 | + | ||||
| 170 | cret := xStyleManagerGetHighContrast(x.GoPointer()) | 184 | cret := xStyleManagerGetHighContrast(x.GoPointer()) | ||
| 171 | return cret | 185 | return cret | ||
| 172 | } | 186 | } | ||
| @@ -180,6 +194,8 @@ var xStyleManagerGetMonospaceFontName func(uintptr) string | |||||
| 180 | // | 194 | // | ||
| 181 | // Use [func@Pango.FontDescription.from_string] to parse it. | 195 | // Use [func@Pango.FontDescription.from_string] to parse it. | ||
| 182 | func (x *StyleManager) GetMonospaceFontName() string { | 196 | func (x *StyleManager) GetMonospaceFontName() string { | ||
| 197 | + | core.LazyRegister(&xStyleManagerGetMonospaceFontName, "ADW", "adw_style_manager_get_monospace_font_name", false) | |||
| 198 | + | ||||
| 183 | cret := xStyleManagerGetMonospaceFontName(x.GoPointer()) | 199 | cret := xStyleManagerGetMonospaceFontName(x.GoPointer()) | ||
| 184 | return cret | 200 | return cret | ||
| 185 | } | 201 | } | ||
| @@ -194,6 +210,8 @@ var xStyleManagerGetSystemSupportsAccentColors func(uintptr) bool | |||||
| 194 | // | 210 | // | ||
| 195 | // See [property@StyleManager:accent-color]. | 211 | // See [property@StyleManager:accent-color]. | ||
| 196 | func (x *StyleManager) GetSystemSupportsAccentColors() bool { | 212 | func (x *StyleManager) GetSystemSupportsAccentColors() bool { | ||
| 213 | + | core.LazyRegister(&xStyleManagerGetSystemSupportsAccentColors, "ADW", "adw_style_manager_get_system_supports_accent_colors", false) | |||
| 214 | + | ||||
| 197 | cret := xStyleManagerGetSystemSupportsAccentColors(x.GoPointer()) | 215 | cret := xStyleManagerGetSystemSupportsAccentColors(x.GoPointer()) | ||
| 198 | return cret | 216 | return cret | ||
| 199 | } | 217 | } | ||
| @@ -206,6 +224,8 @@ var xStyleManagerGetSystemSupportsColorSchemes func(uintptr) bool | |||||
| 206 | // preference. For example, applications might want to show a separate | 224 | // preference. For example, applications might want to show a separate | ||
| 207 | // appearance switcher if it's set to `FALSE`. | 225 | // appearance switcher if it's set to `FALSE`. | ||
| 208 | func (x *StyleManager) GetSystemSupportsColorSchemes() bool { | 226 | func (x *StyleManager) GetSystemSupportsColorSchemes() bool { | ||
| 227 | + | core.LazyRegister(&xStyleManagerGetSystemSupportsColorSchemes, "ADW", "adw_style_manager_get_system_supports_color_schemes", false) | |||
| 228 | + | ||||
| 209 | cret := xStyleManagerGetSystemSupportsColorSchemes(x.GoPointer()) | 229 | cret := xStyleManagerGetSystemSupportsColorSchemes(x.GoPointer()) | ||
| 210 | return cret | 230 | return cret | ||
| 211 | } | 231 | } | ||
| @@ -244,6 +264,8 @@ var xStyleManagerSetColorScheme func(uintptr, ColorScheme) | |||||
| 244 | // used to check if the current environment provides a color scheme | 264 | // used to check if the current environment provides a color scheme | ||
| 245 | // preference. | 265 | // preference. | ||
| 246 | func (x *StyleManager) SetColorScheme(ColorSchemeVar ColorScheme) { | 266 | func (x *StyleManager) SetColorScheme(ColorSchemeVar ColorScheme) { | ||
| 267 | + | core.LazyRegister(&xStyleManagerSetColorScheme, "ADW", "adw_style_manager_set_color_scheme", false) | |||
| 268 | + | ||||
| 247 | xStyleManagerSetColorScheme(x.GoPointer(), ColorSchemeVar) | 269 | xStyleManagerSetColorScheme(x.GoPointer(), ColorSchemeVar) | ||
| 248 | } | 270 | } | ||
| 249 | 271 | ||||
| @@ -355,6 +377,7 @@ var xStyleManagerGetDefault func() uintptr | |||||
| 355 | // | 377 | // | ||
| 356 | // See [func@StyleManager.get_for_display]. | 378 | // See [func@StyleManager.get_for_display]. | ||
| 357 | func StyleManagerGetDefault() *StyleManager { | 379 | func StyleManagerGetDefault() *StyleManager { | ||
| 380 | + | core.LazyRegister(&xStyleManagerGetDefault, "ADW", "adw_style_manager_get_default", false) | |||
| 358 | var cls *StyleManager | 381 | var cls *StyleManager | ||
| 359 | 382 | ||||
| 360 | cret := xStyleManagerGetDefault() | 383 | cret := xStyleManagerGetDefault() | ||
| @@ -377,6 +400,7 @@ var xStyleManagerGetForDisplay func(uintptr) uintptr | |||||
| 377 | // | 400 | // | ||
| 378 | // Most applications should use [func@StyleManager.get_default] instead. | 401 | // Most applications should use [func@StyleManager.get_default] instead. | ||
| 379 | func StyleManagerGetForDisplay(DisplayVar *gdk.Display) *StyleManager { | 402 | func StyleManagerGetForDisplay(DisplayVar *gdk.Display) *StyleManager { | ||
| 403 | + | core.LazyRegister(&xStyleManagerGetForDisplay, "ADW", "adw_style_manager_get_for_display", false) | |||
| 380 | var cls *StyleManager | 404 | var cls *StyleManager | ||
| 381 | 405 | ||||
| 382 | cret := xStyleManagerGetForDisplay(DisplayVar.GoPointer()) | 406 | cret := xStyleManagerGetForDisplay(DisplayVar.GoPointer()) | ||
| @@ -393,31 +417,4 @@ func StyleManagerGetForDisplay(DisplayVar *gdk.Display) *StyleManager { | |||||
| 393 | func init() { | 417 | func init() { | ||
| 394 | core.SetPackageName("ADW", "libadwaita-1") | 418 | core.SetPackageName("ADW", "libadwaita-1") | ||
| 395 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | 419 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | ||
| 396 | - | var libs []uintptr | |||
| 397 | - | for _, libPath := range core.GetPaths("ADW") { | |||
| 398 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 399 | - | if err != nil { | |||
| 400 | - | panic(err) | |||
| 401 | - | } | |||
| 402 | - | libs = append(libs, lib) | |||
| 403 | - | } | |||
| 404 | - | ||||
| 405 | - | core.PuregoSafeRegister(&xColorSchemeGLibType, libs, "adw_color_scheme_get_type") | |||
| 406 | - | ||||
| 407 | - | core.PuregoSafeRegister(&xStyleManagerGLibType, libs, "adw_style_manager_get_type") | |||
| 408 | - | ||||
| 409 | - | core.PuregoSafeRegister(&xStyleManagerGetAccentColor, libs, "adw_style_manager_get_accent_color") | |||
| 410 | - | core.PuregoSafeRegister(&xStyleManagerGetAccentColorRgba, libs, "adw_style_manager_get_accent_color_rgba") | |||
| 411 | - | core.PuregoSafeRegister(&xStyleManagerGetColorScheme, libs, "adw_style_manager_get_color_scheme") | |||
| 412 | - | core.PuregoSafeRegister(&xStyleManagerGetDark, libs, "adw_style_manager_get_dark") | |||
| 413 | - | core.PuregoSafeRegister(&xStyleManagerGetDisplay, libs, "adw_style_manager_get_display") | |||
| 414 | - | core.PuregoSafeRegister(&xStyleManagerGetDocumentFontName, libs, "adw_style_manager_get_document_font_name") | |||
| 415 | - | core.PuregoSafeRegister(&xStyleManagerGetHighContrast, libs, "adw_style_manager_get_high_contrast") | |||
| 416 | - | core.PuregoSafeRegister(&xStyleManagerGetMonospaceFontName, libs, "adw_style_manager_get_monospace_font_name") | |||
| 417 | - | core.PuregoSafeRegister(&xStyleManagerGetSystemSupportsAccentColors, libs, "adw_style_manager_get_system_supports_accent_colors") | |||
| 418 | - | core.PuregoSafeRegister(&xStyleManagerGetSystemSupportsColorSchemes, libs, "adw_style_manager_get_system_supports_color_schemes") | |||
| 419 | - | core.PuregoSafeRegister(&xStyleManagerSetColorScheme, libs, "adw_style_manager_set_color_scheme") | |||
| 420 | - | ||||
| 421 | - | core.PuregoSafeRegister(&xStyleManagerGetDefault, libs, "adw_style_manager_get_default") | |||
| 422 | - | core.PuregoSafeRegister(&xStyleManagerGetForDisplay, libs, "adw_style_manager_get_for_display") | |||
| 423 | } | 420 | } | ||