3 #ifndef _GTKMM_TEXTITER_H
4 #define _GTKMM_TEXTITER_H
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
29 #include <glibmm/exceptionhandler.h>
30 #include <glibmm/slisthandle.h>
63 {
return static_cast<TextSearchFlags>(
static_cast<unsigned>(lhs) |
static_cast<unsigned>(rhs)); }
67 {
return static_cast<TextSearchFlags>(
static_cast<unsigned>(lhs) &
static_cast<unsigned>(rhs)); }
71 {
return static_cast<TextSearchFlags>(
static_cast<unsigned>(lhs) ^
static_cast<unsigned>(rhs)); }
79 {
return (lhs =
static_cast<TextSearchFlags>(
static_cast<unsigned>(lhs) |
static_cast<unsigned>(rhs))); }
83 {
return (lhs =
static_cast<TextSearchFlags>(
static_cast<unsigned>(lhs) &
static_cast<unsigned>(rhs))); }
87 {
return (lhs =
static_cast<TextSearchFlags>(
static_cast<unsigned>(lhs) ^
static_cast<unsigned>(rhs))); }
92 #ifndef DOXYGEN_SHOULD_SKIP_THIS
100 static GType value_type() G_GNUC_CONST;
132 #ifndef DOXYGEN_SHOULD_SKIP_THIS
176 inline operator bool()
const;
178 #ifndef DOXYGEN_SHOULD_SKIP_THIS
181 template <
class Predicate>
182 struct PredicateAdapter
184 Predicate predicate_;
185 inline PredicateAdapter(
const Predicate& predicate);
186 static gboolean gtk_callback(gunichar uc,
void* user_data);
351 Glib::SListHandle< Glib::RefPtr<TextMark> >
get_marks();
361 Glib::SListHandle< Glib::RefPtr<const TextMark> >
get_marks()
const;
403 Glib::SListHandle< Glib::RefPtr<const TextTag> >
get_toggled_tags(
bool toggled_on =
true)
const;
416 bool begins_tag(
const Glib::RefPtr<const TextTag>& tag)
const;
429 bool ends_tag(
const Glib::RefPtr<const TextTag>& tag)
const;
448 bool has_tag(
const Glib::RefPtr<const TextTag>& tag)
const;
457 Glib::SListHandle< Glib::RefPtr<TextTag> >
get_tags();
464 Glib::SListHandle< Glib::RefPtr<const TextTag> >
get_tags()
const;
1141 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1143 template <
class Predicate>
inline
1144 TextIter::PredicateAdapter<Predicate>::PredicateAdapter(
const Predicate& predicate)
1146 predicate_ (predicate)
1150 template <
class Predicate>
1151 gboolean TextIter::PredicateAdapter<Predicate>::gtk_callback(gunichar uc,
void* user_data)
1158 return (
static_cast<TextIter::PredicateAdapter<Predicate>*
>(user_data)->predicate_(uc)) ? 1 : 0;
1162 Glib::exception_handlers_invoke();
1204 TextIter::operator bool()
const
1209 template <
class Predicate>
1212 typedef TextIter::PredicateAdapter<Predicate> PredAdapter;
1213 PredAdapter adapter (predicate);
1214 return this->forward_find_char_impl(&PredAdapter::gtk_callback, &adapter, limit.gobj());
1217 template <
class Predicate>
1220 typedef TextIter::PredicateAdapter<Predicate> PredAdapter;
1221 PredAdapter adapter (predicate);
1222 return this->forward_find_char_impl(&PredAdapter::gtk_callback, &adapter, 0);
1225 template <
class Predicate>
1228 typedef TextIter::PredicateAdapter<Predicate> PredAdapter;
1229 PredAdapter adapter (predicate);
1230 return this->backward_find_char_impl(&PredAdapter::gtk_callback, &adapter, limit.gobj());
1233 template <
class Predicate>
1236 typedef TextIter::PredicateAdapter<Predicate> PredAdapter;
1237 PredAdapter adapter (predicate);
1238 return this->backward_find_char_impl(&PredAdapter::gtk_callback, &adapter, 0);
1310 #ifndef DOXYGEN_SHOULD_SKIP_THIS
Glib::ustring get_visible_text(const TextIter &end) const
void set_offset(int char_offset)
bool is_cursor_position() const
bool can_insert(bool default_editability=true) const
bool backward_cursor_positions(int count)
bool operator!=(const TextIter &lhs, const TextIter &rhs)
bool toggles_tag(const Glib::RefPtr< const TextTag > &tag) const
bool forward_find_char(const Predicate &predicate, const TextIter &limit)
bool backward_word_starts(int count)
bool operator<(const TextIter &lhs, const TextIter &rhs)
bool forward_find_char(const Predicate &predicate)
bool starts_sentence() const
int get_visible_line_offset() const
int get_visible_line_index() const
bool forward_sentence_end()
bool backward_visible_line()
Glib::ustring get_slice(const TextIter &end) const
bool forward_to_line_end()
bool ends_tag(const Glib::RefPtr< const TextTag > &tag) const
bool operator>=(const TextIter &lhs, const TextIter &rhs)
std::bidirectional_iterator_tag iterator_category
Glib::RefPtr< Gdk::Pixbuf > get_pixbuf() const
bool forward_search(const Glib::ustring &str, TextSearchFlags flags, TextIter &match_start, TextIter &match_end, const TextIter &limit) const
bool begins_tag(const Glib::RefPtr< const TextTag > &tag) const
bool backward_visible_cursor_position()
bool backward_chars(int count)
void set_visible_line_index(int byte_on_line)
bool backward_visible_word_starts(int count)
bool backward_visible_lines(int count)
bool backward_visible_cursor_positions(int count)
Glib::ustring get_visible_slice(const TextIter &end) const
bool backward_search(const Glib::ustring &str, TextSearchFlags flags, TextIter &match_start, TextIter &match_end, const TextIter &limit) const
void order(TextIter &second)
bool forward_visible_line()
Gtk::TextIter & wrap(GtkTextIter *object)
bool forward_visible_line(int count)
Pango::Language get_language() const
const Gtk::TextIter & wrap(const GtkTextIter *object)
void set_line_offset(int char_on_line)
Glib::SListHandle< Glib::RefPtr< const TextTag > > get_tags() const
bool forward_visible_cursor_position()
bool forward_sentence_ends(int count)
bool inside_sentence() const
bool has_tag(const Glib::RefPtr< const TextTag > &tag) const
Glib::RefPtr< const TextChildAnchor > get_child_anchor() const
bool operator<=(const TextIter &lhs, const TextIter &rhs)
bool forward_visible_cursor_positions(int count)
bool ends_sentence() const
void set_visible_line_offset(int char_on_line)
int get_chars_in_line() const
bool backward_sentence_start()
bool backward_sentence_starts(int count)
bool operator==(const TextIter &lhs, const TextIter &rhs)
int get_line_index() const
bool forward_to_tag_toggle(const Glib::RefPtr< TextTag > &tag)
bool backward_lines(int count)
bool forward_cursor_positions(int count)
Glib::SListHandle< Glib::RefPtr< const TextTag > > get_toggled_tags(bool toggled_on=true) const
bool backward_word_start()
Glib::RefPtr< TextBuffer > get_buffer() const
value_type operator*() const
bool backward_visible_word_start()
bool backward_find_char(const Predicate &predicate)
bool forward_search(const Glib::ustring &str, TextSearchFlags flags, TextIter &match_start, TextIter &match_end) const
bool get_attributes(TextAttributes &values) const
Glib::SListHandle< Glib::RefPtr< TextMark > > get_marks()
bool forward_word_ends(int count)
bool forward_chars(int count)
static GType get_type() G_GNUC_CONST
Glib::RefPtr< TextChildAnchor > get_child_anchor()
void set_line(int line_number)
bool forward_cursor_position()
const GtkTextIter * gobj() const
Provides access to the underlying C instance.
bool forward_visible_word_end()
bool backward_cursor_position()
bool in_range(const TextIter &start, const TextIter &end) const
bool editable(bool default_setting=true) const
gunichar get_char() const
Glib::SListHandle< Glib::RefPtr< const TextMark > > get_marks() const
bool backward_find_char(const Predicate &predicate, const TextIter &limit)
bool backward_to_tag_toggle(const Glib::RefPtr< TextTag > &tag)
int get_line_offset() const
bool operator>(const TextIter &lhs, const TextIter &rhs)
bool forward_visible_word_ends(int count)
bool forward_lines(int count)
int get_bytes_in_line() const
const TextIter operator++(int)
Glib::SListHandle< Glib::RefPtr< TextTag > > get_tags()
Glib::ustring get_text(const TextIter &end) const
const TextIter operator--(int)
bool backward_search(const Glib::ustring &str, TextSearchFlags flags, TextIter &match_start, TextIter &match_end) const
int compare(const TextIter &rhs) const
Glib::SListHandle< Glib::RefPtr< TextTag > > get_toggled_tags(bool toggled_on=true)
void set_line_index(int byte_on_line)
gboolean(* GtkTextCharPredicate)(gunichar ch, gpointer user_data)
typedefG_BEGIN_DECLS struct _GtkTextIter GtkTextIter
PBD::PropertyDescriptor< timepos_t > start