From 797642a563884b3389aaf6bf9b0f0b51efe899a3 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 23 Jun 2000 19:41:56 +0000 Subject: [PATCH] Use anonymous mark instead of making up a bogus name for first_para_mark 2000-06-23 Havoc Pennington * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark instead of making up a bogus name for first_para_mark * gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow 0 as a context ID --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-0 | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-2 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ gtk/gtkstatusbar.c | 3 --- gtk/gtkstatusbar.h | 3 +++ gtk/gtktextview.c | 7 ++----- 10 files changed, 61 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90808ec660..192b196dea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-06-23 Havoc Pennington + + * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark + instead of making up a bogus name for first_para_mark + + * gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow + 0 as a context ID + Thu Jun 22 17:43:51 BST 2000 Tony Gale * docs/faq/gtk-faq.sgml: Change filename. Add Section 3. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 90808ec660..192b196dea 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +2000-06-23 Havoc Pennington + + * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark + instead of making up a bogus name for first_para_mark + + * gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow + 0 as a context ID + Thu Jun 22 17:43:51 BST 2000 Tony Gale * docs/faq/gtk-faq.sgml: Change filename. Add Section 3. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 90808ec660..192b196dea 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2000-06-23 Havoc Pennington + + * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark + instead of making up a bogus name for first_para_mark + + * gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow + 0 as a context ID + Thu Jun 22 17:43:51 BST 2000 Tony Gale * docs/faq/gtk-faq.sgml: Change filename. Add Section 3. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 90808ec660..192b196dea 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +2000-06-23 Havoc Pennington + + * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark + instead of making up a bogus name for first_para_mark + + * gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow + 0 as a context ID + Thu Jun 22 17:43:51 BST 2000 Tony Gale * docs/faq/gtk-faq.sgml: Change filename. Add Section 3. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 90808ec660..192b196dea 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +2000-06-23 Havoc Pennington + + * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark + instead of making up a bogus name for first_para_mark + + * gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow + 0 as a context ID + Thu Jun 22 17:43:51 BST 2000 Tony Gale * docs/faq/gtk-faq.sgml: Change filename. Add Section 3. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 90808ec660..192b196dea 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2000-06-23 Havoc Pennington + + * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark + instead of making up a bogus name for first_para_mark + + * gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow + 0 as a context ID + Thu Jun 22 17:43:51 BST 2000 Tony Gale * docs/faq/gtk-faq.sgml: Change filename. Add Section 3. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 90808ec660..192b196dea 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2000-06-23 Havoc Pennington + + * gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark + instead of making up a bogus name for first_para_mark + + * gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow + 0 as a context ID + Thu Jun 22 17:43:51 BST 2000 Tony Gale * docs/faq/gtk-faq.sgml: Change filename. Add Section 3. diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c index f0826a7d8b..9b11615afe 100644 --- a/gtk/gtkstatusbar.c +++ b/gtk/gtkstatusbar.c @@ -202,7 +202,6 @@ gtk_statusbar_push (GtkStatusbar *statusbar, g_return_val_if_fail (statusbar != NULL, 0); g_return_val_if_fail (GTK_IS_STATUSBAR (statusbar), 0); g_return_val_if_fail (text != NULL, 0); - g_return_val_if_fail (context_id > 0, 0); class = GTK_STATUSBAR_GET_CLASS (statusbar); msg = g_chunk_new (GtkStatusbarMsg, class->messages_mem_chunk); @@ -228,7 +227,6 @@ gtk_statusbar_pop (GtkStatusbar *statusbar, g_return_if_fail (statusbar != NULL); g_return_if_fail (GTK_IS_STATUSBAR (statusbar)); - g_return_if_fail (context_id > 0); if (statusbar->messages) { @@ -271,7 +269,6 @@ gtk_statusbar_remove (GtkStatusbar *statusbar, g_return_if_fail (statusbar != NULL); g_return_if_fail (GTK_IS_STATUSBAR (statusbar)); - g_return_if_fail (context_id > 0); g_return_if_fail (message_id > 0); msg = statusbar->messages ? statusbar->messages->data : NULL; diff --git a/gtk/gtkstatusbar.h b/gtk/gtkstatusbar.h index c388124f56..b2ecdb8c17 100644 --- a/gtk/gtkstatusbar.h +++ b/gtk/gtkstatusbar.h @@ -84,6 +84,9 @@ struct _GtkStatusbarMsg GtkType gtk_statusbar_get_type (void); GtkWidget* gtk_statusbar_new (void); +/* If you don't want to use contexts, 0 is a predefined global + * context_id you can pass to push/pop/remove + */ guint gtk_statusbar_get_context_id (GtkStatusbar *statusbar, const gchar *context_description); /* Returns message_id used for gtk_statusbar_remove */ diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 27b71014f0..3947ff92fd 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -667,13 +667,10 @@ gtk_text_view_set_buffer (GtkTextView *text_view, "__drag_target", &start, FALSE); - /* Initialize. FIXME: Allow anonymous marks and use one here - */ - mark_name = g_strdup_printf ("__first_para_%p", text_view); text_view->first_para_mark = gtk_text_buffer_create_mark (text_view->buffer, - mark_name, + NULL, &start, TRUE); - g_free (mark_name); + text_view->first_para_pixels = 0; gtk_signal_connect (GTK_OBJECT (text_view->buffer), "mark_set",