// Generated by gtkmmproc -- DO NOT MODIFY! #include #include #include // -*- 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 namespace Gtk { void Calendar::get_date(Glib::Date& date) const { guint year = 0; guint month = 0; guint day = 0; get_date(year, month, day); date.set_year(year); date.set_month(static_cast(Glib::Date::JANUARY + month)); // Month from 1 to 12 instead from 0 to 11 date.set_day(day); } } //namespace Gtk namespace { static const Glib::SignalProxyInfo Calendar_signal_month_changed_info = { "month_changed", (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, (GCallback) &Glib::SignalProxyNormal::slot0_void_callback }; static const Glib::SignalProxyInfo Calendar_signal_day_selected_info = { "day_selected", (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, (GCallback) &Glib::SignalProxyNormal::slot0_void_callback }; static const Glib::SignalProxyInfo Calendar_signal_day_selected_double_click_info = { "day_selected_double_click", (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, (GCallback) &Glib::SignalProxyNormal::slot0_void_callback }; static const Glib::SignalProxyInfo Calendar_signal_prev_month_info = { "prev_month", (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, (GCallback) &Glib::SignalProxyNormal::slot0_void_callback }; static const Glib::SignalProxyInfo Calendar_signal_next_month_info = { "next_month", (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, (GCallback) &Glib::SignalProxyNormal::slot0_void_callback }; static const Glib::SignalProxyInfo Calendar_signal_prev_year_info = { "prev_year", (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, (GCallback) &Glib::SignalProxyNormal::slot0_void_callback }; static const Glib::SignalProxyInfo Calendar_signal_next_year_info = { "next_year", (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, (GCallback) &Glib::SignalProxyNormal::slot0_void_callback }; } // anonymous namespace // static GType Glib::Value::value_type() { return gtk_calendar_display_options_get_type(); } namespace Glib { Gtk::Calendar* wrap(GtkCalendar* object, bool take_copy) { return dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)); } } /* namespace Glib */ namespace Gtk { /* The *_Class implementation: */ const Glib::Class& Calendar_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_ = &Calendar_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_calendar_get_type()); // Add derived versions of interfaces, if the C type implements any interfaces: } return *this; } void Calendar_Class::class_init_function(void* g_class, void* class_data) { BaseClassType *const klass = static_cast(g_class); CppClassParent::class_init_function(klass, class_data); #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED klass->month_changed = &month_changed_callback; klass->day_selected = &day_selected_callback; klass->day_selected_double_click = &day_selected_double_click_callback; klass->prev_month = &prev_month_callback; klass->next_month = &next_month_callback; klass->prev_year = &prev_year_callback; klass->next_year = &next_year_callback; #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED } #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED void Calendar_Class::month_changed_callback(GtkCalendar* self) { Glib::ObjectBase *const obj_base = static_cast( 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(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_month_changed(); return; #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } #endif //GLIBMM_EXCEPTIONS_ENABLED } } BaseClassType *const base = static_cast( 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->month_changed) (*base->month_changed)(self); } void Calendar_Class::day_selected_callback(GtkCalendar* self) { Glib::ObjectBase *const obj_base = static_cast( 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(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_day_selected(); return; #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } #endif //GLIBMM_EXCEPTIONS_ENABLED } } BaseClassType *const base = static_cast( 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->day_selected) (*base->day_selected)(self); } void Calendar_Class::day_selected_double_click_callback(GtkCalendar* self) { Glib::ObjectBase *const obj_base = static_cast( 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(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_day_selected_double_click(); return; #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } #endif //GLIBMM_EXCEPTIONS_ENABLED } } BaseClassType *const base = static_cast( 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->day_selected_double_click) (*base->day_selected_double_click)(self); } void Calendar_Class::prev_month_callback(GtkCalendar* self) { Glib::ObjectBase *const obj_base = static_cast( 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(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_prev_month(); return; #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } #endif //GLIBMM_EXCEPTIONS_ENABLED } } BaseClassType *const base = static_cast( 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->prev_month) (*base->prev_month)(self); } void Calendar_Class::next_month_callback(GtkCalendar* self) { Glib::ObjectBase *const obj_base = static_cast( 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(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_next_month(); return; #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } #endif //GLIBMM_EXCEPTIONS_ENABLED } } BaseClassType *const base = static_cast( 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->next_month) (*base->next_month)(self); } void Calendar_Class::prev_year_callback(GtkCalendar* self) { Glib::ObjectBase *const obj_base = static_cast( 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(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_prev_year(); return; #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } #endif //GLIBMM_EXCEPTIONS_ENABLED } } BaseClassType *const base = static_cast( 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->prev_year) (*base->prev_year)(self); } void Calendar_Class::next_year_callback(GtkCalendar* self) { Glib::ObjectBase *const obj_base = static_cast( 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(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_next_year(); return; #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } #endif //GLIBMM_EXCEPTIONS_ENABLED } } BaseClassType *const base = static_cast( 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->next_year) (*base->next_year)(self); } #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED Glib::ObjectBase* Calendar_Class::wrap_new(GObject* o) { return manage(new Calendar((GtkCalendar*)(o))); } /* The implementation: */ Calendar::Calendar(const Glib::ConstructParams& construct_params) : Gtk::Widget(construct_params) { } Calendar::Calendar(GtkCalendar* castitem) : Gtk::Widget((GtkWidget*)(castitem)) { } Calendar::~Calendar() { destroy_(); } Calendar::CppClassType Calendar::calendar_class_; // initialize static member GType Calendar::get_type() { return calendar_class_.init().get_type(); } GType Calendar::get_base_type() { return gtk_calendar_get_type(); } Calendar::Calendar() : // Mark this class as non-derived to allow C++ vfuncs to be skipped. Glib::ObjectBase(0), Gtk::Widget(Glib::ConstructParams(calendar_class_.init())) { } int Calendar::select_month(guint month, guint year) { return gtk_calendar_select_month(gobj(), month, year); } void Calendar::select_day(guint day) { gtk_calendar_select_day(gobj(), day); } int Calendar::mark_day(guint day) { return gtk_calendar_mark_day(gobj(), day); } int Calendar::unmark_day(guint day) { return gtk_calendar_unmark_day(gobj(), day); } void Calendar::clear_marks() { gtk_calendar_clear_marks(gobj()); } #ifndef GTKMM_DISABLE_DEPRECATED void Calendar::display_options(CalendarDisplayOptions flags) { gtk_calendar_display_options(gobj(), ((GtkCalendarDisplayOptions)(flags))); } #endif // GTKMM_DISABLE_DEPRECATED void Calendar::set_display_options(CalendarDisplayOptions flags) { gtk_calendar_set_display_options(gobj(), ((GtkCalendarDisplayOptions)(flags))); } CalendarDisplayOptions Calendar::get_display_options() const { return ((CalendarDisplayOptions)(gtk_calendar_get_display_options(const_cast(gobj())))); } void Calendar::get_date(guint& year, guint& month, guint& day) const { gtk_calendar_get_date(const_cast(gobj()), &(year), &(month), &(day)); } void Calendar::freeze() { gtk_calendar_freeze(gobj()); } void Calendar::thaw() { gtk_calendar_thaw(gobj()); } Glib::SignalProxy0< void > Calendar::signal_month_changed() { return Glib::SignalProxy0< void >(this, &Calendar_signal_month_changed_info); } Glib::SignalProxy0< void > Calendar::signal_day_selected() { return Glib::SignalProxy0< void >(this, &Calendar_signal_day_selected_info); } Glib::SignalProxy0< void > Calendar::signal_day_selected_double_click() { return Glib::SignalProxy0< void >(this, &Calendar_signal_day_selected_double_click_info); } Glib::SignalProxy0< void > Calendar::signal_prev_month() { return Glib::SignalProxy0< void >(this, &Calendar_signal_prev_month_info); } Glib::SignalProxy0< void > Calendar::signal_next_month() { return Glib::SignalProxy0< void >(this, &Calendar_signal_next_month_info); } Glib::SignalProxy0< void > Calendar::signal_prev_year() { return Glib::SignalProxy0< void >(this, &Calendar_signal_prev_year_info); } Glib::SignalProxy0< void > Calendar::signal_next_year() { return Glib::SignalProxy0< void >(this, &Calendar_signal_next_year_info); } #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED void Gtk::Calendar::on_month_changed() { BaseClassType *const base = static_cast( 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->month_changed) (*base->month_changed)(gobj()); } void Gtk::Calendar::on_day_selected() { BaseClassType *const base = static_cast( 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->day_selected) (*base->day_selected)(gobj()); } void Gtk::Calendar::on_day_selected_double_click() { BaseClassType *const base = static_cast( 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->day_selected_double_click) (*base->day_selected_double_click)(gobj()); } void Gtk::Calendar::on_prev_month() { BaseClassType *const base = static_cast( 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->prev_month) (*base->prev_month)(gobj()); } void Gtk::Calendar::on_next_month() { BaseClassType *const base = static_cast( 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->next_month) (*base->next_month)(gobj()); } void Gtk::Calendar::on_prev_year() { BaseClassType *const base = static_cast( 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->prev_year) (*base->prev_year)(gobj()); } void Gtk::Calendar::on_next_year() { BaseClassType *const base = static_cast( 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->next_year) (*base->next_year)(gobj()); } #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED } // namespace Gtk