Upgraded gtkmm to gtkmm-2.10.7.
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / textbuffer.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TEXTBUFFER_H
4 #define _GTKMM_TEXTBUFFER_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* Copyright(C) 1998-2002 The gtkmm Development Team
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or(at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the Free
25  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26  */
27
28
29 #include <gtkmm/object.h>
30 #include <gtkmm/texttagtable.h>
31 #include <gtkmm/textchildanchor.h>
32 #include <gtkmm/textmark.h>
33 #include <gtkmm/textiter.h>
34 #include <gtkmm/clipboard.h>
35 #include <gdkmm/pixbuf.h>
36 #include <gtkmmconfig.h>
37 #include <utility>
38
39 GLIBMM_USING_STD(pair)
40
41
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 typedef struct _GtkTextBuffer GtkTextBuffer;
44 typedef struct _GtkTextBufferClass GtkTextBufferClass;
45 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
46
47
48 namespace Gtk
49 { class TextBuffer_Class; } // namespace Gtk
50 namespace Gtk
51 {
52
53 class TextMark;
54 class TextIter;
55
56 /** Multi-line attributed text that can be displayed by one or more Gtk::TextView widgets.
57  *
58  * Text in a buffer can be marked with tags. A @link Gtk::TextTag Gtk::TextBuffer::Tag@endlink is an attribute that can be applied to some range of text. For example, a tag
59  * might be called "bold" and make the text inside the tag bold. However, the tag concept is more general than that; tags don't
60  * have to affect appearance. They can instead affect the behavior of mouse and key presses, "lock" a range of text so the user
61  * can't edit it, or countless other things. A tag is represented by a @link Gtk::TextTag Gtk::TextBuffer::Tag@endlink object.
62  * One @link Gtk::TextTag Gtk::TextBuffer::Tag@endlink can be applied to any number of text ranges in any number of @link Gtk::TextBuffer Gtk::TextBuffers@endlink.
63  *
64  * Each tag is stored in a @link Gtk::TextTagTable Gtk::TextBuffer::TagTable@endlink. A tag table defines a set of tags that can be used together. Each buffer has one tag
65  * table associated with it; only tags from that tag table can be used with the buffer. A single tag table can be shared between
66  * multiple buffers, however.
67  *
68  * Most text manipulation is accomplished with iterators, represented by an @link Gtk::TextIter iterator@endlink. The iterator can
69  * be used to navigate over characters, words, lines, and sentences.
70  *
71  * But iterators can't be used to preserve positions across buffer modifications. To preserve a position, the
72  * @link Gtk::TextMark Gtk::TextBuffer::Mark@endlink object is ideal. There are two marks built-in to GtkTextBuffer; these are
73  * named "insert" and "selection_bound" and refer to the insertion point and the boundary of the selection which is not the
74  * insertion point. If no text is selected, these two marks will be in the same position. You can manipulate what is selected and
75  * where the cursor appears by moving these marks around.
76  *
77  * Text buffers always contain at least one line, but may be empty (that is, buffers can contain zero characters). The last line
78  * in the text buffer never ends in a line separator (such as newline); the other lines in the buffer always end in a line
79  * separator. Line separators count as characters when computing character counts and character offsets. Note that some Unicode
80  * line separators are represented with multiple bytes in UTF-8, and the two-character sequence "\r\n" is also considered a line
81  * separator.
82  *
83  * @ingroup TextView
84  */
85
86 class TextBuffer : public Glib::Object
87 {
88    
89 #ifndef DOXYGEN_SHOULD_SKIP_THIS
90
91 public:
92   typedef TextBuffer CppObjectType;
93   typedef TextBuffer_Class CppClassType;
94   typedef GtkTextBuffer BaseObjectType;
95   typedef GtkTextBufferClass BaseClassType;
96
97 private:  friend class TextBuffer_Class;
98   static CppClassType textbuffer_class_;
99
100 private:
101   // noncopyable
102   TextBuffer(const TextBuffer&);
103   TextBuffer& operator=(const TextBuffer&);
104
105 protected:
106   explicit TextBuffer(const Glib::ConstructParams& construct_params);
107   explicit TextBuffer(GtkTextBuffer* castitem);
108
109 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
110
111 public:
112   virtual ~TextBuffer();
113
114 #ifndef DOXYGEN_SHOULD_SKIP_THIS
115   static GType get_type()      G_GNUC_CONST;
116   static GType get_base_type() G_GNUC_CONST;
117 #endif
118
119   ///Provides access to the underlying C GObject.
120   GtkTextBuffer*       gobj()       { return reinterpret_cast<GtkTextBuffer*>(gobject_); }
121
122   ///Provides access to the underlying C GObject.
123   const GtkTextBuffer* gobj() const { return reinterpret_cast<GtkTextBuffer*>(gobject_); }
124
125   ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
126   GtkTextBuffer* gobj_copy();
127
128 private:
129
130    
131 public:
132   typedef TextIter iterator;
133   typedef TextTag Tag;
134   typedef TextTagTable TagTable;
135   typedef TextMark Mark;
136   typedef TextChildAnchor ChildAnchor;
137
138 protected:
139   TextBuffer();
140   explicit TextBuffer(const Glib::RefPtr<TagTable>& tag_table);
141
142 public:
143   
144   static Glib::RefPtr<TextBuffer> create();
145
146   
147   static Glib::RefPtr<TextBuffer> create(const Glib::RefPtr<TagTable>& tag_table);
148
149
150   /** Obtains the number of lines in the buffer. This value is cached, so
151    * the function is very fast.
152    * @return Number of lines in the buffer.
153    */
154   int get_line_count() const;
155   
156   /** Gets the number of characters in the buffer; note that characters
157    * and bytes are not the same, you can't e.g.\ expect the contents of
158    * the buffer in string form to be this many bytes long. The character
159    * count is cached, so this function is very fast.
160    * @return Number of characters in the buffer.
161    */
162   int get_char_count() const;
163
164   /// See get_char_count().
165   int size() const;
166
167   
168   /** Get the Gtk::TextTagTable associated with this buffer.
169    * @return The buffer's tag table.
170    */
171   Glib::RefPtr<TextBuffer::TagTable> get_tag_table();
172   
173   /** Get the Gtk::TextTagTable associated with this buffer.
174    * @return The buffer's tag table.
175    */
176   Glib::RefPtr<const TextBuffer::TagTable> get_tag_table() const;
177
178   /** Removes the current contents of the buffer, and inserts @a text instead.
179    * @param text The text to put in the buffer.
180    */
181   void set_text(const Glib::ustring& text);
182
183   /** Removes the current contents of the buffer, and inserts @a text instead.
184    * @param text_begin The start of a UTF8 character array.
185    * @param text_end The end of the UTF8 character array.
186    */
187   void set_text(const char* text_begin, const char* text_end);
188   
189
190   #ifndef GTKMM_DISABLE_DEPRECATED
191
192   /** @deprecated Use set_text()
193    */
194   void assign(const Glib::ustring& text);
195   
196   /** @deprecated Use set_text()
197    */
198   void assign(const char* text_begin, const char* text_end);
199   #endif // GTKMM_DISABLE_DEPRECATED
200
201
202   //TODO: Make all insert() methods have the same return type:
203   
204   /** Inserts @a text at position @a pos.
205    * Emits the "insert_text" signal; insertion actually occurs in the default handler for the signal.
206    * The @a pos iterator is invalidated when insertion occurs (because the buffer contents change).
207    *
208    * @param pos An iterator pointing to the position at which the text should be inserted.
209    * @param text The text to be inserted in the buffer.
210    * @result An iterator that points to the end of the inserted text.
211    */
212   iterator insert(const iterator& pos, const Glib::ustring& text);
213
214   /** Inserts text at position @a pos.
215    * Emits the "insert_text" signal; insertion actually occurs in the default handler for the signal.
216    * The @a pos iterator is invalidated when insertion occurs (because the buffer contents change).
217    *
218    * @param pos An iterator pointing to the position at which the text should be inserted.
219    * @param text_begin The start of a UTF8 character array.
220    * @param text_end The end of the UTF8 character array.
221    * @result An iterator that points to the end of the inserted text.
222    */
223   iterator insert(const iterator& pos, const char* text_begin, const char* text_end);
224
225   /** Inserts @a text, using the current cursor position as the insertion point.
226    * Emits the "insert_text" signal; insertion actually occurs in the default handler for the signal.
227    *
228    * @param text The text to be inserted in the buffer.
229    * @result An iterator that points to the end of the inserted text.
230    */
231   void insert_at_cursor(const Glib::ustring& text);
232
233   /** Inserts text, using the current cursor position as the insertion point.
234    * Emits the "insert_text" signal; insertion actually occurs in the default handler for the signal.
235    *
236    * @param text_begin The start of a UTF8 character array.
237    * @param text_end The end of the UTF8 character array.
238    * @result An iterator that points to the end of the inserted text.
239    */
240   void insert_at_cursor(const char* text_begin, const char* text_end);
241
242   /** Like insert(), but the insertion will not occur if @a iter is at a non-editable location in the buffer.
243    * Usually you want to prevent insertions at ineditable locations if the insertion results from a user action (is interactive).
244    *
245    * @a default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it.
246    * Typically the result of Gtk::TextView::get_editable() is appropriate here.
247    *
248    * @param pos An iterator pointing to the position at which the text should be inserted.
249    * @param text The text to be inserted in the buffer.
250    * @param default_editable Default editability of buffer
251    * @result Whether text was actually inserted
252    */
253   std::pair<iterator,bool> insert_interactive(
254       const iterator& pos, const Glib::ustring& text, bool default_editable = true);
255
256   /** Like insert(), but the insertion will not occur if @a pos is at a non-editable location in the buffer.
257    * Usually you want to prevent insertions at ineditable locations if the insertion results from a user action (is interactive).
258    *
259    * @a default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it.
260    * Typically the result of Gtk::TextView::get_editable() is appropriate here.
261    *
262    * @param pos An iterator pointing to the position at which the text should be inserted.
263    * @param text_begin The start of a UTF8 character array.
264    * @param text_end The end of the UTF8 character array.
265    * @param default_editable Default editability of buffer.
266    * @result Whether text was actually inserted
267    */
268   std::pair<iterator,bool> insert_interactive(
269       const iterator& pos, const char* text_begin, const char* text_end, bool default_editable = true);
270
271   /** Calls insert_interactive() at the cursor position.
272    *
273    * @a default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it.
274    * Typically the result of Gtk::TextView::get_editable() is appropriate here.
275    *
276    * @param text The text to be inserted in the buffer.
277    * @param default_editable Default editability of buffer
278    * @result Whether text was actually inserted
279    */
280   bool insert_interactive_at_cursor(const Glib::ustring& text, bool default_editable = true);
281
282   /** Calls insert_interactive() at the cursor position.
283    *
284    * @a default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it.
285    * Typically the result of Gtk::TextView::get_editable() is appropriate here.
286    *
287    * @param text_begin The start of a UTF8 character array.
288    * @param text_end The end of the UTF8 character array.
289    * @param default_editable Default editability of buffer
290    * @result Whether text was actually inserted
291    */
292   bool insert_interactive_at_cursor(const char* text_begin, const char* text_end,
293                                     bool default_editable = true);
294
295   /** Copies text, tags, and pixbufs between @a range_begin and @a range_end (the order of range_begin and range_begin doesn't
296    * matter) and inserts the copy at @a pos. Used instead of simply getting/inserting text because it preserves images and tags.
297    * If range_begin and range_end are in a different buffer, the two buffers must share the same tag table.
298    *
299    * Implemented via emissions of the insert_text and apply_tag signals, so expect those.
300    *
301    * @param pos An iterator pointing to the position at which the text should be inserted.
302    * @param range_begin A position in a buffer.
303    * @param range_end Another position in the same buffer as @a range_begin.
304    * @result Whether text was actually inserted
305    */
306   iterator insert(const iterator& pos, const iterator& range_begin, const iterator& range_end);
307   
308  
309   /** Same as insert_range(), but does nothing if the insertion point isn't editable.
310    *
311    * The @a default_editable parameter indicates whether the text is editable at @a pos if no tags enclosing @a pos affect editability.
312    * Typically the result of Gtk::TextView::get_editable() is appropriate here.
313    *
314    * @param pos An iterator pointing to the position at which the text should be inserted.
315    * @param range_begin A position in a buffer.
316    * @param range_end Another position in the same buffer as @a range_begin.
317    * @param default_editable Default editability of buffer.
318    * @result Whether text was actually inserted
319    */
320   std::pair<iterator,bool> insert_interactive(const iterator& pos, const iterator& range_begin, const iterator& range_end, bool default_editable = true);
321   
322
323   iterator insert_with_tag(const iterator& pos, const Glib::ustring& text, const Glib::RefPtr<Tag>& tag);
324   iterator insert_with_tag(const iterator& pos, const char* text_begin, const char* text_end, const Glib::RefPtr<Tag>& tag);
325
326   iterator insert_with_tag(const iterator& pos, const Glib::ustring& text, const Glib::ustring& tag_name);
327   iterator insert_with_tag(const iterator& pos, const char* text_begin, const char* text_end, const Glib::ustring& tag_name);
328
329   /** Inserts text into buffer at @a pos, applying the list of tags to the newly-inserted text.
330    * Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
331    *
332    * @param pos An iterator pointing to the position at which the text should be inserted.
333    * @param text The text to be inserted in the buffer.
334    * @param tags A standard C++ container of @link Gtk::TextTag Gtk::TextBuffer::Tags@endlink.
335    * @result Whether text was actually inserted
336    */
337   iterator insert_with_tags(const iterator& pos, const Glib::ustring& text,
338                             const Glib::ArrayHandle< Glib::RefPtr<Tag> >& tags);
339
340   /** Inserts text into buffer at @a pos, applying the list of tags to the newly-inserted text.
341    * Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
342    *
343    * @param pos An iterator pointing to the position at which the text should be inserted.
344    * @param text_begin The start of a UTF8 character array.
345    * @param text_end The end of the UTF8 character array.
346    * @param tags A standard C++ container of @link Gtk::TextTag Gtk::TextBuffer::Tags@endlink.
347    * @result Whether text was actually inserted
348    */                          
349   iterator insert_with_tags(const iterator& pos, const char* text_begin, const char* text_end,
350                             const Glib::ArrayHandle< Glib::RefPtr<Tag> >& tags);
351
352   /** Inserts text into buffer at @a pos, applying the list of tags to the newly-inserted text.
353    * Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
354    *
355    * @param pos An iterator pointing to the position at which the text should be inserted.
356    * @param text The text to be inserted in the buffer.
357    * @param tag_names A standard C++ container of tag names.
358    * @result Whether text was actually inserted
359    */
360   iterator insert_with_tags_by_name(const iterator& pos, const Glib::ustring& text,
361                                     const Glib::StringArrayHandle& tag_names);
362
363
364   /** Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
365    *
366    * @param pos An iterator pointing to the position at which the text should be inserted.
367    * @param text_begin The start of a UTF8 character array.
368    * @param text_end The end of the UTF8 character array.
369    * @param tag_names A standard C++ container of tag names.
370    * @result Whether text was actually inserted
371    */                                   
372   iterator insert_with_tags_by_name(const iterator& pos, const char* text_begin, const char* text_end,
373                                     const Glib::StringArrayHandle& tag_names);
374
375   /* Deletes all text between @a range_begin and @a range_end. The order of range_begin and range_end is not actually relevant.
376    * This function actually emits the "delete_range" signal, and the default handler of that signal deletes the text.
377    * Because the buffer is modified, all outstanding iterators become invalid after calling this function.
378    * @param range_begin
379    * @param range_end
380    * @result An iterator that points to the location where text was deleted.
381    */
382   iterator erase(const iterator& range_begin, const iterator& range_end);
383   
384
385    /* Deletes all editable text between @a range_begin and @a range_end. The order of range_begin and range_end is not actually relevant.
386    * This function actually emits the "delete_range" signal, and the default handler of that signal deletes the text.
387    * Because the buffer is modified, all outstanding iterators become invalid after calling this function.
388    *
389    * @a default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it.
390    * Typically the result of Gtk::TextView::get_editable() is appropriate here.
391    *
392    * @param range_begin
393    * @param range_end
394    * @param default_editable Default editability of buffer
395    * @result An iterator that points to the location where text was deleted, or end() is no text was deleted.
396    */
397   std::pair<iterator,bool> erase_interactive(const iterator& range_begin, const iterator& range_end, bool default_editable = true);
398   
399
400   /** Performs the appropriate action as if the user hit the delete
401    * key with the cursor at the position specified by @a iter. In the
402    * normal case a single character will be deleted, but when
403    * combining accents are involved, more than one character can
404    * be deleted, and when precomposed character and accent combinations
405    * are involved, less than one character will be deleted.
406    * 
407    * Because the buffer is modified, all outstanding iterators become 
408    * invalid after calling this method; however, this method returns 
409    * a valid iterator that points to the location where text was deleted.
410    *
411    * @param iter A position in the buffer.
412    * @param interactive Whether the deletion is caused by user interaction.
413    * @param default_editable Whether the buffer is editable by default.
414    * @result An iterator to the location where text was deleted, if the buffer was modified.
415    *
416    * @newin2p6
417    */
418   iterator backspace(const iterator& iter, bool interactive = true, bool default_editable = true);
419   
420
421   /** @deprecated Use get_text(const iterator& start, const iterator& end, bool include_hidden_chars) const
422    */
423   
424   /** Returns the text in the range [ @a start , @a end ). Excludes undisplayed
425    * text (text marked with tags that set the invisibility attribute) if
426    *  @a include_hidden_chars  is <tt>false</tt>. Does not include characters
427    * representing embedded images, so byte and character indexes into
428    * the returned string do <em>not</em> correspond to byte
429    * and character indexes into the buffer. Contrast with
430    * get_slice().
431    * @param start Start of a range.
432    * @param end End of a range.
433    * @param include_hidden_chars Whether to include invisible text.
434    * @return An allocated UTF-8 string.
435    */
436   Glib::ustring get_text(const iterator& start, const iterator& end, bool include_hidden_chars = true);
437
438   
439   /** Returns the text in the range [ @a start , @a end ). Excludes undisplayed
440    * text (text marked with tags that set the invisibility attribute) if
441    *  @a include_hidden_chars  is <tt>false</tt>. Does not include characters
442    * representing embedded images, so byte and character indexes into
443    * the returned string do <em>not</em> correspond to byte
444    * and character indexes into the buffer. Contrast with
445    * get_slice().
446    * @param start Start of a range.
447    * @param end End of a range.
448    * @param include_hidden_chars Whether to include invisible text.
449    * @return An allocated UTF-8 string.
450    */
451   Glib::ustring get_text(const iterator& start, const iterator& end, bool include_hidden_chars = true) const;
452
453   /** @deprecated Use get_text(bool include_hidden_chars) const.
454    */
455   Glib::ustring get_text(bool include_hidden_chars = true);
456
457   /** Returns all the text in the buffer. Excludes undisplayed
458    * text (text marked with tags that set the invisibility attribute) if
459    *  @a include_hidden_chars  is <tt>false</tt>. Does not include characters
460    * representing embedded images, so byte and character indexes into
461    * the returned string do <em>not</em> correspond to byte
462    * and character indexes into the buffer. Contrast with
463    * get_slice().
464    *
465    * @param include_hidden_chars Whether to include invisible text.
466    * @return An allocated UTF-8 string.
467    */
468   Glib::ustring get_text(bool include_hidden_chars = true) const;
469
470   /** @deprecated Use get_slice(const iterator& start, const iterator& end, bool include_hidden_chars) const.
471    */
472   
473   /** Returns the text in the range [ @a start , @a end ). Excludes undisplayed
474    * text (text marked with tags that set the invisibility attribute) if
475    *  @a include_hidden_chars  is <tt>false</tt>. The returned string includes a
476    * 0xFFFC character whenever the buffer contains
477    * embedded images, so byte and character indexes into
478    * the returned string <em>do</em> correspond to byte
479    * and character indexes into the buffer. Contrast with
480    * get_text(). Note that 0xFFFC can occur in normal
481    * text as well, so it is not a reliable indicator that a pixbuf or
482    * widget is in the buffer.
483    * @param start Start of a range.
484    * @param end End of a range.
485    * @param include_hidden_chars Whether to include invisible text.
486    * @return An allocated UTF-8 string.
487    */
488   Glib::ustring get_slice(const iterator& start, const iterator& end, bool include_hidden_chars = true);
489
490   
491   /** Returns the text in the range [ @a start , @a end ). Excludes undisplayed
492    * text (text marked with tags that set the invisibility attribute) if
493    *  @a include_hidden_chars  is <tt>false</tt>. The returned string includes a
494    * 0xFFFC character whenever the buffer contains
495    * embedded images, so byte and character indexes into
496    * the returned string <em>do</em> correspond to byte
497    * and character indexes into the buffer. Contrast with
498    * get_text(). Note that 0xFFFC can occur in normal
499    * text as well, so it is not a reliable indicator that a pixbuf or
500    * widget is in the buffer.
501    * @param start Start of a range.
502    * @param end End of a range.
503    * @param include_hidden_chars Whether to include invisible text.
504    * @return An allocated UTF-8 string.
505    */
506   Glib::ustring get_slice(const iterator& start, const iterator& end, bool include_hidden_chars = true) const;
507
508   iterator insert_pixbuf(const iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
509   
510
511   iterator insert_child_anchor(const iterator& pos, const Glib::RefPtr<ChildAnchor>& anchor);
512   
513
514   Glib::RefPtr<ChildAnchor> create_child_anchor(const iterator& pos);
515   
516
517   /** Creates a mark at position @a where . The mark can be retrieved by name using
518    * get_mark(). If a mark has left gravity, and text is
519    * inserted at the mark's current location, the mark will be moved to
520    * the left of the newly-inserted text. If the mark has right gravity
521    * ( @a left_gravity  = <tt>false</tt>), the mark will end up on the right of
522    * newly-inserted text. The standard left-to-right cursor is a mark
523    * with right gravity (when you type, the cursor stays on the right
524    * side of the text you're typing).
525    * 
526    * Emits the "mark_set" signal as notification of the mark's initial
527    * placement.
528    * @param mark_name Name for mark, or <tt>0</tt>.
529    * @param where Location to place mark.
530    * @param left_gravity Whether the mark has left gravity.
531    * @return The new Gtk::TextMark object.
532    */
533   Glib::RefPtr<TextBuffer::Mark> create_mark(const Glib::ustring& mark_name, const iterator& where, bool left_gravity = true);
534
535   /** Create an anonymous mark. */
536   /** Creates an anonymous mark at position @a where.
537    *
538    * If a mark has left gravity, and text is
539    * inserted at the mark's current location, the mark will be moved to
540    * the left of the newly-inserted text. If the mark has right gravity
541    * ( @a left_gravity  = <tt>false</tt>), the mark will end up on the right of
542    * newly-inserted text. The standard left-to-right cursor is a mark
543    * with right gravity (when you type, the cursor stays on the right
544    * side of the text you're typing).
545    *
546    * Emits the "mark_set" signal as notification of the mark's initial
547    * placement.
548    * @param where Location to place mark.
549    * @param left_gravity Whether the mark has left gravity.
550    * @return The new Gtk::TextMark object.
551    */ 
552   Glib::RefPtr<Mark> create_mark(const iterator& where, bool left_gravity = true);
553
554   
555   /** Moves @a mark  to the new location @a where . Emits the "mark_set" signal
556    * as notification of the move.
557    * @param mark A Gtk::TextMark.
558    * @param where New location for @a mark  in @a buffer .
559    */
560   void move_mark(const Glib::RefPtr<Mark>& mark, const iterator& where);
561   
562   /** Deletes @a mark , so that it's no longer located anywhere in the
563    * buffer. Removes the reference the buffer holds to the mark, so if
564    * you don't keep a Glib::RefPtr to the mark, it will be freed. Even
565    * if the mark isn't freed, most operations on @a mark  become
566    * invalid. There is no way to undelete a
567    * mark. Gtk::TextMark::get_deleted() will return <tt>true</tt> after this
568    * function has been called on a mark; Gtk::TextMark::get_deleted()
569    * indicates that a mark no longer belongs to a buffer. The "mark_deleted"
570    * signal will be emitted as notification after the mark is deleted.
571    * @param mark A Gtk::TextMark in @a buffer .
572    */
573   void delete_mark(const Glib::RefPtr<Mark>& mark);
574
575   
576   /** Returns the mark named @a name  in buffer @a buffer , or <tt>0</tt> if no such
577    * mark exists in the buffer.
578    * @param name A mark name.
579    * @return A Gtk::TextMark, or <tt>0</tt>.
580    */
581   Glib::RefPtr<TextBuffer::Mark> get_mark(const Glib::ustring& name);
582   
583   /** Returns the mark named @a name  in buffer @a buffer , or <tt>0</tt> if no such
584    * mark exists in the buffer.
585    * @param name A mark name.
586    * @return A Gtk::TextMark, or <tt>0</tt>.
587    */
588   Glib::RefPtr<const TextBuffer::Mark> get_mark(const Glib::ustring& name) const;
589
590   
591   /** Moves the mark named @a name  (which must exist) to location @a where .
592    * See move_mark() for details.
593    * @param name Name of a mark.
594    * @param where New location for mark.
595    */
596   void move_mark_by_name(const Glib::ustring& name, const iterator& where);
597   
598   /** Deletes the mark named @a name ; the mark must exist. See
599    * delete_mark() for details.
600    * @param name Name of a mark in @a buffer .
601    */
602   void delete_mark_by_name(const Glib::ustring& name);
603
604   
605   /** Returns the mark that represents the cursor (insertion point).
606    * Equivalent to calling get_mark() to get the mark
607    * named "insert", but very slightly more efficient, and involves less
608    * typing.
609    * @return Insertion point mark.
610    */
611   Glib::RefPtr<TextBuffer::Mark> get_insert();
612   
613   /** Returns the mark that represents the selection bound.  Equivalent
614    * to calling get_mark() to get the mark named
615    * "selection_bound", but very slightly more efficient, and involves
616    * less typing.
617    * 
618    * The currently-selected text in @a buffer  is the region between the
619    * "selection_bound" and "insert" marks. If "selection_bound" and
620    * "insert" are in the same place, then there is no current selection.
621    * get_selection_bounds() is another convenient function
622    * for handling the selection, if you just want to know whether there's a
623    * selection and what its bounds are.
624    * @return Selection bound mark.
625    */
626   Glib::RefPtr<TextBuffer::Mark> get_selection_bound();
627
628   
629   /** This function moves the "insert" and "selection_bound" marks
630    * simultaneously.  If you move them to the same place in two steps
631    * with move_mark(), you will temporarily select a
632    * region in between their old and new locations, which can be pretty
633    * inefficient since the temporarily-selected region will force stuff
634    * to be recalculated. This function moves them as a unit, which can
635    * be optimized.
636    * @param where Where to put the cursor.
637    */
638   void place_cursor(const iterator& where);
639   
640   /** Emits the "apply_tag" signal on @a buffer . The default
641    * handler for the signal applies @a tag  to the given range.
642    *  @a start  and @a end  do not have to be in order.
643    * @param tag A Gtk::TextTag.
644    * @param start One bound of range to be tagged.
645    * @param end Other bound of range to be tagged.
646    */
647   void apply_tag(const Glib::RefPtr<Tag>& tag, const iterator& start, const iterator& end);
648   
649   /** Emits the "remove_tag" signal. The default handler for the signal
650    * removes all occurrences of @a tag  from the given range. @a start  and
651    *  @a end  don't have to be in order.
652    * @param tag A Gtk::TextTag.
653    * @param start One bound of range to be untagged.
654    * @param end Other bound of range to be untagged.
655    */
656   void remove_tag(const Glib::RefPtr<Tag>& tag, const iterator& start, const iterator& end);
657   
658   /** Calls Gtk::TextTagTable::lookup() on the buffer's tag table to
659    * get a Gtk::TextTag, then calls apply_tag().
660    * @param name Name of a named Gtk::TextTag.
661    * @param start One bound of range to be tagged.
662    * @param end Other bound of range to be tagged.
663    */
664   void apply_tag_by_name(const Glib::ustring& name, const iterator& start, const iterator& end);
665   
666   /** Calls Gtk::TextTagTable::lookup() on the buffer's tag table to
667    * get a Gtk::TextTag, then calls remove_tag().
668    * @param name Name of a Gtk::TextTag.
669    * @param start One bound of range to be untagged.
670    * @param end Other bound of range to be untagged.
671    */
672   void remove_tag_by_name(const Glib::ustring& name, const iterator& start, const iterator& end);
673   
674   /** Removes all tags in the range between @a start  and @a end .  Be careful
675    * with this function; it could remove tags added in code unrelated to
676    * the code you're currently writing. That is, using this function is
677    * probably a bad idea if you have two or more unrelated code sections
678    * that add tags.
679    * @param start One bound of range to be untagged.
680    * @param end Other bound of range to be untagged.
681    */
682   void remove_all_tags(const iterator& start, const iterator& end);
683
684   /** Creates a tag and adds it to the tag table for buffer. Equivalent to calling Gtk::TextBuffer::Tag::create() and then adding
685    * the tag to the buffer's tag table.
686    * A tag called @a tag_name must not already exist in the tag table for this buffer.
687    *
688    * @param tag_name The name for the new tag.
689    * @result The new tag.
690    */
691   Glib::RefPtr<Tag> create_tag(const Glib::ustring& tag_name);
692   
693
694   /** Creates an anoymous tag and adds it to the tag table for buffer. Equivalent to calling Gtk::TextBuffer::Tag::create() and then adding
695    * the tag to the buffer's tag table.
696    *
697    * @result The new tag.
698    */
699   Glib::RefPtr<Tag> create_tag();
700
701   iterator get_iter_at_line_offset(int line_number, int char_offset);
702   iterator get_iter_at_line_index(int line_number, int byte_index);
703   iterator get_iter_at_offset(int char_offset);
704   iterator get_iter_at_line(int line_number);
705   iterator begin();
706   iterator end();
707   void get_bounds(iterator& range_begin, iterator& range_end);
708
709   /** Get the current position of a mark.
710    * @param mark The @link Gtk::TextMark Gtk::TextBuffer::Mark@endlink
711    * @result An iterator that points to the position of the @a mark.
712    */
713   iterator get_iter_at_mark(const Glib::RefPtr<Mark>& mark);
714
715   /** Get the current position of an anchor.
716    * @param anchor A @link Gtk::TextChildAnchor Gtk::TextBuffer::Anchor@endlink that appears in the buffer.
717    * @result An iterator that points to the position of the @a anchor.
718    */
719   iterator get_iter_at_child_anchor(const Glib::RefPtr<ChildAnchor>& anchor);
720
721   
722   /** Indicates whether the buffer has been modified since the last call
723    * to set_modified() set the modification flag to
724    * <tt>false</tt>. Used for example to enable a "save" function in a text
725    * editor.
726    * @return <tt>true</tt> if the buffer has been modified.
727    */
728   bool get_modified() const;
729   
730   /** Used to keep track of whether the buffer has been modified since the
731    * last time it was saved. Whenever the buffer is saved to disk, call
732    * gtk_text_buffer_set_modified ( @a buffer , <tt>false</tt>). When the buffer is modified,
733    * it will automatically toggled on the modified bit again. When the modified
734    * bit flips, the buffer emits a "modified_changed" signal.
735    * @param setting Modification flag setting.
736    */
737   void set_modified(bool setting = true);
738
739   
740   bool get_has_selection() const;
741
742   
743   /** Adds @a clipboard  to the list of clipboards in which the selection contents
744    * of @a buffer  are available. In most cases, @a clipboard  will be the Gtk::Clipboard
745    * of type Gdk::SELECTION_PRIMARY for a view of @a buffer .
746    * @param clipboard A Gtk::Clipboard.
747    */
748   void add_selection_clipboard(const Glib::RefPtr<Clipboard>& clipboard);
749   
750   /** Removes a Gtk::Clipboard added with add_selection_clipboard()
751    * @param clipboard A Gtk::Clipboard added to @a buffer  by add_selection_clipboard().
752    */
753   void remove_selection_clipboard(const Glib::RefPtr<Clipboard>& clipboard);
754   
755   /** Copies the currently-selected text to a clipboard, then deletes
756    * said text if it's editable.
757    * @param clipboard The Gtk::Clipboard object to cut to.
758    * @param default_editable Default editability of the buffer.
759    */
760   void cut_clipboard(const Glib::RefPtr<Clipboard>& clipboard, bool default_editable = true);
761   
762   /** Copies the currently-selected text to a clipboard.
763    * @param clipboard The Gtk::Clipboard object to copy to.
764    */
765   void copy_clipboard(const Glib::RefPtr<Clipboard>& clipboard);
766   void paste_clipboard(const Glib::RefPtr<Clipboard>& clipboard, const iterator& override_location, bool default_editable = true);
767   void paste_clipboard(const Glib::RefPtr<Clipboard>& clipboard, bool default_editable = true);
768   
769
770   /** Returns <tt>true</tt> if some text is selected; places the bounds
771    * of the selection in @a start  and @a end  (if the selection has length 0,
772    * then @a start  and @a end  are filled in with the same value).
773    *  @a start  and @a end  will be in ascending order. If @a start  and @a end  are
774    * <tt>0</tt>, then they are not filled in, but the return value still indicates
775    * whether text is selected.
776    * @param start Iterator to initialize with selection start.
777    * @param end Iterator to initialize with selection end.
778    * @return Whether the selection has nonzero length.
779    */
780   bool get_selection_bounds(iterator& start, iterator& end) const;
781   
782   /** Deletes the range between the "insert" and "selection_bound" marks,
783    * that is, the currently-selected text. If @a interactive  is <tt>true</tt>,
784    * the editability of the selection will be considered (users can't delete
785    * uneditable text).
786    * @param interactive Whether the deletion is caused by user interaction.
787    * @param default_editable Whether the buffer is editable by default.
788    * @return Whether there was a non-empty selection to delete.
789    */
790   bool erase_selection(bool interactive = true, bool default_editable = true);
791
792   
793   /** This function moves the "insert" and "selection_bound" marks
794    * simultaneously.  If you move them in two steps
795    * with move_mark(), you will temporarily select a
796    * region in between their old and new locations, which can be pretty
797    * inefficient since the temporarily-selected region will force stuff
798    * to be recalculated. This function moves them as a unit, which can
799    * be optimized.
800    * 
801    * @newin2p4
802    * @param ins Where to put the "insert" mark.
803    * @param bound Where to put the "selection_bound" mark.
804    */
805   void select_range(const iterator& ins, const iterator& bound);
806   
807 /* Called to specify atomic user actions, used to implement undo */
808   
809   /** Called to indicate that the buffer operations between here and a
810    * call to end_user_action() are part of a single
811    * user-visible operation. The operations between
812    * begin_user_action() and
813    * end_user_action() can then be grouped when creating
814    * an undo stack. Gtk::TextBuffer maintains a count of calls to
815    * begin_user_action() that have not been closed with
816    * a call to end_user_action(), and emits the "begin_user_action"
817    * and "end_user_action" signals only for the outermost pair of calls.
818    * This allows you to build user actions from other user actions.
819    * 
820    * The "interactive" buffer mutation functions, such as
821    * insert_interactive(), automatically call begin/end
822    * user action around the buffer operations they perform, so there's
823    * no need to add extra calls if you user action consists solely of a
824    * single call to one of those functions.
825    */
826   void begin_user_action();
827   
828   /** Should be paired with a call to begin_user_action().
829    * See that function for a full explanation.
830    */
831   void end_user_action();
832
833
834   //These are only available on the Maemo platform (patched Gtk+):
835
836   
837   /** Sets whether rich text can be pasted and dropped to the text buffer.
838    * 
839    * Since: maemo 1.0
840    * @param can_paste_rich_text Whether rich text pasting and dropping is enabled.
841    */
842
843 #ifdef  GTKMM_MAEMO_EXTENSIONS_ENABLED
844   void set_can_paste_rich_text(bool can_paste_rich_text);
845 #endif //  GTKMM_MAEMO_EXTENSIONS_ENABLED
846
847   
848   /** 
849    * @return Whether rich text pasting and dropping is enabled
850    * 
851    * Since: maemo 1.0.
852    */
853
854 #ifdef  GTKMM_MAEMO_EXTENSIONS_ENABLED
855   bool get_can_paste_rich_text() const;
856 #endif //  GTKMM_MAEMO_EXTENSIONS_ENABLED
857
858
859   /** Sets a new rich text format for the widget.
860    * 
861    * Since: maemo 1.0
862    * @param format Name of a collection of tags that the text view supports.
863    */
864
865 #ifdef  GTKMM_MAEMO_EXTENSIONS_ENABLED
866   void set_rich_text_format(const Glib::ustring& format);
867 #endif //  GTKMM_MAEMO_EXTENSIONS_ENABLED
868
869
870 #ifdef GTKMM_MAEMO_EXTENSIONS_ENABLED
871   /** Accept all formats from clipboard
872    *
873    */
874   void set_rich_text_format_all();
875 #endif //GTKMM_MAEMO_EXTENSIONS_ENABLED
876
877   
878   /** 
879    * @return The widget's current rich text format.
880    * 
881    * Since: maemo 1.0.
882    */
883
884 #ifdef  GTKMM_MAEMO_EXTENSIONS_ENABLED
885   Glib::ustring get_rich_text_format() const;
886 #endif //  GTKMM_MAEMO_EXTENSIONS_ENABLED
887  
888
889 //TODO: I have commented these out for now because I don't understand what the register_buffer and content_buffer are. murrayc.
890  //TODO: Documentation.
891  // typedef sigc::slot<guint8*, const Glib::RefPtr<TextBuffer>& /* content_buffer */, const iterator& /* start */, const iterator& /* end */, gsize& /* length */> SlotSerialize;
892
893
894 //TODO: Use ArrayHandle, or just use guint8* to be more efficient?
895   // typedef sigc::slot<bool, const Glib::RefPtr<TextBuffer>& /* content_buffer */, iterator& /* iter */, const guint8*  /* data */, gsize /* length */, bool /* create_tags */> SlotDeserialize;
896
897 /*
898   Glib::ustring register_serialize_format(const Glib::ustring& mime_type, const SlotSerialize& slot);
899   _IGNORE(gtk_text_buffer_register_serialize_format)
900 */
901
902   
903   Glib::ustring register_serialize_tagset(const Glib::ustring& tagset_name);
904
905 /*
906   Glib::ustring register_deserialize_format(const Glib::ustring& mime_type, const SlotDeserialize& slot);
907   _IGNORE(gtk_text_buffer_register_deserialize_format)
908 */
909   
910   Glib::ustring register_deserialize_tagset(const Glib::ustring& tagset_name);
911
912   
913   void unregister_serialize_format(const Glib::ustring& format);
914   
915   void unregister_deserialize_format(const Glib::ustring& format);
916
917 //TODO: Wrap property too, if there is one.
918   
919   void set_can_create_tags(const Glib::ustring& format, bool can_create_tags = true);
920   
921   bool get_can_create_tags(const Glib::ustring& format) const;
922
923
924   Glib::StringArrayHandle get_serialize_formats() const;
925   
926   Glib::StringArrayHandle get_deserialize_formats() const;
927   
928
929 /*
930 //TODO: I have commented these out for now because I don't understand what the register_buffer and content_buffer are. murrayc.
931
932 //TODO: Use something other than gsize?
933 #m4 _CONVERSION(`const iterator&', `GtkTextIter*',`($3).gobj()')
934   _WRAP_METHOD(guint8* serialize(const Glib::RefPtr<TextBuffer>& content_buffer,
935                                                        const Glib::ustring& format,
936                                                        const iterator& iterstart,
937                                                        const iterator& iterend,
938                                                        gsize& length), gtk_text_buffer_serialize)
939
940 //TODO: Is the bool superfluous?
941 //TODO: Use an ArrayHandle?
942   _WRAP_METHOD(bool deserialize(const Glib::RefPtr<TextBuffer>& content_buffer,
943                                                        const Glib::ustring& format,
944                                                        const iterator& iter, const guint8* data,
945                                                        gsize length), gtk_text_buffer_deserialize, errthrow)
946 */
947
948
949 /**
950    * @par Prototype:
951    * <tt>void %insert(const TextBuffer::iterator& pos, const Glib::ustring& text, int bytes)</tt>
952    */
953
954   Glib::SignalProxy3< void,const TextBuffer::iterator&,const Glib::ustring&,int > signal_insert();
955
956   
957 /**
958    * @par Prototype:
959    * <tt>void %insert_pixbuf(const TextBuffer::iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)</tt>
960    */
961
962   Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<Gdk::Pixbuf>& > signal_insert_pixbuf();
963
964   
965 /**
966    * @par Prototype:
967    * <tt>void %insert_child_anchor(const TextBuffer::iterator& pos, const Glib::RefPtr<ChildAnchor>& anchor)</tt>
968    */
969
970   Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<ChildAnchor>& > signal_insert_child_anchor();
971
972   
973   /** The delete_range signal is emitted to delete a range from 
974    * a TextBuffer. Note that your handler must not invalidate the
975    * @a start and @a end iters (or has to revalidate them), if it runs before the 
976    * default handler. There is no need to keep the iters valid in handlers
977    * which run after the default handler but
978    * those don't have access to the deleted text.
979    *
980    * @param start the start of the range to be deleted.
981    * @param end the end of the range to be deleted.
982    */
983   
984 /**
985    * @par Prototype:
986    * <tt>void %erase(const TextBuffer::iterator& start, const TextBuffer::iterator& end)</tt>
987    */
988
989   Glib::SignalProxy2< void,const TextBuffer::iterator&,const TextBuffer::iterator& > signal_erase();
990
991   
992 /**
993    * @par Prototype:
994    * <tt>void %changed()</tt>
995    */
996
997   Glib::SignalProxy0< void > signal_changed();
998
999   
1000 /**
1001    * @par Prototype:
1002    * <tt>void %modified_changed()</tt>
1003    */
1004
1005   Glib::SignalProxy0< void > signal_modified_changed();
1006
1007   
1008 /**
1009    * @par Prototype:
1010    * <tt>void %mark_set(const TextBuffer::iterator& location, const Glib::RefPtr<TextBuffer::Mark>& mark)</tt>
1011    */
1012
1013   Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<TextBuffer::Mark>& > signal_mark_set();
1014
1015   
1016 /**
1017    * @par Prototype:
1018    * <tt>void %mark_deleted(const Glib::RefPtr<TextBuffer::Mark>& mark)</tt>
1019    */
1020
1021   Glib::SignalProxy1< void,const Glib::RefPtr<TextBuffer::Mark>& > signal_mark_deleted();
1022
1023   
1024 /**
1025    * @par Prototype:
1026    * <tt>void %apply_tag(const Glib::RefPtr<TextBuffer::Tag>& tag, const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end)</tt>
1027    */
1028
1029   Glib::SignalProxy3< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& > signal_apply_tag();
1030
1031   
1032 /**
1033    * @par Prototype:
1034    * <tt>void %remove_tag(const Glib::RefPtr<TextBuffer::Tag>& tag, const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end)</tt>
1035    */
1036
1037   Glib::SignalProxy3< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& > signal_remove_tag();
1038
1039   
1040 /**
1041    * @par Prototype:
1042    * <tt>void %begin_user_action()</tt>
1043    */
1044
1045   Glib::SignalProxy0< void > signal_begin_user_action();
1046
1047   
1048 /**
1049    * @par Prototype:
1050    * <tt>void %end_user_action()</tt>
1051    */
1052
1053   Glib::SignalProxy0< void > signal_end_user_action();
1054
1055
1056   #ifdef GLIBMM_PROPERTIES_ENABLED
1057 /** Current text of the buffer.
1058    *
1059    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1060    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1061    * the value of the property changes.
1062    */
1063   Glib::PropertyProxy<Glib::ustring> property_text() ;
1064 #endif //#GLIBMM_PROPERTIES_ENABLED
1065
1066 #ifdef GLIBMM_PROPERTIES_ENABLED
1067 /** Current text of the buffer.
1068    *
1069    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1070    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1071    * the value of the property changes.
1072    */
1073   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_text() const;
1074 #endif //#GLIBMM_PROPERTIES_ENABLED
1075
1076   #ifdef GLIBMM_PROPERTIES_ENABLED
1077 /** Whether the buffer has some text currently selected.
1078    *
1079    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1080    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1081    * the value of the property changes.
1082    */
1083   Glib::PropertyProxy_ReadOnly<bool> property_has_selection() const;
1084 #endif //#GLIBMM_PROPERTIES_ENABLED
1085
1086
1087 public:
1088
1089 public:
1090   //C++ methods used to invoke GTK+ virtual functions:
1091 #ifdef GLIBMM_VFUNCS_ENABLED
1092 #endif //GLIBMM_VFUNCS_ENABLED
1093
1094 protected:
1095   //GTK+ Virtual Functions (override these to change behaviour):
1096 #ifdef GLIBMM_VFUNCS_ENABLED
1097 #endif //GLIBMM_VFUNCS_ENABLED
1098
1099   //Default Signal Handlers::
1100 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
1101   virtual void on_insert(const TextBuffer::iterator& pos, const Glib::ustring& text, int bytes);
1102   virtual void on_insert_pixbuf(const TextBuffer::iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
1103   virtual void on_insert_child_anchor(const TextBuffer::iterator& pos, const Glib::RefPtr<ChildAnchor>& anchor);
1104   virtual void on_erase(const TextBuffer::iterator& start, const TextBuffer::iterator& end);
1105   virtual void on_changed();
1106   virtual void on_modified_changed();
1107   virtual void on_mark_set(const TextBuffer::iterator& location, const Glib::RefPtr<TextBuffer::Mark>& mark);
1108   virtual void on_mark_deleted(const Glib::RefPtr<TextBuffer::Mark>& mark);
1109   virtual void on_apply_tag(const Glib::RefPtr<TextBuffer::Tag>& tag, const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end);
1110   virtual void on_remove_tag(const Glib::RefPtr<TextBuffer::Tag>& tag, const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end);
1111   virtual void on_begin_user_action();
1112   virtual void on_end_user_action();
1113 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
1114
1115
1116 };
1117
1118 } // namespace Gtk
1119
1120
1121 namespace Glib
1122 {
1123   /** @relates Gtk::TextBuffer
1124    * @param object The C instance
1125    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
1126    * @result A C++ instance that wraps this C instance.
1127    */
1128   Glib::RefPtr<Gtk::TextBuffer> wrap(GtkTextBuffer* object, bool take_copy = false);
1129 }
1130
1131
1132 #endif /* _GTKMM_TEXTBUFFER_H */
1133