13
0
livetrax/libs/tk/ytkmm/range.cc

740 lines
20 KiB
C++
Raw Permalink Normal View History

// Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
//Allow use of deprecated API, to avoid the need to break our own ABI:
#undef GTK_DISABLE_DEPRECATED
#include <glibmm.h>
#include <gtkmm/range.h>
#include <gtkmm/private/range_p.h>
// -*- c++ -*-
/* $Id: range.ccg,v 1.1 2003/01/21 13:40:35 murrayc Exp $ */
/* 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 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 <gtk/gtk.h>
#include <gtkmm/adjustment.h>
namespace Gtk
{
void Range::unset_adjustment()
{
gtk_range_set_adjustment(gobj(), 0);
}
Gdk::Rectangle Range::get_range_rect() const
{
Gdk::Rectangle result;
gtk_range_get_range_rect(const_cast<GtkRange*>(gobj()), result.gobj());
return result;
}
} // namespace Gtk
namespace
{
static const Glib::SignalProxyInfo Range_signal_value_changed_info =
{
"value_changed",
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};
static void Range_signal_adjust_bounds_callback(GtkRange* self, gdouble p0,void* data)
{
using namespace Gtk;
typedef sigc::slot< void,double > SlotType;
Range* obj = dynamic_cast<Range*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
// Do not try to call a signal on a disassociated wrapper.
if(obj)
{
try
{
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
(*static_cast<SlotType*>(slot))(p0
);
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
}
static const Glib::SignalProxyInfo Range_signal_adjust_bounds_info =
{
"adjust_bounds",
(GCallback) &Range_signal_adjust_bounds_callback,
(GCallback) &Range_signal_adjust_bounds_callback
};
static void Range_signal_move_slider_callback(GtkRange* self, GtkScrollType p0,void* data)
{
using namespace Gtk;
typedef sigc::slot< void,ScrollType > SlotType;
Range* obj = dynamic_cast<Range*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
// Do not try to call a signal on a disassociated wrapper.
if(obj)
{
try
{
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
(*static_cast<SlotType*>(slot))(((ScrollType)(p0))
);
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
}
static const Glib::SignalProxyInfo Range_signal_move_slider_info =
{
"move_slider",
(GCallback) &Range_signal_move_slider_callback,
(GCallback) &Range_signal_move_slider_callback
};
static gboolean Range_signal_change_value_callback(GtkRange* self, GtkScrollType p0,gdouble p1,void* data)
{
using namespace Gtk;
typedef sigc::slot< bool,ScrollType,double > SlotType;
Range* obj = dynamic_cast<Range*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
// Do not try to call a signal on a disassociated wrapper.
if(obj)
{
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();
}
static 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;
Range* obj = dynamic_cast<Range*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
// Do not try to call a signal on a disassociated wrapper.
if(obj)
{
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();
}
static 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)
{
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.
{
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)
);
return;
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
}
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)
{
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.
{
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();
return;
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
}
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)
{
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.
{
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
);
return;
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
}
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)
{
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.
{
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))
);
return;
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
}
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()
:
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
Glib::ObjectBase(0),
Gtk::Widget(Glib::ConstructParams(range_class_.init()))
{
}
#ifndef GTKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
void Range::set_update_policy(UpdateType policy)
{
gtk_range_set_update_policy(gobj(), ((GtkUpdateType)(policy)));
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // GTKMM_DISABLE_DEPRECATED
#ifndef GTKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
UpdateType Range::get_update_policy() const
{
return ((UpdateType)(gtk_range_get_update_policy(const_cast<GtkRange*>(gobj()))));
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // GTKMM_DISABLE_DEPRECATED
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 const_cast<Range*>(this)->get_adjustment();
}
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_flippable(bool flippable)
{
gtk_range_set_flippable(gobj(), static_cast<int>(flippable));
}
bool Range::get_flippable() const
{
return gtk_range_get_flippable(const_cast<GtkRange*>(gobj()));
}
void Range::set_slider_size_fixed(bool size_fixed)
{
gtk_range_set_slider_size_fixed(gobj(), static_cast<int>(size_fixed));
}
bool Range::get_slider_size_fixed() const
{
return gtk_range_get_slider_size_fixed(const_cast<GtkRange*>(gobj()));
}
void Range::set_min_slider_size(bool min_size)
{
gtk_range_set_min_slider_size(gobj(), static_cast<int>(min_size));
}
int Range::get_min_slider_size() const
{
return gtk_range_get_min_slider_size(const_cast<GtkRange*>(gobj()));
}
void Range::get_slider_range(int& slider_start, int& slider_end) const
{
gtk_range_get_slider_range(const_cast<GtkRange*>(gobj()), &(slider_start), &(slider_end));
}
void Range::set_lower_stepper_sensitivity(SensitivityType sensitivity)
{
gtk_range_set_lower_stepper_sensitivity(gobj(), ((GtkSensitivityType)(sensitivity)));
}
SensitivityType Range::get_lower_stepper_sensitivity() const
{
return ((SensitivityType)(gtk_range_get_lower_stepper_sensitivity(const_cast<GtkRange*>(gobj()))));
}
void Range::set_upper_stepper_sensitivity(SensitivityType sensitivity)
{
gtk_range_set_upper_stepper_sensitivity(gobj(), ((GtkSensitivityType)(sensitivity)));
}
SensitivityType Range::get_upper_stepper_sensitivity() const
{
return ((SensitivityType)(gtk_range_get_upper_stepper_sensitivity(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()));
}
void Range::set_show_fill_level(bool show_fill_level)
{
gtk_range_set_show_fill_level(gobj(), static_cast<int>(show_fill_level));
}
bool Range::get_show_fill_level() const
{
return gtk_range_get_show_fill_level(const_cast<GtkRange*>(gobj()));
}
void Range::set_restrict_to_fill_level(bool restrict_to_fill_level)
{
gtk_range_set_restrict_to_fill_level(gobj(), static_cast<int>(restrict_to_fill_level));
}
bool Range::get_restrict_to_fill_level() const
{
return gtk_range_get_restrict_to_fill_level(const_cast<GtkRange*>(gobj()));
}
void Range::set_fill_level(double fill_level)
{
gtk_range_set_fill_level(gobj(), fill_level);
}
double Range::get_fill_level() const
{
return gtk_range_get_fill_level(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");
}
Glib::PropertyProxy< SensitivityType > Range::property_lower_stepper_sensitivity()
{
return Glib::PropertyProxy< SensitivityType >(this, "lower-stepper-sensitivity");
}
Glib::PropertyProxy_ReadOnly< SensitivityType > Range::property_lower_stepper_sensitivity() const
{
return Glib::PropertyProxy_ReadOnly< SensitivityType >(this, "lower-stepper-sensitivity");
}
Glib::PropertyProxy< SensitivityType > Range::property_upper_stepper_sensitivity()
{
return Glib::PropertyProxy< SensitivityType >(this, "upper-stepper-sensitivity");
}
Glib::PropertyProxy_ReadOnly< SensitivityType > Range::property_upper_stepper_sensitivity() const
{
return Glib::PropertyProxy_ReadOnly< SensitivityType >(this, "upper-stepper-sensitivity");
}
Glib::PropertyProxy< bool > Range::property_show_fill_level()
{
return Glib::PropertyProxy< bool >(this, "show-fill-level");
}
Glib::PropertyProxy_ReadOnly< bool > Range::property_show_fill_level() const
{
return Glib::PropertyProxy_ReadOnly< bool >(this, "show-fill-level");
}
Glib::PropertyProxy< bool > Range::property_restrict_to_fill_level()
{
return Glib::PropertyProxy< bool >(this, "restrict-to-fill-level");
}
Glib::PropertyProxy_ReadOnly< bool > Range::property_restrict_to_fill_level() const
{
return Glib::PropertyProxy_ReadOnly< bool >(this, "restrict-to-fill-level");
}
Glib::PropertyProxy< double > Range::property_fill_level()
{
return Glib::PropertyProxy< double >(this, "fill-level");
}
Glib::PropertyProxy_ReadOnly< double > Range::property_fill_level() const
{
return Glib::PropertyProxy_ReadOnly< double >(this, "fill-level");
}
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(Gtk::Border* 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