Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / textiter.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/textiter.h>
4 #include <gtkmm/private/textiter_p.h>
5
6 #include <gtk/gtktypebuiltins.h>
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* Copyright 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 Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
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  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26
27 #include <gtkmm/texttag.h>
28 #include <gtkmm/textbuffer.h>
29
30 namespace Gtk
31 {
32
33 /**** Gtk::TextIter ********************************************************/
34
35
36 bool TextIter::get_attributes(TextAttributes& values) const
37 {
38   // The initialization is not strictly necessary and omitting it
39   // prevents a gcc-3.2 warning since { 0, } doesn't specifically
40   // initialize all members.
41   GtkTextAttributes gattributes; // = { 0, }
42
43   const bool result = gtk_text_iter_get_attributes(gobj(), &gattributes);
44   values = TextAttributes(&gattributes, true); //true = take_copy.
45   return result;
46 }
47
48 bool TextIter::begins_tag() const
49 {
50   return gtk_text_iter_begins_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
51 }
52
53 bool TextIter::ends_tag() const
54 {
55   return gtk_text_iter_ends_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
56 }
57
58 bool TextIter::toggles_tag() const
59 {
60   return gtk_text_iter_toggles_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
61 }
62
63 bool TextIter::has_tag() const
64 {
65   return gtk_text_iter_has_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
66 }
67
68 bool TextIter::forward_search(const Glib::ustring& str, TextSearchFlags flags, TextIter& match_start, TextIter& match_end) const
69 {
70   return gtk_text_iter_forward_search(const_cast<GtkTextIter*>(gobj()), str.c_str(), ((GtkTextSearchFlags)(flags)), (match_start).gobj(), (match_end).gobj(), 0 /* means end() - see C docs */);
71 }
72
73 bool TextIter::backward_search(const Glib::ustring& str, TextSearchFlags flags, TextIter& match_start, TextIter& match_end) const
74 {
75   return gtk_text_iter_backward_search(const_cast<GtkTextIter*>(gobj()), str.c_str(), ((GtkTextSearchFlags)(flags)), (match_start).gobj(), (match_end).gobj(), 0 /* means end - see C docs */);
76 }
77   
78
79 } // namespace Gtk
80
81
82 namespace
83 {
84 } // anonymous namespace
85
86 // static
87 GType Glib::Value<Gtk::TextSearchFlags>::value_type()
88 {
89   return gtk_text_search_flags_get_type();
90 }
91
92
93 namespace Glib
94 {
95
96 Gtk::TextIter& wrap(GtkTextIter* object)
97 {
98   return *reinterpret_cast<Gtk::TextIter*>(object);
99 }
100
101 const Gtk::TextIter& wrap(const GtkTextIter* object)
102 {
103   return *reinterpret_cast<const Gtk::TextIter*>(object);
104 }
105
106 } // namespace Glib
107
108
109 namespace Gtk
110 {
111
112
113 // static
114 GType TextIter::get_type()
115 {
116   return gtk_text_iter_get_type();
117 }
118
119 TextIter::TextIter()
120 {
121   GLIBMM_INITIALIZE_STRUCT(gobject_, GtkTextIter);
122 }
123
124 TextIter::TextIter(const GtkTextIter* gobject)
125 {
126   if(gobject)
127     gobject_ = *gobject;
128   else
129     GLIBMM_INITIALIZE_STRUCT(gobject_, GtkTextIter);
130 }
131
132
133 bool TextIter::forward_find_char_impl(GtkTextCharPredicate predicate, void* user_data, const GtkTextIter* limit)
134 {
135   return gtk_text_iter_forward_find_char(gobj(), predicate, user_data, limit);
136 }
137
138 bool TextIter::backward_find_char_impl(GtkTextCharPredicate predicate, void* user_data, const GtkTextIter* limit)
139 {
140   return gtk_text_iter_backward_find_char(gobj(), predicate, user_data, limit);
141 }
142
143 Glib::RefPtr<TextBuffer> TextIter::get_buffer() const
144 {
145
146   Glib::RefPtr<TextBuffer> retvalue = Glib::wrap(gtk_text_iter_get_buffer(const_cast<GtkTextIter*>(gobj())));
147
148   if(retvalue)
149     retvalue->reference(); //The function does not do a ref for us.
150   return retvalue;
151 }
152
153 int TextIter::get_offset() const
154 {
155   return gtk_text_iter_get_offset(const_cast<GtkTextIter*>(gobj()));
156 }
157
158 int TextIter::get_line() const
159 {
160   return gtk_text_iter_get_line(const_cast<GtkTextIter*>(gobj()));
161 }
162
163 int TextIter::get_line_offset() const
164 {
165   return gtk_text_iter_get_line_offset(const_cast<GtkTextIter*>(gobj()));
166 }
167
168 int TextIter::get_line_index() const
169 {
170   return gtk_text_iter_get_line_index(const_cast<GtkTextIter*>(gobj()));
171 }
172
173 int TextIter::get_visible_line_offset() const
174 {
175   return gtk_text_iter_get_visible_line_offset(const_cast<GtkTextIter*>(gobj()));
176 }
177
178 int TextIter::get_visible_line_index() const
179 {
180   return gtk_text_iter_get_visible_line_index(const_cast<GtkTextIter*>(gobj()));
181 }
182
183 gunichar TextIter::get_char() const
184 {
185   return gtk_text_iter_get_char(const_cast<GtkTextIter*>(gobj()));
186 }
187
188 Glib::ustring TextIter::get_slice(const TextIter& end) const
189 {
190   return Glib::convert_return_gchar_ptr_to_ustring(gtk_text_iter_get_slice(const_cast<GtkTextIter*>(gobj()), (end).gobj()));
191 }
192
193 Glib::ustring TextIter::get_text(const TextIter& end) const
194 {
195   return Glib::convert_return_gchar_ptr_to_ustring(gtk_text_iter_get_text(const_cast<GtkTextIter*>(gobj()), (end).gobj()));
196 }
197
198 Glib::ustring TextIter::get_visible_slice(const TextIter& end) const
199 {
200   return Glib::convert_return_gchar_ptr_to_ustring(gtk_text_iter_get_visible_slice(const_cast<GtkTextIter*>(gobj()), (end).gobj()));
201 }
202
203 Glib::ustring TextIter::get_visible_text(const TextIter& end) const
204 {
205   return Glib::convert_return_gchar_ptr_to_ustring(gtk_text_iter_get_visible_text(const_cast<GtkTextIter*>(gobj()), (end).gobj()));
206 }
207
208 Glib::RefPtr<Gdk::Pixbuf> TextIter::get_pixbuf() const
209 {
210
211   Glib::RefPtr<Gdk::Pixbuf> retvalue = Glib::wrap(gtk_text_iter_get_pixbuf(const_cast<GtkTextIter*>(gobj())));
212
213   if(retvalue)
214     retvalue->reference(); //The function does not do a ref for us.
215   return retvalue;
216 }
217
218 Glib::SListHandle< Glib::RefPtr<TextMark> > TextIter::get_marks()
219 {
220   return Glib::SListHandle< Glib::RefPtr<TextMark> >(gtk_text_iter_get_marks(gobj()), Glib::OWNERSHIP_SHALLOW);
221 }
222
223 Glib::SListHandle< Glib::RefPtr<const TextMark> > TextIter::get_marks() const
224 {
225   return Glib::SListHandle< Glib::RefPtr<const TextMark> >(gtk_text_iter_get_marks(const_cast<GtkTextIter*>(gobj())), Glib::OWNERSHIP_SHALLOW);
226 }
227
228 Glib::RefPtr<TextChildAnchor> TextIter::get_child_anchor()
229 {
230
231   Glib::RefPtr<TextChildAnchor> retvalue = Glib::wrap(gtk_text_iter_get_child_anchor(gobj()));
232
233   if(retvalue)
234     retvalue->reference(); //The function does not do a ref for us.
235   return retvalue;
236 }
237
238 Glib::RefPtr<const TextChildAnchor> TextIter::get_child_anchor() const
239 {
240
241   Glib::RefPtr<const TextChildAnchor> retvalue = Glib::wrap(gtk_text_iter_get_child_anchor(const_cast<GtkTextIter*>(gobj())));
242
243   if(retvalue)
244     retvalue->reference(); //The function does not do a ref for us.
245   return retvalue;
246 }
247
248 Glib::SListHandle< Glib::RefPtr<TextTag> > TextIter::get_toggled_tags(bool toggled_on)
249 {
250   return Glib::SListHandle< Glib::RefPtr<TextTag> >(gtk_text_iter_get_toggled_tags(gobj(), static_cast<int>(toggled_on)), Glib::OWNERSHIP_SHALLOW);
251 }
252
253 Glib::SListHandle< Glib::RefPtr<const TextTag> > TextIter::get_toggled_tags(bool toggled_on) const
254 {
255   return Glib::SListHandle< Glib::RefPtr<const TextTag> >(gtk_text_iter_get_toggled_tags(const_cast<GtkTextIter*>(gobj()), static_cast<int>(toggled_on)), Glib::OWNERSHIP_SHALLOW);
256 }
257
258 bool TextIter::begins_tag(const Glib::RefPtr<const TextTag>& tag) const
259 {
260   return gtk_text_iter_begins_tag(const_cast<GtkTextIter*>(gobj()), const_cast<GtkTextTag*>(Glib::unwrap<TextTag>(tag)));
261 }
262
263 bool TextIter::ends_tag(const Glib::RefPtr<const TextTag>& tag) const
264 {
265   return gtk_text_iter_ends_tag(const_cast<GtkTextIter*>(gobj()), const_cast<GtkTextTag*>(Glib::unwrap<TextTag>(tag)));
266 }
267
268 bool TextIter::toggles_tag(const Glib::RefPtr<const TextTag>& tag) const
269 {
270   return gtk_text_iter_toggles_tag(const_cast<GtkTextIter*>(gobj()), const_cast<GtkTextTag*>(Glib::unwrap<TextTag>(tag)));
271 }
272
273 bool TextIter::has_tag(const Glib::RefPtr<const TextTag>& tag) const
274 {
275   return gtk_text_iter_has_tag(const_cast<GtkTextIter*>(gobj()), const_cast<GtkTextTag*>(Glib::unwrap<TextTag>(tag)));
276 }
277
278 Glib::SListHandle< Glib::RefPtr<TextTag> > TextIter::get_tags()
279 {
280   return Glib::SListHandle< Glib::RefPtr<TextTag> >(gtk_text_iter_get_tags(gobj()), Glib::OWNERSHIP_SHALLOW);
281 }
282
283 Glib::SListHandle< Glib::RefPtr<const TextTag> > TextIter::get_tags() const
284 {
285   return Glib::SListHandle< Glib::RefPtr<const TextTag> >(gtk_text_iter_get_tags(const_cast<GtkTextIter*>(gobj())), Glib::OWNERSHIP_SHALLOW);
286 }
287
288 bool TextIter::editable(bool default_setting) const
289 {
290   return gtk_text_iter_editable(const_cast<GtkTextIter*>(gobj()), static_cast<int>(default_setting));
291 }
292
293 bool TextIter::can_insert(bool default_editability) const
294 {
295   return gtk_text_iter_can_insert(const_cast<GtkTextIter*>(gobj()), static_cast<int>(default_editability));
296 }
297
298 bool TextIter::starts_word() const
299 {
300   return gtk_text_iter_starts_word(const_cast<GtkTextIter*>(gobj()));
301 }
302
303 bool TextIter::ends_word() const
304 {
305   return gtk_text_iter_ends_word(const_cast<GtkTextIter*>(gobj()));
306 }
307
308 bool TextIter::inside_word() const
309 {
310   return gtk_text_iter_inside_word(const_cast<GtkTextIter*>(gobj()));
311 }
312
313 bool TextIter::starts_sentence() const
314 {
315   return gtk_text_iter_starts_sentence(const_cast<GtkTextIter*>(gobj()));
316 }
317
318 bool TextIter::ends_sentence() const
319 {
320   return gtk_text_iter_ends_sentence(const_cast<GtkTextIter*>(gobj()));
321 }
322
323 bool TextIter::inside_sentence() const
324 {
325   return gtk_text_iter_inside_sentence(const_cast<GtkTextIter*>(gobj()));
326 }
327
328 bool TextIter::starts_line() const
329 {
330   return gtk_text_iter_starts_line(const_cast<GtkTextIter*>(gobj()));
331 }
332
333 bool TextIter::ends_line() const
334 {
335   return gtk_text_iter_ends_line(const_cast<GtkTextIter*>(gobj()));
336 }
337
338 bool TextIter::is_cursor_position() const
339 {
340   return gtk_text_iter_is_cursor_position(const_cast<GtkTextIter*>(gobj()));
341 }
342
343 int TextIter::get_chars_in_line() const
344 {
345   return gtk_text_iter_get_chars_in_line(const_cast<GtkTextIter*>(gobj()));
346 }
347
348 int TextIter::get_bytes_in_line() const
349 {
350   return gtk_text_iter_get_bytes_in_line(const_cast<GtkTextIter*>(gobj()));
351 }
352
353 Pango::Language TextIter::get_language() const
354 {
355   return Pango::Language(gtk_text_iter_get_language(const_cast<GtkTextIter*>(gobj())));
356 }
357
358 bool TextIter::is_end() const
359 {
360   return gtk_text_iter_is_end(const_cast<GtkTextIter*>(gobj()));
361 }
362
363 bool TextIter::is_start() const
364 {
365   return gtk_text_iter_is_start(const_cast<GtkTextIter*>(gobj()));
366 }
367
368 bool TextIter::forward_char()
369 {
370   return gtk_text_iter_forward_char(gobj());
371 }
372
373 bool TextIter::backward_char()
374 {
375   return gtk_text_iter_backward_char(gobj());
376 }
377
378 bool TextIter::forward_chars(int count)
379 {
380   return gtk_text_iter_forward_chars(gobj(), count);
381 }
382
383 bool TextIter::backward_chars(int count)
384 {
385   return gtk_text_iter_backward_chars(gobj(), count);
386 }
387
388 bool TextIter::forward_line()
389 {
390   return gtk_text_iter_forward_line(gobj());
391 }
392
393 bool TextIter::backward_line()
394 {
395   return gtk_text_iter_backward_line(gobj());
396 }
397
398 bool TextIter::forward_lines(int count)
399 {
400   return gtk_text_iter_forward_lines(gobj(), count);
401 }
402
403 bool TextIter::backward_lines(int count)
404 {
405   return gtk_text_iter_backward_lines(gobj(), count);
406 }
407
408 bool TextIter::forward_word_end()
409 {
410   return gtk_text_iter_forward_word_end(gobj());
411 }
412
413 bool TextIter::backward_word_start()
414 {
415   return gtk_text_iter_backward_word_start(gobj());
416 }
417
418 bool TextIter::forward_word_ends(int count)
419 {
420   return gtk_text_iter_forward_word_ends(gobj(), count);
421 }
422
423 bool TextIter::backward_word_starts(int count)
424 {
425   return gtk_text_iter_backward_word_starts(gobj(), count);
426 }
427
428 bool TextIter::forward_visible_word_end()
429 {
430   return gtk_text_iter_forward_visible_word_end(gobj());
431 }
432
433 bool TextIter::backward_visible_word_start()
434 {
435   return gtk_text_iter_backward_visible_word_start(gobj());
436 }
437
438 bool TextIter::forward_visible_word_ends(int count)
439 {
440   return gtk_text_iter_forward_visible_word_ends(gobj(), count);
441 }
442
443 bool TextIter::backward_visible_word_starts(int count)
444 {
445   return gtk_text_iter_backward_visible_word_starts(gobj(), count);
446 }
447
448 bool TextIter::forward_sentence_end()
449 {
450   return gtk_text_iter_forward_sentence_end(gobj());
451 }
452
453 bool TextIter::backward_sentence_start()
454 {
455   return gtk_text_iter_backward_sentence_start(gobj());
456 }
457
458 bool TextIter::forward_sentence_ends(int count)
459 {
460   return gtk_text_iter_forward_sentence_ends(gobj(), count);
461 }
462
463 bool TextIter::backward_sentence_starts(int count)
464 {
465   return gtk_text_iter_backward_sentence_starts(gobj(), count);
466 }
467
468 bool TextIter::forward_cursor_position()
469 {
470   return gtk_text_iter_forward_cursor_position(gobj());
471 }
472
473 bool TextIter::backward_cursor_position()
474 {
475   return gtk_text_iter_backward_cursor_position(gobj());
476 }
477
478 bool TextIter::forward_cursor_positions(int count)
479 {
480   return gtk_text_iter_forward_cursor_positions(gobj(), count);
481 }
482
483 bool TextIter::backward_cursor_positions(int count)
484 {
485   return gtk_text_iter_backward_cursor_positions(gobj(), count);
486 }
487
488 bool TextIter::forward_visible_cursor_position()
489 {
490   return gtk_text_iter_forward_visible_cursor_position(gobj());
491 }
492
493 bool TextIter::backward_visible_cursor_position()
494 {
495   return gtk_text_iter_backward_visible_cursor_position(gobj());
496 }
497
498 bool TextIter::forward_visible_cursor_positions(int count)
499 {
500   return gtk_text_iter_forward_visible_cursor_positions(gobj(), count);
501 }
502
503 bool TextIter::backward_visible_cursor_positions(int count)
504 {
505   return gtk_text_iter_backward_visible_cursor_positions(gobj(), count);
506 }
507
508 void TextIter::set_offset(int char_offset)
509 {
510   gtk_text_iter_set_offset(gobj(), char_offset);
511 }
512
513 void TextIter::set_line(int line_number)
514 {
515   gtk_text_iter_set_line(gobj(), line_number);
516 }
517
518 void TextIter::set_line_offset(int char_on_line)
519 {
520   gtk_text_iter_set_line_offset(gobj(), char_on_line);
521 }
522
523 void TextIter::set_line_index(int byte_on_line)
524 {
525   gtk_text_iter_set_line_index(gobj(), byte_on_line);
526 }
527
528 void TextIter::forward_to_end()
529 {
530   gtk_text_iter_forward_to_end(gobj());
531 }
532
533 bool TextIter::forward_to_line_end()
534 {
535   return gtk_text_iter_forward_to_line_end(gobj());
536 }
537
538 void TextIter::set_visible_line_offset(int char_on_line)
539 {
540   gtk_text_iter_set_visible_line_offset(gobj(), char_on_line);
541 }
542
543 void TextIter::set_visible_line_index(int byte_on_line)
544 {
545   gtk_text_iter_set_visible_line_index(gobj(), byte_on_line);
546 }
547
548 bool TextIter::forward_to_tag_toggle(const Glib::RefPtr<TextTag>& tag)
549 {
550   return gtk_text_iter_forward_to_tag_toggle(gobj(), Glib::unwrap(tag));
551 }
552
553 bool TextIter::backward_to_tag_toggle(const Glib::RefPtr<TextTag>& tag)
554 {
555   return gtk_text_iter_backward_to_tag_toggle(gobj(), Glib::unwrap(tag));
556 }
557
558 bool TextIter::forward_search(const Glib::ustring& str, TextSearchFlags flags, TextIter& match_start, TextIter& match_end, const TextIter& limit) const
559 {
560   return gtk_text_iter_forward_search(const_cast<GtkTextIter*>(gobj()), str.c_str(), ((GtkTextSearchFlags)(flags)), (match_start).gobj(), (match_end).gobj(), (limit).gobj());
561 }
562
563 bool TextIter::backward_search(const Glib::ustring& str, TextSearchFlags flags, TextIter& match_start, TextIter& match_end, const TextIter& limit) const
564 {
565   return gtk_text_iter_backward_search(const_cast<GtkTextIter*>(gobj()), str.c_str(), ((GtkTextSearchFlags)(flags)), (match_start).gobj(), (match_end).gobj(), (limit).gobj());
566 }
567
568 int TextIter::compare(const TextIter& rhs) const
569 {
570   return gtk_text_iter_compare(const_cast<GtkTextIter*>(gobj()), (rhs).gobj());
571 }
572
573 bool TextIter::in_range(const TextIter& start, const TextIter& end) const
574 {
575   return gtk_text_iter_in_range(const_cast<GtkTextIter*>(gobj()), (start).gobj(), (end).gobj());
576 }
577
578 void TextIter::order(TextIter& second)
579 {
580   gtk_text_iter_order(gobj(), (second).gobj());
581 }
582
583
584 bool operator==(const TextIter& lhs, const TextIter& rhs)
585 {
586   return (gtk_text_iter_equal(lhs.gobj(), rhs.gobj()) != 0);
587 }
588
589 bool operator!=(const TextIter& lhs, const TextIter& rhs)
590 {
591   return (gtk_text_iter_equal(lhs.gobj(), rhs.gobj()) == 0);
592 }
593
594 bool operator<(const TextIter& lhs, const TextIter& rhs)
595 {
596   return (gtk_text_iter_compare(lhs.gobj(), rhs.gobj()) < 0);
597 }
598
599 bool operator>(const TextIter& lhs, const TextIter& rhs)
600 {
601   return (gtk_text_iter_compare(lhs.gobj(), rhs.gobj()) > 0);
602 }
603
604 bool operator<=(const TextIter& lhs, const TextIter& rhs)
605 {
606   return (gtk_text_iter_compare(lhs.gobj(), rhs.gobj()) <= 0);
607 }
608
609 bool operator>=(const TextIter& lhs, const TextIter& rhs)
610 {
611   return (gtk_text_iter_compare(lhs.gobj(), rhs.gobj()) >= 0);
612 }
613
614
615 } // namespace Gtk
616
617