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