~ubuntu-branches/ubuntu/precise/gtkmm3.0/precise

« back to all changes in this revision

Viewing changes to gtk/gtkmm/textbuffer.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2011-06-17 00:12:44 UTC
  • Revision ID: james.westby@ubuntu.com-20110617001244-9hl5an15hiaaahi6
Tags: upstream-3.0.1
ImportĀ upstreamĀ versionĀ 3.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Generated by gtkmmproc -- DO NOT MODIFY!
 
2
 
 
3
 
 
4
#include <gtkmm/textbuffer.h>
 
5
#include <gtkmm/private/textbuffer_p.h>
 
6
 
 
7
// -*- c++ -*-
 
8
/* $Id: textbuffer.ccg,v 1.8 2006/11/20 09:19:49 murrayc Exp $ */
 
9
 
 
10
/* Copyright(C) 1998-2002 The gtkmm Development Team
 
11
 *
 
12
 * This library is free software; you can redistribute it and/or
 
13
 * modify it under the terms of the GNU Lesser General Public
 
14
 * License as published by the Free Software Foundation; either
 
15
 * version 2.1 of the License, or (at your option) any later version.
 
16
 *
 
17
 * This library is distributed in the hope that it will be useful,
 
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
20
 * Lesser General Public License for more details.
 
21
 *
 
22
 * You should have received a copy of the GNU Lesser General Public
 
23
 * License along with this library; if not, write to the Free
 
24
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
25
 */
 
26
 
 
27
#include <glibmm/vectorutils.h>
 
28
 
 
29
#include <gtk/gtk.h>
 
30
#include <glib.h>
 
31
#include <gtkmm/textmark.h>
 
32
#include <gtkmm/textiter.h>
 
33
 
 
34
 
 
35
/*
 
36
static guint8* SignalProxy_Serialize(GtkTextBuffer* , GtkTextBuffer* content_buffer,
 
37
                                                   const GtkTextIter* start, const GtkTextIter* end,
 
38
                                                   gsize* length,
 
39
                                                   gpointer user_data)
 
40
{
 
41
  Gtk::TextBuffer::SlotSerialize* the_slot = static_cast<Gtk::TextBuffer::SlotSerialize*>(user_data);
 
42
 
 
43
  try
 
44
  {
 
45
    return (*the_slot)(Glib::wrap(content_buffer), Glib::wrap(start), Glib::wrap(end), *length);
 
46
  }
 
47
  catch(...)
 
48
  {
 
49
    Glib::exception_handlers_invoke();
 
50
  }
 
51
 
 
52
  return 0; // arbitrary value
 
53
}
 
54
 
 
55
static void SignalProxy_Serialize_gtk_callback_destroy(void* user_data)
 
56
{
 
57
  delete static_cast<Gtk::TextBuffer::SlotSerialize*>(user_data);
 
58
}
 
59
 
 
60
static gboolean SignalProxy_Deserialize(GtkTextBuffer* , GtkTextBuffer* content_buffer,
 
61
                                                   GtkTextIter* iter, const guint8* data,
 
62
                                                   gsize length, gboolean create_tags,
 
63
                                                   gpointer user_data,
 
64
                                                   GError** )
 
65
{
 
66
  Gtk::TextBuffer::SlotDeserialize* the_slot = static_cast<Gtk::TextBuffer::SlotDeserialize*>(user_data);
 
67
 
 
68
  try
 
69
  {
 
70
    (*the_slot)(Glib::wrap(content_buffer, true), Glib::wrap(iter), data, length, create_tags);
 
71
 
 
72
  }
 
73
  catch(...)
 
74
  {
 
75
    //TODO: Fill the error parameter.
 
76
    Glib::exception_handlers_invoke();
 
77
  }
 
78
 
 
79
  return 0; // arbitrary value
 
80
}
 
81
 
 
82
static void SignalProxy_Deserialize_gtk_callback_destroy(void* user_data)
 
83
{
 
84
  delete static_cast<Gtk::TextBuffer::SlotDeserialize*>(user_data);
 
85
}
 
86
*/
 
87
 
 
88
namespace Gtk
 
