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
| @@ -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/gio" | |
| 11 | 10 | "github.com/bnema/puregotk/v4/glib" | |
| @@ -114,6 +113,7 @@ type SidebarSection struct { | |||
| 114 | 113 | var xSidebarSectionGLibType func() types.GType | |
| 115 | 114 | ||
| 116 | 115 | func SidebarSectionGLibType() types.GType { | |
| 116 | + | core.LazyRegister(&xSidebarSectionGLibType, "ADW", "adw_sidebar_section_get_type", false) | |
| 117 | 117 | return xSidebarSectionGLibType() | |
| 118 | 118 | } | |
| 119 | 119 | ||
| @@ -127,6 +127,7 @@ var xNewSidebarSection func() uintptr | |||
| 127 | 127 | ||
| 128 | 128 | // Creates a new `AdwSidebarSection`. | |
| 129 | 129 | func NewSidebarSection() *SidebarSection { | |
| 130 | + | core.LazyRegister(&xNewSidebarSection, "ADW", "adw_sidebar_section_new", false) | |
| 130 | 131 | var cls *SidebarSection | |
| 131 | 132 | ||
| 132 | 133 | cret := xNewSidebarSection() | |
| @@ -145,6 +146,8 @@ var xSidebarSectionAppend func(uintptr, uintptr) | |||
| 145 | 146 | // | |
| 146 | 147 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | |
| 147 | 148 | func (x *SidebarSection) Append(ItemVar *SidebarItem) { | |
| 149 | + | core.LazyRegister(&xSidebarSectionAppend, "ADW", "adw_sidebar_section_append", false) | |
| 150 | + | ||
| 148 | 151 | xSidebarSectionAppend(x.GoPointer(), ItemVar.GoPointer()) | |
| 149 | 152 | } | |
| 150 | 153 | ||
| @@ -167,6 +170,8 @@ var xSidebarSectionBindModel func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||
| 167 | 170 | // Accessing items and modifying them is allowed, but the changes will be erased | |
| 168 | 171 | // whenever that part of the model changes, so it's not recommended. | |
| 169 | 172 | func (x *SidebarSection) BindModel(ModelVar gio.ListModel, CreateItemFuncVar *SidebarSectionCreateItemFunc, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) { | |
| 173 | + | core.LazyRegister(&xSidebarSectionBindModel, "ADW", "adw_sidebar_section_bind_model", false) | |
| 174 | + | ||
| 170 | 175 | xSidebarSectionBindModel(x.GoPointer(), ModelVar.GoPointer(), glib.NewCallbackNullable(CreateItemFuncVar), UserDataVar, glib.NewCallback(UserDataFreeFuncVar)) | |
| 171 | 176 | } | |
| 172 | 177 | ||
| @@ -179,6 +184,7 @@ var xSidebarSectionGetItem func(uintptr, uint) uintptr | |||
| 179 | 184 | // | |
| 180 | 185 | // Can return `NULL` if @index is larger or equal to the number of items. | |
| 181 | 186 | func (x *SidebarSection) GetItem(IndexVar uint) *SidebarItem { | |
| 187 | + | core.LazyRegister(&xSidebarSectionGetItem, "ADW", "adw_sidebar_section_get_item", false) | |
| 182 | 188 | var cls *SidebarItem | |
| 183 | 189 | ||
| 184 | 190 | cret := xSidebarSectionGetItem(x.GoPointer(), IndexVar) | |
| @@ -198,6 +204,7 @@ var xSidebarSectionGetItems func(uintptr) uintptr | |||
| 198 | 204 | // | |
| 199 | 205 | // This can be used to keep an up-to-date view. | |
| 200 | 206 | func (x *SidebarSection) GetItems() *gio.ListModelBase { | |
| 207 | + | core.LazyRegister(&xSidebarSectionGetItems, "ADW", "adw_sidebar_section_get_items", false) | |
| 201 | 208 | var cls *gio.ListModelBase | |
| 202 | 209 | ||
| 203 | 210 | cret := xSidebarSectionGetItems(x.GoPointer()) | |
| @@ -214,6 +221,7 @@ var xSidebarSectionGetMenuModel func(uintptr) uintptr | |||
| 214 | 221 | ||
| 215 | 222 | // Gets the context menu model for @self's items. | |
| 216 | 223 | func (x *SidebarSection) GetMenuModel() *gio.MenuModel { | |
| 224 | + | core.LazyRegister(&xSidebarSectionGetMenuModel, "ADW", "adw_sidebar_section_get_menu_model", false) | |
| 217 | 225 | var cls *gio.MenuModel | |
| 218 | 226 | ||
| 219 | 227 | cret := xSidebarSectionGetMenuModel(x.GoPointer()) | |
| @@ -231,6 +239,7 @@ var xSidebarSectionGetSidebar func(uintptr) uintptr | |||
| 231 | 239 | ||
| 232 | 240 | // Gets the sidebar @self is in. | |
| 233 | 241 | func (x *SidebarSection) GetSidebar() *Sidebar { | |
| 242 | + | core.LazyRegister(&xSidebarSectionGetSidebar, "ADW", "adw_sidebar_section_get_sidebar", false) | |
| 234 | 243 | var cls *Sidebar | |
| 235 | 244 | ||
| 236 | 245 | cret := xSidebarSectionGetSidebar(x.GoPointer()) | |
| @@ -248,6 +257,8 @@ var xSidebarSectionGetTitle func(uintptr) string | |||
| 248 | 257 | ||
| 249 | 258 | // Gets the title of @self. | |
| 250 | 259 | func (x *SidebarSection) GetTitle() string { | |
| 260 | + | core.LazyRegister(&xSidebarSectionGetTitle, "ADW", "adw_sidebar_section_get_title", false) | |
| 261 | + | ||
| 251 | 262 | cret := xSidebarSectionGetTitle(x.GoPointer()) | |
| 252 | 263 | return cret | |
| 253 | 264 | } | |
| @@ -261,6 +272,8 @@ var xSidebarSectionInsert func(uintptr, uintptr, int) | |||
| 261 | 272 | // | |
| 262 | 273 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | |
| 263 | 274 | func (x *SidebarSection) Insert(ItemVar *SidebarItem, PositionVar int) { | |
| 275 | + | core.LazyRegister(&xSidebarSectionInsert, "ADW", "adw_sidebar_section_insert", false) | |
| 276 | + | ||
| 264 | 277 | xSidebarSectionInsert(x.GoPointer(), ItemVar.GoPointer(), PositionVar) | |
| 265 | 278 | } | |
| 266 | 279 | ||
| @@ -270,6 +283,8 @@ var xSidebarSectionPrepend func(uintptr, uintptr) | |||
| 270 | 283 | // | |
| 271 | 284 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | |
| 272 | 285 | func (x *SidebarSection) Prepend(ItemVar *SidebarItem) { | |
| 286 | + | core.LazyRegister(&xSidebarSectionPrepend, "ADW", "adw_sidebar_section_prepend", false) | |
| 287 | + | ||
| 273 | 288 | xSidebarSectionPrepend(x.GoPointer(), ItemVar.GoPointer()) | |
| 274 | 289 | } | |
| 275 | 290 | ||
| @@ -279,6 +294,8 @@ var xSidebarSectionRemove func(uintptr, uintptr) | |||
| 279 | 294 | // | |
| 280 | 295 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | |
| 281 | 296 | func (x *SidebarSection) Remove(ItemVar *SidebarItem) { | |
| 297 | + | core.LazyRegister(&xSidebarSectionRemove, "ADW", "adw_sidebar_section_remove", false) | |
| 298 | + | ||
| 282 | 299 | xSidebarSectionRemove(x.GoPointer(), ItemVar.GoPointer()) | |
| 283 | 300 | } | |
| 284 | 301 | ||
| @@ -288,6 +305,8 @@ var xSidebarSectionRemoveAll func(uintptr) | |||
| 288 | 305 | // | |
| 289 | 306 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | |
| 290 | 307 | func (x *SidebarSection) RemoveAll() { | |
| 308 | + | core.LazyRegister(&xSidebarSectionRemoveAll, "ADW", "adw_sidebar_section_remove_all", false) | |
| 309 | + | ||
| 291 | 310 | xSidebarSectionRemoveAll(x.GoPointer()) | |
| 292 | 311 | } | |
| 293 | 312 | ||
| @@ -301,6 +320,8 @@ var xSidebarSectionSetMenuModel func(uintptr, uintptr) | |||
| 301 | 320 | // | |
| 302 | 321 | // If not set, [property@Sidebar:menu-model] will be used instead. | |
| 303 | 322 | func (x *SidebarSection) SetMenuModel(MenuModelVar *gio.MenuModel) { | |
| 323 | + | core.LazyRegister(&xSidebarSectionSetMenuModel, "ADW", "adw_sidebar_section_set_menu_model", false) | |
| 324 | + | ||
| 304 | 325 | xSidebarSectionSetMenuModel(x.GoPointer(), MenuModelVar.GoPointer()) | |
| 305 | 326 | } | |
| 306 | 327 | ||
| @@ -310,6 +331,8 @@ var xSidebarSectionSetTitle func(uintptr, uintptr) | |||
| 310 | 331 | // | |
| 311 | 332 | // If set, it will be displayed instead of the separator before the section. | |
| 312 | 333 | func (x *SidebarSection) SetTitle(TitleVar *string) { | |
| 334 | + | core.LazyRegister(&xSidebarSectionSetTitle, "ADW", "adw_sidebar_section_set_title", false) | |
| 335 | + | ||
| 313 | 336 | TitleVarPtr := core.GStrdupNullable(TitleVar) | |
| 314 | 337 | defer core.GFreeNullable(TitleVarPtr) | |
| 315 | 338 | ||
| @@ -360,30 +383,4 @@ func (x *SidebarSection) GetBuildableId() string { | |||
| 360 | 383 | func init() { | |
| 361 | 384 | core.SetPackageName("ADW", "libadwaita-1") | |
| 362 | 385 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | |
| 363 | - | var libs []uintptr | |
| 364 | - | for _, libPath := range core.GetPaths("ADW") { | |
| 365 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 366 | - | if err != nil { | |
| 367 | - | panic(err) | |
| 368 | - | } | |
| 369 | - | libs = append(libs, lib) | |
| 370 | - | } | |
| 371 | - | ||
| 372 | - | core.PuregoSafeRegister(&xSidebarSectionGLibType, libs, "adw_sidebar_section_get_type") | |
| 373 | - | ||
| 374 | - | core.PuregoSafeRegister(&xNewSidebarSection, libs, "adw_sidebar_section_new") | |
| 375 | - | ||
| 376 | - | core.PuregoSafeRegister(&xSidebarSectionAppend, libs, "adw_sidebar_section_append") | |
| 377 | - | core.PuregoSafeRegister(&xSidebarSectionBindModel, libs, "adw_sidebar_section_bind_model") | |
| 378 | - | core.PuregoSafeRegister(&xSidebarSectionGetItem, libs, "adw_sidebar_section_get_item") | |
| 379 | - | core.PuregoSafeRegister(&xSidebarSectionGetItems, libs, "adw_sidebar_section_get_items") | |
| 380 | - | core.PuregoSafeRegister(&xSidebarSectionGetMenuModel, libs, "adw_sidebar_section_get_menu_model") | |
| 381 | - | core.PuregoSafeRegister(&xSidebarSectionGetSidebar, libs, "adw_sidebar_section_get_sidebar") | |
| 382 | - | core.PuregoSafeRegister(&xSidebarSectionGetTitle, libs, "adw_sidebar_section_get_title") | |
| 383 | - | core.PuregoSafeRegister(&xSidebarSectionInsert, libs, "adw_sidebar_section_insert") | |
| 384 | - | core.PuregoSafeRegister(&xSidebarSectionPrepend, libs, "adw_sidebar_section_prepend") | |
| 385 | - | core.PuregoSafeRegister(&xSidebarSectionRemove, libs, "adw_sidebar_section_remove") | |
| 386 | - | core.PuregoSafeRegister(&xSidebarSectionRemoveAll, libs, "adw_sidebar_section_remove_all") | |
| 387 | - | core.PuregoSafeRegister(&xSidebarSectionSetMenuModel, libs, "adw_sidebar_section_set_menu_model") | |
| 388 | - | core.PuregoSafeRegister(&xSidebarSectionSetTitle, libs, "adw_sidebar_section_set_title") | |
| 389 | 386 | } | |
| @@ -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/gio" | 9 | "github.com/bnema/puregotk/v4/gio" | ||
| 11 | "github.com/bnema/puregotk/v4/glib" | 10 | "github.com/bnema/puregotk/v4/glib" | ||
| @@ -114,6 +113,7 @@ type SidebarSection struct { | |||||
| 114 | var xSidebarSectionGLibType func() types.GType | 113 | var xSidebarSectionGLibType func() types.GType | ||
| 115 | 114 | ||||
| 116 | func SidebarSectionGLibType() types.GType { | 115 | func SidebarSectionGLibType() types.GType { | ||
| 116 | + | core.LazyRegister(&xSidebarSectionGLibType, "ADW", "adw_sidebar_section_get_type", false) | |||
| 117 | return xSidebarSectionGLibType() | 117 | return xSidebarSectionGLibType() | ||
| 118 | } | 118 | } | ||
| 119 | 119 | ||||
| @@ -127,6 +127,7 @@ var xNewSidebarSection func() uintptr | |||||
| 127 | 127 | ||||
| 128 | // Creates a new `AdwSidebarSection`. | 128 | // Creates a new `AdwSidebarSection`. | ||
| 129 | func NewSidebarSection() *SidebarSection { | 129 | func NewSidebarSection() *SidebarSection { | ||
| 130 | + | core.LazyRegister(&xNewSidebarSection, "ADW", "adw_sidebar_section_new", false) | |||
| 130 | var cls *SidebarSection | 131 | var cls *SidebarSection | ||
| 131 | 132 | ||||
| 132 | cret := xNewSidebarSection() | 133 | cret := xNewSidebarSection() | ||
| @@ -145,6 +146,8 @@ var xSidebarSectionAppend func(uintptr, uintptr) | |||||
| 145 | // | 146 | // | ||
| 146 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | 147 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | ||
| 147 | func (x *SidebarSection) Append(ItemVar *SidebarItem) { | 148 | func (x *SidebarSection) Append(ItemVar *SidebarItem) { | ||
| 149 | + | core.LazyRegister(&xSidebarSectionAppend, "ADW", "adw_sidebar_section_append", false) | |||
| 150 | + | ||||
| 148 | xSidebarSectionAppend(x.GoPointer(), ItemVar.GoPointer()) | 151 | xSidebarSectionAppend(x.GoPointer(), ItemVar.GoPointer()) | ||
| 149 | } | 152 | } | ||
| 150 | 153 | ||||
| @@ -167,6 +170,8 @@ var xSidebarSectionBindModel func(uintptr, uintptr, uintptr, uintptr, uintptr) | |||||
| 167 | // Accessing items and modifying them is allowed, but the changes will be erased | 170 | // Accessing items and modifying them is allowed, but the changes will be erased | ||
| 168 | // whenever that part of the model changes, so it's not recommended. | 171 | // whenever that part of the model changes, so it's not recommended. | ||
| 169 | func (x *SidebarSection) BindModel(ModelVar gio.ListModel, CreateItemFuncVar *SidebarSectionCreateItemFunc, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) { | 172 | func (x *SidebarSection) BindModel(ModelVar gio.ListModel, CreateItemFuncVar *SidebarSectionCreateItemFunc, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) { | ||
| 173 | + | core.LazyRegister(&xSidebarSectionBindModel, "ADW", "adw_sidebar_section_bind_model", false) | |||
| 174 | + | ||||
| 170 | xSidebarSectionBindModel(x.GoPointer(), ModelVar.GoPointer(), glib.NewCallbackNullable(CreateItemFuncVar), UserDataVar, glib.NewCallback(UserDataFreeFuncVar)) | 175 | xSidebarSectionBindModel(x.GoPointer(), ModelVar.GoPointer(), glib.NewCallbackNullable(CreateItemFuncVar), UserDataVar, glib.NewCallback(UserDataFreeFuncVar)) | ||
| 171 | } | 176 | } | ||
| 172 | 177 | ||||
| @@ -179,6 +184,7 @@ var xSidebarSectionGetItem func(uintptr, uint) uintptr | |||||
| 179 | // | 184 | // | ||
| 180 | // Can return `NULL` if @index is larger or equal to the number of items. | 185 | // Can return `NULL` if @index is larger or equal to the number of items. | ||
| 181 | func (x *SidebarSection) GetItem(IndexVar uint) *SidebarItem { | 186 | func (x *SidebarSection) GetItem(IndexVar uint) *SidebarItem { | ||
| 187 | + | core.LazyRegister(&xSidebarSectionGetItem, "ADW", "adw_sidebar_section_get_item", false) | |||
| 182 | var cls *SidebarItem | 188 | var cls *SidebarItem | ||
| 183 | 189 | ||||
| 184 | cret := xSidebarSectionGetItem(x.GoPointer(), IndexVar) | 190 | cret := xSidebarSectionGetItem(x.GoPointer(), IndexVar) | ||
| @@ -198,6 +204,7 @@ var xSidebarSectionGetItems func(uintptr) uintptr | |||||
| 198 | // | 204 | // | ||
| 199 | // This can be used to keep an up-to-date view. | 205 | // This can be used to keep an up-to-date view. | ||
| 200 | func (x *SidebarSection) GetItems() *gio.ListModelBase { | 206 | func (x *SidebarSection) GetItems() *gio.ListModelBase { | ||
| 207 | + | core.LazyRegister(&xSidebarSectionGetItems, "ADW", "adw_sidebar_section_get_items", false) | |||
| 201 | var cls *gio.ListModelBase | 208 | var cls *gio.ListModelBase | ||
| 202 | 209 | ||||
| 203 | cret := xSidebarSectionGetItems(x.GoPointer()) | 210 | cret := xSidebarSectionGetItems(x.GoPointer()) | ||
| @@ -214,6 +221,7 @@ var xSidebarSectionGetMenuModel func(uintptr) uintptr | |||||
| 214 | 221 | ||||
| 215 | // Gets the context menu model for @self's items. | 222 | // Gets the context menu model for @self's items. | ||
| 216 | func (x *SidebarSection) GetMenuModel() *gio.MenuModel { | 223 | func (x *SidebarSection) GetMenuModel() *gio.MenuModel { | ||
| 224 | + | core.LazyRegister(&xSidebarSectionGetMenuModel, "ADW", "adw_sidebar_section_get_menu_model", false) | |||
| 217 | var cls *gio.MenuModel | 225 | var cls *gio.MenuModel | ||
| 218 | 226 | ||||
| 219 | cret := xSidebarSectionGetMenuModel(x.GoPointer()) | 227 | cret := xSidebarSectionGetMenuModel(x.GoPointer()) | ||
| @@ -231,6 +239,7 @@ var xSidebarSectionGetSidebar func(uintptr) uintptr | |||||
| 231 | 239 | ||||
| 232 | // Gets the sidebar @self is in. | 240 | // Gets the sidebar @self is in. | ||
| 233 | func (x *SidebarSection) GetSidebar() *Sidebar { | 241 | func (x *SidebarSection) GetSidebar() *Sidebar { | ||
| 242 | + | core.LazyRegister(&xSidebarSectionGetSidebar, "ADW", "adw_sidebar_section_get_sidebar", false) | |||
| 234 | var cls *Sidebar | 243 | var cls *Sidebar | ||
| 235 | 244 | ||||
| 236 | cret := xSidebarSectionGetSidebar(x.GoPointer()) | 245 | cret := xSidebarSectionGetSidebar(x.GoPointer()) | ||
| @@ -248,6 +257,8 @@ var xSidebarSectionGetTitle func(uintptr) string | |||||
| 248 | 257 | ||||
| 249 | // Gets the title of @self. | 258 | // Gets the title of @self. | ||
| 250 | func (x *SidebarSection) GetTitle() string { | 259 | func (x *SidebarSection) GetTitle() string { | ||
| 260 | + | core.LazyRegister(&xSidebarSectionGetTitle, "ADW", "adw_sidebar_section_get_title", false) | |||
| 261 | + | ||||
| 251 | cret := xSidebarSectionGetTitle(x.GoPointer()) | 262 | cret := xSidebarSectionGetTitle(x.GoPointer()) | ||
| 252 | return cret | 263 | return cret | ||
| 253 | } | 264 | } | ||
| @@ -261,6 +272,8 @@ var xSidebarSectionInsert func(uintptr, uintptr, int) | |||||
| 261 | // | 272 | // | ||
| 262 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | 273 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | ||
| 263 | func (x *SidebarSection) Insert(ItemVar *SidebarItem, PositionVar int) { | 274 | func (x *SidebarSection) Insert(ItemVar *SidebarItem, PositionVar int) { | ||
| 275 | + | core.LazyRegister(&xSidebarSectionInsert, "ADW", "adw_sidebar_section_insert", false) | |||
| 276 | + | ||||
| 264 | xSidebarSectionInsert(x.GoPointer(), ItemVar.GoPointer(), PositionVar) | 277 | xSidebarSectionInsert(x.GoPointer(), ItemVar.GoPointer(), PositionVar) | ||
| 265 | } | 278 | } | ||
| 266 | 279 | ||||
| @@ -270,6 +283,8 @@ var xSidebarSectionPrepend func(uintptr, uintptr) | |||||
| 270 | // | 283 | // | ||
| 271 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | 284 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | ||
| 272 | func (x *SidebarSection) Prepend(ItemVar *SidebarItem) { | 285 | func (x *SidebarSection) Prepend(ItemVar *SidebarItem) { | ||
| 286 | + | core.LazyRegister(&xSidebarSectionPrepend, "ADW", "adw_sidebar_section_prepend", false) | |||
| 287 | + | ||||
| 273 | xSidebarSectionPrepend(x.GoPointer(), ItemVar.GoPointer()) | 288 | xSidebarSectionPrepend(x.GoPointer(), ItemVar.GoPointer()) | ||
| 274 | } | 289 | } | ||
| 275 | 290 | ||||
| @@ -279,6 +294,8 @@ var xSidebarSectionRemove func(uintptr, uintptr) | |||||
| 279 | // | 294 | // | ||
| 280 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | 295 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | ||
| 281 | func (x *SidebarSection) Remove(ItemVar *SidebarItem) { | 296 | func (x *SidebarSection) Remove(ItemVar *SidebarItem) { | ||
| 297 | + | core.LazyRegister(&xSidebarSectionRemove, "ADW", "adw_sidebar_section_remove", false) | |||
| 298 | + | ||||
| 282 | xSidebarSectionRemove(x.GoPointer(), ItemVar.GoPointer()) | 299 | xSidebarSectionRemove(x.GoPointer(), ItemVar.GoPointer()) | ||
| 283 | } | 300 | } | ||
| 284 | 301 | ||||
| @@ -288,6 +305,8 @@ var xSidebarSectionRemoveAll func(uintptr) | |||||
| 288 | // | 305 | // | ||
| 289 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | 306 | // Cannot be used while a model is bound via [method@SidebarSection.bind_model]. | ||
| 290 | func (x *SidebarSection) RemoveAll() { | 307 | func (x *SidebarSection) RemoveAll() { | ||
| 308 | + | core.LazyRegister(&xSidebarSectionRemoveAll, "ADW", "adw_sidebar_section_remove_all", false) | |||
| 309 | + | ||||
| 291 | xSidebarSectionRemoveAll(x.GoPointer()) | 310 | xSidebarSectionRemoveAll(x.GoPointer()) | ||
| 292 | } | 311 | } | ||
| 293 | 312 | ||||
| @@ -301,6 +320,8 @@ var xSidebarSectionSetMenuModel func(uintptr, uintptr) | |||||
| 301 | // | 320 | // | ||
| 302 | // If not set, [property@Sidebar:menu-model] will be used instead. | 321 | // If not set, [property@Sidebar:menu-model] will be used instead. | ||
| 303 | func (x *SidebarSection) SetMenuModel(MenuModelVar *gio.MenuModel) { | 322 | func (x *SidebarSection) SetMenuModel(MenuModelVar *gio.MenuModel) { | ||
| 323 | + | core.LazyRegister(&xSidebarSectionSetMenuModel, "ADW", "adw_sidebar_section_set_menu_model", false) | |||
| 324 | + | ||||
| 304 | xSidebarSectionSetMenuModel(x.GoPointer(), MenuModelVar.GoPointer()) | 325 | xSidebarSectionSetMenuModel(x.GoPointer(), MenuModelVar.GoPointer()) | ||
| 305 | } | 326 | } | ||
| 306 | 327 | ||||
| @@ -310,6 +331,8 @@ var xSidebarSectionSetTitle func(uintptr, uintptr) | |||||
| 310 | // | 331 | // | ||
| 311 | // If set, it will be displayed instead of the separator before the section. | 332 | // If set, it will be displayed instead of the separator before the section. | ||
| 312 | func (x *SidebarSection) SetTitle(TitleVar *string) { | 333 | func (x *SidebarSection) SetTitle(TitleVar *string) { | ||
| 334 | + | core.LazyRegister(&xSidebarSectionSetTitle, "ADW", "adw_sidebar_section_set_title", false) | |||
| 335 | + | ||||
| 313 | TitleVarPtr := core.GStrdupNullable(TitleVar) | 336 | TitleVarPtr := core.GStrdupNullable(TitleVar) | ||
| 314 | defer core.GFreeNullable(TitleVarPtr) | 337 | defer core.GFreeNullable(TitleVarPtr) | ||
| 315 | 338 | ||||
| @@ -360,30 +383,4 @@ func (x *SidebarSection) GetBuildableId() string { | |||||
| 360 | func init() { | 383 | func init() { | ||
| 361 | core.SetPackageName("ADW", "libadwaita-1") | 384 | core.SetPackageName("ADW", "libadwaita-1") | ||
| 362 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | 385 | core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0", "libadwaita-1.0.dylib"}) | ||
| 363 | - | var libs []uintptr | |||
| 364 | - | for _, libPath := range core.GetPaths("ADW") { | |||
| 365 | - | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 366 | - | if err != nil { | |||
| 367 | - | panic(err) | |||
| 368 | - | } | |||
| 369 | - | libs = append(libs, lib) | |||
| 370 | - | } | |||
| 371 | - | ||||
| 372 | - | core.PuregoSafeRegister(&xSidebarSectionGLibType, libs, "adw_sidebar_section_get_type") | |||
| 373 | - | ||||
| 374 | - | core.PuregoSafeRegister(&xNewSidebarSection, libs, "adw_sidebar_section_new") | |||
| 375 | - | ||||
| 376 | - | core.PuregoSafeRegister(&xSidebarSectionAppend, libs, "adw_sidebar_section_append") | |||
| 377 | - | core.PuregoSafeRegister(&xSidebarSectionBindModel, libs, "adw_sidebar_section_bind_model") | |||
| 378 | - | core.PuregoSafeRegister(&xSidebarSectionGetItem, libs, "adw_sidebar_section_get_item") | |||
| 379 | - | core.PuregoSafeRegister(&xSidebarSectionGetItems, libs, "adw_sidebar_section_get_items") | |||
| 380 | - | core.PuregoSafeRegister(&xSidebarSectionGetMenuModel, libs, "adw_sidebar_section_get_menu_model") | |||
| 381 | - | core.PuregoSafeRegister(&xSidebarSectionGetSidebar, libs, "adw_sidebar_section_get_sidebar") | |||
| 382 | - | core.PuregoSafeRegister(&xSidebarSectionGetTitle, libs, "adw_sidebar_section_get_title") | |||
| 383 | - | core.PuregoSafeRegister(&xSidebarSectionInsert, libs, "adw_sidebar_section_insert") | |||
| 384 | - | core.PuregoSafeRegister(&xSidebarSectionPrepend, libs, "adw_sidebar_section_prepend") | |||
| 385 | - | core.PuregoSafeRegister(&xSidebarSectionRemove, libs, "adw_sidebar_section_remove") | |||
| 386 | - | core.PuregoSafeRegister(&xSidebarSectionRemoveAll, libs, "adw_sidebar_section_remove_all") | |||
| 387 | - | core.PuregoSafeRegister(&xSidebarSectionSetMenuModel, libs, "adw_sidebar_section_set_menu_model") | |||
| 388 | - | core.PuregoSafeRegister(&xSidebarSectionSetTitle, libs, "adw_sidebar_section_set_title") | |||
| 389 | } | 386 | } | ||