[gtkmm] Add Gtk::ListBox and Gtk::ListBoxRow.



commit 42714751b81c2867338dd3db65556e10511c2d6d
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Sun Sep 15 16:38:02 2013 +0200

    Add Gtk::ListBox and Gtk::ListBoxRow.
    
    * .gitignore: Add new generated files in gtk/gtkmm/.
    * gtk/gtkmm.h: Add listbox.h and listboxrow.h.
    * gtk/src/filelist.am: Add listbox.hg and listboxrow.hg.
    * gtk/src/gtk_signals.defs: Regenerate with GtkListBox's and GtkListBoxRow's
    signals and properties.
    * tools/extra_defs_gen/generate_defs_gtk.cc: Add GTK_TYPE_LIST_BOX and
    GTK_TYPE_LIST_BOX_ROW.
    * tools/m4/convert_gtk.m4: Add conversions for GtkListBoxRow.
    * docs/reference/images/widgets/listbox1.png:
    * gtk/src/listbox.[hg|ccg]:
    * gtk/src/listboxrow.[hg|ccg]: New files. Bug #708115.

 .gitignore                                 |    4 +
 docs/reference/images/widgets/listbox1.png |  Bin 0 -> 6078 bytes
 gtk/gtkmm.h                                |    2 +
 gtk/src/filelist.am                        |    2 +
 gtk/src/gtk_signals.defs                   |   84 ++++++++++-
 gtk/src/listbox.ccg                        |  148 +++++++++++++++++++
 gtk/src/listbox.hg                         |  216 ++++++++++++++++++++++++++++
 gtk/src/listboxrow.ccg                     |   27 ++++
 gtk/src/listboxrow.hg                      |   78 ++++++++++
 tools/extra_defs_gen/generate_defs_gtk.cc  |    2 +
 tools/m4/convert_gtk.m4                    |    6 +
 11 files changed, 561 insertions(+), 8 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 07d6c31..a7b7311 100644
--- a/.gitignore
+++ b/.gitignore
@@ -296,6 +296,10 @@ gtk/gtkmm/levelbar.cc
 gtk/gtkmm/levelbar.h
 gtk/gtkmm/linkbutton.cc
 gtk/gtkmm/linkbutton.h
+gtk/gtkmm/listbox.cc
+gtk/gtkmm/listbox.h
+gtk/gtkmm/listboxrow.cc
+gtk/gtkmm/listboxrow.h
 gtk/gtkmm/liststore.cc
 gtk/gtkmm/liststore.h
 gtk/gtkmm/main.cc
diff --git a/docs/reference/images/widgets/listbox1.png b/docs/reference/images/widgets/listbox1.png
new file mode 100644
index 0000000..7ee913f
Binary files /dev/null and b/docs/reference/images/widgets/listbox1.png differ
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 09d2e76..fc65411 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -179,6 +179,8 @@ extern const int gtkmm_micro_version;
 #include <gtkmm/label.h>
 #include <gtkmm/layout.h>
 #include <gtkmm/levelbar.h>
+#include <gtkmm/listbox.h>
+#include <gtkmm/listboxrow.h>
 #include <gtkmm/liststore.h>
 #include <gtkmm/listviewtext.h>
 #include <gtkmm/linkbutton.h>
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 8ad4d54..5b0a05f 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -95,6 +95,8 @@ gtkmm_files_any_hg =          \
        layout.hg               \
        levelbar.hg             \
        linkbutton.hg           \
+       listbox.hg \
+       listboxrow.hg \
        liststore.hg            \
        main.hg                 \
        menu.hg                 \
diff --git a/gtk/src/gtk_signals.defs b/gtk/src/gtk_signals.defs
index e6a8420..2253a8e 100644
--- a/gtk/src/gtk_signals.defs
+++ b/gtk/src/gtk_signals.defs
@@ -4602,12 +4602,6 @@
   (when "last")
 )
 
-(define-signal selection-changed
-  (of-object "GtkIconView")
-  (return-type "void")
-  (when "first")
-)
-
 (define-signal item-activated
   (of-object "GtkIconView")
   (return-type "void")
@@ -4617,6 +4611,12 @@
   )
 )
 