89
{
 
90
 
 
91
typedef TextChildAnchor ChildAnchor; //Help the code-generator so that it does not have to fully qualify this type in the .cc file.
 
92
 
 
93
TextBuffer::TextBuffer(const Glib::RefPtr<TagTable>& tag_table)
 
94
:
 
95
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
 
96
  Glib::ObjectBase(0),
 
97
  Glib::Object(Glib::ConstructParams(textbuffer_class_.init(), "tag_table",Glib::unwrap(tag_table), static_cast<char*>(0)))
 
98
{}
 
99
 
 
100
Glib::RefPtr<TextBuffer::Tag> TextBuffer::create_tag(const Glib::ustring& tag_name)
 
101
{
 
102
  //gtk_text_buffer_create_tag takes a varargs list of property names and values.
 
103
  //gtkmm coders should use the Tag.set_* method instead.
 
104
  return Glib::wrap(gtk_text_buffer_create_tag(gobj(), tag_name.c_str(), (char*)0), true); //true = take_copy.
 
105
  //We have to take a copy because gtk_text_buffer_create_tag() doesn't ref for us, for no real reason.
 
106
}
 
107
 
 
108
Glib::RefPtr<TextBuffer::Tag> TextBuffer::create_tag()
 
109
{
 
110
  //gtk_text_buffer_create_tag takes a varargs list of property names and values.
 
111
  //gtkmm coders should use the Tag.set_* method instead.
 
112
  return Glib::wrap(gtk_text_buffer_create_tag(gobj(), (const char*)0, (char*)0), true); //true = take_copy.
 
113
  //We have to take a copy because gtk_text_buffer_create_tag() doesn't ref for us, for no real reason.
 
114
}
 
115
 
 
116
Glib::RefPtr<TextBuffer::Mark>
 
117
TextBuffer::create_mark(const TextBuffer::iterator& where, bool left_gravity)
 
118
{
 
119
  return Glib::wrap(gtk_text_buffer_create_mark(
 
120
      gobj(), 0, const_cast<GtkTextIter*>(where.gobj()), left_gravity),
 
121
      true); // acquire reference
 
122
}
 
123
 
 
124
TextBuffer::iterator TextBuffer::get_iter_at_line_offset(int line_number, int char_offset)
 
125
{
 
126
  iterator iter;
 
127
  gtk_text_buffer_get_iter_at_line_offset(gobj(), iter.gobj(), line_number, char_offset);
 
128
  return iter;
 
129
}
 
130
 
 
131
TextBuffer::iterator TextBuffer::get_iter_at_line_index(int line_number, int byte_index)
 
132
{
 
133
  iterator iter;
 
134
  gtk_text_buffer_get_iter_at_line_index(gobj(), iter.gobj(), line_number, byte_index);
 
135
  return iter;
 
136
}
 
137
 
 
138
TextBuffer::iterator TextBuffer::get_iter_at_offset(int char_offset)
 
139
{
 
140
  iterator iter;
 
141
  gtk_text_buffer_get_iter_at_offset(gobj(), iter.gobj(), char_offset);
 
142
  return iter;
 
143
}
 
144
 
 
145
TextBuffer::iterator TextBuffer::get_iter_at_line(int line_number)
 
146
{
 
147
  iterator iter;
 
148
  gtk_text_buffer_get_iter_at_line(gobj(), iter.gobj(), line_number);
 
149
  return iter;
 
150
}
 
151
 
 
152
TextBuffer::iterator TextBuffer::begin()
 
153
{
 
154
  iterator iter;
 
155
  gtk_text_buffer_get_start_iter(gobj(), iter.gobj());
 
156
  return iter;
 
157
}
 
158
 
 
159
TextBuffer::iterator TextBuffer::end()
 
160
{
 
161
  iterator iter;
 
162
  gtk_text_buffer_get_end_iter(gobj(), iter.gobj());
 
163
  return iter;
 
164
}
 
165
 
 
166
void TextBuffer::get_bounds(iterator& range_begin, iterator& range_end)
 
167
{
 
168
  gtk_text_buffer_get_bounds(gobj(), range_begin.gobj(), range_end.gobj());
 
169
}
 
170
 
 
171
TextBuffer::iterator TextBuffer::get_iter_at_mark(const Glib::RefPtr<Mark>& mark)
 
172
{
 
173
  iterator iter;
 
174
  gtk_text_buffer_get_iter_at_mark(gobj(), iter.gobj(), mark->gobj());
 
175
  return iter;
 
176
}
 
177
 
 
178
void TextBuffer::set_text(const Glib::ustring& text)
 
179
{
 
180
  gtk_text_buffer_set_text(gobj(), text.data(), text.bytes());
 
181
}
 
182
 
 
183
void TextBuffer::set_text(const char* text_begin, const char* text_end)
 
184
{
 
185
  gtk_text_buffer_set_text(gobj(), text_begin, text_end - text_begin);
 
186
}
 
187
 
 
188
TextBuffer::iterator TextBuffer::insert(const iterator& pos, const Glib::ustring& text)
 
189
{
 
190
  // gtk_text_buffer_insert() modifies the iterator, but that's not the
 
191
  // STL way so we give it something that we don't mind it modifying.
 
192
  iterator iterCopy (pos);
 
193
  gtk_text_buffer_insert(gobj(), iterCopy.gobj(), text.data(), text.bytes());
 
194
 
 
195
  // According to the gtk_text_buffer_insert() docs, the "default signal handler
 
196
  // revalidates it to point to the end of the inserted text".
 
197
  return iterCopy;
 
198
}
 
199
 
 
200
TextBuffer::iterator TextBuffer::insert(const iterator& pos, const char* text_begin, const char* text_end)
 
201
{
 
202
  // gtk_text_buffer_insert() modifies the iterator, but that's not the
 
203
  // STL way so we give it something that we don't mind it modifying.
 
204
  iterator iterCopy (pos);
 
205
  gtk_text_buffer_insert(gobj(), iterCopy.gobj(), text_begin, text_end - text_begin);
 
206
 
 
207
  // According to the gtk_text_buffer_insert() docs, the "default signal handler
 
208
  // revalidates it to point to the end of the inserted text".
 
209
  return iterCopy;
 
210
}
 
211
 
 
212
TextBuffer::iterator TextBuffer::insert_pixbuf(const iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
 
213
{
 
214
  iterator iterCopy (pos);
 
215
  gtk_text_buffer_insert_pixbuf(gobj(), iterCopy.gobj(), pixbuf->gobj());
 
216
  return iterCopy;
 
217
}
 
218
 
 
219
TextBuffer::iterator TextBuffer::insert_child_anchor(const iterator& pos,
 
220
                                                     const Glib::RefPtr<ChildAnchor>& anchor)
 
221
{
 
222
  // Copy the iterator. It might be changed because it is used as a signal parameter internally.
 
223
  iterator iterCopy (pos);
 
224
  gtk_text_buffer_insert_child_anchor(gobj(), iterCopy.gobj(), Glib::unwrap(anchor));
 
225
  return iterCopy;
 
226
}
 
227
 
 
228
Glib::RefPtr<ChildAnchor> TextBuffer::create_child_anchor(const iterator& pos)
 
229
{
 
230
  // Copy the iterator. It might be changed because it is used as a signal parameter internally.
 
231
  iterator iterCopy (pos);
 
232
  return Glib::wrap(gtk_text_buffer_create_child_anchor(gobj(), iterCopy.gobj()),
 
233
                    true); // The function does not do a ref for us.
 
234
}
 
235
 
 
236
void TextBuffer::insert_at_cursor(const Glib::ustring& text)
 
237
{
 
238
  gtk_text_buffer_insert_at_cursor(gobj(), text.data(), text.bytes());
 
239
}
 
240
 
 
241
void TextBuffer::insert_at_cursor(const char* text_begin, const char* text_end)
 
242
{
 
243
  gtk_text_buffer_insert_at_cursor(gobj(), text_begin, text_end - text_begin);
 
244
}
 
245
 
 
246
std::pair<TextBuffer::iterator,bool>
 
247
TextBuffer::insert_interactive(const iterator& pos, const Glib::ustring& text, bool default_editable)
 
248
{
 
249
  // Since we have to copy the iterator anyway we can as well create the
 
250
  // std::pair now.  That saves another copy later (mind you, TextIter is
 
251
  // a heavy struct), and allows modern compilers to apply the return value
 
252
  // optimization.
 
253
  std::pair<iterator,bool> pair_iter_success (pos, false);
 
254
 
 
255
  pair_iter_success.second = gtk_text_buffer_insert_interactive(
 
256
      gobj(), pair_iter_success.first.gobj(), text.data(), text.bytes(), default_editable);
 
257
 
 
258
  return pair_iter_success;
 
259
}
 
260
 
 
261
std::pair<TextBuffer::iterator,bool>
 
262
TextBuffer::insert_interactive(const iterator& pos, const char* text_begin, const char* text_end,
 
263
                               bool default_editable)
 
264
{
 
265
  // Since we have to copy the iterator anyway we can as well create the
 
266
  // std::pair now.  That saves another copy later (mind you, TextIter is
 
267
  // a heavy struct), and allows modern compilers to apply the return value
 
268
  // optimization.
 
269
  std::pair<iterator,bool> pair_iter_success (pos, false);
 
270
 
 
271
  pair_iter_success.second =  gtk_text_buffer_insert_interactive(
 
272
      gobj(), pair_iter_success.first.gobj(), text_begin, text_end - text_begin, default_editable);
 
273
 
 
274
  return pair_iter_success;
 
275
}
 
276
 
 
277
bool TextBuffer::insert_interactive_at_cursor(const Glib::ustring& text, bool default_editable)
 
278
{
 
279
  return gtk_text_buffer_insert_interactive_at_cursor(
 
280
      gobj(), text.data(), text.bytes(), default_editable);
 
281
}
 
282
 
 
283
bool TextBuffer::insert_interactive_at_cursor(const char* text_begin, const char* text_end,
 
284
                                              bool default_editable)
 
285
{
 
286
  return gtk_text_buffer_insert_interactive_at_cursor(
 
287
      gobj(), text_begin, text_end - text_begin, default_editable);
 
288
}
 
289
 
 
290
TextBuffer::iterator TextBuffer::insert_with_tag(const iterator& pos, const Glib::ustring& text,
 
291
                                                 const Glib::RefPtr<Tag>& tag)
 
292
{
 
293
  // gtk_text_buffer_insert_with_tags() invalidates the iterator, but this lets us recreate it later.
 
294
  const int offset = pos.get_offset();
 
295
 
 
296
  iterator iterCopy (pos);
 
297
  gtk_text_buffer_insert_with_tags(
 
298
      gobj(), iterCopy.gobj(), text.data(), text.bytes(), tag->gobj(), (GtkTextTag*)0);
 
299
 
 
300
  return get_iter_at_offset(offset + text.size());
 
301
}
 
302
 
 
303
TextBuffer::iterator TextBuffer::insert_with_tag(const iterator& pos,
 
304
                                                 const char* text_begin, const char* text_end,
 
305
                                                 const Glib::RefPtr<Tag>& tag)
 
306
{
 
307
  // gtk_text_buffer_insert_with_tags() invalidates the iterator, but this lets us recreate it later.
 
308
  const int offset = pos.get_offset();
 
309
 
 
310
  iterator iterCopy (pos);
 
311
  gtk_text_buffer_insert_with_tags(
 
312
      gobj(), iterCopy.gobj(), text_begin, text_end - text_begin, tag->gobj(), (GtkTextTag*)0);
 
313
 
 
314
  return get_iter_at_offset(offset + (text_end - text_begin));
 
315
}
 
316
 
 
317
TextBuffer::iterator TextBuffer::insert_with_tag(const iterator& pos, const Glib::ustring& text,
 
318
                                                 const Glib::ustring& tag_name)
 
319
{
 
320
  // gtk_text_buffer_insert_with_tags() invalidates the iterator, but this lets us recreate it later.
 
321
  const int offset = pos.get_offset();
 
322
 
 
323
  iterator iterCopy (pos);
 
324
  gtk_text_buffer_insert_with_tags_by_name(
 
325
      gobj(), iterCopy.gobj(), text.data(), text.bytes(), tag_name.c_str(), (char*)0);
 
326
 
 
327
  return get_iter_at_offset(offset + text.size());
 
328
}
 
329
 
 
330
TextBuffer::iterator TextBuffer::insert_with_tag(const iterator& pos,
 
331
                                                 const char* text_begin, const char* text_end,
 
332
                                                 const Glib::ustring& tag_name)
 
333
{
 
334
  // gtk_text_buffer_insert_with_tags() invalidates the iterator, but this lets us recreate it later.
 
335
  const int offset = pos.get_offset();
 
336
 
 
337
  iterator iterCopy (pos);
 
338
  gtk_text_buffer_insert_with_tags_by_name(
 
339
      gobj(), iterCopy.gobj(), text_begin, text_end - text_begin, tag_name.c_str(), (char*)0);
 
340
 
 
341
  return get_iter_at_offset(offset + (text_end - text_begin));
 
342
}
 
343
 
 
344
TextBuffer::iterator TextBuffer::insert_with_tags(const iterator& pos, const Glib::ustring& text,
 
345
                                                  const std::vector< Glib::RefPtr<Tag> >& tags)
 
346
{
 
347
  const char *const text_begin = text.data();
 
348
  return insert_with_tags(pos, text_begin, text_begin + text.bytes(), tags);
 
349
}
 
350
 
 
351
TextBuffer::iterator TextBuffer::insert_with_tags(const iterator& pos,
 
352
                                                  const char* text_begin, const char* text_end,
 
353
                                                  const std::vector< Glib::RefPtr<Tag> >& tags)
 
354
{
 
355
  const int start_offset = pos.get_offset();
 
356
  iterator range_end (insert(pos, text_begin, text_end));
 
357
 
 
358
  GtkTextIter range_begin;
 
359
  gtk_text_buffer_get_iter_at_offset(gobj(), &range_begin, start_offset);
 
360
 
 
361
  Glib::ArrayHandler<Glib::RefPtr<Tag> >::ArrayKeeperType array_keeper (Glib::ArrayHandler<Glib::RefPtr<Tag> >::vector_to_array(tags));
 
362
 
 
363
  //This was GtkTextTag* const * const, but the SUN Forte compiler said that it couldn't convert to that. murrayc
 
364
  const GtkTextTag* const* tags_begin = array_keeper.data();
 
365
  const GtkTextTag* const* tags_end   = tags_begin + tags.size();
 
366
 
 
367
  //TODO: Investigate if this const_cast<> is really necessary.
 
368
  //I added it for the SUN Forte compiler. murrayc.
 
369
  for(GtkTextTag *const * ptag = const_cast<GtkTextTag* const *>(tags_begin); ptag != const_cast<GtkTextTag* const *>(tags_end); ++ptag)
 
370
  {
 
371
    gtk_text_buffer_apply_tag(gobj(), *ptag, &range_begin, range_end.gobj());
 
372
  }
 
373
 
 
374
  return range_end;
 
375
}
 
376
 
 
377
TextBuffer::iterator TextBuffer::insert_with_tags_by_name(const iterator& pos, const Glib::ustring& text,
 
378
                                                          const std::vector<Glib::ustring>& tag_names)
 
379
{
 
380
  const char *const text_begin = text.data();
 
381
  return insert_with_tags_by_name(pos, text_begin, text_begin + text.bytes(), tag_names);
 
382
}
 
383
 
 
384
TextBuffer::iterator TextBuffer::insert_with_tags_by_name(const iterator& pos,
 
385
                                                          const char* text_begin, const char* text_end,
 
386
                                                          const std::vector<Glib::ustring>& tag_names)
 
387
{
 
388
  // gtk_buffer_insert_with_tags_by_name() is a convenience wrapper, so it's kind of OK to reimplement it:
 
389
 
 
390
  const int start_offset = pos.get_offset();
 
391
  iterator range_end (insert(pos, text_begin, text_end));
 
392
 
 
393
  GtkTextIter range_begin;
 
394
  gtk_text_buffer_get_iter_at_offset(gobj(), &range_begin, start_offset);
 
395
 
 
396
  GtkTextTagTable *const tag_table = gtk_text_buffer_get_tag_table(gobj());
 
397
  Glib::ArrayHandler<Glib::ustring>::ArrayKeeperType array_keeper (Glib::ArrayHandler<Glib::ustring>::vector_to_array(tag_names));
 
398
 
 
399
  const char *const *const names_begin = array_keeper.data();
 
400
  const char *const *const names_end   = names_begin + tag_names.size();
 
401
 
 
402
  for(const char *const * pname = names_begin; pname != names_end; ++pname)
 
403
  {
 
404
    if(GtkTextTag *const tag = gtk_text_tag_table_lookup(tag_table, *pname))
 
405
    {
 
406
      gtk_text_buffer_apply_tag(gobj(), tag, &range_begin, range_end.gobj());
 
407
    }
 
408
    else
 
409
    {
 
410
      g_warning("Gtk::TextBuffer::insert_with_tags_by_name(): no tag with name '%s'!", *pname);
 
411
    }
 
412
  }
 
413
 
 
414
  return range_end;
 
415
}
 
416
 
 
417
TextBuffer::iterator TextBuffer::insert(const iterator& pos,
 
418
                                        const iterator& range_begin, const iterator& range_end)
 
419
{
 
420
  iterator iterCopy (pos);
 
421
  gtk_text_buffer_insert_range(gobj(), iterCopy.gobj(), range_begin.gobj(), range_end.gobj());
 
422
  return iterCopy;
 
423
}
 
424
 
 
425
std::pair<TextBuffer::iterator,bool>
 
426
TextBuffer::insert_interactive(const iterator& pos, const iterator& range_begin,
 
427
                               const iterator& range_end, bool default_editable)
 
428
{
 
429
  // Since we have to copy the iterator anyway we can as well create the
 
430
  // std::pair now.  That saves another copy later (mind you, TextIter is
 
431
  // a heavy struct), and allows modern compilers to apply the return value
 
432
  // optimization.
 
433
  std::pair<iterator,bool> pair_iter_success (pos, false);
 
434
 
 
435
  pair_iter_success.second = gtk_text_buffer_insert_range_interactive(
 
436
      gobj(), pair_iter_success.first.gobj(), range_begin.gobj(), range_end.gobj(), default_editable);
 
437
 
 
438
  return pair_iter_success;
 
439
}
 
440
 
 
441
TextBuffer::iterator TextBuffer::erase(const iterator& range_begin, const iterator& range_end)
 
442
{
 
443
  // GTK+ sets the iterators to where the deletion occured. We do it the STL way and therefore need copies.
 
444
  iterator beginCopy (range_begin);
 
445
  iterator endCopy   (range_end);
 
446
  gtk_text_buffer_delete(gobj(), beginCopy.gobj(), endCopy.gobj());
 
447
  return beginCopy;
 
448
}
 
449
 
 
450
TextBuffer::iterator TextBuffer::backspace(const iterator& iter, bool interactive, bool default_editable)
 
451
{
 
452
  // GTK+ sets the iterators to where the deletion occured. We do it the STL way and therefore need copies.
 
453
  iterator copy(iter);
 
454
  gtk_text_buffer_backspace(gobj(), copy.gobj(), interactive, default_editable);
 
455
  return copy;
 
456
}
 
457
 
 
458
 
 
459
std::pair<TextBuffer::iterator,bool>
 
460
TextBuffer::erase_interactive(const iterator& range_begin, const iterator& range_end,
 
461
                              bool default_editable)
 
462
{
 
463
  // Since we have to copy the iterator anyway we can as well create the
 
464
  // std::pair now.  That saves another copy later (mind you, TextIter is
 
465
  // a heavy struct), and allows modern compilers to apply the return value
 
466
  // optimization.
 
467
  std::pair<iterator,bool> pair_iter_success (range_begin, false);
 
468
 
 
469
  // GTK+ sets the iterators to where the deletion occured.
 
470
  // We do it the STL way and therefore need copies.
 
471
  iterator endCopy (range_end);
 
472
 
 
473
  pair_iter_success.second = gtk_text_buffer_delete_interactive(
 
474
      gobj(), pair_iter_success.first.gobj(), endCopy.gobj(), default_editable);
 
475
 
 
476
  return pair_iter_success;
 
477
}
 
478
 
 
479
void TextBuffer::paste_clipboard(const Glib::RefPtr<Clipboard>& clipboard, const iterator& override_location,
 
480
                                 bool default_editable)
 
481
{
 
482
  gtk_text_buffer_paste_clipboard(gobj(), clipboard->gobj(),
 
483
      const_cast<GtkTextIter*>(override_location.gobj()), default_editable);
 
484
}
 
485
 
 
486
void TextBuffer::paste_clipboard(const Glib::RefPtr<Clipboard>& clipboard, bool default_editable)
 
487
{
 
488
  gtk_text_buffer_paste_clipboard(gobj(), clipboard->gobj(), 0, default_editable);
 
489
}
 
490
 
 
491
TextBuffer::iterator TextBuffer::get_iter_at_child_anchor(const Glib::RefPtr<ChildAnchor>& anchor)
 
492
{
 
493
  iterator iter;
 
494
  gtk_text_buffer_get_iter_at_child_anchor(gobj(), iter.gobj(), anchor->gobj());
 
495
  return iter;
 
496
}
 
497
 
 
498
int TextBuffer::size() const
 
499
{
 
500
  return get_char_count();
 
501
}
 
502
 
 
503
Glib::ustring TextBuffer::get_text(bool include_hidden_chars) const
 
504
{
 
505
  TextBuffer* unconst = const_cast<TextBuffer*>(this); //Because begin() and end() are not const.
 
506
  return get_text(unconst->begin(), unconst->end(), include_hidden_chars);
 
507
}
 
508
 
 
509
std::vector<Glib::ustring> TextBuffer::get_serialize_formats() const
 
510
{
 
511
  int n_atoms = 0;
 
512
  GdkAtom* atoms = gtk_text_buffer_get_serialize_formats(const_cast<GtkTextBuffer*>(gobj()), &n_atoms);
 
513
  return Glib::ArrayHandler<Glib::ustring, Gdk::AtomUstringTraits>::array_to_vector(atoms, n_atoms, Glib::OWNERSHIP_SHALLOW);
 
514
}
 
515
 
 
516
std::vector<Glib::ustring> TextBuffer::get_deserialize_formats() const
 
517
{
 
518
  int n_atoms = 0;
 
519
  GdkAtom* atoms = gtk_text_buffer_get_deserialize_formats(const_cast<GtkTextBuffer*>(gobj()), &n_atoms);
 
520
  return Glib::ArrayHandler<Glib::ustring, Gdk::AtomUstringTraits>::array_to_vector(atoms, n_atoms, Glib::OWNERSHIP_SHALLOW);
 
521
}
 
522
 
 
523
/*
 
524
Glib::ustring TextBuffer::register_serialize_format(const Glib::ustring& mime_type, const SlotSerialize& slot)
 
525
{
 
526
  SlotSerialize* slot_copy = new SlotSerialize(slot);
 
527
  GdkAtom atom = gtk_text_buffer_register_serialize_format(gobj(), mime_type.c_str(), 
 
528
                &SignalProxy_Serialize, slot_copy, &SignalProxy_Serialize_gtk_callback_destroy);
 
529
 
 
530
  //Convert the atom to a string:
 
531
  Glib::ustring atom_as_string;
 
532
  char* atom_name = gdk_atom_name(atom);
 
533
  if(atom_name)
 
534
  {
 
535
    atom_as_string = atom_name;
 
536
    g_free(atom_name);
 
537
  }
 
538
 
 
539
  return atom_as_string;
 
540
}
 
541
 
 
542
Glib::ustring TextBuffer::register_deserialize_format(const Glib::ustring& mime_type, const SlotDeserialize& slot)
 
543
{
 
544
  SlotDeserialize* slot_copy = new SlotDeserialize(slot);
 
545
  GdkAtom atom = gtk_text_buffer_register_deserialize_format(gobj(), mime_type.c_str(), 
 
546
                &SignalProxy_Deserialize, slot_copy, &SignalProxy_Deserialize_gtk_callback_destroy);
 
547
 
 
548
  //Convert the atom to a string:
 
549
  Glib::ustring atom_as_string;
 
550
  char* atom_name = gdk_atom_name(atom);
 
551
  if(atom_name)
 
552
  {
 
553
    atom_as_string = atom_name;
 
554
    g_free(atom_name);
 
555
  }
 
556
 
 
557
  return atom_as_string;
 
558
}
 
559
*/
 
560
 
 
561
} // namespace Gtk
 
562
 
 
563
namespace
 
564
{
 
565
 
 
566
 
 
567
static void TextBuffer_signal_insert_callback(GtkTextBuffer* self, GtkTextIter* p0,const gchar* p1,gint p2,void* data)
 
568
{
 
569
  using namespace Gtk;
 
570
  typedef sigc::slot< void,const TextBuffer::iterator&,const Glib::ustring&,int > SlotType;
 
571
 
 
572
  // Do not try to call a signal on a disassociated wrapper.
 
573
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
 
574
  {
 
575
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
576
    try
 
577
    {
 
578
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
579
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
 
580
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
 
581
, Glib::ustring(p1, p1 + p2)
 
582
, p2
 
583
);
 
584
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
585
    }
 
586
    catch(...)
 
587
    {
 
588
      Glib::exception_handlers_invoke();
 
589
    }
 
590
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
591
  }
 
592
}
 
593
 
 
594
static const Glib::SignalProxyInfo TextBuffer_signal_insert_info =
 
595
{
 
596
  "insert_text",
 
597
  (GCallback) &TextBuffer_signal_insert_callback,
 
598
  (GCallback) &TextBuffer_signal_insert_callback
 
599
};
 
600
 
 
601
 
 
602
static void TextBuffer_signal_insert_pixbuf_callback(GtkTextBuffer* self, GtkTextIter* p0,GdkPixbuf* p1,void* data)
 
603
{
 
604
  using namespace Gtk;
 
605
  typedef sigc::slot< void,const TextBuffer::iterator&,const Glib::RefPtr<Gdk::Pixbuf>& > SlotType;
 
606
 
 
607
  // Do not try to call a signal on a disassociated wrapper.
 
608
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
 
609
  {
 
610
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
611
    try
 
612
    {
 
613
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
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)
 
617
);
 
618
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
619
    }
 
620
    catch(...)
 
621
    {
 
622
      Glib::exception_handlers_invoke();
 
623
    }
 
624
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
625
  }
 
