| 1 |
/* Copyright (C) 2006 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include <gtk/gtk.h> |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
static gint SignalProxy_SlotForwardPage_gtk_callback(gint current_page, gpointer data) |
| 22 |
{ |
| 23 |
auto the_slot = static_cast<Gtk::Assistant::SlotForwardPage*>(data); |
| 24 |
|
| 25 |
try |
| 26 |
{ |
| 27 |
return (*the_slot)(current_page); |
| 28 |
} |
| 29 |
catch(...) |
| 30 |
{ |
| 31 |
Glib::exception_handlers_invoke(); |
| 32 |
return gint(); |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
static void SignalProxy_SlotForwardPage_gtk_callback_destroy(void* data) |
| 37 |
{ |
| 38 |
delete static_cast<Gtk::Assistant::SlotForwardPage*>(data); |
| 39 |
} |
| 40 |
|
| 41 |
|
| 42 |
namespace Gtk |
| 43 |
{ |
| 44 |
|
| 45 |
void Assistant::set_forward_page_func(const SlotForwardPage& slot) |
| 46 |
{ |
| 47 |
// Create a copy of the slot object. A pointer to this will be passed |
| 48 |
// through the callback's data parameter. It will be deleted |
| 49 |
// when SignalProxy_SlotForwardPage_gtk_callback_destroy() is called. |
| 50 |
auto slot_copy = new SlotForwardPage(slot); |
| 51 |
|
| 52 |
gtk_assistant_set_forward_page_func(gobj(), |
| 53 |
&SignalProxy_SlotForwardPage_gtk_callback, slot_copy, |
| 54 |
&SignalProxy_SlotForwardPage_gtk_callback_destroy); |
| 55 |
} |
| 56 |
|
| 57 |
} // namespace Gtk |