Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / treeview_private.cc
1 /* $Id$ */
2
3 /* Copyright(C) 2001-2002 The gtkmm Development Team
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or(at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the Free
17  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19
20 #include <gtkmm/treeview_private.h>
21 #include <glibmm.h>
22
23
24 namespace Gtk
25 {
26
27 namespace TreeView_Private
28 {
29
30 SignalProxy_CellData::SignalProxy_CellData(const SlotType& slot)
31 :
32   slot_ (slot)
33 {}
34
35 SignalProxy_CellData::~SignalProxy_CellData()
36 {}
37
38 void SignalProxy_CellData::gtk_callback(GtkTreeViewColumn*, GtkCellRenderer* cell,
39                                         GtkTreeModel* model, GtkTreeIter* iter, void* data)
40 {
41   SignalProxy_CellData *const self = static_cast<SignalProxy_CellData*>(data);
42
43   try
44   {
45     // use Slot::operator()
46     (self->slot_)(Glib::wrap(cell, false), TreeIter(model, iter));
47   }
48   catch(...)
49   {
50     Glib::exception_handlers_invoke();
51   }
52 }
53
54 void SignalProxy_CellData::gtk_callback_destroy(void* data)
55 {
56   delete static_cast<SignalProxy_CellData*>(data);
57 }
58
59
60
61 SignalProxy_RowSeparator::SignalProxy_RowSeparator(const SlotType& slot)
62 :
63   slot_ (slot)
64 {}
65
66 SignalProxy_RowSeparator::~SignalProxy_RowSeparator()
67 {}
68
69 gboolean SignalProxy_RowSeparator::gtk_callback(GtkTreeModel* model, GtkTreeIter* iter, void* data)
70 {
71   SignalProxy_RowSeparator *const self = static_cast<SignalProxy_RowSeparator*>(data);
72
73   try
74   {
75     return (self->slot_)(Glib::wrap(model, true), Gtk::TreeIter(model, iter));
76   }
77   catch(...)
78   {
79     Glib::exception_handlers_invoke();
80   }
81
82   return 0; // arbitrary value
83 }
84
85 void SignalProxy_RowSeparator::gtk_callback_destroy(void* data)
86 {
87   delete static_cast<SignalProxy_RowSeparator*>(data);
88 }
89
90
91 } // namespace TreeView_Private
92
93 } // namespace Gtk
94