1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/textbuffer.h>
4 #include <gtkmm/private/textbuffer_p.h>
9 /* Copyright(C) 1998-2002 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <gtk/gtktextbuffer.h>
27 #include <glib/gslist.h>
28 #include <gtkmm/textmark.h>
29 #include <gtkmm/textiter.h>
35 typedef TextChildAnchor ChildAnchor; //Help the code-generator so that it does not have to fully qualify this type in the .cc file.
37 TextBuffer::TextBuffer(const Glib::RefPtr<TagTable>& tag_table)
39 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
40 Glib::Object(Glib::ConstructParams(textbuffer_class_.init(), "tag_table",Glib::unwrap(tag_table), (char*) 0))
43 Glib::RefPtr<TextBuffer::Tag> TextBuffer::create_tag(const Glib::ustring& tag_name)
45 //gtk_text_buffer_create_tag takes a varargs list of property names and values.
46 //gtkmm coders should use the Tag.set_* method instead.
47 return Glib::wrap(gtk_text_buffer_create_tag(gobj(), tag_name.c_str(), (char*)0), true); //true = take_copy.
48 //We have to take a copy because gtk_text_buffer_create_tag() doesn't ref for us, for no real reason.
51 Glib::RefPtr<TextBuffer::Tag> TextBuffer::create_tag()
53 //gtk_text_buffer_create_tag takes a varargs list of property names and values.
54 //gtkmm coders should use the Tag.set_* method instead.
55 return Glib::wrap(gtk_text_buffer_create_tag(gobj(), (const char*)0, (char*)0), true); //true = take_copy.
56 //We have to take a copy because gtk_text_buffer_create_tag() doesn't ref for us, for no real reason.
59 Glib::RefPtr<TextBuffer::Mark>
60 TextBuffer::create_mark(const TextBuffer::iterator& where, bool left_gravity)
62 return Glib::wrap(gtk_text_buffer_create_mark(
63 gobj(), 0, const_cast<GtkTextIter*>(where.gobj()), left_gravity),
64 true); // acquire reference
67 TextBuffer::iterator TextBuffer::get_iter_at_line_offset(int line_number, int char_offset)
70 gtk_text_buffer_get_iter_at_line_offset(gobj(), iter.gobj(), line_number, char_offset);
74 TextBuffer::iterator TextBuffer::get_iter_at_line_index(int line_number, int byte_index)
77 gtk_text_buffer_get_iter_at_line_index(gobj(), iter.gobj(), line_number, byte_index);
81 TextBuffer::iterator TextBuffer::get_iter_at_offset(int char_offset)
84 gtk_text_buffer_get_iter_at_offset(gobj(), iter.gobj(), char_offset);
88 TextBuffer::iterator TextBuffer::get_iter_at_line(int line_number)
91 gtk_text_buffer_get_iter_at_line(gobj(), iter.gobj(), line_number);
95 TextBuffer::iterator TextBuffer::begin()
98 gtk_text_buffer_get_start_iter(gobj(), iter.gobj());
102 TextBuffer::iterator TextBuffer::end()
105 gtk_text_buffer_get_end_iter(gobj(), iter.gobj());
109 void TextBuffer::get_bounds(iterator& range_begin, iterator& range_end)
111 gtk_text_buffer_get_bounds(gobj(), range_begin.gobj(), range_end.gobj());
114 TextBuffer::iterator TextBuffer::get_iter_at_mark(const Glib::RefPtr<Mark>& mark)
117 gtk_text_buffer_get_iter_at_mark(gobj(), iter.gobj(), mark->gobj());
121 void TextBuffer::set_text(const Glib::ustring& text)
123 gtk_text_buffer_set_text(gobj(), text.data(), text.bytes());
126 void TextBuffer::set_text(const char* text_begin, const char* text_end)
128 gtk_text_buffer_set_text(gobj(), text_begin, text_end - text_begin);
132 void TextBuffer::assign(const Glib::ustring& text)
134 gtk_text_buffer_set_text(gobj(), text.data(), text.bytes());
138 void TextBuffer::assign(const char* text_begin, const char* text_end)
140 gtk_text_buffer_set_text(gobj(), text_begin, text_end - text_begin);
143 TextBuffer::iterator TextBuffer::insert(const iterator& pos, const Glib::ustring& text)
145 // gtk_text_buffer_insert() modifies the iterator, but that's not the
146 // STL way so we give it something that we don't mind it modifying.
147 iterator iterCopy (pos);
148 gtk_text_buffer_insert(gobj(), iterCopy.gobj(), text.data(), text.bytes());
150 // According to the gtk_text_buffer_insert() docs, the "default signal handler
151 // revalidates it to point to the end of the inserted text".
155 TextBuffer::iterator TextBuffer::insert(const iterator& pos, const char* text_begin, const char* text_end)
157 // gtk_text_buffer_insert() modifies the iterator, but that's not the
158 // STL way so we give it something that we don't mind it modifying.
159 iterator iterCopy (pos);
160 gtk_text_buffer_insert(gobj(), iterCopy.gobj(), text_begin, text_end - text_begin);
162 // According to the gtk_text_buffer_insert() docs, the "default signal handler
163 // revalidates it to point to the end of the inserted text".
167 TextBuffer::iterator TextBuffer::insert_pixbuf(const iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
169 iterator iterCopy (pos);
170 gtk_text_buffer_insert_pixbuf(gobj(), iterCopy.gobj(), pixbuf->gobj());
174 TextBuffer::iterator TextBuffer::insert_child_anchor(const iterator& pos,
175 const Glib::RefPtr<ChildAnchor>& anchor)
177 // Copy the iterator. It might be changed because it is used as a signal parameter internally.
178 iterator iterCopy (pos);
179 gtk_text_buffer_insert_child_anchor(gobj(), iterCopy.gobj(), Glib::unwrap(anchor));
183 Glib::RefPtr<ChildAnchor> TextBuffer::create_child_anchor(const iterator& pos)
185 // Copy the iterator. It might be changed because it is used as a signal parameter internally.
186 iterator iterCopy (pos);
187 return Glib::wrap(gtk_text_buffer_create_child_anchor(gobj(), iterCopy.gobj()),
188 true); // The function does not do a ref for us.
191 void TextBuffer::insert_at_cursor(const Glib::ustring& text)
193 gtk_text_buffer_insert_at_cursor(gobj(), text.data(), text.bytes());
196 void TextBuffer::insert_at_cursor(const char* text_begin, const char* text_end)
198 gtk_text_buffer_insert_at_cursor(gobj(), text_begin, text_end - text_begin);
201 std::pair<TextBuffer::iterator,bool>
202 TextBuffer::insert_interactive(const iterator& pos, const Glib::ustring& text, bool default_editable)
204 // Since we have to copy the iterator anyway we can as well create the
205 // std::pair now. That saves another copy later (mind you, TextIter is
206 // a heavy struct), and allows modern compilers to apply the return value
208 std::pair<iterator,bool> pair_iter_success (pos, false);
210 pair_iter_success.second = gtk_text_buffer_insert_interactive(
211 gobj(), pair_iter_success.first.gobj(), text.data(), text.bytes(), default_editable);
213 return pair_iter_success;
216 std::pair<TextBuffer::iterator,bool>
217 TextBuffer::insert_interactive(const iterator& pos, const char* text_begin, const char* text_end,
218 bool default_editable)
220 // Since we have to copy the iterator anyway we can as well create the
221 // std::pair now. That saves another copy later (mind you, TextIter is
222 // a heavy struct), and allows modern compilers to apply the return value
224 std::pair<iterator,bool> pair_iter_success (pos, false);
226 pair_iter_success.second = gtk_text_buffer_insert_interactive(
227 gobj(), pair_iter_success.first.gobj(), text_begin, text_end - text_begin, default_editable);
229 return pair_iter_success;
232 bool TextBuffer::insert_interactive_at_cursor(const Glib::ustring& text, bool default_editable)
234 return gtk_text_buffer_insert_interactive_at_cursor(
235 gobj(), text.data(), text.bytes(), default_editable);
238 bool TextBuffer::insert_interactive_at_cursor(const char* text_begin, const char* text_end,
239 bool default_editable)
241 return gtk_text_buffer_insert_interactive_at_cursor(
242 gobj(), text_begin, text_end - text_begin, default_editable);
245 TextBuffer::iterator TextBuffer::insert_with_tag(const iterator& pos, const Glib::ustring& text,
246 const Glib::RefPtr<Tag>& tag)
248 // gtk_text_buffer_insert_with_tags() invalidates the iterator, but this lets us recreate it later.
249 const int offset = pos.get_offset();
251 iterator iterCopy (pos);
252 gtk_text_buffer_insert_with_tags(
253 gobj(), iterCopy.gobj(), text.data(), text.bytes(), tag->gobj(), (GtkTextTag*)0);
255 return get_iter_at_offset(offset + text.size());
258 TextBuffer::iterator TextBuffer::insert_with_tag(const iterator& pos,
259 const char* text_begin, const char* text_end,
260 const Glib::RefPtr<Tag>& tag)
262 // gtk_text_buffer_insert_with_tags() invalidates the iterator, but this lets us recreate it later.
263 const int offset = pos.get_offset();
265 iterator iterCopy (pos);
266 gtk_text_buffer_insert_with_tags(
267 gobj(), iterCopy.gobj(), text_begin, text_end - text_begin, tag->gobj(), (GtkTextTag*)0);
269 return get_iter_at_offset(offset + (text_end - text_begin));
272 TextBuffer::iterator TextBuffer::insert_with_tag(const iterator& pos, const Glib::ustring& text,
273 const Glib::ustring& tag_name)
275 // gtk_text_buffer_insert_with_tags() invalidates the iterator, but this lets us recreate it later.
276 const int offset = pos.get_offset();
278 iterator iterCopy (pos);
279 gtk_text_buffer_insert_with_tags_by_name(
280 gobj(), iterCopy.gobj(), text.data(), text.bytes(), tag_name.c_str(), (char*)0);
282 return get_iter_at_offset(offset + text.size());
285 TextBuffer::iterator TextBuffer::insert_with_tag(const iterator& pos,
286 const char* text_begin, const char* text_end,
287 const Glib::ustring& tag_name)
289 // gtk_text_buffer_insert_with_tags() invalidates the iterator, but this lets us recreate it later.
290 const int offset = pos.get_offset();
292 iterator iterCopy (pos);
293 gtk_text_buffer_insert_with_tags_by_name(
294 gobj(), iterCopy.gobj(), text_begin, text_end - text_begin, tag_name.c_str(), (char*)0);
296 return get_iter_at_offset(offset + (text_end - text_begin));
299 TextBuffer::iterator TextBuffer::insert_with_tags(const iterator& pos, const Glib::ustring& text,
300 const Glib::ArrayHandle< Glib::RefPtr<Tag> >& tags)
302 const char *const text_begin = text.data();
303 return insert_with_tags(pos, text_begin, text_begin + text.bytes(), tags);
306 TextBuffer::iterator TextBuffer::insert_with_tags(const iterator& pos,
307 const char* text_begin, const char* text_end,
308 const Glib::ArrayHandle< Glib::RefPtr<Tag> >& tags)
310 const int start_offset = pos.get_offset();
311 iterator range_end (insert(pos, text_begin, text_end));
313 GtkTextIter range_begin;
314 gtk_text_buffer_get_iter_at_offset(gobj(), &range_begin, start_offset);
316 //This was GtkTextTag* const * const, but the SUN Forte compiler said that it couldn't convert to that. murrayc
317 const GtkTextTag* const* tags_begin = tags.data();
318 const GtkTextTag* const* tags_end = tags_begin + tags.size();
320 //TODO: Investigate if this const_cast<> is really necessary.
321 //I added it for the SUN Forte compiler. murrayc.
322 for(GtkTextTag *const * ptag = const_cast<GtkTextTag* const *>(tags_begin); ptag != const_cast<GtkTextTag* const *>(tags_end);
325 gtk_text_buffer_apply_tag(gobj(), *ptag, &range_begin, range_end.gobj());
331 TextBuffer::iterator TextBuffer::insert_with_tags_by_name(const iterator& pos, const Glib::ustring& text,
332 const Glib::ArrayHandle<Glib::ustring>& tag_names)
334 const char *const text_begin = text.data();
335 return insert_with_tags_by_name(pos, text_begin, text_begin + text.bytes(), tag_names);
338 TextBuffer::iterator TextBuffer::insert_with_tags_by_name(const iterator& pos,
339 const char* text_begin, const char* text_end,
340 const Glib::ArrayHandle<Glib::ustring>& tag_names)
342 // gtk_buffer_insert_with_tags_by_name() is a convenience wrapper, so it's kind of OK to reimplement it:
344 const int start_offset = pos.get_offset();
345 iterator range_end (insert(pos, text_begin, text_end));
347 GtkTextIter range_begin;
348 gtk_text_buffer_get_iter_at_offset(gobj(), &range_begin, start_offset);
350 GtkTextTagTable *const tag_table = gtk_text_buffer_get_tag_table(gobj());
352 const char *const *const names_begin = tag_names.data();
353 const char *const *const names_end = names_begin + tag_names.size();
355 for(const char *const * pname = names_begin; pname != names_end; ++pname)
357 if(GtkTextTag *const tag = gtk_text_tag_table_lookup(tag_table, *pname))
359 gtk_text_buffer_apply_tag(gobj(), tag, &range_begin, range_end.gobj());
363 g_warning("Gtk::TextBuffer::insert_with_tags_by_name(): no tag with name '%s'!", *pname);
370 TextBuffer::iterator TextBuffer::insert(const iterator& pos,
371 const iterator& range_begin, const iterator& range_end)
373 iterator iterCopy (pos);
374 gtk_text_buffer_insert_range(gobj(), iterCopy.gobj(), range_begin.gobj(), range_end.gobj());
378 std::pair<TextBuffer::iterator,bool>
379 TextBuffer::insert_interactive(const iterator& pos, const iterator& range_begin,
380 const iterator& range_end, bool default_editable)
382 // Since we have to copy the iterator anyway we can as well create the
383 // std::pair now. That saves another copy later (mind you, TextIter is
384 // a heavy struct), and allows modern compilers to apply the return value
386 std::pair<iterator,bool> pair_iter_success (pos, false);
388 pair_iter_success.second = gtk_text_buffer_insert_range_interactive(
389 gobj(), pair_iter_success.first.gobj(), range_begin.gobj(), range_end.gobj(), default_editable);
391 return pair_iter_success;
394 TextBuffer::iterator TextBuffer::erase(const iterator& range_begin, const iterator& range_end)
396 // GTK+ sets the iterators to where the deletion occured. We do it the STL way and therefore need copies.
397 iterator beginCopy (range_begin);
398 iterator endCopy (range_end);
399 gtk_text_buffer_delete(gobj(), beginCopy.gobj(), endCopy.gobj());
403 TextBuffer::iterator TextBuffer::backspace(const iterator& iter, bool interactive, bool default_editable)
405 // GTK+ sets the iterators to where the deletion occured. We do it the STL way and therefore need copies.
407 gtk_text_buffer_backspace(gobj(), copy.gobj(), interactive, default_editable);
412 std::pair<TextBuffer::iterator,bool>
413 TextBuffer::erase_interactive(const iterator& range_begin, const iterator& range_end,
414 bool default_editable)
416 // Since we have to copy the iterator anyway we can as well create the
417 // std::pair now. That saves another copy later (mind you, TextIter is
418 // a heavy struct), and allows modern compilers to apply the return value
420 std::pair<iterator,bool> pair_iter_success (range_begin, false);
422 // GTK+ sets the iterators to where the deletion occured.
423 // We do it the STL way and therefore need copies.
424 iterator endCopy (range_end);
426 pair_iter_success.second = gtk_text_buffer_delete_interactive(
427 gobj(), pair_iter_success.first.gobj(), endCopy.gobj(), default_editable);
429 return pair_iter_success;
432 void TextBuffer::paste_clipboard(const Glib::RefPtr<Clipboard>& clipboard, const iterator& override_location,
433 bool default_editable)
435 gtk_text_buffer_paste_clipboard(gobj(), clipboard->gobj(),
436 const_cast<GtkTextIter*>(override_location.gobj()), default_editable);
439 void TextBuffer::paste_clipboard(const Glib::RefPtr<Clipboard>& clipboard, bool default_editable)
441 gtk_text_buffer_paste_clipboard(gobj(), clipboard->gobj(), 0, default_editable);
444 TextBuffer::iterator TextBuffer::get_iter_at_child_anchor(const Glib::RefPtr<ChildAnchor>& anchor)
447 gtk_text_buffer_get_iter_at_child_anchor(gobj(), iter.gobj(), anchor->gobj());
451 int TextBuffer::size() const
453 return get_char_count();
456 Glib::ustring TextBuffer::get_text(bool include_hidden_chars)
458 return get_text(begin(), end(), include_hidden_chars);
467 void TextBuffer_signal_insert_callback(GtkTextBuffer* self, GtkTextIter* p0,const gchar* p1,gint p2,void* data)
470 typedef sigc::slot< void,const TextBuffer::iterator&,const Glib::ustring&,int > SlotType;
472 // Do not try to call a signal on a disassociated wrapper.
473 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
477 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
478 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
479 , Glib::ustring(p1, p1 + p2)
485 Glib::exception_handlers_invoke();
490 const Glib::SignalProxyInfo TextBuffer_signal_insert_info =
493 (GCallback) &TextBuffer_signal_insert_callback,
494 (GCallback) &TextBuffer_signal_insert_callback
498 void TextBuffer_signal_insert_pixbuf_callback(GtkTextBuffer* self, GtkTextIter* p0,GdkPixbuf* p1,void* data)
501 typedef sigc::slot< void,const TextBuffer::iterator&,const Glib::RefPtr<Gdk::Pixbuf>& > SlotType;
503 // Do not try to call a signal on a disassociated wrapper.
504 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
508 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
509 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
510 , Glib::wrap(p1, true)
515 Glib::exception_handlers_invoke();
520 const Glib::SignalProxyInfo TextBuffer_signal_insert_pixbuf_info =
523 (GCallback) &TextBuffer_signal_insert_pixbuf_callback,
524 (GCallback) &TextBuffer_signal_insert_pixbuf_callback
528 void TextBuffer_signal_insert_child_anchor_callback(GtkTextBuffer* self, GtkTextIter* p0,GtkTextChildAnchor* p1,void* data)
531 typedef sigc::slot< void,const TextBuffer::iterator&,const Glib::RefPtr<ChildAnchor>& > SlotType;
533 // Do not try to call a signal on a disassociated wrapper.
534 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
538 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
539 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
540 , Glib::wrap(p1, true)
545 Glib::exception_handlers_invoke();
550 const Glib::SignalProxyInfo TextBuffer_signal_insert_child_anchor_info =
552 "insert_child_anchor",
553 (GCallback) &TextBuffer_signal_insert_child_anchor_callback,
554 (GCallback) &TextBuffer_signal_insert_child_anchor_callback
558 void TextBuffer_signal_erase_callback(GtkTextBuffer* self, GtkTextIter* p0,GtkTextIter* p1,void* data)
561 typedef sigc::slot< void,const TextBuffer::iterator&,const TextBuffer::iterator& > SlotType;
563 // Do not try to call a signal on a disassociated wrapper.
564 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
568 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
569 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
575 Glib::exception_handlers_invoke();
580 const Glib::SignalProxyInfo TextBuffer_signal_erase_info =
583 (GCallback) &TextBuffer_signal_erase_callback,
584 (GCallback) &TextBuffer_signal_erase_callback
588 const Glib::SignalProxyInfo TextBuffer_signal_changed_info =
591 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
592 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
596 const Glib::SignalProxyInfo TextBuffer_signal_modified_changed_info =
599 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
600 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
604 void TextBuffer_signal_mark_set_callback(GtkTextBuffer* self, const GtkTextIter* p0,GtkTextMark* p1,void* data)
607 typedef sigc::slot< void,const TextBuffer::iterator&,const Glib::RefPtr<TextBuffer::Mark>& > SlotType;
609 // Do not try to call a signal on a disassociated wrapper.
610 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
614 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
615 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
616 , Glib::wrap(p1, true)
621 Glib::exception_handlers_invoke();
626 const Glib::SignalProxyInfo TextBuffer_signal_mark_set_info =
629 (GCallback) &TextBuffer_signal_mark_set_callback,
630 (GCallback) &TextBuffer_signal_mark_set_callback
634 void TextBuffer_signal_mark_deleted_callback(GtkTextBuffer* self, GtkTextMark* p0,void* data)
637 typedef sigc::slot< void,const Glib::RefPtr<TextBuffer::Mark>& > SlotType;
639 // Do not try to call a signal on a disassociated wrapper.
640 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
644 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
645 (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
650 Glib::exception_handlers_invoke();
655 const Glib::SignalProxyInfo TextBuffer_signal_mark_deleted_info =
658 (GCallback) &TextBuffer_signal_mark_deleted_callback,
659 (GCallback) &TextBuffer_signal_mark_deleted_callback
663 void TextBuffer_signal_apply_tag_callback(GtkTextBuffer* self, GtkTextTag* p0,const GtkTextIter* p1,const GtkTextIter* p2,void* data)
666 typedef sigc::slot< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& > SlotType;
668 // Do not try to call a signal on a disassociated wrapper.
669 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
673 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
674 (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
681 Glib::exception_handlers_invoke();
686 const Glib::SignalProxyInfo TextBuffer_signal_apply_tag_info =
689 (GCallback) &TextBuffer_signal_apply_tag_callback,
690 (GCallback) &TextBuffer_signal_apply_tag_callback
694 void TextBuffer_signal_remove_tag_callback(GtkTextBuffer* self, GtkTextTag* p0,const GtkTextIter* p1,const GtkTextIter* p2,void* data)
697 typedef sigc::slot< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& > SlotType;
699 // Do not try to call a signal on a disassociated wrapper.
700 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
704 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
705 (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
712 Glib::exception_handlers_invoke();
717 const Glib::SignalProxyInfo TextBuffer_signal_remove_tag_info =
720 (GCallback) &TextBuffer_signal_remove_tag_callback,
721 (GCallback) &TextBuffer_signal_remove_tag_callback
725 const Glib::SignalProxyInfo TextBuffer_signal_begin_user_action_info =
728 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
729 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
733 const Glib::SignalProxyInfo TextBuffer_signal_end_user_action_info =
736 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
737 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
740 } // anonymous namespace
746 Glib::RefPtr<Gtk::TextBuffer> wrap(GtkTextBuffer* object, bool take_copy)
748 return Glib::RefPtr<Gtk::TextBuffer>( dynamic_cast<Gtk::TextBuffer*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
749 //We use dynamic_cast<> in case of multiple inheritance.
752 } /* namespace Glib */
759 /* The *_Class implementation: */
761 const Glib::Class& TextBuffer_Class::init()
763 if(!gtype_) // create the GType if necessary
765 // Glib::Class has to know the class init function to clone custom types.
766 class_init_func_ = &TextBuffer_Class::class_init_function;
768 // This is actually just optimized away, apparently with no harm.
769 // Make sure that the parent type has been created.
770 //CppClassParent::CppObjectType::get_type();
772 // Create the wrapper type, with the same class/instance size as the base type.
773 register_derived_type(gtk_text_buffer_get_type());
775 // Add derived versions of interfaces, if the C type implements any interfaces:
781 void TextBuffer_Class::class_init_function(void* g_class, void* class_data)
783 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
784 CppClassParent::class_init_function(klass, class_data);
786 klass->insert_text = &insert_text_callback;
787 klass->insert_pixbuf = &insert_pixbuf_callback;
788 klass->insert_child_anchor = &insert_child_anchor_callback;
789 klass->delete_range = &delete_range_callback;
790 klass->changed = &changed_callback;
791 klass->modified_changed = &modified_changed_callback;
792 klass->mark_set = &mark_set_callback;
793 klass->mark_deleted = &mark_deleted_callback;
794 klass->apply_tag = &apply_tag_callback;
795 klass->remove_tag = &remove_tag_callback;
796 klass->begin_user_action = &begin_user_action_callback;
797 klass->end_user_action = &end_user_action_callback;
801 void TextBuffer_Class::insert_text_callback(GtkTextBuffer* self, GtkTextIter* p0, const gchar* p1, gint p2)
803 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
804 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
806 // Non-gtkmmproc-generated custom classes implicitly call the default
807 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
808 // generated classes can use this optimisation, which avoids the unnecessary
809 // parameter conversions if there is no possibility of the virtual function
811 if(obj && obj->is_derived_())
813 try // Trap C++ exceptions which would normally be lost because this is a C callback.
815 // Call the virtual member method, which derived classes might override.
816 obj->on_insert(Glib::wrap(p0)
817 , Glib::ustring(p1, p1 + p2)
823 Glib::exception_handlers_invoke();
828 BaseClassType *const base = static_cast<BaseClassType*>(
829 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
832 // Call the original underlying C function:
833 if(base && base->insert_text)
834 (*base->insert_text)(self, p0, p1, p2);
838 void TextBuffer_Class::insert_pixbuf_callback(GtkTextBuffer* self, GtkTextIter* p0, GdkPixbuf* p1)
840 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
841 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
843 // Non-gtkmmproc-generated custom classes implicitly call the default
844 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
845 // generated classes can use this optimisation, which avoids the unnecessary
846 // parameter conversions if there is no possibility of the virtual function
848 if(obj && obj->is_derived_())
850 try // Trap C++ exceptions which would normally be lost because this is a C callback.
852 // Call the virtual member method, which derived classes might override.
853 obj->on_insert_pixbuf(Glib::wrap(p0)
854 , Glib::wrap(p1, true)
859 Glib::exception_handlers_invoke();
864 BaseClassType *const base = static_cast<BaseClassType*>(
865 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
868 // Call the original underlying C function:
869 if(base && base->insert_pixbuf)
870 (*base->insert_pixbuf)(self, p0, p1);
874 void TextBuffer_Class::insert_child_anchor_callback(GtkTextBuffer* self, GtkTextIter* p0, GtkTextChildAnchor* p1)
876 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
877 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
879 // Non-gtkmmproc-generated custom classes implicitly call the default
880 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
881 // generated classes can use this optimisation, which avoids the unnecessary
882 // parameter conversions if there is no possibility of the virtual function
884 if(obj && obj->is_derived_())
886 try // Trap C++ exceptions which would normally be lost because this is a C callback.
888 // Call the virtual member method, which derived classes might override.
889 obj->on_insert_child_anchor(Glib::wrap(p0)
890 , Glib::wrap(p1, true)
895 Glib::exception_handlers_invoke();
900 BaseClassType *const base = static_cast<BaseClassType*>(
901 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
904 // Call the original underlying C function:
905 if(base && base->insert_child_anchor)
906 (*base->insert_child_anchor)(self, p0, p1);
910 void TextBuffer_Class::delete_range_callback(GtkTextBuffer* self, GtkTextIter* p0, GtkTextIter* p1)
912 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
913 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
915 // Non-gtkmmproc-generated custom classes implicitly call the default
916 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
917 // generated classes can use this optimisation, which avoids the unnecessary
918 // parameter conversions if there is no possibility of the virtual function
920 if(obj && obj->is_derived_())
922 try // Trap C++ exceptions which would normally be lost because this is a C callback.
924 // Call the virtual member method, which derived classes might override.
925 obj->on_erase(Glib::wrap(p0)
931 Glib::exception_handlers_invoke();
936 BaseClassType *const base = static_cast<BaseClassType*>(
937 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
940 // Call the original underlying C function:
941 if(base && base->delete_range)
942 (*base->delete_range)(self, p0, p1);
946 void TextBuffer_Class::changed_callback(GtkTextBuffer* self)
948 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
949 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
951 // Non-gtkmmproc-generated custom classes implicitly call the default
952 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
953 // generated classes can use this optimisation, which avoids the unnecessary
954 // parameter conversions if there is no possibility of the virtual function
956 if(obj && obj->is_derived_())
958 try // Trap C++ exceptions which would normally be lost because this is a C callback.
960 // Call the virtual member method, which derived classes might override.
965 Glib::exception_handlers_invoke();
970 BaseClassType *const base = static_cast<BaseClassType*>(
971 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
974 // Call the original underlying C function:
975 if(base && base->changed)
976 (*base->changed)(self);
980 void TextBuffer_Class::modified_changed_callback(GtkTextBuffer* self)
982 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
983 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
985 // Non-gtkmmproc-generated custom classes implicitly call the default
986 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
987 // generated classes can use this optimisation, which avoids the unnecessary
988 // parameter conversions if there is no possibility of the virtual function
990 if(obj && obj->is_derived_())
992 try // Trap C++ exceptions which would normally be lost because this is a C callback.
994 // Call the virtual member method, which derived classes might override.
995 obj->on_modified_changed();
999 Glib::exception_handlers_invoke();
1004 BaseClassType *const base = static_cast<BaseClassType*>(
1005 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
1008 // Call the original underlying C function:
1009 if(base && base->modified_changed)
1010 (*base->modified_changed)(self);
1014 void TextBuffer_Class::mark_set_callback(GtkTextBuffer* self, const GtkTextIter* p0, GtkTextMark* p1)
1016 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1017 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1019 // Non-gtkmmproc-generated custom classes implicitly call the default
1020 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1021 // generated classes can use this optimisation, which avoids the unnecessary
1022 // parameter conversions if there is no possibility of the virtual function
1023 // being overridden:
1024 if(obj && obj->is_derived_())
1026 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1028 // Call the virtual member method, which derived classes might override.
1029 obj->on_mark_set(Glib::wrap(p0)
1030 , Glib::wrap(p1, true)
1035 Glib::exception_handlers_invoke();
1040 BaseClassType *const base = static_cast<BaseClassType*>(
1041 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
1044 // Call the original underlying C function:
1045 if(base && base->mark_set)
1046 (*base->mark_set)(self, p0, p1);
1050 void TextBuffer_Class::mark_deleted_callback(GtkTextBuffer* self, GtkTextMark* p0)
1052 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1053 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1055 // Non-gtkmmproc-generated custom classes implicitly call the default
1056 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1057 // generated classes can use this optimisation, which avoids the unnecessary
1058 // parameter conversions if there is no possibility of the virtual function
1059 // being overridden:
1060 if(obj && obj->is_derived_())
1062 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1064 // Call the virtual member method, which derived classes might override.
1065 obj->on_mark_deleted(Glib::wrap(p0, true)
1070 Glib::exception_handlers_invoke();
1075 BaseClassType *const base = static_cast<BaseClassType*>(
1076 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
1079 // Call the original underlying C function:
1080 if(base && base->mark_deleted)
1081 (*base->mark_deleted)(self, p0);
1085 void TextBuffer_Class::apply_tag_callback(GtkTextBuffer* self, GtkTextTag* p0, const GtkTextIter* p1, const GtkTextIter* p2)
1087 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1088 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1090 // Non-gtkmmproc-generated custom classes implicitly call the default
1091 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1092 // generated classes can use this optimisation, which avoids the unnecessary
1093 // parameter conversions if there is no possibility of the virtual function
1094 // being overridden:
1095 if(obj && obj->is_derived_())
1097 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1099 // Call the virtual member method, which derived classes might override.
1100 obj->on_apply_tag(Glib::wrap(p0, true)
1107 Glib::exception_handlers_invoke();
1112 BaseClassType *const base = static_cast<BaseClassType*>(
1113 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
1116 // Call the original underlying C function:
1117 if(base && base->apply_tag)
1118 (*base->apply_tag)(self, p0, p1, p2);
1122 void TextBuffer_Class::remove_tag_callback(GtkTextBuffer* self, GtkTextTag* p0, const GtkTextIter* p1, const GtkTextIter* p2)
1124 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1125 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1127 // Non-gtkmmproc-generated custom classes implicitly call the default
1128 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1129 // generated classes can use this optimisation, which avoids the unnecessary
1130 // parameter conversions if there is no possibility of the virtual function
1131 // being overridden:
1132 if(obj && obj->is_derived_())
1134 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1136 // Call the virtual member method, which derived classes might override.
1137 obj->on_remove_tag(Glib::wrap(p0, true)
1144 Glib::exception_handlers_invoke();
1149 BaseClassType *const base = static_cast<BaseClassType*>(
1150 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
1153 // Call the original underlying C function:
1154 if(base && base->remove_tag)
1155 (*base->remove_tag)(self, p0, p1, p2);
1159 void TextBuffer_Class::begin_user_action_callback(GtkTextBuffer* self)
1161 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1162 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1164 // Non-gtkmmproc-generated custom classes implicitly call the default
1165 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1166 // generated classes can use this optimisation, which avoids the unnecessary
1167 // parameter conversions if there is no possibility of the virtual function
1168 // being overridden:
1169 if(obj && obj->is_derived_())
1171 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1173 // Call the virtual member method, which derived classes might override.
1174 obj->on_begin_user_action();
1178 Glib::exception_handlers_invoke();
1183 BaseClassType *const base = static_cast<BaseClassType*>(
1184 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
1187 // Call the original underlying C function:
1188 if(base && base->begin_user_action)
1189 (*base->begin_user_action)(self);
1193 void TextBuffer_Class::end_user_action_callback(GtkTextBuffer* self)
1195 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1196 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1198 // Non-gtkmmproc-generated custom classes implicitly call the default
1199 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1200 // generated classes can use this optimisation, which avoids the unnecessary
1201 // parameter conversions if there is no possibility of the virtual function
1202 // being overridden:
1203 if(obj && obj->is_derived_())
1205 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1207 // Call the virtual member method, which derived classes might override.
1208 obj->on_end_user_action();
1212 Glib::exception_handlers_invoke();
1217 BaseClassType *const base = static_cast<BaseClassType*>(
1218 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
1221 // Call the original underlying C function:
1222 if(base && base->end_user_action)
1223 (*base->end_user_action)(self);
1228 Glib::ObjectBase* TextBuffer_Class::wrap_new(GObject* object)
1230 return new TextBuffer((GtkTextBuffer*)object);
1234 /* The implementation: */
1236 GtkTextBuffer* TextBuffer::gobj_copy()
1242 TextBuffer::TextBuffer(const Glib::ConstructParams& construct_params)
1244 Glib::Object(construct_params)
1247 TextBuffer::TextBuffer(GtkTextBuffer* castitem)
1249 Glib::Object((GObject*)(castitem))
1252 TextBuffer::~TextBuffer()
1256 TextBuffer::CppClassType TextBuffer::textbuffer_class_; // initialize static member
1258 GType TextBuffer::get_type()
1260 return textbuffer_class_.init().get_type();
1263 GType TextBuffer::get_base_type()
1265 return gtk_text_buffer_get_type();
1269 TextBuffer::TextBuffer()
1271 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
1272 Glib::Object(Glib::ConstructParams(textbuffer_class_.init()))
1276 Glib::RefPtr<TextBuffer> TextBuffer::create()
1278 return Glib::RefPtr<TextBuffer>( new TextBuffer() );
1280 Glib::RefPtr<TextBuffer> TextBuffer::create(const Glib::RefPtr<TagTable>& tag_table)
1282 return Glib::RefPtr<TextBuffer>( new TextBuffer(tag_table) );
1284 int TextBuffer::get_line_count() const
1286 return gtk_text_buffer_get_line_count(const_cast<GtkTextBuffer*>(gobj()));
1289 int TextBuffer::get_char_count() const
1291 return gtk_text_buffer_get_char_count(const_cast<GtkTextBuffer*>(gobj()));
1294 Glib::RefPtr<TextBuffer::TagTable> TextBuffer::get_tag_table()
1297 Glib::RefPtr<TextBuffer::TagTable> retvalue = Glib::wrap(gtk_text_buffer_get_tag_table(gobj()));
1300 retvalue->reference(); //The function does not do a ref for us.
1304 Glib::RefPtr<const TextBuffer::TagTable> TextBuffer::get_tag_table() const
1307 Glib::RefPtr<const TextBuffer::TagTable> retvalue = Glib::wrap(gtk_text_buffer_get_tag_table(const_cast<GtkTextBuffer*>(gobj())));
1310 retvalue->reference(); //The function does not do a ref for us.
1314 Glib::ustring TextBuffer::get_text(const iterator& start, const iterator& end, bool include_hidden_chars)
1316 return Glib::convert_return_gchar_ptr_to_ustring(gtk_text_buffer_get_text(gobj(), (start).gobj(), (end).gobj(), static_cast<int>(include_hidden_chars)));
1319 Glib::ustring TextBuffer::get_slice(const iterator& start, const iterator& end, bool include_hidden_chars)
1321 return Glib::convert_return_gchar_ptr_to_ustring(gtk_text_buffer_get_slice(gobj(), (start).gobj(), (end).gobj(), static_cast<int>(include_hidden_chars)));
1324 Glib::RefPtr<TextBuffer::Mark> TextBuffer::create_mark(const Glib::ustring& mark_name, const iterator& where, bool left_gravity)
1327 Glib::RefPtr<TextBuffer::Mark> retvalue = Glib::wrap(gtk_text_buffer_create_mark(gobj(), mark_name.c_str(), (where).gobj(), static_cast<int>(left_gravity)));
1330 retvalue->reference(); //The function does not do a ref for us.
1334 void TextBuffer::move_mark(const Glib::RefPtr<Mark>& mark, const iterator& where)
1336 gtk_text_buffer_move_mark(gobj(), Glib::unwrap(mark), (where).gobj());
1339 void TextBuffer::delete_mark(const Glib::RefPtr<Mark>& mark)
1341 gtk_text_buffer_delete_mark(gobj(), Glib::unwrap(mark));
1344 Glib::RefPtr<TextBuffer::Mark> TextBuffer::get_mark(const Glib::ustring& name)
1347 Glib::RefPtr<TextBuffer::Mark> retvalue = Glib::wrap(gtk_text_buffer_get_mark(gobj(), name.c_str()));
1350 retvalue->reference(); //The function does not do a ref for us.
1354 Glib::RefPtr<const TextBuffer::Mark> TextBuffer::get_mark(const Glib::ustring& name) const
1357 Glib::RefPtr<const TextBuffer::Mark> retvalue = Glib::wrap(gtk_text_buffer_get_mark(const_cast<GtkTextBuffer*>(gobj()), name.c_str()));
1360 retvalue->reference(); //The function does not do a ref for us.
1364 void TextBuffer::move_mark_by_name(const Glib::ustring& name, const iterator& where)
1366 gtk_text_buffer_move_mark_by_name(gobj(), name.c_str(), (where).gobj());
1369 void TextBuffer::delete_mark_by_name(const Glib::ustring& name)
1371 gtk_text_buffer_delete_mark_by_name(gobj(), name.c_str());
1374 Glib::RefPtr<TextBuffer::Mark> TextBuffer::get_insert()
1377 Glib::RefPtr<TextBuffer::Mark> retvalue = Glib::wrap(gtk_text_buffer_get_insert(gobj()));
1380 retvalue->reference(); //The function does not do a ref for us.
1384 Glib::RefPtr<TextBuffer::Mark> TextBuffer::get_selection_bound()
1387 Glib::RefPtr<TextBuffer::Mark> retvalue = Glib::wrap(gtk_text_buffer_get_selection_bound(gobj()));
1390 retvalue->reference(); //The function does not do a ref for us.
1394 void TextBuffer::place_cursor(const iterator& where)
1396 gtk_text_buffer_place_cursor(gobj(), (where).gobj());
1399 void TextBuffer::apply_tag(const Glib::RefPtr<Tag>& tag, const iterator& start, const iterator& end)
1401 gtk_text_buffer_apply_tag(gobj(), Glib::unwrap(tag), (start).gobj(), (end).gobj());
1404 void TextBuffer::remove_tag(const Glib::RefPtr<Tag>& tag, const iterator& start, const iterator& end)
1406 gtk_text_buffer_remove_tag(gobj(), Glib::unwrap(tag), (start).gobj(), (end).gobj());
1409 void TextBuffer::apply_tag_by_name(const Glib::ustring& name, const iterator& start, const iterator& end)
1411 gtk_text_buffer_apply_tag_by_name(gobj(), name.c_str(), (start).gobj(), (end).gobj());
1414 void TextBuffer::remove_tag_by_name(const Glib::ustring& name, const iterator& start, const iterator& end)
1416 gtk_text_buffer_remove_tag_by_name(gobj(), name.c_str(), (start).gobj(), (end).gobj());
1419 void TextBuffer::remove_all_tags(const iterator& start, const iterator& end)
1421 gtk_text_buffer_remove_all_tags(gobj(), (start).gobj(), (end).gobj());
1424 bool TextBuffer::get_modified() const
1426 return gtk_text_buffer_get_modified(const_cast<GtkTextBuffer*>(gobj()));
1429 void TextBuffer::set_modified(bool setting)
1431 gtk_text_buffer_set_modified(gobj(), static_cast<int>(setting));
1434 void TextBuffer::add_selection_clipboard(const Glib::RefPtr<Clipboard>& clipboard)
1436 gtk_text_buffer_add_selection_clipboard(gobj(), Glib::unwrap(clipboard));
1439 void TextBuffer::remove_selection_clipboard(const Glib::RefPtr<Clipboard>& clipboard)
1441 gtk_text_buffer_remove_selection_clipboard(gobj(), Glib::unwrap(clipboard));
1444 void TextBuffer::cut_clipboard(const Glib::RefPtr<Clipboard>& clipboard, bool default_editable)
1446 gtk_text_buffer_cut_clipboard(gobj(), Glib::unwrap(clipboard), static_cast<int>(default_editable));
1449 void TextBuffer::copy_clipboard(const Glib::RefPtr<Clipboard>& clipboard)
1451 gtk_text_buffer_copy_clipboard(gobj(), Glib::unwrap(clipboard));
1454 bool TextBuffer::get_selection_bounds(iterator& start, iterator& end) const
1456 return gtk_text_buffer_get_selection_bounds(const_cast<GtkTextBuffer*>(gobj()), (start).gobj(), (end).gobj());
1459 bool TextBuffer::erase_selection(bool interactive, bool default_editable)
1461 return gtk_text_buffer_delete_selection(gobj(), static_cast<int>(interactive), static_cast<int>(default_editable));
1464 void TextBuffer::select_range(const iterator& ins, const iterator& bound)
1466 gtk_text_buffer_select_range(gobj(), (ins).gobj(), (bound).gobj());
1469 void TextBuffer::begin_user_action()
1471 gtk_text_buffer_begin_user_action(gobj());
1474 void TextBuffer::end_user_action()
1476 gtk_text_buffer_end_user_action(gobj());
1480 Glib::SignalProxy3< void,const TextBuffer::iterator&,const Glib::ustring&,int > TextBuffer::signal_insert()
1482 return Glib::SignalProxy3< void,const TextBuffer::iterator&,const Glib::ustring&,int >(this, &TextBuffer_signal_insert_info);
1485 Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<Gdk::Pixbuf>& > TextBuffer::signal_insert_pixbuf()
1487 return Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<Gdk::Pixbuf>& >(this, &TextBuffer_signal_insert_pixbuf_info);
1490 Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<ChildAnchor>& > TextBuffer::signal_insert_child_anchor()
1492 return Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<ChildAnchor>& >(this, &TextBuffer_signal_insert_child_anchor_info);
1495 Glib::SignalProxy2< void,const TextBuffer::iterator&,const TextBuffer::iterator& > TextBuffer::signal_erase()
1497 return Glib::SignalProxy2< void,const TextBuffer::iterator&,const TextBuffer::iterator& >(this, &TextBuffer_signal_erase_info);
1500 Glib::SignalProxy0< void > TextBuffer::signal_changed()
1502 return Glib::SignalProxy0< void >(this, &TextBuffer_signal_changed_info);
1505 Glib::SignalProxy0< void > TextBuffer::signal_modified_changed()
1507 return Glib::SignalProxy0< void >(this, &TextBuffer_signal_modified_changed_info);
1510 Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<TextBuffer::Mark>& > TextBuffer::signal_mark_set()
1512 return Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<TextBuffer::Mark>& >(this, &TextBuffer_signal_mark_set_info);
1515 Glib::SignalProxy1< void,const Glib::RefPtr<TextBuffer::Mark>& > TextBuffer::signal_mark_deleted()
1517 return Glib::SignalProxy1< void,const Glib::RefPtr<TextBuffer::Mark>& >(this, &TextBuffer_signal_mark_deleted_info);
1520 Glib::SignalProxy3< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& > TextBuffer::signal_apply_tag()
1522 return Glib::SignalProxy3< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& >(this, &TextBuffer_signal_apply_tag_info);
1525 Glib::SignalProxy3< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& > TextBuffer::signal_remove_tag()
1527 return Glib::SignalProxy3< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& >(this, &TextBuffer_signal_remove_tag_info);
1530 Glib::SignalProxy0< void > TextBuffer::signal_begin_user_action()
1532 return Glib::SignalProxy0< void >(this, &TextBuffer_signal_begin_user_action_info);
1535 Glib::SignalProxy0< void > TextBuffer::signal_end_user_action()
1537 return Glib::SignalProxy0< void >(this, &TextBuffer_signal_end_user_action_info);
1541 void Gtk::TextBuffer::on_insert(const TextBuffer::iterator& pos, const Glib::ustring& text, int bytes)
1543 BaseClassType *const base = static_cast<BaseClassType*>(
1544 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1547 if(base && base->insert_text)
1548 (*base->insert_text)(gobj(),const_cast<GtkTextIter*>((pos).gobj()),text.c_str(),bytes);
1551 void Gtk::TextBuffer::on_insert_pixbuf(const TextBuffer::iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
1553 BaseClassType *const base = static_cast<BaseClassType*>(
1554 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1557 if(base && base->insert_pixbuf)
1558 (*base->insert_pixbuf)(gobj(),const_cast<GtkTextIter*>((pos).gobj()),Glib::unwrap(pixbuf));
1561 void Gtk::TextBuffer::on_insert_child_anchor(const TextBuffer::iterator& pos, const Glib::RefPtr<ChildAnchor>& anchor)
1563 BaseClassType *const base = static_cast<BaseClassType*>(
1564 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1567 if(base && base->insert_child_anchor)
1568 (*base->insert_child_anchor)(gobj(),const_cast<GtkTextIter*>((pos).gobj()),Glib::unwrap(anchor));
1571 void Gtk::TextBuffer::on_erase(const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end)
1573 BaseClassType *const base = static_cast<BaseClassType*>(
1574 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1577 if(base && base->delete_range)
1578 (*base->delete_range)(gobj(),const_cast<GtkTextIter*>((range_begin).gobj()),const_cast<GtkTextIter*>((range_end).gobj()));
1581 void Gtk::TextBuffer::on_changed()
1583 BaseClassType *const base = static_cast<BaseClassType*>(
1584 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1587 if(base && base->changed)
1588 (*base->changed)(gobj());
1591 void Gtk::TextBuffer::on_modified_changed()
1593 BaseClassType *const base = static_cast<BaseClassType*>(
1594 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1597 if(base && base->modified_changed)
1598 (*base->modified_changed)(gobj());
1601 void Gtk::TextBuffer::on_mark_set(const TextBuffer::iterator& location, const Glib::RefPtr<TextBuffer::Mark>& mark)
1603 BaseClassType *const base = static_cast<BaseClassType*>(
1604 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1607 if(base && base->mark_set)
1608 (*base->mark_set)(gobj(),(location).gobj(),Glib::unwrap(mark));
1611 void Gtk::TextBuffer::on_mark_deleted(const Glib::RefPtr<TextBuffer::Mark>& mark)
1613 BaseClassType *const base = static_cast<BaseClassType*>(
1614 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1617 if(base && base->mark_deleted)
1618 (*base->mark_deleted)(gobj(),Glib::unwrap(mark));
1621 void Gtk::TextBuffer::on_apply_tag(const Glib::RefPtr<TextBuffer::Tag>& tag, const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end)
1623 BaseClassType *const base = static_cast<BaseClassType*>(
1624 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1627 if(base && base->apply_tag)
1628 (*base->apply_tag)(gobj(),Glib::unwrap(tag),(range_begin).gobj(),(range_end).gobj());
1631 void Gtk::TextBuffer::on_remove_tag(const Glib::RefPtr<TextBuffer::Tag>& tag, const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end)
1633 BaseClassType *const base = static_cast<BaseClassType*>(
1634 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1637 if(base && base->remove_tag)
1638 (*base->remove_tag)(gobj(),Glib::unwrap(tag),(range_begin).gobj(),(range_end).gobj());
1641 void Gtk::TextBuffer::on_begin_user_action()
1643 BaseClassType *const base = static_cast<BaseClassType*>(
1644 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1647 if(base && base->begin_user_action)
1648 (*base->begin_user_action)(gobj());
1651 void Gtk::TextBuffer::on_end_user_action()
1653 BaseClassType *const base = static_cast<BaseClassType*>(
1654 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1657 if(base && base->end_user_action)
1658 (*base->end_user_action)(gobj());