// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gdk import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/cairo" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type MemoryTextureBuilderClass struct { _ structs.HostLayout } func (x *MemoryTextureBuilderClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Constructs [class@Gdk.Texture] objects from system memory provided // via [struct@GLib.Bytes]. // // The operation is quite simple: Create a texture builder, set all the necessary // properties - keep in mind that the properties [property@Gdk.MemoryTextureBuilder:bytes], // [property@Gdk.MemoryTextureBuilder:stride], [property@Gdk.MemoryTextureBuilder:width], // and [property@Gdk.MemoryTextureBuilder:height] are mandatory - and then call // [method@Gdk.MemoryTextureBuilder.build] to create the new texture. // // `GdkMemoryTextureBuilder` can be used for quick one-shot construction of // textures as well as kept around and reused to construct multiple textures. type MemoryTextureBuilder struct { gobject.Object } var xMemoryTextureBuilderGLibType func() types.GType func MemoryTextureBuilderGLibType() types.GType { return xMemoryTextureBuilderGLibType() } func MemoryTextureBuilderNewFromInternalPtr(ptr uintptr) *MemoryTextureBuilder { cls := &MemoryTextureBuilder{} cls.Ptr = ptr return cls } var xNewMemoryTextureBuilder func() uintptr // Creates a new texture builder. func NewMemoryTextureBuilder() *MemoryTextureBuilder { var cls *MemoryTextureBuilder cret := xNewMemoryTextureBuilder() if cret == 0 { return nil } cls = &MemoryTextureBuilder{} cls.Ptr = cret return cls } var xMemoryTextureBuilderBuild func(uintptr) uintptr // Builds a new `GdkTexture` with the values set up in the builder. // // Note that it is a programming error to call this function if any mandatory // property has not been set. // // It is possible to call this function multiple times to create multiple textures, // possibly with changing properties in between. func (x *MemoryTextureBuilder) Build() *Texture { var cls *Texture cret := xMemoryTextureBuilderBuild(x.GoPointer()) if cret == 0 { return nil } cls = &Texture{} cls.Ptr = cret return cls } var xMemoryTextureBuilderGetBytes func(uintptr) *glib.Bytes // Gets the bytes previously set via gdk_memory_texture_builder_set_bytes() // or %NULL if none was set. func (x *MemoryTextureBuilder) GetBytes() *glib.Bytes { cret := xMemoryTextureBuilderGetBytes(x.GoPointer()) return cret } var xMemoryTextureBuilderGetColorState func(uintptr) *ColorState // Gets the colorstate previously set via gdk_memory_texture_builder_set_color_state(). func (x *MemoryTextureBuilder) GetColorState() *ColorState { cret := xMemoryTextureBuilderGetColorState(x.GoPointer()) return cret } var xMemoryTextureBuilderGetFormat func(uintptr) MemoryFormat // Gets the format previously set via gdk_memory_texture_builder_set_format(). func (x *MemoryTextureBuilder) GetFormat() MemoryFormat { cret := xMemoryTextureBuilderGetFormat(x.GoPointer()) return cret } var xMemoryTextureBuilderGetHeight func(uintptr) int // Gets the height previously set via gdk_memory_texture_builder_set_height() // or 0 if the height wasn't set. func (x *MemoryTextureBuilder) GetHeight() int { cret := xMemoryTextureBuilderGetHeight(x.GoPointer()) return cret } var xMemoryTextureBuilderGetOffset func(uintptr, uint) uint // Gets the offset previously set via gdk_memory_texture_builder_set_offset(). func (x *MemoryTextureBuilder) GetOffset(PlaneVar uint) uint { cret := xMemoryTextureBuilderGetOffset(x.GoPointer(), PlaneVar) return cret } var xMemoryTextureBuilderGetStride func(uintptr) uint // Gets the stride previously set via gdk_memory_texture_builder_set_stride(). func (x *MemoryTextureBuilder) GetStride() uint { cret := xMemoryTextureBuilderGetStride(x.GoPointer()) return cret } var xMemoryTextureBuilderGetStrideForPlane func(uintptr, uint) uint // Gets the stride previously set via gdk_memory_texture_builder_set_stride_for_plane(). func (x *MemoryTextureBuilder) GetStrideForPlane(PlaneVar uint) uint { cret := xMemoryTextureBuilderGetStrideForPlane(x.GoPointer(), PlaneVar) return cret } var xMemoryTextureBuilderGetUpdateRegion func(uintptr) *cairo.Region // Gets the region previously set via gdk_memory_texture_builder_set_update_region() // or %NULL if none was set. func (x *MemoryTextureBuilder) GetUpdateRegion() *cairo.Region { cret := xMemoryTextureBuilderGetUpdateRegion(x.GoPointer()) return cret } var xMemoryTextureBuilderGetUpdateTexture func(uintptr) uintptr // Gets the texture previously set via gdk_memory_texture_builder_set_update_texture() // or %NULL if none was set. func (x *MemoryTextureBuilder) GetUpdateTexture() *Texture { var cls *Texture cret := xMemoryTextureBuilderGetUpdateTexture(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Texture{} cls.Ptr = cret return cls } var xMemoryTextureBuilderGetWidth func(uintptr) int // Gets the width previously set via gdk_memory_texture_builder_set_width() // or 0 if the width wasn't set. func (x *MemoryTextureBuilder) GetWidth() int { cret := xMemoryTextureBuilderGetWidth(x.GoPointer()) return cret } var xMemoryTextureBuilderSetBytes func(uintptr, *glib.Bytes) // Sets the data to be shown but the texture. // // The bytes must be set before calling [method@Gdk.MemoryTextureBuilder.build]. func (x *MemoryTextureBuilder) SetBytes(BytesVar *glib.Bytes) { xMemoryTextureBuilderSetBytes(x.GoPointer(), BytesVar) } var xMemoryTextureBuilderSetColorState func(uintptr, *ColorState) // Sets the colorstate describing the data. // // By default, the sRGB colorstate is used. If you don't know // what colorstates are, this is probably the right thing. func (x *MemoryTextureBuilder) SetColorState(ColorStateVar *ColorState) { xMemoryTextureBuilderSetColorState(x.GoPointer(), ColorStateVar) } var xMemoryTextureBuilderSetFormat func(uintptr, MemoryFormat) // Sets the format of the bytes. // // The default is `GDK_MEMORY_R8G8B8A8_PREMULTIPLIED`. func (x *MemoryTextureBuilder) SetFormat(FormatVar MemoryFormat) { xMemoryTextureBuilderSetFormat(x.GoPointer(), FormatVar) } var xMemoryTextureBuilderSetHeight func(uintptr, int) // Sets the height of the texture. // // The height must be set before calling [method@Gdk.MemoryTextureBuilder.build] // and conform to size requirements of the provided format. func (x *MemoryTextureBuilder) SetHeight(HeightVar int) { xMemoryTextureBuilderSetHeight(x.GoPointer(), HeightVar) } var xMemoryTextureBuilderSetOffset func(uintptr, uint, uint) // Sets the offset of the texture for @plane. func (x *MemoryTextureBuilder) SetOffset(PlaneVar uint, OffsetVar uint) { xMemoryTextureBuilderSetOffset(x.GoPointer(), PlaneVar, OffsetVar) } var xMemoryTextureBuilderSetStride func(uintptr, uint) // Sets the rowstride of the bytes used. // // The rowstride must be set before calling [method@Gdk.MemoryTextureBuilder.build]. func (x *MemoryTextureBuilder) SetStride(StrideVar uint) { xMemoryTextureBuilderSetStride(x.GoPointer(), StrideVar) } var xMemoryTextureBuilderSetStrideForPlane func(uintptr, uint, uint) // Sets the stride of the texture for @plane. func (x *MemoryTextureBuilder) SetStrideForPlane(PlaneVar uint, StrideVar uint) { xMemoryTextureBuilderSetStrideForPlane(x.GoPointer(), PlaneVar, StrideVar) } var xMemoryTextureBuilderSetUpdateRegion func(uintptr, *cairo.Region) // Sets the region to be updated by this texture. // // Together with [property@Gdk.MemoryTextureBuilder:update-texture], // this describes an update of a previous texture. // // When rendering animations of large textures, it is possible that // consecutive textures are only updating contents in parts of the texture. // It is then possible to describe this update via these two properties, // so that GTK can avoid rerendering parts that did not change. // // An example would be a screen recording where only the mouse pointer moves. func (x *MemoryTextureBuilder) SetUpdateRegion(RegionVar *cairo.Region) { xMemoryTextureBuilderSetUpdateRegion(x.GoPointer(), RegionVar) } var xMemoryTextureBuilderSetUpdateTexture func(uintptr, uintptr) // Sets the texture to be updated by this texture. // // See [method@Gdk.MemoryTextureBuilder.set_update_region] for an explanation. func (x *MemoryTextureBuilder) SetUpdateTexture(TextureVar *Texture) { xMemoryTextureBuilderSetUpdateTexture(x.GoPointer(), TextureVar.GoPointer()) } var xMemoryTextureBuilderSetWidth func(uintptr, int) // Sets the width of the texture. // // The width must be set before calling [method@Gdk.MemoryTextureBuilder.build] // and conform to size requirements of the provided format. func (x *MemoryTextureBuilder) SetWidth(WidthVar int) { xMemoryTextureBuilderSetWidth(x.GoPointer(), WidthVar) } func (c *MemoryTextureBuilder) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *MemoryTextureBuilder) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyBytes sets the "bytes" property. // The bytes holding the data. func (x *MemoryTextureBuilder) SetPropertyBytes(value uintptr) { var v gobject.Value v.Init(gobject.TypePointerVal) v.SetPointer(value) x.SetProperty("bytes", &v) } // GetPropertyBytes gets the "bytes" property. // The bytes holding the data. func (x *MemoryTextureBuilder) GetPropertyBytes() uintptr { var v gobject.Value x.GetProperty("bytes", &v) return v.GetPointer() } // SetPropertyColorState sets the "color-state" property. // The colorstate describing the data. func (x *MemoryTextureBuilder) SetPropertyColorState(value uintptr) { var v gobject.Value v.Init(gobject.TypePointerVal) v.SetPointer(value) x.SetProperty("color-state", &v) } // GetPropertyColorState gets the "color-state" property. // The colorstate describing the data. func (x *MemoryTextureBuilder) GetPropertyColorState() uintptr { var v gobject.Value x.GetProperty("color-state", &v) return v.GetPointer() } // SetPropertyHeight sets the "height" property. // The height of the texture. func (x *MemoryTextureBuilder) SetPropertyHeight(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("height", &v) } // GetPropertyHeight gets the "height" property. // The height of the texture. func (x *MemoryTextureBuilder) GetPropertyHeight() int { var v gobject.Value x.GetProperty("height", &v) return v.GetInt() } // SetPropertyStride sets the "stride" property. // The rowstride of the texture. // // The rowstride is the number of bytes between the first pixel // in a row of image data, and the first pixel in the next row. func (x *MemoryTextureBuilder) SetPropertyStride(value uint64) { var v gobject.Value v.Init(gobject.TypeUint64Val) v.SetUint64(value) x.SetProperty("stride", &v) } // GetPropertyStride gets the "stride" property. // The rowstride of the texture. // // The rowstride is the number of bytes between the first pixel // in a row of image data, and the first pixel in the next row. func (x *MemoryTextureBuilder) GetPropertyStride() uint64 { var v gobject.Value x.GetProperty("stride", &v) return v.GetUint64() } // SetPropertyUpdateRegion sets the "update-region" property. // The update region for [property@Gdk.MemoryTextureBuilder:update-texture]. func (x *MemoryTextureBuilder) SetPropertyUpdateRegion(value uintptr) { var v gobject.Value v.Init(gobject.TypePointerVal) v.SetPointer(value) x.SetProperty("update-region", &v) } // GetPropertyUpdateRegion gets the "update-region" property. // The update region for [property@Gdk.MemoryTextureBuilder:update-texture]. func (x *MemoryTextureBuilder) GetPropertyUpdateRegion() uintptr { var v gobject.Value x.GetProperty("update-region", &v) return v.GetPointer() } // SetPropertyWidth sets the "width" property. // The width of the texture. func (x *MemoryTextureBuilder) SetPropertyWidth(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("width", &v) } // GetPropertyWidth gets the "width" property. // The width of the texture. func (x *MemoryTextureBuilder) GetPropertyWidth() int { var v gobject.Value x.GetProperty("width", &v) return v.GetInt() } 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(&xMemoryTextureBuilderGLibType, libs, "gdk_memory_texture_builder_get_type") core.PuregoSafeRegister(&xNewMemoryTextureBuilder, libs, "gdk_memory_texture_builder_new") core.PuregoSafeRegister(&xMemoryTextureBuilderBuild, libs, "gdk_memory_texture_builder_build") core.PuregoSafeRegister(&xMemoryTextureBuilderGetBytes, libs, "gdk_memory_texture_builder_get_bytes") core.PuregoSafeRegister(&xMemoryTextureBuilderGetColorState, libs, "gdk_memory_texture_builder_get_color_state") core.PuregoSafeRegister(&xMemoryTextureBuilderGetFormat, libs, "gdk_memory_texture_builder_get_format") core.PuregoSafeRegister(&xMemoryTextureBuilderGetHeight, libs, "gdk_memory_texture_builder_get_height") core.PuregoSafeRegister(&xMemoryTextureBuilderGetOffset, libs, "gdk_memory_texture_builder_get_offset") core.PuregoSafeRegister(&xMemoryTextureBuilderGetStride, libs, "gdk_memory_texture_builder_get_stride") core.PuregoSafeRegister(&xMemoryTextureBuilderGetStrideForPlane, libs, "gdk_memory_texture_builder_get_stride_for_plane") core.PuregoSafeRegister(&xMemoryTextureBuilderGetUpdateRegion, libs, "gdk_memory_texture_builder_get_update_region") core.PuregoSafeRegister(&xMemoryTextureBuilderGetUpdateTexture, libs, "gdk_memory_texture_builder_get_update_texture") core.PuregoSafeRegister(&xMemoryTextureBuilderGetWidth, libs, "gdk_memory_texture_builder_get_width") core.PuregoSafeRegister(&xMemoryTextureBuilderSetBytes, libs, "gdk_memory_texture_builder_set_bytes") core.PuregoSafeRegister(&xMemoryTextureBuilderSetColorState, libs, "gdk_memory_texture_builder_set_color_state") core.PuregoSafeRegister(&xMemoryTextureBuilderSetFormat, libs, "gdk_memory_texture_builder_set_format") core.PuregoSafeRegister(&xMemoryTextureBuilderSetHeight, libs, "gdk_memory_texture_builder_set_height") core.PuregoSafeRegister(&xMemoryTextureBuilderSetOffset, libs, "gdk_memory_texture_builder_set_offset") core.PuregoSafeRegister(&xMemoryTextureBuilderSetStride, libs, "gdk_memory_texture_builder_set_stride") core.PuregoSafeRegister(&xMemoryTextureBuilderSetStrideForPlane, libs, "gdk_memory_texture_builder_set_stride_for_plane") core.PuregoSafeRegister(&xMemoryTextureBuilderSetUpdateRegion, libs, "gdk_memory_texture_builder_set_update_region") core.PuregoSafeRegister(&xMemoryTextureBuilderSetUpdateTexture, libs, "gdk_memory_texture_builder_set_update_texture") core.PuregoSafeRegister(&xMemoryTextureBuilderSetWidth, libs, "gdk_memory_texture_builder_set_width") }