From 25fc4d97f853b459836a1999a65832697897b728 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 31 Jul 2010 11:27:34 +0200 Subject: [PATCH] textview: remove GtkTextAttributes (un)realize code It was unused (apart from a few assertion that indeed it was unused). --- docs/reference/gtk/tmpl/gtktexttag.sgml | 1 - gtk/gtktexttag.c | 66 ------------------------- gtk/gtktexttag.h | 3 -- gtk/gtktexttagprivate.h | 10 ---- 4 files changed, 80 deletions(-) diff --git a/docs/reference/gtk/tmpl/gtktexttag.sgml b/docs/reference/gtk/tmpl/gtktexttag.sgml index c807da83e3..85203a04d9 100644 --- a/docs/reference/gtk/tmpl/gtktexttag.sgml +++ b/docs/reference/gtk/tmpl/gtktexttag.sgml @@ -398,7 +398,6 @@ modified directly. @invisible: @bg_full_height: @editable: -@realized: diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c index 9131e4179c..25928ce0d9 100644 --- a/gtk/gtktexttag.c +++ b/gtk/gtktexttag.c @@ -699,8 +699,6 @@ gtk_text_tag_finalize (GObject *object) text_tag = GTK_TEXT_TAG (object); - g_assert (!text_tag->values->realized); - if (text_tag->table) gtk_text_tag_table_remove (text_tag->table, text_tag); @@ -957,8 +955,6 @@ gtk_text_tag_set_property (GObject *object, text_tag = GTK_TEXT_TAG (object); - g_return_if_fail (!text_tag->values->realized); - switch (prop_id) { case PROP_NAME: @@ -1914,8 +1910,6 @@ gtk_text_attributes_copy_values (GtkTextAttributes *src, { guint orig_refcount; - g_return_if_fail (!dest->realized); - if (src == dest) return; @@ -1941,7 +1935,6 @@ gtk_text_attributes_copy_values (GtkTextAttributes *src, dest->pg_bg_color = gdk_color_copy (src->pg_bg_color); dest->refcount = orig_refcount; - dest->realized = FALSE; } /** @@ -1979,8 +1972,6 @@ gtk_text_attributes_unref (GtkTextAttributes *values) if (values->refcount == 0) { - g_assert (!values->realized); - if (values->tabs) pango_tab_array_free (values->tabs); @@ -1994,61 +1985,6 @@ gtk_text_attributes_unref (GtkTextAttributes *values) } } -void -_gtk_text_attributes_realize (GtkTextAttributes *values, - GdkColormap *cmap, - GdkVisual *visual) -{ - g_return_if_fail (values != NULL); - g_return_if_fail (values->refcount > 0); - g_return_if_fail (!values->realized); - - /* It is wrong to use this colormap, FIXME */ - gdk_colormap_alloc_color (cmap, - &values->appearance.fg_color, - FALSE, TRUE); - - gdk_colormap_alloc_color (cmap, - &values->appearance.bg_color, - FALSE, TRUE); - - if (values->pg_bg_color) - gdk_colormap_alloc_color (cmap, - values->pg_bg_color, - FALSE, TRUE); - - values->realized = TRUE; -} - -void -_gtk_text_attributes_unrealize (GtkTextAttributes *values, - GdkColormap *cmap, - GdkVisual *visual) -{ - g_return_if_fail (values != NULL); - g_return_if_fail (values->refcount > 0); - g_return_if_fail (values->realized); - - gdk_colormap_free_colors (cmap, - &values->appearance.fg_color, 1); - - - gdk_colormap_free_colors (cmap, - &values->appearance.bg_color, 1); - - values->appearance.fg_color.pixel = 0; - values->appearance.bg_color.pixel = 0; - - if (values->pg_bg_color) - { - gdk_colormap_free_colors (cmap, values->pg_bg_color, 1); - - values->pg_bg_color->pixel = 0; - } - - values->realized = FALSE; -} - void _gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest, GtkTextTag** tags, @@ -2059,8 +1995,6 @@ _gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest, guint left_margin_accumulative = 0; guint right_margin_accumulative = 0; - g_return_if_fail (!dest->realized); - while (n < n_tags) { GtkTextTag *tag = tags[n]; diff --git a/gtk/gtktexttag.h b/gtk/gtktexttag.h index fd74270138..d74a43bf3a 100644 --- a/gtk/gtktexttag.h +++ b/gtk/gtktexttag.h @@ -259,9 +259,6 @@ struct _GtkTextAttributes /* can edit this text */ guint editable : 1; - /* colors are allocated etc. */ - guint realized : 1; - /*< private >*/ guint pad1 : 1; guint pad2 : 1; diff --git a/gtk/gtktexttagprivate.h b/gtk/gtktexttagprivate.h index b3363d9250..afc3a9b345 100644 --- a/gtk/gtktexttagprivate.h +++ b/gtk/gtktexttagprivate.h @@ -41,16 +41,6 @@ void _gtk_text_attributes_fill_from_tags (GtkTextAttributes *values, void _gtk_text_tag_array_sort (GtkTextTag **tag_array_p, guint len); -/* ensure colors are allocated, etc. for drawing */ -void _gtk_text_attributes_realize (GtkTextAttributes *values, - GdkColormap *cmap, - GdkVisual *visual); - -/* free the stuff again */ -void _gtk_text_attributes_unrealize (GtkTextAttributes *values, - GdkColormap *cmap, - GdkVisual *visual); - gboolean _gtk_text_tag_affects_size (GtkTextTag *tag); gboolean _gtk_text_tag_affects_nonsize_appearance (GtkTextTag *tag);