626
}
 
627
 
 
628
static const Glib::SignalProxyInfo TextBuffer_signal_insert_pixbuf_info =
 
629
{
 
630
  "insert_pixbuf",
 
631
  (GCallback) &TextBuffer_signal_insert_pixbuf_callback,
 
632
  (GCallback) &TextBuffer_signal_insert_pixbuf_callback
 
633
};
 
634
 
 
635
 
 
636
static void TextBuffer_signal_insert_child_anchor_callback(GtkTextBuffer* self, GtkTextIter* p0,GtkTextChildAnchor* p1,void* data)
 
637
{
 
638
  using namespace Gtk;
 
639
  typedef sigc::slot< void,const TextBuffer::iterator&,const Glib::RefPtr<ChildAnchor>& > SlotType;
 
640
 
 
641
  // Do not try to call a signal on a disassociated wrapper.
 
642
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
 
643
  {
 
644
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
645
    try
 
646
    {
 
647
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
648
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
 
649
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
 
650
, Glib::wrap(p1, true)
 
651
);
 
652
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
653
    }
 
654
    catch(...)
 
655
    {
 
656
      Glib::exception_handlers_invoke();
 
657
    }
 
658
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
659
  }
 
660
}
 
661
 
 
662
static const Glib::SignalProxyInfo TextBuffer_signal_insert_child_anchor_info =
 
