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
| @@ -4,6 +4,7 @@ package gdk | |||
| 4 | 4 | import ( | |
| 5 | 5 | "unsafe" | |
| 6 | 6 | ||
| 7 | + | "github.com/bnema/purego" | |
| 7 | 8 | "github.com/bnema/puregotk/pkg/core" | |
| 8 | 9 | "github.com/bnema/puregotk/v4/cairo" | |
| 9 | 10 | "github.com/bnema/puregotk/v4/gdkpixbuf" | |
| @@ -30,8 +31,6 @@ var xCairoDrawFromGl func(*cairo.Context, uintptr, int, int, int, int, int, int, | |||
| 30 | 31 | // | |
| 31 | 32 | // Calling this may change the current GL context. | |
| 32 | 33 | func CairoDrawFromGl(CrVar *cairo.Context, SurfaceVar *Surface, SourceVar int, SourceTypeVar int, BufferScaleVar int, XVar int, YVar int, WidthVar int, HeightVar int) { | |
| 33 | - | core.LazyRegister(&xCairoDrawFromGl, "GDK", "gdk_cairo_draw_from_gl", false) | |
| 34 | - | ||
| 35 | 34 | xCairoDrawFromGl(CrVar, SurfaceVar.GoPointer(), SourceVar, SourceTypeVar, BufferScaleVar, XVar, YVar, WidthVar, HeightVar) | |
| 36 | 35 | } | |
| 37 | 36 | ||
| @@ -39,8 +38,6 @@ var xCairoRectangle func(*cairo.Context, *Rectangle) | |||
| 39 | 38 | ||
| 40 | 39 | // Adds the given rectangle to the current path of @cr. | |
| 41 | 40 | func CairoRectangle(CrVar *cairo.Context, RectangleVar *Rectangle) { | |
| 42 | - | core.LazyRegister(&xCairoRectangle, "GDK", "gdk_cairo_rectangle", false) | |
| 43 | - | ||
| 44 | 41 | xCairoRectangle(CrVar, RectangleVar) | |
| 45 | 42 | } | |
| 46 | 43 | ||
| @@ -48,8 +45,6 @@ var xCairoRegion func(*cairo.Context, *cairo.Region) | |||
| 48 | 45 | ||
| 49 | 46 | // Adds the given region to the current path of @cr. | |
| 50 | 47 | func CairoRegion(CrVar *cairo.Context, RegionVar *cairo.Region) { | |
| 51 | - | core.LazyRegister(&xCairoRegion, "GDK", "gdk_cairo_region", false) | |
| 52 | - | ||
| 53 | 48 | xCairoRegion(CrVar, RegionVar) | |
| 54 | 49 | } | |
| 55 | 50 | ||
| @@ -61,8 +56,6 @@ var xCairoRegionCreateFromSurface func(*cairo.Surface) uintptr | |||
| 61 | 56 | // This function takes into account device offsets that might be | |
| 62 | 57 | // set with cairo_surface_set_device_offset(). | |
| 63 | 58 | func CairoRegionCreateFromSurface(SurfaceVar *cairo.Surface) *cairo.Region { | |
| 64 | - | core.LazyRegister(&xCairoRegionCreateFromSurface, "GDK", "gdk_cairo_region_create_from_surface", false) | |
| 65 | - | ||
| 66 | 59 | cret := xCairoRegionCreateFromSurface(SurfaceVar) | |
| 67 | 60 | if cret == 0 { | |
| 68 | 61 | return nil | |
| @@ -77,8 +70,6 @@ var xCairoSetSourcePixbuf func(*cairo.Context, uintptr, float64, float64) | |||
| 77 | 70 | // The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned | |
| 78 | 71 | // so that the origin of @pixbuf is @pixbuf_x, @pixbuf_y. | |
| 79 | 72 | func CairoSetSourcePixbuf(CrVar *cairo.Context, PixbufVar *gdkpixbuf.Pixbuf, PixbufXVar float64, PixbufYVar float64) { | |
| 80 | - | core.LazyRegister(&xCairoSetSourcePixbuf, "GDK", "gdk_cairo_set_source_pixbuf", false) | |
| 81 | - | ||
| 82 | 73 | xCairoSetSourcePixbuf(CrVar, PixbufVar.GoPointer(), PixbufXVar, PixbufYVar) | |
| 83 | 74 | } | |
| 84 | 75 | ||
| @@ -86,12 +77,25 @@ var xCairoSetSourceRgba func(*cairo.Context, *RGBA) | |||
| 86 | 77 | ||
| 87 | 78 | // Sets the specified `GdkRGBA` as the source color of @cr. | |
| 88 | 79 | func CairoSetSourceRgba(CrVar *cairo.Context, RgbaVar *RGBA) { | |
| 89 | - | core.LazyRegister(&xCairoSetSourceRgba, "GDK", "gdk_cairo_set_source_rgba", false) | |
| 90 | - | ||
| 91 | 80 | xCairoSetSourceRgba(CrVar, RgbaVar) | |
| 92 | 81 | } | |
| 93 | 82 | ||
| 94 | 83 | func init() { | |
| 95 | 84 | core.SetPackageName("GDK", "gtk4") | |
| 96 | 85 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | |
| 86 | + | var libs []uintptr | |
| 87 | + | for _, libPath := range core.GetPaths("GDK") { | |
| 88 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 89 | + | if err != nil { | |
| 90 | + | panic(err) | |
| 91 | + | } | |
| 92 | + | libs = append(libs, lib) | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | core.PuregoSafeRegister(&xCairoDrawFromGl, libs, "gdk_cairo_draw_from_gl") | |
| 96 | + | core.PuregoSafeRegister(&xCairoRectangle, libs, "gdk_cairo_rectangle") | |
| 97 | + | core.PuregoSafeRegister(&xCairoRegion, libs, "gdk_cairo_region") | |
| 98 | + | core.PuregoSafeRegister(&xCairoRegionCreateFromSurface, libs, "gdk_cairo_region_create_from_surface") | |
| 99 | + | core.PuregoSafeRegister(&xCairoSetSourcePixbuf, libs, "gdk_cairo_set_source_pixbuf") | |
| 100 | + | core.PuregoSafeRegister(&xCairoSetSourceRgba, libs, "gdk_cairo_set_source_rgba") | |
| 97 | 101 | } | |
| @@ -4,6 +4,7 @@ package gdk | |||||
| 4 | import ( | 4 | import ( | ||
| 5 | "unsafe" | 5 | "unsafe" | ||
| 6 | 6 | ||||
| 7 | + | "github.com/bnema/purego" | |||
| 7 | "github.com/bnema/puregotk/pkg/core" | 8 | "github.com/bnema/puregotk/pkg/core" | ||
| 8 | "github.com/bnema/puregotk/v4/cairo" | 9 | "github.com/bnema/puregotk/v4/cairo" | ||
| 9 | "github.com/bnema/puregotk/v4/gdkpixbuf" | 10 | "github.com/bnema/puregotk/v4/gdkpixbuf" | ||
| @@ -30,8 +31,6 @@ var xCairoDrawFromGl func(*cairo.Context, uintptr, int, int, int, int, int, int, | |||||
| 30 | // | 31 | // | ||
| 31 | // Calling this may change the current GL context. | 32 | // Calling this may change the current GL context. | ||
| 32 | func CairoDrawFromGl(CrVar *cairo.Context, SurfaceVar *Surface, SourceVar int, SourceTypeVar int, BufferScaleVar int, XVar int, YVar int, WidthVar int, HeightVar int) { | 33 | func CairoDrawFromGl(CrVar *cairo.Context, SurfaceVar *Surface, SourceVar int, SourceTypeVar int, BufferScaleVar int, XVar int, YVar int, WidthVar int, HeightVar int) { | ||
| 33 | - | core.LazyRegister(&xCairoDrawFromGl, "GDK", "gdk_cairo_draw_from_gl", false) | |||
| 34 | - | ||||
| 35 | xCairoDrawFromGl(CrVar, SurfaceVar.GoPointer(), SourceVar, SourceTypeVar, BufferScaleVar, XVar, YVar, WidthVar, HeightVar) | 34 | xCairoDrawFromGl(CrVar, SurfaceVar.GoPointer(), SourceVar, SourceTypeVar, BufferScaleVar, XVar, YVar, WidthVar, HeightVar) | ||
| 36 | } | 35 | } | ||
| 37 | 36 | ||||
| @@ -39,8 +38,6 @@ var xCairoRectangle func(*cairo.Context, *Rectangle) | |||||
| 39 | 38 | ||||
| 40 | // Adds the given rectangle to the current path of @cr. | 39 | // Adds the given rectangle to the current path of @cr. | ||
| 41 | func CairoRectangle(CrVar *cairo.Context, RectangleVar *Rectangle) { | 40 | func CairoRectangle(CrVar *cairo.Context, RectangleVar *Rectangle) { | ||
| 42 | - | core.LazyRegister(&xCairoRectangle, "GDK", "gdk_cairo_rectangle", false) | |||
| 43 | - | ||||
| 44 | xCairoRectangle(CrVar, RectangleVar) | 41 | xCairoRectangle(CrVar, RectangleVar) | ||
| 45 | } | 42 | } | ||
| 46 | 43 | ||||
| @@ -48,8 +45,6 @@ var xCairoRegion func(*cairo.Context, *cairo.Region) | |||||
| 48 | 45 | ||||
| 49 | // Adds the given region to the current path of @cr. | 46 | // Adds the given region to the current path of @cr. | ||
| 50 | func CairoRegion(CrVar *cairo.Context, RegionVar *cairo.Region) { | 47 | func CairoRegion(CrVar *cairo.Context, RegionVar *cairo.Region) { | ||
| 51 | - | core.LazyRegister(&xCairoRegion, "GDK", "gdk_cairo_region", false) | |||
| 52 | - | ||||
| 53 | xCairoRegion(CrVar, RegionVar) | 48 | xCairoRegion(CrVar, RegionVar) | ||
| 54 | } | 49 | } | ||
| 55 | 50 | ||||
| @@ -61,8 +56,6 @@ var xCairoRegionCreateFromSurface func(*cairo.Surface) uintptr | |||||
| 61 | // This function takes into account device offsets that might be | 56 | // This function takes into account device offsets that might be | ||
| 62 | // set with cairo_surface_set_device_offset(). | 57 | // set with cairo_surface_set_device_offset(). | ||
| 63 | func CairoRegionCreateFromSurface(SurfaceVar *cairo.Surface) *cairo.Region { | 58 | func CairoRegionCreateFromSurface(SurfaceVar *cairo.Surface) *cairo.Region { | ||
| 64 | - | core.LazyRegister(&xCairoRegionCreateFromSurface, "GDK", "gdk_cairo_region_create_from_surface", false) | |||
| 65 | - | ||||
| 66 | cret := xCairoRegionCreateFromSurface(SurfaceVar) | 59 | cret := xCairoRegionCreateFromSurface(SurfaceVar) | ||
| 67 | if cret == 0 { | 60 | if cret == 0 { | ||
| 68 | return nil | 61 | return nil | ||
| @@ -77,8 +70,6 @@ var xCairoSetSourcePixbuf func(*cairo.Context, uintptr, float64, float64) | |||||
| 77 | // The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned | 70 | // The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned | ||
| 78 | // so that the origin of @pixbuf is @pixbuf_x, @pixbuf_y. | 71 | // so that the origin of @pixbuf is @pixbuf_x, @pixbuf_y. | ||
| 79 | func CairoSetSourcePixbuf(CrVar *cairo.Context, PixbufVar *gdkpixbuf.Pixbuf, PixbufXVar float64, PixbufYVar float64) { | 72 | func CairoSetSourcePixbuf(CrVar *cairo.Context, PixbufVar *gdkpixbuf.Pixbuf, PixbufXVar float64, PixbufYVar float64) { | ||
| 80 | - | core.LazyRegister(&xCairoSetSourcePixbuf, "GDK", "gdk_cairo_set_source_pixbuf", false) | |||
| 81 | - | ||||
| 82 | xCairoSetSourcePixbuf(CrVar, PixbufVar.GoPointer(), PixbufXVar, PixbufYVar) | 73 | xCairoSetSourcePixbuf(CrVar, PixbufVar.GoPointer(), PixbufXVar, PixbufYVar) | ||
| 83 | } | 74 | } | ||
| 84 | 75 | ||||
| @@ -86,12 +77,25 @@ var xCairoSetSourceRgba func(*cairo.Context, *RGBA) | |||||
| 86 | 77 | ||||
| 87 | // Sets the specified `GdkRGBA` as the source color of @cr. | 78 | // Sets the specified `GdkRGBA` as the source color of @cr. | ||
| 88 | func CairoSetSourceRgba(CrVar *cairo.Context, RgbaVar *RGBA) { | 79 | func CairoSetSourceRgba(CrVar *cairo.Context, RgbaVar *RGBA) { | ||
| 89 | - | core.LazyRegister(&xCairoSetSourceRgba, "GDK", "gdk_cairo_set_source_rgba", false) | |||
| 90 | - | ||||
| 91 | xCairoSetSourceRgba(CrVar, RgbaVar) | 80 | xCairoSetSourceRgba(CrVar, RgbaVar) | ||
| 92 | } | 81 | } | ||
| 93 | 82 | ||||
| 94 | func init() { | 83 | func init() { | ||
| 95 | core.SetPackageName("GDK", "gtk4") | 84 | core.SetPackageName("GDK", "gtk4") | ||
| 96 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | 85 | core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1", "libgtk-4.1.dylib"}) | ||
| 86 | + | var libs []uintptr | |||
| 87 | + | for _, libPath := range core.GetPaths("GDK") { | |||
| 88 | + | lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) | |||
| 89 | + | if err != nil { | |||
| 90 | + | panic(err) | |||
| 91 | + | } | |||
| 92 | + | libs = append(libs, lib) | |||
| 93 | + | } | |||
| 94 | + | ||||
| 95 | + | core.PuregoSafeRegister(&xCairoDrawFromGl, libs, "gdk_cairo_draw_from_gl") | |||
| 96 | + | core.PuregoSafeRegister(&xCairoRectangle, libs, "gdk_cairo_rectangle") | |||
| 97 | + | core.PuregoSafeRegister(&xCairoRegion, libs, "gdk_cairo_region") | |||
| 98 | + | core.PuregoSafeRegister(&xCairoRegionCreateFromSurface, libs, "gdk_cairo_region_create_from_surface") | |||
| 99 | + | core.PuregoSafeRegister(&xCairoSetSourcePixbuf, libs, "gdk_cairo_set_source_pixbuf") | |||
| 100 | + | core.PuregoSafeRegister(&xCairoSetSourceRgba, libs, "gdk_cairo_set_source_rgba") | |||
| 97 | } | 101 | } | ||