gtktextbuffer.h 21.7 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
2
3
4
5
6
7
8
9
10
 * gtktextbuffer.h Copyright (C) 2000 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
13
14
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16
17
18
19
20
21
 */

/*
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
22
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23
24
 */

25
26
27
#ifndef __GTK_TEXT_BUFFER_H__
#define __GTK_TEXT_BUFFER_H__

28
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
29
30
31
#error "Only <gtk/gtk.h> can be included directly."
#endif

32
33
34
35
#include <gtk/gtkwidget.h>
#include <gtk/gtktexttagtable.h>
#include <gtk/gtktextiter.h>
#include <gtk/gtktextmark.h>
36
#include <gtk/gtktextchild.h>
37

38
G_BEGIN_DECLS
39

40
#define GTK_TYPE_TEXT_BUFFER            (gtk_text_buffer_get_type ())
41
42
43
44
45
#define GTK_TEXT_BUFFER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT_BUFFER, GtkTextBuffer))
#define GTK_TEXT_BUFFER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_BUFFER, GtkTextBufferClass))
#define GTK_IS_TEXT_BUFFER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TEXT_BUFFER))
#define GTK_IS_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_BUFFER))
#define GTK_TEXT_BUFFER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT_BUFFER, GtkTextBufferClass))
46

47
typedef struct _GtkTextBufferPrivate GtkTextBufferPrivate;
48
49
typedef struct _GtkTextBufferClass GtkTextBufferClass;

50
51
struct _GtkTextBuffer
{
52
  GObject parent_instance;
53

54
  GtkTextBufferPrivate *priv;
55
56
};

57
58
59
/**
 * GtkTextBufferClass:
 * @parent_class: The object class structure needs to be the first.
Matthias Clasen's avatar
Matthias Clasen committed
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
 * @insert_text: The class handler for the `GtkTextBuffer::insert-text` signal.
 * @insert_paintable: The class handler for the `GtkTextBuffer::insert-paintable` signal.
 * @insert_child_anchor: The class handler for the `GtkTextBuffer::insert-child-anchor` signal.
 * @delete_range: The class handler for the `GtkTextBuffer::delete-range` signal.
 * @changed: The class handler for the `GtkTextBuffer::changed` signal.
 * @modified_changed: The class handler for the `GtkTextBuffer::modified-changed` signal.
 * @mark_set: The class handler for the `GtkTextBuffer::mark-set` signal.
 * @mark_deleted: The class handler for the `GtkTextBuffer::mark-deleted` signal.
 * @apply_tag: The class handler for the `GtkTextBuffer::apply-tag` signal.
 * @remove_tag: The class handler for the `GtkTextBuffer::remove-tag` signal.
 * @begin_user_action: The class handler for the `GtkTextBuffer::begin-user-action` signal.
 * @end_user_action: The class handler for the `GtkTextBuffer::end-user-action` signal.
 * @paste_done: The class handler for the `GtkTextBuffer::paste-done` signal.
 * @undo: The class handler for the `GtkTextBuffer::undo` signal
 * @redo: The class handler for the `GtkTextBuffer::redo` signal
75
 *
Matthias Clasen's avatar
Matthias Clasen committed
76
 * The class structure for `GtkTextBuffer`.
77
 */
