// Generated by gtkmmproc -- DO NOT MODIFY! #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 { static void Entry_signal_populate_popup_callback(GtkEntry* self, GtkMenu* p0,void* data) { using namespace Gtk; typedef sigc::slot< void,Menu* > SlotType; // Do not try to call a signal on a disassociated wrapper. if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) { #ifdef GLIBMM_EXCEPTIONS_ENABLED try { #endif //GLIBMM_EXCEPTIONS_ENABLED if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) (*static_cast(slot))(Glib::wrap(p0) ); #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } #endif //GLIBMM_EXCEPTIONS_ENABLED } } static const Glib::SignalProxyInfo Entry_signal_populate_popup_info = { "populate_popup", (GCallback) &Entry_signal_populate_popup_callback, (GCallback) &Entry_signal_populate_popup_callback }; static void Entry_signal_insert_at_cursor_callback(GtkEntry* self, const gchar* p0,void* data) { using namespace Gtk; typedef sigc::slot< void,const Glib::ustring& > SlotType; // Do not try to call a signal on a disassociated wrapper. if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) { #ifdef GLIBMM_EXCEPTIONS_ENABLED try { #endif //GLIBMM_EXCEPTIONS_ENABLED if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) (*static_cast(slot))(Glib::convert_const_gchar_ptr_to_ustring(p0) ); #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } #endif //GLIBMM_EXCEPTIONS_ENABLED } } static const Glib::SignalProxyInfo Entry_signal_insert_at_cursor_info = { "insert_at_cursor", (GCallback) &Entry_signal_insert_at_cursor_callback, (GCallback) &Entry_signal_insert_at_cursor_callback }; static const Glib::SignalProxyInfo Entry_signal_activate_info = { "activate", (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, (GCallback) &Glib::SignalProxyNormal::slot0_void_callback }; } // anonymous namespace namespace Glib { Gtk::Entry* wrap(GtkEntry* object, bool take_copy) { return dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)); } } /* namespace Glib */ namespace Gtk { /* The *_Class implementation: */ const Glib::Class& Entry_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_ = &Entry_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_entry_get_type()); // Add derived versions of interfaces, if the C type implements any interfaces: Editable::add_interface(get_type()); CellEditable::add_interface(get_type()); } return *this; } void Entry_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->populate_popup = &populate_popup_callback; klass->insert_at_cursor = &insert_at_cursor_callback; klass->activate = &activate_callback; #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED } #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED void Entry_Class::populate_popup_callback(GtkEntry* self, GtkMenu* p0) { 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_populate_popup(Glib::wrap(p0) ); 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->populate_popup) (*base->populate_popup)(self, p0); } void Entry_Class::insert_at_cursor_callback(GtkEntry* self, const gchar* p0) { 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_insert_at_cursor(Glib::convert_const_gchar_ptr_to_ustring(p0) ); 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->insert_at_cursor) (*base->insert_at_cursor)(self, p0); } void Entry_Class::activate_callback(GtkEntry* 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_activate(); 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->activate) (*base->activate)(self); } #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED Glib::ObjectBase* Entry_Class::wrap_new(GObject* o) { return manage(new Entry((GtkEntry*)(o))); } /* The implementation: */ Entry::Entry(const Glib::ConstructParams& construct_params) : Gtk::Widget(construct_params) { } Entry::Entry(GtkEntry* castitem) : Gtk::Widget((GtkWidget*)(castitem)) { } Entry::~Entry() { destroy_(); } Entry::CppClassType Entry::entry_class_; // initialize static member GType Entry::get_type() { return entry_class_.init().get_type(); } GType Entry::get_base_type() { return gtk_entry_get_type(); } Entry::Entry() : // Mark this class as non-derived to allow C++ vfuncs to be skipped. Glib::ObjectBase(0), Gtk::Widget(Glib::ConstructParams(entry_class_.init())) { } void Entry::set_visibility(bool visible) { gtk_entry_set_visibility(gobj(), static_cast(visible)); } bool Entry::get_visibility() const { return gtk_entry_get_visibility(const_cast(gobj())); } void Entry::set_invisible_char(gunichar ch) { gtk_entry_set_invisible_char(gobj(), ch); } gunichar Entry::get_invisible_char() const { return gtk_entry_get_invisible_char(const_cast(gobj())); } void Entry::set_has_frame(bool setting) { gtk_entry_set_has_frame(gobj(), static_cast(setting)); } bool Entry::get_has_frame() const { return gtk_entry_get_has_frame(const_cast(gobj())); } void Entry::set_inner_border(const Border& border) { gtk_entry_set_inner_border(gobj(), &(border)); } Border Entry::get_inner_border() const { return *(gtk_entry_get_inner_border(const_cast(gobj()))); } void Entry::set_max_length(int max) { gtk_entry_set_max_length(gobj(), max); } int Entry::get_max_length() const { return gtk_entry_get_max_length(const_cast(gobj())); } void Entry::set_activates_default(bool setting) { gtk_entry_set_activates_default(gobj(), static_cast(setting)); } gboolean Entry::get_activates_default() const { return gtk_entry_get_activates_default(const_cast(gobj())); } void Entry::set_width_chars(int n_chars) { gtk_entry_set_width_chars(gobj(), n_chars); } int Entry::get_width_chars() const { return gtk_entry_get_width_chars(const_cast(gobj())); } void Entry::set_text(const Glib::ustring & text) { gtk_entry_set_text(gobj(), text.c_str()); } Glib::ustring Entry::get_text() const { return Glib::convert_const_gchar_ptr_to_ustring(gtk_entry_get_text(const_cast(gobj()))); } Glib::RefPtr Entry::get_layout() { Glib::RefPtr retvalue = Glib::wrap(gtk_entry_get_layout(gobj())); if(retvalue) retvalue->reference(); //The function does not do a ref for us. return retvalue; } Glib::RefPtr Entry::get_layout() const { return const_cast(this)->get_layout(); } void Entry::get_layout_offsets(int& x, int& y) { gtk_entry_get_layout_offsets(gobj(), &x, &y); } int Entry::layout_index_to_text_index(int layout_index) const { return gtk_entry_layout_index_to_text_index(const_cast(gobj()), layout_index); } int Entry::text_index_to_layout_index(int text_index) const { return gtk_entry_text_index_to_layout_index(const_cast(gobj()), text_index); } void Entry::set_cursor_hadjustment(Adjustment& adjustment) { gtk_entry_set_cursor_hadjustment(gobj(), (adjustment).gobj()); } Adjustment* Entry::get_cursor_hadjustment() { Adjustment* retvalue = Glib::wrap(gtk_entry_get_cursor_hadjustment(gobj())); if(retvalue) retvalue->reference(); //The function does not do a ref for us. return retvalue; } const Adjustment* Entry::get_cursor_hadjustment() const { return const_cast(this)->get_cursor_hadjustment(); } void Entry::set_alignment(float xalign) { gtk_entry_set_alignment(gobj(), xalign); } void Entry::set_alignment(AlignmentEnum xalign) { gtk_entry_set_alignment(gobj(), _gtkmm_align_float_from_enum(xalign)); } float Entry::get_alignment() const { return gtk_entry_get_alignment(const_cast(gobj())); } void Entry::set_completion(const Glib::RefPtr& completion) { gtk_entry_set_completion(gobj(), Glib::unwrap(completion)); } Glib::RefPtr Entry::get_completion() { Glib::RefPtr retvalue = Glib::wrap(gtk_entry_get_completion(gobj())); if(retvalue) retvalue->reference(); //The function does not do a ref for us. return retvalue; } Glib::RefPtr Entry::get_completion() const { return const_cast(this)->get_completion(); } guint16 Entry::get_text_length() const { return gobj()->text_length; } Glib::SignalProxy1< void,Menu* > Entry::signal_populate_popup() { return Glib::SignalProxy1< void,Menu* >(this, &Entry_signal_populate_popup_info); } Glib::SignalProxy1< void,const Glib::ustring& > Entry::signal_insert_at_cursor() { return Glib::SignalProxy1< void,const Glib::ustring& >(this, &Entry_signal_insert_at_cursor_info); } Glib::SignalProxy0< void > Entry::signal_activate() { return Glib::SignalProxy0< void >(this, &Entry_signal_activate_info); } #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_cursor_position() const { return Glib::PropertyProxy_ReadOnly(this, "cursor-position"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_selection_bound() const { return Glib::PropertyProxy_ReadOnly(this, "selection-bound"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy Entry::property_editable() { return Glib::PropertyProxy(this, "editable"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_editable() const { return Glib::PropertyProxy_ReadOnly(this, "editable"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy Entry::property_max_length() { return Glib::PropertyProxy(this, "max-length"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_max_length() const { return Glib::PropertyProxy_ReadOnly(this, "max-length"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy Entry::property_visibility() { return Glib::PropertyProxy(this, "visibility"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_visibility() const { return Glib::PropertyProxy_ReadOnly(this, "visibility"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy Entry::property_has_frame() { return Glib::PropertyProxy(this, "has-frame"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_has_frame() const { return Glib::PropertyProxy_ReadOnly(this, "has-frame"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy Entry::property_invisible_char() { return Glib::PropertyProxy(this, "invisible-char"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_invisible_char() const { return Glib::PropertyProxy_ReadOnly(this, "invisible-char"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy Entry::property_activates_default() { return Glib::PropertyProxy(this, "activates-default"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_activates_default() const { return Glib::PropertyProxy_ReadOnly(this, "activates-default"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy Entry::property_width_chars() { return Glib::PropertyProxy(this, "width-chars"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_width_chars() const { return Glib::PropertyProxy_ReadOnly(this, "width-chars"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_scroll_offset() const { return Glib::PropertyProxy_ReadOnly(this, "scroll-offset"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy Entry::property_text() { return Glib::PropertyProxy(this, "text"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_text() const { return Glib::PropertyProxy_ReadOnly(this, "text"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy Entry::property_xalign() { return Glib::PropertyProxy(this, "xalign"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_xalign() const { return Glib::PropertyProxy_ReadOnly(this, "xalign"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy Entry::property_truncate_multiline() { return Glib::PropertyProxy(this, "truncate-multiline"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly Entry::property_truncate_multiline() const { return Glib::PropertyProxy_ReadOnly(this, "truncate-multiline"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED void Gtk::Entry::on_populate_popup(Menu* menu) { 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->populate_popup) (*base->populate_popup)(gobj(),(GtkMenu*)Glib::unwrap(menu)); } void Gtk::Entry::on_insert_at_cursor(const Glib::ustring& str) { 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->insert_at_cursor) (*base->insert_at_cursor)(gobj(),str.c_str()); } void Gtk::Entry::on_activate() { 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->activate) (*base->activate)(gobj()); } #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED } // namespace Gtk