diff --git a/ChangeLog b/ChangeLog index cd39ad807e..e98cf5ebf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2000-11-12 Havoc Pennington + + * demos/gtk-demo/Makefile.am (democodedir): change demo install + dir to datadir/gtk+-2.0/demo + + * demos/gtk-demo/textview.c: Text widget demo; reveals all + sorts of text widget and Pango font bugs. Urgh. + + * demos/gtk-demo/Makefile.am (demos): Add textview.c + + * demos/gtk-demo/main.c (create_tree): Add instructions at top of + tree that you should double click to see the demo. Fix + types of variables to reflect changed return values from + GtkTreeStore and GtkTreeViewColumn constructors. + + * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the + newly-created buffer to prepare for GObject semantics + + * gtk/testtext.c: don't leak the buffer with GObject semantics + + * gtk/testtextbuffer.c: ditto + 2000-11-12 Havoc Pennington Rename this testgtk to gtk-demo to avoid confusion, and diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index cd39ad807e..e98cf5ebf3 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,25 @@ +2000-11-12 Havoc Pennington + + * demos/gtk-demo/Makefile.am (democodedir): change demo install + dir to datadir/gtk+-2.0/demo + + * demos/gtk-demo/textview.c: Text widget demo; reveals all + sorts of text widget and Pango font bugs. Urgh. + + * demos/gtk-demo/Makefile.am (demos): Add textview.c + + * demos/gtk-demo/main.c (create_tree): Add instructions at top of + tree that you should double click to see the demo. Fix + types of variables to reflect changed return values from + GtkTreeStore and GtkTreeViewColumn constructors. + + * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the + newly-created buffer to prepare for GObject semantics + + * gtk/testtext.c: don't leak the buffer with GObject semantics + + * gtk/testtextbuffer.c: ditto + 2000-11-12 Havoc Pennington Rename this testgtk to gtk-demo to avoid confusion, and diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index cd39ad807e..e98cf5ebf3 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,25 @@ +2000-11-12 Havoc Pennington + + * demos/gtk-demo/Makefile.am (democodedir): change demo install + dir to datadir/gtk+-2.0/demo + + * demos/gtk-demo/textview.c: Text widget demo; reveals all + sorts of text widget and Pango font bugs. Urgh. + + * demos/gtk-demo/Makefile.am (demos): Add textview.c + + * demos/gtk-demo/main.c (create_tree): Add instructions at top of + tree that you should double click to see the demo. Fix + types of variables to reflect changed return values from + GtkTreeStore and GtkTreeViewColumn constructors. + + * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the + newly-created buffer to prepare for GObject semantics + + * gtk/testtext.c: don't leak the buffer with GObject semantics + + * gtk/testtextbuffer.c: ditto + 2000-11-12 Havoc Pennington Rename this testgtk to gtk-demo to avoid confusion, and diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index cd39ad807e..e98cf5ebf3 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,25 @@ +2000-11-12 Havoc Pennington + + * demos/gtk-demo/Makefile.am (democodedir): change demo install + dir to datadir/gtk+-2.0/demo + + * demos/gtk-demo/textview.c: Text widget demo; reveals all + sorts of text widget and Pango font bugs. Urgh. + + * demos/gtk-demo/Makefile.am (demos): Add textview.c + + * demos/gtk-demo/main.c (create_tree): Add instructions at top of + tree that you should double click to see the demo. Fix + types of variables to reflect changed return values from + GtkTreeStore and GtkTreeViewColumn constructors. + + * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the + newly-created buffer to prepare for GObject semantics + + * gtk/testtext.c: don't leak the buffer with GObject semantics + + * gtk/testtextbuffer.c: ditto + 2000-11-12 Havoc Pennington Rename this testgtk to gtk-demo to avoid confusion, and diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index cd39ad807e..e98cf5ebf3 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,25 @@ +2000-11-12 Havoc Pennington + + * demos/gtk-demo/Makefile.am (democodedir): change demo install + dir to datadir/gtk+-2.0/demo + + * demos/gtk-demo/textview.c: Text widget demo; reveals all + sorts of text widget and Pango font bugs. Urgh. + + * demos/gtk-demo/Makefile.am (demos): Add textview.c + + * demos/gtk-demo/main.c (create_tree): Add instructions at top of + tree that you should double click to see the demo. Fix + types of variables to reflect changed return values from + GtkTreeStore and GtkTreeViewColumn constructors. + + * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the + newly-created buffer to prepare for GObject semantics + + * gtk/testtext.c: don't leak the buffer with GObject semantics + + * gtk/testtextbuffer.c: ditto + 2000-11-12 Havoc Pennington Rename this testgtk to gtk-demo to avoid confusion, and diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index cd39ad807e..e98cf5ebf3 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,25 @@ +2000-11-12 Havoc Pennington + + * demos/gtk-demo/Makefile.am (democodedir): change demo install + dir to datadir/gtk+-2.0/demo + + * demos/gtk-demo/textview.c: Text widget demo; reveals all + sorts of text widget and Pango font bugs. Urgh. + + * demos/gtk-demo/Makefile.am (demos): Add textview.c + + * demos/gtk-demo/main.c (create_tree): Add instructions at top of + tree that you should double click to see the demo. Fix + types of variables to reflect changed return values from + GtkTreeStore and GtkTreeViewColumn constructors. + + * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the + newly-created buffer to prepare for GObject semantics + + * gtk/testtext.c: don't leak the buffer with GObject semantics + + * gtk/testtextbuffer.c: ditto + 2000-11-12 Havoc Pennington Rename this testgtk to gtk-demo to avoid confusion, and diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index cd39ad807e..e98cf5ebf3 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,25 @@ +2000-11-12 Havoc Pennington + + * demos/gtk-demo/Makefile.am (democodedir): change demo install + dir to datadir/gtk+-2.0/demo + + * demos/gtk-demo/textview.c: Text widget demo; reveals all + sorts of text widget and Pango font bugs. Urgh. + + * demos/gtk-demo/Makefile.am (demos): Add textview.c + + * demos/gtk-demo/main.c (create_tree): Add instructions at top of + tree that you should double click to see the demo. Fix + types of variables to reflect changed return values from + GtkTreeStore and GtkTreeViewColumn constructors. + + * gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the + newly-created buffer to prepare for GObject semantics + + * gtk/testtext.c: don't leak the buffer with GObject semantics + + * gtk/testtextbuffer.c: ditto + 2000-11-12 Havoc Pennington Rename this testgtk to gtk-demo to avoid confusion, and diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am index f67baa99ef..d3548fb5a7 100644 --- a/demos/gtk-demo/Makefile.am +++ b/demos/gtk-demo/Makefile.am @@ -1,12 +1,13 @@ ## Makefile.am for gtk+/demos -democodedir=$(datadir)/gtk-demo +democodedir=$(datadir)/gtk-2.0/demo demos = @STRIP_BEGIN@ \ button_box.c \ item_factory.c \ menus.c \ panes.c \ + textview.c \ @STRIP_END@ INCLUDES = @STRIP_BEGIN@ \ diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c index 417dbf66c4..227b2bfa7f 100644 --- a/demos/gtk-demo/main.c +++ b/demos/gtk-demo/main.c @@ -307,8 +307,8 @@ create_tree (void) GtkTreeSelection *selection; GtkCellRenderer *cell; GtkWidget *tree_view; - GtkObject *column; - GtkObject *model; + GtkTreeViewColumn *column; + GtkTreeStore *model; GtkTreeIter iter; gint i; @@ -334,7 +334,7 @@ create_tree (void) } cell = gtk_cell_renderer_text_new (); - column = gtk_tree_view_column_new_with_attributes ("Widget", + column = gtk_tree_view_column_new_with_attributes ("Widget (double click for demo)", cell, "text", TITLE_COLUMN, "italic", ITALIC_COLUMN, diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index ac62712c35..e5444c2788 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -262,6 +262,9 @@ gtk_text_buffer_new (GtkTextTagTable *table) gtk_object_sink (GTK_OBJECT (text_buffer->tag_table)); } + gtk_object_ref (GTK_OBJECT (text_buffer)); + gtk_object_sink (GTK_OBJECT (text_buffer)); + return text_buffer; } diff --git a/gtk/gtktextbuffer.h b/gtk/gtktextbuffer.h index f8c00a6710..b2e6391883 100644 --- a/gtk/gtktextbuffer.h +++ b/gtk/gtktextbuffer.h @@ -252,6 +252,7 @@ void gtk_text_buffer_remove_tag_by_name (GtkTextBuffer *buffer, /* You can either ignore the return value, or use it to * set the attributes of the tag. tag_name can be NULL */ +/* FIXME this should take a varargs list of tag attributes I think */ GtkTextTag *gtk_text_buffer_create_tag (GtkTextBuffer *buffer, const gchar *tag_name); diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 707cc98cd4..e022a5d0ea 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -2443,7 +2443,7 @@ gtk_text_view_draw (GtkWidget *widget, GdkRectangle *area) text_view = GTK_TEXT_VIEW (widget); gtk_text_view_paint (widget, area); - + /* If the area overlaps the "edge" of the widget, draw the focus * rectangle */ @@ -2452,7 +2452,7 @@ gtk_text_view_draw (GtkWidget *widget, GdkRectangle *area) (area->x + area->width) > (widget->allocation.width - FOCUS_EDGE_WIDTH) || (area->y + area->height) > (widget->allocation.height - FOCUS_EDGE_WIDTH)) gtk_widget_draw_focus (widget); - + /* Synthesize expose events for the user-drawn border windows, * just as we would for a drawing area. */ @@ -2480,14 +2480,14 @@ gtk_text_view_draw (GtkWidget *widget, GdkRectangle *area) static gint gtk_text_view_expose_event (GtkWidget *widget, GdkEventExpose *event) -{ +{ if (event->window == gtk_text_view_get_window (GTK_TEXT_VIEW (widget), GTK_TEXT_WINDOW_TEXT)) gtk_text_view_paint (widget, &event->area); if (event->window == widget->window) gtk_widget_draw_focus (widget); - + return TRUE; } diff --git a/gtk/testtext.c b/gtk/testtext.c index 279535aecd..1f9be694b3 100644 --- a/gtk/testtext.c +++ b/gtk/testtext.c @@ -1023,9 +1023,10 @@ do_search (gpointer callback_data, buffer = gtk_text_buffer_new (NULL); - /* FIXME memory leak once buffer is a GObject */ search_text = gtk_text_view_new_with_buffer (buffer); + g_object_unref (G_OBJECT (buffer)); + gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox), search_text, TRUE, TRUE, 0); @@ -1276,8 +1277,6 @@ create_buffer (void) buffer = g_new (Buffer, 1); buffer->buffer = gtk_text_buffer_new (NULL); - gtk_object_ref (GTK_OBJECT (buffer->buffer)); - gtk_object_sink (GTK_OBJECT (buffer->buffer)); buffer->refcount = 1; buffer->filename = NULL; diff --git a/gtk/testtextbuffer.c b/gtk/testtextbuffer.c index 437be8832f..18df1a2f1b 100644 --- a/gtk/testtextbuffer.c +++ b/gtk/testtextbuffer.c @@ -66,6 +66,8 @@ main (int argc, char** argv) run_tests (buffer); + g_object_unref (G_OBJECT (buffer)); + g_print ("All tests passed.\n"); return 0; diff --git a/tests/testtext.c b/tests/testtext.c index 279535aecd..1f9be694b3 100644 --- a/tests/testtext.c +++ b/tests/testtext.c @@ -1023,9 +1023,10 @@ do_search (gpointer callback_data, buffer = gtk_text_buffer_new (NULL); - /* FIXME memory leak once buffer is a GObject */ search_text = gtk_text_view_new_with_buffer (buffer); + g_object_unref (G_OBJECT (buffer)); + gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox), search_text, TRUE, TRUE, 0); @@ -1276,8 +1277,6 @@ create_buffer (void) buffer = g_new (Buffer, 1); buffer->buffer = gtk_text_buffer_new (NULL); - gtk_object_ref (GTK_OBJECT (buffer->buffer)); - gtk_object_sink (GTK_OBJECT (buffer->buffer)); buffer->refcount = 1; buffer->filename = NULL; diff --git a/tests/testtextbuffer.c b/tests/testtextbuffer.c index 437be8832f..18df1a2f1b 100644 --- a/tests/testtextbuffer.c +++ b/tests/testtextbuffer.c @@ -66,6 +66,8 @@ main (int argc, char** argv) run_tests (buffer); + g_object_unref (G_OBJECT (buffer)); + g_print ("All tests passed.\n"); return 0;