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 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
| @@ -5,6 +5,7 @@ import ( | |||
| 5 | 5 | "structs" | |
| 6 | 6 | "unsafe" | |
| 7 | 7 | ||
| 8 | + | "github.com/bnema/purego" | |
| 8 | 9 | "github.com/bnema/puregotk/pkg/core" | |
| 9 | 10 | "github.com/bnema/puregotk/v4/glib" | |
| 10 | 11 | "github.com/bnema/puregotk/v4/gobject/types" | |
| @@ -18,7 +19,6 @@ type ContentFormatsBuilder struct { | |||
| 18 | 19 | var xContentFormatsBuilderGLibType func() types.GType | |
| 19 | 20 | ||
| 20 | 21 | func ContentFormatsBuilderGLibType() types.GType { | |
| 21 | - | core.LazyRegister(&xContentFormatsBuilderGLibType, "GDK", "gdk_content_formats_builder_get_type", false) | |
| 22 | 22 | return xContentFormatsBuilderGLibType() | |
| 23 | 23 | } | |
| 24 | 24 | ||
| @@ -41,8 +41,6 @@ var xNewContentFormatsBuilder func() uintptr | |||
| 41 | 41 | // The resulting builder would create an empty `GdkContentFormats`. | |
| 42 | 42 | // Use addition functions to add types to it. | |
| 43 | 43 | func NewContentFormatsBuilder() *ContentFormatsBuilder { | |
| 44 | - | core.LazyRegister(&xNewContentFormatsBuilder, "GDK", "gdk_content_formats_builder_new", false) | |
| 45 | - | ||
| 46 | 44 | cret := xNewContentFormatsBuilder() | |
| 47 | 45 | if cret == 0 { | |
| 48 | 46 | return nil | |
| @@ -55,8 +53,6 @@ var xContentFormatsBuilderAddFormats func(uintptr, *ContentFormats) | |||
| 55 | 53 | // Appends all formats from @formats to @builder, skipping those that | |
| 56 | 54 | // already exist. | |
| 57 | 55 | func (x *ContentFormatsBuilder) AddFormats(FormatsVar *ContentFormats) { | |
| 58 | - | core.LazyRegister(&xContentFormatsBuilderAddFormats, "GDK", "gdk_content_formats_builder_add_formats", false) | |
| 59 | - | ||
| 60 | 56 | xContentFormatsBuilderAddFormats(x.GoPointer(), FormatsVar) | |
| 61 | 57 | } | |
| 62 | 58 | ||
| @@ -64,8 +60,6 @@ var xContentFormatsBuilderAddGtype func(uintptr, types.GType) | |||
| 64 | 60 | ||
| 65 | 61 | // Appends @type to @builder if it has not already been added. | |
| 66 | 62 | func (x *ContentFormatsBuilder) AddGtype(TypeVar types.GType) { | |
| 67 | - | core.LazyRegister(&xContentFormatsBuilderAddGtype, "GDK", "gdk_content_formats_builder_add_gtype", false) | |
| 68 | - | ||
| 69 | 63 | xContentFormatsBuilderAddGtype(x.GoPointer(), TypeVar) | |
| 70 | 64 | } | |
| 71 | 65 | ||
| @@ -73,8 +67,6 @@ var xContentFormatsBuilderAddMimeType func(uintptr, string) | |||
| 73 | 67 | ||
| 74 | 68 | // Appends @mime_type to @builder if it has not already been added. | |
| 75 | 69 | func (x *ContentFormatsBuilder) AddMimeType(MimeTypeVar string) { | |
| 76 | - | core.LazyRegister(&xContentFormatsBuilderAddMimeType, "GDK", "gdk_content_formats_builder_add_mime_type", false) | |
| 77 | - | ||
| 78 | 70 | xContentFormatsBuilderAddMimeType(x.GoPointer(), MimeTypeVar) | |
| 79 | 71 | } | |
| 80 | 72 | ||
| @@ -83,8 +75,6 @@ var xContentFormatsBuilderFreeToFormats func(uintptr) uintptr | |||
| 83 | 75 | // Creates a new `GdkContentFormats` from the current state of the | |
| 84 | 76 | // given @builder, and frees the @builder instance. | |
| 85 | 77 | func (x *ContentFormatsBuilder) FreeToFormats() *ContentFormats { | |
| 86 | - | core.LazyRegister(&xContentFormatsBuilderFreeToFormats, "GDK", "gdk_content_formats_builder_free_to_formats", false) | |
| 87 | - | ||
| 88 | 78 | cret := xContentFormatsBuilderFreeToFormats(x.GoPointer()) | |
| 89 | 79 | if cret == 0 { | |
| 90 | 80 | return nil | |
| @@ -99,8 +89,6 @@ var xContentFormatsBuilderRef func(uintptr) uintptr | |||
| 99 | 89 | // This function is intended primarily for bindings. | |
| 100 | 90 | // `GdkContentFormatsBuilder` objects should not be kept around. | |
| 101 | 91 | func (x *ContentFormatsBuilder) Ref() *ContentFormatsBuilder { | |
| 102 | - | core.LazyRegister(&xContentFormatsBuilderRef, "GDK", "gdk_content_formats_builder_ref", false) | |
| 103 | - | ||
| 104 | 92 | cret := xContentFormatsBuilderRef(x.GoPointer()) | |
| 105 | 93 | if cret == 0 { | |
| 106 | 94 | return nil | |
| @@ -118,8 +106,6 @@ var xContentFormatsBuilderToFormats func(uintptr) uintptr | |||
| 118 | 106 | // This function is intended primarily for bindings. C code should use | |
| 119 | 107 | // [method@Gdk.ContentFormatsBuilder.free_to_formats]. | |
| 120 | 108 | func (x *ContentFormatsBuilder) ToFormats() *ContentFormats { | |
| 121 | - | core.LazyRegister(&xContentFormatsBuilderToFormats, "GDK", "gdk_content_formats_builder_to_formats", false) | |
| 122 | - | ||
| 123 | 109 | cret := xContentFormatsBuilderToFormats(x.GoPointer()) | |
| 124 | 110 | if cret == 0 { | |
| 125 | 111 | return nil | |
| @@ -131,8 +117,6 @@ var xContentFormatsBuilderUnref func(uintptr) | |||
| 131 | 117 | ||
| 132 | 118 | // Releases a reference on the given @builder. | |
| 133 | 119 | func (x *ContentFormatsBuilder) Unref() { | |
| 134 | - | core.LazyRegister(&xContentFormatsBuilderUnref, "GDK", "gdk_content_formats_builder_unref", false) | |
| 135 | - | ||
| 136 | 120 | xContentFormatsBuilderUnref(x.GoPointer()) | |
| 137 | 121 | } | |
| 138 | 122 | ||
| @@ -144,7 +128,6 @@ type FileList struct { | |||
| 144 | 128 | var xFileListGLibType func() types.GType | |
| 145 | 129 | ||
| 146 | 130 | func FileListGLibType() types.GType { | |
| 147 | - | core.LazyRegister(&xFileListGLibType, "GDK", "gdk_file_list_get_type", false) | |
| 148 | 131 | return xFileListGLibType() | |
| 149 | 132 | } | |
| 150 | 133 | ||
| @@ -166,8 +149,6 @@ var xNewFileListFromArray func(uintptr, uint) uintptr | |||
| 166 | 149 | // | |
| 167 | 150 | // This function is meant to be used by language bindings. | |
| 168 | 151 | func NewFileListFromArray(FilesVar uintptr, NFilesVar uint) *FileList { | |
| 169 | - | core.LazyRegister(&xNewFileListFromArray, "GDK", "gdk_file_list_new_from_array", false) | |
| 170 | - | ||
| 171 | 152 | cret := xNewFileListFromArray(FilesVar, NFilesVar) | |
| 172 | 153 | if cret == 0 { | |
| 173 | 154 | return nil | |
| @@ -182,8 +163,6 @@ var xNewFileListFromList func(*glib.SList) uintptr | |||
| 182 | 163 | // | |
| 183 | 164 | // This function is meant to be used by language bindings | |
| 184 | 165 | func NewFileListFromList(FilesVar *glib.SList) *FileList { | |
| 185 | - | core.LazyRegister(&xNewFileListFromList, "GDK", "gdk_file_list_new_from_list", false) | |
| 186 | - | ||
| 187 | 166 | cret := xNewFileListFromList(FilesVar) | |
| 188 | 167 | if cret == 0 { | |
| 189 | 168 | return nil | |
| @@ -197,8 +176,6 @@ var xFileListGetFiles func(uintptr) uintptr | |||
| 197 | 176 | // | |
| 198 | 177 | // This function is meant for language bindings. | |
| 199 | 178 | func (x *FileList) GetFiles() *glib.SList { | |
| 200 | - | core.LazyRegister(&xFileListGetFiles, "GDK", "gdk_file_list_get_files", false) | |
| 201 | - | ||
| 202 | 179 | cret := xFileListGetFiles(x.GoPointer()) | |
| 203 | 180 | if cret == 0 { | |
| 204 | 181 | return nil | |
| @@ -217,8 +194,6 @@ var xContentFormatsParse func(string) uintptr | |||
| 217 | 194 | // If @string does not describe valid content formats, %NULL | |
| 218 | 195 | // is returned. | |
| 219 | 196 | func ContentFormatsParse(StringVar string) *ContentFormats { | |
| 220 | - | core.LazyRegister(&xContentFormatsParse, "GDK", "gdk_content_formats_parse", false) | |
| 221 | - | ||
| 222 | 197 | cret := xContentFormatsParse(StringVar) | |
| 223 | 198 | if cret == 0 { | |
| 224 | 199 | return nil | |
| @@ -233,8 +208,6 @@ var xInternMimeType func(string) string | |||
| 233 | 208 | // If @string is not a valid mime type, %NULL is returned instead. | |
| 234 | 209 | // See RFC 2048 for the syntax if mime types. | |
| 235 | 210 | func InternMimeType(StringVar string) string { | |
| 236 | - | core.LazyRegister(&xInternMimeType, "GDK", "gdk_intern_mime_type", false) | |
| 237 | - | ||
| 238 | 211 | cret := xInternMimeType(StringVar) | |
| 239 | 212 | return cret | |
| 240 | 213 | } | |
| @@ -242,4 +215,34 @@ func InternMimeType(StringVar string) string { | |||
| 242 | 215 | func init() { | |
| 243 | 216 | core.SetPackageName("GDK", "gtk4") | |
| 244 | 217 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | |
| 218 | + | var libs []uintptr | |
| 219 | + | for _, libPath := range core.GetPaths("GDK") { | |
| 220 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 221 | + | if err != nil { | |
| 222 | + | panic(err) | |
| 223 | + | } | |
| 224 | + | libs = append(libs, lib) | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | core.PuregoSafeRegister(&xContentFormatsParse, libs, "gdk_content_formats_parse") | |
| 228 | + | core.PuregoSafeRegister(&xInternMimeType, libs, "gdk_intern_mime_type") | |
| 229 | + | ||
| 230 | + | core.PuregoSafeRegister(&xContentFormatsBuilderGLibType, libs, "gdk_content_formats_builder_get_type") | |
| 231 | + | ||
| 232 | + | core.PuregoSafeRegister(&xNewContentFormatsBuilder, libs, "gdk_content_formats_builder_new") | |
| 233 | + | ||
| 234 | + | core.PuregoSafeRegister(&xContentFormatsBuilderAddFormats, libs, "gdk_content_formats_builder_add_formats") | |
| 235 | + | core.PuregoSafeRegister(&xContentFormatsBuilderAddGtype, libs, "gdk_content_formats_builder_add_gtype") | |
| 236 | + | core.PuregoSafeRegister(&xContentFormatsBuilderAddMimeType, libs, "gdk_content_formats_builder_add_mime_type") | |
| 237 | + | core.PuregoSafeRegister(&xContentFormatsBuilderFreeToFormats, libs, "gdk_content_formats_builder_free_to_formats") | |
| 238 | + | core.PuregoSafeRegister(&xContentFormatsBuilderRef, libs, "gdk_content_formats_builder_ref") | |
| 239 | + | core.PuregoSafeRegister(&xContentFormatsBuilderToFormats, libs, "gdk_content_formats_builder_to_formats") | |
| 240 | + | core.PuregoSafeRegister(&xContentFormatsBuilderUnref, libs, "gdk_content_formats_builder_unref") | |
| 241 | + | ||
| 242 | + | core.PuregoSafeRegister(&xFileListGLibType, libs, "gdk_file_list_get_type") | |
| 243 | + | ||
| 244 | + | core.PuregoSafeRegister(&xNewFileListFromArray, libs, "gdk_file_list_new_from_array") | |
| 245 | + | core.PuregoSafeRegister(&xNewFileListFromList, libs, "gdk_file_list_new_from_list") | |
| 246 | + | ||
| 247 | + | core.PuregoSafeRegister(&xFileListGetFiles, libs, "gdk_file_list_get_files") | |
| 245 | 248 | } | |
| @@ -5,6 +5,7 @@ import ( | |||||
| 5 | "structs" | 5 | "structs" | ||
| 6 | "unsafe" | 6 | "unsafe" | ||
| 7 | 7 | ||||
| 8 | + | "github.com/bnema/purego" | |||
| 8 | "github.com/bnema/puregotk/pkg/core" | 9 | "github.com/bnema/puregotk/pkg/core" | ||
| 9 | "github.com/bnema/puregotk/v4/glib" | 10 | "github.com/bnema/puregotk/v4/glib" | ||
| 10 | "github.com/bnema/puregotk/v4/gobject/types" | 11 | "github.com/bnema/puregotk/v4/gobject/types" | ||
| @@ -18,7 +19,6 @@ type ContentFormatsBuilder struct { | |||||
| 18 | var xContentFormatsBuilderGLibType func() types.GType | 19 | var xContentFormatsBuilderGLibType func() types.GType | ||
| 19 | 20 | ||||
| 20 | func ContentFormatsBuilderGLibType() types.GType { | 21 | func ContentFormatsBuilderGLibType() types.GType { | ||
| 21 | - | core.LazyRegister(&xContentFormatsBuilderGLibType, "GDK", "gdk_content_formats_builder_get_type", false) | |||
| 22 | return xContentFormatsBuilderGLibType() | 22 | return xContentFormatsBuilderGLibType() | ||
| 23 | } | 23 | } | ||
| 24 | 24 | ||||
| @@ -41,8 +41,6 @@ var xNewContentFormatsBuilder func() uintptr | |||||
| 41 | // The resulting builder would create an empty `GdkContentFormats`. | 41 | // The resulting builder would create an empty `GdkContentFormats`. | ||
| 42 | // Use addition functions to add types to it. | 42 | // Use addition functions to add types to it. | ||
| 43 | func NewContentFormatsBuilder() *ContentFormatsBuilder { | 43 | func NewContentFormatsBuilder() *ContentFormatsBuilder { | ||
| 44 | - | core.LazyRegister(&xNewContentFormatsBuilder, "GDK", "gdk_content_formats_builder_new", false) | |||
| 45 | - | ||||
| 46 | cret := xNewContentFormatsBuilder() | 44 | cret := xNewContentFormatsBuilder() | ||
| 47 | if cret == 0 { | 45 | if cret == 0 { | ||
| 48 | return nil | 46 | return nil | ||
| @@ -55,8 +53,6 @@ var xContentFormatsBuilderAddFormats func(uintptr, *ContentFormats) | |||||
| 55 | // Appends all formats from @formats to @builder, skipping those that | 53 | // Appends all formats from @formats to @builder, skipping those that | ||
| 56 | // already exist. | 54 | // already exist. | ||
| 57 | func (x *ContentFormatsBuilder) AddFormats(FormatsVar *ContentFormats) { | 55 | func (x *ContentFormatsBuilder) AddFormats(FormatsVar *ContentFormats) { | ||
| 58 | - | core.LazyRegister(&xContentFormatsBuilderAddFormats, "GDK", "gdk_content_formats_builder_add_formats", false) | |||
| 59 | - | ||||
| 60 | xContentFormatsBuilderAddFormats(x.GoPointer(), FormatsVar) | 56 | xContentFormatsBuilderAddFormats(x.GoPointer(), FormatsVar) | ||
| 61 | } | 57 | } | ||
| 62 | 58 | ||||
| @@ -64,8 +60,6 @@ var xContentFormatsBuilderAddGtype func(uintptr, types.GType) | |||||
| 64 | 60 | ||||
| 65 | // Appends @type to @builder if it has not already been added. | 61 | // Appends @type to @builder if it has not already been added. | ||
| 66 | func (x *ContentFormatsBuilder) AddGtype(TypeVar types.GType) { | 62 | func (x *ContentFormatsBuilder) AddGtype(TypeVar types.GType) { | ||
| 67 | - | core.LazyRegister(&xContentFormatsBuilderAddGtype, "GDK", "gdk_content_formats_builder_add_gtype", false) | |||
| 68 | - | ||||
| 69 | xContentFormatsBuilderAddGtype(x.GoPointer(), TypeVar) | 63 | xContentFormatsBuilderAddGtype(x.GoPointer(), TypeVar) | ||
| 70 | } | 64 | } | ||
| 71 | 65 | ||||
| @@ -73,8 +67,6 @@ var xContentFormatsBuilderAddMimeType func(uintptr, string) | |||||
| 73 | 67 | ||||
| 74 | // Appends @mime_type to @builder if it has not already been added. | 68 | // Appends @mime_type to @builder if it has not already been added. | ||
| 75 | func (x *ContentFormatsBuilder) AddMimeType(MimeTypeVar string) { | 69 | func (x *ContentFormatsBuilder) AddMimeType(MimeTypeVar string) { | ||
| 76 | - | core.LazyRegister(&xContentFormatsBuilderAddMimeType, "GDK", "gdk_content_formats_builder_add_mime_type", false) | |||
| 77 | - | ||||
| 78 | xContentFormatsBuilderAddMimeType(x.GoPointer(), MimeTypeVar) | 70 | xContentFormatsBuilderAddMimeType(x.GoPointer(), MimeTypeVar) | ||
| 79 | } | 71 | } | ||
| 80 | 72 | ||||
| @@ -83,8 +75,6 @@ var xContentFormatsBuilderFreeToFormats func(uintptr) uintptr | |||||
| 83 | // Creates a new `GdkContentFormats` from the current state of the | 75 | // Creates a new `GdkContentFormats` from the current state of the | ||
| 84 | // given @builder, and frees the @builder instance. | 76 | // given @builder, and frees the @builder instance. | ||
| 85 | func (x *ContentFormatsBuilder) FreeToFormats() *ContentFormats { | 77 | func (x *ContentFormatsBuilder) FreeToFormats() *ContentFormats { | ||
| 86 | - | core.LazyRegister(&xContentFormatsBuilderFreeToFormats, "GDK", "gdk_content_formats_builder_free_to_formats", false) | |||
| 87 | - | ||||
| 88 | cret := xContentFormatsBuilderFreeToFormats(x.GoPointer()) | 78 | cret := xContentFormatsBuilderFreeToFormats(x.GoPointer()) | ||
| 89 | if cret == 0 { | 79 | if cret == 0 { | ||
| 90 | return nil | 80 | return nil | ||
| @@ -99,8 +89,6 @@ var xContentFormatsBuilderRef func(uintptr) uintptr | |||||
| 99 | // This function is intended primarily for bindings. | 89 | // This function is intended primarily for bindings. | ||
| 100 | // `GdkContentFormatsBuilder` objects should not be kept around. | 90 | // `GdkContentFormatsBuilder` objects should not be kept around. | ||
| 101 | func (x *ContentFormatsBuilder) Ref() *ContentFormatsBuilder { | 91 | func (x *ContentFormatsBuilder) Ref() *ContentFormatsBuilder { | ||
| 102 | - | core.LazyRegister(&xContentFormatsBuilderRef, "GDK", "gdk_content_formats_builder_ref", false) | |||
| 103 | - | ||||
| 104 | cret := xContentFormatsBuilderRef(x.GoPointer()) | 92 | cret := xContentFormatsBuilderRef(x.GoPointer()) | ||
| 105 | if cret == 0 { | 93 | if cret == 0 { | ||
| 106 | return nil | 94 | return nil | ||
| @@ -118,8 +106,6 @@ var xContentFormatsBuilderToFormats func(uintptr) uintptr | |||||
| 118 | // This function is intended primarily for bindings. C code should use | 106 | // This function is intended primarily for bindings. C code should use | ||
| 119 | // [method@Gdk.ContentFormatsBuilder.free_to_formats]. | 107 | // [method@Gdk.ContentFormatsBuilder.free_to_formats]. | ||
| 120 | func (x *ContentFormatsBuilder) ToFormats() *ContentFormats { | 108 | func (x *ContentFormatsBuilder) ToFormats() *ContentFormats { | ||
| 121 | - | core.LazyRegister(&xContentFormatsBuilderToFormats, "GDK", "gdk_content_formats_builder_to_formats", false) | |||
| 122 | - | ||||
| 123 | cret := xContentFormatsBuilderToFormats(x.GoPointer()) | 109 | cret := xContentFormatsBuilderToFormats(x.GoPointer()) | ||
| 124 | if cret == 0 { | 110 | if cret == 0 { | ||
| 125 | return nil | 111 | return nil | ||
| @@ -131,8 +117,6 @@ var xContentFormatsBuilderUnref func(uintptr) | |||||
| 131 | 117 | ||||
| 132 | // Releases a reference on the given @builder. | 118 | // Releases a reference on the given @builder. | ||
| 133 | func (x *ContentFormatsBuilder) Unref() { | 119 | func (x *ContentFormatsBuilder) Unref() { | ||
| 134 | - | core.LazyRegister(&xContentFormatsBuilderUnref, "GDK", "gdk_content_formats_builder_unref", false) | |||
| 135 | - | ||||
| 136 | xContentFormatsBuilderUnref(x.GoPointer()) | 120 | xContentFormatsBuilderUnref(x.GoPointer()) | ||
| 137 | } | 121 | } | ||
| 138 | 122 | ||||
| @@ -144,7 +128,6 @@ type FileList struct { | |||||
| 144 | var xFileListGLibType func() types.GType | 128 | var xFileListGLibType func() types.GType | ||
| 145 | 129 | ||||
| 146 | func FileListGLibType() types.GType { | 130 | func FileListGLibType() types.GType { | ||
| 147 | - | core.LazyRegister(&xFileListGLibType, "GDK", "gdk_file_list_get_type", false) | |||
| 148 | return xFileListGLibType() | 131 | return xFileListGLibType() | ||
| 149 | } | 132 | } | ||
| 150 | 133 | ||||
| @@ -166,8 +149,6 @@ var xNewFileListFromArray func(uintptr, uint) uintptr | |||||
| 166 | // | 149 | // | ||
| 167 | // This function is meant to be used by language bindings. | 150 | // This function is meant to be used by language bindings. | ||
| 168 | func NewFileListFromArray(FilesVar uintptr, NFilesVar uint) *FileList { | 151 | func NewFileListFromArray(FilesVar uintptr, NFilesVar uint) *FileList { | ||
| 169 | - | core.LazyRegister(&xNewFileListFromArray, "GDK", "gdk_file_list_new_from_array", false) | |||
| 170 | - | ||||
| 171 | cret := xNewFileListFromArray(FilesVar, NFilesVar) | 152 | cret := xNewFileListFromArray(FilesVar, NFilesVar) | ||
| 172 | if cret == 0 { | 153 | if cret == 0 { | ||
| 173 | return nil | 154 | return nil | ||
| @@ -182,8 +163,6 @@ var xNewFileListFromList func(*glib.SList) uintptr | |||||
| 182 | // | 163 | // | ||
| 183 | // This function is meant to be used by language bindings | 164 | // This function is meant to be used by language bindings | ||
| 184 | func NewFileListFromList(FilesVar *glib.SList) *FileList { | 165 | func NewFileListFromList(FilesVar *glib.SList) *FileList { | ||
| 185 | - | core.LazyRegister(&xNewFileListFromList, "GDK", "gdk_file_list_new_from_list", false) | |||
| 186 | - | ||||
| 187 | cret := xNewFileListFromList(FilesVar) | 166 | cret := xNewFileListFromList(FilesVar) | ||
| 188 | if cret == 0 { | 167 | if cret == 0 { | ||
| 189 | return nil | 168 | return nil | ||
| @@ -197,8 +176,6 @@ var xFileListGetFiles func(uintptr) uintptr | |||||
| 197 | // | 176 | // | ||
| 198 | // This function is meant for language bindings. | 177 | // This function is meant for language bindings. | ||
| 199 | func (x *FileList) GetFiles() *glib.SList { | 178 | func (x *FileList) GetFiles() *glib.SList { | ||
| 200 | - | core.LazyRegister(&xFileListGetFiles, "GDK", "gdk_file_list_get_files", false) | |||
| 201 | - | ||||
| 202 | cret := xFileListGetFiles(x.GoPointer()) | 179 | cret := xFileListGetFiles(x.GoPointer()) | ||
| 203 | if cret == 0 { | 180 | if cret == 0 { | ||
| 204 | return nil | 181 | return nil | ||
| @@ -217,8 +194,6 @@ var xContentFormatsParse func(string) uintptr | |||||
| 217 | // If @string does not describe valid content formats, %NULL | 194 | // If @string does not describe valid content formats, %NULL | ||
| 218 | // is returned. | 195 | // is returned. | ||
| 219 | func ContentFormatsParse(StringVar string) *ContentFormats { | 196 | func ContentFormatsParse(StringVar string) *ContentFormats { | ||
| 220 | - | core.LazyRegister(&xContentFormatsParse, "GDK", "gdk_content_formats_parse", false) | |||
| 221 | - | ||||
| 222 | cret := xContentFormatsParse(StringVar) | 197 | cret := xContentFormatsParse(StringVar) | ||
| 223 | if cret == 0 { | 198 | if cret == 0 { | ||
| 224 | return nil | 199 | return nil | ||
| @@ -233,8 +208,6 @@ var xInternMimeType func(string) string | |||||
| 233 | // If @string is not a valid mime type, %NULL is returned instead. | 208 | // If @string is not a valid mime type, %NULL is returned instead. | ||
| 234 | // See RFC 2048 for the syntax if mime types. | 209 | // See RFC 2048 for the syntax if mime types. | ||
| 235 | func InternMimeType(StringVar string) string { | 210 | func InternMimeType(StringVar string) string { | ||
| 236 | - | core.LazyRegister(&xInternMimeType, "GDK", "gdk_intern_mime_type", false) | |||
| 237 | - | ||||
| 238 | cret := xInternMimeType(StringVar) | 211 | cret := xInternMimeType(StringVar) | ||
| 239 | return cret | 212 | return cret | ||
| 240 | } | 213 | } | ||
| @@ -242,4 +215,34 @@ func InternMimeType(StringVar string) string { | |||||
| 242 | func init() { | 215 | func init() { | ||
| 243 | core.SetPackageName("GDK", "gtk4") | 216 | core.SetPackageName("GDK", "gtk4") | ||
| 244 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | 217 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | ||
| 218 | + | var libs []uintptr | |||
| 219 | + | for _, libPath := range core.GetPaths("GDK") { | |||
| 220 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 221 | + | if err != nil { | |||
| 222 | + | panic(err) | |||
| 223 | + | } | |||
| 224 | + | libs = append(libs, lib) | |||
| 225 | + | } | |||
| 226 | + | ||||
| 227 | + | core.PuregoSafeRegister(&xContentFormatsParse, libs, "gdk_content_formats_parse") | |||
| 228 | + | core.PuregoSafeRegister(&xInternMimeType, libs, "gdk_intern_mime_type") | |||
| 229 | + | ||||
| 230 | + | core.PuregoSafeRegister(&xContentFormatsBuilderGLibType, libs, "gdk_content_formats_builder_get_type") | |||
| 231 | + | ||||
| 232 | + | core.PuregoSafeRegister(&xNewContentFormatsBuilder, libs, "gdk_content_formats_builder_new") | |||
| 233 | + | ||||
| 234 | + | core.PuregoSafeRegister(&xContentFormatsBuilderAddFormats, libs, "gdk_content_formats_builder_add_formats") | |||
| 235 | + | core.PuregoSafeRegister(&xContentFormatsBuilderAddGtype, libs, "gdk_content_formats_builder_add_gtype") | |||
| 236 | + | core.PuregoSafeRegister(&xContentFormatsBuilderAddMimeType, libs, "gdk_content_formats_builder_add_mime_type") | |||
| 237 | + | core.PuregoSafeRegister(&xContentFormatsBuilderFreeToFormats, libs, "gdk_content_formats_builder_free_to_formats") | |||
| 238 | + | core.PuregoSafeRegister(&xContentFormatsBuilderRef, libs, "gdk_content_formats_builder_ref") | |||
| 239 | + | core.PuregoSafeRegister(&xContentFormatsBuilderToFormats, libs, "gdk_content_formats_builder_to_formats") | |||
| 240 | + | core.PuregoSafeRegister(&xContentFormatsBuilderUnref, libs, "gdk_content_formats_builder_unref") | |||
| 241 | + | ||||
| 242 | + | core.PuregoSafeRegister(&xFileListGLibType, libs, "gdk_file_list_get_type") | |||
| 243 | + | ||||
| 244 | + | core.PuregoSafeRegister(&xNewFileListFromArray, libs, "gdk_file_list_new_from_array") | |||
| 245 | + | core.PuregoSafeRegister(&xNewFileListFromList, libs, "gdk_file_list_new_from_list") | |||
| 246 | + | ||||
| 247 | + | core.PuregoSafeRegister(&xFileListGetFiles, libs, "gdk_file_list_get_files") | |||
| 245 | } | 248 | } | ||