// Generated by gtkmmproc -- DO NOT MODIFY!


#include <cluttermm/animation.h>
#include <cluttermm/private/animation_p.h>

/* Copyright (C) 2007 The cluttermm Development Team
 *
 * This library 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.
 *
 * 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <clutter/clutter.h>

namespace Clutter
{

} //namespace Clutter


namespace
{


static const Glib::SignalProxyInfo Animation_signal_started_info =
{
  "started",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


static const Glib::SignalProxyInfo Animation_signal_completed_info =
{
  "completed",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


} // anonymous namespace


namespace Glib
{

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

} /* namespace Glib */


namespace Clutter
{


/* The *_Class implementation: */

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

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

  }

  return *this;
}


void Animation_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->started = &started_callback;
  klass->completed = &completed_callback;
}


void Animation_Class::started_callback(ClutterAnimation* 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_started();
        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->started)
    (*base->started)(self);
}
void Animation_Class::completed_callback(ClutterAnimation* 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_completed();
        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->completed)
    (*base->completed)(self);
}


Glib::ObjectBase* Animation_Class::wrap_new(GObject* object)
{
  return new Animation((ClutterAnimation*)object);
}


/* The implementation: */

ClutterAnimation* Animation::gobj_copy()
{
  reference();
  return gobj();
}

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

}

Animation::Animation(ClutterAnimation* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


Animation::~Animation()
{}


Animation::CppClassType Animation::animation_class_; // initialize static member

GType Animation::get_type()
{
  return animation_class_.init().get_type();
}


GType Animation::get_base_type()
{
  return clutter_animation_get_type();
}


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

}

Glib::RefPtr<Animation> Animation::create()
{
  return Glib::RefPtr<Animation>( new Animation() );
}
void Animation::set_object(const Glib::RefPtr<Glib::Object>& object)
{
clutter_animation_set_object(gobj(), Glib::unwrap(object)); 
}

Glib::RefPtr<Glib::Object> Animation::get_object()
{
  return Glib::wrap(clutter_animation_get_object(gobj()));
}

Glib::RefPtr<const Glib::Object> Animation::get_object() const
{
  return Glib::wrap(clutter_animation_get_object(const_cast<ClutterAnimation*>(gobj())));
}

void Animation::set_mode(gulong mode)
{
clutter_animation_set_mode(gobj(), mode); 
}

gulong Animation::get_mode() const
{
  return clutter_animation_get_mode(const_cast<ClutterAnimation*>(gobj()));
}

void Animation::set_duration(guint msecs)
{
clutter_animation_set_duration(gobj(), msecs); 
}

guint Animation::get_duration() const
{
  return clutter_animation_get_duration(const_cast<ClutterAnimation*>(gobj()));
}

void Animation::set_loop(bool loop)
{
clutter_animation_set_loop(gobj(), static_cast<int>(loop)); 
}

bool Animation::get_loop() const
{
  return clutter_animation_get_loop(const_cast<ClutterAnimation*>(gobj()));
}

void Animation::set_timeline(const Glib::RefPtr<Timeline>& timeline)
{
clutter_animation_set_timeline(gobj(), Glib::unwrap(timeline)); 
}

Glib::RefPtr<Timeline> Animation::get_timeline() const
{
  return Glib::wrap(clutter_animation_get_timeline(const_cast<ClutterAnimation*>(gobj())));
}

void Animation::set_alpha(const Glib::RefPtr<Alpha>& alpha)
{
clutter_animation_set_alpha(gobj(), Glib::unwrap(alpha)); 
}

Glib::RefPtr<Alpha> Animation::get_alpha() const
{
  return Glib::wrap(clutter_animation_get_alpha(const_cast<ClutterAnimation*>(gobj())));
}

void Animation::completed()
{
clutter_animation_completed(gobj()); 
}

Glib::RefPtr<Animation> Animation::bind(const std::string& property_name, const Glib::ValueBase& final)
{
  return Glib::wrap(clutter_animation_bind(gobj(), property_name.c_str(), (final).gobj()));
}

void Animation::bind_interval(const std::string& property_name, const Glib::RefPtr<Interval>& interval)
{
clutter_animation_bind_interval(gobj(), property_name.c_str(), Glib::unwrap(interval)); 
}

void Animation::update_interval(const std::string& property_name, const Glib::RefPtr<Interval>& interval)
{
clutter_animation_update_interval(gobj(), property_name.c_str(), Glib::unwrap(interval)); 
}

bool Animation::has_property(const std::string& property_name) const
{
  return clutter_animation_has_property(const_cast<ClutterAnimation*>(gobj()), property_name.c_str());
}

Glib::RefPtr<Animation> Animation::update(const std::string& property_name, const Glib::ValueBase& final)
{
  return Glib::wrap(clutter_animation_update(gobj(), property_name.c_str(), (final).gobj()));
}

void Animation::unbind_property(const std::string& property_name)
{
clutter_animation_unbind_property(gobj(), property_name.c_str()); 
}

Glib::RefPtr<Interval> Animation::get_interval(const std::string& property_name) const
{
  return Glib::wrap(clutter_animation_get_interval(const_cast<ClutterAnimation*>(gobj()), property_name.c_str()));
}


Glib::SignalProxy0< void > Animation::signal_started()
{
  return Glib::SignalProxy0< void >(this, &Animation_signal_started_info);
}


Glib::SignalProxy0< void > Animation::signal_completed()
{
  return Glib::SignalProxy0< void >(this, &Animation_signal_completed_info);
}


#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<Glib::Object> > Animation::property_object() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Glib::Object> >(this, "object");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Glib::Object> > Animation::property_object() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Glib::Object> >(this, "object");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<gulong> Animation::property_mode() 
{
  return Glib::PropertyProxy<gulong>(this, "mode");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<gulong> Animation::property_mode() const
{
  return Glib::PropertyProxy_ReadOnly<gulong>(this, "mode");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<guint> Animation::property_duration() 
{
  return Glib::PropertyProxy<guint>(this, "duration");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<guint> Animation::property_duration() const
{
  return Glib::PropertyProxy_ReadOnly<guint>(this, "duration");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<bool> Animation::property_loop() 
{
  return Glib::PropertyProxy<bool>(this, "loop");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<bool> Animation::property_loop() const
{
  return Glib::PropertyProxy_ReadOnly<bool>(this, "loop");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<Timeline> > Animation::property_timeline() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Timeline> >(this, "timeline");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Timeline> > Animation::property_timeline() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Timeline> >(this, "timeline");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<Alpha> > Animation::property_alpha() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Alpha> >(this, "alpha");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Alpha> > Animation::property_alpha() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Alpha> >(this, "alpha");
}
#endif //GLIBMM_PROPERTIES_ENABLED


void Clutter::Animation::on_started()
{
  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->started)
    (*base->started)(gobj());
}
void Clutter::Animation::on_completed()
{
  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->completed)
    (*base->completed)(gobj());
}


} // namespace Clutter


