// 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/gobject/types" ) // Represents the platform-specific draw context. // // `GdkCairoContext`s are created for a surface using // [method@Gdk.Surface.create_cairo_context], and the context // can then be used to draw on that surface. type CairoContext struct { DrawContext } var xCairoContextGLibType func() types.GType func CairoContextGLibType() types.GType { return xCairoContextGLibType() } func CairoContextNewFromInternalPtr(ptr uintptr) *CairoContext { cls := &CairoContext{} cls.Ptr = ptr return cls } var xCairoContextCairoCreate func(uintptr) *cairo.Context // Retrieves a Cairo context to be used to draw on the `GdkSurface` // of @context. // // A call to [method@Gdk.DrawContext.begin_frame] with this // @context must have been done or this function will return %NULL. // // The returned context is guaranteed to be valid until // [method@Gdk.DrawContext.end_frame] is called. func (x *CairoContext) CairoCreate() *cairo.Context { cret := xCairoContextCairoCreate(x.GoPointer()) return cret } func (c *CairoContext) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *CairoContext) SetGoPointer(ptr uintptr) { c.Ptr = ptr } 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(&xCairoContextGLibType, libs, "gdk_cairo_context_get_type") core.PuregoSafeRegister(&xCairoContextCairoCreate, libs, "gdk_cairo_context_cairo_create") }