Debian Codegraph @

gtk/src/textiter.ccg

raw
1 /* Copyright (C) 1998-2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #include <glibmm/vectorutils.h>
18
19 #include <gtkmm/texttag.h>
20 #include <gtkmm/textbuffer.h>
21
22 namespace Gtk
23 {
24
25 /**** Gtk::TextIter ********************************************************/
26
27
28
29 bool TextIter::get_attributes(TextAttributes& values) const
30 {
31 // The initialization is not strictly necessary and omitting it
32 // prevents a gcc-3.2 warning since { 0, } doesn't specifically
33 // initialize all members.
34 GtkTextAttributes gattributes; // = { 0, }
35
36 const bool result = gtk_text_iter_get_attributes(gobj(), &gattributes);
37 values = TextAttributes(&gattributes, true); //true = take_copy.
38 return result;
39 }
40
41 bool TextIter::starts_tag() const
42 {
43 return gtk_text_iter_starts_tag(const_cast<GtkTextIter*>(gobj()), nullptr /* see C docs */);
44 }
45 _DEPRECATE_IFDEF_START
46 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
47 bool TextIter::begins_tag() const
48 {
49 return gtk_text_iter_begins_tag(const_cast<GtkTextIter*>(gobj()), nullptr /* see C docs */);
50 }
51 G_GNUC_END_IGNORE_DEPRECATIONS
52 _DEPRECATE_IFDEF_END
53
54 bool TextIter::ends_tag() const
55 {
56 return gtk_text_iter_ends_tag(const_cast<GtkTextIter*>(gobj()), nullptr /* see C docs */);
57 }
58
59 bool TextIter::toggles_tag() const
60 {
61 return gtk_text_iter_toggles_tag(const_cast<GtkTextIter*>(gobj()), nullptr /* see C docs */);
62 }
63
64 bool TextIter::has_tag() const
65 {
66 return gtk_text_iter_has_tag(const_cast<GtkTextIter*>(gobj()), nullptr /* see C docs */);
67 }
68
69 bool TextIter::forward_search(const Glib::ustring& str, TextSearchFlags flags, TextIter& match_start, TextIter& match_end) const
70 {
71 return gtk_text_iter_forward_search(const_cast<GtkTextIter*>(gobj()), str.c_str(), ((GtkTextSearchFlags)(flags)), (match_start).gobj(), (match_end).gobj(), nullptr /* means end() - see C docs */);
72 }
73
74 bool TextIter::backward_search(const Glib::ustring& str, TextSearchFlags flags, TextIter& match_start, TextIter& match_end) const
75 {
76 return gtk_text_iter_backward_search(const_cast<GtkTextIter*>(gobj()), str.c_str(), ((GtkTextSearchFlags)(flags)), (match_start).gobj(), (match_end).gobj(), nullptr /* means end - see C docs */);
77 }
78
79 } // namespace Gtk