// Generated by gtkmmproc -- DO NOT MODIFY!


#include <glibmm.h>

#include <gdlmm/dockmaster.h>
#include <gdlmm/private/dockmaster_p.h>

#include <gdl/gdl-dock-master.h>

/* Copyright (c) 2009  Fabien Parent <parent.f@gmail.com>
 *
 * This file is part of gdlmm.
 *
 * gdlmm 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.
 *
 * gdlmm 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 program.  If not, see <http://www.gnu.org/licenses/>.
 */

namespace Gdl
{

} // namespace Gdl

namespace
{


static const Glib::SignalProxyInfo DockMaster_signal_layout_changed_info =
{
  "layout-changed",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


} // anonymous namespace

// static
GType Glib::Value<Gdl::SwitcherStyle>::value_type()
{
  return gdl_switcher_style_get_type();
}


namespace Glib
{

Glib::RefPtr<Gdl::DockMaster> wrap(GdlDockMaster* object, bool take_copy)
{
  return Glib::RefPtr<Gdl::DockMaster>( dynamic_cast<Gdl::DockMaster*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gdl
{


/* The *_Class implementation: */

const Glib::Class& DockMaster_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &DockMaster_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gdl_dock_master_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void DockMaster_Class::class_init_function(void* g_class, void* class_data)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


  klass->layout_changed = &layout_changed_callback;
}


void DockMaster_Class::layout_changed_callback(GdlDockMaster* self)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_layout_changed();
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->layout_changed)
    (*base->layout_changed)(self);
}


Glib::ObjectBase* DockMaster_Class::wrap_new(GObject* object)
{
  return new DockMaster((GdlDockMaster*)object);
}


/* The implementation: */

GdlDockMaster* DockMaster::gobj_copy()
{
  reference();
  return gobj();
}

DockMaster::DockMaster(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

DockMaster::DockMaster(GdlDockMaster* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


DockMaster::~DockMaster()
{}


DockMaster::CppClassType DockMaster::dockmaster_class_; // initialize static member

GType DockMaster::get_type()
{
  return dockmaster_class_.init().get_type();
}


GType DockMaster::get_base_type()
{
  return gdl_dock_master_get_type();
}


DockMaster::DockMaster()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(dockmaster_class_.init()))
{
  

}

Glib::RefPtr<DockMaster> DockMaster::create()
{
  return Glib::RefPtr<DockMaster>( new DockMaster() );
}

void DockMaster::add(DockObject& object)
{
  gdl_dock_master_add(gobj(), object.gobj());
}

void DockMaster::remove(DockObject& object)
{
  gdl_dock_master_remove(gobj(), object.gobj());
}

Gdl::DockObject* DockMaster::get_object(const Glib::ustring& nick_name) const
{
  return Glib::wrap(gdl_dock_master_get_object(const_cast<GdlDockMaster*>(gobj()), nick_name.c_str()));
}

Gdl::DockObject* DockMaster::get_controller() const
{
  return Glib::wrap(gdl_dock_master_get_controller(const_cast<GdlDockMaster*>(gobj())));
}

void DockMaster::set_controller(DockObject& object)
{
  gdl_dock_master_set_controller(gobj(), object.gobj());
}


Glib::SignalProxy0< void > DockMaster::signal_layout_changed()
{
  return Glib::SignalProxy0< void >(this, &DockMaster_signal_layout_changed_info);
}


#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::ustring > DockMaster::property_default_title() 
{
  return Glib::PropertyProxy< Glib::ustring >(this, "default-title");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::ustring > DockMaster::property_default_title() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "default-title");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< int > DockMaster::property_locked() 
{
  return Glib::PropertyProxy< int >(this, "locked");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< int > DockMaster::property_locked() const
{
  return Glib::PropertyProxy_ReadOnly< int >(this, "locked");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< SwitcherStyle > DockMaster::property_switcher_style() 
{
  return Glib::PropertyProxy< SwitcherStyle >(this, "switcher-style");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< SwitcherStyle > DockMaster::property_switcher_style() const
{
  return Glib::PropertyProxy_ReadOnly< SwitcherStyle >(this, "switcher-style");
}
#endif //GLIBMM_PROPERTIES_ENABLED


void Gdl::DockMaster::on_layout_changed()
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->layout_changed)
    (*base->layout_changed)(gobj());
}


} // namespace Gdl