663
{
 
664
  "insert_child_anchor",
 
665
  (GCallback) &TextBuffer_signal_insert_child_anchor_callback,
 
666
  (GCallback) &TextBuffer_signal_insert_child_anchor_callback
 
667
};
 
668
 
 
669
 
 
670
static void TextBuffer_signal_erase_callback(GtkTextBuffer* self, GtkTextIter* p0,GtkTextIter* p1,void* data)
 
671
{
 
672
  using namespace Gtk;
 
673
  typedef sigc::slot< void,const TextBuffer::iterator&,const TextBuffer::iterator& > SlotType;
 
674
 
 
675
  // Do not try to call a signal on a disassociated wrapper.
 
676
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
 
677
  {
 
678
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
679
    try
 
680
    {
 
681
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
682
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
 
683
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
 
684
, Glib::wrap(p1)
 
685
);
 
686
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
687
    }
 
688
    catch(...)
 
689
    {
 
690
      Glib::exception_handlers_invoke();
 
691
    }
 
692
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
693
  }
 
694
}
 
695
 
 
696
static const Glib::SignalProxyInfo TextBuffer_signal_erase_info =
 
697
{
 
698
  "delete_range",
 
699
  (GCallback) &TextBuffer_signal_erase_callback,
 
700
  (GCallback) &TextBuffer_signal_erase_callback
 
701
};
 
702
 
 
703
 
 
704
static const Glib::SignalProxyInfo TextBuffer_signal_changed_info =
 
705
{
 
706
  "changed",
 
707
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
 
708
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
 
709
};
 
710
 
 
711
 
 
712
static const Glib::SignalProxyInfo TextBuffer_signal_modified_changed_info =
 
713
{
 
714
  "modified_changed",
 
715
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
 
716
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
 
717
};
 
718
 
 
719
 
 
720
static void TextBuffer_signal_mark_set_callback(GtkTextBuffer* self, const GtkTextIter* p0,GtkTextMark* p1,void* data)
 
721
{
 
722
  using namespace Gtk;
 
723
  typedef sigc::slot< void,const TextBuffer::iterator&,const Glib::RefPtr<TextBuffer::Mark>& > SlotType;
 
724
 
 
725
  // Do not try to call a signal on a disassociated wrapper.
 
726
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
 
727
  {
 
728
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
729
    try
 
730
    {
 
731
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
732
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
 
733
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
 
734
, Glib::wrap(p1, true)
 
735
);
 
736
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
737
    }
 
738
    catch(...)
 
739
    {
 
740
      Glib::exception_handlers_invoke();
 
741
    }
 
742
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
743
  }
 
744
}
 
745
 
 
746
static const Glib::SignalProxyInfo TextBuffer_signal_mark_set_info =
 
747
{
 
748
  "mark_set",
 
749
  (GCallback) &TextBuffer_signal_mark_set_callback,
 
750
  (GCallback) &TextBuffer_signal_mark_set_callback
 
751
};
 
752
 
 
753
 
 
754
static void TextBuffer_signal_mark_deleted_callback(GtkTextBuffer* self, GtkTextMark* p0,void* data)
 
755
{
 
756
  using namespace Gtk;
 
757
  typedef sigc::slot< void,const Glib::RefPtr<TextBuffer::Mark>& > SlotType;
 
758
 
 
759
  // Do not try to call a signal on a disassociated wrapper.
 
760
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
 
761
  {
 
762
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
763
    try
 
764
    {
 
765
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
766
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
 
767
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
 
768
);
 
769
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
770
    }
 
771
    catch(...)
 
772
    {
 
773
      Glib::exception_handlers_invoke();
 
774
    }
 
775
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
776
  }
 
777
}
 
778
 
 
779
static const Glib::SignalProxyInfo TextBuffer_signal_mark_deleted_info =
 
780
{
 
781
  "mark_deleted",
 
782
  (GCallback) &TextBuffer_signal_mark_deleted_callback,
 
783
  (GCallback) &TextBuffer_signal_mark_deleted_callback
 
784
};
 
785
 
 
786
 
 
787
static void TextBuffer_signal_apply_tag_callback(GtkTextBuffer* self, GtkTextTag* p0,const GtkTextIter* p1,const GtkTextIter* p2,void* data)
 
788
{
 
789
  using namespace Gtk;
 
790
  typedef sigc::slot< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& > SlotType;
 
791
 
 
792
  // Do not try to call a signal on a disassociated wrapper.
 
793
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
 
794
  {
 
795
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
796
    try
 
797
    {
 
798
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
799
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
 
800
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
 
801
, Glib::wrap(p1)
 
802
, Glib::wrap(p2)
 
803
);
 
804
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
805
    }
 
806
    catch(...)
 
807
    {
 
808
      Glib::exception_handlers_invoke();
 
809
    }
 
810
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
811
  }
 
812
}
 
813
 
 
814
static const Glib::SignalProxyInfo TextBuffer_signal_apply_tag_info =
 
815
{
 
816
  "apply_tag",
 
817
  (GCallback) &TextBuffer_signal_apply_tag_callback,
 
818
  (GCallback) &TextBuffer_signal_apply_tag_callback
 
819
};
 
820
 
 
821
 
 
822
static void TextBuffer_signal_remove_tag_callback(GtkTextBuffer* self, GtkTextTag* p0,const GtkTextIter* p1,const GtkTextIter* p2,void* data)
 
823
{
 
824
  using namespace Gtk;
 
825
  typedef sigc::slot< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& > SlotType;
 
826
 
 
827
  // Do not try to call a signal on a disassociated wrapper.
 
828
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
 
829
  {
 
830
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
831
    try
 
832
    {
 
833
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
834
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
 
835
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
 
836
, Glib::wrap(p1)
 
837
, Glib::wrap(p2)
 
838
);
 
839
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
840
    }
 
841
    catch(...)
 
842
    {
 
843
      Glib::exception_handlers_invoke();
 
844
    }
 
845
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
846
  }
 
847
}
 
848
 
 
849
static const Glib::SignalProxyInfo TextBuffer_signal_remove_tag_info =
 
850
{
 
851
  "remove_tag",
 
852
  (GCallback) &TextBuffer_signal_remove_tag_callback,
 
853
  (GCallback) &TextBuffer_signal_remove_tag_callback
 
854
};
 
855
 
 
856
 
 
857
static const Glib::SignalProxyInfo TextBuffer_signal_begin_user_action_info =
 
858
{
 
859
  "begin_user_action",
 
860
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
 
861
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
 
862
};
 
863
 
 
864
 
 
865
static const Glib::SignalProxyInfo TextBuffer_signal_end_user_action_info =
 
866
{
 
867
  "end_user_action",
 
868
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
 
869
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
 
870
};
 
871
 
 
872
 
 
873
static void TextBuffer_signal_paste_done_callback(GtkTextBuffer* self, GtkClipboard* p0,void* data)
 
874
{
 
875
  using namespace Gtk;
 
876
  typedef sigc::slot< void,const Glib::RefPtr<Gtk::Clipboard>& > SlotType;
 
877
 
 
878
  // Do not try to call a signal on a disassociated wrapper.
 
879
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
 
880
  {
 
881
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
882
    try
 
883
    {
 
884
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
885
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
 
886
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
 
887
);
 
888
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
889
    }
 
890
    catch(...)
 
891
    {
 
892
      Glib::exception_handlers_invoke();
 
893
    }
 
894
    #endif //GLIBMM_EXCEPTIONS_ENABLED
 
895
  }
 
896
}
 
897
 
 
898
static const Glib::SignalProxyInfo TextBuffer_signal_paste_done_info =
 
899
{
 
900
  "paste_done",
 
901
  (GCallback) &TextBuffer_signal_paste_done_callback,
 
902
  (GCallback) &TextBuffer_signal_paste_done_callback
 
903
};
 
904
 
 
905
 
 
906
} // anonymous namespace
 
907
 
 
908
 
 
909
namespace Glib
 
910
{
 
911
 
 
912
Glib::RefPtr<Gtk::TextBuffer> wrap(GtkTextBuffer* object, bool take_copy)
 
913
{
 
914
  return Glib::RefPtr<Gtk::TextBuffer>( dynamic_cast<Gtk::TextBuffer*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
 
915
  //We use dynamic_cast<> in case of multiple inheritance.
 
916
}
 
917
 
 
918
} /* namespace Glib */
 
919
 
 
920
 
 
921
namespace Gtk
 
922
{
 
923
 
 
924
 
 
925
/* The *_Class implementation: */
 
926
 
 
927
const Glib::Class& TextBuffer_Class::init()
 
928
{
 
929
  if(!gtype_) // create the GType if necessary
 
930
  {
 
931
    // Glib::Class has to know the class init function to clone custom types.
 
932
    class_init_func_ = &TextBuffer_Class::class_init_function;
 
933
 
 
934
    // This is actually just optimized away, apparently with no harm.
 
935
    // Make sure that the parent type has been created.
 
936
    //CppClassParent::CppObjectType::get_type();
 
937
 
 
938
    // Create the wrapper type, with the same class/instance size as the base type.
 
939
    register_derived_type(gtk_text_buffer_get_type());
 
940
 
 
941
    // Add derived versions of interfaces, if the C type implements any interfaces:
 
942
 
 
943
  }
 
944
 
 
945
  return *this;
 
946
}
 
947
 
 
948
 
 
949
void TextBuffer_Class::class_init_function(void* g_class, void* class_data)
 
950
{
 
951
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
 
952
  CppClassParent::class_init_function(klass, class_data);
 
953
 
 
954
 
 
955
  klass->insert_text = &insert_text_callback;
 
956
  klass->insert_pixbuf = &insert_pixbuf_callback;
 
957
  klass->insert_child_anchor = &insert_child_anchor_callback;
 
958
  klass->delete_range = &delete_range_callback;
 
959
  klass->changed = &changed_callback;
 
960
  klass->modified_changed = &modified_changed_callback;
 
961
  klass->mark_set = &mark_set_callback;
 
962
  klass->mark_deleted = &mark_deleted_callback;
 
963
  klass->apply_tag = &apply_tag_callback;
 
964
  klass->remove_tag = &remove_tag_callback;
 
965
  klass->begin_user_action = &begin_user_action_callback;
 
966
  klass->end_user_action = &end_user_action_callback;
 
967
  klass->paste_done = &paste_done_callback;
 
968
}
 
969
 
 
970
 
 
971
void TextBuffer_Class::insert_text_callback(GtkTextBuffer* self, GtkTextIter* p0, const gchar* p1, gint p2)
 
972
{
 
973
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
974
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
975
 
 
976
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
977
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
978
  // generated classes can use this optimisation, which avoids the unnecessary
 
979
  // parameter conversions if there is no possibility of the virtual function
 
980
  // being overridden:
 
981
  if(obj_base && obj_base->is_derived_())
 
982
  {
 
983
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
984
    if(obj) // This can be NULL during destruction.
 
985
    {
 
986
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
987
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
988
      {
 
989
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
990
        // Call the virtual member method, which derived classes might override.
 
991
        obj->on_insert(Glib::wrap(p0)
 
992
, Glib::ustring(p1, p1 + p2)
 
993
, p2
 
994
);
 
995
        return;
 
996
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
997
      }
 
998
      catch(...)
 
999
      {
 
1000
        Glib::exception_handlers_invoke();
 
1001
      }
 
1002
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1003
    }
 
1004
  }
 
1005
  
 
1006
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1007
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1008
    );
 
1009
 
 
1010
  // Call the original underlying C function:
 
1011
  if(base && base->insert_text)
 
1012
    (*base->insert_text)(self, p0, p1, p2);
 
1013
}
 
1014
void TextBuffer_Class::insert_pixbuf_callback(GtkTextBuffer* self, GtkTextIter* p0, GdkPixbuf* p1)
 
1015
{
 
1016
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1017
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1018
 
 
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_base && obj_base->is_derived_())
 
1025
  {
 
1026
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1027
    if(obj) // This can be NULL during destruction.
 
1028
    {
 
1029
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1030
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1031
      {
 
1032
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1033
        // Call the virtual member method, which derived classes might override.
 
1034
        obj->on_insert_pixbuf(Glib::wrap(p0)
 
1035
, Glib::wrap(p1, true)
 
1036
);
 
1037
        return;
 
1038
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1039
      }
 
1040
      catch(...)
 
1041
      {
 
1042
        Glib::exception_handlers_invoke();
 
1043
      }
 
1044
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1045
    }
 
1046
  }
 
1047
  
 
1048
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1049
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1050
    );
 