78
79
struct _GtkTextBufferClass
{
80
  GObjectClass parent_class;
81

82
83
  void (* insert_text)            (GtkTextBuffer      *buffer,
                                   GtkTextIter        *pos,
Benjamin Otte's avatar
Benjamin Otte committed
84
                                   const char         *new_text,
Benjamin Otte's avatar
Benjamin Otte committed
85
                                   int                 new_text_length);
86

87
  void (* insert_paintable)       (GtkTextBuffer      *buffer,
88
                                   GtkTextIter        *iter,
89
                                   GdkPaintable       *paintable);
90

91
92
93
  void (* insert_child_anchor)    (GtkTextBuffer      *buffer,
                                   GtkTextIter        *iter,
                                   GtkTextChildAnchor *anchor);
94

95
96
97
  void (* delete_range)           (GtkTextBuffer      *buffer,
                                   GtkTextIter        *start,
                                   GtkTextIter        *end);
98

99
  void (* changed)                (GtkTextBuffer      *buffer);
100

101
  void (* modified_changed)       (GtkTextBuffer      *buffer);
102

103
104
105
  void (* mark_set)               (GtkTextBuffer      *buffer,
                                   const GtkTextIter  *location,
                                   GtkTextMark        *mark);
106

107
108
  void (* mark_deleted)           (GtkTextBuffer      *buffer,
                                   GtkTextMark        *mark);
109

110
111
112
113
  void (* apply_tag)              (GtkTextBuffer      *buffer,
                                   GtkTextTag         *tag,
                                   const GtkTextIter  *start,
                                   const GtkTextIter  *end);
114

115
116
117
118
  void (* remove_tag)             (GtkTextBuffer      *buffer,
                                   GtkTextTag         *tag,
                                   const GtkTextIter  *start,
                                   const GtkTextIter  *end);
119

120
  void (* begin_user_action)      (GtkTextBuffer      *buffer);
121

122
  void (* end_user_action)        (GtkTextBuffer      *buffer);
123

124
  void (* paste_done)             (GtkTextBuffer      *buffer,
125
                                   GdkClipboard       *clipboard);
126
127
  void (* undo)                   (GtkTextBuffer      *buffer);
  void (* redo)                   (GtkTextBuffer      *buffer);
128

129
  /*< private >*/
130

131
132
133
134
135
  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
136
137
};

138
GDK_AVAILABLE_IN_ALL
139
GType        gtk_text_buffer_get_type       (void) G_GNUC_CONST;
140
141
142
143



/* table is NULL to create a new one */
144
GDK_AVAILABLE_IN_ALL
145
GtkTextBuffer *gtk_text_buffer_new            (GtkTextTagTable *table);
146
GDK_AVAILABLE_IN_ALL
Benjamin Otte's avatar
Benjamin Otte committed
147
int            gtk_text_buffer_get_line_count (GtkTextBuffer   *buffer);
148
GDK_AVAILABLE_IN_ALL
Benjamin Otte's avatar
Benjamin Otte committed
149
int            gtk_text_buffer_get_char_count (GtkTextBuffer   *buffer);
150
151


152
GDK_AVAILABLE_IN_ALL
153
GtkTextTagTable* gtk_text_buffer_get_tag_table (GtkTextBuffer  *buffer);
154

155
/* Delete whole buffer, then insert */
156
GDK_AVAILABLE_IN_ALL
157
void gtk_text_buffer_set_text          (GtkTextBuffer *buffer,
Benjamin Otte's avatar
Benjamin Otte committed
158
                                        const char    *text,
Benjamin Otte's avatar
Benjamin Otte committed
159
                                        int            len);
160

161
/* Insert into the buffer */
162
GDK_AVAILABLE_IN_ALL
163
164
void gtk_text_buffer_insert            (GtkTextBuffer *buffer,
                                        GtkTextIter   *iter,
Benjamin Otte's avatar
Benjamin Otte committed
165
                                        const char    *text,
Benjamin Otte's avatar
Benjamin Otte committed
166
                                        int            len);
167
GDK_AVAILABLE_IN_ALL
168
void gtk_text_buffer_insert_at_cursor  (GtkTextBuffer *buffer,
Benjamin Otte's avatar
Benjamin Otte committed
169
                                        const char    *text,
Benjamin Otte's avatar
Benjamin Otte committed
170
                                        int            len);
171

172
GDK_AVAILABLE_IN_ALL
173
174
gboolean gtk_text_buffer_insert_interactive           (GtkTextBuffer *buffer,
                                                       GtkTextIter   *iter,
Benjamin Otte's avatar
Benjamin Otte committed
175
                                                       const char    *text,
Benjamin Otte's avatar
Benjamin Otte committed
176
                                                       int            len,
177
                                                       gboolean       default_editable);
