Commit a0021967 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

fix other typo

2001-06-14  Havoc Pennington  <hp@redhat.com>

	* gtk/gtkwindow.c (window_group_cleanup_grabs): fix other typo

	* gtk/gtkwidget.c (gtk_widget_propagate_state): fix typo

	* gtk/gtktextbtree.c: don't leak node data all over the place.

	* demos/gtk-demo/main.c (main): create fontify tags for the right
	buffer

	* gtk/gtktextbuffer.c, gtk/gtktexttagtable.c: enhance docs
	to mention tags in the same table can't have the same name,
	suggested by Skip Montanaro

2001-06-11  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktexttagtable.c (gtk_text_tag_table_add): improve warning
	for trying to add two tags with same name to the tag table

	* demos/gtk-demo/main.c (main): fix colors ;-)
parent cf2fab90
2001-06-14 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (window_group_cleanup_grabs): fix other typo
* gtk/gtkwidget.c (gtk_widget_propagate_state): fix typo
* gtk/gtktextbtree.c: don't leak node data all over the place.
* demos/gtk-demo/main.c (main): create fontify tags for the right
buffer
* gtk/gtktextbuffer.c, gtk/gtktexttagtable.c: enhance docs
to mention tags in the same table can't have the same name,
suggested by Skip Montanaro
2001-06-11 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttagtable.c (gtk_text_tag_table_add): improve warning
for trying to add two tags with same name to the tag table
* demos/gtk-demo/main.c (main): fix colors ;-)
Fri Jun 8 17:56:52 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct
......
2001-06-14 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (window_group_cleanup_grabs): fix other typo
* gtk/gtkwidget.c (gtk_widget_propagate_state): fix typo
* gtk/gtktextbtree.c: don't leak node data all over the place.
* demos/gtk-demo/main.c (main): create fontify tags for the right
buffer
* gtk/gtktextbuffer.c, gtk/gtktexttagtable.c: enhance docs
to mention tags in the same table can't have the same name,
suggested by Skip Montanaro
2001-06-11 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttagtable.c (gtk_text_tag_table_add): improve warning
for trying to add two tags with same name to the tag table
* demos/gtk-demo/main.c (main): fix colors ;-)
Fri Jun 8 17:56:52 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct
......
2001-06-14 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (window_group_cleanup_grabs): fix other typo
* gtk/gtkwidget.c (gtk_widget_propagate_state): fix typo
* gtk/gtktextbtree.c: don't leak node data all over the place.
* demos/gtk-demo/main.c (main): create fontify tags for the right
buffer
* gtk/gtktextbuffer.c, gtk/gtktexttagtable.c: enhance docs
to mention tags in the same table can't have the same name,
suggested by Skip Montanaro
2001-06-11 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttagtable.c (gtk_text_tag_table_add): improve warning
for trying to add two tags with same name to the tag table
* demos/gtk-demo/main.c (main): fix colors ;-)
Fri Jun 8 17:56:52 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct
......
2001-06-14 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (window_group_cleanup_grabs): fix other typo
* gtk/gtkwidget.c (gtk_widget_propagate_state): fix typo
* gtk/gtktextbtree.c: don't leak node data all over the place.
* demos/gtk-demo/main.c (main): create fontify tags for the right
buffer
* gtk/gtktextbuffer.c, gtk/gtktexttagtable.c: enhance docs
to mention tags in the same table can't have the same name,
suggested by Skip Montanaro
2001-06-11 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttagtable.c (gtk_text_tag_table_add): improve warning
for trying to add two tags with same name to the tag table
* demos/gtk-demo/main.c (main): fix colors ;-)
Fri Jun 8 17:56:52 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct
......
2001-06-14 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (window_group_cleanup_grabs): fix other typo
* gtk/gtkwidget.c (gtk_widget_propagate_state): fix typo
* gtk/gtktextbtree.c: don't leak node data all over the place.
* demos/gtk-demo/main.c (main): create fontify tags for the right
buffer
* gtk/gtktextbuffer.c, gtk/gtktexttagtable.c: enhance docs
to mention tags in the same table can't have the same name,
suggested by Skip Montanaro
2001-06-11 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttagtable.c (gtk_text_tag_table_add): improve warning
for trying to add two tags with same name to the tag table
* demos/gtk-demo/main.c (main): fix colors ;-)
Fri Jun 8 17:56:52 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct
......
2001-06-14 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (window_group_cleanup_grabs): fix other typo
* gtk/gtkwidget.c (gtk_widget_propagate_state): fix typo
* gtk/gtktextbtree.c: don't leak node data all over the place.
* demos/gtk-demo/main.c (main): create fontify tags for the right
buffer
* gtk/gtktextbuffer.c, gtk/gtktexttagtable.c: enhance docs
to mention tags in the same table can't have the same name,
suggested by Skip Montanaro
2001-06-11 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttagtable.c (gtk_text_tag_table_add): improve warning
for trying to add two tags with same name to the tag table
* demos/gtk-demo/main.c (main): fix colors ;-)
Fri Jun 8 17:56:52 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct
......
2001-06-14 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (window_group_cleanup_grabs): fix other typo
* gtk/gtkwidget.c (gtk_widget_propagate_state): fix typo
* gtk/gtktextbtree.c: don't leak node data all over the place.
* demos/gtk-demo/main.c (main): create fontify tags for the right
buffer
* gtk/gtktextbuffer.c, gtk/gtktexttagtable.c: enhance docs
to mention tags in the same table can't have the same name,
suggested by Skip Montanaro
2001-06-11 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttagtable.c (gtk_text_tag_table_add): improve warning
for trying to add two tags with same name to the tag table
* demos/gtk-demo/main.c (main): fix colors ;-)
Fri Jun 8 17:56:52 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct
......
......@@ -347,7 +347,7 @@ fontify ()
tmp_iter = next_iter;
}
if (tag)
gtk_text_buffer_apply_tag_by_name (info_buffer, tag, &start_iter, &tmp_iter);
gtk_text_buffer_apply_tag_by_name (source_buffer, tag, &start_iter, &tmp_iter);
start_iter = tmp_iter;
start_ptr = end_ptr;
......@@ -637,13 +637,14 @@ create_text (GtkTextBuffer **buffer,
GTK_SHADOW_IN);
text_view = gtk_text_view_new ();
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
*buffer = gtk_text_buffer_new (NULL);
gtk_text_view_set_buffer (GTK_TEXT_VIEW (text_view), *buffer);
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
if (is_source)
{
font_desc = pango_font_description_from_string ("Courier 12");
......@@ -770,28 +771,28 @@ main (int argc, char **argv)
"font", "Sans 18",
NULL);
tag = gtk_text_buffer_create_tag (info_buffer, "comment",
"foreground", "blue",
NULL);
tag = gtk_text_buffer_create_tag (info_buffer, "type",
tag = gtk_text_buffer_create_tag (source_buffer, "comment",
"foreground", "red",
NULL);
tag = gtk_text_buffer_create_tag (info_buffer, "string",
"foreground", "SpringGreen3",
tag = gtk_text_buffer_create_tag (source_buffer, "type",
"foreground", "ForestGreen",
NULL);
tag = gtk_text_buffer_create_tag (source_buffer, "string",
"foreground", "RosyBrown",
"weight", PANGO_WEIGHT_BOLD,
NULL);
tag = gtk_text_buffer_create_tag (info_buffer, "control",
tag = gtk_text_buffer_create_tag (source_buffer, "control",
"foreground", "purple",
NULL);
tag = gtk_text_buffer_create_tag (info_buffer, "preprocessor",
tag = gtk_text_buffer_create_tag (source_buffer, "preprocessor",
"style", PANGO_STYLE_OBLIQUE,
"foreground", "burlywood4",
NULL);
tag = gtk_text_buffer_create_tag (info_buffer, "function",
tag = gtk_text_buffer_create_tag (source_buffer, "function",
"weight", PANGO_WEIGHT_BOLD,
"foreground", "DarkGoldenrod4",
NULL);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
gtk_widget_show_all (window);
......
......@@ -1564,6 +1564,14 @@ GtkWidget
@widget: the object which received the signal.
<!-- ##### SIGNAL GtkWidget::grab-notify ##### -->
<para>
</para>
@widget: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GtkWidget::hide ##### -->
<para>
......
......@@ -280,6 +280,8 @@ static void gtk_text_btree_node_remove_view (BTreeView
gpointer view_id);
static void gtk_text_btree_node_destroy (GtkTextBTree *tree,
GtkTextBTreeNode *node);
static void gtk_text_btree_node_free_empty (GtkTextBTree *tree,
GtkTextBTreeNode *node);
static NodeData * gtk_text_btree_node_ensure_data (GtkTextBTreeNode *node,
gpointer view_id);
static void gtk_text_btree_node_remove_data (GtkTextBTreeNode *node,
......@@ -736,7 +738,7 @@ _gtk_text_btree_delete (GtkTextIter *start,
prevnode->next = curnode->next;
}
parent->num_children--;
g_free (curnode);
gtk_text_btree_node_free_empty (tree, curnode);
curnode = parent;
}
curnode = curline->parent;
......@@ -1361,7 +1363,7 @@ _gtk_text_btree_add_view (GtkTextBTree *tree,
GtkTextLineData *line_data;
g_return_if_fail (tree != NULL);
view = g_new (BTreeView, 1);
view->view_id = layout;
......@@ -1390,14 +1392,14 @@ _gtk_text_btree_add_view (GtkTextBTree *tree,
void
_gtk_text_btree_remove_view (GtkTextBTree *tree,
gpointer view_id)
gpointer view_id)
{
BTreeView *view;
GtkTextLine *last_line;
GtkTextLineData *line_data;
g_return_if_fail (tree != NULL);
view = tree->views;
while (view != NULL)
......@@ -1557,9 +1559,9 @@ queue_tag_redisplay (GtkTextBTree *tree,
void
_gtk_text_btree_tag (const GtkTextIter *start_orig,
const GtkTextIter *end_orig,
GtkTextTag *tag,
gboolean add)
const GtkTextIter *end_orig,
GtkTextTag *tag,
gboolean add)
{
GtkTextLineSegment *seg, *prev;
GtkTextLine *cleanupline;
......@@ -1577,7 +1579,8 @@ _gtk_text_btree_tag (const GtkTextIter *start_orig,
g_return_if_fail (GTK_IS_TEXT_TAG (tag));
g_return_if_fail (_gtk_text_iter_get_btree (start_orig) ==
_gtk_text_iter_get_btree (end_orig));
g_return_if_fail (tag->table == _gtk_text_iter_get_btree (start_orig)->table);
#if 0
printf ("%s tag %s from %d to %d\n",
add ? "Adding" : "Removing",
......@@ -4408,7 +4411,7 @@ static NodeData*
node_data_new (gpointer view_id)
{
NodeData *nd;
nd = g_new (NodeData, 1);
nd->view_id = view_id;
......@@ -4423,7 +4426,6 @@ node_data_new (gpointer view_id)
static void
node_data_destroy (NodeData *nd)
{
g_free (nd);
}
......@@ -5113,6 +5115,16 @@ gtk_text_btree_node_destroy (GtkTextBTree *tree, GtkTextBTreeNode *node)
}
}
gtk_text_btree_node_free_empty (tree, node);
}
static void
gtk_text_btree_node_free_empty (GtkTextBTree *tree,
GtkTextBTreeNode *node)
{
g_return_if_fail ((node->level > 0 && node->children.node == NULL) ||
(node->level == 0 && node->children.line == NULL));
summary_list_destroy (node->summary);
node_data_list_destroy (node->node_data);
g_free (node);
......@@ -5410,8 +5422,9 @@ gtk_text_btree_rebalance (GtkTextBTree *tree,
{
tree->root_node = node->children.node;
tree->root_node->parent = NULL;
summary_list_destroy (node->summary);
g_free (node);
node->children.node = NULL;
gtk_text_btree_node_free_empty (tree, node);
}
return;
}
......@@ -5515,8 +5528,10 @@ gtk_text_btree_rebalance (GtkTextBTree *tree,
recompute_node_counts (tree, node);
node->next = other->next;
node->parent->num_children--;
summary_list_destroy (other->summary);
g_free (other);
other->children.node = NULL;
other->children.line = NULL;
gtk_text_btree_node_free_empty (tree, other);
continue;
}
......
......@@ -458,7 +458,7 @@ gtk_text_buffer_real_insert_text (GtkTextBuffer *buffer,
{
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (iter != NULL);
_gtk_text_btree_insert (iter, text, len);
g_signal_emit (G_OBJECT (buffer), signals[CHANGED], 0);
......@@ -511,7 +511,8 @@ gtk_text_buffer_insert (GtkTextBuffer *buffer,
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (iter != NULL);
g_return_if_fail (text != NULL);
g_return_if_fail (gtk_text_iter_get_buffer (iter) == buffer);
gtk_text_buffer_emit_insert (buffer, iter, text, len);
}
......@@ -569,6 +570,7 @@ gtk_text_buffer_insert_interactive (GtkTextBuffer *buffer,
{
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE);
g_return_val_if_fail (text != NULL, FALSE);
g_return_val_if_fail (gtk_text_iter_get_buffer (iter) == buffer, FALSE);
if (gtk_text_iter_editable (iter, default_editable))
{
......@@ -936,7 +938,8 @@ gtk_text_buffer_insert_range (GtkTextBuffer *buffer,
gtk_text_iter_get_buffer (end));
g_return_if_fail (gtk_text_iter_get_buffer (start)->tag_table ==
buffer->tag_table);
g_return_if_fail (gtk_text_iter_get_buffer (iter) == buffer);
gtk_text_buffer_real_insert_range (buffer, iter, start, end, FALSE);
}
......@@ -1013,7 +1016,8 @@ gtk_text_buffer_insert_with_tags (GtkTextBuffer *buffer,
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (iter != NULL);
g_return_if_fail (text != NULL);
g_return_if_fail (gtk_text_iter_get_buffer (iter) == buffer);
start_offset = gtk_text_iter_get_offset (iter);
gtk_text_buffer_insert (buffer, iter, text, len);
......@@ -1063,7 +1067,8 @@ gtk_text_buffer_insert_with_tags_by_name (GtkTextBuffer *buffer,
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (iter != NULL);
g_return_if_fail (text != NULL);
g_return_if_fail (gtk_text_iter_get_buffer (iter) == buffer);
start_offset = gtk_text_iter_get_offset (iter);
gtk_text_buffer_insert (buffer, iter, text, len);
......@@ -1174,7 +1179,9 @@ gtk_text_buffer_delete (GtkTextBuffer *buffer,
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (start != NULL);
g_return_if_fail (end != NULL);
g_return_if_fail (gtk_text_iter_get_buffer (start) == buffer);
g_return_if_fail (gtk_text_iter_get_buffer (end) == buffer);
gtk_text_buffer_emit_delete (buffer, start, end);
}
......@@ -1210,7 +1217,10 @@ gtk_text_buffer_delete_interactive (GtkTextBuffer *buffer,
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE);
g_return_val_if_fail (start_iter != NULL, FALSE);
g_return_val_if_fail (end_iter != NULL, FALSE);
g_return_val_if_fail (gtk_text_iter_get_buffer (start_iter) == buffer, FALSE);
g_return_val_if_fail (gtk_text_iter_get_buffer (end_iter) == buffer, FALSE);
gtk_text_buffer_begin_user_action (buffer);
gtk_text_iter_order (start_iter, end_iter);
......@@ -1341,7 +1351,9 @@ gtk_text_buffer_get_text (GtkTextBuffer *buffer,
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
g_return_val_if_fail (start != NULL, NULL);
g_return_val_if_fail (end != NULL, NULL);
g_return_val_if_fail (gtk_text_iter_get_buffer (start) == buffer, NULL);
g_return_val_if_fail (gtk_text_iter_get_buffer (end) == buffer, NULL);
if (include_hidden_chars)
return gtk_text_iter_get_text (start, end);
else
......@@ -1377,7 +1389,9 @@ gtk_text_buffer_get_slice (GtkTextBuffer *buffer,
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
g_return_val_if_fail (start != NULL, NULL);
g_return_val_if_fail (end != NULL, NULL);
g_return_val_if_fail (gtk_text_iter_get_buffer (start) == buffer, NULL);
g_return_val_if_fail (gtk_text_iter_get_buffer (end) == buffer, NULL);
if (include_hidden_chars)
return gtk_text_iter_get_slice (start, end);
else
......@@ -1392,7 +1406,7 @@ static void
gtk_text_buffer_real_insert_pixbuf (GtkTextBuffer *buffer,
GtkTextIter *iter,
GdkPixbuf *pixbuf)
{
{
_gtk_text_btree_insert_pixbuf (iter, pixbuf);
g_signal_emit (G_OBJECT (buffer), signals[CHANGED], 0);
......@@ -1422,7 +1436,8 @@ gtk_text_buffer_insert_pixbuf (GtkTextBuffer *buffer,
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (iter != NULL);
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
g_return_if_fail (gtk_text_iter_get_buffer (iter) == buffer);
g_signal_emit (G_OBJECT (buffer), signals[INSERT_PIXBUF], 0,
iter, pixbuf);
}
......@@ -1469,6 +1484,7 @@ gtk_text_buffer_insert_child_anchor (GtkTextBuffer *buffer,
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (iter != NULL);
g_return_if_fail (GTK_IS_TEXT_CHILD_ANCHOR (anchor));
g_return_if_fail (gtk_text_iter_get_buffer (iter) == buffer);
g_signal_emit (G_OBJECT (buffer), signals[INSERT_CHILD_ANCHOR], 0,
iter, anchor);
......@@ -1494,7 +1510,8 @@ gtk_text_buffer_create_child_anchor (GtkTextBuffer *buffer,
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
g_return_val_if_fail (iter != NULL, NULL);
g_return_val_if_fail (gtk_text_iter_get_buffer (iter) == buffer, NULL);
anchor = gtk_text_child_anchor_new ();
gtk_text_buffer_insert_child_anchor (buffer, iter, anchor);
......@@ -1559,13 +1576,15 @@ gtk_text_buffer_set_mark (GtkTextBuffer *buffer,
GtkTextIter location;
GtkTextMark *mark;
g_return_val_if_fail (gtk_text_iter_get_buffer (iter) == buffer, NULL);
mark = _gtk_text_btree_set_mark (get_btree (buffer),
existing_mark,
mark_name,
left_gravity,
iter,
should_exist);
existing_mark,
mark_name,
left_gravity,
iter,
should_exist);
if (_gtk_text_btree_mark_is_insert (get_btree (buffer), mark) ||
_gtk_text_btree_mark_is_selection_bound (get_btree (buffer), mark))
{
......@@ -1659,8 +1678,8 @@ gtk_text_buffer_get_iter_at_mark (GtkTextBuffer *buffer,
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
_gtk_text_btree_get_iter_at_mark (get_btree (buffer),
iter,
mark);
iter,
mark);
}
/**
......@@ -1900,6 +1919,9 @@ gtk_text_buffer_place_cursor (GtkTextBuffer *buffer,
*
* If @tag_name is %NULL, the tag is anonymous.
*
* If @tag_name is non-%NULL, a tag called @tag_name must not already
* exist in the tag table for this buffer.
*
* The @first_property_name argument and subsequent arguments are a list
* of properties to set on the tag, as with g_object_set().
*
......@@ -1936,6 +1958,12 @@ gtk_text_buffer_real_apply_tag (GtkTextBuffer *buffer,
const GtkTextIter *start,
const GtkTextIter *end)
{
if (tag->table != buffer->tag_table)
{
g_warning ("Can only apply tags that are in the tag table for the buffer");
return;
}
_gtk_text_btree_tag (start, end, tag, TRUE);
}
......@@ -1945,6 +1973,12 @@ gtk_text_buffer_real_remove_tag (GtkTextBuffer *buffer,
const GtkTextIter *start,
const GtkTextIter *end)
{
if (tag->table != buffer->tag_table)
{
g_warning ("Can only remove tags that are in the tag table for the buffer");
return;
}
_gtk_text_btree_tag (start, end, tag, FALSE);
}
......@@ -2001,7 +2035,10 @@ gtk_text_buffer_apply_tag (GtkTextBuffer *buffer,
g_return_if_fail (GTK_IS_TEXT_TAG (tag));
g_return_if_fail (start != NULL);
g_return_if_fail (end != NULL);
g_return_if_fail (gtk_text_iter_get_buffer (start) == buffer);
g_return_if_fail (gtk_text_iter_get_buffer (end) == buffer);
g_return_if_fail (tag->table == buffer->tag_table);
gtk_text_buffer_emit_tag (buffer, tag, TRUE, start, end);
}
......@@ -2028,7 +2065,10 @@ gtk_text_buffer_remove_tag (GtkTextBuffer *buffer,
g_return_if_fail (GTK_IS_TEXT_TAG (tag));
g_return_if_fail (start != NULL);
g_return_if_fail (end != NULL);
g_return_if_fail (gtk_text_iter_get_buffer (start) == buffer);
g_return_if_fail (gtk_text_iter_get_buffer (end) == buffer);
g_return_if_fail (tag->table == buffer->tag_table);
gtk_text_buffer_emit_tag (buffer, tag, FALSE, start, end);
}
......@@ -2056,6 +2096,8 @@ gtk_text_buffer_apply_tag_by_name (GtkTextBuffer *buffer,
g_return_if_fail (name != NULL);
g_return_if_fail (start != NULL);
g_return_if_fail (end != NULL);
g_return_if_fail (gtk_text_iter_get_buffer (start) == buffer);
g_return_if_fail (gtk_text_iter_get_buffer (end) == buffer);
tag = gtk_text_tag_table_lookup (get_table (buffer),
name);
......@@ -2093,7 +2135,9 @@ gtk_text_buffer_remove_tag_by_name (GtkTextBuffer *buffer,
g_return_if_fail (name != NULL);
g_return_if_fail (start != NULL);
g_return_if_fail (end != NULL);
g_return_if_fail (gtk_text_iter_get_buffer (start) == buffer);
g_return_if_fail (gtk_text_iter_get_buffer (end) == buffer);
tag = gtk_text_tag_table_lookup (get_table (buffer),
name);
......@@ -2144,6 +2188,8 @@ gtk_text_buffer_remove_all_tags (GtkTextBuffer *buffer,
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (start != NULL);
g_return_if_fail (end != NULL);
g_return_if_fail (gtk_text_iter_get_buffer (start) == buffer);
g_return_if_fail (gtk_text_iter_get_buffer (end) == buffer);
first = *start;
second = *end;
......
......@@ -201,7 +201,9 @@ gtk_text_tag_table_get_property (GObject *object,
*
* Add a tag to the table. The tag is assigned the highest priority
* in the table.
*
*
* @tag must not be in a tag table already, and may not have
* the same name as an already-added tag.
**/
void
gtk_text_tag_table_add (GtkTextTagTable *table,
......@@ -211,10 +213,15 @@ gtk_text_tag_table_add (GtkTextTagTable *table,
g_return_if_fail (GTK_IS_TEXT_TAG_TABLE (table));
g_return_if_fail (GTK_IS_TEXT_TAG (tag));
g_return_if_fail (tag->name == NULL ||
g_hash_table_lookup (table->hash, tag->name) == NULL);
g_return_if_fail (tag->table == NULL);
if (tag->name && g_hash_table_lookup (table->hash, tag->name))
{
g_warning ("A tag named '%s' is already in the tag table.",
tag->name);
return;
}
g_object_ref (G_OBJECT (tag));
if (tag->name)
......
......@@ -5293,7 +5293,7 @@ gtk_widget_propagate_state (GtkWidget *widget,
{
gtk_widget_ref (widget);