1051
 
 
1052
  // Call the original underlying C function:
 
1053
  if(base && base->insert_pixbuf)
 
1054
    (*base->insert_pixbuf)(self, p0, p1);
 
1055
}
 
1056
void TextBuffer_Class::insert_child_anchor_callback(GtkTextBuffer* self, GtkTextIter* p0, GtkTextChildAnchor* p1)
 
1057
{
 
1058
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1059
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1060
 
 
1061
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1062
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1063
  // generated classes can use this optimisation, which avoids the unnecessary
 
1064
  // parameter conversions if there is no possibility of the virtual function
 
1065
  // being overridden:
 
1066
  if(obj_base && obj_base->is_derived_())
 
1067
  {
 
1068
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1069
    if(obj) // This can be NULL during destruction.
 
1070
    {
 
1071
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1072
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1073
      {
 
1074
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1075
        // Call the virtual member method, which derived classes might override.
 
1076
        obj->on_insert_child_anchor(Glib::wrap(p0)
 
1077
, Glib::wrap(p1, true)
 
1078
);
 
1079
        return;
 
1080
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1081
      }
 
1082
      catch(...)
 
1083
      {
 
1084
        Glib::exception_handlers_invoke();
 
1085
      }
 
1086
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1087
    }
 
1088
  }
 
1089
  
 
1090
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1091
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1092
    );
 
1093
 
 
1094
  // Call the original underlying C function:
 
1095
  if(base && base->insert_child_anchor)
 
1096
    (*base->insert_child_anchor)(self, p0, p1);
 
1097
}
 
1098
void TextBuffer_Class::delete_range_callback(GtkTextBuffer* self, GtkTextIter* p0, GtkTextIter* p1)
 
1099
{
 
1100
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1101
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1102
 
 
1103
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1104
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1105
  // generated classes can use this optimisation, which avoids the unnecessary
 
1106
  // parameter conversions if there is no possibility of the virtual function
 
1107
  // being overridden:
 
1108
  if(obj_base && obj_base->is_derived_())
 
1109
  {
 
1110
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1111
    if(obj) // This can be NULL during destruction.
 
1112
    {
 
1113
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1114
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1115
      {
 
1116
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1117
        // Call the virtual member method, which derived classes might override.
 
1118
        obj->on_erase(Glib::wrap(p0)
 
1119
, Glib::wrap(p1)
 
1120
);
 
1121
        return;
 
1122
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1123
      }
 
1124
      catch(...)
 
1125
      {
 
1126
        Glib::exception_handlers_invoke();
 
1127
      }
 
1128
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1129
    }
 
1130
  }
 
1131
  
 
1132
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1133
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1134
    );
 
1135
 
 
1136
  // Call the original underlying C function:
 
1137
  if(base && base->delete_range)
 
1138
    (*base->delete_range)(self, p0, p1);
 
1139
}
 
1140
void TextBuffer_Class::changed_callback(GtkTextBuffer* self)
 
1141
{
 
1142
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1143
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1144
 
 
1145
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1146
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1147
  // generated classes can use this optimisation, which avoids the unnecessary
 
1148
  // parameter conversions if there is no possibility of the virtual function
 
1149
  // being overridden:
 
1150
  if(obj_base && obj_base->is_derived_())
 
1151
  {
 
1152
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1153
    if(obj) // This can be NULL during destruction.
 
1154
    {
 
1155
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1156
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1157
      {
 
1158
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1159
        // Call the virtual member method, which derived classes might override.
 
1160
        obj->on_changed();
 
1161
        return;
 
1162
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1163
      }
 
1164
      catch(...)
 
1165
      {
 
1166
        Glib::exception_handlers_invoke();
 
1167
      }
 
1168
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1169
    }
 
1170
  }
 
1171
  
 
1172
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1173
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1174
    );
 
1175
 
 
1176
  // Call the original underlying C function:
 
1177
  if(base && base->changed)
 
1178
    (*base->changed)(self);
 
1179
}
 
1180
void TextBuffer_Class::modified_changed_callback(GtkTextBuffer* self)
 
1181
{
 
1182
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1183
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1184
 
 
1185
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1186
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1187
  // generated classes can use this optimisation, which avoids the unnecessary
 
1188
  // parameter conversions if there is no possibility of the virtual function
 
1189
  // being overridden:
 
1190
  if(obj_base && obj_base->is_derived_())
 
1191
  {
 
1192
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1193
    if(obj) // This can be NULL during destruction.
 
1194
    {
 
1195
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1196
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1197
      {
 
1198
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1199
        // Call the virtual member method, which derived classes might override.
 
1200
        obj->on_modified_changed();
 
1201
        return;
 
1202
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1203
      }
 
1204
      catch(...)
 
1205
      {
 
1206
        Glib::exception_handlers_invoke();
 
1207
      }
 
1208
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1209
    }
 
1210
  }
 
1211
  
 
1212
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1213
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1214
    );
 
1215
 
 
1216
  // Call the original underlying C function:
 
1217
  if(base && base->modified_changed)
 
1218
    (*base->modified_changed)(self);
 
1219
}
 
1220
void TextBuffer_Class::mark_set_callback(GtkTextBuffer* self, const GtkTextIter* p0, GtkTextMark* p1)
 
1221
{
 
1222
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1223
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1224
 
 
1225
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1226
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1227
  // generated classes can use this optimisation, which avoids the unnecessary
 
1228
  // parameter conversions if there is no possibility of the virtual function
 
1229
  // being overridden:
 
1230
  if(obj_base && obj_base->is_derived_())
 
1231
  {
 
1232
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1233
    if(obj) // This can be NULL during destruction.
 
1234
    {
 
1235
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1236
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1237
      {
 
1238
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1239
        // Call the virtual member method, which derived classes might override.
 
1240
        obj->on_mark_set(Glib::wrap(p0)
 
1241
, Glib::wrap(p1, true)
 
1242
);
 
1243
        return;
 
1244
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1245
      }
 
1246
      catch(...)
 
1247
      {
 
1248
        Glib::exception_handlers_invoke();
 
1249
      }
 
1250
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1251
    }
 
1252
  }
 
1253
  
 
1254
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1255
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1256
    );
 
1257
 
 
1258
  // Call the original underlying C function:
 
1259
  if(base && base->mark_set)
 
1260
    (*base->mark_set)(self, p0, p1);
 
1261
}
 
1262
void TextBuffer_Class::mark_deleted_callback(GtkTextBuffer* self, GtkTextMark* p0)
 
1263
{
 
1264
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1265
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1266
 
 
1267
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1268
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1269
  // generated classes can use this optimisation, which avoids the unnecessary
 
1270
  // parameter conversions if there is no possibility of the virtual function
 
1271
  // being overridden:
 
1272
  if(obj_base && obj_base->is_derived_())
 
1273
  {
 
1274
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1275
    if(obj) // This can be NULL during destruction.
 
1276
    {
 
1277
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1278
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1279
      {
 
1280
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1281
        // Call the virtual member method, which derived classes might override.
 
1282
        obj->on_mark_deleted(Glib::wrap(p0, true)
 
1283
);
 
1284
        return;
 
1285
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1286
      }
 
1287
      catch(...)
 
1288
      {
 
1289
        Glib::exception_handlers_invoke();
 
1290
      }
 
1291
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1292
    }
 
1293
  }
 
1294
  
 
1295
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1296
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1297
    );
 
1298
 
 
1299
  // Call the original underlying C function:
 
1300
  if(base && base->mark_deleted)
 
1301
    (*base->mark_deleted)(self, p0);
 
1302
}
 
1303
void TextBuffer_Class::apply_tag_callback(GtkTextBuffer* self, GtkTextTag* p0, const GtkTextIter* p1, const GtkTextIter* p2)
 
1304
{
 
1305
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1306
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1307
 
 
1308
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1309
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1310
  // generated classes can use this optimisation, which avoids the unnecessary
 
1311
  // parameter conversions if there is no possibility of the virtual function
 
1312
  // being overridden:
 
1313
  if(obj_base && obj_base->is_derived_())
 
1314
  {
 
1315
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1316
    if(obj) // This can be NULL during destruction.
 
1317
    {
 
1318
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1319
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1320
      {
 
1321
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1322
        // Call the virtual member method, which derived classes might override.
 
1323
        obj->on_apply_tag(Glib::wrap(p0, true)
 
1324
, Glib::wrap(p1)
 
1325
, Glib::wrap(p2)
 
1326
);
 
1327
        return;
 
1328
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1329
      }
 
1330
      catch(...)
 
1331
      {
 
1332
        Glib::exception_handlers_invoke();
 
1333
      }
 
1334
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1335
    }
 
1336
  }
 
1337
  
 
1338
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1339
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1340
    );
 
