// 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/types" ) // A set of unsigned integers. // // Another name for this data structure is “bitmap”. // // The current implementation is based on [roaring bitmaps](https://roaringbitmap.org/). // // A bitset allows adding a set of integers and provides support for set operations // like unions, intersections and checks for equality or if a value is contained // in the set. `GtkBitset` also contains various functions to query metadata about // the bitset, such as the minimum or maximum values or its size. // // The fastest way to iterate values in a bitset is [struct@Gtk.BitsetIter]. // // The main use case for `GtkBitset` is implementing complex selections for // [iface@Gtk.SelectionModel]. type Bitset struct { _ structs.HostLayout } var xBitsetGLibType func() types.GType func BitsetGLibType() types.GType { return xBitsetGLibType() } func (x *Bitset) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xNewBitsetEmpty func() *Bitset // Creates a new empty bitset. func NewBitsetEmpty() *Bitset { cret := xNewBitsetEmpty() return cret } var xNewBitsetRange func(uint, uint) *Bitset // Creates a bitset with the given range set. func NewBitsetRange(StartVar uint, NItemsVar uint) *Bitset { cret := xNewBitsetRange(StartVar, NItemsVar) return cret } var xBitsetAdd func(uintptr, uint) bool // Adds @value to @self if it wasn't part of it before. func (x *Bitset) Add(ValueVar uint) bool { cret := xBitsetAdd(x.GoPointer(), ValueVar) return cret } var xBitsetAddRange func(uintptr, uint, uint) // Adds all values from @start (inclusive) to @start + @n_items // (exclusive) in @self. func (x *Bitset) AddRange(StartVar uint, NItemsVar uint) { xBitsetAddRange(x.GoPointer(), StartVar, NItemsVar) } var xBitsetAddRangeClosed func(uintptr, uint, uint) // Adds the closed range [@first, @last], so @first, @last and all // values in between. @first must be smaller than @last. func (x *Bitset) AddRangeClosed(FirstVar uint, LastVar uint) { xBitsetAddRangeClosed(x.GoPointer(), FirstVar, LastVar) } var xBitsetAddRectangle func(uintptr, uint, uint, uint, uint) // Interprets the values as a 2-dimensional boolean grid with the given @stride // and inside that grid, adds a rectangle with the given @width and @height. func (x *Bitset) AddRectangle(StartVar uint, WidthVar uint, HeightVar uint, StrideVar uint) { xBitsetAddRectangle(x.GoPointer(), StartVar, WidthVar, HeightVar, StrideVar) } var xBitsetContains func(uintptr, uint) bool // Checks if the given @value has been added to @self func (x *Bitset) Contains(ValueVar uint) bool { cret := xBitsetContains(x.GoPointer(), ValueVar) return cret } var xBitsetCopy func(uintptr) *Bitset // Creates a copy of @self. func (x *Bitset) Copy() *Bitset { cret := xBitsetCopy(x.GoPointer()) return cret } var xBitsetDifference func(uintptr, *Bitset) // Sets @self to be the symmetric difference of @self and @other. // // The symmetric difference is set @self to contain all values that // were either contained in @self or in @other, but not in both. // This operation is also called an XOR. // // It is allowed for @self and @other to be the same bitset. The bitset // will be emptied in that case. func (x *Bitset) Difference(OtherVar *Bitset) { xBitsetDifference(x.GoPointer(), OtherVar) } var xBitsetEquals func(uintptr, *Bitset) bool // Returns %TRUE if @self and @other contain the same values. func (x *Bitset) Equals(OtherVar *Bitset) bool { cret := xBitsetEquals(x.GoPointer(), OtherVar) return cret } var xBitsetGetMaximum func(uintptr) uint // Returns the largest value in @self. // // If @self is empty, 0 is returned. func (x *Bitset) GetMaximum() uint { cret := xBitsetGetMaximum(x.GoPointer()) return cret } var xBitsetGetMinimum func(uintptr) uint // Returns the smallest value in @self. // // If @self is empty, `G_MAXUINT` is returned. func (x *Bitset) GetMinimum() uint { cret := xBitsetGetMinimum(x.GoPointer()) return cret } var xBitsetGetNth func(uintptr, uint) uint // Returns the value of the @nth item in self. // // If @nth is >= the size of @self, 0 is returned. func (x *Bitset) GetNth(NthVar uint) uint { cret := xBitsetGetNth(x.GoPointer(), NthVar) return cret } var xBitsetGetSize func(uintptr) uint64 // Gets the number of values that were added to the set. // // For example, if the set is empty, 0 is returned. // // Note that this function returns a `guint64`, because when all // values are set, the return value is `G_MAXUINT + 1`. Unless you // are sure this cannot happen (it can't with `GListModel`), be sure // to use a 64bit type. func (x *Bitset) GetSize() uint64 { cret := xBitsetGetSize(x.GoPointer()) return cret } var xBitsetGetSizeInRange func(uintptr, uint, uint) uint64 // Gets the number of values that are part of the set from @first to @last // (inclusive). // // Note that this function returns a `guint64`, because when all values are // set, the return value is `G_MAXUINT + 1`. Unless you are sure this cannot // happen (it can't with `GListModel`), be sure to use a 64bit type. func (x *Bitset) GetSizeInRange(FirstVar uint, LastVar uint) uint64 { cret := xBitsetGetSizeInRange(x.GoPointer(), FirstVar, LastVar) return cret } var xBitsetIntersect func(uintptr, *Bitset) // Sets @self to be the intersection of @self and @other. // // In other words, remove all values from @self that are not part of @other. // // It is allowed for @self and @other to be the same bitset. Nothing will // happen in that case. func (x *Bitset) Intersect(OtherVar *Bitset) { xBitsetIntersect(x.GoPointer(), OtherVar) } var xBitsetIsEmpty func(uintptr) bool // Check if no value is contained in bitset. func (x *Bitset) IsEmpty() bool { cret := xBitsetIsEmpty(x.GoPointer()) return cret } var xBitsetRef func(uintptr) *Bitset // Acquires a reference on the given `GtkBitset`. func (x *Bitset) Ref() *Bitset { cret := xBitsetRef(x.GoPointer()) return cret } var xBitsetRemove func(uintptr, uint) bool // Removes @value from @self if it was part of it before. func (x *Bitset) Remove(ValueVar uint) bool { cret := xBitsetRemove(x.GoPointer(), ValueVar) return cret } var xBitsetRemoveAll func(uintptr) // Removes all values from the bitset so that it is empty again. func (x *Bitset) RemoveAll() { xBitsetRemoveAll(x.GoPointer()) } var xBitsetRemoveRange func(uintptr, uint, uint) // Removes all values from @start (inclusive) to @start + @n_items (exclusive) // in @self. func (x *Bitset) RemoveRange(StartVar uint, NItemsVar uint) { xBitsetRemoveRange(x.GoPointer(), StartVar, NItemsVar) } var xBitsetRemoveRangeClosed func(uintptr, uint, uint) // Removes the closed range [@first, @last], so @first, @last and all // values in between. @first must be smaller than @last. func (x *Bitset) RemoveRangeClosed(FirstVar uint, LastVar uint) { xBitsetRemoveRangeClosed(x.GoPointer(), FirstVar, LastVar) } var xBitsetRemoveRectangle func(uintptr, uint, uint, uint, uint) // Interprets the values as a 2-dimensional boolean grid with the given @stride // and inside that grid, removes a rectangle with the given @width and @height. func (x *Bitset) RemoveRectangle(StartVar uint, WidthVar uint, HeightVar uint, StrideVar uint) { xBitsetRemoveRectangle(x.GoPointer(), StartVar, WidthVar, HeightVar, StrideVar) } var xBitsetShiftLeft func(uintptr, uint) // Shifts all values in @self to the left by @amount. // // Values smaller than @amount are discarded. func (x *Bitset) ShiftLeft(AmountVar uint) { xBitsetShiftLeft(x.GoPointer(), AmountVar) } var xBitsetShiftRight func(uintptr, uint) // Shifts all values in @self to the right by @amount. // // Values that end up too large to be held in a #guint are discarded. func (x *Bitset) ShiftRight(AmountVar uint) { xBitsetShiftRight(x.GoPointer(), AmountVar) } var xBitsetSplice func(uintptr, uint, uint, uint) // This is a support function for `GListModel` handling, by mirroring // the `GlistModel::items-changed` signal. // // First, it "cuts" the values from @position to @removed from // the bitset. That is, it removes all those values and shifts // all larger values to the left by @removed places. // // Then, it "pastes" new room into the bitset by shifting all values // larger than @position by @added spaces to the right. This frees // up space that can then be filled. func (x *Bitset) Splice(PositionVar uint, RemovedVar uint, AddedVar uint) { xBitsetSplice(x.GoPointer(), PositionVar, RemovedVar, AddedVar) } var xBitsetSubtract func(uintptr, *Bitset) // Sets @self to be the subtraction of @other from @self. // // In other words, remove all values from @self that are part of @other. // // It is allowed for @self and @other to be the same bitset. The bitset // will be emptied in that case. func (x *Bitset) Subtract(OtherVar *Bitset) { xBitsetSubtract(x.GoPointer(), OtherVar) } var xBitsetUnion func(uintptr, *Bitset) // Sets @self to be the union of @self and @other. // // That is, add all values from @other into @self that weren't part of it. // // It is allowed for @self and @other to be the same bitset. Nothing will // happen in that case. func (x *Bitset) Union(OtherVar *Bitset) { xBitsetUnion(x.GoPointer(), OtherVar) } var xBitsetUnref func(uintptr) // Releases a reference on the given `GtkBitset`. // // If the reference was the last, the resources associated to the @self are // freed. func (x *Bitset) Unref() { xBitsetUnref(x.GoPointer()) } // A CSS style change. type CssStyleChange struct { _ structs.HostLayout } func (x *CssStyleChange) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Provides detailed information on how a scroll operation should be performed. // // Scrolling functions usually allow passing a `NULL` scroll info which will // cause the default values to be used and just scroll the element into view. type ScrollInfo struct { _ structs.HostLayout } var xScrollInfoGLibType func() types.GType func ScrollInfoGLibType() types.GType { return xScrollInfoGLibType() } func (x *ScrollInfo) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xNewScrollInfo func() *ScrollInfo // Creates a new scroll info for scrolling an element into view. func NewScrollInfo() *ScrollInfo { cret := xNewScrollInfo() return cret } var xScrollInfoGetEnableHorizontal func(uintptr) bool // Checks if horizontal scrolling is enabled. func (x *ScrollInfo) GetEnableHorizontal() bool { cret := xScrollInfoGetEnableHorizontal(x.GoPointer()) return cret } var xScrollInfoGetEnableVertical func(uintptr) bool // Checks if vertical scrolling is enabled. func (x *ScrollInfo) GetEnableVertical() bool { cret := xScrollInfoGetEnableVertical(x.GoPointer()) return cret } var xScrollInfoRef func(uintptr) *ScrollInfo // Increases the reference count of a `GtkScrollInfo` by one. func (x *ScrollInfo) Ref() *ScrollInfo { cret := xScrollInfoRef(x.GoPointer()) return cret } var xScrollInfoSetEnableHorizontal func(uintptr, bool) // Turns horizontal scrolling on or off. func (x *ScrollInfo) SetEnableHorizontal(HorizontalVar bool) { xScrollInfoSetEnableHorizontal(x.GoPointer(), HorizontalVar) } var xScrollInfoSetEnableVertical func(uintptr, bool) // Turns vertical scrolling on or off. func (x *ScrollInfo) SetEnableVertical(VerticalVar bool) { xScrollInfoSetEnableVertical(x.GoPointer(), VerticalVar) } var xScrollInfoUnref func(uintptr) // Decreases the reference count of a `GtkScrollInfo` by one. // // If the resulting reference count is zero, frees the self. func (x *ScrollInfo) Unref() { xScrollInfoUnref(x.GoPointer()) } const ( // The value used to refer to a guaranteed invalid position // in a `GListModel`. // // This value may be returned from some functions, others may // accept it as input. Its interpretation may differ for different // functions. // // Refer to each function's documentation for if this value is // allowed and what it does. INVALID_LIST_POSITION uint = 4294967295 ) 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(&xBitsetGLibType, libs, "gtk_bitset_get_type") core.PuregoSafeRegister(&xNewBitsetEmpty, libs, "gtk_bitset_new_empty") core.PuregoSafeRegister(&xNewBitsetRange, libs, "gtk_bitset_new_range") core.PuregoSafeRegister(&xBitsetAdd, libs, "gtk_bitset_add") core.PuregoSafeRegister(&xBitsetAddRange, libs, "gtk_bitset_add_range") core.PuregoSafeRegister(&xBitsetAddRangeClosed, libs, "gtk_bitset_add_range_closed") core.PuregoSafeRegister(&xBitsetAddRectangle, libs, "gtk_bitset_add_rectangle") core.PuregoSafeRegister(&xBitsetContains, libs, "gtk_bitset_contains") core.PuregoSafeRegister(&xBitsetCopy, libs, "gtk_bitset_copy") core.PuregoSafeRegister(&xBitsetDifference, libs, "gtk_bitset_difference") core.PuregoSafeRegister(&xBitsetEquals, libs, "gtk_bitset_equals") core.PuregoSafeRegister(&xBitsetGetMaximum, libs, "gtk_bitset_get_maximum") core.PuregoSafeRegister(&xBitsetGetMinimum, libs, "gtk_bitset_get_minimum") core.PuregoSafeRegister(&xBitsetGetNth, libs, "gtk_bitset_get_nth") core.PuregoSafeRegister(&xBitsetGetSize, libs, "gtk_bitset_get_size") core.PuregoSafeRegister(&xBitsetGetSizeInRange, libs, "gtk_bitset_get_size_in_range") core.PuregoSafeRegister(&xBitsetIntersect, libs, "gtk_bitset_intersect") core.PuregoSafeRegister(&xBitsetIsEmpty, libs, "gtk_bitset_is_empty") core.PuregoSafeRegister(&xBitsetRef, libs, "gtk_bitset_ref") core.PuregoSafeRegister(&xBitsetRemove, libs, "gtk_bitset_remove") core.PuregoSafeRegister(&xBitsetRemoveAll, libs, "gtk_bitset_remove_all") core.PuregoSafeRegister(&xBitsetRemoveRange, libs, "gtk_bitset_remove_range") core.PuregoSafeRegister(&xBitsetRemoveRangeClosed, libs, "gtk_bitset_remove_range_closed") core.PuregoSafeRegister(&xBitsetRemoveRectangle, libs, "gtk_bitset_remove_rectangle") core.PuregoSafeRegister(&xBitsetShiftLeft, libs, "gtk_bitset_shift_left") core.PuregoSafeRegister(&xBitsetShiftRight, libs, "gtk_bitset_shift_right") core.PuregoSafeRegister(&xBitsetSplice, libs, "gtk_bitset_splice") core.PuregoSafeRegister(&xBitsetSubtract, libs, "gtk_bitset_subtract") core.PuregoSafeRegister(&xBitsetUnion, libs, "gtk_bitset_union") core.PuregoSafeRegister(&xBitsetUnref, libs, "gtk_bitset_unref") core.PuregoSafeRegister(&xScrollInfoGLibType, libs, "gtk_scroll_info_get_type") core.PuregoSafeRegister(&xNewScrollInfo, libs, "gtk_scroll_info_new") core.PuregoSafeRegister(&xScrollInfoGetEnableHorizontal, libs, "gtk_scroll_info_get_enable_horizontal") core.PuregoSafeRegister(&xScrollInfoGetEnableVertical, libs, "gtk_scroll_info_get_enable_vertical") core.PuregoSafeRegister(&xScrollInfoRef, libs, "gtk_scroll_info_ref") core.PuregoSafeRegister(&xScrollInfoSetEnableHorizontal, libs, "gtk_scroll_info_set_enable_horizontal") core.PuregoSafeRegister(&xScrollInfoSetEnableVertical, libs, "gtk_scroll_info_set_enable_vertical") core.PuregoSafeRegister(&xScrollInfoUnref, libs, "gtk_scroll_info_unref") }