// Generated by gtkmmproc -- DO NOT MODIFY!


#include <cluttermm/alpha.h>
#include <cluttermm/private/alpha_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
{

static double SignalProxy_Alpha_callback(ClutterAlpha *alpha, gpointer user_data)
{
  double value = 0;
  Clutter::Alpha::SlotAlphaFunc* the_slot = static_cast<Clutter::Alpha::SlotAlphaFunc*>(user_data);

#ifdef GLIBMM_EXCEPTIONS_ENABLED
  try
  {
#endif
    Glib::RefPtr<Clutter::Alpha> cpp_alpha = Glib::wrap(alpha, true /* take reference */);
    value = (*the_slot)(cpp_alpha);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  }
  catch(...)
  {
    Glib::exception_handlers_invoke();
  }
#endif
  return value;
}

static void SignalProxy_Alpha_callback_destroy(void* data)
{
  delete static_cast<Clutter::Alpha::SlotAlphaFunc*>(data);
}

} // anonymous namespace

namespace Clutter
{

Alpha::Alpha(const Glib::RefPtr<Timeline>& timeline, const SlotAlphaFunc& slot)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(alpha_class_.init()))
{
     if(gobject_ && g_object_is_floating (gobject_))
     g_object_ref_sink(gobject_); //Stops it from being floating.

  set_timeline(timeline);
  set_func(slot);
}

void Alpha::set_func(const SlotAlphaFunc& slot)
{
  //Create a copy of the slot. A pointer to this will be passed through the callback's data parameter.
  //It will be deleted when SignalProxy_Alpha_callback_destroy() is called.
  SlotAlphaFunc *const slot_copy = new SlotAlphaFunc(slot);

  clutter_alpha_set_func(
      gobj(),
      &SignalProxy_Alpha_callback, slot_copy,
      &SignalProxy_Alpha_callback_destroy);
}

} // namespace Clutter

namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Clutter::Alpha> wrap(ClutterAlpha* object, bool take_copy)
{
  return Glib::RefPtr<Clutter::Alpha>( dynamic_cast<Clutter::Alpha*> (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& Alpha_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_ = &Alpha_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_alpha_get_type());

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

  }

  return *this;
}


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


}


Glib::ObjectBase* Alpha_Class::wrap_new(GObject* object)
{
  return new Alpha((ClutterAlpha*)object);
}


/* The implementation: */

ClutterAlpha* Alpha::gobj_copy()
{
  reference();
  return gobj();
}

Alpha::Alpha(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{
   if(gobject_ && g_object_is_floating (gobject_))
     g_object_ref_sink(gobject_); //Stops it from being floating.

}

Alpha::Alpha(ClutterAlpha* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


Alpha::~Alpha()
{}


Alpha::CppClassType Alpha::alpha_class_; // initialize static member

GType Alpha::get_type()
{
  return alpha_class_.init().get_type();
}


GType Alpha::get_base_type()
{
  return clutter_alpha_get_type();
}


Alpha::Alpha()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(alpha_class_.init()))
{
  
   if(gobject_ && g_object_is_floating (gobject_))
     g_object_ref_sink(gobject_); //Stops it from being floating.

}

Alpha::Alpha(const Glib::RefPtr<Timeline>& timeline, gulong mode)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(alpha_class_.init(), "timeline", Glib::unwrap(timeline), "mode", mode, static_cast<char*>(0)))
{
  
   if(gobject_ && g_object_is_floating (gobject_))
     g_object_ref_sink(gobject_); //Stops it from being floating.

}

Glib::RefPtr<Alpha> Alpha::create()
{
  return Glib::RefPtr<Alpha>( new Alpha() );
}
Glib::RefPtr<Alpha> Alpha::create(const Glib::RefPtr<Timeline>& timeline, const SlotAlphaFunc& slot)
{
  return Glib::RefPtr<Alpha>( new Alpha(timeline, slot) );
}
Glib::RefPtr<Alpha> Alpha::create(const Glib::RefPtr<Timeline>& timeline, gulong mode)
{
  return Glib::RefPtr<Alpha>( new Alpha(timeline, mode) );
}
void Alpha::set_timeline(const Glib::RefPtr<Timeline>& timeline)
{
clutter_alpha_set_timeline(gobj(), Glib::unwrap(timeline)); 
}

Glib::RefPtr<Timeline> Alpha::get_timeline()
{

  Glib::RefPtr<Timeline> retvalue = Glib::wrap(clutter_alpha_get_timeline(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const Timeline> Alpha::get_timeline() const
{
  return const_cast<Alpha*>(this)->get_timeline();
}

double Alpha::get_alpha() const
{
  return clutter_alpha_get_alpha(const_cast<ClutterAlpha*>(gobj()));
}

void Alpha::set_mode(gulong mode)
{
clutter_alpha_set_mode(gobj(), mode); 
}

gulong Alpha::get_mode() const
{
  return clutter_alpha_get_mode(const_cast<ClutterAlpha*>(gobj()));
}


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

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

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


} // namespace Clutter