178
GDK_AVAILABLE_IN_ALL
179
gboolean gtk_text_buffer_insert_interactive_at_cursor (GtkTextBuffer *buffer,
Benjamin Otte's avatar
Benjamin Otte committed
180
                                                       const char    *text,
Benjamin Otte's avatar
Benjamin Otte committed
181
                                                       int            len,
182
                                                       gboolean       default_editable);
183

184
GDK_AVAILABLE_IN_ALL
185
186
187
188
void     gtk_text_buffer_insert_range             (GtkTextBuffer     *buffer,
                                                   GtkTextIter       *iter,
                                                   const GtkTextIter *start,
                                                   const GtkTextIter *end);
189
GDK_AVAILABLE_IN_ALL
190
191
192
193
194
195
gboolean gtk_text_buffer_insert_range_interactive (GtkTextBuffer     *buffer,
                                                   GtkTextIter       *iter,
                                                   const GtkTextIter *start,
                                                   const GtkTextIter *end,
                                                   gboolean           default_editable);

196
GDK_AVAILABLE_IN_ALL
197
198
void    gtk_text_buffer_insert_with_tags          (GtkTextBuffer     *buffer,
                                                   GtkTextIter       *iter,
Benjamin Otte's avatar
Benjamin Otte committed
199
                                                   const char        *text,
Benjamin Otte's avatar
Benjamin Otte committed
200
                                                   int                len,
201
                                                   GtkTextTag        *first_tag,
202
                                                   ...) G_GNUC_NULL_TERMINATED;
203

204
GDK_AVAILABLE_IN_ALL
205
206
void    gtk_text_buffer_insert_with_tags_by_name  (GtkTextBuffer     *buffer,
                                                   GtkTextIter       *iter,
Benjamin Otte's avatar
Benjamin Otte committed
207
                                                   const char        *text,
Benjamin Otte's avatar
Benjamin Otte committed
208
                                                   int                len,
Benjamin Otte's avatar
Benjamin Otte committed
209
                                                   const char        *first_tag_name,
210
                                                   ...) G_GNUC_NULL_TERMINATED;
211

Matthias Clasen's avatar
Matthias Clasen committed
212
GDK_AVAILABLE_IN_ALL
213
214
void     gtk_text_buffer_insert_markup            (GtkTextBuffer     *buffer,
                                                   GtkTextIter       *iter,
Benjamin Otte's avatar
Benjamin Otte committed
215
                                                   const char        *markup,
Benjamin Otte's avatar
Benjamin Otte committed
216
                                                   int                len);
217

218
/* Delete from the buffer */
219
GDK_AVAILABLE_IN_ALL
220
void     gtk_text_buffer_delete             (GtkTextBuffer *buffer,
Owen Taylor's avatar
#155952    
Owen Taylor committed
221
222
					     GtkTextIter   *start,
					     GtkTextIter   *end);
223
GDK_AVAILABLE_IN_ALL
224
gboolean gtk_text_buffer_delete_interactive (GtkTextBuffer *buffer,
Owen Taylor's avatar
#155952    
Owen Taylor committed
225
226
227
					     GtkTextIter   *start_iter,
					     GtkTextIter   *end_iter,
					     gboolean       default_editable);
228
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
#155952    
Owen Taylor committed
229
230
231
232
gboolean gtk_text_buffer_backspace          (GtkTextBuffer *buffer,
					     GtkTextIter   *iter,
					     gboolean       interactive,
					     gboolean       default_editable);
233
234

/* Obtain strings from the buffer */
235
GDK_AVAILABLE_IN_ALL
Benjamin Otte's avatar
Benjamin Otte committed
236
char           *gtk_text_buffer_get_text            (GtkTextBuffer     *buffer,
237
238
                                                     const GtkTextIter *start,
                                                     const GtkTextIter *end,
239
                                                     gboolean           include_hidden_chars);
