class Gtk::Bitset

Overview

A Gtk::Bitset 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. Gtk::Bitset 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 Gtk::BitsetIter.

The main use case for Gtk::Bitset is implementing complex selections for Gtk::SelectionModel.

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/bitset.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(pointer : Pointer(Void), transfer : GICrystal::Transfer) #

[View source]
def self.new_range(start : UInt32, n_items : UInt32) : self #

[View source]

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


[View source]

Instance Method Detail

def add(value : UInt32) : Bool #

[View source]
def add_range(start : UInt32, n_items : UInt32) : Nil #

[View source]
def add_range_closed(first : UInt32, last : UInt32) : Nil #

[View source]
def add_rectangle(start : UInt32, width : UInt32, height : UInt32, stride : UInt32) : Nil #

[View source]
def contains(value : UInt32) : Bool #

[View source]
def copy : Gtk::Bitset #

[View source]
def difference(other : Gtk::Bitset) : Nil #

[View source]
def equals(other : Gtk::Bitset) : Bool #

[View source]
def finalize #

[View source]
def intersect(other : Gtk::Bitset) : Nil #

[View source]
def is_empty : Bool #

[View source]
def maximum : UInt32 #

[View source]
def minimum : UInt32 #

[View source]
def nth(nth : UInt32) : UInt32 #

[View source]
def ref : Gtk::Bitset #

[View source]
def remove(value : UInt32) : Bool #

[View source]
def remove_all : Nil #

[View source]
def remove_range(start : UInt32, n_items : UInt32) : Nil #

[View source]
def remove_range_closed(first : UInt32, last : UInt32) : Nil #

[View source]
def remove_rectangle(start : UInt32, width : UInt32, height : UInt32, stride : UInt32) : Nil #

[View source]
def shift_left(amount : UInt32) : Nil #

[View source]
def shift_right(amount : UInt32) : Nil #

[View source]
def size : UInt64 #

[View source]
def size_in_range(first : UInt32, last : UInt32) : UInt64 #

[View source]
def splice(position : UInt32, removed : UInt32, added : UInt32) : Nil #

[View source]
def subtract(other : Gtk::Bitset) : Nil #

[View source]
def to_unsafe : Pointer(Void) #

[View source]
def union(other : Gtk::Bitset) : Nil #

[View source]
def unref : Nil #

[View source]