1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <libgnomecanvasmm/rich-text.h>
4 #include <libgnomecanvasmm/private/rich-text_p.h>
10 * Copyright (C) 2002 The libgnomecanvasmm Development Team
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34 RichText::RichText (Group& parent,
36 const Glib::ustring& text)
37 : Item (GNOME_CANVAS_ITEM (g_object_new (get_type (), NULL)))
39 item_construct (parent);
42 "text", text.c_str (),
46 RichText::RichText (Group& parent)
47 : Item (GNOME_CANVAS_ITEM (g_object_new (get_type (), NULL)))
49 item_construct (parent);
52 RichText::iterator RichText::get_iter_at_location(int x, int y) const
55 gnome_canvas_rich_text_get_iter_at_location(const_cast<GnomeCanvasRichText*>(gobj()), iter.gobj(), x, y);
68 void RichText_signal_tag_changed_callback(GnomeCanvasRichText* self, GtkTextTag* tag,void* data)
70 using namespace Gnome::Canvas;
71 typedef sigc::slot< void,const Glib::RefPtr<Gtk::TextTag>& > SlotType;
73 // Do not try to call a signal on a disassociated wrapper.
74 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
78 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
79 (*static_cast<SlotType*>(slot))(Glib::wrap(tag, true)
84 Glib::exception_handlers_invoke();
89 const Glib::SignalProxyInfo RichText_signal_tag_changed_info =
92 (GCallback) &RichText_signal_tag_changed_callback,
93 (GCallback) &RichText_signal_tag_changed_callback
96 } // anonymous namespace
102 Gnome::Canvas::RichText* wrap(GnomeCanvasRichText* object, bool take_copy)
104 return dynamic_cast<Gnome::Canvas::RichText *> (Glib::wrap_auto ((GObject*)(object), take_copy));
107 } /* namespace Glib */
116 /* The *_Class implementation: */
118 const Glib::Class& RichText_Class::init()
120 if(!gtype_) // create the GType if necessary
122 // Glib::Class has to know the class init function to clone custom types.
123 class_init_func_ = &RichText_Class::class_init_function;
125 // This is actually just optimized away, apparently with no harm.
126 // Make sure that the parent type has been created.
127 //CppClassParent::CppObjectType::get_type();
129 // Create the wrapper type, with the same class/instance size as the base type.
130 register_derived_type(gnome_canvas_rich_text_get_type());
132 // Add derived versions of interfaces, if the C type implements any interfaces:
138 void RichText_Class::class_init_function(void* g_class, void* class_data)
140 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
141 CppClassParent::class_init_function(klass, class_data);
143 klass->tag_changed = &tag_changed_callback;
147 void RichText_Class::tag_changed_callback(GnomeCanvasRichText* self, GtkTextTag* tag)
149 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
150 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
152 // Non-gtkmmproc-generated custom classes implicitly call the default
153 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
154 // generated classes can use this optimisation, which avoids the unnecessary
155 // parameter conversions if there is no possibility of the virtual function
157 if(obj && obj->is_derived_())
159 try // Trap C++ exceptions which would normally be lost because this is a C callback.
161 // Call the virtual member method, which derived classes might override.
162 obj->on_tag_changed(Glib::wrap(tag, true)
167 Glib::exception_handlers_invoke();
172 BaseClassType *const base = static_cast<BaseClassType*>(
173 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
176 // Call the original underlying C function:
177 if(base && base->tag_changed)
178 (*base->tag_changed)(self, tag);
183 Glib::ObjectBase* RichText_Class::wrap_new(GObject* o)
185 return manage(new RichText((GnomeCanvasRichText*)(o)));
190 /* The implementation: */
192 RichText::RichText(const Glib::ConstructParams& construct_params)
194 Item(construct_params)
198 RichText::RichText(GnomeCanvasRichText* castitem)
200 Item((GnomeCanvasItem*)(castitem))
204 RichText::~RichText()
209 RichText::CppClassType RichText::richtext_class_; // initialize static member
211 GType RichText::get_type()
213 return richtext_class_.init().get_type();
216 GType RichText::get_base_type()
218 return gnome_canvas_rich_text_get_type();
222 void RichText::cut_clipboard()
224 gnome_canvas_rich_text_cut_clipboard(gobj());
227 void RichText::copy_clipboard()
229 gnome_canvas_rich_text_copy_clipboard(gobj());
232 void RichText::paste_clipboard()
234 gnome_canvas_rich_text_paste_clipboard(gobj());
237 void RichText::set_buffer(const Glib::RefPtr<Gtk::TextBuffer>& buffer)
239 gnome_canvas_rich_text_set_buffer(gobj(), Glib::unwrap(buffer));
242 Glib::RefPtr<Gtk::TextBuffer> RichText::get_buffer() const
244 return Glib::wrap(gnome_canvas_rich_text_get_buffer(const_cast<GnomeCanvasRichText*>(gobj())));
247 void RichText::get_iter_location(const iterator& iter, Gdk::Rectangle& location) const
249 gnome_canvas_rich_text_get_iter_location(const_cast<GnomeCanvasRichText*>(gobj()), (iter).gobj(), (location).gobj());
253 Glib::SignalProxy1< void,const Glib::RefPtr<Gtk::TextTag>& > RichText::signal_tag_changed()
255 return Glib::SignalProxy1< void,const Glib::RefPtr<Gtk::TextTag>& >(this, &RichText_signal_tag_changed_info);
259 Glib::PropertyProxy<Glib::ustring> RichText::property_text()
261 return Glib::PropertyProxy<Glib::ustring>(this, "text");
264 Glib::PropertyProxy_ReadOnly<Glib::ustring> RichText::property_text() const
266 return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "text");
269 Glib::PropertyProxy<double> RichText::property_x()
271 return Glib::PropertyProxy<double>(this, "x");
274 Glib::PropertyProxy_ReadOnly<double> RichText::property_x() const
276 return Glib::PropertyProxy_ReadOnly<double>(this, "x");
279 Glib::PropertyProxy<double> RichText::property_y()
281 return Glib::PropertyProxy<double>(this, "y");
284 Glib::PropertyProxy_ReadOnly<double> RichText::property_y() const
286 return Glib::PropertyProxy_ReadOnly<double>(this, "y");
289 Glib::PropertyProxy<double> RichText::property_width()
291 return Glib::PropertyProxy<double>(this, "width");
294 Glib::PropertyProxy_ReadOnly<double> RichText::property_width() const
296 return Glib::PropertyProxy_ReadOnly<double>(this, "width");
299 Glib::PropertyProxy<double> RichText::property_height()
301 return Glib::PropertyProxy<double>(this, "height");
304 Glib::PropertyProxy_ReadOnly<double> RichText::property_height() const
306 return Glib::PropertyProxy_ReadOnly<double>(this, "height");
309 Glib::PropertyProxy<bool> RichText::property_editable()
311 return Glib::PropertyProxy<bool>(this, "editable");
314 Glib::PropertyProxy_ReadOnly<bool> RichText::property_editable() const
316 return Glib::PropertyProxy_ReadOnly<bool>(this, "editable");
319 Glib::PropertyProxy<bool> RichText::property_visible()
321 return Glib::PropertyProxy<bool>(this, "visible");
324 Glib::PropertyProxy_ReadOnly<bool> RichText::property_visible() const
326 return Glib::PropertyProxy_ReadOnly<bool>(this, "visible");
329 Glib::PropertyProxy<bool> RichText::property_cursor_visible()
331 return Glib::PropertyProxy<bool>(this, "cursor-visible");
334 Glib::PropertyProxy_ReadOnly<bool> RichText::property_cursor_visible() const
336 return Glib::PropertyProxy_ReadOnly<bool>(this, "cursor-visible");
339 Glib::PropertyProxy<bool> RichText::property_cursor_blink()
341 return Glib::PropertyProxy<bool>(this, "cursor-blink");
344 Glib::PropertyProxy_ReadOnly<bool> RichText::property_cursor_blink() const
346 return Glib::PropertyProxy_ReadOnly<bool>(this, "cursor-blink");
349 Glib::PropertyProxy<bool> RichText::property_grow_height()
351 return Glib::PropertyProxy<bool>(this, "grow-height");
354 Glib::PropertyProxy_ReadOnly<bool> RichText::property_grow_height() const
356 return Glib::PropertyProxy_ReadOnly<bool>(this, "grow-height");
359 Glib::PropertyProxy<Gtk::WrapMode> RichText::property_wrap_mode()
361 return Glib::PropertyProxy<Gtk::WrapMode>(this, "wrap-mode");
364 Glib::PropertyProxy_ReadOnly<Gtk::WrapMode> RichText::property_wrap_mode() const
366 return Glib::PropertyProxy_ReadOnly<Gtk::WrapMode>(this, "wrap-mode");
369 Glib::PropertyProxy<Gtk::Justification> RichText::property_justification()
371 return Glib::PropertyProxy<Gtk::Justification>(this, "justification");
374 Glib::PropertyProxy_ReadOnly<Gtk::Justification> RichText::property_justification() const
376 return Glib::PropertyProxy_ReadOnly<Gtk::Justification>(this, "justification");
379 Glib::PropertyProxy<Gtk::DirectionType> RichText::property_direction()
381 return Glib::PropertyProxy<Gtk::DirectionType>(this, "direction");
384 Glib::PropertyProxy_ReadOnly<Gtk::DirectionType> RichText::property_direction() const
386 return Glib::PropertyProxy_ReadOnly<Gtk::DirectionType>(this, "direction");
389 Glib::PropertyProxy<Gtk::AnchorType> RichText::property_anchor()
391 return Glib::PropertyProxy<Gtk::AnchorType>(this, "anchor");
394 Glib::PropertyProxy_ReadOnly<Gtk::AnchorType> RichText::property_anchor() const
396 return Glib::PropertyProxy_ReadOnly<Gtk::AnchorType>(this, "anchor");
399 Glib::PropertyProxy<int> RichText::property_pixels_above_lines()
401 return Glib::PropertyProxy<int>(this, "pixels-above-lines");
404 Glib::PropertyProxy_ReadOnly<int> RichText::property_pixels_above_lines() const
406 return Glib::PropertyProxy_ReadOnly<int>(this, "pixels-above-lines");
409 Glib::PropertyProxy<int> RichText::property_pixels_below_lines()
411 return Glib::PropertyProxy<int>(this, "pixels-below-lines");
414 Glib::PropertyProxy_ReadOnly<int> RichText::property_pixels_below_lines() const
416 return Glib::PropertyProxy_ReadOnly<int>(this, "pixels-below-lines");
419 Glib::PropertyProxy<int> RichText::property_pixels_inside_wrap()
421 return Glib::PropertyProxy<int>(this, "pixels-inside-wrap");
424 Glib::PropertyProxy_ReadOnly<int> RichText::property_pixels_inside_wrap() const
426 return Glib::PropertyProxy_ReadOnly<int>(this, "pixels-inside-wrap");
429 Glib::PropertyProxy<int> RichText::property_left_margin()
431 return Glib::PropertyProxy<int>(this, "left-margin");
434 Glib::PropertyProxy_ReadOnly<int> RichText::property_left_margin() const
436 return Glib::PropertyProxy_ReadOnly<int>(this, "left-margin");
439 Glib::PropertyProxy<int> RichText::property_right_margin()
441 return Glib::PropertyProxy<int>(this, "right-margin");
444 Glib::PropertyProxy_ReadOnly<int> RichText::property_right_margin() const
446 return Glib::PropertyProxy_ReadOnly<int>(this, "right-margin");
449 Glib::PropertyProxy<int> RichText::property_indent()
451 return Glib::PropertyProxy<int>(this, "indent");
454 Glib::PropertyProxy_ReadOnly<int> RichText::property_indent() const
456 return Glib::PropertyProxy_ReadOnly<int>(this, "indent");
460 void Gnome::Canvas::RichText::on_tag_changed(const Glib::RefPtr<Gtk::TextTag>& tag)
462 BaseClassType *const base = static_cast<BaseClassType*>(
463 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
466 if(base && base->tag_changed)
467 (*base->tag_changed)(gobj(),Glib::unwrap(tag));
471 } // namespace Canvas