#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-#include "gtksignal.h"
#include "gtktexttag.h"
#include "gtktexttagtable.h"
#include "gtktextlayout.h"
/* Height and width of this node */
gint height;
- gint width : 24;
+ signed int width : 24;
/* boolean indicating whether the lines below this node are in need of validation.
* However, width/height should always represent the current total width and
* width/height on the lines needs recomputing, not whether the totals
* need recomputing.
*/
- gint valid : 8;
+ guint valid : 8; /* Actually a boolean */
};
GtkTextBuffer *buffer;
BTreeView *views;
GSList *tag_infos;
- guint tag_changed_handler;
+ gulong tag_changed_handler;
/* Incremented when a segment with a byte size > 0
* is added to or removed from the tree (i.e. the
tree->end_iter_segment_byte_index = 0;
tree->end_iter_segment_char_offset = 0;
- g_object_ref (G_OBJECT (tree->table));
+ g_object_ref (tree->table);
- tree->tag_changed_handler = g_signal_connect (G_OBJECT (tree->table),
+ tree->tag_changed_handler = g_signal_connect (tree->table,
"tag_changed",
G_CALLBACK (tag_changed_cb),
tree);
seg->body.mark.not_deleteable = TRUE;
- g_object_ref (G_OBJECT (tree->insert_mark));
- g_object_ref (G_OBJECT (tree->selection_bound_mark));
+ g_object_ref (tree->insert_mark);
+ g_object_ref (tree->selection_bound_mark);
}
tree->refcount = 1;
if (tree->refcount == 0)
{
- g_signal_handler_disconnect (G_OBJECT (tree->table),
+ g_signal_handler_disconnect (tree->table,
tree->tag_changed_handler);
- g_object_unref (G_OBJECT (tree->table));
+ g_object_unref (tree->table);
tree->table = NULL;
gtk_text_btree_node_destroy (tree, tree->root_node);
tree->child_anchor_table = NULL;
}
- g_object_unref (G_OBJECT (tree->insert_mark));
+ g_object_unref (tree->insert_mark);
tree->insert_mark = NULL;
- g_object_unref (G_OBJECT (tree->selection_bound_mark));
+ g_object_unref (tree->selection_bound_mark);
tree->selection_bound_mark = NULL;
g_free (tree);
gtk_text_iter_order (&start, &end);
- retval = g_string_new ("");
+ retval = g_string_new (NULL);
tree = _gtk_text_iter_get_btree (&start);
void
_gtk_text_btree_place_cursor (GtkTextBTree *tree,
const GtkTextIter *iter)
+{
+ _gtk_text_btree_select_range (tree, iter, iter);
+}
+
+void
+_gtk_text_btree_select_range (GtkTextBTree *tree,
+ const GtkTextIter *ins,
+ const GtkTextIter *bound)
{
GtkTextIter start, end;
/* Move insert AND selection_bound before we redisplay */
real_set_mark (tree, tree->insert_mark,
- "insert", FALSE, iter, TRUE, FALSE);
+ "insert", FALSE, ins, TRUE, FALSE);
real_set_mark (tree, tree->selection_bound_mark,
- "selection_bound", FALSE, iter, TRUE, FALSE);
+ "selection_bound", FALSE, bound, TRUE, FALSE);
}
+
void
_gtk_text_btree_remove_mark_by_name (GtkTextBTree *tree,
const gchar *name)
/* Remove the ref on the mark, which frees segment as a side effect
* if this is the last reference.
*/
- g_object_unref (G_OBJECT (segment->body.mark.obj));
+ g_object_unref (segment->body.mark.obj);
}
void
line_ancestor = line_ancestor_parent;
line_ancestor_parent = line_ancestor->parent;
- node = line_ancestor_parent->children.node;
+ if (line_ancestor_parent != NULL)
+ {
+ node = line_ancestor_parent->children.node;
+ }
}
/* No dice. */
info = g_new (GtkTextTagInfo, 1);
info->tag = tag;
- g_object_ref (G_OBJECT (tag));
+ g_object_ref (tag);
info->tag_root = NULL;
info->toggle_count = 0;
list->next = NULL;
g_slist_free (list);
- g_object_unref (G_OBJECT (info->tag));
+ g_object_unref (info->tag);
g_free (info);
return;