1// -*- c++ -*-
2/* $Id: textiter.ccg,v 1.3 2005/01/06 20:49:07 murrayc Exp $ */
3
4/* Copyright 1998-2002 The gtkmm Development Team
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
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 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser 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.
19 */
20
21#include <gtkmm/texttag.h>
22#include <gtkmm/textbuffer.h>
23
24namespace Gtk
25{
26
27/**** Gtk::TextIter ********************************************************/
28
29
30
31bool TextIter::get_attributes(TextAttributes& values) const
32{
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, }
37
38  const bool result = gtk_text_iter_get_attributes(gobj(), &gattributes);
39  values = TextAttributes(&gattributes, true); //true = take_copy.
40  return result;
41}
42
43bool TextIter::begins_tag() const
44{
45  return gtk_text_iter_begins_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
46}
47
48bool TextIter::ends_tag() const
49{
50  return gtk_text_iter_ends_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
51}
52
53bool TextIter::toggles_tag() const
54{
55  return gtk_text_iter_toggles_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
56}
57
58bool TextIter::has_tag() const
59{
60  return gtk_text_iter_has_tag(const_cast<GtkTextIter*>(gobj()), 0 /* see C docs */);
61}
62
63bool TextIter::forward_search(const Glib::ustring& str, TextSearchFlags flags, TextIter& match_start, TextIter& match_end) const
64{
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 */);
66}
67
68bool TextIter::backward_search(const Glib::ustring& str, TextSearchFlags flags, TextIter& match_start, TextIter& match_end) const
69{
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 */);
71}
72
73
74} // namespace Gtk
75
76