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 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkgltexture.go +15 -4 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkgltexturebuilder.go +35 -41 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkkeys.go +22 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkmemorytexture.go +13 -2 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkmemorytexturebuilder.go +35 -42 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkmonitor.go +27 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkpaintable.go +33 -63 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkpango.go +12 -4 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkpixbuf.go +12 -2 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkpopup.go +26 -47 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkpopuplayout.go +32 -36 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkrgba.go +21 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkseat.go +20 -11 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdksnapshot.go +0 -7 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdksurface.go +40 -46
| @@ -5,6 +5,7 @@ import ( | |||
| 5 | 5 | "structs" | |
| 6 | 6 | "unsafe" | |
| 7 | 7 | ||
| 8 | + | "github.com/bnema/purego" | |
| 8 | 9 | "github.com/bnema/puregotk/pkg/core" | |
| 9 | 10 | "github.com/bnema/puregotk/v4/cairo" | |
| 10 | 11 | "github.com/bnema/puregotk/v4/glib" | |
| @@ -44,7 +45,6 @@ type Surface struct { | |||
| 44 | 45 | var xSurfaceGLibType func() types.GType | |
| 45 | 46 | ||
| 46 | 47 | func SurfaceGLibType() types.GType { | |
| 47 | - | core.LazyRegister(&xSurfaceGLibType, "GDK", "gdk_surface_get_type", false) | |
| 48 | 48 | return xSurfaceGLibType() | |
| 49 | 49 | } | |
| 50 | 50 | ||
| @@ -61,7 +61,6 @@ var xNewSurfacePopup func(uintptr, bool) uintptr | |||
| 61 | 61 | // The surface will be attached to @parent and can be positioned | |
| 62 | 62 | // relative to it using [method@Gdk.Popup.present]. | |
| 63 | 63 | func NewSurfacePopup(ParentVar *Surface, AutohideVar bool) *Surface { | |
| 64 | - | core.LazyRegister(&xNewSurfacePopup, "GDK", "gdk_surface_new_popup", false) | |
| 65 | 64 | var cls *Surface | |
| 66 | 65 | ||
| 67 | 66 | cret := xNewSurfacePopup(ParentVar.GoPointer(), AutohideVar) | |
| @@ -78,7 +77,6 @@ var xNewSurfaceToplevel func(uintptr) uintptr | |||
| 78 | 77 | ||
| 79 | 78 | // Creates a new toplevel surface. | |
| 80 | 79 | func NewSurfaceToplevel(DisplayVar *Display) *Surface { | |
| 81 | - | core.LazyRegister(&xNewSurfaceToplevel, "GDK", "gdk_surface_new_toplevel", false) | |
| 82 | 80 | var cls *Surface | |
| 83 | 81 | ||
| 84 | 82 | cret := xNewSurfaceToplevel(DisplayVar.GoPointer()) | |
| @@ -98,8 +96,6 @@ var xSurfaceBeep func(uintptr) | |||
| 98 | 96 | // If the display of @surface does not support per-surface beeps, | |
| 99 | 97 | // emits a short beep on the display just as [method@Gdk.Display.beep]. | |
| 100 | 98 | func (x *Surface) Beep() { | |
| 101 | - | core.LazyRegister(&xSurfaceBeep, "GDK", "gdk_surface_beep", false) | |
| 102 | - | ||
| 103 | 99 | xSurfaceBeep(x.GoPointer()) | |
| 104 | 100 | } | |
| 105 | 101 | ||
| @@ -107,7 +103,6 @@ var xSurfaceCreateCairoContext func(uintptr) uintptr | |||
| 107 | 103 | ||
| 108 | 104 | // Creates a new `GdkCairoContext` for rendering on @surface. | |
| 109 | 105 | func (x *Surface) CreateCairoContext() *CairoContext { | |
| 110 | - | core.LazyRegister(&xSurfaceCreateCairoContext, "GDK", "gdk_surface_create_cairo_context", false) | |
| 111 | 106 | var cls *CairoContext | |
| 112 | 107 | ||
| 113 | 108 | cret := xSurfaceCreateCairoContext(x.GoPointer()) | |
| @@ -129,7 +124,6 @@ var xSurfaceCreateGlContext func(uintptr, **glib.Error) uintptr | |||
| 129 | 124 | // Before using the returned `GdkGLContext`, you will need to | |
| 130 | 125 | // call [method@Gdk.GLContext.make_current] or [method@Gdk.GLContext.realize]. | |
| 131 | 126 | func (x *Surface) CreateGlContext() (*GLContext, error) { | |
| 132 | - | core.LazyRegister(&xSurfaceCreateGlContext, "GDK", "gdk_surface_create_gl_context", false) | |
| 133 | 127 | var cls *GLContext | |
| 134 | 128 | var cerr *glib.Error | |
| 135 | 129 | ||
| @@ -164,8 +158,6 @@ var xSurfaceCreateSimilarSurface func(uintptr, cairo.Content, int, int) uintptr | |||
| 164 | 158 | // pointer to a “nil” surface if @other is already in an error state | |
| 165 | 159 | // or any other error occurs. | |
| 166 | 160 | func (x *Surface) CreateSimilarSurface(ContentVar cairo.Content, WidthVar int, HeightVar int) *cairo.Surface { | |
| 167 | - | core.LazyRegister(&xSurfaceCreateSimilarSurface, "GDK", "gdk_surface_create_similar_surface", false) | |
| 168 | - | ||
| 169 | 161 | cret := xSurfaceCreateSimilarSurface(x.GoPointer(), ContentVar, WidthVar, HeightVar) | |
| 170 | 162 | if cret == 0 { | |
| 171 | 163 | return nil | |
| @@ -177,7 +169,6 @@ var xSurfaceCreateVulkanContext func(uintptr, **glib.Error) uintptr | |||
| 177 | 169 | ||
| 178 | 170 | // Sets an error and returns %NULL. | |
| 179 | 171 | func (x *Surface) CreateVulkanContext() (*VulkanContext, error) { | |
| 180 | - | core.LazyRegister(&xSurfaceCreateVulkanContext, "GDK", "gdk_surface_create_vulkan_context", false) | |
| 181 | 172 | var cls *VulkanContext | |
| 182 | 173 | var cerr *glib.Error | |
| 183 | 174 | ||
| @@ -206,8 +197,6 @@ var xSurfaceDestroy func(uintptr) | |||
| 206 | 197 | // reference count reaches zero. You must call this function yourself | |
| 207 | 198 | // before that happens. | |
| 208 | 199 | func (x *Surface) Destroy() { | |
| 209 | - | core.LazyRegister(&xSurfaceDestroy, "GDK", "gdk_surface_destroy", false) | |
| 210 | - | ||
| 211 | 200 | xSurfaceDestroy(x.GoPointer()) | |
| 212 | 201 | } | |
| 213 | 202 | ||
| @@ -221,7 +210,6 @@ var xSurfaceGetCursor func(uintptr) uintptr | |||
| 221 | 210 | // | |
| 222 | 211 | // Use [method@Gdk.Surface.set_cursor] to unset the cursor of the surface. | |
| 223 | 212 | func (x *Surface) GetCursor() *Cursor { | |
| 224 | - | core.LazyRegister(&xSurfaceGetCursor, "GDK", "gdk_surface_get_cursor", false) | |
| 225 | 213 | var cls *Cursor | |
| 226 | 214 | ||
| 227 | 215 | cret := xSurfaceGetCursor(x.GoPointer()) | |
| @@ -245,7 +233,6 @@ var xSurfaceGetDeviceCursor func(uintptr, uintptr) uintptr | |||
| 245 | 233 | // | |
| 246 | 234 | // Use [method@Gdk.Surface.set_cursor] to unset the cursor of the surface. | |
| 247 | 235 | func (x *Surface) GetDeviceCursor(DeviceVar *Device) *Cursor { | |
| 248 | - | core.LazyRegister(&xSurfaceGetDeviceCursor, "GDK", "gdk_surface_get_device_cursor", false) | |
| 249 | 236 | var cls *Cursor | |
| 250 | 237 | ||
| 251 | 238 | cret := xSurfaceGetDeviceCursor(x.GoPointer(), DeviceVar.GoPointer()) | |
| @@ -266,8 +253,6 @@ var xSurfaceGetDevicePosition func(uintptr, uintptr, *float64, *float64, *Modifi | |||
| 266 | 253 | // The position is given in coordinates relative to the upper | |
| 267 | 254 | // left corner of @surface. | |
| 268 | 255 | func (x *Surface) GetDevicePosition(DeviceVar *Device, XVar *float64, YVar *float64, MaskVar *ModifierType) bool { | |
| 269 | - | core.LazyRegister(&xSurfaceGetDevicePosition, "GDK", "gdk_surface_get_device_position", false) | |
| 270 | - | ||
| 271 | 256 | cret := xSurfaceGetDevicePosition(x.GoPointer(), DeviceVar.GoPointer(), XVar, YVar, MaskVar) | |
| 272 | 257 | return cret | |
| 273 | 258 | } | |
| @@ -276,7 +261,6 @@ var xSurfaceGetDisplay func(uintptr) uintptr | |||
| 276 | 261 | ||
| 277 | 262 | // Gets the `GdkDisplay` associated with a `GdkSurface`. | |
| 278 | 263 | func (x *Surface) GetDisplay() *Display { | |
| 279 | - | core.LazyRegister(&xSurfaceGetDisplay, "GDK", "gdk_surface_get_display", false) | |
| 280 | 264 | var cls *Display | |
| 281 | 265 | ||
| 282 | 266 | cret := xSurfaceGetDisplay(x.GoPointer()) | |
| @@ -297,7 +281,6 @@ var xSurfaceGetFrameClock func(uintptr) uintptr | |||
| 297 | 281 | // The frame clock for a surface never changes unless the surface is | |
| 298 | 282 | // reparented to a new toplevel surface. | |
| 299 | 283 | func (x *Surface) GetFrameClock() *FrameClock { | |
| 300 | - | core.LazyRegister(&xSurfaceGetFrameClock, "GDK", "gdk_surface_get_frame_clock", false) | |
| 301 | 284 | var cls *FrameClock | |
| 302 | 285 | ||
| 303 | 286 | cret := xSurfaceGetFrameClock(x.GoPointer()) | |
| @@ -318,8 +301,6 @@ var xSurfaceGetHeight func(uintptr) int | |||
| 318 | 301 | // Surface size is reported in ”application pixels”, not | |
| 319 | 302 | // ”device pixels” (see [method@Gdk.Surface.get_scale_factor]). | |
| 320 | 303 | func (x *Surface) GetHeight() int { | |
| 321 | - | core.LazyRegister(&xSurfaceGetHeight, "GDK", "gdk_surface_get_height", false) | |
| 322 | - | ||
| 323 | 304 | cret := xSurfaceGetHeight(x.GoPointer()) | |
| 324 | 305 | return cret | |
| 325 | 306 | } | |
| @@ -331,8 +312,6 @@ var xSurfaceGetMapped func(uintptr) bool | |||
| 331 | 312 | // A surface is mapped with [method@Gdk.Toplevel.present] | |
| 332 | 313 | // or [method@Gdk.Popup.present]. | |
| 333 | 314 | func (x *Surface) GetMapped() bool { | |
| 334 | - | core.LazyRegister(&xSurfaceGetMapped, "GDK", "gdk_surface_get_mapped", false) | |
| 335 | - | ||
| 336 | 315 | cret := xSurfaceGetMapped(x.GoPointer()) | |
| 337 | 316 | return cret | |
| 338 | 317 | } | |
| @@ -351,8 +330,6 @@ var xSurfaceGetScale func(uintptr) float64 | |||
| 351 | 330 | // | |
| 352 | 331 | // The scale may change during the lifetime of the surface. | |
| 353 | 332 | func (x *Surface) GetScale() float64 { | |
| 354 | - | core.LazyRegister(&xSurfaceGetScale, "GDK", "gdk_surface_get_scale", false) | |
| 355 | - | ||
| 356 | 333 | cret := xSurfaceGetScale(x.GoPointer()) | |
| 357 | 334 | return cret | |
| 358 | 335 | } | |
| @@ -371,8 +348,6 @@ var xSurfaceGetScaleFactor func(uintptr) int | |||
| 371 | 348 | // | |
| 372 | 349 | // The scale factor may change during the lifetime of the surface. | |
| 373 | 350 | func (x *Surface) GetScaleFactor() int { | |
| 374 | - | core.LazyRegister(&xSurfaceGetScaleFactor, "GDK", "gdk_surface_get_scale_factor", false) | |
| 375 | - | ||
| 376 | 351 | cret := xSurfaceGetScaleFactor(x.GoPointer()) | |
| 377 | 352 | return cret | |
| 378 | 353 | } | |
| @@ -384,8 +359,6 @@ var xSurfaceGetWidth func(uintptr) int | |||
| 384 | 359 | // Surface size is reported in ”application pixels”, not | |
| 385 | 360 | // ”device pixels” (see [method@Gdk.Surface.get_scale_factor]). | |
| 386 | 361 | func (x *Surface) GetWidth() int { | |
| 387 | - | core.LazyRegister(&xSurfaceGetWidth, "GDK", "gdk_surface_get_width", false) | |
| 388 | - | ||
| 389 | 362 | cret := xSurfaceGetWidth(x.GoPointer()) | |
| 390 | 363 | return cret | |
| 391 | 364 | } | |
| @@ -399,8 +372,6 @@ var xSurfaceHide func(uintptr) | |||
| 399 | 372 | // they won’t be displayed. Normally done automatically as | |
| 400 | 373 | // part of [gtk_widget_hide()](../gtk4/method.Widget.hide.html). | |
| 401 | 374 | func (x *Surface) Hide() { | |
| 402 | - | core.LazyRegister(&xSurfaceHide, "GDK", "gdk_surface_hide", false) | |
| 403 | - | ||
| 404 | 375 | xSurfaceHide(x.GoPointer()) | |
| 405 | 376 | } | |
| 406 | 377 | ||
| @@ -408,8 +379,6 @@ var xSurfaceIsDestroyed func(uintptr) bool | |||
| 408 | 379 | ||
| 409 | 380 | // Check to see if a surface is destroyed. | |
| 410 | 381 | func (x *Surface) IsDestroyed() bool { | |
| 411 | - | core.LazyRegister(&xSurfaceIsDestroyed, "GDK", "gdk_surface_is_destroyed", false) | |
| 412 | - | ||
| 413 | 382 | cret := xSurfaceIsDestroyed(x.GoPointer()) | |
| 414 | 383 | return cret | |
| 415 | 384 | } | |
| @@ -422,8 +391,6 @@ var xSurfaceQueueRender func(uintptr) | |||
| 422 | 391 | // This function is useful for implementations that track invalid | |
| 423 | 392 | // regions on their own. | |
| 424 | 393 | func (x *Surface) QueueRender() { | |
| 425 | - | core.LazyRegister(&xSurfaceQueueRender, "GDK", "gdk_surface_queue_render", false) | |
| 426 | - | ||
| 427 | 394 | xSurfaceQueueRender(x.GoPointer()) | |
| 428 | 395 | } | |
| 429 | 396 | ||
| @@ -433,8 +400,6 @@ var xSurfaceRequestLayout func(uintptr) | |||
| 433 | 400 | // | |
| 434 | 401 | // See [method@Gdk.FrameClock.request_phase]. | |
| 435 | 402 | func (x *Surface) RequestLayout() { | |
| 436 | - | core.LazyRegister(&xSurfaceRequestLayout, "GDK", "gdk_surface_request_layout", false) | |
| 437 | - | ||
| 438 | 403 | xSurfaceRequestLayout(x.GoPointer()) | |
| 439 | 404 | } | |
| 440 | 405 | ||
| @@ -449,8 +414,6 @@ var xSurfaceSetCursor func(uintptr, uintptr) | |||
| 449 | 414 | // Use [ctor@Gdk.Cursor.new_from_name] or [ctor@Gdk.Cursor.new_from_texture] | |
| 450 | 415 | // to create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. | |
| 451 | 416 | func (x *Surface) SetCursor(CursorVar *Cursor) { | |
| 452 | - | core.LazyRegister(&xSurfaceSetCursor, "GDK", "gdk_surface_set_cursor", false) | |
| 453 | - | ||
| 454 | 417 | xSurfaceSetCursor(x.GoPointer(), CursorVar.GoPointer()) | |
| 455 | 418 | } | |
| 456 | 419 | ||
| @@ -464,8 +427,6 @@ var xSurfaceSetDeviceCursor func(uintptr, uintptr, uintptr) | |||
| 464 | 427 | // Use [ctor@Gdk.Cursor.new_from_name] or [ctor@Gdk.Cursor.new_from_texture] | |
| 465 | 428 | // to create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. | |
| 466 | 429 | func (x *Surface) SetDeviceCursor(DeviceVar *Device, CursorVar *Cursor) { | |
| 467 | - | core.LazyRegister(&xSurfaceSetDeviceCursor, "GDK", "gdk_surface_set_device_cursor", false) | |
| 468 | - | ||
| 469 | 430 | xSurfaceSetDeviceCursor(x.GoPointer(), DeviceVar.GoPointer(), CursorVar.GoPointer()) | |
| 470 | 431 | } | |
| 471 | 432 | ||
| @@ -486,8 +447,6 @@ var xSurfaceSetInputRegion func(uintptr, *cairo.Region) | |||
| 486 | 447 | // Use [method@Gdk.Display.supports_input_shapes] to find out if | |
| 487 | 448 | // a particular backend supports input regions. | |
| 488 | 449 | func (x *Surface) SetInputRegion(RegionVar *cairo.Region) { | |
| 489 | - | core.LazyRegister(&xSurfaceSetInputRegion, "GDK", "gdk_surface_set_input_region", false) | |
| 490 | - | ||
| 491 | 450 | xSurfaceSetInputRegion(x.GoPointer(), RegionVar) | |
| 492 | 451 | } | |
| 493 | 452 | ||
| @@ -509,8 +468,6 @@ var xSurfaceSetOpaqueRegion func(uintptr, *cairo.Region) | |||
| 509 | 468 | // background is not opaque, please update this property in your | |
| 510 | 469 | // [GtkWidgetClass.css_changed](../gtk4/vfunc.Widget.css_changed.html) handler. | |
| 511 | 470 | func (x *Surface) SetOpaqueRegion(RegionVar *cairo.Region) { | |
| 512 | - | core.LazyRegister(&xSurfaceSetOpaqueRegion, "GDK", "gdk_surface_set_opaque_region", false) | |
| 513 | - | ||
| 514 | 471 | xSurfaceSetOpaqueRegion(x.GoPointer(), RegionVar) | |
| 515 | 472 | } | |
| 516 | 473 | ||
| @@ -521,8 +478,6 @@ var xSurfaceTranslateCoordinates func(uintptr, uintptr, *float64, *float64) bool | |||
| 521 | 478 | // Note that this only works if @to and @from are popups or | |
| 522 | 479 | // transient-for to the same toplevel (directly or indirectly). | |
| 523 | 480 | func (x *Surface) TranslateCoordinates(ToVar *Surface, XVar *float64, YVar *float64) bool { | |
| 524 | - | core.LazyRegister(&xSurfaceTranslateCoordinates, "GDK", "gdk_surface_translate_coordinates", false) | |
| 525 | - | ||
| 526 | 481 | cret := xSurfaceTranslateCoordinates(x.GoPointer(), ToVar.GoPointer(), XVar, YVar) | |
| 527 | 482 | return cret | |
| 528 | 483 | } | |
| @@ -707,4 +662,43 @@ func (x *Surface) ConnectRender(cb *func(Surface, uintptr) bool) uint { | |||
| 707 | 662 | func init() { | |
| 708 | 663 | core.SetPackageName("GDK", "gtk4") | |
| 709 | 664 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | |
| 665 | + | var libs []uintptr | |
| 666 | + | for _, libPath := range core.GetPaths("GDK") { | |
| 667 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 668 | + | if err != nil { | |
| 669 | + | panic(err) | |
| 670 | + | } | |
| 671 | + | libs = append(libs, lib) | |
| 672 | + | } | |
| 673 | + | ||
| 674 | + | core.PuregoSafeRegister(&xSurfaceGLibType, libs, "gdk_surface_get_type") | |
| 675 | + | ||
| 676 | + | core.PuregoSafeRegister(&xNewSurfacePopup, libs, "gdk_surface_new_popup") | |
| 677 | + | core.PuregoSafeRegister(&xNewSurfaceToplevel, libs, "gdk_surface_new_toplevel") | |
| 678 | + | ||
| 679 | + | core.PuregoSafeRegister(&xSurfaceBeep, libs, "gdk_surface_beep") | |
| 680 | + | core.PuregoSafeRegister(&xSurfaceCreateCairoContext, libs, "gdk_surface_create_cairo_context") | |
| 681 | + | core.PuregoSafeRegister(&xSurfaceCreateGlContext, libs, "gdk_surface_create_gl_context") | |
| 682 | + | core.PuregoSafeRegister(&xSurfaceCreateSimilarSurface, libs, "gdk_surface_create_similar_surface") | |
| 683 | + | core.PuregoSafeRegister(&xSurfaceCreateVulkanContext, libs, "gdk_surface_create_vulkan_context") | |
| 684 | + | core.PuregoSafeRegister(&xSurfaceDestroy, libs, "gdk_surface_destroy") | |
| 685 | + | core.PuregoSafeRegister(&xSurfaceGetCursor, libs, "gdk_surface_get_cursor") | |
| 686 | + | core.PuregoSafeRegister(&xSurfaceGetDeviceCursor, libs, "gdk_surface_get_device_cursor") | |
| 687 | + | core.PuregoSafeRegister(&xSurfaceGetDevicePosition, libs, "gdk_surface_get_device_position") | |
| 688 | + | core.PuregoSafeRegister(&xSurfaceGetDisplay, libs, "gdk_surface_get_display") | |
| 689 | + | core.PuregoSafeRegister(&xSurfaceGetFrameClock, libs, "gdk_surface_get_frame_clock") | |
| 690 | + | core.PuregoSafeRegister(&xSurfaceGetHeight, libs, "gdk_surface_get_height") | |
| 691 | + | core.PuregoSafeRegister(&xSurfaceGetMapped, libs, "gdk_surface_get_mapped") | |
| 692 | + | core.PuregoSafeRegister(&xSurfaceGetScale, libs, "gdk_surface_get_scale") | |
| 693 | + | core.PuregoSafeRegister(&xSurfaceGetScaleFactor, libs, "gdk_surface_get_scale_factor") | |
| 694 | + | core.PuregoSafeRegister(&xSurfaceGetWidth, libs, "gdk_surface_get_width") | |
| 695 | + | core.PuregoSafeRegister(&xSurfaceHide, libs, "gdk_surface_hide") | |
| 696 | + | core.PuregoSafeRegister(&xSurfaceIsDestroyed, libs, "gdk_surface_is_destroyed") | |
| 697 | + | core.PuregoSafeRegister(&xSurfaceQueueRender, libs, "gdk_surface_queue_render") | |
| 698 | + | core.PuregoSafeRegister(&xSurfaceRequestLayout, libs, "gdk_surface_request_layout") | |
| 699 | + | core.PuregoSafeRegister(&xSurfaceSetCursor, libs, "gdk_surface_set_cursor") | |
| 700 | + | core.PuregoSafeRegister(&xSurfaceSetDeviceCursor, libs, "gdk_surface_set_device_cursor") | |
| 701 | + | core.PuregoSafeRegister(&xSurfaceSetInputRegion, libs, "gdk_surface_set_input_region") | |
| 702 | + | core.PuregoSafeRegister(&xSurfaceSetOpaqueRegion, libs, "gdk_surface_set_opaque_region") | |
| 703 | + | core.PuregoSafeRegister(&xSurfaceTranslateCoordinates, libs, "gdk_surface_translate_coordinates") | |
| 710 | 704 | } | |
| @@ -5,6 +5,7 @@ import ( | |||||
| 5 | "structs" | 5 | "structs" | ||
| 6 | "unsafe" | 6 | "unsafe" | ||
| 7 | 7 | ||||
| 8 | + | "github.com/bnema/purego" | |||
| 8 | "github.com/bnema/puregotk/pkg/core" | 9 | "github.com/bnema/puregotk/pkg/core" | ||
| 9 | "github.com/bnema/puregotk/v4/cairo" | 10 | "github.com/bnema/puregotk/v4/cairo" | ||
| 10 | "github.com/bnema/puregotk/v4/glib" | 11 | "github.com/bnema/puregotk/v4/glib" | ||
| @@ -44,7 +45,6 @@ type Surface struct { | |||||
| 44 | var xSurfaceGLibType func() types.GType | 45 | var xSurfaceGLibType func() types.GType | ||
| 45 | 46 | ||||
| 46 | func SurfaceGLibType() types.GType { | 47 | func SurfaceGLibType() types.GType { | ||
| 47 | - | core.LazyRegister(&xSurfaceGLibType, "GDK", "gdk_surface_get_type", false) | |||
| 48 | return xSurfaceGLibType() | 48 | return xSurfaceGLibType() | ||
| 49 | } | 49 | } | ||
| 50 | 50 | ||||
| @@ -61,7 +61,6 @@ var xNewSurfacePopup func(uintptr, bool) uintptr | |||||
| 61 | // The surface will be attached to @parent and can be positioned | 61 | // The surface will be attached to @parent and can be positioned | ||
| 62 | // relative to it using [method@Gdk.Popup.present]. | 62 | // relative to it using [method@Gdk.Popup.present]. | ||
| 63 | func NewSurfacePopup(ParentVar *Surface, AutohideVar bool) *Surface { | 63 | func NewSurfacePopup(ParentVar *Surface, AutohideVar bool) *Surface { | ||
| 64 | - | core.LazyRegister(&xNewSurfacePopup, "GDK", "gdk_surface_new_popup", false) | |||
| 65 | var cls *Surface | 64 | var cls *Surface | ||
| 66 | 65 | ||||
| 67 | cret := xNewSurfacePopup(ParentVar.GoPointer(), AutohideVar) | 66 | cret := xNewSurfacePopup(ParentVar.GoPointer(), AutohideVar) | ||
| @@ -78,7 +77,6 @@ var xNewSurfaceToplevel func(uintptr) uintptr | |||||
| 78 | 77 | ||||
| 79 | // Creates a new toplevel surface. | 78 | // Creates a new toplevel surface. | ||
| 80 | func NewSurfaceToplevel(DisplayVar *Display) *Surface { | 79 | func NewSurfaceToplevel(DisplayVar *Display) *Surface { | ||
| 81 | - | core.LazyRegister(&xNewSurfaceToplevel, "GDK", "gdk_surface_new_toplevel", false) | |||
| 82 | var cls *Surface | 80 | var cls *Surface | ||
| 83 | 81 | ||||
| 84 | cret := xNewSurfaceToplevel(DisplayVar.GoPointer()) | 82 | cret := xNewSurfaceToplevel(DisplayVar.GoPointer()) | ||
| @@ -98,8 +96,6 @@ var xSurfaceBeep func(uintptr) | |||||
| 98 | // If the display of @surface does not support per-surface beeps, | 96 | // If the display of @surface does not support per-surface beeps, | ||
| 99 | // emits a short beep on the display just as [method@Gdk.Display.beep]. | 97 | // emits a short beep on the display just as [method@Gdk.Display.beep]. | ||
| 100 | func (x *Surface) Beep() { | 98 | func (x *Surface) Beep() { | ||
| 101 | - | core.LazyRegister(&xSurfaceBeep, "GDK", "gdk_surface_beep", false) | |||
| 102 | - | ||||
| 103 | xSurfaceBeep(x.GoPointer()) | 99 | xSurfaceBeep(x.GoPointer()) | ||
| 104 | } | 100 | } | ||
| 105 | 101 | ||||
| @@ -107,7 +103,6 @@ var xSurfaceCreateCairoContext func(uintptr) uintptr | |||||
| 107 | 103 | ||||
| 108 | // Creates a new `GdkCairoContext` for rendering on @surface. | 104 | // Creates a new `GdkCairoContext` for rendering on @surface. | ||
| 109 | func (x *Surface) CreateCairoContext() *CairoContext { | 105 | func (x *Surface) CreateCairoContext() *CairoContext { | ||
| 110 | - | core.LazyRegister(&xSurfaceCreateCairoContext, "GDK", "gdk_surface_create_cairo_context", false) | |||
| 111 | var cls *CairoContext | 106 | var cls *CairoContext | ||
| 112 | 107 | ||||
| 113 | cret := xSurfaceCreateCairoContext(x.GoPointer()) | 108 | cret := xSurfaceCreateCairoContext(x.GoPointer()) | ||
| @@ -129,7 +124,6 @@ var xSurfaceCreateGlContext func(uintptr, **glib.Error) uintptr | |||||
| 129 | // Before using the returned `GdkGLContext`, you will need to | 124 | // Before using the returned `GdkGLContext`, you will need to | ||
| 130 | // call [method@Gdk.GLContext.make_current] or [method@Gdk.GLContext.realize]. | 125 | // call [method@Gdk.GLContext.make_current] or [method@Gdk.GLContext.realize]. | ||
| 131 | func (x *Surface) CreateGlContext() (*GLContext, error) { | 126 | func (x *Surface) CreateGlContext() (*GLContext, error) { | ||
| 132 | - | core.LazyRegister(&xSurfaceCreateGlContext, "GDK", "gdk_surface_create_gl_context", false) | |||
| 133 | var cls *GLContext | 127 | var cls *GLContext | ||
| 134 | var cerr *glib.Error | 128 | var cerr *glib.Error | ||
| 135 | 129 | ||||
| @@ -164,8 +158,6 @@ var xSurfaceCreateSimilarSurface func(uintptr, cairo.Content, int, int) uintptr | |||||
| 164 | // pointer to a “nil” surface if @other is already in an error state | 158 | // pointer to a “nil” surface if @other is already in an error state | ||
| 165 | // or any other error occurs. | 159 | // or any other error occurs. | ||
| 166 | func (x *Surface) CreateSimilarSurface(ContentVar cairo.Content, WidthVar int, HeightVar int) *cairo.Surface { | 160 | func (x *Surface) CreateSimilarSurface(ContentVar cairo.Content, WidthVar int, HeightVar int) *cairo.Surface { | ||
| 167 | - | core.LazyRegister(&xSurfaceCreateSimilarSurface, "GDK", "gdk_surface_create_similar_surface", false) | |||
| 168 | - | ||||
| 169 | cret := xSurfaceCreateSimilarSurface(x.GoPointer(), ContentVar, WidthVar, HeightVar) | 161 | cret := xSurfaceCreateSimilarSurface(x.GoPointer(), ContentVar, WidthVar, HeightVar) | ||
| 170 | if cret == 0 { | 162 | if cret == 0 { | ||
| 171 | return nil | 163 | return nil | ||
| @@ -177,7 +169,6 @@ var xSurfaceCreateVulkanContext func(uintptr, **glib.Error) uintptr | |||||
| 177 | 169 | ||||
| 178 | // Sets an error and returns %NULL. | 170 | // Sets an error and returns %NULL. | ||
| 179 | func (x *Surface) CreateVulkanContext() (*VulkanContext, error) { | 171 | func (x *Surface) CreateVulkanContext() (*VulkanContext, error) { | ||
| 180 | - | core.LazyRegister(&xSurfaceCreateVulkanContext, "GDK", "gdk_surface_create_vulkan_context", false) | |||
| 181 | var cls *VulkanContext | 172 | var cls *VulkanContext | ||
| 182 | var cerr *glib.Error | 173 | var cerr *glib.Error | ||
| 183 | 174 | ||||
| @@ -206,8 +197,6 @@ var xSurfaceDestroy func(uintptr) | |||||
| 206 | // reference count reaches zero. You must call this function yourself | 197 | // reference count reaches zero. You must call this function yourself | ||
| 207 | // before that happens. | 198 | // before that happens. | ||
| 208 | func (x *Surface) Destroy() { | 199 | func (x *Surface) Destroy() { | ||
| 209 | - | core.LazyRegister(&xSurfaceDestroy, "GDK", "gdk_surface_destroy", false) | |||
| 210 | - | ||||
| 211 | xSurfaceDestroy(x.GoPointer()) | 200 | xSurfaceDestroy(x.GoPointer()) | ||
| 212 | } | 201 | } | ||
| 213 | 202 | ||||
| @@ -221,7 +210,6 @@ var xSurfaceGetCursor func(uintptr) uintptr | |||||
| 221 | // | 210 | // | ||
| 222 | // Use [method@Gdk.Surface.set_cursor] to unset the cursor of the surface. | 211 | // Use [method@Gdk.Surface.set_cursor] to unset the cursor of the surface. | ||
| 223 | func (x *Surface) GetCursor() *Cursor { | 212 | func (x *Surface) GetCursor() *Cursor { | ||
| 224 | - | core.LazyRegister(&xSurfaceGetCursor, "GDK", "gdk_surface_get_cursor", false) | |||
| 225 | var cls *Cursor | 213 | var cls *Cursor | ||
| 226 | 214 | ||||
| 227 | cret := xSurfaceGetCursor(x.GoPointer()) | 215 | cret := xSurfaceGetCursor(x.GoPointer()) | ||
| @@ -245,7 +233,6 @@ var xSurfaceGetDeviceCursor func(uintptr, uintptr) uintptr | |||||
| 245 | // | 233 | // | ||
| 246 | // Use [method@Gdk.Surface.set_cursor] to unset the cursor of the surface. | 234 | // Use [method@Gdk.Surface.set_cursor] to unset the cursor of the surface. | ||
| 247 | func (x *Surface) GetDeviceCursor(DeviceVar *Device) *Cursor { | 235 | func (x *Surface) GetDeviceCursor(DeviceVar *Device) *Cursor { | ||
| 248 | - | core.LazyRegister(&xSurfaceGetDeviceCursor, "GDK", "gdk_surface_get_device_cursor", false) | |||
| 249 | var cls *Cursor | 236 | var cls *Cursor | ||
| 250 | 237 | ||||
| 251 | cret := xSurfaceGetDeviceCursor(x.GoPointer(), DeviceVar.GoPointer()) | 238 | cret := xSurfaceGetDeviceCursor(x.GoPointer(), DeviceVar.GoPointer()) | ||
| @@ -266,8 +253,6 @@ var xSurfaceGetDevicePosition func(uintptr, uintptr, *float64, *float64, *Modifi | |||||
| 266 | // The position is given in coordinates relative to the upper | 253 | // The position is given in coordinates relative to the upper | ||
| 267 | // left corner of @surface. | 254 | // left corner of @surface. | ||
| 268 | func (x *Surface) GetDevicePosition(DeviceVar *Device, XVar *float64, YVar *float64, MaskVar *ModifierType) bool { | 255 | func (x *Surface) GetDevicePosition(DeviceVar *Device, XVar *float64, YVar *float64, MaskVar *ModifierType) bool { | ||
| 269 | - | core.LazyRegister(&xSurfaceGetDevicePosition, "GDK", "gdk_surface_get_device_position", false) | |||
| 270 | - | ||||
| 271 | cret := xSurfaceGetDevicePosition(x.GoPointer(), DeviceVar.GoPointer(), XVar, YVar, MaskVar) | 256 | cret := xSurfaceGetDevicePosition(x.GoPointer(), DeviceVar.GoPointer(), XVar, YVar, MaskVar) | ||
| 272 | return cret | 257 | return cret | ||
| 273 | } | 258 | } | ||
| @@ -276,7 +261,6 @@ var xSurfaceGetDisplay func(uintptr) uintptr | |||||
| 276 | 261 | ||||
| 277 | // Gets the `GdkDisplay` associated with a `GdkSurface`. | 262 | // Gets the `GdkDisplay` associated with a `GdkSurface`. | ||
| 278 | func (x *Surface) GetDisplay() *Display { | 263 | func (x *Surface) GetDisplay() *Display { | ||
| 279 | - | core.LazyRegister(&xSurfaceGetDisplay, "GDK", "gdk_surface_get_display", false) | |||
| 280 | var cls *Display | 264 | var cls *Display | ||
| 281 | 265 | ||||
| 282 | cret := xSurfaceGetDisplay(x.GoPointer()) | 266 | cret := xSurfaceGetDisplay(x.GoPointer()) | ||
| @@ -297,7 +281,6 @@ var xSurfaceGetFrameClock func(uintptr) uintptr | |||||
| 297 | // The frame clock for a surface never changes unless the surface is | 281 | // The frame clock for a surface never changes unless the surface is | ||
| 298 | // reparented to a new toplevel surface. | 282 | // reparented to a new toplevel surface. | ||
| 299 | func (x *Surface) GetFrameClock() *FrameClock { | 283 | func (x *Surface) GetFrameClock() *FrameClock { | ||
| 300 | - | core.LazyRegister(&xSurfaceGetFrameClock, "GDK", "gdk_surface_get_frame_clock", false) | |||
| 301 | var cls *FrameClock | 284 | var cls *FrameClock | ||
| 302 | 285 | ||||
| 303 | cret := xSurfaceGetFrameClock(x.GoPointer()) | 286 | cret := xSurfaceGetFrameClock(x.GoPointer()) | ||
| @@ -318,8 +301,6 @@ var xSurfaceGetHeight func(uintptr) int | |||||
| 318 | // Surface size is reported in ”application pixels”, not | 301 | // Surface size is reported in ”application pixels”, not | ||
| 319 | // ”device pixels” (see [method@Gdk.Surface.get_scale_factor]). | 302 | // ”device pixels” (see [method@Gdk.Surface.get_scale_factor]). | ||
| 320 | func (x *Surface) GetHeight() int { | 303 | func (x *Surface) GetHeight() int { | ||
| 321 | - | core.LazyRegister(&xSurfaceGetHeight, "GDK", "gdk_surface_get_height", false) | |||
| 322 | - | ||||
| 323 | cret := xSurfaceGetHeight(x.GoPointer()) | 304 | cret := xSurfaceGetHeight(x.GoPointer()) | ||
| 324 | return cret | 305 | return cret | ||
| 325 | } | 306 | } | ||
| @@ -331,8 +312,6 @@ var xSurfaceGetMapped func(uintptr) bool | |||||
| 331 | // A surface is mapped with [method@Gdk.Toplevel.present] | 312 | // A surface is mapped with [method@Gdk.Toplevel.present] | ||
| 332 | // or [method@Gdk.Popup.present]. | 313 | // or [method@Gdk.Popup.present]. | ||
| 333 | func (x *Surface) GetMapped() bool { | 314 | func (x *Surface) GetMapped() bool { | ||
| 334 | - | core.LazyRegister(&xSurfaceGetMapped, "GDK", "gdk_surface_get_mapped", false) | |||
| 335 | - | ||||
| 336 | cret := xSurfaceGetMapped(x.GoPointer()) | 315 | cret := xSurfaceGetMapped(x.GoPointer()) | ||
| 337 | return cret | 316 | return cret | ||
| 338 | } | 317 | } | ||
| @@ -351,8 +330,6 @@ var xSurfaceGetScale func(uintptr) float64 | |||||
| 351 | // | 330 | // | ||
| 352 | // The scale may change during the lifetime of the surface. | 331 | // The scale may change during the lifetime of the surface. | ||
| 353 | func (x *Surface) GetScale() float64 { | 332 | func (x *Surface) GetScale() float64 { | ||
| 354 | - | core.LazyRegister(&xSurfaceGetScale, "GDK", "gdk_surface_get_scale", false) | |||
| 355 | - | ||||
| 356 | cret := xSurfaceGetScale(x.GoPointer()) | 333 | cret := xSurfaceGetScale(x.GoPointer()) | ||
| 357 | return cret | 334 | return cret | ||
| 358 | } | 335 | } | ||
| @@ -371,8 +348,6 @@ var xSurfaceGetScaleFactor func(uintptr) int | |||||
| 371 | // | 348 | // | ||
| 372 | // The scale factor may change during the lifetime of the surface. | 349 | // The scale factor may change during the lifetime of the surface. | ||
| 373 | func (x *Surface) GetScaleFactor() int { | 350 | func (x *Surface) GetScaleFactor() int { | ||
| 374 | - | core.LazyRegister(&xSurfaceGetScaleFactor, "GDK", "gdk_surface_get_scale_factor", false) | |||
| 375 | - | ||||
| 376 | cret := xSurfaceGetScaleFactor(x.GoPointer()) | 351 | cret := xSurfaceGetScaleFactor(x.GoPointer()) | ||
| 377 | return cret | 352 | return cret | ||
| 378 | } | 353 | } | ||
| @@ -384,8 +359,6 @@ var xSurfaceGetWidth func(uintptr) int | |||||
| 384 | // Surface size is reported in ”application pixels”, not | 359 | // Surface size is reported in ”application pixels”, not | ||
| 385 | // ”device pixels” (see [method@Gdk.Surface.get_scale_factor]). | 360 | // ”device pixels” (see [method@Gdk.Surface.get_scale_factor]). | ||
| 386 | func (x *Surface) GetWidth() int { | 361 | func (x *Surface) GetWidth() int { | ||
| 387 | - | core.LazyRegister(&xSurfaceGetWidth, "GDK", "gdk_surface_get_width", false) | |||
| 388 | - | ||||
| 389 | cret := xSurfaceGetWidth(x.GoPointer()) | 362 | cret := xSurfaceGetWidth(x.GoPointer()) | ||
| 390 | return cret | 363 | return cret | ||
| 391 | } | 364 | } | ||
| @@ -399,8 +372,6 @@ var xSurfaceHide func(uintptr) | |||||
| 399 | // they won’t be displayed. Normally done automatically as | 372 | // they won’t be displayed. Normally done automatically as | ||
| 400 | // part of [gtk_widget_hide()](../gtk4/method.Widget.hide.html). | 373 | // part of [gtk_widget_hide()](../gtk4/method.Widget.hide.html). | ||
| 401 | func (x *Surface) Hide() { | 374 | func (x *Surface) Hide() { | ||
| 402 | - | core.LazyRegister(&xSurfaceHide, "GDK", "gdk_surface_hide", false) | |||
| 403 | - | ||||
| 404 | xSurfaceHide(x.GoPointer()) | 375 | xSurfaceHide(x.GoPointer()) | ||
| 405 | } | 376 | } | ||
| 406 | 377 | ||||
| @@ -408,8 +379,6 @@ var xSurfaceIsDestroyed func(uintptr) bool | |||||
| 408 | 379 | ||||
| 409 | // Check to see if a surface is destroyed. | 380 | // Check to see if a surface is destroyed. | ||
| 410 | func (x *Surface) IsDestroyed() bool { | 381 | func (x *Surface) IsDestroyed() bool { | ||
| 411 | - | core.LazyRegister(&xSurfaceIsDestroyed, "GDK", "gdk_surface_is_destroyed", false) | |||
| 412 | - | ||||
| 413 | cret := xSurfaceIsDestroyed(x.GoPointer()) | 382 | cret := xSurfaceIsDestroyed(x.GoPointer()) | ||
| 414 | return cret | 383 | return cret | ||
| 415 | } | 384 | } | ||
| @@ -422,8 +391,6 @@ var xSurfaceQueueRender func(uintptr) | |||||
| 422 | // This function is useful for implementations that track invalid | 391 | // This function is useful for implementations that track invalid | ||
| 423 | // regions on their own. | 392 | // regions on their own. | ||
| 424 | func (x *Surface) QueueRender() { | 393 | func (x *Surface) QueueRender() { | ||
| 425 | - | core.LazyRegister(&xSurfaceQueueRender, "GDK", "gdk_surface_queue_render", false) | |||
| 426 | - | ||||
| 427 | xSurfaceQueueRender(x.GoPointer()) | 394 | xSurfaceQueueRender(x.GoPointer()) | ||
| 428 | } | 395 | } | ||
| 429 | 396 | ||||
| @@ -433,8 +400,6 @@ var xSurfaceRequestLayout func(uintptr) | |||||
| 433 | // | 400 | // | ||
| 434 | // See [method@Gdk.FrameClock.request_phase]. | 401 | // See [method@Gdk.FrameClock.request_phase]. | ||
| 435 | func (x *Surface) RequestLayout() { | 402 | func (x *Surface) RequestLayout() { | ||
| 436 | - | core.LazyRegister(&xSurfaceRequestLayout, "GDK", "gdk_surface_request_layout", false) | |||
| 437 | - | ||||
| 438 | xSurfaceRequestLayout(x.GoPointer()) | 403 | xSurfaceRequestLayout(x.GoPointer()) | ||
| 439 | } | 404 | } | ||
| 440 | 405 | ||||
| @@ -449,8 +414,6 @@ var xSurfaceSetCursor func(uintptr, uintptr) | |||||
| 449 | // Use [ctor@Gdk.Cursor.new_from_name] or [ctor@Gdk.Cursor.new_from_texture] | 414 | // Use [ctor@Gdk.Cursor.new_from_name] or [ctor@Gdk.Cursor.new_from_texture] | ||
| 450 | // to create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. | 415 | // to create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. | ||
| 451 | func (x *Surface) SetCursor(CursorVar *Cursor) { | 416 | func (x *Surface) SetCursor(CursorVar *Cursor) { | ||
| 452 | - | core.LazyRegister(&xSurfaceSetCursor, "GDK", "gdk_surface_set_cursor", false) | |||
| 453 | - | ||||
| 454 | xSurfaceSetCursor(x.GoPointer(), CursorVar.GoPointer()) | 417 | xSurfaceSetCursor(x.GoPointer(), CursorVar.GoPointer()) | ||
| 455 | } | 418 | } | ||
| 456 | 419 | ||||
| @@ -464,8 +427,6 @@ var xSurfaceSetDeviceCursor func(uintptr, uintptr, uintptr) | |||||
| 464 | // Use [ctor@Gdk.Cursor.new_from_name] or [ctor@Gdk.Cursor.new_from_texture] | 427 | // Use [ctor@Gdk.Cursor.new_from_name] or [ctor@Gdk.Cursor.new_from_texture] | ||
| 465 | // to create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. | 428 | // to create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. | ||
| 466 | func (x *Surface) SetDeviceCursor(DeviceVar *Device, CursorVar *Cursor) { | 429 | func (x *Surface) SetDeviceCursor(DeviceVar *Device, CursorVar *Cursor) { | ||
| 467 | - | core.LazyRegister(&xSurfaceSetDeviceCursor, "GDK", "gdk_surface_set_device_cursor", false) | |||
| 468 | - | ||||
| 469 | xSurfaceSetDeviceCursor(x.GoPointer(), DeviceVar.GoPointer(), CursorVar.GoPointer()) | 430 | xSurfaceSetDeviceCursor(x.GoPointer(), DeviceVar.GoPointer(), CursorVar.GoPointer()) | ||
| 470 | } | 431 | } | ||
| 471 | 432 | ||||
| @@ -486,8 +447,6 @@ var xSurfaceSetInputRegion func(uintptr, *cairo.Region) | |||||
| 486 | // Use [method@Gdk.Display.supports_input_shapes] to find out if | 447 | // Use [method@Gdk.Display.supports_input_shapes] to find out if | ||
| 487 | // a particular backend supports input regions. | 448 | // a particular backend supports input regions. | ||
| 488 | func (x *Surface) SetInputRegion(RegionVar *cairo.Region) { | 449 | func (x *Surface) SetInputRegion(RegionVar *cairo.Region) { | ||
| 489 | - | core.LazyRegister(&xSurfaceSetInputRegion, "GDK", "gdk_surface_set_input_region", false) | |||
| 490 | - | ||||
| 491 | xSurfaceSetInputRegion(x.GoPointer(), RegionVar) | 450 | xSurfaceSetInputRegion(x.GoPointer(), RegionVar) | ||
| 492 | } | 451 | } | ||
| 493 | 452 | ||||
| @@ -509,8 +468,6 @@ var xSurfaceSetOpaqueRegion func(uintptr, *cairo.Region) | |||||
| 509 | // background is not opaque, please update this property in your | 468 | // background is not opaque, please update this property in your | ||
| 510 | // [GtkWidgetClass.css_changed](../gtk4/vfunc.Widget.css_changed.html) handler. | 469 | // [GtkWidgetClass.css_changed](../gtk4/vfunc.Widget.css_changed.html) handler. | ||
| 511 | func (x *Surface) SetOpaqueRegion(RegionVar *cairo.Region) { | 470 | func (x *Surface) SetOpaqueRegion(RegionVar *cairo.Region) { | ||
| 512 | - | core.LazyRegister(&xSurfaceSetOpaqueRegion, "GDK", "gdk_surface_set_opaque_region", false) | |||
| 513 | - | ||||
| 514 | xSurfaceSetOpaqueRegion(x.GoPointer(), RegionVar) | 471 | xSurfaceSetOpaqueRegion(x.GoPointer(), RegionVar) | ||
| 515 | } | 472 | } | ||
| 516 | 473 | ||||
| @@ -521,8 +478,6 @@ var xSurfaceTranslateCoordinates func(uintptr, uintptr, *float64, *float64) bool | |||||
| 521 | // Note that this only works if @to and @from are popups or | 478 | // Note that this only works if @to and @from are popups or | ||
| 522 | // transient-for to the same toplevel (directly or indirectly). | 479 | // transient-for to the same toplevel (directly or indirectly). | ||
| 523 | func (x *Surface) TranslateCoordinates(ToVar *Surface, XVar *float64, YVar *float64) bool { | 480 | func (x *Surface) TranslateCoordinates(ToVar *Surface, XVar *float64, YVar *float64) bool { | ||
| 524 | - | core.LazyRegister(&xSurfaceTranslateCoordinates, "GDK", "gdk_surface_translate_coordinates", false) | |||
| 525 | - | ||||
| 526 | cret := xSurfaceTranslateCoordinates(x.GoPointer(), ToVar.GoPointer(), XVar, YVar) | 481 | cret := xSurfaceTranslateCoordinates(x.GoPointer(), ToVar.GoPointer(), XVar, YVar) | ||
| 527 | return cret | 482 | return cret | ||
| 528 | } | 483 | } | ||
| @@ -707,4 +662,43 @@ func (x *Surface) ConnectRender(cb *func(Surface, uintptr) bool) uint { | |||||
| 707 | func init() { | 662 | func init() { | ||
| 708 | core.SetPackageName("GDK", "gtk4") | 663 | core.SetPackageName("GDK", "gtk4") | ||
| 709 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | 664 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | ||
| 665 | + | var libs []uintptr | |||
| 666 | + | for _, libPath := range core.GetPaths("GDK") { | |||
| 667 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 668 | + | if err != nil { | |||
| 669 | + | panic(err) | |||
| 670 | + | } | |||
| 671 | + | libs = append(libs, lib) | |||
| 672 | + | } | |||
| 673 | + | ||||
| 674 | + | core.PuregoSafeRegister(&xSurfaceGLibType, libs, "gdk_surface_get_type") | |||
| 675 | + | ||||
| 676 | + | core.PuregoSafeRegister(&xNewSurfacePopup, libs, "gdk_surface_new_popup") | |||
| 677 | + | core.PuregoSafeRegister(&xNewSurfaceToplevel, libs, "gdk_surface_new_toplevel") | |||
| 678 | + | ||||
| 679 | + | core.PuregoSafeRegister(&xSurfaceBeep, libs, "gdk_surface_beep") | |||
| 680 | + | core.PuregoSafeRegister(&xSurfaceCreateCairoContext, libs, "gdk_surface_create_cairo_context") | |||
| 681 | + | core.PuregoSafeRegister(&xSurfaceCreateGlContext, libs, "gdk_surface_create_gl_context") | |||
| 682 | + | core.PuregoSafeRegister(&xSurfaceCreateSimilarSurface, libs, "gdk_surface_create_similar_surface") | |||
| 683 | + | core.PuregoSafeRegister(&xSurfaceCreateVulkanContext, libs, "gdk_surface_create_vulkan_context") | |||
| 684 | + | core.PuregoSafeRegister(&xSurfaceDestroy, libs, "gdk_surface_destroy") | |||
| 685 | + | core.PuregoSafeRegister(&xSurfaceGetCursor, libs, "gdk_surface_get_cursor") | |||
| 686 | + | core.PuregoSafeRegister(&xSurfaceGetDeviceCursor, libs, "gdk_surface_get_device_cursor") | |||
| 687 | + | core.PuregoSafeRegister(&xSurfaceGetDevicePosition, libs, "gdk_surface_get_device_position") | |||
| 688 | + | core.PuregoSafeRegister(&xSurfaceGetDisplay, libs, "gdk_surface_get_display") | |||
| 689 | + | core.PuregoSafeRegister(&xSurfaceGetFrameClock, libs, "gdk_surface_get_frame_clock") | |||
| 690 | + | core.PuregoSafeRegister(&xSurfaceGetHeight, libs, "gdk_surface_get_height") | |||
| 691 | + | core.PuregoSafeRegister(&xSurfaceGetMapped, libs, "gdk_surface_get_mapped") | |||
| 692 | + | core.PuregoSafeRegister(&xSurfaceGetScale, libs, "gdk_surface_get_scale") | |||
| 693 | + | core.PuregoSafeRegister(&xSurfaceGetScaleFactor, libs, "gdk_surface_get_scale_factor") | |||
| 694 | + | core.PuregoSafeRegister(&xSurfaceGetWidth, libs, "gdk_surface_get_width") | |||
| 695 | + | core.PuregoSafeRegister(&xSurfaceHide, libs, "gdk_surface_hide") | |||
| 696 | + | core.PuregoSafeRegister(&xSurfaceIsDestroyed, libs, "gdk_surface_is_destroyed") | |||
| 697 | + | core.PuregoSafeRegister(&xSurfaceQueueRender, libs, "gdk_surface_queue_render") | |||
| 698 | + | core.PuregoSafeRegister(&xSurfaceRequestLayout, libs, "gdk_surface_request_layout") | |||
| 699 | + | core.PuregoSafeRegister(&xSurfaceSetCursor, libs, "gdk_surface_set_cursor") | |||
| 700 | + | core.PuregoSafeRegister(&xSurfaceSetDeviceCursor, libs, "gdk_surface_set_device_cursor") | |||
| 701 | + | core.PuregoSafeRegister(&xSurfaceSetInputRegion, libs, "gdk_surface_set_input_region") | |||
| 702 | + | core.PuregoSafeRegister(&xSurfaceSetOpaqueRegion, libs, "gdk_surface_set_opaque_region") | |||
| 703 | + | core.PuregoSafeRegister(&xSurfaceTranslateCoordinates, libs, "gdk_surface_translate_coordinates") | |||
| 710 | } | 704 | } | ||