diff options
author | Owen Taylor <otaylor@gtk.org> | 1998-06-15 21:27:17 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-06-15 21:27:17 +0000 |
commit | 48a9f44f3172d362eab8a0084865b42084cef383 (patch) | |
tree | 3b700a14292130d483e58d7c9164ee23826f1269 /gtk/gtktext.c | |
parent | e144ff2bb588d9e0f2c6237aaa6b9d4c3ec04d6e (diff) | |
download | gdk-pixbuf-48a9f44f3172d362eab8a0084865b42084cef383.tar.gz |
gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h gtk/Makefile.am gtk/makenums.pl
Mon Jun 15 16:29:45 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h
gtk/Makefile.am gtk/makenums.pl
Removed out the G_ENUM/FLAGS mechanism in favor
of a perl script that parses the standard headers
(with occasional /*< nick=foo >*/ style overrides)
and extracts the enumerations.
gtk/maketypes.awk: Small improvments to the
translation of names. (Avoid splitting gc into
g_c_.)
Mon Jun 15 16:25:44 1998 Owen Taylor <otaylor@gtk.org>
* gtk/Makefile.am gtk/gtk.h gtk/gtkfontsel.[ch] gtk/testgtk.c:
Damon Chaplin's <DAChaplin@email.msn.com> Font selection widget,
and a simple example for testgtk.
Mon Jun 15 15:58:34 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkentry.c:
- Restored gtk_entry_adjust_scroll to static
- Changed text positioning code so that we always
display as large a portion of the text as possible.
Mon Jun 15 15:42:12 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtktext.c (gtk_text_finalize): Free internal
structures of text widget. Also, unreference pixmaps
when unrealizing.
Sat Jun 13 19:14:39 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkinputcommon.h (gdk_input_device_new): Change
3.3.1 bug workaround to number keys starting at 1.
Sat Jun 13 11:56:57 1998 Owen Taylor <otaylor@gtk.org>
* docs/gtk_tut.sgml: Fixed urls for complete example
source for scribble+widget-writing examples.
Diffstat (limited to 'gtk/gtktext.c')
-rw-r--r-- | gtk/gtktext.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 13fd9cb43..14d683e3c 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -159,6 +159,7 @@ struct _LineParams static void gtk_text_class_init (GtkTextClass *klass); static void gtk_text_init (GtkText *text); static void gtk_text_destroy (GtkObject *object); +static void gtk_text_finalize (GtkObject *object); static void gtk_text_realize (GtkWidget *widget); static void gtk_text_unrealize (GtkWidget *widget); static void gtk_text_style_set (GtkWidget *widget, @@ -274,6 +275,7 @@ static void scroll_int (GtkText* text, gint diff); static void process_exposes (GtkText *text); /* Cache Management. */ +static void free_cache (GtkText* text); static GList* remove_cache_line (GtkText* text, GList* list); /* Key Motion. */ @@ -460,6 +462,7 @@ gtk_text_class_init (GtkTextClass *class) parent_class = gtk_type_class (gtk_editable_get_type ()); object_class->destroy = gtk_text_destroy; + object_class->finalize = gtk_text_finalize; widget_class->realize = gtk_text_realize; widget_class->unrealize = gtk_text_unrealize; @@ -934,6 +937,38 @@ gtk_text_destroy (GtkObject *object) } static void +gtk_text_finalize (GtkObject *object) +{ + GtkText *text; + GList *tmp_list; + + g_return_if_fail (object != NULL); + g_return_if_fail (GTK_IS_TEXT (object)); + + text = (GtkText *)object; + + /* Clean up the internal structures */ + g_free (text->text); + free_cache (text); + + tmp_list = text->text_properties; + while (tmp_list) + { + g_mem_chunk_free (text_property_chunk, tmp_list->data); + tmp_list = tmp_list->next; + } + + g_list_free (text->text_properties); + + if (text->scratch_buffer) + g_free (text->scratch_buffer); + + g_list_free (text->tab_stops); + + GTK_OBJECT_CLASS(parent_class)->finalize (object); +} + +static void gtk_text_realize (GtkWidget *widget) { GtkText *text; @@ -1113,6 +1148,9 @@ gtk_text_unrealize (GtkWidget *widget) gdk_gc_destroy (text->gc); text->gc = NULL; + gdk_pixmap_unref (text->line_wrap_bitmap); + gdk_pixmap_unref (text->line_arrow_bitmap); + if (GTK_WIDGET_CLASS (parent_class)->unrealize) (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget); } |