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 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-swipe-tracker.go +33 -30 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-swipeable.go +33 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-switch-row.go +6 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-bar.go +35 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-button.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-overview.go +45 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-view.go +123 -87 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-timed-animation.go +30 -28 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toast-overlay.go +9 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toast.go +41 -36 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toggle-group.go +64 -51 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toolbar-view.go +40 -35 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-version.go +7 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-stack.go +78 -62 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-bar.go +9 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-sidebar.go +15 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-title.go +19 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher.go +10 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-window-title.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-window.go +14 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-wrap-box.go +66 -46 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-wrap-layout.go +57 -46 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/cairo/main.go +36 -79 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkapplaunchcontext.go +10 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcairo.go +12 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcairocontext.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcicpparams.go +20 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkclipboard.go +34 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcolorstate.go +12 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentdeserializer.go +26 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentformats.go +28 -31 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentprovider.go +23 -28 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentserializer.go +26 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcursor.go +12 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdevice.go +36 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdevicepad.go +27 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdevicetool.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdisplay.go +51 -43 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdisplaymanager.go +10 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdmabuftexture.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdmabuftexturebuilder.go +53 -41 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdmabuftexturebuilder_extra.go +6 -0 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdrag.go +20 -28 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdragsurface.go +6 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdragsurfacesize.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdrawcontext.go +11 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdrop.go +19 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkenums.go +21 -1 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkevents.go +120 -118 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkframeclock.go +22 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkframetimings.go +17 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkglcontext.go +40 -36
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | package gdk | |
| 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/glib" | |
| 8 | 7 | "github.com/bnema/puregotk/v4/gobject" | |
| @@ -13,6 +12,8 @@ var xGlErrorQuark func() glib.Quark | |||
| 13 | 12 | ||
| 14 | 13 | // Registers an error quark for [class@Gdk.GLContext] errors. | |
| 15 | 14 | func GlErrorQuark() glib.Quark { | |
| 15 | + | core.LazyRegister(&xGlErrorQuark, "GDK", "gdk_gl_error_quark", false) | |
| 16 | + | ||
| 16 | 17 | cret := xGlErrorQuark() | |
| 17 | 18 | return cret | |
| 18 | 19 | } | |
| @@ -72,6 +73,7 @@ type GLContext struct { | |||
| 72 | 73 | var xGLContextGLibType func() types.GType | |
| 73 | 74 | ||
| 74 | 75 | func GLContextGLibType() types.GType { | |
| 76 | + | core.LazyRegister(&xGLContextGLibType, "GDK", "gdk_gl_context_get_type", false) | |
| 75 | 77 | return xGLContextGLibType() | |
| 76 | 78 | } | |
| 77 | 79 | ||
| @@ -85,6 +87,8 @@ var xGLContextGetAllowedApis func(uintptr) GLAPI | |||
| 85 | 87 | ||
| 86 | 88 | // Gets the allowed APIs set via gdk_gl_context_set_allowed_apis(). | |
| 87 | 89 | func (x *GLContext) GetAllowedApis() GLAPI { | |
| 90 | + | core.LazyRegister(&xGLContextGetAllowedApis, "GDK", "gdk_gl_context_get_allowed_apis", false) | |
| 91 | + | ||
| 88 | 92 | cret := xGLContextGetAllowedApis(x.GoPointer()) | |
| 89 | 93 | return cret | |
| 90 | 94 | } | |
| @@ -95,6 +99,8 @@ var xGLContextGetApi func(uintptr) GLAPI | |||
| 95 | 99 | // | |
| 96 | 100 | // If the renderer has not been realized yet, 0 is returned. | |
| 97 | 101 | func (x *GLContext) GetApi() GLAPI { | |
| 102 | + | core.LazyRegister(&xGLContextGetApi, "GDK", "gdk_gl_context_get_api", false) | |
| 103 | + | ||
| 98 | 104 | cret := xGLContextGetApi(x.GoPointer()) | |
| 99 | 105 | return cret | |
| 100 | 106 | } | |
| @@ -105,6 +111,8 @@ var xGLContextGetDebugEnabled func(uintptr) bool | |||
| 105 | 111 | // | |
| 106 | 112 | // See [method@Gdk.GLContext.set_debug_enabled]. | |
| 107 | 113 | func (x *GLContext) GetDebugEnabled() bool { | |
| 114 | + | core.LazyRegister(&xGLContextGetDebugEnabled, "GDK", "gdk_gl_context_get_debug_enabled", false) | |
| 115 | + | ||
| 108 | 116 | cret := xGLContextGetDebugEnabled(x.GoPointer()) | |
| 109 | 117 | return cret | |
| 110 | 118 | } | |
| @@ -113,6 +121,7 @@ var xGLContextGetDisplay func(uintptr) uintptr | |||
| 113 | 121 | ||
| 114 | 122 | // Retrieves the display the @context is created for | |
| 115 | 123 | func (x *GLContext) GetDisplay() *Display { | |
| 124 | + | core.LazyRegister(&xGLContextGetDisplay, "GDK", "gdk_gl_context_get_display", false) | |
| 116 | 125 | var cls *Display | |
| 117 | 126 | ||
| 118 | 127 | cret := xGLContextGetDisplay(x.GoPointer()) | |
| @@ -132,6 +141,8 @@ var xGLContextGetForwardCompatible func(uintptr) bool | |||
| 132 | 141 | // | |
| 133 | 142 | // See [method@Gdk.GLContext.set_forward_compatible]. | |
| 134 | 143 | func (x *GLContext) GetForwardCompatible() bool { | |
| 144 | + | core.LazyRegister(&xGLContextGetForwardCompatible, "GDK", "gdk_gl_context_get_forward_compatible", false) | |
| 145 | + | ||
| 135 | 146 | cret := xGLContextGetForwardCompatible(x.GoPointer()) | |
| 136 | 147 | return cret | |
| 137 | 148 | } | |
| @@ -145,6 +156,8 @@ var xGLContextGetRequiredVersion func(uintptr, *int, *int) | |||
| 145 | 156 | // | |
| 146 | 157 | // See [method@Gdk.GLContext.set_required_version]. | |
| 147 | 158 | func (x *GLContext) GetRequiredVersion(MajorVar *int, MinorVar *int) { | |
| 159 | + | core.LazyRegister(&xGLContextGetRequiredVersion, "GDK", "gdk_gl_context_get_required_version", false) | |
| 160 | + | ||
| 148 | 161 | xGLContextGetRequiredVersion(x.GoPointer(), MajorVar, MinorVar) | |
| 149 | 162 | } | |
| 150 | 163 | ||
| @@ -155,6 +168,7 @@ var xGLContextGetSharedContext func(uintptr) uintptr | |||
| 155 | 168 | // As many contexts can share data now and no single shared context exists | |
| 156 | 169 | // anymore, this function has been deprecated and now always returns %NULL. | |
| 157 | 170 | func (x *GLContext) GetSharedContext() *GLContext { | |
| 171 | + | core.LazyRegister(&xGLContextGetSharedContext, "GDK", "gdk_gl_context_get_shared_context", false) | |
| 158 | 172 | var cls *GLContext | |
| 159 | 173 | ||
| 160 | 174 | cret := xGLContextGetSharedContext(x.GoPointer()) | |
| @@ -172,6 +186,7 @@ var xGLContextGetSurface func(uintptr) uintptr | |||
| 172 | 186 | ||
| 173 | 187 | // Retrieves the surface used by the @context. | |
| 174 | 188 | func (x *GLContext) GetSurface() *Surface { | |
| 189 | + | core.LazyRegister(&xGLContextGetSurface, "GDK", "gdk_gl_context_get_surface", false) | |
| 175 | 190 | var cls *Surface | |
| 176 | 191 | ||
| 177 | 192 | cret := xGLContextGetSurface(x.GoPointer()) | |
| @@ -189,6 +204,8 @@ var xGLContextGetUseEs func(uintptr) bool | |||
| 189 | 204 | ||
| 190 | 205 | // Checks whether the @context is using an OpenGL or OpenGL ES profile. | |
| 191 | 206 | func (x *GLContext) GetUseEs() bool { | |
| 207 | + | core.LazyRegister(&xGLContextGetUseEs, "GDK", "gdk_gl_context_get_use_es", false) | |
| 208 | + | ||
| 192 | 209 | cret := xGLContextGetUseEs(x.GoPointer()) | |
| 193 | 210 | return cret | |
| 194 | 211 | } | |
| @@ -199,6 +216,8 @@ var xGLContextGetVersion func(uintptr, *int, *int) | |||
| 199 | 216 | // | |
| 200 | 217 | // The @context must be realized prior to calling this function. | |
| 201 | 218 | func (x *GLContext) GetVersion(MajorVar *int, MinorVar *int) { | |
| 219 | + | core.LazyRegister(&xGLContextGetVersion, "GDK", "gdk_gl_context_get_version", false) | |
| 220 | + | ||
| 202 | 221 | xGLContextGetVersion(x.GoPointer(), MajorVar, MinorVar) | |
| 203 | 222 | } | |
| 204 | 223 | ||
| @@ -221,6 +240,8 @@ var xGLContextIsLegacy func(uintptr) bool | |||
| 221 | 240 | // of OpenGL API to use, or whether to do extension discovery, or what | |
| 222 | 241 | // kind of shader programs to load. | |
| 223 | 242 | func (x *GLContext) IsLegacy() bool { | |
| 243 | + | core.LazyRegister(&xGLContextIsLegacy, "GDK", "gdk_gl_context_is_legacy", false) | |
| 244 | + | ||
| 224 | 245 | cret := xGLContextIsLegacy(x.GoPointer()) | |
| 225 | 246 | return cret | |
| 226 | 247 | } | |
| @@ -240,6 +261,8 @@ var xGLContextIsShared func(uintptr, uintptr) bool | |||
| 240 | 261 | // Both contexts must be realized for this check to succeed. If either one | |
| 241 | 262 | // is not, this function will return %FALSE. | |
| 242 | 263 | func (x *GLContext) IsShared(OtherVar *GLContext) bool { | |
| 264 | + | core.LazyRegister(&xGLContextIsShared, "GDK", "gdk_gl_context_is_shared", false) | |
| 265 | + | ||
| 243 | 266 | cret := xGLContextIsShared(x.GoPointer(), OtherVar.GoPointer()) | |
| 244 | 267 | return cret | |
| 245 | 268 | } | |
| @@ -248,6 +271,8 @@ var xGLContextMakeCurrent func(uintptr) | |||
| 248 | 271 | ||
| 249 | 272 | // Makes the @context the current one. | |
| 250 | 273 | func (x *GLContext) MakeCurrent() { | |
| 274 | + | core.LazyRegister(&xGLContextMakeCurrent, "GDK", "gdk_gl_context_make_current", false) | |
| 275 | + | ||
| 251 | 276 | xGLContextMakeCurrent(x.GoPointer()) | |
| 252 | 277 | } | |
| 253 | 278 | ||
| @@ -257,6 +282,7 @@ var xGLContextRealize func(uintptr, **glib.Error) bool | |||
| 257 | 282 | // | |
| 258 | 283 | // It is safe to call this function on a realized `GdkGLContext`. | |
| 259 | 284 | func (x *GLContext) Realize() (bool, error) { | |
| 285 | + | core.LazyRegister(&xGLContextRealize, "GDK", "gdk_gl_context_realize", false) | |
| 260 | 286 | var cerr *glib.Error | |
| 261 | 287 | ||
| 262 | 288 | cret := xGLContextRealize(x.GoPointer(), &cerr) | |
| @@ -276,6 +302,8 @@ var xGLContextSetAllowedApis func(uintptr, GLAPI) | |||
| 276 | 302 | // | |
| 277 | 303 | // By default, all APIs are allowed. | |
| 278 | 304 | func (x *GLContext) SetAllowedApis(ApisVar GLAPI) { | |
| 305 | + | core.LazyRegister(&xGLContextSetAllowedApis, "GDK", "gdk_gl_context_set_allowed_apis", false) | |
| 306 | + | ||
| 279 | 307 | xGLContextSetAllowedApis(x.GoPointer(), ApisVar) | |
| 280 | 308 | } | |
| 281 | 309 | ||
| @@ -289,6 +317,8 @@ var xGLContextSetDebugEnabled func(uintptr, bool) | |||
| 289 | 317 | // The `GdkGLContext` must not be realized or made current prior to | |
| 290 | 318 | // calling this function. | |
| 291 | 319 | func (x *GLContext) SetDebugEnabled(EnabledVar bool) { | |
| 320 | + | core.LazyRegister(&xGLContextSetDebugEnabled, "GDK", "gdk_gl_context_set_debug_enabled", false) | |
| 321 | + | ||
| 292 | 322 | xGLContextSetDebugEnabled(x.GoPointer(), EnabledVar) | |
| 293 | 323 | } | |
| 294 | 324 | ||
| @@ -304,6 +334,8 @@ var xGLContextSetForwardCompatible func(uintptr, bool) | |||
| 304 | 334 | // The `GdkGLContext` must not be realized or made current prior to calling | |
| 305 | 335 | // this function. | |
| 306 | 336 | func (x *GLContext) SetForwardCompatible(CompatibleVar bool) { | |
| 337 | + | core.LazyRegister(&xGLContextSetForwardCompatible, "GDK", "gdk_gl_context_set_forward_compatible", false) | |
| 338 | + | ||
| 307 | 339 | xGLContextSetForwardCompatible(x.GoPointer(), CompatibleVar) | |
| 308 | 340 | } | |
| 309 | 341 | ||
| @@ -319,6 +351,8 @@ var xGLContextSetRequiredVersion func(uintptr, int, int) | |||
| 319 | 351 | // The @context must not be realized or made current prior to calling | |
| 320 | 352 | // this function. | |
| 321 | 353 | func (x *GLContext) SetRequiredVersion(MajorVar int, MinorVar int) { | |
| 354 | + | core.LazyRegister(&xGLContextSetRequiredVersion, "GDK", "gdk_gl_context_set_required_version", false) | |
| 355 | + | ||
| 322 | 356 | xGLContextSetRequiredVersion(x.GoPointer(), MajorVar, MinorVar) | |
| 323 | 357 | } | |
| 324 | 358 | ||
| @@ -338,6 +372,8 @@ var xGLContextSetUseEs func(uintptr, int) | |||
| 338 | 372 | // after calling [method@Gdk.GLContext.realize] to decide whether to use | |
| 339 | 373 | // the OpenGL or OpenGL ES API, extensions, or shaders. | |
| 340 | 374 | func (x *GLContext) SetUseEs(UseEsVar int) { | |
| 375 | + | core.LazyRegister(&xGLContextSetUseEs, "GDK", "gdk_gl_context_set_use_es", false) | |
| 376 | + | ||
| 341 | 377 | xGLContextSetUseEs(x.GoPointer(), UseEsVar) | |
| 342 | 378 | } | |
| 343 | 379 | ||
| @@ -359,6 +395,8 @@ var xGLContextClearCurrent func() | |||
| 359 | 395 | // Any OpenGL call after this function returns will be ignored | |
| 360 | 396 | // until [method@Gdk.GLContext.make_current] is called. | |
| 361 | 397 | func GLContextClearCurrent() { | |
| 398 | + | core.LazyRegister(&xGLContextClearCurrent, "GDK", "gdk_gl_context_clear_current", false) | |
| 399 | + | ||
| 362 | 400 | xGLContextClearCurrent() | |
| 363 | 401 | } | |
| 364 | 402 | ||
| @@ -366,6 +404,7 @@ var xGLContextGetCurrent func() uintptr | |||
| 366 | 404 | ||
| 367 | 405 | // Retrieves the current `GdkGLContext`. | |
| 368 | 406 | func GLContextGetCurrent() *GLContext { | |
| 407 | + | core.LazyRegister(&xGLContextGetCurrent, "GDK", "gdk_gl_context_get_current", false) | |
| 369 | 408 | var cls *GLContext | |
| 370 | 409 | ||
| 371 | 410 | cret := xGLContextGetCurrent() | |
| @@ -382,39 +421,4 @@ func GLContextGetCurrent() *GLContext { | |||
| 382 | 421 | func init() { | |
| 383 | 422 | core.SetPackageName("GDK", "gtk4") | |
| 384 | 423 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | |
| 385 | - | var libs []uintptr | |
| 386 | - | for _, libPath := range core.GetPaths("GDK") { | |
| 387 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 388 | - | if err != nil { | |
| 389 | - | panic(err) | |
| 390 | - | } | |
| 391 | - | libs = append(libs, lib) | |
| 392 | - | } | |
| 393 | - | ||
| 394 | - | core.PuregoSafeRegister(&xGlErrorQuark, libs, "gdk_gl_error_quark") | |
| 395 | - | ||
| 396 | - | core.PuregoSafeRegister(&xGLContextGLibType, libs, "gdk_gl_context_get_type") | |
| 397 | - | ||
| 398 | - | core.PuregoSafeRegister(&xGLContextGetAllowedApis, libs, "gdk_gl_context_get_allowed_apis") | |
| 399 | - | core.PuregoSafeRegister(&xGLContextGetApi, libs, "gdk_gl_context_get_api") | |
| 400 | - | core.PuregoSafeRegister(&xGLContextGetDebugEnabled, libs, "gdk_gl_context_get_debug_enabled") | |
| 401 | - | core.PuregoSafeRegister(&xGLContextGetDisplay, libs, "gdk_gl_context_get_display") | |
| 402 | - | core.PuregoSafeRegister(&xGLContextGetForwardCompatible, libs, "gdk_gl_context_get_forward_compatible") | |
| 403 | - | core.PuregoSafeRegister(&xGLContextGetRequiredVersion, libs, "gdk_gl_context_get_required_version") | |
| 404 | - | core.PuregoSafeRegister(&xGLContextGetSharedContext, libs, "gdk_gl_context_get_shared_context") | |
| 405 | - | core.PuregoSafeRegister(&xGLContextGetSurface, libs, "gdk_gl_context_get_surface") | |
| 406 | - | core.PuregoSafeRegister(&xGLContextGetUseEs, libs, "gdk_gl_context_get_use_es") | |
| 407 | - | core.PuregoSafeRegister(&xGLContextGetVersion, libs, "gdk_gl_context_get_version") | |
| 408 | - | core.PuregoSafeRegister(&xGLContextIsLegacy, libs, "gdk_gl_context_is_legacy") | |
| 409 | - | core.PuregoSafeRegister(&xGLContextIsShared, libs, "gdk_gl_context_is_shared") | |
| 410 | - | core.PuregoSafeRegister(&xGLContextMakeCurrent, libs, "gdk_gl_context_make_current") | |
| 411 | - | core.PuregoSafeRegister(&xGLContextRealize, libs, "gdk_gl_context_realize") | |
| 412 | - | core.PuregoSafeRegister(&xGLContextSetAllowedApis, libs, "gdk_gl_context_set_allowed_apis") | |
| 413 | - | core.PuregoSafeRegister(&xGLContextSetDebugEnabled, libs, "gdk_gl_context_set_debug_enabled") | |
| 414 | - | core.PuregoSafeRegister(&xGLContextSetForwardCompatible, libs, "gdk_gl_context_set_forward_compatible") | |
| 415 | - | core.PuregoSafeRegister(&xGLContextSetRequiredVersion, libs, "gdk_gl_context_set_required_version") | |
| 416 | - | core.PuregoSafeRegister(&xGLContextSetUseEs, libs, "gdk_gl_context_set_use_es") | |
| 417 | - | ||
| 418 | - | core.PuregoSafeRegister(&xGLContextClearCurrent, libs, "gdk_gl_context_clear_current") | |
| 419 | - | core.PuregoSafeRegister(&xGLContextGetCurrent, libs, "gdk_gl_context_get_current") | |
| 420 | 424 | } | |
| @@ -2,7 +2,6 @@ | |||||
| 2 | package gdk | 2 | package gdk | ||
| 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/glib" | 6 | "github.com/bnema/puregotk/v4/glib" | ||
| 8 | "github.com/bnema/puregotk/v4/gobject" | 7 | "github.com/bnema/puregotk/v4/gobject" | ||
| @@ -13,6 +12,8 @@ var xGlErrorQuark func() glib.Quark | |||||
| 13 | 12 | ||||
| 14 | // Registers an error quark for [class@Gdk.GLContext] errors. | 13 | // Registers an error quark for [class@Gdk.GLContext] errors. | ||
| 15 | func GlErrorQuark() glib.Quark { | 14 | func GlErrorQuark() glib.Quark { | ||
| 15 | + | core.LazyRegister(&xGlErrorQuark, "GDK", "gdk_gl_error_quark", false) | |||
| 16 | + | ||||
| 16 | cret := xGlErrorQuark() | 17 | cret := xGlErrorQuark() | ||
| 17 | return cret | 18 | return cret | ||
| 18 | } | 19 | } | ||
| @@ -72,6 +73,7 @@ type GLContext struct { | |||||
| 72 | var xGLContextGLibType func() types.GType | 73 | var xGLContextGLibType func() types.GType | ||
| 73 | 74 | ||||
| 74 | func GLContextGLibType() types.GType { | 75 | func GLContextGLibType() types.GType { | ||
| 76 | + | core.LazyRegister(&xGLContextGLibType, "GDK", "gdk_gl_context_get_type", false) | |||
| 75 | return xGLContextGLibType() | 77 | return xGLContextGLibType() | ||
| 76 | } | 78 | } | ||
| 77 | 79 | ||||
| @@ -85,6 +87,8 @@ var xGLContextGetAllowedApis func(uintptr) GLAPI | |||||
| 85 | 87 | ||||
| 86 | // Gets the allowed APIs set via gdk_gl_context_set_allowed_apis(). | 88 | // Gets the allowed APIs set via gdk_gl_context_set_allowed_apis(). | ||
| 87 | func (x *GLContext) GetAllowedApis() GLAPI { | 89 | func (x *GLContext) GetAllowedApis() GLAPI { | ||
| 90 | + | core.LazyRegister(&xGLContextGetAllowedApis, "GDK", "gdk_gl_context_get_allowed_apis", false) | |||
| 91 | + | ||||
| 88 | cret := xGLContextGetAllowedApis(x.GoPointer()) | 92 | cret := xGLContextGetAllowedApis(x.GoPointer()) | ||
| 89 | return cret | 93 | return cret | ||
| 90 | } | 94 | } | ||
| @@ -95,6 +99,8 @@ var xGLContextGetApi func(uintptr) GLAPI | |||||
| 95 | // | 99 | // | ||
| 96 | // If the renderer has not been realized yet, 0 is returned. | 100 | // If the renderer has not been realized yet, 0 is returned. | ||
| 97 | func (x *GLContext) GetApi() GLAPI { | 101 | func (x *GLContext) GetApi() GLAPI { | ||
| 102 | + | core.LazyRegister(&xGLContextGetApi, "GDK", "gdk_gl_context_get_api", false) | |||
| 103 | + | ||||
| 98 | cret := xGLContextGetApi(x.GoPointer()) | 104 | cret := xGLContextGetApi(x.GoPointer()) | ||
| 99 | return cret | 105 | return cret | ||
| 100 | } | 106 | } | ||
| @@ -105,6 +111,8 @@ var xGLContextGetDebugEnabled func(uintptr) bool | |||||
| 105 | // | 111 | // | ||
| 106 | // See [method@Gdk.GLContext.set_debug_enabled]. | 112 | // See [method@Gdk.GLContext.set_debug_enabled]. | ||
| 107 | func (x *GLContext) GetDebugEnabled() bool { | 113 | func (x *GLContext) GetDebugEnabled() bool { | ||
| 114 | + | core.LazyRegister(&xGLContextGetDebugEnabled, "GDK", "gdk_gl_context_get_debug_enabled", false) | |||
| 115 | + | ||||
| 108 | cret := xGLContextGetDebugEnabled(x.GoPointer()) | 116 | cret := xGLContextGetDebugEnabled(x.GoPointer()) | ||
| 109 | return cret | 117 | return cret | ||
| 110 | } | 118 | } | ||
| @@ -113,6 +121,7 @@ var xGLContextGetDisplay func(uintptr) uintptr | |||||
| 113 | 121 | ||||
| 114 | // Retrieves the display the @context is created for | 122 | // Retrieves the display the @context is created for | ||
| 115 | func (x *GLContext) GetDisplay() *Display { | 123 | func (x *GLContext) GetDisplay() *Display { | ||
| 124 | + | core.LazyRegister(&xGLContextGetDisplay, "GDK", "gdk_gl_context_get_display", false) | |||
| 116 | var cls *Display | 125 | var cls *Display | ||
| 117 | 126 | ||||
| 118 | cret := xGLContextGetDisplay(x.GoPointer()) | 127 | cret := xGLContextGetDisplay(x.GoPointer()) | ||
| @@ -132,6 +141,8 @@ var xGLContextGetForwardCompatible func(uintptr) bool | |||||
| 132 | // | 141 | // | ||
| 133 | // See [method@Gdk.GLContext.set_forward_compatible]. | 142 | // See [method@Gdk.GLContext.set_forward_compatible]. | ||
| 134 | func (x *GLContext) GetForwardCompatible() bool { | 143 | func (x *GLContext) GetForwardCompatible() bool { | ||
| 144 | + | core.LazyRegister(&xGLContextGetForwardCompatible, "GDK", "gdk_gl_context_get_forward_compatible", false) | |||
| 145 | + | ||||
| 135 | cret := xGLContextGetForwardCompatible(x.GoPointer()) | 146 | cret := xGLContextGetForwardCompatible(x.GoPointer()) | ||
| 136 | return cret | 147 | return cret | ||
| 137 | } | 148 | } | ||
| @@ -145,6 +156,8 @@ var xGLContextGetRequiredVersion func(uintptr, *int, *int) | |||||
| 145 | // | 156 | // | ||
| 146 | // See [method@Gdk.GLContext.set_required_version]. | 157 | // See [method@Gdk.GLContext.set_required_version]. | ||
| 147 | func (x *GLContext) GetRequiredVersion(MajorVar *int, MinorVar *int) { | 158 | func (x *GLContext) GetRequiredVersion(MajorVar *int, MinorVar *int) { | ||
| 159 | + | core.LazyRegister(&xGLContextGetRequiredVersion, "GDK", "gdk_gl_context_get_required_version", false) | |||
| 160 | + | ||||
| 148 | xGLContextGetRequiredVersion(x.GoPointer(), MajorVar, MinorVar) | 161 | xGLContextGetRequiredVersion(x.GoPointer(), MajorVar, MinorVar) | ||
| 149 | } | 162 | } | ||
| 150 | 163 | ||||
| @@ -155,6 +168,7 @@ var xGLContextGetSharedContext func(uintptr) uintptr | |||||
| 155 | // As many contexts can share data now and no single shared context exists | 168 | // As many contexts can share data now and no single shared context exists | ||
| 156 | // anymore, this function has been deprecated and now always returns %NULL. | 169 | // anymore, this function has been deprecated and now always returns %NULL. | ||
| 157 | func (x *GLContext) GetSharedContext() *GLContext { | 170 | func (x *GLContext) GetSharedContext() *GLContext { | ||
| 171 | + | core.LazyRegister(&xGLContextGetSharedContext, "GDK", "gdk_gl_context_get_shared_context", false) | |||
| 158 | var cls *GLContext | 172 | var cls *GLContext | ||
| 159 | 173 | ||||
| 160 | cret := xGLContextGetSharedContext(x.GoPointer()) | 174 | cret := xGLContextGetSharedContext(x.GoPointer()) | ||
| @@ -172,6 +186,7 @@ var xGLContextGetSurface func(uintptr) uintptr | |||||
| 172 | 186 | ||||
| 173 | // Retrieves the surface used by the @context. | 187 | // Retrieves the surface used by the @context. | ||
| 174 | func (x *GLContext) GetSurface() *Surface { | 188 | func (x *GLContext) GetSurface() *Surface { | ||
| 189 | + | core.LazyRegister(&xGLContextGetSurface, "GDK", "gdk_gl_context_get_surface", false) | |||
| 175 | var cls *Surface | 190 | var cls *Surface | ||
| 176 | 191 | ||||
| 177 | cret := xGLContextGetSurface(x.GoPointer()) | 192 | cret := xGLContextGetSurface(x.GoPointer()) | ||
| @@ -189,6 +204,8 @@ var xGLContextGetUseEs func(uintptr) bool | |||||
| 189 | 204 | ||||
| 190 | // Checks whether the @context is using an OpenGL or OpenGL ES profile. | 205 | // Checks whether the @context is using an OpenGL or OpenGL ES profile. | ||
| 191 | func (x *GLContext) GetUseEs() bool { | 206 | func (x *GLContext) GetUseEs() bool { | ||
| 207 | + | core.LazyRegister(&xGLContextGetUseEs, "GDK", "gdk_gl_context_get_use_es", false) | |||
| 208 | + | ||||
| 192 | cret := xGLContextGetUseEs(x.GoPointer()) | 209 | cret := xGLContextGetUseEs(x.GoPointer()) | ||
| 193 | return cret | 210 | return cret | ||
| 194 | } | 211 | } | ||
| @@ -199,6 +216,8 @@ var xGLContextGetVersion func(uintptr, *int, *int) | |||||
| 199 | // | 216 | // | ||
| 200 | // The @context must be realized prior to calling this function. | 217 | // The @context must be realized prior to calling this function. | ||
| 201 | func (x *GLContext) GetVersion(MajorVar *int, MinorVar *int) { | 218 | func (x *GLContext) GetVersion(MajorVar *int, MinorVar *int) { | ||
| 219 | + | core.LazyRegister(&xGLContextGetVersion, "GDK", "gdk_gl_context_get_version", false) | |||
| 220 | + | ||||
| 202 | xGLContextGetVersion(x.GoPointer(), MajorVar, MinorVar) | 221 | xGLContextGetVersion(x.GoPointer(), MajorVar, MinorVar) | ||
| 203 | } | 222 | } | ||
| 204 | 223 | ||||
| @@ -221,6 +240,8 @@ var xGLContextIsLegacy func(uintptr) bool | |||||
| 221 | // of OpenGL API to use, or whether to do extension discovery, or what | 240 | // of OpenGL API to use, or whether to do extension discovery, or what | ||
| 222 | // kind of shader programs to load. | 241 | // kind of shader programs to load. | ||
| 223 | func (x *GLContext) IsLegacy() bool { | 242 | func (x *GLContext) IsLegacy() bool { | ||
| 243 | + | core.LazyRegister(&xGLContextIsLegacy, "GDK", "gdk_gl_context_is_legacy", false) | |||
| 244 | + | ||||
| 224 | cret := xGLContextIsLegacy(x.GoPointer()) | 245 | cret := xGLContextIsLegacy(x.GoPointer()) | ||
| 225 | return cret | 246 | return cret | ||
| 226 | } | 247 | } | ||
| @@ -240,6 +261,8 @@ var xGLContextIsShared func(uintptr, uintptr) bool | |||||
| 240 | // Both contexts must be realized for this check to succeed. If either one | 261 | // Both contexts must be realized for this check to succeed. If either one | ||
| 241 | // is not, this function will return %FALSE. | 262 | // is not, this function will return %FALSE. | ||
| 242 | func (x *GLContext) IsShared(OtherVar *GLContext) bool { | 263 | func (x *GLContext) IsShared(OtherVar *GLContext) bool { | ||
| 264 | + | core.LazyRegister(&xGLContextIsShared, "GDK", "gdk_gl_context_is_shared", false) | |||
| 265 | + | ||||
| 243 | cret := xGLContextIsShared(x.GoPointer(), OtherVar.GoPointer()) | 266 | cret := xGLContextIsShared(x.GoPointer(), OtherVar.GoPointer()) | ||
| 244 | return cret | 267 | return cret | ||
| 245 | } | 268 | } | ||
| @@ -248,6 +271,8 @@ var xGLContextMakeCurrent func(uintptr) | |||||
| 248 | 271 | ||||
| 249 | // Makes the @context the current one. | 272 | // Makes the @context the current one. | ||
| 250 | func (x *GLContext) MakeCurrent() { | 273 | func (x *GLContext) MakeCurrent() { | ||
| 274 | + | core.LazyRegister(&xGLContextMakeCurrent, "GDK", "gdk_gl_context_make_current", false) | |||
| 275 | + | ||||
| 251 | xGLContextMakeCurrent(x.GoPointer()) | 276 | xGLContextMakeCurrent(x.GoPointer()) | ||
| 252 | } | 277 | } | ||
| 253 | 278 | ||||
| @@ -257,6 +282,7 @@ var xGLContextRealize func(uintptr, **glib.Error) bool | |||||
| 257 | // | 282 | // | ||
| 258 | // It is safe to call this function on a realized `GdkGLContext`. | 283 | // It is safe to call this function on a realized `GdkGLContext`. | ||
| 259 | func (x *GLContext) Realize() (bool, error) { | 284 | func (x *GLContext) Realize() (bool, error) { | ||
| 285 | + | core.LazyRegister(&xGLContextRealize, "GDK", "gdk_gl_context_realize", false) | |||
| 260 | var cerr *glib.Error | 286 | var cerr *glib.Error | ||
| 261 | 287 | ||||
| 262 | cret := xGLContextRealize(x.GoPointer(), &cerr) | 288 | cret := xGLContextRealize(x.GoPointer(), &cerr) | ||
| @@ -276,6 +302,8 @@ var xGLContextSetAllowedApis func(uintptr, GLAPI) | |||||
| 276 | // | 302 | // | ||
| 277 | // By default, all APIs are allowed. | 303 | // By default, all APIs are allowed. | ||
| 278 | func (x *GLContext) SetAllowedApis(ApisVar GLAPI) { | 304 | func (x *GLContext) SetAllowedApis(ApisVar GLAPI) { | ||
| 305 | + | core.LazyRegister(&xGLContextSetAllowedApis, "GDK", "gdk_gl_context_set_allowed_apis", false) | |||
| 306 | + | ||||
| 279 | xGLContextSetAllowedApis(x.GoPointer(), ApisVar) | 307 | xGLContextSetAllowedApis(x.GoPointer(), ApisVar) | ||
| 280 | } | 308 | } | ||
| 281 | 309 | ||||
| @@ -289,6 +317,8 @@ var xGLContextSetDebugEnabled func(uintptr, bool) | |||||
| 289 | // The `GdkGLContext` must not be realized or made current prior to | 317 | // The `GdkGLContext` must not be realized or made current prior to | ||
| 290 | // calling this function. | 318 | // calling this function. | ||
| 291 | func (x *GLContext) SetDebugEnabled(EnabledVar bool) { | 319 | func (x *GLContext) SetDebugEnabled(EnabledVar bool) { | ||
| 320 | + | core.LazyRegister(&xGLContextSetDebugEnabled, "GDK", "gdk_gl_context_set_debug_enabled", false) | |||
| 321 | + | ||||
| 292 | xGLContextSetDebugEnabled(x.GoPointer(), EnabledVar) | 322 | xGLContextSetDebugEnabled(x.GoPointer(), EnabledVar) | ||
| 293 | } | 323 | } | ||
| 294 | 324 | ||||
| @@ -304,6 +334,8 @@ var xGLContextSetForwardCompatible func(uintptr, bool) | |||||
| 304 | // The `GdkGLContext` must not be realized or made current prior to calling | 334 | // The `GdkGLContext` must not be realized or made current prior to calling | ||
| 305 | // this function. | 335 | // this function. | ||
| 306 | func (x *GLContext) SetForwardCompatible(CompatibleVar bool) { | 336 | func (x *GLContext) SetForwardCompatible(CompatibleVar bool) { | ||
| 337 | + | core.LazyRegister(&xGLContextSetForwardCompatible, "GDK", "gdk_gl_context_set_forward_compatible", false) | |||
| 338 | + | ||||
| 307 | xGLContextSetForwardCompatible(x.GoPointer(), CompatibleVar) | 339 | xGLContextSetForwardCompatible(x.GoPointer(), CompatibleVar) | ||
| 308 | } | 340 | } | ||
| 309 | 341 | ||||
| @@ -319,6 +351,8 @@ var xGLContextSetRequiredVersion func(uintptr, int, int) | |||||
| 319 | // The @context must not be realized or made current prior to calling | 351 | // The @context must not be realized or made current prior to calling | ||
| 320 | // this function. | 352 | // this function. | ||
| 321 | func (x *GLContext) SetRequiredVersion(MajorVar int, MinorVar int) { | 353 | func (x *GLContext) SetRequiredVersion(MajorVar int, MinorVar int) { | ||
| 354 | + | core.LazyRegister(&xGLContextSetRequiredVersion, "GDK", "gdk_gl_context_set_required_version", false) | |||
| 355 | + | ||||
| 322 | xGLContextSetRequiredVersion(x.GoPointer(), MajorVar, MinorVar) | 356 | xGLContextSetRequiredVersion(x.GoPointer(), MajorVar, MinorVar) | ||
| 323 | } | 357 | } | ||
| 324 | 358 | ||||
| @@ -338,6 +372,8 @@ var xGLContextSetUseEs func(uintptr, int) | |||||
| 338 | // after calling [method@Gdk.GLContext.realize] to decide whether to use | 372 | // after calling [method@Gdk.GLContext.realize] to decide whether to use | ||
| 339 | // the OpenGL or OpenGL ES API, extensions, or shaders. | 373 | // the OpenGL or OpenGL ES API, extensions, or shaders. | ||
| 340 | func (x *GLContext) SetUseEs(UseEsVar int) { | 374 | func (x *GLContext) SetUseEs(UseEsVar int) { | ||
| 375 | + | core.LazyRegister(&xGLContextSetUseEs, "GDK", "gdk_gl_context_set_use_es", false) | |||
| 376 | + | ||||
| 341 | xGLContextSetUseEs(x.GoPointer(), UseEsVar) | 377 | xGLContextSetUseEs(x.GoPointer(), UseEsVar) | ||
| 342 | } | 378 | } | ||
| 343 | 379 | ||||
| @@ -359,6 +395,8 @@ var xGLContextClearCurrent func() | |||||
| 359 | // Any OpenGL call after this function returns will be ignored | 395 | // Any OpenGL call after this function returns will be ignored | ||
| 360 | // until [method@Gdk.GLContext.make_current] is called. | 396 | // until [method@Gdk.GLContext.make_current] is called. | ||
| 361 | func GLContextClearCurrent() { | 397 | func GLContextClearCurrent() { | ||
| 398 | + | core.LazyRegister(&xGLContextClearCurrent, "GDK", "gdk_gl_context_clear_current", false) | |||
| 399 | + | ||||
| 362 | xGLContextClearCurrent() | 400 | xGLContextClearCurrent() | ||
| 363 | } | 401 | } | ||
| 364 | 402 | ||||
| @@ -366,6 +404,7 @@ var xGLContextGetCurrent func() uintptr | |||||
| 366 | 404 | ||||
| 367 | // Retrieves the current `GdkGLContext`. | 405 | // Retrieves the current `GdkGLContext`. | ||
| 368 | func GLContextGetCurrent() *GLContext { | 406 | func GLContextGetCurrent() *GLContext { | ||
| 407 | + | core.LazyRegister(&xGLContextGetCurrent, "GDK", "gdk_gl_context_get_current", false) | |||
| 369 | var cls *GLContext | 408 | var cls *GLContext | ||
| 370 | 409 | ||||
| 371 | cret := xGLContextGetCurrent() | 410 | cret := xGLContextGetCurrent() | ||
| @@ -382,39 +421,4 @@ func GLContextGetCurrent() *GLContext { | |||||
| 382 | func init() { | 421 | func init() { | ||
| 383 | core.SetPackageName("GDK", "gtk4") | 422 | core.SetPackageName("GDK", "gtk4") | ||
| 384 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | 423 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | ||
| 385 | - | var libs []uintptr | |||
| 386 | - | for _, libPath := range core.GetPaths("GDK") { | |||
| 387 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 388 | - | if err != nil { | |||
| 389 | - | panic(err) | |||
| 390 | - | } | |||
| 391 | - | libs = append(libs, lib) | |||
| 392 | - | } | |||
| 393 | - | ||||
| 394 | - | core.PuregoSafeRegister(&xGlErrorQuark, libs, "gdk_gl_error_quark") | |||
| 395 | - | ||||
| 396 | - | core.PuregoSafeRegister(&xGLContextGLibType, libs, "gdk_gl_context_get_type") | |||
| 397 | - | ||||
| 398 | - | core.PuregoSafeRegister(&xGLContextGetAllowedApis, libs, "gdk_gl_context_get_allowed_apis") | |||
| 399 | - | core.PuregoSafeRegister(&xGLContextGetApi, libs, "gdk_gl_context_get_api") | |||
| 400 | - | core.PuregoSafeRegister(&xGLContextGetDebugEnabled, libs, "gdk_gl_context_get_debug_enabled") | |||
| 401 | - | core.PuregoSafeRegister(&xGLContextGetDisplay, libs, "gdk_gl_context_get_display") | |||
| 402 | - | core.PuregoSafeRegister(&xGLContextGetForwardCompatible, libs, "gdk_gl_context_get_forward_compatible") | |||
| 403 | - | core.PuregoSafeRegister(&xGLContextGetRequiredVersion, libs, "gdk_gl_context_get_required_version") | |||
| 404 | - | core.PuregoSafeRegister(&xGLContextGetSharedContext, libs, "gdk_gl_context_get_shared_context") | |||
| 405 | - | core.PuregoSafeRegister(&xGLContextGetSurface, libs, "gdk_gl_context_get_surface") | |||
| 406 | - | core.PuregoSafeRegister(&xGLContextGetUseEs, libs, "gdk_gl_context_get_use_es") | |||
| 407 | - | core.PuregoSafeRegister(&xGLContextGetVersion, libs, "gdk_gl_context_get_version") | |||
| 408 | - | core.PuregoSafeRegister(&xGLContextIsLegacy, libs, "gdk_gl_context_is_legacy") | |||
| 409 | - | core.PuregoSafeRegister(&xGLContextIsShared, libs, "gdk_gl_context_is_shared") | |||
| 410 | - | core.PuregoSafeRegister(&xGLContextMakeCurrent, libs, "gdk_gl_context_make_current") | |||
| 411 | - | core.PuregoSafeRegister(&xGLContextRealize, libs, "gdk_gl_context_realize") | |||
| 412 | - | core.PuregoSafeRegister(&xGLContextSetAllowedApis, libs, "gdk_gl_context_set_allowed_apis") | |||
| 413 | - | core.PuregoSafeRegister(&xGLContextSetDebugEnabled, libs, "gdk_gl_context_set_debug_enabled") | |||
| 414 | - | core.PuregoSafeRegister(&xGLContextSetForwardCompatible, libs, "gdk_gl_context_set_forward_compatible") | |||
| 415 | - | core.PuregoSafeRegister(&xGLContextSetRequiredVersion, libs, "gdk_gl_context_set_required_version") | |||
| 416 | - | core.PuregoSafeRegister(&xGLContextSetUseEs, libs, "gdk_gl_context_set_use_es") | |||
| 417 | - | ||||
| 418 | - | core.PuregoSafeRegister(&xGLContextClearCurrent, libs, "gdk_gl_context_clear_current") | |||
| 419 | - | core.PuregoSafeRegister(&xGLContextGetCurrent, libs, "gdk_gl_context_get_current") | |||
| 420 | } | 424 | } | ||