+(define-signal selection-changed
+  (of-object "GtkIconView")
+  (return-type "void")
+  (when "first")
+)
+
 (define-signal select-cursor-item
   (of-object "GtkIconView")
   (return-type "void")
@@ -5113,6 +5113,74 @@
   (construct-only #f)
 )
 
+;; From GtkListBox
+
+(define-signal row-activated
+  (of-object "GtkListBox")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GtkListBoxRow*" "p0")
+  )
+)
+
+(define-signal move-cursor
+  (of-object "GtkListBox")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GtkMovementStep" "p0")
+    '("gint" "p1")
+  )
+)
+
+(define-signal toggle-cursor-row
+  (of-object "GtkListBox")
+  (return-type "void")
+  (when "last")
+)
+
+(define-signal row-selected
+  (of-object "GtkListBox")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("GtkListBoxRow*" "p0")
+  )
+)
+
+(define-signal activate-cursor-row
+  (of-object "GtkListBox")
+  (return-type "void")
+  (when "last")
+)
+
+(define-property selection-mode
+  (of-object "GtkListBox")
+  (prop-type "GParamEnum")
+  (docs "The selection mode")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property activate-on-single-click
+  (of-object "GtkListBox")
+  (prop-type "GParamBoolean")
+  (docs "Activate row on a single click")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+;; From GtkListBoxRow
+
+(define-signal activate
+  (of-object "GtkListBoxRow")
+  (return-type "void")
+  (when "first")
+)
+
 ;; From GtkMenu
 
 (define-signal move-scroll
@@ -6791,13 +6859,13 @@
 
 ;; From GtkRecentChooser
 
-(define-signal selection-changed
+(define-signal item-activated
   (of-object "GtkRecentChooser")
   (return-type "void")
   (when "last")
 )
 
-(define-signal item-activated
+(define-signal selection-changed
   (of-object "GtkRecentChooser")
   (return-type "void")
   (when "last")
diff --git a/gtk/src/listbox.ccg b/gtk/src/listbox.ccg
new file mode 100644
index 0000000..d791275
--- /dev/null
+++ b/gtk/src/listbox.ccg
@@ -0,0 +1,148 @@
+/* Copyright (C) 2013 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
+#include <gtkmm/adjustment.h>
+
+namespace
+{
+
+gboolean SignalProxy_Filter_gtk_callback(GtkListBoxRow* row, void* data)
+{
+  Gtk::ListBox::SlotFilter* the_slot = static_cast<Gtk::ListBox::SlotFilter*>(data);
+
+  try
+  {
+    return (*the_slot)(Glib::wrap(row));
+  }
+  catch(...)
+  {
+    Glib::exception_handlers_invoke();
+    return FALSE;
+  }
+}
+
+void SignalProxy_Filter_gtk_callback_destroy(void* data)
+{
+  delete static_cast<Gtk::ListBox::SlotFilter*>(data);
+}
+
+gint SignalProxy_Sort_gtk_callback(GtkListBoxRow* row1, GtkListBoxRow* row2, void* data)
+{
+  Gtk::ListBox::SlotSort* the_slot = static_cast<Gtk::ListBox::SlotSort*>(data);
+
+  try
+  {
+    return (*the_slot)(Glib::wrap(row1), Glib::wrap(row2));
+  }
+  catch(...)
+  {
+    Glib::exception_handlers_invoke();
+    return 0;
+  }
+}
+
+void SignalProxy_Sort_gtk_callback_destroy(void* data)
+{
+  delete static_cast<Gtk::ListBox::SlotSort*>(data);
+}
+
+void SignalProxy_UpdateHeader_gtk_callback(GtkListBoxRow* row, GtkListBoxRow* before, void* data)
+{
+  Gtk::ListBox::SlotUpdateHeader* the_slot = static_cast<Gtk::ListBox::SlotUpdateHeader*>(data);
+
+  try
+  {
+    (*the_slot)(Glib::wrap(row), Glib::wrap(before));
+  }
+  catch(...)
+  {
+    Glib::exception_handlers_invoke();
+  }
+}
+
+void SignalProxy_UpdateHeader_gtk_callback_destroy(void* data)
+{
+  delete static_cast<Gtk::ListBox::SlotUpdateHeader*>(data);
+}
+
+} // anonymous namespace
+
+namespace Gtk
+{
+
+void ListBox::unselect_row()
+{
+  gtk_list_box_select_row(gobj(), 0);
+}
+
+void ListBox::unset_placeholder()
+{
+  gtk_list_box_set_placeholder(gobj(), 0);
+}
+
+void ListBox::set_filter_func(const SlotFilter& slot)
+{
+  // Create a copy of the slot object. A pointer to this will be passed
+  // through the callback's data parameter. It will be deleted
+  // when SignalProxy_Filter_gtk_callback_destroy() is called.
+  SlotFilter* slot_copy = new SlotFilter(slot);
+
+  gtk_list_box_set_filter_func(gobj(),
+    &SignalProxy_Filter_gtk_callback, slot_copy,
+    &SignalProxy_Filter_gtk_callback_destroy);
+}
+
+void ListBox::unset_filter_func()
+{
+  gtk_list_box_set_filter_func(gobj(), 0, 0, 0);
+}
+
+void ListBox::set_sort_func(const SlotSort& slot)
+{
+  // Create a copy of the slot object. A pointer to this will be passed
+  // through the callback's data parameter. It will be deleted
+  // when SignalProxy_Sort_gtk_callback_destroy() is called.
+  SlotSort* slot_copy = new SlotSort(slot);
+
+  gtk_list_box_set_sort_func(gobj(),
+    &SignalProxy_Sort_gtk_callback, slot_copy,
+    &SignalProxy_Sort_gtk_callback_destroy);
+}
+
+void ListBox::unset_sort_func()
+{
+  gtk_list_box_set_sort_func(gobj(), 0, 0, 0);
+}
+
+void ListBox::set_header_func(const SlotUpdateHeader& slot)
+{
+  // Create a copy of the slot object. A pointer to this will be passed
+  // through the callback's data parameter. It will be deleted
+  // when SignalProxy_Sort_gtk_callback_destroy() is called.
+  SlotUpdateHeader* slot_copy = new SlotUpdateHeader(slot);
+
+  gtk_list_box_set_header_func(gobj(),
+    &SignalProxy_UpdateHeader_gtk_callback, slot_copy,
+    &SignalProxy_UpdateHeader_gtk_callback_destroy);
+}
+
+void ListBox::unset_header_func()
+{
+  gtk_list_box_set_header_func(gobj(), 0, 0, 0);
+}
+
+} //namespace Gtk
diff --git a/gtk/src/listbox.hg b/gtk/src/listbox.hg
new file mode 100644
index 0000000..9fc1ecd
--- /dev/null
+++ b/gtk/src/listbox.hg
@@ -0,0 +1,216 @@
+/* Copyright (C) 2013 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtkmm/container.h>
+#include <gtkmm/listboxrow.h>
+#include <gtkmm/enums.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/container_p.h)
+
+namespace Gtk
+{
+class Adjustment;
+
+/** A ListBox is a vertical container that contains ListBoxRow
+ * children. These rows can by dynamically sorted and filtered, and
+ * headers can be added dynamically depending on the row content.
+ * It also allows keyboard and mouse navigation and selection like
+ * a typical list.
+ *
+ * Using ListBox is often an alternative to TreeView, especially
+ * when the list contents have a more complicated layout than what is allowed
+ * by a CellRenderer, or when the contents are interactive (e.g. contain a
+ * button).
+ *
+ * Although a ListBox must have only ListBoxRow children you can
+ * add any kind of widget to it via Container::add(), and a ListBoxRow
+ * widget will automatically be inserted between the list and the widget.
+ *
+ * A ListBox looks like this:
+ * @image html listbox1.png
+ *
+ * @ingroup Widgets
+ * @ingroup Containers
+ *
+ * @newin{3,10}
+ */
+class ListBox : public Container
+{
+  _CLASS_GTKOBJECT(ListBox, GtkListBox, GTK_LIST_BOX, Gtk::Container, GtkContainer)
+public:
+  _CTOR_DEFAULT
+
+  /** For instance: bool on_filter(ListBoxRow* row);
+   *
+   * Will be called whenever the row changes or is added and lets you control
+   * if the row should be visible or not.
+   *
+   * @param row The row that may be filtered
+   * @returns <tt>true</tt> if the row should be visible, <tt>false</tt> otherwise
+   *
+   * @newin{3,10}
+   */
+  typedef sigc::slot<bool, ListBoxRow*> SlotFilter;
+
+  /** For instance: int on_sort(ListBoxRow* row1, ListBoxRow* row2);
+   *
+   * Compare two rows to determine which should be first.
+   *
+   * @param row1 The first row
+   * @param row2 The second row
+   * @returns < 0 if @a row1 should be before @a row2, 0 if they are
+   *          equal and > 0 otherwise
+   *
+   * @newin{3,10}
+   */
+  typedef sigc::slot<int, ListBoxRow*, ListBoxRow*> SlotSort;
+
+  /** For instance: void on_update_header(ListBoxRow* row, ListBoxRow* before);
+   *
+   * Whenever @a row changes or which row is before @a row changes this
+   * is called, which lets you update the header on @a row. You may
+   * remove or set a new one via ListBoxRow::set_header() or
+   * just change the state of the current header widget.
+   *
+   * @param row The row to update
+   * @param before The row before @a row, or <tt>0</tt> if it is first
+   *
+   * @newin{3,10}
+   */
+  typedef sigc::slot<void, ListBoxRow*, ListBoxRow*> SlotUpdateHeader;
+
+  _WRAP_METHOD(void prepend(Widget& child), gtk_list_box_prepend)
+  _WRAP_METHOD(void insert(Widget& child, int position), gtk_list_box_insert)
+  _WRAP_METHOD(ListBoxRow* get_selected_row(), gtk_list_box_get_selected_row)
+  _WRAP_METHOD(const ListBoxRow* get_selected_row() const, gtk_list_box_get_selected_row, constversion)
+  _WRAP_METHOD(ListBoxRow* get_row_at_index(int index), gtk_list_box_get_row_at_index)
+  _WRAP_METHOD(const ListBoxRow* get_row_at_index(int index) const, gtk_list_box_get_row_at_index, 
constversion)
+  _WRAP_METHOD(ListBoxRow* get_row_at_y(int y), gtk_list_box_get_row_at_y)
+  _WRAP_METHOD(const ListBoxRow* get_row_at_y(int y) const, gtk_list_box_get_row_at_y, constversion)
+  _WRAP_METHOD(void select_row(ListBoxRow& row), gtk_list_box_select_row)
+
+  /** Unselects the currently selected row, if any.
+   * 
+   * @newin{3,10}
+   */
+  void unselect_row();
+
+  _WRAP_METHOD(void set_placeholder(Widget& placeholder), gtk_list_box_set_placeholder)
+
+  /** Removes the placeholder widget, if any.
+   * 
+   * @newin{3,10}
+   */
+  void unset_placeholder();
+
+  _WRAP_METHOD(void set_adjustment(const Glib::RefPtr<Adjustment>& adjustment), gtk_list_box_set_adjustment)
+  _WRAP_METHOD(Glib::RefPtr<Adjustment> get_adjustment(), gtk_list_box_get_adjustment, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Adjustment> get_adjustment() const, gtk_list_box_get_adjustment, 
refreturn, constversion)
+  _WRAP_METHOD(void set_selection_mode(SelectionMode mode), gtk_list_box_set_selection_mode)
+  _WRAP_METHOD(SelectionMode get_selection_mode() const, gtk_list_box_get_selection_mode)
+
+  /** Sets a filter function.
+   *
+   * By setting a filter function on the ListBox one can decide dynamically which
+   * of the rows to show. For instance, to implement a search function on a list that
+   * filters the original list to only show the matching rows.
+   *
+   * The @a slot will be called for each row after the call, and it will
+   * continue to be called each time a row changes (via ListBoxRow::changed()) or
+   * when invalidate_filter() is called.
+   *
+   * @param slot Callback that lets you filter which rows to show
+   * @newin{3,10}
+   */
+  void set_filter_func(const SlotFilter& slot);
+  _IGNORE(gtk_list_box_set_filter_func)
+
+  /** Removes the filter function, if any.
+   * @newin{3,10}
+   */
+  void unset_filter_func();
+
+  /** Sets a sort function.
+   *
+   * By setting a sort function on the ListBox one can dynamically reorder the rows
+   * of the list, based on the contents of the rows.
+   *
+   * The @a slot will be called for each row after the call, and will continue to
+   * be called each time a row changes (via ListBoxRow::changed()) and when
+   * invalidate_sort() is called.
+   *
+   * @param slot The sort function.
+   * @newin{3,10}
+   */
+  void set_sort_func(const SlotSort& slot);
+  _IGNORE(gtk_list_box_set_sort_func)
+
+  /** Removes the sort function, if any.
+   * @newin{3,10}
+   */
+  void unset_sort_func();
+
+  /** Sets a header function.
+   *
+   * By setting a header function on the ListBox one can dynamically add headers
+   * in front of rows, depending on the contents of the row and its position in the list.
+   * For instance, one could use it to add headers in front of the first item of a
+   * new kind, in a list sorted by the kind.
+   *
+   * The @a slot can look at the current header widget using ListBoxRow::get_header()
+   * and either update the state of the widget as needed, or set a new one using
+   * ListBoxRow::set_header(). If no header is needed, use ListBoxRow::unset_header().
+   *
+   * Note that you may get many calls to this @a slot for a particular row when e.g.
+   * changing things that don't affect the header. In this case it is important for performance
+   * to not blindly replace an exisiting header with an identical one.
+   *
+   * The @a slot function will be called for each row after the call, and it will
+   * continue to be called each time a row changes (via ListBoxRow::changed()) and when
+   * the row before changes (either by ListBoxRow::changed() on the previous row, or when
+   * the previous row becomes a different row). It is also called for all rows when
+   * invalidate_headers() is called.
+   *
+   * @param slot Callback that lets you add row headers
+   * @newin{3,10}
+   */
+  void set_header_func(const SlotUpdateHeader& slot);
+  _IGNORE(gtk_list_box_set_header_func)
+
+  /** Removes the header function, if any.
+   * @newin{3,10}
+   */
+  void unset_header_func();
+
+  _WRAP_METHOD(void invalidate_filter(), gtk_list_box_invalidate_filter)
+  _WRAP_METHOD(void invalidate_sort(), gtk_list_box_invalidate_sort)
+  _WRAP_METHOD(void invalidate_headers(), gtk_list_box_invalidate_headers)
+  _WRAP_METHOD(void set_activate_on_single_click(bool single = true), 
gtk_list_box_set_activate_on_single_click)
+  _WRAP_METHOD(bool get_activate_on_single_click() const, gtk_list_box_get_activate_on_single_click)
+  _WRAP_METHOD(void drag_unhighlight_row(), gtk_list_box_drag_unhighlight_row)
+  _WRAP_METHOD(void drag_highlight_row(ListBoxRow& row), gtk_list_box_drag_highlight_row)
+
+  _WRAP_PROPERTY("selection-mode", SelectionMode)
+  _WRAP_PROPERTY("activate-on-single-click", bool)
+
+  _WRAP_SIGNAL(void row_selected(ListBoxRow* row), row-selected)
+  _WRAP_SIGNAL(void row_activated(ListBoxRow* row), row-activated)
+
+  _IGNORE_SIGNAL(activate-cursor-row, toggle-cursor-row, move-cursor) // Action signals
+};
+
+} // namespace Gtk
diff --git a/gtk/src/listboxrow.ccg b/gtk/src/listboxrow.ccg
new file mode 100644
index 0000000..e695a6b
--- /dev/null
+++ b/gtk/src/listboxrow.ccg
@@ -0,0 +1,27 @@
+/* Copyright (C) 2013 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
+
+namespace Gtk
+{
+
+void ListBoxRow::unset_header()
+{
+  gtk_list_box_row_set_header(gobj(), 0);
+}
+
+} // namespace Gtk
diff --git a/gtk/src/listboxrow.hg b/gtk/src/listboxrow.hg
new file mode 100644
index 0000000..c722ac8
--- /dev/null
+++ b/gtk/src/listboxrow.hg
@@ -0,0 +1,78 @@
+/* Copyright (C) 2013 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtkmm/bin.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/bin_p.h)
+
+namespace Gtk
+{
+
+/** See the description of ListBox.
+ *
+ * @ingroup Widgets
+ * @ingroup Containers
+ *
+ * @newin{3,10}
+ */
+class ListBoxRow : public Bin
+{
+  _CLASS_GTKOBJECT(ListBoxRow, GtkListBoxRow, GTK_LIST_BOX_ROW, Gtk::Bin, GtkBin)
+public:
+  _CTOR_DEFAULT()
+
+  /** Sets the current header of the ListBoxRow. This is only allowed to be called
+   * from a ListBox::SlotUpdateHeader. It will replace any existing
+   * header in the row, and be shown in front of the row in the ListBox.
+   * 
+   * @newin{3,10}
+   * @param header The header.
+   */
+  _WRAP_METHOD(void set_header(Widget& header), gtk_list_box_row_set_header)
+
+  /** Removes the current header, if any. This is only allowed to be called
+   * from a ListBox::SlotUpdateHeader.
+   *
+   * @newin{3,10}
+   */
+  void unset_header();
+
+  /** Returns the current header of the ListBoxRow. This can be used
+   * in a ListBox::SlotUpdateHeader to see if there is a header
+   * set already, and if so to update the state of it.
+   * 
+   * @newin{3,10}
+   * @return The current header, or <tt>0</tt> if none.
+   */
+  _WRAP_METHOD(Widget* get_header(), gtk_list_box_row_get_header)
+
+  /** Returns the current header of the ListBoxRow. This can be used
+   * in a ListBox::SlotUpdateHeader to see if there is a header
+   * set already, and if so to update the state of it.
+   * 
+   * @newin{3,10}
+   * @return The current header, or <tt>0</tt> if none.
+   */
+  _WRAP_METHOD(const Widget* get_header() const, gtk_list_box_row_get_header, constversion)
+
+  _WRAP_METHOD(int get_index() const, gtk_list_box_row_get_index)
+  _WRAP_METHOD(void changed(), gtk_list_box_row_changed)
+
+  _IGNORE_SIGNAL(activate) // Action signal
+};
+
+} // namespace Gtk
diff --git a/tools/extra_defs_gen/generate_defs_gtk.cc b/tools/extra_defs_gen/generate_defs_gtk.cc
index 04181c6..3086a56 100644
--- a/tools/extra_defs_gen/generate_defs_gtk.cc
+++ b/tools/extra_defs_gen/generate_defs_gtk.cc
@@ -129,6 +129,8 @@ int main(int argc, char** argv)
             << get_defs( GTK_TYPE_LAYOUT )
             << get_defs( GTK_TYPE_LEVEL_BAR)
             << get_defs( GTK_TYPE_LINK_BUTTON )
+            << get_defs( GTK_TYPE_LIST_BOX )
+            << get_defs( GTK_TYPE_LIST_BOX_ROW )
             << get_defs( GTK_TYPE_MENU )
             << get_defs( GTK_TYPE_MENU_BAR )
             << get_defs( GTK_TYPE_MENU_BUTTON )
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 00ca5b7..025e41f 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -572,6 +572,12 @@ _CONVERSION(`const Border&',`const GtkBorder*',__FR2P)
 _CONVERSION(`Border&',`GtkBorder*',__FR2P)
 _CONVERSION(`const GtkBorder*',`Border',`Glib::wrap(const_cast<GtkBorder*>($3))')
 
+#ListBoxRow
+_CONVERSION(`GtkListBoxRow*',`ListBoxRow*',__RP2P)
+_CONVERSION(`GtkListBoxRow*',`const ListBoxRow*',__RP2P)
+_CONVERSION(`ListBoxRow&',`GtkListBoxRow*',__FR2P)
+_CONVERSION(`ListBoxRow*',`GtkListBoxRow*',__FP2P)
+
 #RecentFilter
 _CONVERSION(`GtkRecentFilterFlags',`RecentFilterFlags',`($2)$3')
 _CONVERSION(`const Glib::RefPtr<RecentFilter>&', `GtkRecentFilter*', __CONVERT_REFPTR_TO_P)



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