// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type TextChildAnchorClass struct { _ structs.HostLayout ParentClass gobject.ObjectClass xGtkReserved1 uintptr xGtkReserved2 uintptr xGtkReserved3 uintptr xGtkReserved4 uintptr } func (x *TextChildAnchorClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // OverrideGtkReserved1 sets the "_gtk_reserved1" callback function. func (x *TextChildAnchorClass) OverrideGtkReserved1(cb func()) { if cb == nil { x.xGtkReserved1 = 0 } else { x.xGtkReserved1 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved1 gets the "_gtk_reserved1" callback function. func (x *TextChildAnchorClass) GetGtkReserved1() func() { if x.xGtkReserved1 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved1) return func() { rawCallback() } } // OverrideGtkReserved2 sets the "_gtk_reserved2" callback function. func (x *TextChildAnchorClass) OverrideGtkReserved2(cb func()) { if cb == nil { x.xGtkReserved2 = 0 } else { x.xGtkReserved2 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved2 gets the "_gtk_reserved2" callback function. func (x *TextChildAnchorClass) GetGtkReserved2() func() { if x.xGtkReserved2 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved2) return func() { rawCallback() } } // OverrideGtkReserved3 sets the "_gtk_reserved3" callback function. func (x *TextChildAnchorClass) OverrideGtkReserved3(cb func()) { if cb == nil { x.xGtkReserved3 = 0 } else { x.xGtkReserved3 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved3 gets the "_gtk_reserved3" callback function. func (x *TextChildAnchorClass) GetGtkReserved3() func() { if x.xGtkReserved3 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved3) return func() { rawCallback() } } // OverrideGtkReserved4 sets the "_gtk_reserved4" callback function. func (x *TextChildAnchorClass) OverrideGtkReserved4(cb func()) { if cb == nil { x.xGtkReserved4 = 0 } else { x.xGtkReserved4 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved4 gets the "_gtk_reserved4" callback function. func (x *TextChildAnchorClass) GetGtkReserved4() func() { if x.xGtkReserved4 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved4) return func() { rawCallback() } } // Marks a spot in a `GtkTextBuffer` where child widgets can be “anchored”. // // The anchor can have multiple widgets anchored, to allow for multiple views. type TextChildAnchor struct { gobject.Object } var xTextChildAnchorGLibType func() types.GType func TextChildAnchorGLibType() types.GType { return xTextChildAnchorGLibType() } func TextChildAnchorNewFromInternalPtr(ptr uintptr) *TextChildAnchor { cls := &TextChildAnchor{} cls.Ptr = ptr return cls } var xNewTextChildAnchor func() uintptr // Creates a new `GtkTextChildAnchor`. // // Usually you would then insert it into a `GtkTextBuffer` with // [method@Gtk.TextBuffer.insert_child_anchor]. To perform the // creation and insertion in one step, use the convenience // function [method@Gtk.TextBuffer.create_child_anchor]. func NewTextChildAnchor() *TextChildAnchor { var cls *TextChildAnchor cret := xNewTextChildAnchor() if cret == 0 { return nil } cls = &TextChildAnchor{} cls.Ptr = cret return cls } var xNewTextChildAnchorWithReplacement func(string) uintptr // Creates a new `GtkTextChildAnchor` with the given replacement character. // // Usually you would then insert it into a `GtkTextBuffer` with // [method@Gtk.TextBuffer.insert_child_anchor]. func NewTextChildAnchorWithReplacement(CharacterVar string) *TextChildAnchor { var cls *TextChildAnchor cret := xNewTextChildAnchorWithReplacement(CharacterVar) if cret == 0 { return nil } cls = &TextChildAnchor{} cls.Ptr = cret return cls } var xTextChildAnchorGetDeleted func(uintptr) bool // Determines whether a child anchor has been deleted from // the buffer. // // Keep in mind that the child anchor will be unreferenced // when removed from the buffer, so you need to hold your own // reference (with g_object_ref()) if you plan to use this // function — otherwise all deleted child anchors will also // be finalized. func (x *TextChildAnchor) GetDeleted() bool { cret := xTextChildAnchorGetDeleted(x.GoPointer()) return cret } var xTextChildAnchorGetWidgets func(uintptr, *uint) uintptr // Gets a list of all widgets anchored at this child anchor. // // The order in which the widgets are returned is not defined. func (x *TextChildAnchor) GetWidgets(OutLenVar *uint) uintptr { cret := xTextChildAnchorGetWidgets(x.GoPointer(), OutLenVar) return cret } func (c *TextChildAnchor) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *TextChildAnchor) SetGoPointer(ptr uintptr) { c.Ptr = ptr } func init() { core.SetPackageName("GTK", "gtk4") core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GTK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xTextChildAnchorGLibType, libs, "gtk_text_child_anchor_get_type") core.PuregoSafeRegister(&xNewTextChildAnchor, libs, "gtk_text_child_anchor_new") core.PuregoSafeRegister(&xNewTextChildAnchorWithReplacement, libs, "gtk_text_child_anchor_new_with_replacement") core.PuregoSafeRegister(&xTextChildAnchorGetDeleted, libs, "gtk_text_child_anchor_get_deleted") core.PuregoSafeRegister(&xTextChildAnchorGetWidgets, libs, "gtk_text_child_anchor_get_widgets") }