// 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 ColumnViewSorterClass struct { _ structs.HostLayout ParentClass SorterClass } func (x *ColumnViewSorterClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Sorts [class@Gtk.ColumnView] columns. // // The sorter returned by [method@Gtk.ColumnView.get_sorter] is // a `GtkColumnViewSorter`. // // In column views, sorting can be configured by associating // sorters with columns, and users can invert sort order by clicking // on column headers. The API of `GtkColumnViewSorter` is designed // to allow saving and restoring this configuration. // // If you are only interested in the primary sort column (i.e. the // column where a sort indicator is shown in the header), then // you can just look at [property@Gtk.ColumnViewSorter:primary-sort-column] // and [property@Gtk.ColumnViewSorter:primary-sort-order]. // // If you want to store the full sort configuration, including // secondary sort columns that are used for tie breaking, then // you can use [method@Gtk.ColumnViewSorter.get_nth_sort_column]. // To get notified about changes, use [signal@Gtk.Sorter::changed]. // // To restore a saved sort configuration on a `GtkColumnView`, // use code like: // // ``` // sorter = gtk_column_view_get_sorter (view); // for (i = gtk_column_view_sorter_get_n_sort_columns (sorter) - 1; i >= 0; i--) // // { // column = gtk_column_view_sorter_get_nth_sort_column (sorter, i, &order); // gtk_column_view_sort_by_column (view, column, order); // } // // ``` type ColumnViewSorter struct { Sorter } var xColumnViewSorterGLibType func() types.GType func ColumnViewSorterGLibType() types.GType { return xColumnViewSorterGLibType() } func ColumnViewSorterNewFromInternalPtr(ptr uintptr) *ColumnViewSorter { cls := &ColumnViewSorter{} cls.Ptr = ptr return cls } var xColumnViewSorterGetNSortColumns func(uintptr) uint // Returns the number of columns by which the sorter sorts. // // If the sorter of the primary sort column does not determine // a total order, then the secondary sorters are consulted to // break the ties. // // Use the [signal@Gtk.Sorter::changed] signal to get notified // when the number of sort columns changes. func (x *ColumnViewSorter) GetNSortColumns() uint { cret := xColumnViewSorterGetNSortColumns(x.GoPointer()) return cret } var xColumnViewSorterGetNthSortColumn func(uintptr, uint, *SortType) uintptr // Gets the @position'th sort column and its associated sort order. // // Use the [signal@Gtk.Sorter::changed] signal to get notified // when sort columns change. func (x *ColumnViewSorter) GetNthSortColumn(PositionVar uint, SortOrderVar *SortType) *ColumnViewColumn { var cls *ColumnViewColumn cret := xColumnViewSorterGetNthSortColumn(x.GoPointer(), PositionVar, SortOrderVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &ColumnViewColumn{} cls.Ptr = cret return cls } var xColumnViewSorterGetPrimarySortColumn func(uintptr) uintptr // Returns the primary sort column. // // The primary sort column is the one that displays the triangle // in a column view header. func (x *ColumnViewSorter) GetPrimarySortColumn() *ColumnViewColumn { var cls *ColumnViewColumn cret := xColumnViewSorterGetPrimarySortColumn(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &ColumnViewColumn{} cls.Ptr = cret return cls } var xColumnViewSorterGetPrimarySortOrder func(uintptr) SortType // Returns the primary sort order. // // The primary sort order determines whether the triangle displayed // in the column view header of the primary sort column points upwards // or downwards. // // If there is no primary sort column, then this function returns // `GTK_SORT_ASCENDING`. func (x *ColumnViewSorter) GetPrimarySortOrder() SortType { cret := xColumnViewSorterGetPrimarySortOrder(x.GoPointer()) return cret } func (c *ColumnViewSorter) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *ColumnViewSorter) 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(&xColumnViewSorterGLibType, libs, "gtk_column_view_sorter_get_type") core.PuregoSafeRegister(&xColumnViewSorterGetNSortColumns, libs, "gtk_column_view_sorter_get_n_sort_columns") core.PuregoSafeRegister(&xColumnViewSorterGetNthSortColumn, libs, "gtk_column_view_sorter_get_nth_sort_column") core.PuregoSafeRegister(&xColumnViewSorterGetPrimarySortColumn, libs, "gtk_column_view_sorter_get_primary_sort_column") core.PuregoSafeRegister(&xColumnViewSorterGetPrimarySortOrder, libs, "gtk_column_view_sorter_get_primary_sort_order") }