// 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/gio" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type ColumnViewColumnClass struct { _ structs.HostLayout } func (x *ColumnViewColumnClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Represents the columns in a `GtkColumnView`. // // The main ingredient for a `GtkColumnViewColumn` is the `GtkListItemFactory` // that tells the columnview how to create cells for this column from items in // the model. // // Columns have a title, and can optionally have a header menu set // with [method@Gtk.ColumnViewColumn.set_header_menu]. // // A sorter can be associated with a column using // [method@Gtk.ColumnViewColumn.set_sorter], to let users influence sorting // by clicking on the column header. type ColumnViewColumn struct { gobject.Object } var xColumnViewColumnGLibType func() types.GType func ColumnViewColumnGLibType() types.GType { return xColumnViewColumnGLibType() } func ColumnViewColumnNewFromInternalPtr(ptr uintptr) *ColumnViewColumn { cls := &ColumnViewColumn{} cls.Ptr = ptr return cls } var xNewColumnViewColumn func(uintptr, uintptr) uintptr // Creates a new `GtkColumnViewColumn` that uses the given @factory for // mapping items to widgets. // // You most likely want to call [method@Gtk.ColumnView.append_column] next. // // The function takes ownership of the argument, so you can write code like: // // ```c // column = gtk_column_view_column_new (_("Name"), // // gtk_builder_list_item_factory_new_from_resource ("/name.ui")); // // ``` func NewColumnViewColumn(TitleVar *string, FactoryVar *ListItemFactory) *ColumnViewColumn { var cls *ColumnViewColumn TitleVarPtr := core.GStrdupNullable(TitleVar) defer core.GFreeNullable(TitleVarPtr) cret := xNewColumnViewColumn(TitleVarPtr, FactoryVar.GoPointer()) if cret == 0 { return nil } cls = &ColumnViewColumn{} cls.Ptr = cret return cls } var xColumnViewColumnGetColumnView func(uintptr) uintptr // Gets the column view that's currently displaying this column. // // If @self has not been added to a column view yet, `NULL` is returned. func (x *ColumnViewColumn) GetColumnView() *ColumnView { var cls *ColumnView cret := xColumnViewColumnGetColumnView(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &ColumnView{} cls.Ptr = cret return cls } var xColumnViewColumnGetExpand func(uintptr) bool // Returns whether this column should expand. func (x *ColumnViewColumn) GetExpand() bool { cret := xColumnViewColumnGetExpand(x.GoPointer()) return cret } var xColumnViewColumnGetFactory func(uintptr) uintptr // Gets the factory that's currently used to populate list items // for this column. func (x *ColumnViewColumn) GetFactory() *ListItemFactory { var cls *ListItemFactory cret := xColumnViewColumnGetFactory(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &ListItemFactory{} cls.Ptr = cret return cls } var xColumnViewColumnGetFixedWidth func(uintptr) int // Gets the fixed width of the column. func (x *ColumnViewColumn) GetFixedWidth() int { cret := xColumnViewColumnGetFixedWidth(x.GoPointer()) return cret } var xColumnViewColumnGetHeaderMenu func(uintptr) uintptr // Gets the menu model that is used to create the context menu // for the column header. func (x *ColumnViewColumn) GetHeaderMenu() *gio.MenuModel { var cls *gio.MenuModel cret := xColumnViewColumnGetHeaderMenu(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gio.MenuModel{} cls.Ptr = cret return cls } var xColumnViewColumnGetId func(uintptr) string // Returns the ID set with [method@Gtk.ColumnViewColumn.set_id]. func (x *ColumnViewColumn) GetId() string { cret := xColumnViewColumnGetId(x.GoPointer()) return cret } var xColumnViewColumnGetResizable func(uintptr) bool // Returns whether this column is resizable. func (x *ColumnViewColumn) GetResizable() bool { cret := xColumnViewColumnGetResizable(x.GoPointer()) return cret } var xColumnViewColumnGetSorter func(uintptr) uintptr // Returns the sorter that is associated with the column. func (x *ColumnViewColumn) GetSorter() *Sorter { var cls *Sorter cret := xColumnViewColumnGetSorter(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Sorter{} cls.Ptr = cret return cls } var xColumnViewColumnGetTitle func(uintptr) string // Returns the title set with [method@Gtk.ColumnViewColumn.set_title]. func (x *ColumnViewColumn) GetTitle() string { cret := xColumnViewColumnGetTitle(x.GoPointer()) return cret } var xColumnViewColumnGetVisible func(uintptr) bool // Returns whether this column is visible. func (x *ColumnViewColumn) GetVisible() bool { cret := xColumnViewColumnGetVisible(x.GoPointer()) return cret } var xColumnViewColumnSetExpand func(uintptr, bool) // Sets the column to take available extra space. // // The extra space is shared equally amongst all columns that // have are set to expand. func (x *ColumnViewColumn) SetExpand(ExpandVar bool) { xColumnViewColumnSetExpand(x.GoPointer(), ExpandVar) } var xColumnViewColumnSetFactory func(uintptr, uintptr) // Sets the `GtkListItemFactory` to use for populating list items // for this column. func (x *ColumnViewColumn) SetFactory(FactoryVar *ListItemFactory) { xColumnViewColumnSetFactory(x.GoPointer(), FactoryVar.GoPointer()) } var xColumnViewColumnSetFixedWidth func(uintptr, int) // Sets the fixed width of the column. // // If @fixed_width is -1, the fixed width of the column is unset. // // Setting a fixed width overrides the automatically calculated // width. Interactive resizing also sets the “fixed-width” property. func (x *ColumnViewColumn) SetFixedWidth(FixedWidthVar int) { xColumnViewColumnSetFixedWidth(x.GoPointer(), FixedWidthVar) } var xColumnViewColumnSetHeaderMenu func(uintptr, uintptr) // Sets the menu model that is used to create the context menu // for the column header. func (x *ColumnViewColumn) SetHeaderMenu(MenuVar *gio.MenuModel) { xColumnViewColumnSetHeaderMenu(x.GoPointer(), MenuVar.GoPointer()) } var xColumnViewColumnSetId func(uintptr, uintptr) // Sets the id of this column. // // GTK makes no use of this, but applications can use it when // storing column view configuration. // // It is up to callers to ensure uniqueness of IDs. func (x *ColumnViewColumn) SetId(IdVar *string) { IdVarPtr := core.GStrdupNullable(IdVar) defer core.GFreeNullable(IdVarPtr) xColumnViewColumnSetId(x.GoPointer(), IdVarPtr) } var xColumnViewColumnSetResizable func(uintptr, bool) // Sets whether this column should be resizable by dragging. func (x *ColumnViewColumn) SetResizable(ResizableVar bool) { xColumnViewColumnSetResizable(x.GoPointer(), ResizableVar) } var xColumnViewColumnSetSorter func(uintptr, uintptr) // Associates a sorter with the column. // // If @sorter is unset, the column will not let users change // the sorting by clicking on its header. // // This sorter can be made active by clicking on the column // header, or by calling [method@Gtk.ColumnView.sort_by_column]. // // See [method@Gtk.ColumnView.get_sorter] for the necessary steps // for setting up customizable sorting for [class@Gtk.ColumnView]. func (x *ColumnViewColumn) SetSorter(SorterVar *Sorter) { xColumnViewColumnSetSorter(x.GoPointer(), SorterVar.GoPointer()) } var xColumnViewColumnSetTitle func(uintptr, uintptr) // Sets the title of this column. // // The title is displayed in the header of a `GtkColumnView` // for this column and is therefore user-facing text that should // be translated. func (x *ColumnViewColumn) SetTitle(TitleVar *string) { TitleVarPtr := core.GStrdupNullable(TitleVar) defer core.GFreeNullable(TitleVarPtr) xColumnViewColumnSetTitle(x.GoPointer(), TitleVarPtr) } var xColumnViewColumnSetVisible func(uintptr, bool) // Sets whether this column should be visible in views. func (x *ColumnViewColumn) SetVisible(VisibleVar bool) { xColumnViewColumnSetVisible(x.GoPointer(), VisibleVar) } func (c *ColumnViewColumn) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *ColumnViewColumn) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyExpand sets the "expand" property. // Column gets share of extra width allocated to the view. func (x *ColumnViewColumn) SetPropertyExpand(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("expand", &v) } // GetPropertyExpand gets the "expand" property. // Column gets share of extra width allocated to the view. func (x *ColumnViewColumn) GetPropertyExpand() bool { var v gobject.Value x.GetProperty("expand", &v) return v.GetBoolean() } // SetPropertyFixedWidth sets the "fixed-width" property. // If not -1, this is the width that the column is allocated, // regardless of the size of its content. func (x *ColumnViewColumn) SetPropertyFixedWidth(value int) { var v gobject.Value v.Init(gobject.TypeIntVal) v.SetInt(value) x.SetProperty("fixed-width", &v) } // GetPropertyFixedWidth gets the "fixed-width" property. // If not -1, this is the width that the column is allocated, // regardless of the size of its content. func (x *ColumnViewColumn) GetPropertyFixedWidth() int { var v gobject.Value x.GetProperty("fixed-width", &v) return v.GetInt() } // SetPropertyId sets the "id" property. // An ID for the column. // // GTK is not currently using the ID for anything, but // it can be used by applications when saving column view // configurations. // // It is up to applications to ensure uniqueness of IDs. func (x *ColumnViewColumn) SetPropertyId(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("id", &v) } // GetPropertyId gets the "id" property. // An ID for the column. // // GTK is not currently using the ID for anything, but // it can be used by applications when saving column view // configurations. // // It is up to applications to ensure uniqueness of IDs. func (x *ColumnViewColumn) GetPropertyId() string { var v gobject.Value x.GetProperty("id", &v) return v.GetString() } // SetPropertyResizable sets the "resizable" property. // Whether this column is resizable. func (x *ColumnViewColumn) SetPropertyResizable(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("resizable", &v) } // GetPropertyResizable gets the "resizable" property. // Whether this column is resizable. func (x *ColumnViewColumn) GetPropertyResizable() bool { var v gobject.Value x.GetProperty("resizable", &v) return v.GetBoolean() } // SetPropertyTitle sets the "title" property. // Title displayed in the header. func (x *ColumnViewColumn) SetPropertyTitle(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("title", &v) } // GetPropertyTitle gets the "title" property. // Title displayed in the header. func (x *ColumnViewColumn) GetPropertyTitle() string { var v gobject.Value x.GetProperty("title", &v) return v.GetString() } // SetPropertyVisible sets the "visible" property. // Whether this column is visible. func (x *ColumnViewColumn) SetPropertyVisible(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("visible", &v) } // GetPropertyVisible gets the "visible" property. // Whether this column is visible. func (x *ColumnViewColumn) GetPropertyVisible() bool { var v gobject.Value x.GetProperty("visible", &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(&xColumnViewColumnGLibType, libs, "gtk_column_view_column_get_type") core.PuregoSafeRegister(&xNewColumnViewColumn, libs, "gtk_column_view_column_new") core.PuregoSafeRegister(&xColumnViewColumnGetColumnView, libs, "gtk_column_view_column_get_column_view") core.PuregoSafeRegister(&xColumnViewColumnGetExpand, libs, "gtk_column_view_column_get_expand") core.PuregoSafeRegister(&xColumnViewColumnGetFactory, libs, "gtk_column_view_column_get_factory") core.PuregoSafeRegister(&xColumnViewColumnGetFixedWidth, libs, "gtk_column_view_column_get_fixed_width") core.PuregoSafeRegister(&xColumnViewColumnGetHeaderMenu, libs, "gtk_column_view_column_get_header_menu") core.PuregoSafeRegister(&xColumnViewColumnGetId, libs, "gtk_column_view_column_get_id") core.PuregoSafeRegister(&xColumnViewColumnGetResizable, libs, "gtk_column_view_column_get_resizable") core.PuregoSafeRegister(&xColumnViewColumnGetSorter, libs, "gtk_column_view_column_get_sorter") core.PuregoSafeRegister(&xColumnViewColumnGetTitle, libs, "gtk_column_view_column_get_title") core.PuregoSafeRegister(&xColumnViewColumnGetVisible, libs, "gtk_column_view_column_get_visible") core.PuregoSafeRegister(&xColumnViewColumnSetExpand, libs, "gtk_column_view_column_set_expand") core.PuregoSafeRegister(&xColumnViewColumnSetFactory, libs, "gtk_column_view_column_set_factory") core.PuregoSafeRegister(&xColumnViewColumnSetFixedWidth, libs, "gtk_column_view_column_set_fixed_width") core.PuregoSafeRegister(&xColumnViewColumnSetHeaderMenu, libs, "gtk_column_view_column_set_header_menu") core.PuregoSafeRegister(&xColumnViewColumnSetId, libs, "gtk_column_view_column_set_id") core.PuregoSafeRegister(&xColumnViewColumnSetResizable, libs, "gtk_column_view_column_set_resizable") core.PuregoSafeRegister(&xColumnViewColumnSetSorter, libs, "gtk_column_view_column_set_sorter") core.PuregoSafeRegister(&xColumnViewColumnSetTitle, libs, "gtk_column_view_column_set_title") core.PuregoSafeRegister(&xColumnViewColumnSetVisible, libs, "gtk_column_view_column_set_visible") }