1341
 
 
1342
  // Call the original underlying C function:
 
1343
  if(base && base->apply_tag)
 
1344
    (*base->apply_tag)(self, p0, p1, p2);
 
1345
}
 
1346
void TextBuffer_Class::remove_tag_callback(GtkTextBuffer* self, GtkTextTag* p0, const GtkTextIter* p1, const GtkTextIter* p2)
 
1347
{
 
1348
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1349
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1350
 
 
1351
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1352
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1353
  // generated classes can use this optimisation, which avoids the unnecessary
 
1354
  // parameter conversions if there is no possibility of the virtual function
 
1355
  // being overridden:
 
1356
  if(obj_base && obj_base->is_derived_())
 
1357
  {
 
1358
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1359
    if(obj) // This can be NULL during destruction.
 
1360
    {
 
1361
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1362
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1363
      {
 
1364
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1365
        // Call the virtual member method, which derived classes might override.
 
1366
        obj->on_remove_tag(Glib::wrap(p0, true)
 
1367
, Glib::wrap(p1)
 
1368
, Glib::wrap(p2)
 
1369
);
 
1370
        return;
 
1371
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1372
      }
 
1373
      catch(...)
 
1374
      {
 
1375
        Glib::exception_handlers_invoke();
 
1376
      }
 
1377
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1378
    }
 
1379
  }
 
1380
  
 
1381
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1382
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1383
    );
 
1384
 
 
1385
  // Call the original underlying C function:
 
1386
  if(base && base->remove_tag)
 
1387
    (*base->remove_tag)(self, p0, p1, p2);
 
1388
}
 
1389
void TextBuffer_Class::begin_user_action_callback(GtkTextBuffer* self)
 
1390
{
 
1391
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1392
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1393
 
 
1394
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1395
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1396
  // generated classes can use this optimisation, which avoids the unnecessary
 
1397
  // parameter conversions if there is no possibility of the virtual function
 
1398
  // being overridden:
 
1399
  if(obj_base && obj_base->is_derived_())
 
1400
  {
 
1401
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1402
    if(obj) // This can be NULL during destruction.
 
1403
    {
 
1404
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1405
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1406
      {
 
1407
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1408
        // Call the virtual member method, which derived classes might override.
 
1409
        obj->on_begin_user_action();
 
1410
        return;
 
1411
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1412
      }
 
1413
      catch(...)
 
1414
      {
 
1415
        Glib::exception_handlers_invoke();
 
1416
      }
 
1417
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1418
    }
 
1419
  }
 
1420
  
 
1421
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1422
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1423
    );
 
1424
 
 
1425
  // Call the original underlying C function:
 
1426
  if(base && base->begin_user_action)
 
1427
    (*base->begin_user_action)(self);
 
1428
}
 
1429
void TextBuffer_Class::end_user_action_callback(GtkTextBuffer* self)
 
1430
{
 
1431
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1432
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1433
 
 
1434
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1435
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1436
  // generated classes can use this optimisation, which avoids the unnecessary
 
1437
  // parameter conversions if there is no possibility of the virtual function
 
1438
  // being overridden:
 
1439
  if(obj_base && obj_base->is_derived_())
 
1440
  {
 
1441
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1442
    if(obj) // This can be NULL during destruction.
 
1443
    {
 
1444
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1445
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1446
      {
 
1447
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1448
        // Call the virtual member method, which derived classes might override.
 
1449
        obj->on_end_user_action();
 
1450
        return;
 
1451
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1452
      }
 
1453
      catch(...)
 
1454
      {
 
1455
        Glib::exception_handlers_invoke();
 
1456
      }
 
1457
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1458
    }
 
1459
  }
 
1460
  
 
1461
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1462
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1463
    );
 
1464
 
 
1465
  // Call the original underlying C function:
 
1466
  if(base && base->end_user_action)
 
1467
    (*base->end_user_action)(self);
 
1468
}
 
1469
void TextBuffer_Class::paste_done_callback(GtkTextBuffer* self, GtkClipboard* p0)
 
1470
{
 
1471
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
 
1472
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
1473
 
 
1474
  // Non-gtkmmproc-generated custom classes implicitly call the default
 
1475
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
 
1476
  // generated classes can use this optimisation, which avoids the unnecessary
 
1477
  // parameter conversions if there is no possibility of the virtual function
 
1478
  // being overridden:
 
1479
  if(obj_base && obj_base->is_derived_())
 
1480
  {
 
1481
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
 
1482
    if(obj) // This can be NULL during destruction.
 
1483
    {
 
1484
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1485
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
1486
      {
 
1487
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1488
        // Call the virtual member method, which derived classes might override.
 
1489
        obj->on_paste_done(Glib::wrap(p0, true)
 
1490
);
 
1491
        return;
 
1492
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
 
1493
      }
 
1494
      catch(...)
 
1495
      {
 
1496
        Glib::exception_handlers_invoke();
 
1497
      }
 
1498
      #endif //GLIBMM_EXCEPTIONS_ENABLED
 
1499
    }
 
1500
  }
 
1501
  
 
1502
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1503
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
 
1504
    );
 
1505
 
 
1506
  // Call the original underlying C function:
 
1507
  if(base && base->paste_done)
 
1508
    (*base->paste_done)(self, p0);
 
1509
}
 
1510
 
 
1511
 
 
1512
Glib::ObjectBase* TextBuffer_Class::wrap_new(GObject* object)
 
1513
{
 
1514
  return new TextBuffer((GtkTextBuffer*)object);
 
1515
}
 
1516
 
 
1517
 
 
1518
/* The implementation: */
 
1519
 
 
1520
GtkTextBuffer* TextBuffer::gobj_copy()
 
1521
{
 
1522
  reference();
 
1523
  return gobj();
 
1524
}
 
1525
 
 
1526
TextBuffer::TextBuffer(const Glib::ConstructParams& construct_params)
 
1527
:
 
1528
  Glib::Object(construct_params)
 
1529
{
 
1530
 
 
1531
}
 
1532
 
 
1533
TextBuffer::TextBuffer(GtkTextBuffer* castitem)
 
1534
:
 
1535
  Glib::Object((GObject*)(castitem))
 
1536
{}
 
1537
 
 
1538
 
 
1539
TextBuffer::~TextBuffer()
 
1540
{}
 
1541
 
 
1542
 
 
1543
TextBuffer::CppClassType TextBuffer::textbuffer_class_; // initialize static member
 
1544
 
 
1545
GType TextBuffer::get_type()
 
1546
{
 
1547
  return textbuffer_class_.init().get_type();
 
1548
}
 
1549
 
 
1550
 
 
1551
GType TextBuffer::get_base_type()
 
1552
{
 
1553
  return gtk_text_buffer_get_type();
 
1554
}
 
1555
 
 
1556
 
 
1557
TextBuffer::TextBuffer()
 
1558
:
 
1559
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
 
1560
  Glib::ObjectBase(0),
 
1561
  Glib::Object(Glib::ConstructParams(textbuffer_class_.init()))
 
1562
{
 
1563
  
 
1564
 
 
1565
}
 
1566
 
 
1567
Glib::RefPtr<TextBuffer> TextBuffer::create()
 
1568
{
 
1569
  return Glib::RefPtr<TextBuffer>( new TextBuffer() );
 
1570
}
 
1571
Glib::RefPtr<TextBuffer> TextBuffer::create(const Glib::RefPtr<TagTable>& tag_table)
 
1572
{
 
1573
  return Glib::RefPtr<TextBuffer>( new TextBuffer(tag_table) );
 
1574
}
 
1575
int TextBuffer::get_line_count() const
 
1576
{
 
1577
  return gtk_text_buffer_get_line_count(const_cast<GtkTextBuffer*>(gobj()));
 
1578
}
 
1579
 
 
1580
int TextBuffer::get_char_count() const
 
1581
{
 
1582
  return gtk_text_buffer_get_char_count(const_cast<GtkTextBuffer*>(gobj()));
 
1583
}
 
1584
 
 
1585
Glib::RefPtr<TextBuffer::TagTable> TextBuffer::get_tag_table()
 
1586
{
 
1587
 
 
1588
  Glib::RefPtr<TextBuffer::TagTable> retvalue = Glib::wrap(gtk_text_buffer_get_tag_table(gobj()));
 
1589
  if(retvalue)
 
1590
    retvalue->reference(); //The function does not do a ref for us.
 
1591
  return retvalue;
 
1592
 
 
1593
}
 
1594
 
 
1595
Glib::RefPtr<const TextBuffer::TagTable> TextBuffer::get_tag_table() const
 
1596
{
 
1597
  return const_cast<TextBuffer*>(this)->get_tag_table();
 
1598
}
 
1599
 
 
1600
Glib::ustring TextBuffer::get_text(const iterator& start, const iterator& end, bool include_hidden_chars) const
 
1601
{
 
1602
  return Glib::convert_return_gchar_ptr_to_ustring(gtk_text_buffer_get_text(const_cast<GtkTextBuffer*>(gobj()), (start).gobj(), (end).gobj(), static_cast<int>(include_hidden_chars)));
 
1603
}
 
1604
 
 
1605
Glib::ustring TextBuffer::get_slice(const iterator& start, const iterator& end, bool include_hidden_chars) const
 
1606
{
 
1607
  return Glib::convert_return_gchar_ptr_to_ustring(gtk_text_buffer_get_slice(const_cast<GtkTextBuffer*>(gobj()), (start).gobj(), (end).gobj(), static_cast<int>(include_hidden_chars)));
 
1608
}
 
1609
 
 
1610
void TextBuffer::add_mark(const Glib::RefPtr<TextBuffer::Mark>& mark, const iterator& where)
 
1611
{
 
1612
gtk_text_buffer_add_mark(gobj(), Glib::unwrap(mark), (where).gobj()); 
 
1613
}
 
1614
 
 
1615
Glib::RefPtr<TextBuffer::Mark> TextBuffer::create_mark(const Glib::ustring& mark_name, const iterator& where, bool left_gravity)
 
1616
{
 
1617
 
 
1618
  Glib::RefPtr<TextBuffer::Mark> retvalue = Glib::wrap(gtk_text_buffer_create_mark(gobj(), mark_name.c_str(), (where).gobj(), static_cast<int>(left_gravity)));
 
1619
  if(retvalue)
 
1620
    retvalue->reference(); //The function does not do a ref for us.
 
1621
  return retvalue;
 
1622
 
 
1623
}
 
