// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gdk import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/cairo" "github.com/bnema/puregotk/v4/gdkpixbuf" ) var xCairoDrawFromGl func(*cairo.Context, uintptr, int, int, int, int, int, int, int) // Draws GL content onto a cairo context. // // It takes a render buffer ID (@source_type == GL_RENDERBUFFER) or a texture // id (@source_type == GL_TEXTURE) and draws it onto @cr with an OVER operation, // respecting the current clip. The top left corner of the rectangle specified // by @x, @y, @width and @height will be drawn at the current (0,0) position of // the `cairo_t`. // // This will work for *all* `cairo_t`, as long as @surface is realized, but the // fallback implementation that reads back the pixels from the buffer may be // used in the general case. In the case of direct drawing to a surface with // no special effects applied to @cr it will however use a more efficient // approach. // // For GL_RENDERBUFFER the code will always fall back to software for buffers // with alpha components, so make sure you use GL_TEXTURE if using alpha. // // Calling this may change the current GL context. func CairoDrawFromGl(CrVar *cairo.Context, SurfaceVar *Surface, SourceVar int, SourceTypeVar int, BufferScaleVar int, XVar int, YVar int, WidthVar int, HeightVar int) { xCairoDrawFromGl(CrVar, SurfaceVar.GoPointer(), SourceVar, SourceTypeVar, BufferScaleVar, XVar, YVar, WidthVar, HeightVar) } var xCairoRectangle func(*cairo.Context, *Rectangle) // Adds the given rectangle to the current path of @cr. func CairoRectangle(CrVar *cairo.Context, RectangleVar *Rectangle) { xCairoRectangle(CrVar, RectangleVar) } var xCairoRegion func(*cairo.Context, *cairo.Region) // Adds the given region to the current path of @cr. func CairoRegion(CrVar *cairo.Context, RegionVar *cairo.Region) { xCairoRegion(CrVar, RegionVar) } var xCairoRegionCreateFromSurface func(*cairo.Surface) *cairo.Region // Creates region that covers the area where the given // @surface is more than 50% opaque. // // This function takes into account device offsets that might be // set with cairo_surface_set_device_offset(). func CairoRegionCreateFromSurface(SurfaceVar *cairo.Surface) *cairo.Region { cret := xCairoRegionCreateFromSurface(SurfaceVar) return cret } var xCairoSetSourcePixbuf func(*cairo.Context, uintptr, float64, float64) // Sets the given pixbuf as the source pattern for @cr. // // The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned // so that the origin of @pixbuf is @pixbuf_x, @pixbuf_y. func CairoSetSourcePixbuf(CrVar *cairo.Context, PixbufVar *gdkpixbuf.Pixbuf, PixbufXVar float64, PixbufYVar float64) { xCairoSetSourcePixbuf(CrVar, PixbufVar.GoPointer(), PixbufXVar, PixbufYVar) } var xCairoSetSourceRgba func(*cairo.Context, *RGBA) // Sets the specified `GdkRGBA` as the source color of @cr. func CairoSetSourceRgba(CrVar *cairo.Context, RgbaVar *RGBA) { xCairoSetSourceRgba(CrVar, RgbaVar) } func init() { core.SetPackageName("GDK", "gtk4") core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GDK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xCairoDrawFromGl, libs, "gdk_cairo_draw_from_gl") core.PuregoSafeRegister(&xCairoRectangle, libs, "gdk_cairo_rectangle") core.PuregoSafeRegister(&xCairoRegion, libs, "gdk_cairo_region") core.PuregoSafeRegister(&xCairoRegionCreateFromSurface, libs, "gdk_cairo_region_create_from_surface") core.PuregoSafeRegister(&xCairoSetSourcePixbuf, libs, "gdk_cairo_set_source_pixbuf") core.PuregoSafeRegister(&xCairoSetSourceRgba, libs, "gdk_cairo_set_source_rgba") }