2 /* $Id: textiter.ccg,v 1.3 2005/01/06 20:49:07 murrayc Exp $ */
4 /* Copyright 1998-2002 The gtkmm Development Team
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <gtkmm/texttag.h>
22 #include <gtkmm/textbuffer.h>
27 /**** Gtk::TextIter ********************************************************/
31 bool TextIter::get_attributes(TextAttributes& values) const
33 // The initialization is not strictly necessary and omitting it
34 // prevents a gcc-3.2 warning since { 0, } doesn't specifically
35 // initialize all members.
36 GtkTextAttributes gattributes; // = { 0, }
38 const bool result = gtk_text_iter_get_attributes(gobj(), &gattributes);
39 values = TextAttributes(&gattributes, true); //true = take_copy.
43 bool TextIter::begins_tag() const
45 return gtk_text_iter_begins_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
48 bool TextIter::ends_tag() const
50 return gtk_text_iter_ends_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
53 bool TextIter::toggles_tag() const
55 return gtk_text_iter_toggles_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
58 bool TextIter::has_tag() const
60 return gtk_text_iter_has_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
63 bool TextIter::forward_search(const Glib::ustring& str, TextSearchFlags flags, TextIter& match_start, TextIter& match_end) const
65 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 */);
68 bool TextIter::backward_search(const Glib::ustring& str, TextSearchFlags flags, TextIter& match_start, TextIter& match_end) const
70 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 */);