summaryrefslogtreecommitdiff
path: root/gtk/gtktextiter.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2000-06-02 17:27:21 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-06-02 17:27:21 +0000
commite86329d5d4640805dc46cbf07a920cb932bd54d4 (patch)
tree0d81a57ff3971f3a3f600e9a82ff2af1c63230e6 /gtk/gtktextiter.c
parentbb77f4e6b934e2ff9dbe99a73a0aad1fbdd921bc (diff)
downloadgtk+-e86329d5d4640805dc46cbf07a920cb932bd54d4.tar.gz
Test program to make sure GtkTextBuffer is in working order.
2000-06-02 Havoc Pennington <hp@pobox.com> * gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer is in working order. * gtk/testtext.c: Change to reflect anonymous mark API * gtk/gtktextview.c: Convert from mark names to GtkTextMark*. * gtk/gtktexttag.h (struct _GtkTextTag): remove the affects_size field, which was unused. * gtk/gtktextmarkprivate.h (GTK_IS_TEXT_MARK): add this macro, saves some typing. * gtk/gtktextbuffer.c: Switch from mark names to GtkTextMark* * gtk/gtktextbtree.c (gtk_text_btree_new): set the not_deleteable flag on the insertion point and selection bound Throughout, use GtkTextMark instead of GtkTextLineSegment, and make mark-manipulation functions take a GtkTextMark* instead of a mark name. * gtk/gtktextmarkprivate.h: Add a "not_deleteable" flag to GtkTextMarkBody; will be used to detect attempts to delete the permanent marks (insert and selection bound)
Diffstat (limited to 'gtk/gtktextiter.c')
-rw-r--r--gtk/gtktextiter.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c
index 41a16916c2..8cc5f783e2 100644
--- a/gtk/gtktextiter.c
+++ b/gtk/gtktextiter.c
@@ -952,7 +952,7 @@ forward_line_leaving_caches_unmodified(GtkTextRealIter *real)
g_assert(new_line != real->line);
if (new_line != NULL)
- {
+ {
real->line = new_line;
real->line_byte_offset = 0;
@@ -2153,7 +2153,7 @@ gtk_text_btree_get_iter_at_mark_name (GtkTextBTree *tree,
GtkTextIter *iter,
const gchar *mark_name)
{
- GtkTextLineSegment *mark;
+ GtkTextMark *mark;
g_return_val_if_fail(iter != NULL, FALSE);
g_return_val_if_fail(tree != NULL, FALSE);
@@ -2173,15 +2173,17 @@ gtk_text_btree_get_iter_at_mark_name (GtkTextBTree *tree,
void
gtk_text_btree_get_iter_at_mark (GtkTextBTree *tree,
GtkTextIter *iter,
- GtkTextLineSegment *mark)
+ GtkTextMark *mark)
{
+ GtkTextLineSegment *seg = (GtkTextLineSegment*) mark;
+
g_return_if_fail(iter != NULL);
g_return_if_fail(tree != NULL);
- g_return_if_fail(mark->type == &gtk_text_left_mark_type ||
- mark->type == &gtk_text_right_mark_type);
+ g_return_if_fail(GTK_IS_TEXT_MARK (mark));
- iter_init_from_segment(iter, tree, mark->body.mark.line, mark);
- g_assert(mark->body.mark.line == gtk_text_iter_get_line(iter));
+ iter_init_from_segment(iter, tree,
+ seg->body.mark.line, seg);
+ g_assert(seg->body.mark.line == gtk_text_iter_get_line(iter));
check_invariants(iter);
}