[gtkmm] Tree*, ComboBox*: Change some parameters to const_iterator.



commit 19fd509e8ea60ae926c6a27b519ba517180e3438
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Mar 15 09:18:08 2017 +0100

    Tree*, ComboBox*: Change some parameters to const_iterator.
    
    Because these methods don't change the model data referred to by the iterator.
    We can expect people to call these methods with const_iterators.

 gtk/src/combobox.hg       |    2 +-
 gtk/src/treemodel.ccg     |    2 +-
 gtk/src/treemodel.hg      |   12 ++++++------
 gtk/src/treeselection.hg  |    4 ++--
 gtk/src/treestore.hg      |    4 ++--
 gtk/src/treeviewcolumn.hg |    2 +-
 6 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/gtk/src/combobox.hg b/gtk/src/combobox.hg
index 7bac1f6..113a284 100644
--- a/gtk/src/combobox.hg
+++ b/gtk/src/combobox.hg
@@ -105,7 +105,7 @@ public:
   _IGNORE(gtk_combo_box_get_active_iter)
 
   _WRAP_METHOD(void set_active(int index), gtk_combo_box_set_active)
-  _WRAP_METHOD(void set_active(const TreeModel::iterator& iter), gtk_combo_box_set_active_iter)
+  _WRAP_METHOD(void set_active(const TreeModel::const_iterator& iter), gtk_combo_box_set_active_iter)
 
   //TODO: See https://bugzilla.gnome.org/show_bug.cgi?id=612396#c30
   /** Get the text in the entry, if there is an entry.
diff --git a/gtk/src/treemodel.ccg b/gtk/src/treemodel.ccg
index a2835c4..e43d5c6 100644
--- a/gtk/src/treemodel.ccg
+++ b/gtk/src/treemodel.ccg
@@ -599,7 +599,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) /
 
 
 
-void TreeModel::rows_reordered(const Path& path, const iterator& iter, const std::vector<int>& new_order)
+void TreeModel::rows_reordered(const Path& path, const const_iterator& iter, const std::vector<int>& 
new_order)
 {
   //The size of the array seems to be based on the known number of children. murrayc.
   gtk_tree_model_rows_reordered(gobj(),
diff --git a/gtk/src/treemodel.hg b/gtk/src/treemodel.hg
index 3023e7b..b53c5dd 100644
--- a/gtk/src/treemodel.hg
+++ b/gtk/src/treemodel.hg
@@ -194,9 +194,9 @@ public:
 
   _WRAP_METHOD(TreeModel::Path get_path(const const_iterator& iter) const, gtk_tree_model_get_path)
 
-  _WRAP_METHOD(void row_changed(const Path& path, const iterator& iter), gtk_tree_model_row_changed)
-  _WRAP_METHOD(void row_inserted(const Path& path, const iterator& iter), gtk_tree_model_row_inserted)
-  _WRAP_METHOD(void row_has_child_toggled(const Path& path, const iterator& iter), 
gtk_tree_model_row_has_child_toggled)
+  _WRAP_METHOD(void row_changed(const Path& path, const const_iterator& iter), gtk_tree_model_row_changed)
+  _WRAP_METHOD(void row_inserted(const Path& path, const const_iterator& iter), gtk_tree_model_row_inserted)
+  _WRAP_METHOD(void row_has_child_toggled(const Path& path, const const_iterator& iter), 
gtk_tree_model_row_has_child_toggled)
   _WRAP_METHOD(void row_deleted(const Path& path), gtk_tree_model_row_deleted)
 
  /** Emits the "rows_reordered" signal on the tree model.  This should be called by
@@ -207,7 +207,7 @@ public:
   * @param new_order An array of integers mapping the current position of each child
   * to its old position before the re-ordering, i.e. @a new_order<literal>[newpos] = oldpos.
   */
-  void rows_reordered(const Path& path, const iterator& iter, const std::vector<int>& new_order);
+  void rows_reordered(const Path& path, const const_iterator& iter, const std::vector<int>& new_order);
   _IGNORE(gtk_tree_model_rows_reordered_with_length)
 
  /** Emits the "rows_reordered" signal on the tree model.  This should be called by
@@ -221,9 +221,9 @@ public:
   */
   void rows_reordered(const Path& path, const std::vector<int>& new_order);
 
