// -*- c++ -*-
/* $Id: assistant.ccg,v 1.3 2006/05/11 11:40:24 murrayc Exp $ */

/* 
 *
 * Copyright 2006 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gtk/gtkassistant.h>
#include <gtk/gtklabel.h>



static gint SignalProxy_SlotForwardPage_gtk_callback(gint current_page, gpointer data)
{
  Gtk::Assistant::SlotForwardPage* the_slot = static_cast<Gtk::Assistant::SlotForwardPage*>(data);

  #ifdef GLIBMM_EXCEPTIONS_ENABLED
  try
  {
  #endif //GLIBMM_EXCEPTIONS_ENABLED
    return (*the_slot)(current_page);
  #ifdef GLIBMM_EXCEPTIONS_ENABLED
  }
  catch(...)
  {
    Glib::exception_handlers_invoke();
    return gint();
  }
  #endif //GLIBMM_EXCEPTIONS_ENABLED
}

static void SignalProxy_SlotForwardPage_gtk_callback_destroy(void* data)
{
  delete static_cast<Gtk::Assistant::SlotForwardPage*>(data);
}


namespace Gtk
{

void Assistant::set_forward_page_func(const SlotForwardPage& 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_SlotForwardPage_gtk_callback_destroy() is called.
  SlotForwardPage* slot_copy = new SlotForwardPage(slot);

  gtk_assistant_set_forward_page_func(gobj(), 
      &SignalProxy_SlotForwardPage_gtk_callback, slot_copy,
      &SignalProxy_SlotForwardPage_gtk_callback_destroy);
}
  

} // namespace Gtk

