1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::translate::*;

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct Bitset(Shared<ffi::GtkBitset>);

    match fn {
        ref => |ptr| ffi::gtk_bitset_ref(ptr),
        unref => |ptr| ffi::gtk_bitset_unref(ptr),
        type_ => || ffi::gtk_bitset_get_type(),
    }
}

impl Bitset {
    #[doc(alias = "gtk_bitset_new_empty")]
    pub fn new_empty() -> Bitset {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::gtk_bitset_new_empty()) }
    }

    #[doc(alias = "gtk_bitset_new_range")]
    pub fn new_range(start: u32, n_items: u32) -> Bitset {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::gtk_bitset_new_range(start, n_items)) }
    }

    #[doc(alias = "gtk_bitset_add")]
    pub fn add(&self, value: u32) -> bool {
        unsafe { from_glib(ffi::gtk_bitset_add(self.to_glib_none().0, value)) }
    }

    #[doc(alias = "gtk_bitset_add_range")]
    pub fn add_range(&self, start: u32, n_items: u32) {
        unsafe {
            ffi::gtk_bitset_add_range(self.to_glib_none().0, start, n_items);
        }
    }

    #[doc(alias = "gtk_bitset_add_range_closed")]
    pub fn add_range_closed(&self, first: u32, last: u32) {
        unsafe {
            ffi::gtk_bitset_add_range_closed(self.to_glib_none().0, first, last);
        }
    }

    #[doc(alias = "gtk_bitset_add_rectangle")]
    pub fn add_rectangle(&self, start: u32, width: u32, height: u32, stride: u32) {
        unsafe {
            ffi::gtk_bitset_add_rectangle(self.to_glib_none().0, start, width, height, stride);
        }
    }

    #[doc(alias = "gtk_bitset_contains")]
    pub fn contains(&self, value: u32) -> bool {
        unsafe { from_glib(ffi::gtk_bitset_contains(self.to_glib_none().0, value)) }
    }

    #[doc(alias = "gtk_bitset_copy")]
    #[must_use]
    pub fn copy(&self) -> Bitset {
        unsafe { from_glib_full(ffi::gtk_bitset_copy(self.to_glib_none().0)) }
    }

    #[doc(alias = "gtk_bitset_difference")]
    pub fn difference(&self, other: &Bitset) {
        unsafe {
            ffi::gtk_bitset_difference(self.to_glib_none().0, other.to_glib_none().0);
        }
    }

    #[doc(alias = "gtk_bitset_equals")]
    pub fn equals(&self, other: &Bitset) -> bool {
        unsafe {
            from_glib(ffi::gtk_bitset_equals(
                self.to_glib_none().0,
                other.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gtk_bitset_get_maximum")]
    #[doc(alias = "get_maximum")]
    pub fn maximum(&self) -> u32 {
        unsafe { ffi::gtk_bitset_get_maximum(self.to_glib_none().0) }
    }

    #[doc(alias = "gtk_bitset_get_minimum")]
    #[doc(alias = "get_minimum")]
    pub fn minimum(&self) -> u32 {
        unsafe { ffi::gtk_bitset_get_minimum(self.to_glib_none().0) }
    }

    #[doc(alias = "gtk_bitset_get_nth")]
    #[doc(alias = "get_nth")]
    pub fn nth(&self, nth: u32) -> u32 {
        unsafe { ffi::gtk_bitset_get_nth(self.to_glib_none().0, nth) }
    }

    #[doc(alias = "gtk_bitset_get_size")]
    #[doc(alias = "get_size")]
    pub fn size(&self) -> u64 {
        unsafe { ffi::gtk_bitset_get_size(self.to_glib_none().0) }
    }

    #[doc(alias = "gtk_bitset_get_size_in_range")]
    #[doc(alias = "get_size_in_range")]
    pub fn size_in_range(&self, first: u32, last: u32) -> u64 {
        unsafe { ffi::gtk_bitset_get_size_in_range(self.to_glib_none().0, first, last) }
    }

    #[doc(alias = "gtk_bitset_intersect")]
    pub fn intersect(&self, other: &Bitset) {
        unsafe {
            ffi::gtk_bitset_intersect(self.to_glib_none().0, other.to_glib_none().0);
        }
    }

    #[doc(alias = "gtk_bitset_is_empty")]
    pub fn is_empty(&self) -> bool {
        unsafe { from_glib(ffi::gtk_bitset_is_empty(self.to_glib_none().0)) }
    }

    #[doc(alias = "gtk_bitset_remove")]
    pub fn remove(&self, value: u32) -> bool {
        unsafe { from_glib(ffi::gtk_bitset_remove(self.to_glib_none().0, value)) }
    }

    #[doc(alias = "gtk_bitset_remove_all")]
    pub fn remove_all(&self) {
        unsafe {
            ffi::gtk_bitset_remove_all(self.to_glib_none().0);
        }
    }

    #[doc(alias = "gtk_bitset_remove_range")]
    pub fn remove_range(&self, start: u32, n_items: u32) {
        unsafe {
            ffi::gtk_bitset_remove_range(self.to_glib_none().0, start, n_items);
        }
    }

    #[doc(alias = "gtk_bitset_remove_range_closed")]
    pub fn remove_range_closed(&self, first: u32, last: u32) {
        unsafe {
            ffi::gtk_bitset_remove_range_closed(self.to_glib_none().0, first, last);
        }
    }

    #[doc(alias = "gtk_bitset_remove_rectangle")]
    pub fn remove_rectangle(&self, start: u32, width: u32, height: u32, stride: u32) {
        unsafe {
            ffi::gtk_bitset_remove_rectangle(self.to_glib_none().0, start, width, height, stride);
        }
    }

    #[doc(alias = "gtk_bitset_shift_left")]
    pub fn shift_left(&self, amount: u32) {
        unsafe {
            ffi::gtk_bitset_shift_left(self.to_glib_none().0, amount);
        }
    }

    #[doc(alias = "gtk_bitset_shift_right")]
    pub fn shift_right(&self, amount: u32) {
        unsafe {
            ffi::gtk_bitset_shift_right(self.to_glib_none().0, amount);
        }
    }

    #[doc(alias = "gtk_bitset_splice")]
    pub fn splice(&self, position: u32, removed: u32, added: u32) {
        unsafe {
            ffi::gtk_bitset_splice(self.to_glib_none().0, position, removed, added);
        }
    }

    #[doc(alias = "gtk_bitset_subtract")]
    pub fn subtract(&self, other: &Bitset) {
        unsafe {
            ffi::gtk_bitset_subtract(self.to_glib_none().0, other.to_glib_none().0);
        }
    }

    #[doc(alias = "gtk_bitset_union")]
    pub fn union(&self, other: &Bitset) {
        unsafe {
            ffi::gtk_bitset_union(self.to_glib_none().0, other.to_glib_none().0);
        }
    }
}