// 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 ListHeaderClass struct { _ structs.HostLayout } func (x *ListHeaderClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Used by list widgets to represent the headers they display. // // `GtkListHeader` objects are managed just like [class@Gtk.ListItem] // objects via their factory, but provide a different set of properties suitable // for managing the header instead of individual items. type ListHeader struct { gobject.Object } var xListHeaderGLibType func() types.GType func ListHeaderGLibType() types.GType { return xListHeaderGLibType() } func ListHeaderNewFromInternalPtr(ptr uintptr) *ListHeader { cls := &ListHeader{} cls.Ptr = ptr return cls } var xListHeaderGetChild func(uintptr) uintptr // Gets the child previously set via gtk_list_header_set_child() or // %NULL if none was set. func (x *ListHeader) GetChild() *Widget { var cls *Widget cret := xListHeaderGetChild(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xListHeaderGetEnd func(uintptr) uint // Gets the end position in the model of the section that @self is // currently the header for. // // If @self is unbound, %GTK_INVALID_LIST_POSITION is returned. func (x *ListHeader) GetEnd() uint { cret := xListHeaderGetEnd(x.GoPointer()) return cret } var xListHeaderGetItem func(uintptr) uintptr // Gets the model item at the start of the section. // This is the item that occupies the list model at position // [property@Gtk.ListHeader:start]. // // If @self is unbound, this function returns %NULL. func (x *ListHeader) GetItem() *gobject.Object { var cls *gobject.Object cret := xListHeaderGetItem(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gobject.Object{} cls.Ptr = cret return cls } var xListHeaderGetNItems func(uintptr) uint // Gets the the number of items in the section. // // If @self is unbound, 0 is returned. func (x *ListHeader) GetNItems() uint { cret := xListHeaderGetNItems(x.GoPointer()) return cret } var xListHeaderGetStart func(uintptr) uint // Gets the start position in the model of the section that @self is // currently the header for. // // If @self is unbound, %GTK_INVALID_LIST_POSITION is returned. func (x *ListHeader) GetStart() uint { cret := xListHeaderGetStart(x.GoPointer()) return cret } var xListHeaderSetChild func(uintptr, uintptr) // Sets the child to be used for this listitem. // // This function is typically called by applications when // setting up a header so that the widget can be reused when // binding it multiple times. func (x *ListHeader) SetChild(ChildVar *Widget) { xListHeaderSetChild(x.GoPointer(), ChildVar.GoPointer()) } func (c *ListHeader) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *ListHeader) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // GetPropertyEnd gets the "end" property. // The first position no longer part of this section. func (x *ListHeader) GetPropertyEnd() uint { var v gobject.Value x.GetProperty("end", &v) return v.GetUint() } // GetPropertyNItems gets the "n-items" property. // Number of items in this section. func (x *ListHeader) GetPropertyNItems() uint { var v gobject.Value x.GetProperty("n-items", &v) return v.GetUint() } // GetPropertyStart gets the "start" property. // First position of items in this section. func (x *ListHeader) GetPropertyStart() uint { var v gobject.Value x.GetProperty("start", &v) return v.GetUint() } 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(&xListHeaderGLibType, libs, "gtk_list_header_get_type") core.PuregoSafeRegister(&xListHeaderGetChild, libs, "gtk_list_header_get_child") core.PuregoSafeRegister(&xListHeaderGetEnd, libs, "gtk_list_header_get_end") core.PuregoSafeRegister(&xListHeaderGetItem, libs, "gtk_list_header_get_item") core.PuregoSafeRegister(&xListHeaderGetNItems, libs, "gtk_list_header_get_n_items") core.PuregoSafeRegister(&xListHeaderGetStart, libs, "gtk_list_header_get_start") core.PuregoSafeRegister(&xListHeaderSetChild, libs, "gtk_list_header_set_child") }