forked from AuroraMiddleware/gtk
textiter: add _gtk_text_iter_same_line()
This is a faster form to compare two text iter to see if they are on the same line.
This commit is contained in:
parent
7eb5dfd294
commit
b930c5a8a2
@ -5358,6 +5358,25 @@ gtk_text_iter_equal (const GtkTextIter *lhs,
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gtk_text_iter_same_line (const GtkTextIter *lhs,
|
||||
const GtkTextIter *rhs)
|
||||
{
|
||||
GtkTextRealIter *real_lhs;
|
||||
GtkTextRealIter *real_rhs;
|
||||
|
||||
real_lhs = gtk_text_iter_make_surreal (lhs);
|
||||
real_rhs = gtk_text_iter_make_surreal (rhs);
|
||||
|
||||
if (real_lhs == NULL || real_rhs == NULL)
|
||||
return FALSE;
|
||||
|
||||
check_invariants (lhs);
|
||||
check_invariants (rhs);
|
||||
|
||||
return real_lhs->line == real_rhs->line;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_text_iter_compare:
|
||||
* @lhs: a #GtkTextIter
|
||||
|
@ -41,6 +41,8 @@ gboolean _gtk_text_iter_forward_indexable_segment (GtkTextIter
|
||||
gboolean _gtk_text_iter_backward_indexable_segment (GtkTextIter *iter);
|
||||
gint _gtk_text_iter_get_segment_byte (const GtkTextIter *iter);
|
||||
gint _gtk_text_iter_get_segment_char (const GtkTextIter *iter);
|
||||
gboolean _gtk_text_iter_same_line (const GtkTextIter *lhs,
|
||||
const GtkTextIter *rhs);
|
||||
|
||||
gboolean gtk_text_iter_get_attributes (const GtkTextIter *iter,
|
||||
GtkTextAttributes *values);
|
||||
|
Loading…
Reference in New Issue
Block a user