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
| @@ -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/gobject/types" | |
| 10 | 11 | ) | |
| @@ -23,7 +24,6 @@ type FrameTimings struct { | |||
| 23 | 24 | var xFrameTimingsGLibType func() types.GType | |
| 24 | 25 | ||
| 25 | 26 | func FrameTimingsGLibType() types.GType { | |
| 26 | - | core.LazyRegister(&xFrameTimingsGLibType, "GDK", "gdk_frame_timings_get_type", false) | |
| 27 | 27 | return xFrameTimingsGLibType() | |
| 28 | 28 | } | |
| 29 | 29 | ||
| @@ -55,8 +55,6 @@ var xFrameTimingsGetComplete func(uintptr) bool | |||
| 55 | 55 | // certain that no further values will become available and be | |
| 56 | 56 | // stored in the `GdkFrameTimings`. | |
| 57 | 57 | func (x *FrameTimings) GetComplete() bool { | |
| 58 | - | core.LazyRegister(&xFrameTimingsGetComplete, "GDK", "gdk_frame_timings_get_complete", false) | |
| 59 | - | ||
| 60 | 58 | cret := xFrameTimingsGetComplete(x.GoPointer()) | |
| 61 | 59 | return cret | |
| 62 | 60 | } | |
| @@ -66,8 +64,6 @@ var xFrameTimingsGetFrameCounter func(uintptr) int64 | |||
| 66 | 64 | // Gets the frame counter value of the `GdkFrameClock` when | |
| 67 | 65 | // this frame was drawn. | |
| 68 | 66 | func (x *FrameTimings) GetFrameCounter() int64 { | |
| 69 | - | core.LazyRegister(&xFrameTimingsGetFrameCounter, "GDK", "gdk_frame_timings_get_frame_counter", false) | |
| 70 | - | ||
| 71 | 67 | cret := xFrameTimingsGetFrameCounter(x.GoPointer()) | |
| 72 | 68 | return cret | |
| 73 | 69 | } | |
| @@ -79,8 +75,6 @@ var xFrameTimingsGetFrameTime func(uintptr) int64 | |||
| 79 | 75 | // This is the time value that is typically used to time | |
| 80 | 76 | // animations for the frame. See [method@Gdk.FrameClock.get_frame_time]. | |
| 81 | 77 | func (x *FrameTimings) GetFrameTime() int64 { | |
| 82 | - | core.LazyRegister(&xFrameTimingsGetFrameTime, "GDK", "gdk_frame_timings_get_frame_time", false) | |
| 83 | - | ||
| 84 | 78 | cret := xFrameTimingsGetFrameTime(x.GoPointer()) | |
| 85 | 79 | return cret | |
| 86 | 80 | } | |
| @@ -100,8 +94,6 @@ var xFrameTimingsGetPredictedPresentationTime func(uintptr) int64 | |||
| 100 | 94 | // over latency. For example, a movie player may want this information | |
| 101 | 95 | // for Audio/Video synchronization. | |
| 102 | 96 | func (x *FrameTimings) GetPredictedPresentationTime() int64 { | |
| 103 | - | core.LazyRegister(&xFrameTimingsGetPredictedPresentationTime, "GDK", "gdk_frame_timings_get_predicted_presentation_time", false) | |
| 104 | - | ||
| 105 | 97 | cret := xFrameTimingsGetPredictedPresentationTime(x.GoPointer()) | |
| 106 | 98 | return cret | |
| 107 | 99 | } | |
| @@ -112,8 +104,6 @@ var xFrameTimingsGetPresentationTime func(uintptr) int64 | |||
| 112 | 104 | // | |
| 113 | 105 | // This is the time at which the frame became visible to the user. | |
| 114 | 106 | func (x *FrameTimings) GetPresentationTime() int64 { | |
| 115 | - | core.LazyRegister(&xFrameTimingsGetPresentationTime, "GDK", "gdk_frame_timings_get_presentation_time", false) | |
| 116 | - | ||
| 117 | 107 | cret := xFrameTimingsGetPresentationTime(x.GoPointer()) | |
| 118 | 108 | return cret | |
| 119 | 109 | } | |
| @@ -126,8 +116,6 @@ var xFrameTimingsGetRefreshInterval func(uintptr) int64 | |||
| 126 | 116 | // Frame presentation usually happens during the “vertical | |
| 127 | 117 | // blanking interval”. | |
| 128 | 118 | func (x *FrameTimings) GetRefreshInterval() int64 { | |
| 129 | - | core.LazyRegister(&xFrameTimingsGetRefreshInterval, "GDK", "gdk_frame_timings_get_refresh_interval", false) | |
| 130 | - | ||
| 131 | 119 | cret := xFrameTimingsGetRefreshInterval(x.GoPointer()) | |
| 132 | 120 | return cret | |
| 133 | 121 | } | |
| @@ -136,8 +124,6 @@ var xFrameTimingsRef func(uintptr) uintptr | |||
| 136 | 124 | ||
| 137 | 125 | // Increases the reference count of @timings. | |
| 138 | 126 | func (x *FrameTimings) Ref() *FrameTimings { | |
| 139 | - | core.LazyRegister(&xFrameTimingsRef, "GDK", "gdk_frame_timings_ref", false) | |
| 140 | - | ||
| 141 | 127 | cret := xFrameTimingsRef(x.GoPointer()) | |
| 142 | 128 | if cret == 0 { | |
| 143 | 129 | return nil | |
| @@ -151,12 +137,29 @@ var xFrameTimingsUnref func(uintptr) | |||
| 151 | 137 | // | |
| 152 | 138 | // If @timings is no longer referenced, it will be freed. | |
| 153 | 139 | func (x *FrameTimings) Unref() { | |
| 154 | - | core.LazyRegister(&xFrameTimingsUnref, "GDK", "gdk_frame_timings_unref", false) | |
| 155 | - | ||
| 156 | 140 | xFrameTimingsUnref(x.GoPointer()) | |
| 157 | 141 | } | |
| 158 | 142 | ||
| 159 | 143 | func init() { | |
| 160 | 144 | core.SetPackageName("GDK", "gtk4") | |
| 161 | 145 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | |
| 146 | + | var libs []uintptr | |
| 147 | + | for _, libPath := range core.GetPaths("GDK") { | |
| 148 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 149 | + | if err != nil { | |
| 150 | + | panic(err) | |
| 151 | + | } | |
| 152 | + | libs = append(libs, lib) | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | core.PuregoSafeRegister(&xFrameTimingsGLibType, libs, "gdk_frame_timings_get_type") | |
| 156 | + | ||
| 157 | + | core.PuregoSafeRegister(&xFrameTimingsGetComplete, libs, "gdk_frame_timings_get_complete") | |
| 158 | + | core.PuregoSafeRegister(&xFrameTimingsGetFrameCounter, libs, "gdk_frame_timings_get_frame_counter") | |
| 159 | + | core.PuregoSafeRegister(&xFrameTimingsGetFrameTime, libs, "gdk_frame_timings_get_frame_time") | |
| 160 | + | core.PuregoSafeRegister(&xFrameTimingsGetPredictedPresentationTime, libs, "gdk_frame_timings_get_predicted_presentation_time") | |
| 161 | + | core.PuregoSafeRegister(&xFrameTimingsGetPresentationTime, libs, "gdk_frame_timings_get_presentation_time") | |
| 162 | + | core.PuregoSafeRegister(&xFrameTimingsGetRefreshInterval, libs, "gdk_frame_timings_get_refresh_interval") | |
| 163 | + | core.PuregoSafeRegister(&xFrameTimingsRef, libs, "gdk_frame_timings_ref") | |
| 164 | + | core.PuregoSafeRegister(&xFrameTimingsUnref, libs, "gdk_frame_timings_unref") | |
| 162 | 165 | } | |
| @@ -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/gobject/types" | 10 | "github.com/bnema/puregotk/v4/gobject/types" | ||
| 10 | ) | 11 | ) | ||
| @@ -23,7 +24,6 @@ type FrameTimings struct { | |||||
| 23 | var xFrameTimingsGLibType func() types.GType | 24 | var xFrameTimingsGLibType func() types.GType | ||
| 24 | 25 | ||||
| 25 | func FrameTimingsGLibType() types.GType { | 26 | func FrameTimingsGLibType() types.GType { | ||
| 26 | - | core.LazyRegister(&xFrameTimingsGLibType, "GDK", "gdk_frame_timings_get_type", false) | |||
| 27 | return xFrameTimingsGLibType() | 27 | return xFrameTimingsGLibType() | ||
| 28 | } | 28 | } | ||
| 29 | 29 | ||||
| @@ -55,8 +55,6 @@ var xFrameTimingsGetComplete func(uintptr) bool | |||||
| 55 | // certain that no further values will become available and be | 55 | // certain that no further values will become available and be | ||
| 56 | // stored in the `GdkFrameTimings`. | 56 | // stored in the `GdkFrameTimings`. | ||
| 57 | func (x *FrameTimings) GetComplete() bool { | 57 | func (x *FrameTimings) GetComplete() bool { | ||
| 58 | - | core.LazyRegister(&xFrameTimingsGetComplete, "GDK", "gdk_frame_timings_get_complete", false) | |||
| 59 | - | ||||
| 60 | cret := xFrameTimingsGetComplete(x.GoPointer()) | 58 | cret := xFrameTimingsGetComplete(x.GoPointer()) | ||
| 61 | return cret | 59 | return cret | ||
| 62 | } | 60 | } | ||
| @@ -66,8 +64,6 @@ var xFrameTimingsGetFrameCounter func(uintptr) int64 | |||||
| 66 | // Gets the frame counter value of the `GdkFrameClock` when | 64 | // Gets the frame counter value of the `GdkFrameClock` when | ||
| 67 | // this frame was drawn. | 65 | // this frame was drawn. | ||
| 68 | func (x *FrameTimings) GetFrameCounter() int64 { | 66 | func (x *FrameTimings) GetFrameCounter() int64 { | ||
| 69 | - | core.LazyRegister(&xFrameTimingsGetFrameCounter, "GDK", "gdk_frame_timings_get_frame_counter", false) | |||
| 70 | - | ||||
| 71 | cret := xFrameTimingsGetFrameCounter(x.GoPointer()) | 67 | cret := xFrameTimingsGetFrameCounter(x.GoPointer()) | ||
| 72 | return cret | 68 | return cret | ||
| 73 | } | 69 | } | ||
| @@ -79,8 +75,6 @@ var xFrameTimingsGetFrameTime func(uintptr) int64 | |||||
| 79 | // This is the time value that is typically used to time | 75 | // This is the time value that is typically used to time | ||
| 80 | // animations for the frame. See [method@Gdk.FrameClock.get_frame_time]. | 76 | // animations for the frame. See [method@Gdk.FrameClock.get_frame_time]. | ||
| 81 | func (x *FrameTimings) GetFrameTime() int64 { | 77 | func (x *FrameTimings) GetFrameTime() int64 { | ||
| 82 | - | core.LazyRegister(&xFrameTimingsGetFrameTime, "GDK", "gdk_frame_timings_get_frame_time", false) | |||
| 83 | - | ||||
| 84 | cret := xFrameTimingsGetFrameTime(x.GoPointer()) | 78 | cret := xFrameTimingsGetFrameTime(x.GoPointer()) | ||
| 85 | return cret | 79 | return cret | ||
| 86 | } | 80 | } | ||
| @@ -100,8 +94,6 @@ var xFrameTimingsGetPredictedPresentationTime func(uintptr) int64 | |||||
| 100 | // over latency. For example, a movie player may want this information | 94 | // over latency. For example, a movie player may want this information | ||
| 101 | // for Audio/Video synchronization. | 95 | // for Audio/Video synchronization. | ||
| 102 | func (x *FrameTimings) GetPredictedPresentationTime() int64 { | 96 | func (x *FrameTimings) GetPredictedPresentationTime() int64 { | ||
| 103 | - | core.LazyRegister(&xFrameTimingsGetPredictedPresentationTime, "GDK", "gdk_frame_timings_get_predicted_presentation_time", false) | |||
| 104 | - | ||||
| 105 | cret := xFrameTimingsGetPredictedPresentationTime(x.GoPointer()) | 97 | cret := xFrameTimingsGetPredictedPresentationTime(x.GoPointer()) | ||
| 106 | return cret | 98 | return cret | ||
| 107 | } | 99 | } | ||
| @@ -112,8 +104,6 @@ var xFrameTimingsGetPresentationTime func(uintptr) int64 | |||||
| 112 | // | 104 | // | ||
| 113 | // This is the time at which the frame became visible to the user. | 105 | // This is the time at which the frame became visible to the user. | ||
| 114 | func (x *FrameTimings) GetPresentationTime() int64 { | 106 | func (x *FrameTimings) GetPresentationTime() int64 { | ||
| 115 | - | core.LazyRegister(&xFrameTimingsGetPresentationTime, "GDK", "gdk_frame_timings_get_presentation_time", false) | |||
| 116 | - | ||||
| 117 | cret := xFrameTimingsGetPresentationTime(x.GoPointer()) | 107 | cret := xFrameTimingsGetPresentationTime(x.GoPointer()) | ||
| 118 | return cret | 108 | return cret | ||
| 119 | } | 109 | } | ||
| @@ -126,8 +116,6 @@ var xFrameTimingsGetRefreshInterval func(uintptr) int64 | |||||
| 126 | // Frame presentation usually happens during the “vertical | 116 | // Frame presentation usually happens during the “vertical | ||
| 127 | // blanking interval”. | 117 | // blanking interval”. | ||
| 128 | func (x *FrameTimings) GetRefreshInterval() int64 { | 118 | func (x *FrameTimings) GetRefreshInterval() int64 { | ||
| 129 | - | core.LazyRegister(&xFrameTimingsGetRefreshInterval, "GDK", "gdk_frame_timings_get_refresh_interval", false) | |||
| 130 | - | ||||
| 131 | cret := xFrameTimingsGetRefreshInterval(x.GoPointer()) | 119 | cret := xFrameTimingsGetRefreshInterval(x.GoPointer()) | ||
| 132 | return cret | 120 | return cret | ||
| 133 | } | 121 | } | ||
| @@ -136,8 +124,6 @@ var xFrameTimingsRef func(uintptr) uintptr | |||||
| 136 | 124 | ||||
| 137 | // Increases the reference count of @timings. | 125 | // Increases the reference count of @timings. | ||
| 138 | func (x *FrameTimings) Ref() *FrameTimings { | 126 | func (x *FrameTimings) Ref() *FrameTimings { | ||
| 139 | - | core.LazyRegister(&xFrameTimingsRef, "GDK", "gdk_frame_timings_ref", false) | |||
| 140 | - | ||||
| 141 | cret := xFrameTimingsRef(x.GoPointer()) | 127 | cret := xFrameTimingsRef(x.GoPointer()) | ||
| 142 | if cret == 0 { | 128 | if cret == 0 { | ||
| 143 | return nil | 129 | return nil | ||
| @@ -151,12 +137,29 @@ var xFrameTimingsUnref func(uintptr) | |||||
| 151 | // | 137 | // | ||
| 152 | // If @timings is no longer referenced, it will be freed. | 138 | // If @timings is no longer referenced, it will be freed. | ||
| 153 | func (x *FrameTimings) Unref() { | 139 | func (x *FrameTimings) Unref() { | ||
| 154 | - | core.LazyRegister(&xFrameTimingsUnref, "GDK", "gdk_frame_timings_unref", false) | |||
| 155 | - | ||||
| 156 | xFrameTimingsUnref(x.GoPointer()) | 140 | xFrameTimingsUnref(x.GoPointer()) | ||
| 157 | } | 141 | } | ||
| 158 | 142 | ||||
| 159 | func init() { | 143 | func init() { | ||
| 160 | core.SetPackageName("GDK", "gtk4") | 144 | core.SetPackageName("GDK", "gtk4") | ||
| 161 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | 145 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | ||
| 146 | + | var libs []uintptr | |||
| 147 | + | for _, libPath := range core.GetPaths("GDK") { | |||
| 148 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 149 | + | if err != nil { | |||
| 150 | + | panic(err) | |||
| 151 | + | } | |||
| 152 | + | libs = append(libs, lib) | |||
| 153 | + | } | |||
| 154 | + | ||||
| 155 | + | core.PuregoSafeRegister(&xFrameTimingsGLibType, libs, "gdk_frame_timings_get_type") | |||
| 156 | + | ||||
| 157 | + | core.PuregoSafeRegister(&xFrameTimingsGetComplete, libs, "gdk_frame_timings_get_complete") | |||
| 158 | + | core.PuregoSafeRegister(&xFrameTimingsGetFrameCounter, libs, "gdk_frame_timings_get_frame_counter") | |||
| 159 | + | core.PuregoSafeRegister(&xFrameTimingsGetFrameTime, libs, "gdk_frame_timings_get_frame_time") | |||
| 160 | + | core.PuregoSafeRegister(&xFrameTimingsGetPredictedPresentationTime, libs, "gdk_frame_timings_get_predicted_presentation_time") | |||
| 161 | + | core.PuregoSafeRegister(&xFrameTimingsGetPresentationTime, libs, "gdk_frame_timings_get_presentation_time") | |||
| 162 | + | core.PuregoSafeRegister(&xFrameTimingsGetRefreshInterval, libs, "gdk_frame_timings_get_refresh_interval") | |||
| 163 | + | core.PuregoSafeRegister(&xFrameTimingsRef, libs, "gdk_frame_timings_ref") | |||
| 164 | + | core.PuregoSafeRegister(&xFrameTimingsUnref, libs, "gdk_frame_timings_unref") | |||
| 162 | } | 165 | } | ||