[gtk/wip/otte/bitset: 16/22] multiselection: Implement get_selection_in_range()



commit 147388e69a77bee60e32200e52f7555b50100f76
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jun 24 05:25:28 2020 +0200

    multiselection: Implement get_selection_in_range()

 gtk/gtkmultiselection.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/gtk/gtkmultiselection.c b/gtk/gtkmultiselection.c
index 1a6dcd3d4f..34e218d7a5 100644
--- a/gtk/gtkmultiselection.c
+++ b/gtk/gtkmultiselection.c
@@ -107,6 +107,16 @@ gtk_multi_selection_is_selected (GtkSelectionModel *model,
   return gtk_bitset_contains (self->selected, position);
 }
 
+static GtkBitset *
+gtk_multi_selection_get_selection_in_range (GtkSelectionModel *model,
+                                            guint              pos,
+                                            guint              n_items)
+{
+  GtkMultiSelection *self = GTK_MULTI_SELECTION (model);
+
+  return gtk_bitset_ref (self->selected);
+}
+
 static void
 gtk_multi_selection_toggle_selection (GtkMultiSelection *self,
                                       GtkBitset         *changes)
@@ -192,6 +202,7 @@ static void
 gtk_multi_selection_selection_model_init (GtkSelectionModelInterface *iface)
 {
   iface->is_selected = gtk_multi_selection_is_selected;
+  iface->get_selection_in_range = gtk_multi_selection_get_selection_in_range;
   iface->set_selection = gtk_multi_selection_set_selection;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]