-  _WRAP_METHOD(void rows_reordered(const Path& path, const iterator& iter, int* new_order), 
gtk_tree_model_rows_reordered)
+  _WRAP_METHOD(void rows_reordered(const Path& path, const const_iterator& iter, int* new_order), 
gtk_tree_model_rows_reordered)
 
-  _WRAP_METHOD(Glib::ustring get_string(const iterator& iter) const, gtk_tree_model_get_string_from_iter)
+  _WRAP_METHOD(Glib::ustring get_string(const const_iterator& iter) const, 
gtk_tree_model_get_string_from_iter)
 
 #m4 _CONVERSION(`GtkTreeIter*',`const iterator&',`Gtk::TreeModel::iterator(self, $3)')
 #m4 _CONVERSION(`GtkTreeIter*',`const TreeModel::iterator&',`Gtk::TreeModel::iterator(self, $3)')
diff --git a/gtk/src/treeselection.hg b/gtk/src/treeselection.hg
index 39060bc..98a1e2d 100644
--- a/gtk/src/treeselection.hg
+++ b/gtk/src/treeselection.hg
@@ -200,11 +200,11 @@ public:
 
   _WRAP_METHOD(void select(const TreeModel::Path& path), gtk_tree_selection_select_path)
   _WRAP_METHOD(void select(const TreeModel::Path& start_path, const TreeModel::Path& end_path), 
gtk_tree_selection_select_range)
-  _WRAP_METHOD(void select(const TreeModel::iterator& iter), gtk_tree_selection_select_iter)
+  _WRAP_METHOD(void select(const TreeModel::const_iterator& iter), gtk_tree_selection_select_iter)
 
   _WRAP_METHOD(void unselect(const TreeModel::Path& path), gtk_tree_selection_unselect_path)
   _WRAP_METHOD(void unselect(const TreeModel::Path& start_path, const TreeModel::Path& end_path), 
gtk_tree_selection_unselect_range)
-  _WRAP_METHOD(void unselect(const TreeModel::iterator& iter), gtk_tree_selection_unselect_iter)
+  _WRAP_METHOD(void unselect(const TreeModel::const_iterator& iter), gtk_tree_selection_unselect_iter)
 
   _WRAP_METHOD(bool is_selected(const TreeModel::Path& path) const, gtk_tree_selection_path_is_selected)
   _WRAP_METHOD(bool is_selected(const TreeModel::const_iterator& iter) const, 
gtk_tree_selection_iter_is_selected)
diff --git a/gtk/src/treestore.hg b/gtk/src/treestore.hg
index 303de87..f954738 100644
--- a/gtk/src/treestore.hg
+++ b/gtk/src/treestore.hg
@@ -155,8 +155,8 @@ public:
   void reorder(const TreeNodeChildren& node, const std::vector<int>& new_order);
 
   _WRAP_METHOD(void clear(), gtk_tree_store_clear)
-  _WRAP_METHOD(bool is_ancestor(const iterator& iter, const iterator& descendant) const, 
gtk_tree_store_is_ancestor)
-  _WRAP_METHOD(int iter_depth(const iterator& iter) const, gtk_tree_store_iter_depth)
+  _WRAP_METHOD(bool is_ancestor(const const_iterator& iter, const const_iterator& descendant) const, 
gtk_tree_store_is_ancestor)
+  _WRAP_METHOD(int iter_depth(const const_iterator& iter) const, gtk_tree_store_iter_depth)
 
   _WRAP_METHOD(bool iter_is_valid(const const_iterator& iter) const, gtk_tree_store_iter_is_valid)
 
diff --git a/gtk/src/treeviewcolumn.hg b/gtk/src/treeviewcolumn.hg
index 4bd76fd..acfe5fe 100644
--- a/gtk/src/treeviewcolumn.hg
+++ b/gtk/src/treeviewcolumn.hg
@@ -120,7 +120,7 @@ void set_renderer(Gtk::CellRenderer& renderer, const TreeModelColumnBase& column
    * This function is used instead of the standard attributes mapping for setting the column value, and 
should set the
    * value of the column's cell renderer as appropriate.
    */
-  typedef sigc::slot<void(CellRenderer*, const Gtk::TreeModel::iterator&)> SlotTreeCellData;
+  typedef sigc::slot<void(CellRenderer*, const Gtk::TreeModel::const_iterator&)> SlotTreeCellData;
 
   /** Sets the slot callback to use for the column.
    * This callback function is used instead of the standard attributes mapping for setting the column value, 
and should set the


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