// Generated by gtkmmproc -- DO NOT MODIFY!


#include <gdlmm/dock.h>
#include <gdlmm/private/dock_p.h>

#include <gdl/gdl-dock.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
{

Dock* Dock::get_toplevel() const
{
  return Glib::wrap(gdl_dock_object_get_toplevel((GdlDockObject*) const_cast<GdlDock*>(gobj())));
}

} // namespace Gdl

namespace
{


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


} // anonymous namespace


namespace Glib
{

Gdl::Dock* wrap(GdlDock* object, bool take_copy)
{
  return dynamic_cast<Gdl::Dock *> (Glib::wrap_auto ((GObject*)(object), take_copy));
}

} /* namespace Glib */

namespace Gdl
{


/* The *_Class implementation: */

const Glib::Class& Dock_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_ = &Dock_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_get_type());

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

  }

  return *this;
}


void Dock_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);

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
  klass->layout_changed = &layout_changed_callback;
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
}

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void Dock_Class::layout_changed_callback(GdlDock* 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);
}
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED


Glib::ObjectBase* Dock_Class::wrap_new(GObject* o)
{
  return manage(new Dock((GdlDock*)(o)));

}


/* The implementation: */

Dock::Dock(const Glib::ConstructParams& construct_params)
:
  DockObject(construct_params)
{
  }

Dock::Dock(GdlDock* castitem)
:
  DockObject((GdlDockObject*)(castitem))
{
  }

Dock::~Dock()
{
  destroy_();
}

Dock::CppClassType Dock::dock_class_; // initialize static member

GType Dock::get_type()
{
  return dock_class_.init().get_type();
}


GType Dock::get_base_type()
{
  return gdl_dock_get_type();
}


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

}

Dock::Dock(Dock& original, bool floating)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  DockObject(Glib::ConstructParams(dock_class_.init(), "original", original.gobj(), "floating", static_cast<int>(floating), static_cast<char*>(0)))
{
  

}

void Dock::add_item(DockItem& item, DockPlacement place)
{
gdl_dock_add_item(gobj(), item.gobj(), ((GdlDockPlacement)(place))); 
}

void Dock::add_floating_item(DockItem& item, int x, int y, int width, int height)
{
gdl_dock_add_floating_item(gobj(), item.gobj(), x, y, width, height); 
}

DockItem* Dock::get_item_by_name(const Glib::ustring& name) const
{
  return Glib::wrap(gdl_dock_get_item_by_name(const_cast<GdlDock*>(gobj()), name.c_str()));
}

DockPlaceholder* Dock::get_placeholder_by_name(const Glib::ustring& name) const
{
  return Glib::wrap(gdl_dock_get_placeholder_by_name(const_cast<GdlDock*>(gobj()), name.c_str()));
}

Glib::ListHandle<DockItem*> Dock::get_named_items() const
{
  return Glib::ListHandle<DockItem*>(gdl_dock_get_named_items(const_cast<GdlDock*>(gobj())), Glib::OWNERSHIP_SHALLOW);
}

void Dock::xor_rect(GdkRectangle * rect)
{
gdl_dock_xor_rect(gobj(), rect); 
}


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


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

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

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<bool> Dock::property_floating() const
{
  return Glib::PropertyProxy_ReadOnly<bool>(this, "floating");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<int> Dock::property_floatx() 
{
  return Glib::PropertyProxy<int>(this, "floatx");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<int> Dock::property_floatx() const
{
  return Glib::PropertyProxy_ReadOnly<int>(this, "floatx");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<int> Dock::property_floaty() 
{
  return Glib::PropertyProxy<int>(this, "floaty");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<int> Dock::property_floaty() const
{
  return Glib::PropertyProxy_ReadOnly<int>(this, "floaty");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<int> Dock::property_height() 
{
  return Glib::PropertyProxy<int>(this, "height");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<int> Dock::property_height() const
{
  return Glib::PropertyProxy_ReadOnly<int>(this, "height");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<int> Dock::property_width() 
{
  return Glib::PropertyProxy<int>(this, "width");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<int> Dock::property_width() const
{
  return Glib::PropertyProxy_ReadOnly<int>(this, "width");
}
#endif //GLIBMM_PROPERTIES_ENABLED


#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void Gdl::Dock::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());
}
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED


} // namespace Gdl


