// Generated by gtkmmproc -- DO NOT MODIFY! #include #include /* $Id$ */ /* rich-text.cc * * Copyright (C) 2002 The libgnomecanvasmm 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. */ namespace Gnome { namespace Canvas { RichText::RichText (Group& parent, double x, double y, const Glib::ustring& text) : Item (GNOME_CANVAS_ITEM (g_object_new (get_type (), NULL))) { item_construct (parent); set ("x", x, "y", y, "text", text.c_str (), NULL); } RichText::RichText (Group& parent) : Item (GNOME_CANVAS_ITEM (g_object_new (get_type (), NULL))) { item_construct (parent); } RichText::iterator RichText::get_iter_at_location(int x, int y) const { iterator iter; gnome_canvas_rich_text_get_iter_at_location(const_cast(gobj()), iter.gobj(), x, y); return iter; } } } namespace { void RichText_signal_tag_changed_callback(GnomeCanvasRichText* self, GtkTextTag* tag,void* data) { using namespace Gnome::Canvas; typedef sigc::slot< void,const Glib::RefPtr& > 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(slot))(Glib::wrap(tag, true) ); } catch(...) { Glib::exception_handlers_invoke(); } } } const Glib::SignalProxyInfo RichText_signal_tag_changed_info = { "tag_changed", (GCallback) &RichText_signal_tag_changed_callback, (GCallback) &RichText_signal_tag_changed_callback }; } // anonymous namespace namespace Glib { Gnome::Canvas::RichText* wrap(GnomeCanvasRichText* object, bool take_copy) { return dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)); } } /* namespace Glib */ namespace Gnome { namespace Canvas { /* The *_Class implementation: */ const Glib::Class& RichText_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_ = &RichText_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(gnome_canvas_rich_text_get_type()); // Add derived versions of interfaces, if the C type implements any interfaces: } return *this; } void RichText_Class::class_init_function(void* g_class, void* class_data) { BaseClassType *const klass = static_cast(g_class); CppClassParent::class_init_function(klass, class_data); klass->tag_changed = &tag_changed_callback; } void RichText_Class::tag_changed_callback(GnomeCanvasRichText* self, GtkTextTag* tag) { CppObjectType *const obj = dynamic_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 && 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_tag_changed(Glib::wrap(tag, true) ); } catch(...) { Glib::exception_handlers_invoke(); } } else { 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->tag_changed) (*base->tag_changed)(self, tag); } } Glib::ObjectBase* RichText_Class::wrap_new(GObject* o) { return manage(new RichText((GnomeCanvasRichText*)(o))); } /* The implementation: */ RichText::RichText(const Glib::ConstructParams& construct_params) : Item(construct_params) { } RichText::RichText(GnomeCanvasRichText* castitem) : Item((GnomeCanvasItem*)(castitem)) { } RichText::~RichText() { destroy_(); } RichText::CppClassType RichText::richtext_class_; // initialize static member GType RichText::get_type() { return richtext_class_.init().get_type(); } GType RichText::get_base_type() { return gnome_canvas_rich_text_get_type(); } void RichText::cut_clipboard() { gnome_canvas_rich_text_cut_clipboard(gobj()); } void RichText::copy_clipboard() { gnome_canvas_rich_text_copy_clipboard(gobj()); } void RichText::paste_clipboard() { gnome_canvas_rich_text_paste_clipboard(gobj()); } void RichText::set_buffer(const Glib::RefPtr& buffer) { gnome_canvas_rich_text_set_buffer(gobj(), Glib::unwrap(buffer)); } Glib::RefPtr RichText::get_buffer() const { return Glib::wrap(gnome_canvas_rich_text_get_buffer(const_cast(gobj()))); } void RichText::get_iter_location(const iterator& iter, Gdk::Rectangle& location) const { gnome_canvas_rich_text_get_iter_location(const_cast(gobj()), (iter).gobj(), (location).gobj()); } Glib::SignalProxy1< void,const Glib::RefPtr& > RichText::signal_tag_changed() { return Glib::SignalProxy1< void,const Glib::RefPtr& >(this, &RichText_signal_tag_changed_info); } Glib::PropertyProxy RichText::property_text() { return Glib::PropertyProxy(this, "text"); } Glib::PropertyProxy_ReadOnly RichText::property_text() const { return Glib::PropertyProxy_ReadOnly(this, "text"); } Glib::PropertyProxy RichText::property_x() { return Glib::PropertyProxy(this, "x"); } Glib::PropertyProxy_ReadOnly RichText::property_x() const { return Glib::PropertyProxy_ReadOnly(this, "x"); } Glib::PropertyProxy RichText::property_y() { return Glib::PropertyProxy(this, "y"); } Glib::PropertyProxy_ReadOnly RichText::property_y() const { return Glib::PropertyProxy_ReadOnly(this, "y"); } Glib::PropertyProxy RichText::property_width() { return Glib::PropertyProxy(this, "width"); } Glib::PropertyProxy_ReadOnly RichText::property_width() const { return Glib::PropertyProxy_ReadOnly(this, "width"); } Glib::PropertyProxy RichText::property_height() { return Glib::PropertyProxy(this, "height"); } Glib::PropertyProxy_ReadOnly RichText::property_height() const { return Glib::PropertyProxy_ReadOnly(this, "height"); } Glib::PropertyProxy RichText::property_editable() { return Glib::PropertyProxy(this, "editable"); } Glib::PropertyProxy_ReadOnly RichText::property_editable() const { return Glib::PropertyProxy_ReadOnly(this, "editable"); } Glib::PropertyProxy RichText::property_visible() { return Glib::PropertyProxy(this, "visible"); } Glib::PropertyProxy_ReadOnly RichText::property_visible() const { return Glib::PropertyProxy_ReadOnly(this, "visible"); } Glib::PropertyProxy RichText::property_cursor_visible() { return Glib::PropertyProxy(this, "cursor-visible"); } Glib::PropertyProxy_ReadOnly RichText::property_cursor_visible() const { return Glib::PropertyProxy_ReadOnly(this, "cursor-visible"); } Glib::PropertyProxy RichText::property_cursor_blink() { return Glib::PropertyProxy(this, "cursor-blink"); } Glib::PropertyProxy_ReadOnly RichText::property_cursor_blink() const { return Glib::PropertyProxy_ReadOnly(this, "cursor-blink"); } Glib::PropertyProxy RichText::property_grow_height() { return Glib::PropertyProxy(this, "grow-height"); } Glib::PropertyProxy_ReadOnly RichText::property_grow_height() const { return Glib::PropertyProxy_ReadOnly(this, "grow-height"); } Glib::PropertyProxy RichText::property_wrap_mode() { return Glib::PropertyProxy(this, "wrap-mode"); } Glib::PropertyProxy_ReadOnly RichText::property_wrap_mode() const { return Glib::PropertyProxy_ReadOnly(this, "wrap-mode"); } Glib::PropertyProxy RichText::property_justification() { return Glib::PropertyProxy(this, "justification"); } Glib::PropertyProxy_ReadOnly RichText::property_justification() const { return Glib::PropertyProxy_ReadOnly(this, "justification"); } Glib::PropertyProxy RichText::property_direction() { return Glib::PropertyProxy(this, "direction"); } Glib::PropertyProxy_ReadOnly RichText::property_direction() const { return Glib::PropertyProxy_ReadOnly(this, "direction"); } Glib::PropertyProxy RichText::property_anchor() { return Glib::PropertyProxy(this, "anchor"); } Glib::PropertyProxy_ReadOnly RichText::property_anchor() const { return Glib::PropertyProxy_ReadOnly(this, "anchor"); } Glib::PropertyProxy RichText::property_pixels_above_lines() { return Glib::PropertyProxy(this, "pixels-above-lines"); } Glib::PropertyProxy_ReadOnly RichText::property_pixels_above_lines() const { return Glib::PropertyProxy_ReadOnly(this, "pixels-above-lines"); } Glib::PropertyProxy RichText::property_pixels_below_lines() { return Glib::PropertyProxy(this, "pixels-below-lines"); } Glib::PropertyProxy_ReadOnly RichText::property_pixels_below_lines() const { return Glib::PropertyProxy_ReadOnly(this, "pixels-below-lines"); } Glib::PropertyProxy RichText::property_pixels_inside_wrap() { return Glib::PropertyProxy(this, "pixels-inside-wrap"); } Glib::PropertyProxy_ReadOnly RichText::property_pixels_inside_wrap() const { return Glib::PropertyProxy_ReadOnly(this, "pixels-inside-wrap"); } Glib::PropertyProxy RichText::property_left_margin() { return Glib::PropertyProxy(this, "left-margin"); } Glib::PropertyProxy_ReadOnly RichText::property_left_margin() const { return Glib::PropertyProxy_ReadOnly(this, "left-margin"); } Glib::PropertyProxy RichText::property_right_margin() { return Glib::PropertyProxy(this, "right-margin"); } Glib::PropertyProxy_ReadOnly RichText::property_right_margin() const { return Glib::PropertyProxy_ReadOnly(this, "right-margin"); } Glib::PropertyProxy RichText::property_indent() { return Glib::PropertyProxy(this, "indent"); } Glib::PropertyProxy_ReadOnly RichText::property_indent() const { return Glib::PropertyProxy_ReadOnly(this, "indent"); } void Gnome::Canvas::RichText::on_tag_changed(const Glib::RefPtr& tag) { 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->tag_changed) (*base->tag_changed)(gobj(),Glib::unwrap(tag)); } } // namespace Canvas } // namespace Gnome