Struct
GtkBitset
Description [src]
struct GtkBitset {
/* No available fields */
}
A GtkBitset
represents a set of unsigned integers.
Another name for this data structure is “bitmap”.
The current implementation is based on roaring bitmaps.
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 GtkBitsetIter
.
The main use case for GtkBitset
is implementing complex selections for
GtkSelectionModel
.
Instance methods
gtk_bitset_add_range_closed
Adds the closed range [first
, last
], so first
, last
and all
values in between. first
must be smaller than last
.
gtk_bitset_add_rectangle
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
.
gtk_bitset_get_size_in_range
Gets the number of values that are part of the set from first
to last
(inclusive).
gtk_bitset_remove_range
Removes all values from start
(inclusive) to start
+ n_items
(exclusive)
in self
.
gtk_bitset_remove_range_closed
Removes the closed range [first
, last
], so first
, last
and all
values in between. first
must be smaller than last
.
gtk_bitset_remove_rectangle
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
.
gtk_bitset_splice
This is a support function for GListModel
handling, by mirroring
the GlistModel::items-changed
signal.