// 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 StringSorterClass struct { _ structs.HostLayout ParentClass SorterClass } func (x *StringSorterClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Describes how a [class@Gtk.StringSorter] turns strings into sort keys to // compare them. // // Note that the result of sorting will in general depend on the current locale // unless the mode is @GTK_COLLATION_NONE. type Collation int var xCollationGLibType func() types.GType func CollationGLibType() types.GType { return xCollationGLibType() } const ( // Don't do any collation CollationNoneValue Collation = 0 // Use [func@GLib.utf8_collate_key] CollationUnicodeValue Collation = 1 // Use [func@GLib.utf8_collate_key_for_filename] CollationFilenameValue Collation = 2 ) // Sorts items by comparing strings. // // To obtain the strings to compare, this sorter evaluates a // [class@Gtk.Expression]. // // It does the comparison in a linguistically correct way using the // current locale by normalizing Unicode strings and possibly case-folding // them before performing the comparison. type StringSorter struct { Sorter } var xStringSorterGLibType func() types.GType func StringSorterGLibType() types.GType { return xStringSorterGLibType() } func StringSorterNewFromInternalPtr(ptr uintptr) *StringSorter { cls := &StringSorter{} cls.Ptr = ptr return cls } var xNewStringSorter func(uintptr) uintptr // Creates a new string sorter that compares items using the given // @expression. // // Unless an expression is set on it, this sorter will always // compare items as invalid. func NewStringSorter(ExpressionVar *Expression) *StringSorter { var cls *StringSorter cret := xNewStringSorter(ExpressionVar.GoPointer()) if cret == 0 { return nil } cls = &StringSorter{} cls.Ptr = cret return cls } var xStringSorterGetCollation func(uintptr) Collation // Gets which collation method the sorter uses. func (x *StringSorter) GetCollation() Collation { cret := xStringSorterGetCollation(x.GoPointer()) return cret } var xStringSorterGetExpression func(uintptr) uintptr // Gets the expression that is evaluated to obtain strings from items. func (x *StringSorter) GetExpression() *Expression { var cls *Expression cret := xStringSorterGetExpression(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Expression{} cls.Ptr = cret return cls } var xStringSorterGetIgnoreCase func(uintptr) bool // Gets whether the sorter ignores case differences. func (x *StringSorter) GetIgnoreCase() bool { cret := xStringSorterGetIgnoreCase(x.GoPointer()) return cret } var xStringSorterSetCollation func(uintptr, Collation) // Sets the collation method to use for sorting. func (x *StringSorter) SetCollation(CollationVar Collation) { xStringSorterSetCollation(x.GoPointer(), CollationVar) } var xStringSorterSetExpression func(uintptr, uintptr) // Sets the expression that is evaluated to obtain strings from items. // // The expression must have the type %G_TYPE_STRING. func (x *StringSorter) SetExpression(ExpressionVar *Expression) { xStringSorterSetExpression(x.GoPointer(), ExpressionVar.GoPointer()) } var xStringSorterSetIgnoreCase func(uintptr, bool) // Sets whether the sorter will ignore case differences. func (x *StringSorter) SetIgnoreCase(IgnoreCaseVar bool) { xStringSorterSetIgnoreCase(x.GoPointer(), IgnoreCaseVar) } func (c *StringSorter) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *StringSorter) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyIgnoreCase sets the "ignore-case" property. // If sorting is case sensitive. func (x *StringSorter) SetPropertyIgnoreCase(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("ignore-case", &v) } // GetPropertyIgnoreCase gets the "ignore-case" property. // If sorting is case sensitive. func (x *StringSorter) GetPropertyIgnoreCase() bool { var v gobject.Value x.GetProperty("ignore-case", &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(&xCollationGLibType, libs, "gtk_collation_get_type") core.PuregoSafeRegister(&xStringSorterGLibType, libs, "gtk_string_sorter_get_type") core.PuregoSafeRegister(&xNewStringSorter, libs, "gtk_string_sorter_new") core.PuregoSafeRegister(&xStringSorterGetCollation, libs, "gtk_string_sorter_get_collation") core.PuregoSafeRegister(&xStringSorterGetExpression, libs, "gtk_string_sorter_get_expression") core.PuregoSafeRegister(&xStringSorterGetIgnoreCase, libs, "gtk_string_sorter_get_ignore_case") core.PuregoSafeRegister(&xStringSorterSetCollation, libs, "gtk_string_sorter_set_collation") core.PuregoSafeRegister(&xStringSorterSetExpression, libs, "gtk_string_sorter_set_expression") core.PuregoSafeRegister(&xStringSorterSetIgnoreCase, libs, "gtk_string_sorter_set_ignore_case") }