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
| @@ -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" | |
| @@ -63,7 +64,6 @@ type Cursor struct { | |||
| 63 | 64 | var xCursorGLibType func() types.GType | |
| 64 | 65 | ||
| 65 | 66 | func CursorGLibType() types.GType { | |
| 66 | - | core.LazyRegister(&xCursorGLibType, "GDK", "gdk_cursor_get_type", false) | |
| 67 | 67 | return xCursorGLibType() | |
| 68 | 68 | } | |
| 69 | 69 | ||
| @@ -80,7 +80,6 @@ var xNewCursorFromCallback func(uintptr, uintptr, uintptr, uintptr) uintptr | |||
| 80 | 80 | // Cursors of this kind produce textures for the cursor | |
| 81 | 81 | // image on demand, when the @callback is called. | |
| 82 | 82 | func NewCursorFromCallback(CallbackVar *CursorGetTextureCallback, DataVar uintptr, DestroyVar *glib.DestroyNotify, FallbackVar *Cursor) *Cursor { | |
| 83 | - | core.LazyRegister(&xNewCursorFromCallback, "GDK", "gdk_cursor_new_from_callback", false) | |
| 84 | 83 | var cls *Cursor | |
| 85 | 84 | ||
| 86 | 85 | cret := xNewCursorFromCallback(glib.NewCallback(CallbackVar), DataVar, glib.NewCallbackNullable(DestroyVar), FallbackVar.GoPointer()) | |
| @@ -141,7 +140,6 @@ var xNewCursorFromName func(string, uintptr) uintptr | |||
| 141 | 140 | // |  | "zoom-in" | Zoom in | | |
| 142 | 141 | // |  | "zoom-out" | Zoom out | | |
| 143 | 142 | func NewCursorFromName(NameVar string, FallbackVar *Cursor) *Cursor { | |
| 144 | - | core.LazyRegister(&xNewCursorFromName, "GDK", "gdk_cursor_new_from_name", false) | |
| 145 | 143 | var cls *Cursor | |
| 146 | 144 | ||
| 147 | 145 | cret := xNewCursorFromName(NameVar, FallbackVar.GoPointer()) | |
| @@ -158,7 +156,6 @@ var xNewCursorFromTexture func(uintptr, int, int, uintptr) uintptr | |||
| 158 | 156 | ||
| 159 | 157 | // Creates a new cursor from a `GdkTexture`. | |
| 160 | 158 | func NewCursorFromTexture(TextureVar *Texture, HotspotXVar int, HotspotYVar int, FallbackVar *Cursor) *Cursor { | |
| 161 | - | core.LazyRegister(&xNewCursorFromTexture, "GDK", "gdk_cursor_new_from_texture", false) | |
| 162 | 159 | var cls *Cursor | |
| 163 | 160 | ||
| 164 | 161 | cret := xNewCursorFromTexture(TextureVar.GoPointer(), HotspotXVar, HotspotYVar, FallbackVar.GoPointer()) | |
| @@ -181,7 +178,6 @@ var xCursorGetFallback func(uintptr) uintptr | |||
| 181 | 178 | // this can happen when the texture is too large or when the `GdkDisplay` | |
| 182 | 179 | // it is used on does not support textured cursors. | |
| 183 | 180 | func (x *Cursor) GetFallback() *Cursor { | |
| 184 | - | core.LazyRegister(&xCursorGetFallback, "GDK", "gdk_cursor_get_fallback", false) | |
| 185 | 181 | var cls *Cursor | |
| 186 | 182 | ||
| 187 | 183 | cret := xCursorGetFallback(x.GoPointer()) | |
| @@ -205,8 +201,6 @@ var xCursorGetHotspotX func(uintptr) int | |||
| 205 | 201 | // will only return the hotspot position for cursors created with | |
| 206 | 202 | // [ctor@Gdk.Cursor.new_from_texture]. | |
| 207 | 203 | func (x *Cursor) GetHotspotX() int { | |
| 208 | - | core.LazyRegister(&xCursorGetHotspotX, "GDK", "gdk_cursor_get_hotspot_x", false) | |
| 209 | - | ||
| 210 | 204 | cret := xCursorGetHotspotX(x.GoPointer()) | |
| 211 | 205 | return cret | |
| 212 | 206 | } | |
| @@ -221,8 +215,6 @@ var xCursorGetHotspotY func(uintptr) int | |||
| 221 | 215 | // will only return the hotspot position for cursors created with | |
| 222 | 216 | // [ctor@Gdk.Cursor.new_from_texture]. | |
| 223 | 217 | func (x *Cursor) GetHotspotY() int { | |
| 224 | - | core.LazyRegister(&xCursorGetHotspotY, "GDK", "gdk_cursor_get_hotspot_y", false) | |
| 225 | - | ||
| 226 | 218 | cret := xCursorGetHotspotY(x.GoPointer()) | |
| 227 | 219 | return cret | |
| 228 | 220 | } | |
| @@ -233,8 +225,6 @@ var xCursorGetName func(uintptr) string | |||
| 233 | 225 | // | |
| 234 | 226 | // If the cursor is not a named cursor, %NULL will be returned. | |
| 235 | 227 | func (x *Cursor) GetName() string { | |
| 236 | - | core.LazyRegister(&xCursorGetName, "GDK", "gdk_cursor_get_name", false) | |
| 237 | - | ||
| 238 | 228 | cret := xCursorGetName(x.GoPointer()) | |
| 239 | 229 | return cret | |
| 240 | 230 | } | |
| @@ -245,7 +235,6 @@ var xCursorGetTexture func(uintptr) uintptr | |||
| 245 | 235 | // | |
| 246 | 236 | // If the cursor is a named cursor, %NULL will be returned. | |
| 247 | 237 | func (x *Cursor) GetTexture() *Texture { | |
| 248 | - | core.LazyRegister(&xCursorGetTexture, "GDK", "gdk_cursor_get_texture", false) | |
| 249 | 238 | var cls *Texture | |
| 250 | 239 | ||
| 251 | 240 | cret := xCursorGetTexture(x.GoPointer()) | |
| @@ -328,4 +317,24 @@ func (x *Cursor) GetPropertyName() string { | |||
| 328 | 317 | func init() { | |
| 329 | 318 | core.SetPackageName("GDK", "gtk4") | |
| 330 | 319 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | |
| 320 | + | var libs []uintptr | |
| 321 | + | for _, libPath := range core.GetPaths("GDK") { | |
| 322 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 323 | + | if err != nil { | |
| 324 | + | panic(err) | |
| 325 | + | } | |
| 326 | + | libs = append(libs, lib) | |
| 327 | + | } | |
| 328 | + | ||
| 329 | + | core.PuregoSafeRegister(&xCursorGLibType, libs, "gdk_cursor_get_type") | |
| 330 | + | ||
| 331 | + | core.PuregoSafeRegister(&xNewCursorFromCallback, libs, "gdk_cursor_new_from_callback") | |
| 332 | + | core.PuregoSafeRegister(&xNewCursorFromName, libs, "gdk_cursor_new_from_name") | |
| 333 | + | core.PuregoSafeRegister(&xNewCursorFromTexture, libs, "gdk_cursor_new_from_texture") | |
| 334 | + | ||
| 335 | + | core.PuregoSafeRegister(&xCursorGetFallback, libs, "gdk_cursor_get_fallback") | |
| 336 | + | core.PuregoSafeRegister(&xCursorGetHotspotX, libs, "gdk_cursor_get_hotspot_x") | |
| 337 | + | core.PuregoSafeRegister(&xCursorGetHotspotY, libs, "gdk_cursor_get_hotspot_y") | |
| 338 | + | core.PuregoSafeRegister(&xCursorGetName, libs, "gdk_cursor_get_name") | |
| 339 | + | core.PuregoSafeRegister(&xCursorGetTexture, libs, "gdk_cursor_get_texture") | |
| 331 | 340 | } | |
| @@ -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" | ||
| @@ -63,7 +64,6 @@ type Cursor struct { | |||||
| 63 | var xCursorGLibType func() types.GType | 64 | var xCursorGLibType func() types.GType | ||
| 64 | 65 | ||||
| 65 | func CursorGLibType() types.GType { | 66 | func CursorGLibType() types.GType { | ||
| 66 | - | core.LazyRegister(&xCursorGLibType, "GDK", "gdk_cursor_get_type", false) | |||
| 67 | return xCursorGLibType() | 67 | return xCursorGLibType() | ||
| 68 | } | 68 | } | ||
| 69 | 69 | ||||
| @@ -80,7 +80,6 @@ var xNewCursorFromCallback func(uintptr, uintptr, uintptr, uintptr) uintptr | |||||
| 80 | // Cursors of this kind produce textures for the cursor | 80 | // Cursors of this kind produce textures for the cursor | ||
| 81 | // image on demand, when the @callback is called. | 81 | // image on demand, when the @callback is called. | ||
| 82 | func NewCursorFromCallback(CallbackVar *CursorGetTextureCallback, DataVar uintptr, DestroyVar *glib.DestroyNotify, FallbackVar *Cursor) *Cursor { | 82 | func NewCursorFromCallback(CallbackVar *CursorGetTextureCallback, DataVar uintptr, DestroyVar *glib.DestroyNotify, FallbackVar *Cursor) *Cursor { | ||
| 83 | - | core.LazyRegister(&xNewCursorFromCallback, "GDK", "gdk_cursor_new_from_callback", false) | |||
| 84 | var cls *Cursor | 83 | var cls *Cursor | ||
| 85 | 84 | ||||
| 86 | cret := xNewCursorFromCallback(glib.NewCallback(CallbackVar), DataVar, glib.NewCallbackNullable(DestroyVar), FallbackVar.GoPointer()) | 85 | cret := xNewCursorFromCallback(glib.NewCallback(CallbackVar), DataVar, glib.NewCallbackNullable(DestroyVar), FallbackVar.GoPointer()) | ||
| @@ -141,7 +140,6 @@ var xNewCursorFromName func(string, uintptr) uintptr | |||||
| 141 | // |  | "zoom-in" | Zoom in | | 140 | // |  | "zoom-in" | Zoom in | | ||
| 142 | // |  | "zoom-out" | Zoom out | | 141 | // |  | "zoom-out" | Zoom out | | ||
| 143 | func NewCursorFromName(NameVar string, FallbackVar *Cursor) *Cursor { | 142 | func NewCursorFromName(NameVar string, FallbackVar *Cursor) *Cursor { | ||
| 144 | - | core.LazyRegister(&xNewCursorFromName, "GDK", "gdk_cursor_new_from_name", false) | |||
| 145 | var cls *Cursor | 143 | var cls *Cursor | ||
| 146 | 144 | ||||
| 147 | cret := xNewCursorFromName(NameVar, FallbackVar.GoPointer()) | 145 | cret := xNewCursorFromName(NameVar, FallbackVar.GoPointer()) | ||
| @@ -158,7 +156,6 @@ var xNewCursorFromTexture func(uintptr, int, int, uintptr) uintptr | |||||
| 158 | 156 | ||||
| 159 | // Creates a new cursor from a `GdkTexture`. | 157 | // Creates a new cursor from a `GdkTexture`. | ||
| 160 | func NewCursorFromTexture(TextureVar *Texture, HotspotXVar int, HotspotYVar int, FallbackVar *Cursor) *Cursor { | 158 | func NewCursorFromTexture(TextureVar *Texture, HotspotXVar int, HotspotYVar int, FallbackVar *Cursor) *Cursor { | ||
| 161 | - | core.LazyRegister(&xNewCursorFromTexture, "GDK", "gdk_cursor_new_from_texture", false) | |||
| 162 | var cls *Cursor | 159 | var cls *Cursor | ||
| 163 | 160 | ||||
| 164 | cret := xNewCursorFromTexture(TextureVar.GoPointer(), HotspotXVar, HotspotYVar, FallbackVar.GoPointer()) | 161 | cret := xNewCursorFromTexture(TextureVar.GoPointer(), HotspotXVar, HotspotYVar, FallbackVar.GoPointer()) | ||
| @@ -181,7 +178,6 @@ var xCursorGetFallback func(uintptr) uintptr | |||||
| 181 | // this can happen when the texture is too large or when the `GdkDisplay` | 178 | // this can happen when the texture is too large or when the `GdkDisplay` | ||
| 182 | // it is used on does not support textured cursors. | 179 | // it is used on does not support textured cursors. | ||
| 183 | func (x *Cursor) GetFallback() *Cursor { | 180 | func (x *Cursor) GetFallback() *Cursor { | ||
| 184 | - | core.LazyRegister(&xCursorGetFallback, "GDK", "gdk_cursor_get_fallback", false) | |||
| 185 | var cls *Cursor | 181 | var cls *Cursor | ||
| 186 | 182 | ||||
| 187 | cret := xCursorGetFallback(x.GoPointer()) | 183 | cret := xCursorGetFallback(x.GoPointer()) | ||
| @@ -205,8 +201,6 @@ var xCursorGetHotspotX func(uintptr) int | |||||
| 205 | // will only return the hotspot position for cursors created with | 201 | // will only return the hotspot position for cursors created with | ||
| 206 | // [ctor@Gdk.Cursor.new_from_texture]. | 202 | // [ctor@Gdk.Cursor.new_from_texture]. | ||
| 207 | func (x *Cursor) GetHotspotX() int { | 203 | func (x *Cursor) GetHotspotX() int { | ||
| 208 | - | core.LazyRegister(&xCursorGetHotspotX, "GDK", "gdk_cursor_get_hotspot_x", false) | |||
| 209 | - | ||||
| 210 | cret := xCursorGetHotspotX(x.GoPointer()) | 204 | cret := xCursorGetHotspotX(x.GoPointer()) | ||
| 211 | return cret | 205 | return cret | ||
| 212 | } | 206 | } | ||
| @@ -221,8 +215,6 @@ var xCursorGetHotspotY func(uintptr) int | |||||
| 221 | // will only return the hotspot position for cursors created with | 215 | // will only return the hotspot position for cursors created with | ||
| 222 | // [ctor@Gdk.Cursor.new_from_texture]. | 216 | // [ctor@Gdk.Cursor.new_from_texture]. | ||
| 223 | func (x *Cursor) GetHotspotY() int { | 217 | func (x *Cursor) GetHotspotY() int { | ||
| 224 | - | core.LazyRegister(&xCursorGetHotspotY, "GDK", "gdk_cursor_get_hotspot_y", false) | |||
| 225 | - | ||||
| 226 | cret := xCursorGetHotspotY(x.GoPointer()) | 218 | cret := xCursorGetHotspotY(x.GoPointer()) | ||
| 227 | return cret | 219 | return cret | ||
| 228 | } | 220 | } | ||
| @@ -233,8 +225,6 @@ var xCursorGetName func(uintptr) string | |||||
| 233 | // | 225 | // | ||
| 234 | // If the cursor is not a named cursor, %NULL will be returned. | 226 | // If the cursor is not a named cursor, %NULL will be returned. | ||
| 235 | func (x *Cursor) GetName() string { | 227 | func (x *Cursor) GetName() string { | ||
| 236 | - | core.LazyRegister(&xCursorGetName, "GDK", "gdk_cursor_get_name", false) | |||
| 237 | - | ||||
| 238 | cret := xCursorGetName(x.GoPointer()) | 228 | cret := xCursorGetName(x.GoPointer()) | ||
| 239 | return cret | 229 | return cret | ||
| 240 | } | 230 | } | ||
| @@ -245,7 +235,6 @@ var xCursorGetTexture func(uintptr) uintptr | |||||
| 245 | // | 235 | // | ||
| 246 | // If the cursor is a named cursor, %NULL will be returned. | 236 | // If the cursor is a named cursor, %NULL will be returned. | ||
| 247 | func (x *Cursor) GetTexture() *Texture { | 237 | func (x *Cursor) GetTexture() *Texture { | ||
| 248 | - | core.LazyRegister(&xCursorGetTexture, "GDK", "gdk_cursor_get_texture", false) | |||
| 249 | var cls *Texture | 238 | var cls *Texture | ||
| 250 | 239 | ||||
| 251 | cret := xCursorGetTexture(x.GoPointer()) | 240 | cret := xCursorGetTexture(x.GoPointer()) | ||
| @@ -328,4 +317,24 @@ func (x *Cursor) GetPropertyName() string { | |||||
| 328 | func init() { | 317 | func init() { | ||
| 329 | core.SetPackageName("GDK", "gtk4") | 318 | core.SetPackageName("GDK", "gtk4") | ||
| 330 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | 319 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | ||
| 320 | + | var libs []uintptr | |||
| 321 | + | for _, libPath := range core.GetPaths("GDK") { | |||
| 322 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 323 | + | if err != nil { | |||
| 324 | + | panic(err) | |||
| 325 | + | } | |||
| 326 | + | libs = append(libs, lib) | |||
| 327 | + | } | |||
| 328 | + | ||||
| 329 | + | core.PuregoSafeRegister(&xCursorGLibType, libs, "gdk_cursor_get_type") | |||
| 330 | + | ||||
| 331 | + | core.PuregoSafeRegister(&xNewCursorFromCallback, libs, "gdk_cursor_new_from_callback") | |||
| 332 | + | core.PuregoSafeRegister(&xNewCursorFromName, libs, "gdk_cursor_new_from_name") | |||
| 333 | + | core.PuregoSafeRegister(&xNewCursorFromTexture, libs, "gdk_cursor_new_from_texture") | |||
| 334 | + | ||||
| 335 | + | core.PuregoSafeRegister(&xCursorGetFallback, libs, "gdk_cursor_get_fallback") | |||
| 336 | + | core.PuregoSafeRegister(&xCursorGetHotspotX, libs, "gdk_cursor_get_hotspot_x") | |||
| 337 | + | core.PuregoSafeRegister(&xCursorGetHotspotY, libs, "gdk_cursor_get_hotspot_y") | |||
| 338 | + | core.PuregoSafeRegister(&xCursorGetName, libs, "gdk_cursor_get_name") | |||
| 339 | + | core.PuregoSafeRegister(&xCursorGetTexture, libs, "gdk_cursor_get_texture") | |||
| 331 | } | 340 | } | ||