Merge pull request #349 from bnema/fix/rollback-lazy-puregotk
fix(deps): emergency rollback puregotk lazy registration regression
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
| @@ -4,6 +4,7 @@ package gdk | |||
| 4 | 4 | import ( | |
| 5 | 5 | "unsafe" | |
| 6 | 6 | ||
| 7 | + | "github.com/bnema/purego" | |
| 7 | 8 | "github.com/bnema/puregotk/pkg/core" | |
| 8 | 9 | "github.com/bnema/puregotk/v4/gio" | |
| 9 | 10 | "github.com/bnema/puregotk/v4/glib" | |
| @@ -34,7 +35,6 @@ type Clipboard struct { | |||
| 34 | 35 | var xClipboardGLibType func() types.GType | |
| 35 | 36 | ||
| 36 | 37 | func ClipboardGLibType() types.GType { | |
| 37 | - | core.LazyRegister(&xClipboardGLibType, "GDK", "gdk_clipboard_get_type", false) | |
| 38 | 38 | return xClipboardGLibType() | |
| 39 | 39 | } | |
| 40 | 40 | ||
| @@ -51,7 +51,6 @@ var xClipboardGetContent func(uintptr) uintptr | |||
| 51 | 51 | // If the @clipboard is empty or its contents are not owned by the | |
| 52 | 52 | // current process, %NULL will be returned. | |
| 53 | 53 | func (x *Clipboard) GetContent() *ContentProvider { | |
| 54 | - | core.LazyRegister(&xClipboardGetContent, "GDK", "gdk_clipboard_get_content", false) | |
| 55 | 54 | var cls *ContentProvider | |
| 56 | 55 | ||
| 57 | 56 | cret := xClipboardGetContent(x.GoPointer()) | |
| @@ -69,7 +68,6 @@ var xClipboardGetDisplay func(uintptr) uintptr | |||
| 69 | 68 | ||
| 70 | 69 | // Gets the `GdkDisplay` that the clipboard was created for. | |
| 71 | 70 | func (x *Clipboard) GetDisplay() *Display { | |
| 72 | - | core.LazyRegister(&xClipboardGetDisplay, "GDK", "gdk_clipboard_get_display", false) | |
| 73 | 71 | var cls *Display | |
| 74 | 72 | ||
| 75 | 73 | cret := xClipboardGetDisplay(x.GoPointer()) | |
| @@ -87,8 +85,6 @@ var xClipboardGetFormats func(uintptr) uintptr | |||
| 87 | 85 | ||
| 88 | 86 | // Gets the formats that the clipboard can provide its current contents in. | |
| 89 | 87 | func (x *Clipboard) GetFormats() *ContentFormats { | |
| 90 | - | core.LazyRegister(&xClipboardGetFormats, "GDK", "gdk_clipboard_get_formats", false) | |
| 91 | - | ||
| 92 | 88 | cret := xClipboardGetFormats(x.GoPointer()) | |
| 93 | 89 | if cret == 0 { | |
| 94 | 90 | return nil | |
| @@ -106,8 +102,6 @@ var xClipboardIsLocal func(uintptr) bool | |||
| 106 | 102 | // Note that [method@Gdk.Clipboard.get_content] may return %NULL | |
| 107 | 103 | // even on a local clipboard. In this case the clipboard is empty. | |
| 108 | 104 | func (x *Clipboard) IsLocal() bool { | |
| 109 | - | core.LazyRegister(&xClipboardIsLocal, "GDK", "gdk_clipboard_is_local", false) | |
| 110 | - | ||
| 111 | 105 | cret := xClipboardIsLocal(x.GoPointer()) | |
| 112 | 106 | return cret | |
| 113 | 107 | } | |
| @@ -120,8 +114,6 @@ var xClipboardReadAsync func(uintptr, []string, int, uintptr, uintptr, uintptr) | |||
| 120 | 114 | // The clipboard will choose the most suitable mime type from the given list | |
| 121 | 115 | // to fulfill the request, preferring the ones listed first. | |
| 122 | 116 | func (x *Clipboard) ReadAsync(MimeTypesVar []string, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 123 | - | core.LazyRegister(&xClipboardReadAsync, "GDK", "gdk_clipboard_read_async", false) | |
| 124 | - | ||
| 125 | 117 | xClipboardReadAsync(x.GoPointer(), MimeTypesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 126 | 118 | } | |
| 127 | 119 | ||
| @@ -131,7 +123,6 @@ var xClipboardReadFinish func(uintptr, uintptr, *string, **glib.Error) uintptr | |||
| 131 | 123 | // | |
| 132 | 124 | // See [method@Gdk.Clipboard.read_async]. | |
| 133 | 125 | func (x *Clipboard) ReadFinish(ResultVar gio.AsyncResult, OutMimeTypeVar *string) (*gio.InputStream, error) { | |
| 134 | - | core.LazyRegister(&xClipboardReadFinish, "GDK", "gdk_clipboard_read_finish", false) | |
| 135 | 126 | var cls *gio.InputStream | |
| 136 | 127 | var cerr *glib.Error | |
| 137 | 128 | ||
| @@ -156,8 +147,6 @@ var xClipboardReadTextAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 156 | 147 | // Use that function or [method@Gdk.Clipboard.read_async] directly if you | |
| 157 | 148 | // need more control over the operation. | |
| 158 | 149 | func (x *Clipboard) ReadTextAsync(CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 159 | - | core.LazyRegister(&xClipboardReadTextAsync, "GDK", "gdk_clipboard_read_text_async", false) | |
| 160 | - | ||
| 161 | 150 | xClipboardReadTextAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 162 | 151 | } | |
| 163 | 152 | ||
| @@ -167,7 +156,6 @@ var xClipboardReadTextFinish func(uintptr, uintptr, **glib.Error) string | |||
| 167 | 156 | // | |
| 168 | 157 | // See [method@Gdk.Clipboard.read_text_async]. | |
| 169 | 158 | func (x *Clipboard) ReadTextFinish(ResultVar gio.AsyncResult) (string, error) { | |
| 170 | - | core.LazyRegister(&xClipboardReadTextFinish, "GDK", "gdk_clipboard_read_text_finish", false) | |
| 171 | 159 | var cerr *glib.Error | |
| 172 | 160 | ||
| 173 | 161 | cret := xClipboardReadTextFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| @@ -185,8 +173,6 @@ var xClipboardReadTextureAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 185 | 173 | // Use that function or [method@Gdk.Clipboard.read_async] directly if you | |
| 186 | 174 | // need more control over the operation. | |
| 187 | 175 | func (x *Clipboard) ReadTextureAsync(CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 188 | - | core.LazyRegister(&xClipboardReadTextureAsync, "GDK", "gdk_clipboard_read_texture_async", false) | |
| 189 | - | ||
| 190 | 176 | xClipboardReadTextureAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 191 | 177 | } | |
| 192 | 178 | ||
| @@ -196,7 +182,6 @@ var xClipboardReadTextureFinish func(uintptr, uintptr, **glib.Error) uintptr | |||
| 196 | 182 | // | |
| 197 | 183 | // See [method@Gdk.Clipboard.read_texture_async]. | |
| 198 | 184 | func (x *Clipboard) ReadTextureFinish(ResultVar gio.AsyncResult) (*Texture, error) { | |
| 199 | - | core.LazyRegister(&xClipboardReadTextureFinish, "GDK", "gdk_clipboard_read_texture_finish", false) | |
| 200 | 185 | var cls *Texture | |
| 201 | 186 | var cerr *glib.Error | |
| 202 | 187 | ||
| @@ -222,8 +207,6 @@ var xClipboardReadValueAsync func(uintptr, types.GType, int, uintptr, uintptr, u | |||
| 222 | 207 | // the value will be copied directly. Otherwise, GDK will try to use | |
| 223 | 208 | // [func@content_deserialize_async] to convert the clipboard's data. | |
| 224 | 209 | func (x *Clipboard) ReadValueAsync(TypeVar types.GType, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 225 | - | core.LazyRegister(&xClipboardReadValueAsync, "GDK", "gdk_clipboard_read_value_async", false) | |
| 226 | - | ||
| 227 | 210 | xClipboardReadValueAsync(x.GoPointer(), TypeVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 228 | 211 | } | |
| 229 | 212 | ||
| @@ -233,7 +216,6 @@ var xClipboardReadValueFinish func(uintptr, uintptr, **glib.Error) uintptr | |||
| 233 | 216 | // | |
| 234 | 217 | // See [method@Gdk.Clipboard.read_value_async]. | |
| 235 | 218 | func (x *Clipboard) ReadValueFinish(ResultVar gio.AsyncResult) (*gobject.Value, error) { | |
| 236 | - | core.LazyRegister(&xClipboardReadValueFinish, "GDK", "gdk_clipboard_read_value_finish", false) | |
| 237 | 219 | var cerr *glib.Error | |
| 238 | 220 | ||
| 239 | 221 | cret := xClipboardReadValueFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| @@ -260,8 +242,6 @@ var xClipboardSet func(uintptr, types.GType, ...interface{}) | |||
| 260 | 242 | // gdk_clipboard_set (clipboard, GDK_TYPE_TEXTURE, some_texture); | |
| 261 | 243 | // ``` | |
| 262 | 244 | func (x *Clipboard) Set(TypeVar types.GType, varArgs ...interface{}) { | |
| 263 | - | core.LazyRegister(&xClipboardSet, "GDK", "gdk_clipboard_set", false) | |
| 264 | - | ||
| 265 | 245 | xClipboardSet(x.GoPointer(), TypeVar, varArgs...) | |
| 266 | 246 | } | |
| 267 | 247 | ||
| @@ -280,8 +260,6 @@ var xClipboardSetContent func(uintptr, uintptr) bool | |||
| 280 | 260 | // @clipboard's read functions, @clipboard will select the best format to | |
| 281 | 261 | // transfer the contents and then request that format from @provider. | |
| 282 | 262 | func (x *Clipboard) SetContent(ProviderVar *ContentProvider) bool { | |
| 283 | - | core.LazyRegister(&xClipboardSetContent, "GDK", "gdk_clipboard_set_content", false) | |
| 284 | - | ||
| 285 | 263 | cret := xClipboardSetContent(x.GoPointer(), ProviderVar.GoPointer()) | |
| 286 | 264 | return cret | |
| 287 | 265 | } | |
| @@ -290,8 +268,6 @@ var xClipboardSetText func(uintptr, string) | |||
| 290 | 268 | ||
| 291 | 269 | // Puts the given @text into the clipboard. | |
| 292 | 270 | func (x *Clipboard) SetText(TextVar string) { | |
| 293 | - | core.LazyRegister(&xClipboardSetText, "GDK", "gdk_clipboard_set_text", false) | |
| 294 | - | ||
| 295 | 271 | xClipboardSetText(x.GoPointer(), TextVar) | |
| 296 | 272 | } | |
| 297 | 273 | ||
| @@ -299,8 +275,6 @@ var xClipboardSetTexture func(uintptr, uintptr) | |||
| 299 | 275 | ||
| 300 | 276 | // Puts the given @texture into the clipboard. | |
| 301 | 277 | func (x *Clipboard) SetTexture(TextureVar *Texture) { | |
| 302 | - | core.LazyRegister(&xClipboardSetTexture, "GDK", "gdk_clipboard_set_texture", false) | |
| 303 | - | ||
| 304 | 278 | xClipboardSetTexture(x.GoPointer(), TextureVar.GoPointer()) | |
| 305 | 279 | } | |
| 306 | 280 | ||
| @@ -308,8 +282,6 @@ var xClipboardSetValist func(uintptr, types.GType, []interface{}) | |||
| 308 | 282 | ||
| 309 | 283 | // Sets the clipboard to contain the value collected from the given @args. | |
| 310 | 284 | func (x *Clipboard) SetValist(TypeVar types.GType, ArgsVar []interface{}) { | |
| 311 | - | core.LazyRegister(&xClipboardSetValist, "GDK", "gdk_clipboard_set_valist", false) | |
| 312 | - | ||
| 313 | 285 | xClipboardSetValist(x.GoPointer(), TypeVar, ArgsVar) | |
| 314 | 286 | } | |
| 315 | 287 | ||
| @@ -317,8 +289,6 @@ var xClipboardSetValue func(uintptr, *gobject.Value) | |||
| 317 | 289 | ||
| 318 | 290 | // Sets the @clipboard to contain the given @value. | |
| 319 | 291 | func (x *Clipboard) SetValue(ValueVar *gobject.Value) { | |
| 320 | - | core.LazyRegister(&xClipboardSetValue, "GDK", "gdk_clipboard_set_value", false) | |
| 321 | - | ||
| 322 | 292 | xClipboardSetValue(x.GoPointer(), ValueVar) | |
| 323 | 293 | } | |
| 324 | 294 | ||
| @@ -337,8 +307,6 @@ var xClipboardStoreAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 337 | 307 | // [GtkApplication](../gtk4/class.Application.html) | |
| 338 | 308 | // is shut down, so you likely don't need to call it. | |
| 339 | 309 | func (x *Clipboard) StoreAsync(IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 340 | - | core.LazyRegister(&xClipboardStoreAsync, "GDK", "gdk_clipboard_store_async", false) | |
| 341 | - | ||
| 342 | 310 | xClipboardStoreAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 343 | 311 | } | |
| 344 | 312 | ||
| @@ -348,7 +316,6 @@ var xClipboardStoreFinish func(uintptr, uintptr, **glib.Error) bool | |||
| 348 | 316 | // | |
| 349 | 317 | // See [method@Gdk.Clipboard.store_async]. | |
| 350 | 318 | func (x *Clipboard) StoreFinish(ResultVar gio.AsyncResult) (bool, error) { | |
| 351 | - | core.LazyRegister(&xClipboardStoreFinish, "GDK", "gdk_clipboard_store_finish", false) | |
| 352 | 319 | var cerr *glib.Error | |
| 353 | 320 | ||
| 354 | 321 | cret := xClipboardStoreFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | |
| @@ -411,4 +378,35 @@ func (x *Clipboard) ConnectChanged(cb *func(Clipboard)) uint { | |||
| 411 | 378 | func init() { | |
| 412 | 379 | core.SetPackageName("GDK", "gtk4") | |
| 413 | 380 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | |
| 381 | + | var libs []uintptr | |
| 382 | + | for _, libPath := range core.GetPaths("GDK") { | |
| 383 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 384 | + | if err != nil { | |
| 385 | + | panic(err) | |
| 386 | + | } | |
| 387 | + | libs = append(libs, lib) | |
| 388 | + | } | |
| 389 | + | ||
| 390 | + | core.PuregoSafeRegister(&xClipboardGLibType, libs, "gdk_clipboard_get_type") | |
| 391 | + | ||
| 392 | + | core.PuregoSafeRegister(&xClipboardGetContent, libs, "gdk_clipboard_get_content") | |
| 393 | + | core.PuregoSafeRegister(&xClipboardGetDisplay, libs, "gdk_clipboard_get_display") | |
| 394 | + | core.PuregoSafeRegister(&xClipboardGetFormats, libs, "gdk_clipboard_get_formats") | |
| 395 | + | core.PuregoSafeRegister(&xClipboardIsLocal, libs, "gdk_clipboard_is_local") | |
| 396 | + | core.PuregoSafeRegister(&xClipboardReadAsync, libs, "gdk_clipboard_read_async") | |
| 397 | + | core.PuregoSafeRegister(&xClipboardReadFinish, libs, "gdk_clipboard_read_finish") | |
| 398 | + | core.PuregoSafeRegister(&xClipboardReadTextAsync, libs, "gdk_clipboard_read_text_async") | |
| 399 | + | core.PuregoSafeRegister(&xClipboardReadTextFinish, libs, "gdk_clipboard_read_text_finish") | |
| 400 | + | core.PuregoSafeRegister(&xClipboardReadTextureAsync, libs, "gdk_clipboard_read_texture_async") | |
| 401 | + | core.PuregoSafeRegister(&xClipboardReadTextureFinish, libs, "gdk_clipboard_read_texture_finish") | |
| 402 | + | core.PuregoSafeRegister(&xClipboardReadValueAsync, libs, "gdk_clipboard_read_value_async") | |
| 403 | + | core.PuregoSafeRegister(&xClipboardReadValueFinish, libs, "gdk_clipboard_read_value_finish") | |
| 404 | + | core.PuregoSafeRegister(&xClipboardSet, libs, "gdk_clipboard_set") | |
| 405 | + | core.PuregoSafeRegister(&xClipboardSetContent, libs, "gdk_clipboard_set_content") | |
| 406 | + | core.PuregoSafeRegister(&xClipboardSetText, libs, "gdk_clipboard_set_text") | |
| 407 | + | core.PuregoSafeRegister(&xClipboardSetTexture, libs, "gdk_clipboard_set_texture") | |
| 408 | + | core.PuregoSafeRegister(&xClipboardSetValist, libs, "gdk_clipboard_set_valist") | |
| 409 | + | core.PuregoSafeRegister(&xClipboardSetValue, libs, "gdk_clipboard_set_value") | |
| 410 | + | core.PuregoSafeRegister(&xClipboardStoreAsync, libs, "gdk_clipboard_store_async") | |
| 411 | + | core.PuregoSafeRegister(&xClipboardStoreFinish, libs, "gdk_clipboard_store_finish") | |
| 414 | 412 | } | |
| @@ -4,6 +4,7 @@ package gdk | |||||
| 4 | import ( | 4 | import ( | ||
| 5 | "unsafe" | 5 | "unsafe" | ||
| 6 | 6 | ||||
| 7 | + | "github.com/bnema/purego" | |||
| 7 | "github.com/bnema/puregotk/pkg/core" | 8 | "github.com/bnema/puregotk/pkg/core" | ||
| 8 | "github.com/bnema/puregotk/v4/gio" | 9 | "github.com/bnema/puregotk/v4/gio" | ||
| 9 | "github.com/bnema/puregotk/v4/glib" | 10 | "github.com/bnema/puregotk/v4/glib" | ||
| @@ -34,7 +35,6 @@ type Clipboard struct { | |||||
| 34 | var xClipboardGLibType func() types.GType | 35 | var xClipboardGLibType func() types.GType | ||
| 35 | 36 | ||||
| 36 | func ClipboardGLibType() types.GType { | 37 | func ClipboardGLibType() types.GType { | ||
| 37 | - | core.LazyRegister(&xClipboardGLibType, "GDK", "gdk_clipboard_get_type", false) | |||
| 38 | return xClipboardGLibType() | 38 | return xClipboardGLibType() | ||
| 39 | } | 39 | } | ||
| 40 | 40 | ||||
| @@ -51,7 +51,6 @@ var xClipboardGetContent func(uintptr) uintptr | |||||
| 51 | // If the @clipboard is empty or its contents are not owned by the | 51 | // If the @clipboard is empty or its contents are not owned by the | ||
| 52 | // current process, %NULL will be returned. | 52 | // current process, %NULL will be returned. | ||
| 53 | func (x *Clipboard) GetContent() *ContentProvider { | 53 | func (x *Clipboard) GetContent() *ContentProvider { | ||
| 54 | - | core.LazyRegister(&xClipboardGetContent, "GDK", "gdk_clipboard_get_content", false) | |||
| 55 | var cls *ContentProvider | 54 | var cls *ContentProvider | ||
| 56 | 55 | ||||
| 57 | cret := xClipboardGetContent(x.GoPointer()) | 56 | cret := xClipboardGetContent(x.GoPointer()) | ||
| @@ -69,7 +68,6 @@ var xClipboardGetDisplay func(uintptr) uintptr | |||||
| 69 | 68 | ||||
| 70 | // Gets the `GdkDisplay` that the clipboard was created for. | 69 | // Gets the `GdkDisplay` that the clipboard was created for. | ||
| 71 | func (x *Clipboard) GetDisplay() *Display { | 70 | func (x *Clipboard) GetDisplay() *Display { | ||
| 72 | - | core.LazyRegister(&xClipboardGetDisplay, "GDK", "gdk_clipboard_get_display", false) | |||
| 73 | var cls *Display | 71 | var cls *Display | ||
| 74 | 72 | ||||
| 75 | cret := xClipboardGetDisplay(x.GoPointer()) | 73 | cret := xClipboardGetDisplay(x.GoPointer()) | ||
| @@ -87,8 +85,6 @@ var xClipboardGetFormats func(uintptr) uintptr | |||||
| 87 | 85 | ||||
| 88 | // Gets the formats that the clipboard can provide its current contents in. | 86 | // Gets the formats that the clipboard can provide its current contents in. | ||
| 89 | func (x *Clipboard) GetFormats() *ContentFormats { | 87 | func (x *Clipboard) GetFormats() *ContentFormats { | ||
| 90 | - | core.LazyRegister(&xClipboardGetFormats, "GDK", "gdk_clipboard_get_formats", false) | |||
| 91 | - | ||||
| 92 | cret := xClipboardGetFormats(x.GoPointer()) | 88 | cret := xClipboardGetFormats(x.GoPointer()) | ||
| 93 | if cret == 0 { | 89 | if cret == 0 { | ||
| 94 | return nil | 90 | return nil | ||
| @@ -106,8 +102,6 @@ var xClipboardIsLocal func(uintptr) bool | |||||
| 106 | // Note that [method@Gdk.Clipboard.get_content] may return %NULL | 102 | // Note that [method@Gdk.Clipboard.get_content] may return %NULL | ||
| 107 | // even on a local clipboard. In this case the clipboard is empty. | 103 | // even on a local clipboard. In this case the clipboard is empty. | ||
| 108 | func (x *Clipboard) IsLocal() bool { | 104 | func (x *Clipboard) IsLocal() bool { | ||
| 109 | - | core.LazyRegister(&xClipboardIsLocal, "GDK", "gdk_clipboard_is_local", false) | |||
| 110 | - | ||||
| 111 | cret := xClipboardIsLocal(x.GoPointer()) | 105 | cret := xClipboardIsLocal(x.GoPointer()) | ||
| 112 | return cret | 106 | return cret | ||
| 113 | } | 107 | } | ||
| @@ -120,8 +114,6 @@ var xClipboardReadAsync func(uintptr, []string, int, uintptr, uintptr, uintptr) | |||||
| 120 | // The clipboard will choose the most suitable mime type from the given list | 114 | // The clipboard will choose the most suitable mime type from the given list | ||
| 121 | // to fulfill the request, preferring the ones listed first. | 115 | // to fulfill the request, preferring the ones listed first. | ||
| 122 | func (x *Clipboard) ReadAsync(MimeTypesVar []string, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | 116 | func (x *Clipboard) ReadAsync(MimeTypesVar []string, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | ||
| 123 | - | core.LazyRegister(&xClipboardReadAsync, "GDK", "gdk_clipboard_read_async", false) | |||
| 124 | - | ||||
| 125 | xClipboardReadAsync(x.GoPointer(), MimeTypesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | 117 | xClipboardReadAsync(x.GoPointer(), MimeTypesVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | ||
| 126 | } | 118 | } | ||
| 127 | 119 | ||||
| @@ -131,7 +123,6 @@ var xClipboardReadFinish func(uintptr, uintptr, *string, **glib.Error) uintptr | |||||
| 131 | // | 123 | // | ||
| 132 | // See [method@Gdk.Clipboard.read_async]. | 124 | // See [method@Gdk.Clipboard.read_async]. | ||
| 133 | func (x *Clipboard) ReadFinish(ResultVar gio.AsyncResult, OutMimeTypeVar *string) (*gio.InputStream, error) { | 125 | func (x *Clipboard) ReadFinish(ResultVar gio.AsyncResult, OutMimeTypeVar *string) (*gio.InputStream, error) { | ||
| 134 | - | core.LazyRegister(&xClipboardReadFinish, "GDK", "gdk_clipboard_read_finish", false) | |||
| 135 | var cls *gio.InputStream | 126 | var cls *gio.InputStream | ||
| 136 | var cerr *glib.Error | 127 | var cerr *glib.Error | ||
| 137 | 128 | ||||
| @@ -156,8 +147,6 @@ var xClipboardReadTextAsync func(uintptr, uintptr, uintptr, uintptr) | |||||
| 156 | // Use that function or [method@Gdk.Clipboard.read_async] directly if you | 147 | // Use that function or [method@Gdk.Clipboard.read_async] directly if you | ||
| 157 | // need more control over the operation. | 148 | // need more control over the operation. | ||
| 158 | func (x *Clipboard) ReadTextAsync(CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | 149 | func (x *Clipboard) ReadTextAsync(CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | ||
| 159 | - | core.LazyRegister(&xClipboardReadTextAsync, "GDK", "gdk_clipboard_read_text_async", false) | |||
| 160 | - | ||||
| 161 | xClipboardReadTextAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | 150 | xClipboardReadTextAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | ||
| 162 | } | 151 | } | ||
| 163 | 152 | ||||
| @@ -167,7 +156,6 @@ var xClipboardReadTextFinish func(uintptr, uintptr, **glib.Error) string | |||||
| 167 | // | 156 | // | ||
| 168 | // See [method@Gdk.Clipboard.read_text_async]. | 157 | // See [method@Gdk.Clipboard.read_text_async]. | ||
| 169 | func (x *Clipboard) ReadTextFinish(ResultVar gio.AsyncResult) (string, error) { | 158 | func (x *Clipboard) ReadTextFinish(ResultVar gio.AsyncResult) (string, error) { | ||
| 170 | - | core.LazyRegister(&xClipboardReadTextFinish, "GDK", "gdk_clipboard_read_text_finish", false) | |||
| 171 | var cerr *glib.Error | 159 | var cerr *glib.Error | ||
| 172 | 160 | ||||
| 173 | cret := xClipboardReadTextFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | 161 | cret := xClipboardReadTextFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | ||
| @@ -185,8 +173,6 @@ var xClipboardReadTextureAsync func(uintptr, uintptr, uintptr, uintptr) | |||||
| 185 | // Use that function or [method@Gdk.Clipboard.read_async] directly if you | 173 | // Use that function or [method@Gdk.Clipboard.read_async] directly if you | ||
| 186 | // need more control over the operation. | 174 | // need more control over the operation. | ||
| 187 | func (x *Clipboard) ReadTextureAsync(CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | 175 | func (x *Clipboard) ReadTextureAsync(CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | ||
| 188 | - | core.LazyRegister(&xClipboardReadTextureAsync, "GDK", "gdk_clipboard_read_texture_async", false) | |||
| 189 | - | ||||
| 190 | xClipboardReadTextureAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | 176 | xClipboardReadTextureAsync(x.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | ||
| 191 | } | 177 | } | ||
| 192 | 178 | ||||
| @@ -196,7 +182,6 @@ var xClipboardReadTextureFinish func(uintptr, uintptr, **glib.Error) uintptr | |||||
| 196 | // | 182 | // | ||
| 197 | // See [method@Gdk.Clipboard.read_texture_async]. | 183 | // See [method@Gdk.Clipboard.read_texture_async]. | ||
| 198 | func (x *Clipboard) ReadTextureFinish(ResultVar gio.AsyncResult) (*Texture, error) { | 184 | func (x *Clipboard) ReadTextureFinish(ResultVar gio.AsyncResult) (*Texture, error) { | ||
| 199 | - | core.LazyRegister(&xClipboardReadTextureFinish, "GDK", "gdk_clipboard_read_texture_finish", false) | |||
| 200 | var cls *Texture | 185 | var cls *Texture | ||
| 201 | var cerr *glib.Error | 186 | var cerr *glib.Error | ||
| 202 | 187 | ||||
| @@ -222,8 +207,6 @@ var xClipboardReadValueAsync func(uintptr, types.GType, int, uintptr, uintptr, u | |||||
| 222 | // the value will be copied directly. Otherwise, GDK will try to use | 207 | // the value will be copied directly. Otherwise, GDK will try to use | ||
| 223 | // [func@content_deserialize_async] to convert the clipboard's data. | 208 | // [func@content_deserialize_async] to convert the clipboard's data. | ||
| 224 | func (x *Clipboard) ReadValueAsync(TypeVar types.GType, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | 209 | func (x *Clipboard) ReadValueAsync(TypeVar types.GType, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | ||
| 225 | - | core.LazyRegister(&xClipboardReadValueAsync, "GDK", "gdk_clipboard_read_value_async", false) | |||
| 226 | - | ||||
| 227 | xClipboardReadValueAsync(x.GoPointer(), TypeVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | 210 | xClipboardReadValueAsync(x.GoPointer(), TypeVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | ||
| 228 | } | 211 | } | ||
| 229 | 212 | ||||
| @@ -233,7 +216,6 @@ var xClipboardReadValueFinish func(uintptr, uintptr, **glib.Error) uintptr | |||||
| 233 | // | 216 | // | ||
| 234 | // See [method@Gdk.Clipboard.read_value_async]. | 217 | // See [method@Gdk.Clipboard.read_value_async]. | ||
| 235 | func (x *Clipboard) ReadValueFinish(ResultVar gio.AsyncResult) (*gobject.Value, error) { | 218 | func (x *Clipboard) ReadValueFinish(ResultVar gio.AsyncResult) (*gobject.Value, error) { | ||
| 236 | - | core.LazyRegister(&xClipboardReadValueFinish, "GDK", "gdk_clipboard_read_value_finish", false) | |||
| 237 | var cerr *glib.Error | 219 | var cerr *glib.Error | ||
| 238 | 220 | ||||
| 239 | cret := xClipboardReadValueFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | 221 | cret := xClipboardReadValueFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | ||
| @@ -260,8 +242,6 @@ var xClipboardSet func(uintptr, types.GType, ...interface{}) | |||||
| 260 | // gdk_clipboard_set (clipboard, GDK_TYPE_TEXTURE, some_texture); | 242 | // gdk_clipboard_set (clipboard, GDK_TYPE_TEXTURE, some_texture); | ||
| 261 | // ``` | 243 | // ``` | ||
| 262 | func (x *Clipboard) Set(TypeVar types.GType, varArgs ...interface{}) { | 244 | func (x *Clipboard) Set(TypeVar types.GType, varArgs ...interface{}) { | ||
| 263 | - | core.LazyRegister(&xClipboardSet, "GDK", "gdk_clipboard_set", false) | |||
| 264 | - | ||||
| 265 | xClipboardSet(x.GoPointer(), TypeVar, varArgs...) | 245 | xClipboardSet(x.GoPointer(), TypeVar, varArgs...) | ||
| 266 | } | 246 | } | ||
| 267 | 247 | ||||
| @@ -280,8 +260,6 @@ var xClipboardSetContent func(uintptr, uintptr) bool | |||||
| 280 | // @clipboard's read functions, @clipboard will select the best format to | 260 | // @clipboard's read functions, @clipboard will select the best format to | ||
| 281 | // transfer the contents and then request that format from @provider. | 261 | // transfer the contents and then request that format from @provider. | ||
| 282 | func (x *Clipboard) SetContent(ProviderVar *ContentProvider) bool { | 262 | func (x *Clipboard) SetContent(ProviderVar *ContentProvider) bool { | ||
| 283 | - | core.LazyRegister(&xClipboardSetContent, "GDK", "gdk_clipboard_set_content", false) | |||
| 284 | - | ||||
| 285 | cret := xClipboardSetContent(x.GoPointer(), ProviderVar.GoPointer()) | 263 | cret := xClipboardSetContent(x.GoPointer(), ProviderVar.GoPointer()) | ||
| 286 | return cret | 264 | return cret | ||
| 287 | } | 265 | } | ||
| @@ -290,8 +268,6 @@ var xClipboardSetText func(uintptr, string) | |||||
| 290 | 268 | ||||
| 291 | // Puts the given @text into the clipboard. | 269 | // Puts the given @text into the clipboard. | ||
| 292 | func (x *Clipboard) SetText(TextVar string) { | 270 | func (x *Clipboard) SetText(TextVar string) { | ||
| 293 | - | core.LazyRegister(&xClipboardSetText, "GDK", "gdk_clipboard_set_text", false) | |||
| 294 | - | ||||
| 295 | xClipboardSetText(x.GoPointer(), TextVar) | 271 | xClipboardSetText(x.GoPointer(), TextVar) | ||
| 296 | } | 272 | } | ||
| 297 | 273 | ||||
| @@ -299,8 +275,6 @@ var xClipboardSetTexture func(uintptr, uintptr) | |||||
| 299 | 275 | ||||
| 300 | // Puts the given @texture into the clipboard. | 276 | // Puts the given @texture into the clipboard. | ||
| 301 | func (x *Clipboard) SetTexture(TextureVar *Texture) { | 277 | func (x *Clipboard) SetTexture(TextureVar *Texture) { | ||
| 302 | - | core.LazyRegister(&xClipboardSetTexture, "GDK", "gdk_clipboard_set_texture", false) | |||
| 303 | - | ||||
| 304 | xClipboardSetTexture(x.GoPointer(), TextureVar.GoPointer()) | 278 | xClipboardSetTexture(x.GoPointer(), TextureVar.GoPointer()) | ||
| 305 | } | 279 | } | ||
| 306 | 280 | ||||
| @@ -308,8 +282,6 @@ var xClipboardSetValist func(uintptr, types.GType, []interface{}) | |||||
| 308 | 282 | ||||
| 309 | // Sets the clipboard to contain the value collected from the given @args. | 283 | // Sets the clipboard to contain the value collected from the given @args. | ||
| 310 | func (x *Clipboard) SetValist(TypeVar types.GType, ArgsVar []interface{}) { | 284 | func (x *Clipboard) SetValist(TypeVar types.GType, ArgsVar []interface{}) { | ||
| 311 | - | core.LazyRegister(&xClipboardSetValist, "GDK", "gdk_clipboard_set_valist", false) | |||
| 312 | - | ||||
| 313 | xClipboardSetValist(x.GoPointer(), TypeVar, ArgsVar) | 285 | xClipboardSetValist(x.GoPointer(), TypeVar, ArgsVar) | ||
| 314 | } | 286 | } | ||
| 315 | 287 | ||||
| @@ -317,8 +289,6 @@ var xClipboardSetValue func(uintptr, *gobject.Value) | |||||
| 317 | 289 | ||||
| 318 | // Sets the @clipboard to contain the given @value. | 290 | // Sets the @clipboard to contain the given @value. | ||
| 319 | func (x *Clipboard) SetValue(ValueVar *gobject.Value) { | 291 | func (x *Clipboard) SetValue(ValueVar *gobject.Value) { | ||
| 320 | - | core.LazyRegister(&xClipboardSetValue, "GDK", "gdk_clipboard_set_value", false) | |||
| 321 | - | ||||
| 322 | xClipboardSetValue(x.GoPointer(), ValueVar) | 292 | xClipboardSetValue(x.GoPointer(), ValueVar) | ||
| 323 | } | 293 | } | ||
| 324 | 294 | ||||
| @@ -337,8 +307,6 @@ var xClipboardStoreAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||||
| 337 | // [GtkApplication](../gtk4/class.Application.html) | 307 | // [GtkApplication](../gtk4/class.Application.html) | ||
| 338 | // is shut down, so you likely don't need to call it. | 308 | // is shut down, so you likely don't need to call it. | ||
| 339 | func (x *Clipboard) StoreAsync(IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | 309 | func (x *Clipboard) StoreAsync(IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | ||
| 340 | - | core.LazyRegister(&xClipboardStoreAsync, "GDK", "gdk_clipboard_store_async", false) | |||
| 341 | - | ||||
| 342 | xClipboardStoreAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | 310 | xClipboardStoreAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | ||
| 343 | } | 311 | } | ||
| 344 | 312 | ||||
| @@ -348,7 +316,6 @@ var xClipboardStoreFinish func(uintptr, uintptr, **glib.Error) bool | |||||
| 348 | // | 316 | // | ||
| 349 | // See [method@Gdk.Clipboard.store_async]. | 317 | // See [method@Gdk.Clipboard.store_async]. | ||
| 350 | func (x *Clipboard) StoreFinish(ResultVar gio.AsyncResult) (bool, error) { | 318 | func (x *Clipboard) StoreFinish(ResultVar gio.AsyncResult) (bool, error) { | ||
| 351 | - | core.LazyRegister(&xClipboardStoreFinish, "GDK", "gdk_clipboard_store_finish", false) | |||
| 352 | var cerr *glib.Error | 319 | var cerr *glib.Error | ||
| 353 | 320 | ||||
| 354 | cret := xClipboardStoreFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | 321 | cret := xClipboardStoreFinish(x.GoPointer(), ResultVar.GoPointer(), &cerr) | ||
| @@ -411,4 +378,35 @@ func (x *Clipboard) ConnectChanged(cb *func(Clipboard)) uint { | |||||
| 411 | func init() { | 378 | func init() { | ||
| 412 | core.SetPackageName("GDK", "gtk4") | 379 | core.SetPackageName("GDK", "gtk4") | ||
| 413 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | 380 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | ||
| 381 | + | var libs []uintptr | |||
| 382 | + | for _, libPath := range core.GetPaths("GDK") { | |||
| 383 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 384 | + | if err != nil { | |||
| 385 | + | panic(err) | |||
| 386 | + | } | |||
| 387 | + | libs = append(libs, lib) | |||
| 388 | + | } | |||
| 389 | + | ||||
| 390 | + | core.PuregoSafeRegister(&xClipboardGLibType, libs, "gdk_clipboard_get_type") | |||
| 391 | + | ||||
| 392 | + | core.PuregoSafeRegister(&xClipboardGetContent, libs, "gdk_clipboard_get_content") | |||
| 393 | + | core.PuregoSafeRegister(&xClipboardGetDisplay, libs, "gdk_clipboard_get_display") | |||
| 394 | + | core.PuregoSafeRegister(&xClipboardGetFormats, libs, "gdk_clipboard_get_formats") | |||
| 395 | + | core.PuregoSafeRegister(&xClipboardIsLocal, libs, "gdk_clipboard_is_local") | |||
| 396 | + | core.PuregoSafeRegister(&xClipboardReadAsync, libs, "gdk_clipboard_read_async") | |||
| 397 | + | core.PuregoSafeRegister(&xClipboardReadFinish, libs, "gdk_clipboard_read_finish") | |||
| 398 | + | core.PuregoSafeRegister(&xClipboardReadTextAsync, libs, "gdk_clipboard_read_text_async") | |||
| 399 | + | core.PuregoSafeRegister(&xClipboardReadTextFinish, libs, "gdk_clipboard_read_text_finish") | |||
| 400 | + | core.PuregoSafeRegister(&xClipboardReadTextureAsync, libs, "gdk_clipboard_read_texture_async") | |||
| 401 | + | core.PuregoSafeRegister(&xClipboardReadTextureFinish, libs, "gdk_clipboard_read_texture_finish") | |||
| 402 | + | core.PuregoSafeRegister(&xClipboardReadValueAsync, libs, "gdk_clipboard_read_value_async") | |||
| 403 | + | core.PuregoSafeRegister(&xClipboardReadValueFinish, libs, "gdk_clipboard_read_value_finish") | |||
| 404 | + | core.PuregoSafeRegister(&xClipboardSet, libs, "gdk_clipboard_set") | |||
| 405 | + | core.PuregoSafeRegister(&xClipboardSetContent, libs, "gdk_clipboard_set_content") | |||
| 406 | + | core.PuregoSafeRegister(&xClipboardSetText, libs, "gdk_clipboard_set_text") | |||
| 407 | + | core.PuregoSafeRegister(&xClipboardSetTexture, libs, "gdk_clipboard_set_texture") | |||
| 408 | + | core.PuregoSafeRegister(&xClipboardSetValist, libs, "gdk_clipboard_set_valist") | |||
| 409 | + | core.PuregoSafeRegister(&xClipboardSetValue, libs, "gdk_clipboard_set_value") | |||
| 410 | + | core.PuregoSafeRegister(&xClipboardStoreAsync, libs, "gdk_clipboard_store_async") | |||
| 411 | + | core.PuregoSafeRegister(&xClipboardStoreFinish, libs, "gdk_clipboard_store_finish") | |||
| 414 | } | 412 | } | ||