Merge pull request #350 from bnema/fix/repin-fixed-puregotk
fix(deps): validate puregotk lazy registration fix
907 files · +27874 -25296
M go.mod +3 -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.0 | |
| 14 | + | github.com/bnema/puregotk v0.7.1-0.20260714200603-7370c78950ef | |
| 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 | |
| @@ -47,6 +47,7 @@ require ( | |||
| 47 | 47 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | |
| 48 | 48 | github.com/fatih/color v1.19.0 // indirect | |
| 49 | 49 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | |
| 50 | + | github.com/google/go-cmp v0.7.0 // indirect | |
| 50 | 51 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | |
| 51 | 52 | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | |
| 52 | 53 | github.com/mattn/go-colorable v0.1.14 // indirect | |
| @@ -80,6 +81,7 @@ require ( | |||
| 80 | 81 | golang.org/x/text v0.40.0 // indirect | |
| 81 | 82 | golang.org/x/tools v0.47.0 // indirect | |
| 82 | 83 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | |
| 84 | + | mvdan.cc/gofumpt v0.9.2 // indirect | |
| 83 | 85 | ) | |
| 84 | 86 | ||
| 85 | 87 | tool github.com/a-h/templ/cmd/templ | |
| @@ -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.0 | 14 | + | github.com/bnema/puregotk v0.7.1-0.20260714200603-7370c78950ef |
| 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 | ||
| @@ -47,6 +47,7 @@ require ( | |||||
| 47 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | 47 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | ||
| 48 | github.com/fatih/color v1.19.0 // indirect | 48 | github.com/fatih/color v1.19.0 // indirect | ||
| 49 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | 49 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | ||
| 50 | + | github.com/google/go-cmp v0.7.0 // indirect | |||
| 50 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | 51 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
| 51 | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | 52 | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | ||
| 52 | github.com/mattn/go-colorable v0.1.14 // indirect | 53 | github.com/mattn/go-colorable v0.1.14 // indirect | ||
| @@ -80,6 +81,7 @@ require ( | |||||
| 80 | golang.org/x/text v0.40.0 // indirect | 81 | golang.org/x/text v0.40.0 // indirect | ||
| 81 | golang.org/x/tools v0.47.0 // indirect | 82 | golang.org/x/tools v0.47.0 // indirect | ||
| 82 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | 83 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | ||
| 84 | + | mvdan.cc/gofumpt v0.9.2 // indirect | |||
| 83 | ) | 85 | ) | ||
| 84 | 86 | ||||
| 85 | tool github.com/a-h/templ/cmd/templ | 87 | tool github.com/a-h/templ/cmd/templ | ||
M go.sum +4 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/internal/core/core.go +197 -4 generated file: collapsed
M vendor/github.com/bnema/puregotk/pkg/core/core.go +10 -0 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-about-dialog.go +99 -64 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-about-window.go +95 -62 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-accent-color.go +7 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-action-row.go +33 -29 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-alert-dialog.go +66 -47 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation-target.go +10 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation-util.go +4 -12 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-animation.go +24 -26 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-application-window.go +14 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-application.go +3 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-avatar.go +22 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-banner.go +23 -26 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-bin.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-bottom-sheet.go +47 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-breakpoint-bin.go +10 -19 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-breakpoint.go +33 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-button-content.go +18 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-button-row.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel-indicator-dots.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel-indicator-lines.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-carousel.go +47 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp-layout.go +14 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp-scrollable.go +17 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-clamp.go +17 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-combo-row.go +34 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-dialog.go +45 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-easing.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-entry-row.go +40 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-enum-list-model.go +13 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-expander-row.go +40 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-flap.go +61 -48 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-fold-threshold-policy.go +10 -1 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-header-bar.go +36 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-inline-view-switcher.go +18 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-layout-slot.go +4 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-layout.go +7 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-leaflet.go +69 -56 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-length-unit.go +5 -14 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-main.go +5 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-message-dialog.go +63 -44 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-multi-layout-view.go +17 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-direction.go +10 -1 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-split-view.go +36 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-navigation-view.go +60 -49 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-overlay-split-view.go +48 -38 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-password-entry-row.go +2 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-dialog.go +23 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-group.go +24 -26 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-page.go +38 -33 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-row.go +18 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-preferences-window.go +31 -29 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcut-label.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-dialog.go +4 -15 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-item.go +23 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-shortcuts-section.go +8 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar-item.go +45 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar-section.go +24 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-sidebar.go +41 -39 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spin-row.go +40 -34 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spinner-paintable.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spinner.go +2 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-split-button.go +39 -34 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spring-animation.go +34 -30 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-spring-params.go +17 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-squeezer.go +49 -44 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-status-page.go +20 -24 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-style-manager.go +25 -28 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-swipe-tracker.go +33 -30 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-swipeable.go +33 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-switch-row.go +6 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-bar.go +35 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-button.go +5 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-overview.go +45 -37 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-tab-view.go +123 -87 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-timed-animation.go +30 -28 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toast-overlay.go +9 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toast.go +41 -36 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toggle-group.go +64 -51 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-toolbar-view.go +40 -35 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-version.go +7 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-stack.go +78 -62 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-bar.go +9 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-sidebar.go +15 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher-title.go +19 -23 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-view-switcher.go +10 -20 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-window-title.go +10 -18 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-window.go +14 -22 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-wrap-box.go +66 -46 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/adw/adw-wrap-layout.go +57 -46 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/cairo/main.go +36 -79 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkapplaunchcontext.go +10 -17 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcairo.go +12 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcairocontext.go +3 -13 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcicpparams.go +20 -25 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkclipboard.go +34 -32 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcolorstate.go +12 -16 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentdeserializer.go +26 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentformats.go +28 -31 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentprovider.go +23 -28 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcontentserializer.go +26 -27 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkcursor.go +12 -21 generated file: collapsed
M vendor/github.com/bnema/puregotk/v4/gdk/gdkdevice.go +36 -33
| @@ -5,7 +5,6 @@ import ( | |||
| 5 | 5 | "structs" | |
| 6 | 6 | "unsafe" | |
| 7 | 7 | ||
| 8 | - | "github.com/bnema/purego" | |
| 9 | 8 | "github.com/bnema/puregotk/pkg/core" | |
| 10 | 9 | "github.com/bnema/puregotk/v4/glib" | |
| 11 | 10 | "github.com/bnema/puregotk/v4/gobject" | |
| @@ -47,6 +46,7 @@ type InputSource int | |||
| 47 | 46 | var xInputSourceGLibType func() types.GType | |
| 48 | 47 | ||
| 49 | 48 | func InputSourceGLibType() types.GType { | |
| 49 | + | core.LazyRegister(&xInputSourceGLibType, "GDK", "gdk_input_source_get_type", false) | |
| 50 | 50 | return xInputSourceGLibType() | |
| 51 | 51 | } | |
| 52 | 52 | ||
| @@ -83,6 +83,7 @@ type Device struct { | |||
| 83 | 83 | var xDeviceGLibType func() types.GType | |
| 84 | 84 | ||
| 85 | 85 | func DeviceGLibType() types.GType { | |
| 86 | + | core.LazyRegister(&xDeviceGLibType, "GDK", "gdk_device_get_type", false) | |
| 86 | 87 | return xDeviceGLibType() | |
| 87 | 88 | } | |
| 88 | 89 | ||
| @@ -101,6 +102,8 @@ var xDeviceGetActiveLayoutIndex func(uintptr) int | |||
| 101 | 102 | // | |
| 102 | 103 | // This is only relevant for keyboard devices. | |
| 103 | 104 | func (x *Device) GetActiveLayoutIndex() int { | |
| 105 | + | core.LazyRegister(&xDeviceGetActiveLayoutIndex, "GDK", "gdk_device_get_active_layout_index", false) | |
| 106 | + | ||
| 104 | 107 | cret := xDeviceGetActiveLayoutIndex(x.GoPointer()) | |
| 105 | 108 | return cret | |
| 106 | 109 | } | |
| @@ -111,6 +114,8 @@ var xDeviceGetCapsLockState func(uintptr) bool | |||
| 111 | 114 | // | |
| 112 | 115 | // This is only relevant for keyboard devices. | |
| 113 | 116 | func (x *Device) GetCapsLockState() bool { | |
| 117 | + | core.LazyRegister(&xDeviceGetCapsLockState, "GDK", "gdk_device_get_caps_lock_state", false) | |
| 118 | + | ||
| 114 | 119 | cret := xDeviceGetCapsLockState(x.GoPointer()) | |
| 115 | 120 | return cret | |
| 116 | 121 | } | |
| @@ -119,6 +124,7 @@ var xDeviceGetDeviceTool func(uintptr) uintptr | |||
| 119 | 124 | ||
| 120 | 125 | // Retrieves the current tool for @device. | |
| 121 | 126 | func (x *Device) GetDeviceTool() *DeviceTool { | |
| 127 | + | core.LazyRegister(&xDeviceGetDeviceTool, "GDK", "gdk_device_get_device_tool", false) | |
| 122 | 128 | var cls *DeviceTool | |
| 123 | 129 | ||
| 124 | 130 | cret := xDeviceGetDeviceTool(x.GoPointer()) | |
| @@ -141,6 +147,8 @@ var xDeviceGetDirection func(uintptr) pango.Direction | |||
| 141 | 147 | // The direction of a layout is the direction of the majority | |
| 142 | 148 | // of its symbols. See [func@Pango.unichar_direction]. | |
| 143 | 149 | func (x *Device) GetDirection() pango.Direction { | |
| 150 | + | core.LazyRegister(&xDeviceGetDirection, "GDK", "gdk_device_get_direction", false) | |
| 151 | + | ||
| 144 | 152 | cret := xDeviceGetDirection(x.GoPointer()) | |
| 145 | 153 | return cret | |
| 146 | 154 | } | |
| @@ -149,6 +157,7 @@ var xDeviceGetDisplay func(uintptr) uintptr | |||
| 149 | 157 | ||
| 150 | 158 | // Returns the `GdkDisplay` to which @device pertains. | |
| 151 | 159 | func (x *Device) GetDisplay() *Display { | |
| 160 | + | core.LazyRegister(&xDeviceGetDisplay, "GDK", "gdk_device_get_display", false) | |
| 152 | 161 | var cls *Display | |
| 153 | 162 | ||
| 154 | 163 | cret := xDeviceGetDisplay(x.GoPointer()) | |
| @@ -169,6 +178,8 @@ var xDeviceGetHasCursor func(uintptr) bool | |||
| 169 | 178 | // This is not meaningful for keyboard devices, which | |
| 170 | 179 | // don't have a pointer. | |
| 171 | 180 | func (x *Device) GetHasCursor() bool { | |
| 181 | + | core.LazyRegister(&xDeviceGetHasCursor, "GDK", "gdk_device_get_has_cursor", false) | |
| 182 | + | ||
| 172 | 183 | cret := xDeviceGetHasCursor(x.GoPointer()) | |
| 173 | 184 | return cret | |
| 174 | 185 | } | |
| @@ -179,6 +190,8 @@ var xDeviceGetLayoutNames func(uintptr) []string | |||
| 179 | 190 | // | |
| 180 | 191 | // This is only relevant for keyboard devices. | |
| 181 | 192 | func (x *Device) GetLayoutNames() []string { | |
| 193 | + | core.LazyRegister(&xDeviceGetLayoutNames, "GDK", "gdk_device_get_layout_names", false) | |
| 194 | + | ||
| 182 | 195 | cret := xDeviceGetLayoutNames(x.GoPointer()) | |
| 183 | 196 | return cret | |
| 184 | 197 | } | |
| @@ -189,6 +202,8 @@ var xDeviceGetModifierState func(uintptr) ModifierType | |||
| 189 | 202 | // | |
| 190 | 203 | // This is only relevant for keyboard devices. | |
| 191 | 204 | func (x *Device) GetModifierState() ModifierType { | |
| 205 | + | core.LazyRegister(&xDeviceGetModifierState, "GDK", "gdk_device_get_modifier_state", false) | |
| 206 | + | ||
| 192 | 207 | cret := xDeviceGetModifierState(x.GoPointer()) | |
| 193 | 208 | return cret | |
| 194 | 209 | } | |
| @@ -197,6 +212,8 @@ var xDeviceGetName func(uintptr) string | |||
| 197 | 212 | ||
| 198 | 213 | // The name of the device, suitable for showing in a user interface. | |
| 199 | 214 | func (x *Device) GetName() string { | |
| 215 | + | core.LazyRegister(&xDeviceGetName, "GDK", "gdk_device_get_name", false) | |
| 216 | + | ||
| 200 | 217 | cret := xDeviceGetName(x.GoPointer()) | |
| 201 | 218 | return cret | |
| 202 | 219 | } | |
| @@ -207,6 +224,8 @@ var xDeviceGetNumLockState func(uintptr) bool | |||
| 207 | 224 | // | |
| 208 | 225 | // This is only relevant for keyboard devices. | |
| 209 | 226 | func (x *Device) GetNumLockState() bool { | |
| 227 | + | core.LazyRegister(&xDeviceGetNumLockState, "GDK", "gdk_device_get_num_lock_state", false) | |
| 228 | + | ||
| 210 | 229 | cret := xDeviceGetNumLockState(x.GoPointer()) | |
| 211 | 230 | return cret | |
| 212 | 231 | } | |
| @@ -215,6 +234,8 @@ var xDeviceGetNumTouches func(uintptr) uint | |||
| 215 | 234 | ||
| 216 | 235 | // Retrieves the number of touch points associated to @device. | |
| 217 | 236 | func (x *Device) GetNumTouches() uint { | |
| 237 | + | core.LazyRegister(&xDeviceGetNumTouches, "GDK", "gdk_device_get_num_touches", false) | |
| 238 | + | ||
| 218 | 239 | cret := xDeviceGetNumTouches(x.GoPointer()) | |
| 219 | 240 | return cret | |
| 220 | 241 | } | |
| @@ -226,6 +247,8 @@ var xDeviceGetProductId func(uintptr) string | |||
| 226 | 247 | // This ID is retrieved from the device, and does not change. | |
| 227 | 248 | // See [method@Gdk.Device.get_vendor_id] for more information. | |
| 228 | 249 | func (x *Device) GetProductId() string { | |
| 250 | + | core.LazyRegister(&xDeviceGetProductId, "GDK", "gdk_device_get_product_id", false) | |
| 251 | + | ||
| 229 | 252 | cret := xDeviceGetProductId(x.GoPointer()) | |
| 230 | 253 | return cret | |
| 231 | 254 | } | |
| @@ -236,6 +259,8 @@ var xDeviceGetScrollLockState func(uintptr) bool | |||
| 236 | 259 | // | |
| 237 | 260 | // This is only relevant for keyboard devices. | |
| 238 | 261 | func (x *Device) GetScrollLockState() bool { | |
| 262 | + | core.LazyRegister(&xDeviceGetScrollLockState, "GDK", "gdk_device_get_scroll_lock_state", false) | |
| 263 | + | ||
| 239 | 264 | cret := xDeviceGetScrollLockState(x.GoPointer()) | |
| 240 | 265 | return cret | |
| 241 | 266 | } | |
| @@ -244,6 +269,7 @@ var xDeviceGetSeat func(uintptr) uintptr | |||
| 244 | 269 | ||
| 245 | 270 | // Returns the `GdkSeat` the device belongs to. | |
| 246 | 271 | func (x *Device) GetSeat() *Seat { | |
| 272 | + | core.LazyRegister(&xDeviceGetSeat, "GDK", "gdk_device_get_seat", false) | |
| 247 | 273 | var cls *Seat | |
| 248 | 274 | ||
| 249 | 275 | cret := xDeviceGetSeat(x.GoPointer()) | |
| @@ -261,6 +287,8 @@ var xDeviceGetSource func(uintptr) InputSource | |||
| 261 | 287 | ||
| 262 | 288 | // Determines the type of the device. | |
| 263 | 289 | func (x *Device) GetSource() InputSource { | |
| 290 | + | core.LazyRegister(&xDeviceGetSource, "GDK", "gdk_device_get_source", false) | |
| 291 | + | ||
| 264 | 292 | cret := xDeviceGetSource(x.GoPointer()) | |
| 265 | 293 | return cret | |
| 266 | 294 | } | |
| @@ -273,6 +301,7 @@ var xDeviceGetSurfaceAtPosition func(uintptr, *float64, *float64) uintptr | |||
| 273 | 301 | // Returns %NULL if the surface tree under @device is not known to GDK | |
| 274 | 302 | // (for example, belongs to another application). | |
| 275 | 303 | func (x *Device) GetSurfaceAtPosition(WinXVar *float64, WinYVar *float64) *Surface { | |
| 304 | + | core.LazyRegister(&xDeviceGetSurfaceAtPosition, "GDK", "gdk_device_get_surface_at_position", false) | |
| 276 | 305 | var cls *Surface | |
| 277 | 306 | ||
| 278 | 307 | cret := xDeviceGetSurfaceAtPosition(x.GoPointer(), WinXVar, WinYVar) | |
| @@ -295,6 +324,8 @@ var xDeviceGetTimestamp func(uintptr) uint32 | |||
| 295 | 324 | // events for a device that are not received from the OS, and will not | |
| 296 | 325 | // update the timestamp). | |
| 297 | 326 | func (x *Device) GetTimestamp() uint32 { | |
| 327 | + | core.LazyRegister(&xDeviceGetTimestamp, "GDK", "gdk_device_get_timestamp", false) | |
| 328 | + | ||
| 298 | 329 | cret := xDeviceGetTimestamp(x.GoPointer()) | |
| 299 | 330 | return cret | |
| 300 | 331 | } | |
| @@ -331,6 +362,8 @@ var xDeviceGetVendorId func(uintptr) string | |||
| 331 | 362 | // | |
| 332 | 363 | // ``` | |
| 333 | 364 | func (x *Device) GetVendorId() string { | |
| 365 | + | core.LazyRegister(&xDeviceGetVendorId, "GDK", "gdk_device_get_vendor_id", false) | |
| 366 | + | ||
| 334 | 367 | cret := xDeviceGetVendorId(x.GoPointer()) | |
| 335 | 368 | return cret | |
| 336 | 369 | } | |
| @@ -342,6 +375,8 @@ var xDeviceHasBidiLayouts func(uintptr) bool | |||
| 342 | 375 | // | |
| 343 | 376 | // This is only relevant for keyboard devices. | |
| 344 | 377 | func (x *Device) HasBidiLayouts() bool { | |
| 378 | + | core.LazyRegister(&xDeviceHasBidiLayouts, "GDK", "gdk_device_has_bidi_layouts", false) | |
| 379 | + | ||
| 345 | 380 | cret := xDeviceHasBidiLayouts(x.GoPointer()) | |
| 346 | 381 | return cret | |
| 347 | 382 | } | |
| @@ -581,36 +616,4 @@ func (x *Device) ConnectToolChanged(cb *func(Device, uintptr)) uint { | |||
| 581 | 616 | func init() { | |
| 582 | 617 | core.SetPackageName("GDK", "gtk4") | |
| 583 | 618 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | |
| 584 | - | var libs []uintptr | |
| 585 | - | for _, libPath := range core.GetPaths("GDK") { | |
| 586 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 587 | - | if err != nil { | |
| 588 | - | panic(err) | |
| 589 | - | } | |
| 590 | - | libs = append(libs, lib) | |
| 591 | - | } | |
| 592 | - | ||
| 593 | - | core.PuregoSafeRegister(&xInputSourceGLibType, libs, "gdk_input_source_get_type") | |
| 594 | - | ||
| 595 | - | core.PuregoSafeRegister(&xDeviceGLibType, libs, "gdk_device_get_type") | |
| 596 | - | ||
| 597 | - | core.PuregoSafeRegister(&xDeviceGetActiveLayoutIndex, libs, "gdk_device_get_active_layout_index") | |
| 598 | - | core.PuregoSafeRegister(&xDeviceGetCapsLockState, libs, "gdk_device_get_caps_lock_state") | |
| 599 | - | core.PuregoSafeRegister(&xDeviceGetDeviceTool, libs, "gdk_device_get_device_tool") | |
| 600 | - | core.PuregoSafeRegister(&xDeviceGetDirection, libs, "gdk_device_get_direction") | |
| 601 | - | core.PuregoSafeRegister(&xDeviceGetDisplay, libs, "gdk_device_get_display") | |
| 602 | - | core.PuregoSafeRegister(&xDeviceGetHasCursor, libs, "gdk_device_get_has_cursor") | |
| 603 | - | core.PuregoSafeRegister(&xDeviceGetLayoutNames, libs, "gdk_device_get_layout_names") | |
| 604 | - | core.PuregoSafeRegister(&xDeviceGetModifierState, libs, "gdk_device_get_modifier_state") | |
| 605 | - | core.PuregoSafeRegister(&xDeviceGetName, libs, "gdk_device_get_name") | |
| 606 | - | core.PuregoSafeRegister(&xDeviceGetNumLockState, libs, "gdk_device_get_num_lock_state") | |
| 607 | - | core.PuregoSafeRegister(&xDeviceGetNumTouches, libs, "gdk_device_get_num_touches") | |
| 608 | - | core.PuregoSafeRegister(&xDeviceGetProductId, libs, "gdk_device_get_product_id") | |
| 609 | - | core.PuregoSafeRegister(&xDeviceGetScrollLockState, libs, "gdk_device_get_scroll_lock_state") | |
| 610 | - | core.PuregoSafeRegister(&xDeviceGetSeat, libs, "gdk_device_get_seat") | |
| 611 | - | core.PuregoSafeRegister(&xDeviceGetSource, libs, "gdk_device_get_source") | |
| 612 | - | core.PuregoSafeRegister(&xDeviceGetSurfaceAtPosition, libs, "gdk_device_get_surface_at_position") | |
| 613 | - | core.PuregoSafeRegister(&xDeviceGetTimestamp, libs, "gdk_device_get_timestamp") | |
| 614 | - | core.PuregoSafeRegister(&xDeviceGetVendorId, libs, "gdk_device_get_vendor_id") | |
| 615 | - | core.PuregoSafeRegister(&xDeviceHasBidiLayouts, libs, "gdk_device_has_bidi_layouts") | |
| 616 | 619 | } | |
| @@ -5,7 +5,6 @@ import ( | |||||
| 5 | "structs" | 5 | "structs" | ||
| 6 | "unsafe" | 6 | "unsafe" | ||
| 7 | 7 | ||||
| 8 | - | "github.com/bnema/purego" | |||
| 9 | "github.com/bnema/puregotk/pkg/core" | 8 | "github.com/bnema/puregotk/pkg/core" | ||
| 10 | "github.com/bnema/puregotk/v4/glib" | 9 | "github.com/bnema/puregotk/v4/glib" | ||
| 11 | "github.com/bnema/puregotk/v4/gobject" | 10 | "github.com/bnema/puregotk/v4/gobject" | ||
| @@ -47,6 +46,7 @@ type InputSource int | |||||
| 47 | var xInputSourceGLibType func() types.GType | 46 | var xInputSourceGLibType func() types.GType | ||
| 48 | 47 | ||||
| 49 | func InputSourceGLibType() types.GType { | 48 | func InputSourceGLibType() types.GType { | ||
| 49 | + | core.LazyRegister(&xInputSourceGLibType, "GDK", "gdk_input_source_get_type", false) | |||
| 50 | return xInputSourceGLibType() | 50 | return xInputSourceGLibType() | ||
| 51 | } | 51 | } | ||
| 52 | 52 | ||||
| @@ -83,6 +83,7 @@ type Device struct { | |||||
| 83 | var xDeviceGLibType func() types.GType | 83 | var xDeviceGLibType func() types.GType | ||
| 84 | 84 | ||||
| 85 | func DeviceGLibType() types.GType { | 85 | func DeviceGLibType() types.GType { | ||
| 86 | + | core.LazyRegister(&xDeviceGLibType, "GDK", "gdk_device_get_type", false) | |||
| 86 | return xDeviceGLibType() | 87 | return xDeviceGLibType() | ||
| 87 | } | 88 | } | ||
| 88 | 89 | ||||
| @@ -101,6 +102,8 @@ var xDeviceGetActiveLayoutIndex func(uintptr) int | |||||
| 101 | // | 102 | // | ||
| 102 | // This is only relevant for keyboard devices. | 103 | // This is only relevant for keyboard devices. | ||
| 103 | func (x *Device) GetActiveLayoutIndex() int { | 104 | func (x *Device) GetActiveLayoutIndex() int { | ||
| 105 | + | core.LazyRegister(&xDeviceGetActiveLayoutIndex, "GDK", "gdk_device_get_active_layout_index", false) | |||
| 106 | + | ||||
| 104 | cret := xDeviceGetActiveLayoutIndex(x.GoPointer()) | 107 | cret := xDeviceGetActiveLayoutIndex(x.GoPointer()) | ||
| 105 | return cret | 108 | return cret | ||
| 106 | } | 109 | } | ||
| @@ -111,6 +114,8 @@ var xDeviceGetCapsLockState func(uintptr) bool | |||||
| 111 | // | 114 | // | ||
| 112 | // This is only relevant for keyboard devices. | 115 | // This is only relevant for keyboard devices. | ||
| 113 | func (x *Device) GetCapsLockState() bool { | 116 | func (x *Device) GetCapsLockState() bool { | ||
| 117 | + | core.LazyRegister(&xDeviceGetCapsLockState, "GDK", "gdk_device_get_caps_lock_state", false) | |||
| 118 | + | ||||
| 114 | cret := xDeviceGetCapsLockState(x.GoPointer()) | 119 | cret := xDeviceGetCapsLockState(x.GoPointer()) | ||
| 115 | return cret | 120 | return cret | ||
| 116 | } | 121 | } | ||
| @@ -119,6 +124,7 @@ var xDeviceGetDeviceTool func(uintptr) uintptr | |||||
| 119 | 124 | ||||
| 120 | // Retrieves the current tool for @device. | 125 | // Retrieves the current tool for @device. | ||
| 121 | func (x *Device) GetDeviceTool() *DeviceTool { | 126 | func (x *Device) GetDeviceTool() *DeviceTool { | ||
| 127 | + | core.LazyRegister(&xDeviceGetDeviceTool, "GDK", "gdk_device_get_device_tool", false) | |||
| 122 | var cls *DeviceTool | 128 | var cls *DeviceTool | ||
| 123 | 129 | ||||
| 124 | cret := xDeviceGetDeviceTool(x.GoPointer()) | 130 | cret := xDeviceGetDeviceTool(x.GoPointer()) | ||
| @@ -141,6 +147,8 @@ var xDeviceGetDirection func(uintptr) pango.Direction | |||||
| 141 | // The direction of a layout is the direction of the majority | 147 | // The direction of a layout is the direction of the majority | ||
| 142 | // of its symbols. See [func@Pango.unichar_direction]. | 148 | // of its symbols. See [func@Pango.unichar_direction]. | ||
| 143 | func (x *Device) GetDirection() pango.Direction { | 149 | func (x *Device) GetDirection() pango.Direction { | ||
| 150 | + | core.LazyRegister(&xDeviceGetDirection, "GDK", "gdk_device_get_direction", false) | |||
| 151 | + | ||||
| 144 | cret := xDeviceGetDirection(x.GoPointer()) | 152 | cret := xDeviceGetDirection(x.GoPointer()) | ||
| 145 | return cret | 153 | return cret | ||
| 146 | } | 154 | } | ||
| @@ -149,6 +157,7 @@ var xDeviceGetDisplay func(uintptr) uintptr | |||||
| 149 | 157 | ||||
| 150 | // Returns the `GdkDisplay` to which @device pertains. | 158 | // Returns the `GdkDisplay` to which @device pertains. | ||
| 151 | func (x *Device) GetDisplay() *Display { | 159 | func (x *Device) GetDisplay() *Display { | ||
| 160 | + | core.LazyRegister(&xDeviceGetDisplay, "GDK", "gdk_device_get_display", false) | |||
| 152 | var cls *Display | 161 | var cls *Display | ||
| 153 | 162 | ||||
| 154 | cret := xDeviceGetDisplay(x.GoPointer()) | 163 | cret := xDeviceGetDisplay(x.GoPointer()) | ||
| @@ -169,6 +178,8 @@ var xDeviceGetHasCursor func(uintptr) bool | |||||
| 169 | // This is not meaningful for keyboard devices, which | 178 | // This is not meaningful for keyboard devices, which | ||
| 170 | // don't have a pointer. | 179 | // don't have a pointer. | ||
| 171 | func (x *Device) GetHasCursor() bool { | 180 | func (x *Device) GetHasCursor() bool { | ||
| 181 | + | core.LazyRegister(&xDeviceGetHasCursor, "GDK", "gdk_device_get_has_cursor", false) | |||
| 182 | + | ||||
| 172 | cret := xDeviceGetHasCursor(x.GoPointer()) | 183 | cret := xDeviceGetHasCursor(x.GoPointer()) | ||
| 173 | return cret | 184 | return cret | ||
| 174 | } | 185 | } | ||
| @@ -179,6 +190,8 @@ var xDeviceGetLayoutNames func(uintptr) []string | |||||
| 179 | // | 190 | // | ||
| 180 | // This is only relevant for keyboard devices. | 191 | // This is only relevant for keyboard devices. | ||
| 181 | func (x *Device) GetLayoutNames() []string { | 192 | func (x *Device) GetLayoutNames() []string { | ||
| 193 | + | core.LazyRegister(&xDeviceGetLayoutNames, "GDK", "gdk_device_get_layout_names", false) | |||
| 194 | + | ||||
| 182 | cret := xDeviceGetLayoutNames(x.GoPointer()) | 195 | cret := xDeviceGetLayoutNames(x.GoPointer()) | ||
| 183 | return cret | 196 | return cret | ||
| 184 | } | 197 | } | ||
| @@ -189,6 +202,8 @@ var xDeviceGetModifierState func(uintptr) ModifierType | |||||
| 189 | // | 202 | // | ||
| 190 | // This is only relevant for keyboard devices. | 203 | // This is only relevant for keyboard devices. | ||
| 191 | func (x *Device) GetModifierState() ModifierType { | 204 | func (x *Device) GetModifierState() ModifierType { | ||
| 205 | + | core.LazyRegister(&xDeviceGetModifierState, "GDK", "gdk_device_get_modifier_state", false) | |||
| 206 | + | ||||
| 192 | cret := xDeviceGetModifierState(x.GoPointer()) | 207 | cret := xDeviceGetModifierState(x.GoPointer()) | ||
| 193 | return cret | 208 | return cret | ||
| 194 | } | 209 | } | ||
| @@ -197,6 +212,8 @@ var xDeviceGetName func(uintptr) string | |||||
| 197 | 212 | ||||
| 198 | // The name of the device, suitable for showing in a user interface. | 213 | // The name of the device, suitable for showing in a user interface. | ||
| 199 | func (x *Device) GetName() string { | 214 | func (x *Device) GetName() string { | ||
| 215 | + | core.LazyRegister(&xDeviceGetName, "GDK", "gdk_device_get_name", false) | |||
| 216 | + | ||||
| 200 | cret := xDeviceGetName(x.GoPointer()) | 217 | cret := xDeviceGetName(x.GoPointer()) | ||
| 201 | return cret | 218 | return cret | ||
| 202 | } | 219 | } | ||
| @@ -207,6 +224,8 @@ var xDeviceGetNumLockState func(uintptr) bool | |||||
| 207 | // | 224 | // | ||
| 208 | // This is only relevant for keyboard devices. | 225 | // This is only relevant for keyboard devices. | ||
| 209 | func (x *Device) GetNumLockState() bool { | 226 | func (x *Device) GetNumLockState() bool { | ||
| 227 | + | core.LazyRegister(&xDeviceGetNumLockState, "GDK", "gdk_device_get_num_lock_state", false) | |||
| 228 | + | ||||
| 210 | cret := xDeviceGetNumLockState(x.GoPointer()) | 229 | cret := xDeviceGetNumLockState(x.GoPointer()) | ||
| 211 | return cret | 230 | return cret | ||
| 212 | } | 231 | } | ||
| @@ -215,6 +234,8 @@ var xDeviceGetNumTouches func(uintptr) uint | |||||
| 215 | 234 | ||||
| 216 | // Retrieves the number of touch points associated to @device. | 235 | // Retrieves the number of touch points associated to @device. | ||
| 217 | func (x *Device) GetNumTouches() uint { | 236 | func (x *Device) GetNumTouches() uint { | ||
| 237 | + | core.LazyRegister(&xDeviceGetNumTouches, "GDK", "gdk_device_get_num_touches", false) | |||
| 238 | + | ||||
| 218 | cret := xDeviceGetNumTouches(x.GoPointer()) | 239 | cret := xDeviceGetNumTouches(x.GoPointer()) | ||
| 219 | return cret | 240 | return cret | ||
| 220 | } | 241 | } | ||
| @@ -226,6 +247,8 @@ var xDeviceGetProductId func(uintptr) string | |||||
| 226 | // This ID is retrieved from the device, and does not change. | 247 | // This ID is retrieved from the device, and does not change. | ||
| 227 | // See [method@Gdk.Device.get_vendor_id] for more information. | 248 | // See [method@Gdk.Device.get_vendor_id] for more information. | ||
| 228 | func (x *Device) GetProductId() string { | 249 | func (x *Device) GetProductId() string { | ||
| 250 | + | core.LazyRegister(&xDeviceGetProductId, "GDK", "gdk_device_get_product_id", false) | |||
| 251 | + | ||||
| 229 | cret := xDeviceGetProductId(x.GoPointer()) | 252 | cret := xDeviceGetProductId(x.GoPointer()) | ||
| 230 | return cret | 253 | return cret | ||
| 231 | } | 254 | } | ||
| @@ -236,6 +259,8 @@ var xDeviceGetScrollLockState func(uintptr) bool | |||||
| 236 | // | 259 | // | ||
| 237 | // This is only relevant for keyboard devices. | 260 | // This is only relevant for keyboard devices. | ||
| 238 | func (x *Device) GetScrollLockState() bool { | 261 | func (x *Device) GetScrollLockState() bool { | ||
| 262 | + | core.LazyRegister(&xDeviceGetScrollLockState, "GDK", "gdk_device_get_scroll_lock_state", false) | |||
| 263 | + | ||||
| 239 | cret := xDeviceGetScrollLockState(x.GoPointer()) | 264 | cret := xDeviceGetScrollLockState(x.GoPointer()) | ||
| 240 | return cret | 265 | return cret | ||
| 241 | } | 266 | } | ||
| @@ -244,6 +269,7 @@ var xDeviceGetSeat func(uintptr) uintptr | |||||
| 244 | 269 | ||||
| 245 | // Returns the `GdkSeat` the device belongs to. | 270 | // Returns the `GdkSeat` the device belongs to. | ||
| 246 | func (x *Device) GetSeat() *Seat { | 271 | func (x *Device) GetSeat() *Seat { | ||
| 272 | + | core.LazyRegister(&xDeviceGetSeat, "GDK", "gdk_device_get_seat", false) | |||
| 247 | var cls *Seat | 273 | var cls *Seat | ||
| 248 | 274 | ||||
| 249 | cret := xDeviceGetSeat(x.GoPointer()) | 275 | cret := xDeviceGetSeat(x.GoPointer()) | ||
| @@ -261,6 +287,8 @@ var xDeviceGetSource func(uintptr) InputSource | |||||
| 261 | 287 | ||||
| 262 | // Determines the type of the device. | 288 | // Determines the type of the device. | ||
| 263 | func (x *Device) GetSource() InputSource { | 289 | func (x *Device) GetSource() InputSource { | ||
| 290 | + | core.LazyRegister(&xDeviceGetSource, "GDK", "gdk_device_get_source", false) | |||
| 291 | + | ||||
| 264 | cret := xDeviceGetSource(x.GoPointer()) | 292 | cret := xDeviceGetSource(x.GoPointer()) | ||
| 265 | return cret | 293 | return cret | ||
| 266 | } | 294 | } | ||
| @@ -273,6 +301,7 @@ var xDeviceGetSurfaceAtPosition func(uintptr, *float64, *float64) uintptr | |||||
| 273 | // Returns %NULL if the surface tree under @device is not known to GDK | 301 | // Returns %NULL if the surface tree under @device is not known to GDK | ||
| 274 | // (for example, belongs to another application). | 302 | // (for example, belongs to another application). | ||
| 275 | func (x *Device) GetSurfaceAtPosition(WinXVar *float64, WinYVar *float64) *Surface { | 303 | func (x *Device) GetSurfaceAtPosition(WinXVar *float64, WinYVar *float64) *Surface { | ||
| 304 | + | core.LazyRegister(&xDeviceGetSurfaceAtPosition, "GDK", "gdk_device_get_surface_at_position", false) | |||
| 276 | var cls *Surface | 305 | var cls *Surface | ||
| 277 | 306 | ||||
| 278 | cret := xDeviceGetSurfaceAtPosition(x.GoPointer(), WinXVar, WinYVar) | 307 | cret := xDeviceGetSurfaceAtPosition(x.GoPointer(), WinXVar, WinYVar) | ||
| @@ -295,6 +324,8 @@ var xDeviceGetTimestamp func(uintptr) uint32 | |||||
| 295 | // events for a device that are not received from the OS, and will not | 324 | // events for a device that are not received from the OS, and will not | ||
| 296 | // update the timestamp). | 325 | // update the timestamp). | ||
| 297 | func (x *Device) GetTimestamp() uint32 { | 326 | func (x *Device) GetTimestamp() uint32 { | ||
| 327 | + | core.LazyRegister(&xDeviceGetTimestamp, "GDK", "gdk_device_get_timestamp", false) | |||
| 328 | + | ||||
| 298 | cret := xDeviceGetTimestamp(x.GoPointer()) | 329 | cret := xDeviceGetTimestamp(x.GoPointer()) | ||
| 299 | return cret | 330 | return cret | ||
| 300 | } | 331 | } | ||
| @@ -331,6 +362,8 @@ var xDeviceGetVendorId func(uintptr) string | |||||
| 331 | // | 362 | // | ||
| 332 | // ``` | 363 | // ``` | ||
| 333 | func (x *Device) GetVendorId() string { | 364 | func (x *Device) GetVendorId() string { | ||
| 365 | + | core.LazyRegister(&xDeviceGetVendorId, "GDK", "gdk_device_get_vendor_id", false) | |||
| 366 | + | ||||
| 334 | cret := xDeviceGetVendorId(x.GoPointer()) | 367 | cret := xDeviceGetVendorId(x.GoPointer()) | ||
| 335 | return cret | 368 | return cret | ||
| 336 | } | 369 | } | ||
| @@ -342,6 +375,8 @@ var xDeviceHasBidiLayouts func(uintptr) bool | |||||
| 342 | // | 375 | // | ||
| 343 | // This is only relevant for keyboard devices. | 376 | // This is only relevant for keyboard devices. | ||
| 344 | func (x *Device) HasBidiLayouts() bool { | 377 | func (x *Device) HasBidiLayouts() bool { | ||
| 378 | + | core.LazyRegister(&xDeviceHasBidiLayouts, "GDK", "gdk_device_has_bidi_layouts", false) | |||
| 379 | + | ||||
| 345 | cret := xDeviceHasBidiLayouts(x.GoPointer()) | 380 | cret := xDeviceHasBidiLayouts(x.GoPointer()) | ||
| 346 | return cret | 381 | return cret | ||
| 347 | } | 382 | } | ||
| @@ -581,36 +616,4 @@ func (x *Device) ConnectToolChanged(cb *func(Device, uintptr)) uint { | |||||
| 581 | func init() { | 616 | func init() { | ||
| 582 | core.SetPackageName("GDK", "gtk4") | 617 | core.SetPackageName("GDK", "gtk4") | ||
| 583 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | 618 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | ||
| 584 | - | var libs []uintptr | |||
| 585 | - | for _, libPath := range core.GetPaths("GDK") { | |||
| 586 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 587 | - | if err != nil { | |||
| 588 | - | panic(err) | |||
| 589 | - | } | |||
| 590 | - | libs = append(libs, lib) | |||
| 591 | - | } | |||
| 592 | - | ||||
| 593 | - | core.PuregoSafeRegister(&xInputSourceGLibType, libs, "gdk_input_source_get_type") | |||
| 594 | - | ||||
| 595 | - | core.PuregoSafeRegister(&xDeviceGLibType, libs, "gdk_device_get_type") | |||
| 596 | - | ||||
| 597 | - | core.PuregoSafeRegister(&xDeviceGetActiveLayoutIndex, libs, "gdk_device_get_active_layout_index") | |||
| 598 | - | core.PuregoSafeRegister(&xDeviceGetCapsLockState, libs, "gdk_device_get_caps_lock_state") | |||
| 599 | - | core.PuregoSafeRegister(&xDeviceGetDeviceTool, libs, "gdk_device_get_device_tool") | |||
| 600 | - | core.PuregoSafeRegister(&xDeviceGetDirection, libs, "gdk_device_get_direction") | |||
| 601 | - | core.PuregoSafeRegister(&xDeviceGetDisplay, libs, "gdk_device_get_display") | |||
| 602 | - | core.PuregoSafeRegister(&xDeviceGetHasCursor, libs, "gdk_device_get_has_cursor") | |||
| 603 | - | core.PuregoSafeRegister(&xDeviceGetLayoutNames, libs, "gdk_device_get_layout_names") | |||
| 604 | - | core.PuregoSafeRegister(&xDeviceGetModifierState, libs, "gdk_device_get_modifier_state") | |||
| 605 | - | core.PuregoSafeRegister(&xDeviceGetName, libs, "gdk_device_get_name") | |||
| 606 | - | core.PuregoSafeRegister(&xDeviceGetNumLockState, libs, "gdk_device_get_num_lock_state") | |||
| 607 | - | core.PuregoSafeRegister(&xDeviceGetNumTouches, libs, "gdk_device_get_num_touches") | |||
| 608 | - | core.PuregoSafeRegister(&xDeviceGetProductId, libs, "gdk_device_get_product_id") | |||
| 609 | - | core.PuregoSafeRegister(&xDeviceGetScrollLockState, libs, "gdk_device_get_scroll_lock_state") | |||
| 610 | - | core.PuregoSafeRegister(&xDeviceGetSeat, libs, "gdk_device_get_seat") | |||
| 611 | - | core.PuregoSafeRegister(&xDeviceGetSource, libs, "gdk_device_get_source") | |||
| 612 | - | core.PuregoSafeRegister(&xDeviceGetSurfaceAtPosition, libs, "gdk_device_get_surface_at_position") | |||
| 613 | - | core.PuregoSafeRegister(&xDeviceGetTimestamp, libs, "gdk_device_get_timestamp") | |||
| 614 | - | core.PuregoSafeRegister(&xDeviceGetVendorId, libs, "gdk_device_get_vendor_id") | |||
| 615 | - | core.PuregoSafeRegister(&xDeviceHasBidiLayouts, libs, "gdk_device_has_bidi_layouts") | |||
| 616 | } | 619 | } | ||