1624
 
 
1625
void TextBuffer::move_mark(const Glib::RefPtr<Mark>& mark, const iterator& where)
 
1626
{
 
1627
gtk_text_buffer_move_mark(gobj(), Glib::unwrap(mark), (where).gobj()); 
 
1628
}
 
1629
 
 
1630
void TextBuffer::delete_mark(const Glib::RefPtr<Mark>& mark)
 
1631
{
 
1632
gtk_text_buffer_delete_mark(gobj(), Glib::unwrap(mark)); 
 
1633
}
 
1634
 
 
1635
Glib::RefPtr<TextBuffer::Mark> TextBuffer::get_mark(const Glib::ustring& name)
 
1636
{
 
1637
 
 
1638
  Glib::RefPtr<TextBuffer::Mark> retvalue = Glib::wrap(gtk_text_buffer_get_mark(gobj(), name.c_str()));
 
1639
  if(retvalue)
 
1640
    retvalue->reference(); //The function does not do a ref for us.
 
1641
  return retvalue;
 
1642
 
 
1643
}
 
1644
 
 
1645
Glib::RefPtr<const TextBuffer::Mark> TextBuffer::get_mark(const Glib::ustring& name) const
 
1646
{
 
1647
  return const_cast<TextBuffer*>(this)->get_mark(name);
 
1648
}
 
1649
 
 
1650
void TextBuffer::move_mark_by_name(const Glib::ustring& name, const iterator& where)
 
1651
{
 
1652
gtk_text_buffer_move_mark_by_name(gobj(), name.c_str(), (where).gobj()); 
 
1653
}
 
1654
 
 
1655
void TextBuffer::delete_mark_by_name(const Glib::ustring& name)
 
1656
{
 
1657
gtk_text_buffer_delete_mark_by_name(gobj(), name.c_str()); 
 
1658
}
 
1659
 
 
1660
Glib::RefPtr<TextBuffer::Mark> TextBuffer::get_insert()
 
1661
{
 
1662
 
 
1663
  Glib::RefPtr<TextBuffer::Mark> retvalue = Glib::wrap(gtk_text_buffer_get_insert(gobj()));
 
1664
  if(retvalue)
 
1665
    retvalue->reference(); //The function does not do a ref for us.
 
1666
  return retvalue;
 
1667
 
 
1668
}
 
1669
 
 
1670
Glib::RefPtr<TextBuffer::Mark> TextBuffer::get_selection_bound()
 
1671
{
 
1672
 
 
1673
  Glib::RefPtr<TextBuffer::Mark> retvalue = Glib::wrap(gtk_text_buffer_get_selection_bound(gobj()));
 
1674
  if(retvalue)
 
1675
    retvalue->reference(); //The function does not do a ref for us.
 
1676
  return retvalue;
 
1677
 
 
1678
}
 
1679
 
 
1680
void TextBuffer::place_cursor(const iterator& where)
 
1681
{
 
1682
gtk_text_buffer_place_cursor(gobj(), (where).gobj()); 
 
1683
}
 
1684
 
 
1685
void TextBuffer::apply_tag(const Glib::RefPtr<Tag>& tag, const iterator& start, const iterator& end)
 
1686
{
 
1687
gtk_text_buffer_apply_tag(gobj(), Glib::unwrap(tag), (start).gobj(), (end).gobj()); 
 
1688
}
 
1689
 
 
1690
void TextBuffer::remove_tag(const Glib::RefPtr<Tag>& tag, const iterator& start, const iterator& end)
 
1691
{
 
1692
gtk_text_buffer_remove_tag(gobj(), Glib::unwrap(tag), (start).gobj(), (end).gobj()); 
 
1693
}
 
1694
 
 
1695
void TextBuffer::apply_tag_by_name(const Glib::ustring& name, const iterator& start, const iterator& end)
 
1696
{
 
1697
gtk_text_buffer_apply_tag_by_name(gobj(), name.c_str(), (start).gobj(), (end).gobj()); 
 
1698
}
 
1699
 
 
1700
void TextBuffer::remove_tag_by_name(const Glib::ustring& name, const iterator& start, const iterator& end)
 
1701
{
 
1702
gtk_text_buffer_remove_tag_by_name(gobj(), name.c_str(), (start).gobj(), (end).gobj()); 
 
1703
}
 
1704
 
 
1705
void TextBuffer::remove_all_tags(const iterator& start, const iterator& end)
 
1706
{
 
1707
gtk_text_buffer_remove_all_tags(gobj(), (start).gobj(), (end).gobj()); 
 
1708
}
 
1709
 
 
1710
bool TextBuffer::get_modified() const
 
1711
{
 
1712
  return gtk_text_buffer_get_modified(const_cast<GtkTextBuffer*>(gobj()));
 
1713
}
 
1714
 
 
1715
void TextBuffer::set_modified(bool setting)
 
1716
{
 
1717
gtk_text_buffer_set_modified(gobj(), static_cast<int>(setting)); 
 
1718
}
 
1719
 
 
1720
bool TextBuffer::get_has_selection() const
 
1721
{
 
1722
  return gtk_text_buffer_get_has_selection(const_cast<GtkTextBuffer*>(gobj()));
 
1723
}
 
1724
 
 
1725
void TextBuffer::add_selection_clipboard(const Glib::RefPtr<Clipboard>& clipboard)
 
1726
{
 
1727
gtk_text_buffer_add_selection_clipboard(gobj(), Glib::unwrap(clipboard)); 
 
1728
}
 
1729
 
 
1730
void TextBuffer::remove_selection_clipboard(const Glib::RefPtr<Clipboard>& clipboard)
 
1731
{
 
1732
gtk_text_buffer_remove_selection_clipboard(gobj(), Glib::unwrap(clipboard)); 
 
1733
}
 
1734
 
 
1735
void TextBuffer::cut_clipboard(const Glib::RefPtr<Clipboard>& clipboard, bool default_editable)
 
1736
{
 
1737
gtk_text_buffer_cut_clipboard(gobj(), Glib::unwrap(clipboard), static_cast<int>(default_editable)); 
 
1738
}
 
1739
 
 
1740
void TextBuffer::copy_clipboard(const Glib::RefPtr<Clipboard>& clipboard)
 
1741
{
 
1742
gtk_text_buffer_copy_clipboard(gobj(), Glib::unwrap(clipboard)); 
 
1743
}
 
1744
 
 
1745
bool TextBuffer::get_selection_bounds(iterator& start, iterator& end) const
 
1746
{
 
1747
  return gtk_text_buffer_get_selection_bounds(const_cast<GtkTextBuffer*>(gobj()), (start).gobj(), (end).gobj());
 
1748
}
 
1749
 
 
1750
bool TextBuffer::erase_selection(bool interactive, bool default_editable)
 
1751
{
 
1752
  return gtk_text_buffer_delete_selection(gobj(), static_cast<int>(interactive), static_cast<int>(default_editable));
 
1753
}
 
1754
 
 
1755
void TextBuffer::select_range(const iterator& ins, const iterator& bound)
 
1756
{
 
1757
gtk_text_buffer_select_range(gobj(), (ins).gobj(), (bound).gobj()); 
 
1758
}
 
1759
 
 
1760
void TextBuffer::begin_user_action()
 
1761
{
 
1762
gtk_text_buffer_begin_user_action(gobj()); 
 
1763
}
 
1764
 
 
1765
void TextBuffer::end_user_action()
 
1766
{
 
1767
gtk_text_buffer_end_user_action(gobj()); 
 
1768
}
 
1769
 
 
1770
Glib::RefPtr<TargetList> TextBuffer::get_copy_target_list() const
 
1771
{
 
1772
 
 
1773
  Glib::RefPtr<TargetList> retvalue = Glib::wrap(gtk_text_buffer_get_copy_target_list(const_cast<GtkTextBuffer*>(gobj())));
 
1774
  if(retvalue)
 
1775
    retvalue->reference(); //The function does not do a ref for us.
 
1776
  return retvalue;
 
1777
 
 
1778
}
 
1779
 
 
1780
Glib::RefPtr<TargetList> TextBuffer::get_paste_target_list() const
 
1781
{
 
1782
 
 
1783
  Glib::RefPtr<TargetList> retvalue = Glib::wrap(gtk_text_buffer_get_paste_target_list(const_cast<GtkTextBuffer*>(gobj())));
 
1784
  if(retvalue)
 
1785
    retvalue->reference(); //The function does not do a ref for us.
 
1786
  return retvalue;
 
1787
 
 
1788
}
 
1789
 
 
1790
Glib::ustring TextBuffer::register_serialize_tagset(const Glib::ustring& tagset_name)
 
1791
{
 
1792
  return Gdk::AtomString::to_cpp_type(gtk_text_buffer_register_serialize_tagset(gobj(), tagset_name.c_str()));
 
1793
}
 
1794
 
 
1795
Glib::ustring TextBuffer::register_deserialize_tagset(const Glib::ustring& tagset_name)
 
1796
{
 
1797
  return Gdk::AtomString::to_cpp_type(gtk_text_buffer_register_deserialize_tagset(gobj(), tagset_name.c_str()));
 
1798
}
 
1799
 
 
1800
void TextBuffer::unregister_serialize_format(const Glib::ustring& format)
 
1801
{
 
1802
gtk_text_buffer_unregister_serialize_format(gobj(), Gdk::AtomString::to_c_type(format)); 
 
1803
}
 
1804
 
 
1805
void TextBuffer::unregister_deserialize_format(const Glib::ustring& format)
 
1806
{
 
1807
gtk_text_buffer_unregister_deserialize_format(gobj(), Gdk::AtomString::to_c_type(format)); 
 
1808
}
 
1809
 
 
1810
void TextBuffer::set_can_create_tags(const Glib::ustring& format, bool can_create_tags)
 
1811
{
 
1812
gtk_text_buffer_deserialize_set_can_create_tags(gobj(), Gdk::AtomString::to_c_type(format), static_cast<int>(can_create_tags)); 
 
1813
}
 
1814
 
 
1815
bool TextBuffer::get_can_create_tags(const Glib::ustring& format) const
 
1816
{
 
1817
  return gtk_text_buffer_deserialize_get_can_create_tags(const_cast<GtkTextBuffer*>(gobj()), Gdk::AtomString::to_c_type(format));
 
1818
}
 
1819
 
 
1820
 
 
1821
Glib::SignalProxy3< void,const TextBuffer::iterator&,const Glib::ustring&,int > TextBuffer::signal_insert()
 
1822
{
 
1823
  return Glib::SignalProxy3< void,const TextBuffer::iterator&,const Glib::ustring&,int >(this, &TextBuffer_signal_insert_info);
 
1824
}
 