240

241
GDK_AVAILABLE_IN_ALL
Benjamin Otte's avatar
Benjamin Otte committed
242
char           *gtk_text_buffer_get_slice           (GtkTextBuffer     *buffer,
243
244
                                                     const GtkTextIter *start,
                                                     const GtkTextIter *end,
245
246
                                                     gboolean           include_hidden_chars);

247
/* Insert a paintable */
248
GDK_AVAILABLE_IN_ALL
249
void gtk_text_buffer_insert_paintable      (GtkTextBuffer *buffer,
250
                                            GtkTextIter   *iter,
251
                                            GdkPaintable  *paintable);
252

253
/* Insert a child anchor */
254
GDK_AVAILABLE_IN_ALL
255
256
257
258
259
void               gtk_text_buffer_insert_child_anchor (GtkTextBuffer      *buffer,
                                                        GtkTextIter        *iter,
                                                        GtkTextChildAnchor *anchor);

/* Convenience, create and insert a child anchor */
260
GDK_AVAILABLE_IN_ALL
261
262
263
GtkTextChildAnchor *gtk_text_buffer_create_child_anchor (GtkTextBuffer *buffer,
                                                         GtkTextIter   *iter);

264
/* Mark manipulation */
265
GDK_AVAILABLE_IN_ALL
266
267
268
void           gtk_text_buffer_add_mark    (GtkTextBuffer     *buffer,
                                            GtkTextMark       *mark,
                                            const GtkTextIter *where);
269
GDK_AVAILABLE_IN_ALL
270
GtkTextMark   *gtk_text_buffer_create_mark (GtkTextBuffer     *buffer,
Benjamin Otte's avatar
Benjamin Otte committed
271
                                            const char        *mark_name,
272
273
                                            const GtkTextIter *where,
                                            gboolean           left_gravity);
274
GDK_AVAILABLE_IN_ALL
275
void           gtk_text_buffer_move_mark   (GtkTextBuffer     *buffer,
276
                                            GtkTextMark       *mark,
277
                                            const GtkTextIter *where);
278
GDK_AVAILABLE_IN_ALL
279
void           gtk_text_buffer_delete_mark (GtkTextBuffer     *buffer,
280
                                            GtkTextMark       *mark);
281
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
282
GtkTextMark*   gtk_text_buffer_get_mark    (GtkTextBuffer     *buffer,
Benjamin Otte's avatar
Benjamin Otte committed
283
                                            const char        *name);
284

285
GDK_AVAILABLE_IN_ALL
286
void gtk_text_buffer_move_mark_by_name   (GtkTextBuffer     *buffer,
Benjamin Otte's avatar
Benjamin Otte committed
287
                                          const char        *name,
288
                                          const GtkTextIter *where);
289
GDK_AVAILABLE_IN_ALL
290
void gtk_text_buffer_delete_mark_by_name (GtkTextBuffer     *buffer,
Benjamin Otte's avatar
Benjamin Otte committed
291
                                          const char        *name);
292

293
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
294
GtkTextMark* gtk_text_buffer_get_insert          (GtkTextBuffer *buffer);
295
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
296
297
GtkTextMark* gtk_text_buffer_get_selection_bound (GtkTextBuffer *buffer);

298
/* efficiently move insert and selection_bound at the same time */
299
GDK_AVAILABLE_IN_ALL
300
301
void gtk_text_buffer_place_cursor (GtkTextBuffer     *buffer,
                                   const GtkTextIter *where);
302
GDK_AVAILABLE_IN_ALL
303
304
305
void gtk_text_buffer_select_range (GtkTextBuffer     *buffer,
                                   const GtkTextIter *ins,
				   const GtkTextIter *bound);
306
307
308
309



