13
0
livetrax/libs/gtkmm2/gtk/gtkmm/range.cc
Taybin Rutkin d09f6b3016 Initial revision
git-svn-id: svn://localhost/trunk/ardour2@4 d708f5d6-7413-0410-9779-e7cbd77b26cf
2005-05-13 20:47:18 +00:00

555 lines
15 KiB
C++

// Generated by gtkmmproc -- DO NOT MODIFY!
#include <gtkmm/range.h>
#include <gtkmm/private/range_p.h>
// -*- c++ -*-
/* $Id$ */
/* Copyright 1998-2002 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/gtkrange.h>
#include <gtkmm/adjustment.h>
namespace Gtk
{
void Range::unset_adjustment()
{
gtk_range_set_adjustment(gobj(), 0);
}
} // namespace Gtk
namespace
{
const Glib::SignalProxyInfo Range_signal_value_changed_info =
{
"value_changed",
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};
void Range_signal_adjust_bounds_callback(GtkRange* self, gdouble p0,void* data)
{
using namespace Gtk;
typedef sigc::slot< void,double > SlotType;
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
try
{
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
(*static_cast<SlotType*>(slot))(p0
);
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
}
const Glib::SignalProxyInfo Range_signal_adjust_bounds_info =
{
"adjust_bounds",
(GCallback) &Range_signal_adjust_bounds_callback,
(GCallback) &Range_signal_adjust_bounds_callback
};
void Range_signal_move_slider_callback(GtkRange* self, GtkScrollType p0,void* data)
{
using namespace Gtk;
typedef sigc::slot< void,ScrollType > SlotType;
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
try
{
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
(*static_cast<SlotType*>(slot))(((ScrollType)(p0))
);
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
}
const Glib::SignalProxyInfo Range_signal_move_slider_info =
{
"move_slider",
(GCallback) &Range_signal_move_slider_callback,
(GCallback) &Range_signal_move_slider_callback
};
gboolean Range_signal_change_value_callback(GtkRange* self, GtkScrollType p0,gdouble p1,void* data)
{
using namespace Gtk;
typedef sigc::slot< bool,ScrollType,double > SlotType;
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
try
{
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
return static_cast<int>((*static_cast<SlotType*>(slot))(((ScrollType)(p0))
, p1
));
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
typedef gboolean RType;
return RType();
}
gboolean Range_signal_change_value_notify_callback(GtkRange* self, GtkScrollType p0,gdouble p1, void* data)
{
using namespace Gtk;
typedef sigc::slot< void,ScrollType,double > SlotType;
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
{
try
{
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
(*static_cast<SlotType*>(slot))(((ScrollType)(p0))
, p1
);
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
typedef gboolean RType;
return RType();
}
const Glib::SignalProxyInfo Range_signal_change_value_info =
{
"change_value",
(GCallback) &Range_signal_change_value_callback,
(GCallback) &Range_signal_change_value_notify_callback
};
} // anonymous namespace
namespace Glib
{
Gtk::Range* wrap(GtkRange* object, bool take_copy)
{
return dynamic_cast<Gtk::Range *> (Glib::wrap_auto ((GObject*)(object), take_copy));
}
} /* namespace Glib */
namespace Gtk
{
/* The *_Class implementation: */
const Glib::Class& Range_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_ = &Range_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(gtk_range_get_type());
// Add derived versions of interfaces, if the C type implements any interfaces:
}
return *this;
}
void Range_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->get_range_border = &get_range_border_vfunc_callback;
klass->value_changed = &value_changed_callback;
klass->adjust_bounds = &adjust_bounds_callback;
klass->move_slider = &move_slider_callback;
}
void Range_Class::get_range_border_vfunc_callback(GtkRange* self, GtkBorder* border)
{
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
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 && obj->is_derived_())
{
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
// Call the virtual member method, which derived classes might override.
obj->get_range_border_vfunc(border);
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
else
{
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->get_range_border)
(*base->get_range_border)(self, border);
}
}
void Range_Class::value_changed_callback(GtkRange* self)
{
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
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 && obj->is_derived_())
{
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
// Call the virtual member method, which derived classes might override.
obj->on_value_changed();
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
else
{
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->value_changed)
(*base->value_changed)(self);
}
}
void Range_Class::adjust_bounds_callback(GtkRange* self, gdouble p0)
{
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
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 && obj->is_derived_())
{
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
// Call the virtual member method, which derived classes might override.
obj->on_adjust_bounds(p0
);
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
else
{
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->adjust_bounds)
(*base->adjust_bounds)(self, p0);
}
}
void Range_Class::move_slider_callback(GtkRange* self, GtkScrollType p0)
{
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
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 && obj->is_derived_())
{
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
// Call the virtual member method, which derived classes might override.
obj->on_move_slider(((ScrollType)(p0))
);
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
else
{
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->move_slider)
(*base->move_slider)(self, p0);
}
}
Glib::ObjectBase* Range_Class::wrap_new(GObject* o)
{
return manage(new Range((GtkRange*)(o)));
}
/* The implementation: */
Range::Range(const Glib::ConstructParams& construct_params)
:
Gtk::Widget(construct_params)
{
}
Range::Range(GtkRange* castitem)
:
Gtk::Widget((GtkWidget*)(castitem))
{
}
Range::~Range()
{
destroy_();
}
Range::CppClassType Range::range_class_; // initialize static member
GType Range::get_type()
{
return range_class_.init().get_type();
}
GType Range::get_base_type()
{
return gtk_range_get_type();
}
Range::Range()
:
Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
Gtk::Widget(Glib::ConstructParams(range_class_.init()))
{
}
void Range::set_update_policy(UpdateType policy)
{
gtk_range_set_update_policy(gobj(), ((GtkUpdateType)(policy)));
}
UpdateType Range::get_update_policy() const
{
return ((UpdateType)(gtk_range_get_update_policy(const_cast<GtkRange*>(gobj()))));
}
void Range::set_adjustment(Gtk::Adjustment& adjustment)
{
gtk_range_set_adjustment(gobj(), (adjustment).gobj());
}
Gtk::Adjustment* Range::get_adjustment()
{
return Glib::wrap(gtk_range_get_adjustment(gobj()));
}
const Gtk::Adjustment* Range::get_adjustment() const
{
return Glib::wrap(gtk_range_get_adjustment(const_cast<GtkRange*>(gobj())));
}
void Range::set_inverted(bool setting)
{
gtk_range_set_inverted(gobj(), static_cast<int>(setting));
}
bool Range::get_inverted() const
{
return gtk_range_get_inverted(const_cast<GtkRange*>(gobj()));
}
void Range::set_increments(double step, double page)
{
gtk_range_set_increments(gobj(), step, page);
}
void Range::set_range(double min, double max)
{
gtk_range_set_range(gobj(), min, max);
}
void Range::set_value(double value)
{
gtk_range_set_value(gobj(), value);
}
double Range::get_value() const
{
return gtk_range_get_value(const_cast<GtkRange*>(gobj()));
}
Glib::SignalProxy0< void > Range::signal_value_changed()
{
return Glib::SignalProxy0< void >(this, &Range_signal_value_changed_info);
}
Glib::SignalProxy1< void,double > Range::signal_adjust_bounds()
{
return Glib::SignalProxy1< void,double >(this, &Range_signal_adjust_bounds_info);
}
Glib::SignalProxy1< void,ScrollType > Range::signal_move_slider()
{
return Glib::SignalProxy1< void,ScrollType >(this, &Range_signal_move_slider_info);
}
Glib::SignalProxy2< bool,ScrollType,double > Range::signal_change_value()
{
return Glib::SignalProxy2< bool,ScrollType,double >(this, &Range_signal_change_value_info);
}
Glib::PropertyProxy<UpdateType> Range::property_update_policy()
{
return Glib::PropertyProxy<UpdateType>(this, "update-policy");
}
Glib::PropertyProxy_ReadOnly<UpdateType> Range::property_update_policy() const
{
return Glib::PropertyProxy_ReadOnly<UpdateType>(this, "update-policy");
}
Glib::PropertyProxy<Adjustment*> Range::property_adjustment()
{
return Glib::PropertyProxy<Adjustment*>(this, "adjustment");
}
Glib::PropertyProxy_ReadOnly<Adjustment*> Range::property_adjustment() const
{
return Glib::PropertyProxy_ReadOnly<Adjustment*>(this, "adjustment");
}
Glib::PropertyProxy<bool> Range::property_inverted()
{
return Glib::PropertyProxy<bool>(this, "inverted");
}
Glib::PropertyProxy_ReadOnly<bool> Range::property_inverted() const
{
return Glib::PropertyProxy_ReadOnly<bool>(this, "inverted");
}
void Gtk::Range::on_value_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->value_changed)
(*base->value_changed)(gobj());
}
void Gtk::Range::on_adjust_bounds(double new_value)
{
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->adjust_bounds)
(*base->adjust_bounds)(gobj(),new_value);
}
void Gtk::Range::on_move_slider(ScrollType scroll)
{
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->move_slider)
(*base->move_slider)(gobj(),((GtkScrollType)(scroll)));
}
void Gtk::Range::get_range_border_vfunc(GtkBorder* border) const
{
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->get_range_border)
(*base->get_range_border)(const_cast<GtkRange*>(gobj()),border);
}
} // namespace Gtk