summaryrefslogtreecommitdiff
path: root/gtk/gtkbitset.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-06-30 03:29:22 +0200
committerBenjamin Otte <otte@redhat.com>2020-07-05 02:59:21 +0200
commit6099fbafc16f8d7aa5da06671d3e893fc7a48426 (patch)
treeaaab6bf9c6821f310eed76a53abd9f6c11bdca8b /gtk/gtkbitset.c
parent6f2f828bcebe49f8b1e56049016b08195fda0e32 (diff)
downloadgtk+-6099fbafc16f8d7aa5da06671d3e893fc7a48426.tar.gz
bitset: Add gtk_bitset_new_range()
It's a common use.
Diffstat (limited to 'gtk/gtkbitset.c')
-rw-r--r--gtk/gtkbitset.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/gtk/gtkbitset.c b/gtk/gtkbitset.c
index c69efd0cf7..27cdf1ba63 100644
--- a/gtk/gtkbitset.c
+++ b/gtk/gtkbitset.c
@@ -268,7 +268,7 @@ gtk_bitset_get_nth (const GtkBitset *self,
*
* Creates a new empty bitset.
*
- * Returns: A new empty bitset.
+ * Returns: A new empty bitset
**/
GtkBitset *
gtk_bitset_new_empty (void)
@@ -285,6 +285,28 @@ gtk_bitset_new_empty (void)
}
/**
+ * gtk_bitset_new_range:
+ * @start: first value to add
+ * @n_items: number of consecutive values to add
+ *
+ * Creates a bitset with the given range set.
+ *
+ * Returns: A new bitset
+ **/
+GtkBitset *
+gtk_bitset_new_range (guint start,
+ guint n_items)
+{
+ GtkBitset *self;
+
+ self = gtk_bitset_new_empty ();
+
+ gtk_bitset_add_range (self, start, n_items);
+
+ return self;
+}
+
+/**
* gtk_bitset_copy:
* @self: a #GtkBitset
*