/* Tag manipulation */
310
GDK_AVAILABLE_IN_ALL
311
void gtk_text_buffer_apply_tag             (GtkTextBuffer     *buffer,
312
                                            GtkTextTag        *tag,
313
314
                                            const GtkTextIter *start,
                                            const GtkTextIter *end);
315
GDK_AVAILABLE_IN_ALL
316
void gtk_text_buffer_remove_tag            (GtkTextBuffer     *buffer,
317
                                            GtkTextTag        *tag,
318
319
                                            const GtkTextIter *start,
                                            const GtkTextIter *end);
320
GDK_AVAILABLE_IN_ALL
321
void gtk_text_buffer_apply_tag_by_name     (GtkTextBuffer     *buffer,
Benjamin Otte's avatar
Benjamin Otte committed
322
                                            const char        *name,
323
324
                                            const GtkTextIter *start,
                                            const GtkTextIter *end);
325
GDK_AVAILABLE_IN_ALL
326
void gtk_text_buffer_remove_tag_by_name    (GtkTextBuffer     *buffer,
Benjamin Otte's avatar
Benjamin Otte committed
327
                                            const char        *name,
328
329
                                            const GtkTextIter *start,
                                            const GtkTextIter *end);
330
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
331
332
333
void gtk_text_buffer_remove_all_tags       (GtkTextBuffer     *buffer,
                                            const GtkTextIter *start,
                                            const GtkTextIter *end);
334
335
336


/* You can either ignore the return value, or use it to
337
338
 * set the attributes of the tag. tag_name can be NULL
 */
339
GDK_AVAILABLE_IN_ALL
340
GtkTextTag    *gtk_text_buffer_create_tag (GtkTextBuffer *buffer,
Benjamin Otte's avatar
Benjamin Otte committed
341
342
                                           const char    *tag_name,
                                           const char    *first_property_name,
343
                                           ...);
344
345

/* Obtain iterators pointed at various places, then you can move the
346
347
 * iterator around using the GtkTextIter operators
 */
348
GDK_AVAILABLE_IN_ALL
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
gboolean gtk_text_buffer_get_iter_at_line_offset (GtkTextBuffer *buffer,
                                                  GtkTextIter   *iter,
                                                  int            line_number,
                                                  int            char_offset);
GDK_AVAILABLE_IN_ALL
gboolean gtk_text_buffer_get_iter_at_line_index  (GtkTextBuffer *buffer,
                                                  GtkTextIter   *iter,
                                                  int            line_number,
                                                  int            byte_index);
GDK_AVAILABLE_IN_ALL
void     gtk_text_buffer_get_iter_at_offset      (GtkTextBuffer *buffer,
                                                  GtkTextIter   *iter,
                                                  int            char_offset);
GDK_AVAILABLE_IN_ALL
gboolean gtk_text_buffer_get_iter_at_line        (GtkTextBuffer *buffer,
                                                  GtkTextIter   *iter,
                                                  int            line_number);
366
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
367
368
void gtk_text_buffer_get_start_iter          (GtkTextBuffer *buffer,
                                              GtkTextIter   *iter);
369
GDK_AVAILABLE_IN_ALL
370
void gtk_text_buffer_get_end_iter            (GtkTextBuffer *buffer,
371
                                              GtkTextIter   *iter);
372
GDK_AVAILABLE_IN_ALL
373
374
375
void gtk_text_buffer_get_bounds              (GtkTextBuffer *buffer,
                                              GtkTextIter   *start,
                                              GtkTextIter   *end);
376
GDK_AVAILABLE_IN_ALL
377
378
379
void gtk_text_buffer_get_iter_at_mark        (GtkTextBuffer *buffer,
                                              GtkTextIter   *iter,
                                              GtkTextMark   *mark);
380

381
GDK_AVAILABLE_IN_ALL
382
383
384
void gtk_text_buffer_get_iter_at_child_anchor (GtkTextBuffer      *buffer,
                                               GtkTextIter        *iter,
                                               GtkTextChildAnchor *anchor);