1825
 
 
1826
 
 
1827
Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<Gdk::Pixbuf>& > TextBuffer::signal_insert_pixbuf()
 
1828
{
 
1829
  return Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<Gdk::Pixbuf>& >(this, &TextBuffer_signal_insert_pixbuf_info);
 
1830
}
 
1831
 
 
1832
 
 
1833
Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<ChildAnchor>& > TextBuffer::signal_insert_child_anchor()
 
1834
{
 
1835
  return Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<ChildAnchor>& >(this, &TextBuffer_signal_insert_child_anchor_info);
 
1836
}
 
1837
 
 
1838
 
 
1839
Glib::SignalProxy2< void,const TextBuffer::iterator&,const TextBuffer::iterator& > TextBuffer::signal_erase()
 
1840
{
 
1841
  return Glib::SignalProxy2< void,const TextBuffer::iterator&,const TextBuffer::iterator& >(this, &TextBuffer_signal_erase_info);
 
1842
}
 
1843
 
 
1844
 
 
1845
Glib::SignalProxy0< void > TextBuffer::signal_changed()
 
1846
{
 
1847
  return Glib::SignalProxy0< void >(this, &TextBuffer_signal_changed_info);
 
1848
}
 
1849
 
 
1850
 
 
1851
Glib::SignalProxy0< void > TextBuffer::signal_modified_changed()
 
1852
{
 
1853
  return Glib::SignalProxy0< void >(this, &TextBuffer_signal_modified_changed_info);
 
1854
}
 
1855
 
 
1856
 
 
1857
Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<TextBuffer::Mark>& > TextBuffer::signal_mark_set()
 
1858
{
 
1859
  return Glib::SignalProxy2< void,const TextBuffer::iterator&,const Glib::RefPtr<TextBuffer::Mark>& >(this, &TextBuffer_signal_mark_set_info);
 
1860
}
 
1861
 
 
1862
 
 
1863
Glib::SignalProxy1< void,const Glib::RefPtr<TextBuffer::Mark>& > TextBuffer::signal_mark_deleted()
 
1864
{
 
1865
  return Glib::SignalProxy1< void,const Glib::RefPtr<TextBuffer::Mark>& >(this, &TextBuffer_signal_mark_deleted_info);
 
1866
}
 
1867
 
 
1868
 
 
1869
Glib::SignalProxy3< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& > TextBuffer::signal_apply_tag()
 
1870
{
 
1871
  return Glib::SignalProxy3< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& >(this, &TextBuffer_signal_apply_tag_info);
 
1872
}
 
1873
 
 
1874
 
 
1875
Glib::SignalProxy3< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& > TextBuffer::signal_remove_tag()
 
1876
{
 
1877
  return Glib::SignalProxy3< void,const Glib::RefPtr<TextBuffer::Tag>&,const TextBuffer::iterator&,const TextBuffer::iterator& >(this, &TextBuffer_signal_remove_tag_info);
 
1878
}
 
1879
 
 
1880
 
 
1881
Glib::SignalProxy0< void > TextBuffer::signal_begin_user_action()
 
1882
{
 
1883
  return Glib::SignalProxy0< void >(this, &TextBuffer_signal_begin_user_action_info);
 
1884
}
 
1885
 
 
1886
 
 
1887
Glib::SignalProxy0< void > TextBuffer::signal_end_user_action()
 
1888
{
 
1889
  return Glib::SignalProxy0< void >(this, &TextBuffer_signal_end_user_action_info);
 
1890
}
 
1891
 
 
1892
 
 
1893
Glib::SignalProxy1< void,const Glib::RefPtr<Gtk::Clipboard>& > TextBuffer::signal_paste_done()
 
1894
{
 
1895
  return Glib::SignalProxy1< void,const Glib::RefPtr<Gtk::Clipboard>& >(this, &TextBuffer_signal_paste_done_info);
 
1896
}
 
1897
 
 
1898
 
 
1899
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1900
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TextBuffer::TagTable> > TextBuffer::property_tag_table() const
 
1901
{
 
1902
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TextBuffer::TagTable> >(this, "tag-table");
 
1903
}
 
1904
#endif //GLIBMM_PROPERTIES_ENABLED
 
1905
 
 
1906
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1907
Glib::PropertyProxy<Glib::ustring> TextBuffer::property_text() 
 
1908
{
 
1909
  return Glib::PropertyProxy<Glib::ustring>(this, "text");
 
1910
}
 
1911
#endif //GLIBMM_PROPERTIES_ENABLED
 
1912
 
 
1913
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1914
Glib::PropertyProxy_ReadOnly<Glib::ustring> TextBuffer::property_text() const
 
1915
{
 
1916
  return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "text");
 
1917
}
 
1918
#endif //GLIBMM_PROPERTIES_ENABLED
 
1919
 
 
1920
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1921
Glib::PropertyProxy_ReadOnly<bool> TextBuffer::property_has_selection() const
 
1922
{
 
1923
  return Glib::PropertyProxy_ReadOnly<bool>(this, "has-selection");
 
1924
}
 
1925
#endif //GLIBMM_PROPERTIES_ENABLED
 
1926
 
 
1927
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1928
Glib::PropertyProxy_ReadOnly<int> TextBuffer::property_cursor_position() const
 
1929
{
 
1930
  return Glib::PropertyProxy_ReadOnly<int>(this, "cursor-position");
 
1931
}
 
1932
#endif //GLIBMM_PROPERTIES_ENABLED
 
1933
 
 
1934
 
 
1935
void Gtk::TextBuffer::on_insert(const TextBuffer::iterator& pos, const Glib::ustring& text, int bytes)
 
1936
{
 
1937
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1938
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
1939
  );
 
1940
 
 
1941
  if(base && base->insert_text)
 
1942
    (*base->insert_text)(gobj(),const_cast<GtkTextIter*>((pos).gobj()),text.c_str(),bytes);
 
1943
}
 
1944
void Gtk::TextBuffer::on_insert_pixbuf(const TextBuffer::iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
 
1945
{
 
1946
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1947
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
1948
  );
 
1949
 
 
1950
  if(base && base->insert_pixbuf)
 
1951
    (*base->insert_pixbuf)(gobj(),const_cast<GtkTextIter*>((pos).gobj()),Glib::unwrap(pixbuf));
 
1952
}
 
1953
void Gtk::TextBuffer::on_insert_child_anchor(const TextBuffer::iterator& pos, const Glib::RefPtr<ChildAnchor>& anchor)
 
1954
{
 
1955
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1956
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
1957
  );
 
1958
 
 
1959
  if(base && base->insert_child_anchor)
 
1960
    (*base->insert_child_anchor)(gobj(),const_cast<GtkTextIter*>((pos).gobj()),Glib::unwrap(anchor));
 
1961
}
 
1962
void Gtk::TextBuffer::on_erase(const TextBuffer::iterator& start, const TextBuffer::iterator& end)
 
1963
{
 
1964
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1965
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
1966
  );
 
1967
 
 
1968
  if(base && base->delete_range)
 
1969
    (*base->delete_range)(gobj(),const_cast<GtkTextIter*>((start).gobj()),const_cast<GtkTextIter*>((end).gobj()));
 
1970
}
 
1971
void Gtk::TextBuffer::on_changed()
 
1972
{
 
1973
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1974
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
1975
  );
 
1976
 
 
1977
  if(base && base->changed)
 
1978
    (*base->changed)(gobj());
 
1979
}
 
1980
void Gtk::TextBuffer::on_modified_changed()
 
1981
{
 
1982
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1983
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
1984
  );
 
1985
 
 
1986
  if(base && base->modified_changed)
 
1987
    (*base->modified_changed)(gobj());
 
1988
}
 
1989
void Gtk::TextBuffer::on_mark_set(const TextBuffer::iterator& location, const Glib::RefPtr<TextBuffer::Mark>& mark)
 
1990
{
 
1991
  BaseClassType *const base = static_cast<BaseClassType*>(
 
1992
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
1993
  );
 
1994
 
 
1995
  if(base && base->mark_set)
 
1996
    (*base->mark_set)(gobj(),(location).gobj(),Glib::unwrap(mark));
 
1997
}
 
1998
void Gtk::TextBuffer::on_mark_deleted(const Glib::RefPtr<TextBuffer::Mark>& mark)
 
1999
{
 
2000
  BaseClassType *const base = static_cast<BaseClassType*>(
 
2001
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
2002
  );
 
2003
 
 
2004
  if(base && base->mark_deleted)
 
2005
    (*base->mark_deleted)(gobj(),Glib::unwrap(mark));
 
2006
}
 
2007
void Gtk::TextBuffer::on_apply_tag(const Glib::RefPtr<TextBuffer::Tag>& tag, const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end)
 
2008
{
 
2009
  BaseClassType *const base = static_cast<BaseClassType*>(
 
2010
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
2011
  );
 
2012
 
 
2013
  if(base && base->apply_tag)
 
2014
    (*base->apply_tag)(gobj(),Glib::unwrap(tag),(range_begin).gobj(),(range_end).gobj());
 
2015
}
 
2016
void Gtk::TextBuffer::on_remove_tag(const Glib::RefPtr<TextBuffer::Tag>& tag, const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end)
 
2017
{
 
2018
  BaseClassType *const base = static_cast<BaseClassType*>(
 
2019
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
2020
  );
 
2021
 
 
2022
  if(base && base->remove_tag)
 
2023
    (*base->remove_tag)(gobj(),Glib::unwrap(tag),(range_begin).gobj(),(range_end).gobj());
 
2024
}
 
2025
void Gtk::TextBuffer::on_begin_user_action()
 
2026
{
 
2027
  BaseClassType *const base = static_cast<BaseClassType*>(
 
2028
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
2029
  );
 
2030
 
 
2031
  if(base && base->begin_user_action)
 
2032
    (*base->begin_user_action)(gobj());
 
2033
}
 
2034
void Gtk::TextBuffer::on_end_user_action()
 
2035
{
 
2036
  BaseClassType *const base = static_cast<BaseClassType*>(
 
2037
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
2038
  );
 
2039
 
 
2040
  if(base && base->end_user_action)
 
2041
    (*base->end_user_action)(gobj());
 
2042
}
 
2043
void Gtk::TextBuffer::on_paste_done(const Glib::RefPtr<Gtk::Clipboard>& clipboard)
 
2044
{
 
2045
  BaseClassType *const base = static_cast<BaseClassType*>(
 
2046
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
 
2047
  );
 
2048
 
 
2049
  if(base && base->paste_done)
 
2050
    (*base->paste_done)(gobj(),Glib::unwrap(clipboard));
 
2051
}
 
2052
 
 
2053
 
 
2054
} // namespace Gtk
 
2055
 
 
2056