Merge branch 'ebassi/issue-4543' into 'main'

Add a boxed GType for GtkBitsetIter

Closes #4543

See merge request GNOME/gtk!4253
This commit is contained in:
Matthias Clasen 2021-12-14 18:09:01 +00:00
commit 075e954b71
2 changed files with 25 additions and 6 deletions

View File

@ -546,7 +546,7 @@ gtk_bitset_union (GtkBitset *self,
{
g_return_if_fail (self != NULL);
g_return_if_fail (other != NULL);
if (self == other)
return;
@ -571,7 +571,7 @@ gtk_bitset_intersect (GtkBitset *self,
{
g_return_if_fail (self != NULL);
g_return_if_fail (other != NULL);
if (self == other)
return;
@ -596,7 +596,7 @@ gtk_bitset_subtract (GtkBitset *self,
{
g_return_if_fail (self != NULL);
g_return_if_fail (other != NULL);
if (self == other)
{
roaring_bitmap_clear (&self->roaring);
@ -626,7 +626,7 @@ gtk_bitset_difference (GtkBitset *self,
{
g_return_if_fail (self != NULL);
g_return_if_fail (other != NULL);
if (self == other)
{
roaring_bitmap_clear (&self->roaring);
@ -756,6 +756,24 @@ gtk_bitset_splice (GtkBitset *self,
G_STATIC_ASSERT (sizeof (GtkBitsetIter) >= sizeof (roaring_uint32_iterator_t));
static GtkBitsetIter *
gtk_bitset_iter_copy (GtkBitsetIter *iter)
{
roaring_uint32_iterator_t *riter = (roaring_uint32_iterator_t *) iter;
return (GtkBitsetIter *) roaring_copy_uint32_iterator (riter);
}
static void
gtk_bitset_iter_free (GtkBitsetIter *iter)
{
roaring_uint32_iterator_t *riter = (roaring_uint32_iterator_t *) iter;
roaring_free_uint32_iterator (riter);
}
G_DEFINE_BOXED_TYPE (GtkBitsetIter, gtk_bitset_iter, gtk_bitset_iter_copy, gtk_bitset_iter_free)
/**
* gtk_bitset_iter_init_first:
* @iter: (out): a pointer to an uninitialized `GtkBitsetIter`

View File

@ -148,6 +148,9 @@ struct _GtkBitsetIter
gpointer private_data[10];
};
GDK_AVAILABLE_IN_4_6
GType gtk_bitset_iter_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gboolean gtk_bitset_iter_init_first (GtkBitsetIter *iter,
const GtkBitset *set,
@ -171,8 +174,6 @@ GDK_AVAILABLE_IN_ALL
guint gtk_bitset_iter_get_value (const GtkBitsetIter *iter);
GDK_AVAILABLE_IN_ALL
gboolean gtk_bitset_iter_is_valid (const GtkBitsetIter *iter);
G_END_DECLS