385
386
387
388
389
390
391
392
393
394

/* There's no get_first_iter because you just get the iter for
   line or char 0 */

/* Used to keep track of whether the buffer needs saving; anytime the
   buffer contents change, the modified flag is turned on. Whenever
   you save, turn it off. Tags and marks do not affect the modified
   flag, but if you would like them to you can connect a handler to
   the tag/mark signals and call set_modified in your handler */

395
GDK_AVAILABLE_IN_ALL
396
gboolean        gtk_text_buffer_get_modified            (GtkTextBuffer *buffer);
397
GDK_AVAILABLE_IN_ALL
398
399
void            gtk_text_buffer_set_modified            (GtkTextBuffer *buffer,
                                                         gboolean       setting);
400

401
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
402
403
gboolean        gtk_text_buffer_get_has_selection       (GtkTextBuffer *buffer);

404
GDK_AVAILABLE_IN_ALL
405
void gtk_text_buffer_add_selection_clipboard    (GtkTextBuffer     *buffer,
406
						 GdkClipboard      *clipboard);
407
GDK_AVAILABLE_IN_ALL
408
void gtk_text_buffer_remove_selection_clipboard (GtkTextBuffer     *buffer,
409
						 GdkClipboard      *clipboard);
410

411
GDK_AVAILABLE_IN_ALL
412
void            gtk_text_buffer_cut_clipboard           (GtkTextBuffer *buffer,
413
							 GdkClipboard  *clipboard,
414
                                                         gboolean       default_editable);
415
GDK_AVAILABLE_IN_ALL
416
void            gtk_text_buffer_copy_clipboard          (GtkTextBuffer *buffer,
417
							 GdkClipboard  *clipboard);
418
GDK_AVAILABLE_IN_ALL
419
void            gtk_text_buffer_paste_clipboard         (GtkTextBuffer *buffer,
420
							 GdkClipboard  *clipboard,
421
							 GtkTextIter   *override_location,
422
                                                         gboolean       default_editable);
423

424
GDK_AVAILABLE_IN_ALL
425
426
427
gboolean        gtk_text_buffer_get_selection_bounds    (GtkTextBuffer *buffer,
                                                         GtkTextIter   *start,
                                                         GtkTextIter   *end);
428
GDK_AVAILABLE_IN_ALL
429
430
gboolean        gtk_text_buffer_delete_selection        (GtkTextBuffer *buffer,
                                                         gboolean       interactive,
431
                                                         gboolean       default_editable);
432

433
434
435
436
GDK_AVAILABLE_IN_ALL
GdkContentProvider *
                gtk_text_buffer_get_selection_content    (GtkTextBuffer *buffer);

437
GDK_AVAILABLE_IN_ALL
438
gboolean        gtk_text_buffer_get_can_undo              (GtkTextBuffer *buffer);
439
GDK_AVAILABLE_IN_ALL
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
gboolean        gtk_text_buffer_get_can_redo              (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
gboolean        gtk_text_buffer_get_enable_undo           (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
void            gtk_text_buffer_set_enable_undo           (GtkTextBuffer *buffer,
                                                           gboolean       enable_undo);
GDK_AVAILABLE_IN_ALL
guint           gtk_text_buffer_get_max_undo_levels       (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
void            gtk_text_buffer_set_max_undo_levels       (GtkTextBuffer *buffer,
                                                           guint          max_undo_levels);
GDK_AVAILABLE_IN_ALL
void            gtk_text_buffer_undo                      (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
void            gtk_text_buffer_redo                      (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
void            gtk_text_buffer_begin_irreversible_action (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
void            gtk_text_buffer_end_irreversible_action   (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
void            gtk_text_buffer_begin_user_action         (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
void            gtk_text_buffer_end_user_action           (GtkTextBuffer *buffer);
463

464
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkTextBuffer, g_object_unref)
465

466
G_END_DECLS
467
468

#endif