diff options
Diffstat (limited to 'gtk/gtkstatusbar.c')
-rw-r--r-- | gtk/gtkstatusbar.c | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c index 34603573f..f0826a7d8 100644 --- a/gtk/gtkstatusbar.c +++ b/gtk/gtkstatusbar.c @@ -41,7 +41,6 @@ enum static void gtk_statusbar_class_init (GtkStatusbarClass *class); static void gtk_statusbar_init (GtkStatusbar *statusbar); static void gtk_statusbar_destroy (GtkObject *object); -static void gtk_statusbar_finalize (GtkObject *object); static void gtk_statusbar_update (GtkStatusbar *statusbar, guint context_id, const gchar *text); @@ -86,11 +85,21 @@ gtk_statusbar_class_init (GtkStatusbarClass *class) container_class = (GtkContainerClass *) class; parent_class = gtk_type_class (GTK_TYPE_HBOX); + + object_class->destroy = gtk_statusbar_destroy; + + class->messages_mem_chunk = g_mem_chunk_new ("GtkStatusBar messages mem chunk", + sizeof (GtkStatusbarMsg), + sizeof (GtkStatusbarMsg) * 64, + G_ALLOC_AND_FREE); + + class->text_pushed = gtk_statusbar_update; + class->text_popped = gtk_statusbar_update; statusbar_signals[SIGNAL_TEXT_PUSHED] = gtk_signal_new ("text_pushed", GTK_RUN_LAST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (GtkStatusbarClass, text_pushed), gtk_marshal_NONE__UINT_STRING, GTK_TYPE_NONE, 2, @@ -99,24 +108,13 @@ gtk_statusbar_class_init (GtkStatusbarClass *class) statusbar_signals[SIGNAL_TEXT_POPPED] = gtk_signal_new ("text_popped", GTK_RUN_LAST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (GtkStatusbarClass, text_popped), gtk_marshal_NONE__UINT_STRING, GTK_TYPE_NONE, 2, GTK_TYPE_UINT, GTK_TYPE_STRING); gtk_object_class_add_signals (object_class, statusbar_signals, SIGNAL_LAST); - - object_class->destroy = gtk_statusbar_destroy; - object_class->finalize = gtk_statusbar_finalize; - - class->messages_mem_chunk = g_mem_chunk_new ("GtkStatusBar messages mem chunk", - sizeof (GtkStatusbarMsg), - sizeof (GtkStatusbarMsg) * 64, - G_ALLOC_AND_FREE); - - class->text_pushed = gtk_statusbar_update; - class->text_popped = gtk_statusbar_update; } static void @@ -206,7 +204,7 @@ gtk_statusbar_push (GtkStatusbar *statusbar, g_return_val_if_fail (text != NULL, 0); g_return_val_if_fail (context_id > 0, 0); - class = GTK_STATUSBAR_CLASS (GTK_OBJECT (statusbar)->klass); + class = GTK_STATUSBAR_GET_CLASS (statusbar); msg = g_chunk_new (GtkStatusbarMsg, class->messages_mem_chunk); msg->text = g_strdup (text); msg->context_id = context_id; @@ -244,7 +242,7 @@ gtk_statusbar_pop (GtkStatusbar *statusbar, { GtkStatusbarClass *class; - class = GTK_STATUSBAR_CLASS (GTK_OBJECT (statusbar)->klass); + class = GTK_STATUSBAR_GET_CLASS (statusbar); statusbar->messages = g_slist_remove_link (statusbar->messages, list); @@ -298,7 +296,7 @@ gtk_statusbar_remove (GtkStatusbar *statusbar, { GtkStatusbarClass *class; - class = GTK_STATUSBAR_CLASS (GTK_OBJECT (statusbar)->klass); + class = GTK_STATUSBAR_GET_CLASS (statusbar); statusbar->messages = g_slist_remove_link (statusbar->messages, list); g_free (msg->text); g_mem_chunk_free (class->messages_mem_chunk, msg); @@ -321,7 +319,7 @@ gtk_statusbar_destroy (GtkObject *object) g_return_if_fail (GTK_IS_STATUSBAR (object)); statusbar = GTK_STATUSBAR (object); - class = GTK_STATUSBAR_CLASS (GTK_OBJECT (statusbar)->klass); + class = GTK_STATUSBAR_GET_CLASS (statusbar); for (list = statusbar->messages; list; list = list->next) { @@ -341,16 +339,3 @@ gtk_statusbar_destroy (GtkObject *object) GTK_OBJECT_CLASS (parent_class)->destroy (object); } - -static void -gtk_statusbar_finalize (GtkObject *object) -{ - GtkStatusbar *statusbar; - - g_return_if_fail (object != NULL); - g_return_if_fail (GTK_IS_STATUSBAR (object)); - - statusbar = GTK_STATUSBAR (object); - - GTK_OBJECT_CLASS (parent_class)->finalize (object); -} |