// 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 ColumnViewCellClass struct { _ structs.HostLayout } func (x *ColumnViewCellClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Represents items in a cell in [class@Gtk.ColumnView]. // // The `GtkColumnViewCell`s are managed by the [class@Gtk.ColumnView] // widget (with its factory) and cannot be created by applications, but // they need to be populated by application code. This is done by calling // [method@Gtk.ColumnViewCell.set_child]. // // `GtkColumnViewCell`s exist in 2 stages: // // 1. The unbound stage where the listitem is not currently connected to // an item in the list. In that case, the [property@Gtk.ColumnViewCell:item] // property is set to %NULL. // // 2. The bound stage where the listitem references an item from the list. // The [property@Gtk.ColumnViewCell:item] property is not %NULL. type ColumnViewCell struct { ListItem } var xColumnViewCellGLibType func() types.GType func ColumnViewCellGLibType() types.GType { return xColumnViewCellGLibType() } func ColumnViewCellNewFromInternalPtr(ptr uintptr) *ColumnViewCell { cls := &ColumnViewCell{} cls.Ptr = ptr return cls } var xColumnViewCellGetChild func(uintptr) uintptr // Gets the child previously set via gtk_column_view_cell_set_child() or // %NULL if none was set. func (x *ColumnViewCell) GetChild() *Widget { var cls *Widget cret := xColumnViewCellGetChild(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xColumnViewCellGetFocusable func(uintptr) bool // Checks if a list item has been set to be focusable via // gtk_column_view_cell_set_focusable(). func (x *ColumnViewCell) GetFocusable() bool { cret := xColumnViewCellGetFocusable(x.GoPointer()) return cret } var xColumnViewCellGetItem func(uintptr) uintptr // Gets the model item that associated with @self. // // If @self is unbound, this function returns %NULL. func (x *ColumnViewCell) GetItem() *gobject.Object { var cls *gobject.Object cret := xColumnViewCellGetItem(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gobject.Object{} cls.Ptr = cret return cls } var xColumnViewCellGetPosition func(uintptr) uint // Gets the position in the model that @self currently displays. // // If @self is unbound, %GTK_INVALID_LIST_POSITION is returned. func (x *ColumnViewCell) GetPosition() uint { cret := xColumnViewCellGetPosition(x.GoPointer()) return cret } var xColumnViewCellGetSelected func(uintptr) bool // Checks if the item is displayed as selected. // // The selected state is maintained by the list widget and its model // and cannot be set otherwise. func (x *ColumnViewCell) GetSelected() bool { cret := xColumnViewCellGetSelected(x.GoPointer()) return cret } var xColumnViewCellSetChild func(uintptr, uintptr) // Sets the child to be used for this listitem. // // This function is typically called by applications when // setting up a listitem so that the widget can be reused when // binding it multiple times. func (x *ColumnViewCell) SetChild(ChildVar *Widget) { xColumnViewCellSetChild(x.GoPointer(), ChildVar.GoPointer()) } var xColumnViewCellSetFocusable func(uintptr, bool) // Sets @self to be focusable. // // If an item is focusable, it can be focused using the keyboard. // This works similar to [method@Gtk.Widget.set_focusable]. // // Note that if items are not focusable, the keyboard cannot be used to activate // them and selecting only works if one of the listitem's children is focusable. // // By default, list items are focusable. func (x *ColumnViewCell) SetFocusable(FocusableVar bool) { xColumnViewCellSetFocusable(x.GoPointer(), FocusableVar) } func (c *ColumnViewCell) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *ColumnViewCell) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyFocusable sets the "focusable" property. // If the item can be focused with the keyboard. func (x *ColumnViewCell) SetPropertyFocusable(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("focusable", &v) } // GetPropertyFocusable gets the "focusable" property. // If the item can be focused with the keyboard. func (x *ColumnViewCell) GetPropertyFocusable() bool { var v gobject.Value x.GetProperty("focusable", &v) return v.GetBoolean() } // GetPropertyPosition gets the "position" property. // Position of the item. func (x *ColumnViewCell) GetPropertyPosition() uint { var v gobject.Value x.GetProperty("position", &v) return v.GetUint() } // GetPropertySelected gets the "selected" property. // If the item is currently selected. func (x *ColumnViewCell) GetPropertySelected() bool { var v gobject.Value x.GetProperty("selected", &v) return v.GetBoolean() } 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(&xColumnViewCellGLibType, libs, "gtk_column_view_cell_get_type") core.PuregoSafeRegister(&xColumnViewCellGetChild, libs, "gtk_column_view_cell_get_child") core.PuregoSafeRegister(&xColumnViewCellGetFocusable, libs, "gtk_column_view_cell_get_focusable") core.PuregoSafeRegister(&xColumnViewCellGetItem, libs, "gtk_column_view_cell_get_item") core.PuregoSafeRegister(&xColumnViewCellGetPosition, libs, "gtk_column_view_cell_get_position") core.PuregoSafeRegister(&xColumnViewCellGetSelected, libs, "gtk_column_view_cell_get_selected") core.PuregoSafeRegister(&xColumnViewCellSetChild, libs, "gtk_column_view_cell_set_child") core.PuregoSafeRegister(&xColumnViewCellSetFocusable, libs, "gtk_column_view_cell_set_focusable") }