[gnome-applets] Remove GtkObject use



commit 274f17fe92b98b5a0bdd31de734240b4cc6227e9
Author: Christian Persch <chpe gnome org>
Date:   Thu Oct 28 13:50:03 2010 +0200

    Remove GtkObject use

 battstat/battstat_applet.c        |   16 ++++++++--------
 charpick/charpick.c               |    8 ++++----
 cpufreq/src/cpufreq-applet.c      |   10 +++++-----
 drivemount/drive-button.c         |   13 ++++++-------
 drivemount/drive-list.c           |   12 +++++-------
 geyes/geyes.c                     |    2 +-
 gweather/gweather-applet.c        |    2 +-
 gweather/gweather-pref.c          |    2 +-
 mini-commander/src/command_line.c |    4 ++--
 mixer/applet.c                    |    1 -
 trashapplet/src/trash-empty.c     |    6 +++---
 trashapplet/src/trashapplet.c     |   11 +++++------
 12 files changed, 41 insertions(+), 46 deletions(-)
---
diff --git a/battstat/battstat_applet.c b/battstat/battstat_applet.c
index 7335efa..5143c27 100644
--- a/battstat/battstat_applet.c
+++ b/battstat/battstat_applet.c
@@ -342,9 +342,9 @@ battstat_error_dialog( GtkWidget *applet, const char *msg )
   gtk_window_set_screen( GTK_WINDOW (dialog),
                          gtk_widget_get_screen (GTK_WIDGET (applet)) );
 
-  g_signal_connect_swapped( GTK_OBJECT (dialog), "response",
+  g_signal_connect_swapped( G_OBJECT (dialog), "response",
                             G_CALLBACK (gtk_widget_destroy),
-                            GTK_OBJECT (dialog) );
+                            G_OBJECT (dialog) );
 
   gtk_widget_show_all( dialog );
 }
@@ -467,9 +467,9 @@ battery_full_dialog (GtkWidget *applet)
 		GTK_STOCK_OK,
 		GTK_RESPONSE_ACCEPT,
 		NULL);
-  g_signal_connect_swapped (GTK_OBJECT (dialog), "response",
+  g_signal_connect_swapped (G_OBJECT (dialog), "response",
 			    G_CALLBACK (gtk_widget_destroy),
-			    GTK_OBJECT (dialog));
+			    G_OBJECT (dialog));
 
   gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
   gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
@@ -626,7 +626,7 @@ battery_low_dialog( ProgressData *battery, BatteryStatus *info )
   gtk_dialog_set_default_response( GTK_DIALOG (battery->battery_low_dialog),
                                    GTK_RESPONSE_ACCEPT );
 
-  g_signal_connect_swapped( GTK_OBJECT (battery->battery_low_dialog),
+  g_signal_connect_swapped( G_OBJECT (battery->battery_low_dialog),
                             "response",
                             G_CALLBACK (battery_low_dialog_destroy),
                             battery );
@@ -1552,9 +1552,9 @@ create_layout(ProgressData *battstat)
   g_object_ref( battstat->status );
   g_object_ref( battstat->percent );
   g_object_ref( battstat->battery );
-  g_object_ref_sink( GTK_OBJECT( battstat->status ) );
-  g_object_ref_sink( GTK_OBJECT( battstat->percent ) );
-  g_object_ref_sink( GTK_OBJECT( battstat->battery ) );
+  g_object_ref_sink( G_OBJECT( battstat->status ) );
+  g_object_ref_sink( G_OBJECT( battstat->percent ) );
+  g_object_ref_sink( G_OBJECT( battstat->battery ) );
 
   /* Let reconfigure_layout know that the table is currently empty. */
   battstat->layout.status = LAYOUT_NONE;
diff --git a/charpick/charpick.c b/charpick/charpick.c
index 164a457..15ccfa0 100644
--- a/charpick/charpick.c
+++ b/charpick/charpick.c
@@ -504,10 +504,10 @@ build_table(charpick_data *p_curr_data)
   
     g_object_set_data (G_OBJECT (toggle_button[i]), "unichar", 
 				GINT_TO_POINTER(g_utf8_get_char (label)));
-    g_signal_connect (GTK_OBJECT (toggle_button[i]), "toggled",
+    g_signal_connect (G_OBJECT (toggle_button[i]), "toggled",
 		      G_CALLBACK (toggle_button_toggled_cb),
                         p_curr_data);
-    g_signal_connect (GTK_OBJECT (toggle_button[i]), "button_press_event", 
+    g_signal_connect (G_OBJECT (toggle_button[i]), "button_press_event", 
                       G_CALLBACK (button_press_hack), p_curr_data->applet);
   }
   
@@ -809,10 +809,10 @@ charpicker_applet_fill (PanelApplet *applet)
 			    GDK_SELECTION_CLIPBOARD,
                             utf8_atom,
 			    0);
-  g_signal_connect (GTK_OBJECT (curr_data->applet), "selection_get",
+  g_signal_connect (G_OBJECT (curr_data->applet), "selection_get",
 		      G_CALLBACK (charpick_selection_handler),
 		      curr_data);
-  g_signal_connect (GTK_OBJECT (curr_data->applet), "selection_clear_event",
+  g_signal_connect (G_OBJECT (curr_data->applet), "selection_clear_event",
 		      G_CALLBACK (selection_clear_cb),
 		      curr_data);
  
diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c
index 711a684..c17183a 100644
--- a/cpufreq/src/cpufreq-applet.c
+++ b/cpufreq/src/cpufreq-applet.c
@@ -94,7 +94,7 @@ static void     cpufreq_applet_update            (CPUFreqApplet      *applet,
                                                   CPUFreqMonitor     *monitor);
 static void     cpufreq_applet_refresh           (CPUFreqApplet      *applet);
 
-static void     cpufreq_applet_destroy           (GtkObject          *widget);
+static void     cpufreq_applet_dispose           (GObject          *widget);
 static gboolean cpufreq_applet_button_press      (GtkWidget          *widget,
                                                   GdkEventButton     *event);
 static gboolean cpufreq_applet_key_press         (GtkWidget          *widget,
@@ -213,10 +213,10 @@ static void
 cpufreq_applet_class_init (CPUFreqAppletClass *klass)
 {
         PanelAppletClass *applet_class = PANEL_APPLET_CLASS (klass);
-        GtkObjectClass   *gtkobject_class = GTK_OBJECT_CLASS (klass);
+        GObjectClass   *gobject_class = G_OBJECT_CLASS (klass);
         GtkWidgetClass   *widget_class = GTK_WIDGET_CLASS (klass);
 
-        gtkobject_class->destroy = cpufreq_applet_destroy;
+        gobject_class->dispose = cpufreq_applet_dispose;
            
         widget_class->size_allocate = cpufreq_applet_size_allocate;
 	widget_class->size_request = cpufreq_applet_size_request;
@@ -227,7 +227,7 @@ cpufreq_applet_class_init (CPUFreqAppletClass *klass)
 }
 
 static void
-cpufreq_applet_destroy (GtkObject *widget)
+cpufreq_applet_dispose (GObject *widget)
 {
         CPUFreqApplet *applet;
         gint           i;
@@ -256,7 +256,7 @@ cpufreq_applet_destroy (GtkObject *widget)
                 applet->popup = NULL;
         }
 
-        GTK_OBJECT_CLASS (cpufreq_applet_parent_class)->destroy (widget);
+        G_OBJECT_CLASS (cpufreq_applet_parent_class)->dispose (widget);
 }
 
 static void
diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c
index cb1a8b9..0a01741 100644
--- a/drivemount/drive-button.c
+++ b/drivemount/drive-button.c
@@ -52,7 +52,7 @@ static void     drive_button_set_mount    (DriveButton    *self,
 static void     drive_button_reset_popup  (DriveButton    *self);
 static void     drive_button_ensure_popup (DriveButton    *self);
 
-static void     drive_button_destroy      (GtkObject      *object);
+static void     drive_button_dispose      (GObject      *object);
 #if 0
 static void     drive_button_unrealize    (GtkWidget      *widget);
 #endif /* 0 */
@@ -66,7 +66,7 @@ static void drive_button_theme_change     (GtkIconTheme   *icon_theme,
 static void
 drive_button_class_init (DriveButtonClass *class)
 {
-    GTK_OBJECT_CLASS(class)->destroy = drive_button_destroy;
+    G_OBJECT_CLASS(class)->dispose = drive_button_dispose;
     GTK_WIDGET_CLASS(class)->button_press_event = drive_button_button_press;
     GTK_WIDGET_CLASS(class)->key_press_event = drive_button_key_press;
 
@@ -133,7 +133,7 @@ drive_button_new_from_mount (GMount *mount)
 }
 
 static void
-drive_button_destroy (GtkObject *object)
+drive_button_dispose (GObject *object)
 {
     DriveButton *self = DRIVE_BUTTON (object);
 
@@ -145,8 +145,7 @@ drive_button_destroy (GtkObject *object)
 
     drive_button_reset_popup (self);
 
-    if (GTK_OBJECT_CLASS (drive_button_parent_class)->destroy)
-	(* GTK_OBJECT_CLASS (drive_button_parent_class)->destroy) (object);
+    G_OBJECT_CLASS (drive_button_parent_class)->dispose (object);
 }
 
 #if 0
@@ -458,7 +457,7 @@ static void
 drive_button_reset_popup (DriveButton *self)
 {
     if (self->popup_menu)
-	gtk_object_destroy (GTK_OBJECT (self->popup_menu));
+	gtk_widget_destroy (GTK_WIDGET (self->popup_menu));
     self->popup_menu = NULL;
 }
 
@@ -557,7 +556,7 @@ open_drive (DriveButton *self, GtkWidget *item)
 						     argv[0]);
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), error->message, NULL);
 	g_signal_connect (dialog, "response",
-			  G_CALLBACK (gtk_object_destroy), NULL);
+			  G_CALLBACK (gtk_widget_destroy), NULL);
 	gtk_widget_show (dialog);
 	g_error_free (error);
     }
diff --git a/drivemount/drive-list.c b/drivemount/drive-list.c
index 1013a88..6c542f0 100644
--- a/drivemount/drive-list.c
+++ b/drivemount/drive-list.c
@@ -35,7 +35,7 @@ G_DEFINE_TYPE (DriveList, drive_list, GTK_TYPE_TABLE);
 static GVolumeMonitor *volume_monitor = NULL;
 
 static void drive_list_finalize (GObject *object);
-static void drive_list_destroy  (GtkObject *object);
+static void drive_list_dispose  (GObject *object);
 static void drive_list_add      (GtkContainer *container, GtkWidget *child);
 static void drive_list_remove   (GtkContainer *container, GtkWidget *child);
 
@@ -70,7 +70,7 @@ static void
 drive_list_class_init (DriveListClass *class)
 {
     G_OBJECT_CLASS (class)->finalize = drive_list_finalize;
-    GTK_OBJECT_CLASS (class)->destroy = drive_list_destroy;
+    G_OBJECT_CLASS (class)->dispose = drive_list_dispose;
     GTK_CONTAINER_CLASS (class)->add = drive_list_add;
     GTK_CONTAINER_CLASS (class)->remove = drive_list_remove;
 }
@@ -139,12 +139,11 @@ drive_list_finalize (GObject *object)
     g_hash_table_destroy (self->volumes);
     g_hash_table_destroy (self->mounts);
 
-    if (G_OBJECT_CLASS (drive_list_parent_class)->finalize)
-	(* G_OBJECT_CLASS (drive_list_parent_class)->finalize) (object);
+    G_OBJECT_CLASS (drive_list_parent_class)->finalize (object);
 }
 
 static void
-drive_list_destroy (GtkObject *object)
+drive_list_dispose (GObject *object)
 {
     DriveList *self = DRIVE_LIST (object);
 
@@ -165,8 +164,7 @@ drive_list_destroy (GtkObject *object)
 	g_source_remove (self->layout_tag);
     self->layout_tag = 0;
 
-    if (GTK_OBJECT_CLASS (drive_list_parent_class)->destroy)
-	(* GTK_OBJECT_CLASS (drive_list_parent_class)->destroy) (object);
+    G_OBJECT_CLASS (drive_list_parent_class)->dispose (object);
 }
 
 static void
diff --git a/geyes/geyes.c b/geyes/geyes.c
index e5d65bd..ec8c92b 100644
--- a/geyes/geyes.c
+++ b/geyes/geyes.c
@@ -297,7 +297,7 @@ create_eyes (PanelApplet *applet)
 }
 
 static void
-destroy_cb (GtkObject *object, EyesApplet *eyes_applet)
+destroy_cb (GtkWidget *object, EyesApplet *eyes_applet)
 {
 	g_return_if_fail (eyes_applet);
 
diff --git a/gweather/gweather-applet.c b/gweather/gweather-applet.c
index 2b9cd07..18598f3 100644
--- a/gweather/gweather-applet.c
+++ b/gweather/gweather-applet.c
@@ -339,7 +339,7 @@ void gweather_applet_create (GWeatherApplet *gw_applet)
                        G_CALLBACK(size_allocate_cb), gw_applet);
     g_signal_connect (G_OBJECT(gw_applet->applet), "destroy", 
                        G_CALLBACK (applet_destroy), gw_applet);
-    g_signal_connect (GTK_OBJECT(gw_applet->applet), "button_press_event",
+    g_signal_connect (G_OBJECT(gw_applet->applet), "button_press_event",
                        G_CALLBACK(clicked_cb), gw_applet);
     g_signal_connect (G_OBJECT(gw_applet->applet), "key_press_event",           
 			G_CALLBACK(key_press_cb), gw_applet);
diff --git a/gweather/gweather-pref.c b/gweather/gweather-pref.c
index ecf4de0..a76278c 100644
--- a/gweather/gweather-pref.c
+++ b/gweather/gweather-pref.c
@@ -776,7 +776,7 @@ gweather_pref_create (GWeatherPref *pref)
     GtkWidget *pref_basic_update_alignment;
     GtkWidget *pref_basic_update_lbl;
     GtkWidget *pref_basic_update_hbox;
-    GtkObject *pref_basic_update_spin_adj;
+    GObject   *pref_basic_update_spin_adj;
     GtkWidget *pref_basic_update_sec_lbl;
     GtkWidget *pref_basic_note_lbl;
     GtkWidget *pref_loc_hbox;
diff --git a/mini-commander/src/command_line.c b/mini-commander/src/command_line.c
index ba1b714..73b558b 100644
--- a/mini-commander/src/command_line.c
+++ b/mini-commander/src/command_line.c
@@ -306,7 +306,7 @@ mc_show_history (GtkWidget *widget,
      gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
      gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_COMBO);
      /* cb */
-     g_signal_connect_after(GTK_OBJECT(window),
+     g_signal_connect_after(G_OBJECT(window),
 			      "button_press_event",
 			      G_CALLBACK(history_popup_clicked_cb),
 			      NULL);
@@ -329,7 +329,7 @@ mc_show_history (GtkWidget *widget,
      gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
 				    GTK_POLICY_AUTOMATIC,
 				    GTK_POLICY_AUTOMATIC);
-     g_signal_connect(GTK_OBJECT(scrolled_window),
+     g_signal_connect(G_OBJECT(scrolled_window),
 			"button_press_event",
 			G_CALLBACK(history_popup_clicked_inside_cb),
 			NULL);
diff --git a/mixer/applet.c b/mixer/applet.c
index fefbb02..8d53dfc 100644
--- a/mixer/applet.c
+++ b/mixer/applet.c
@@ -379,7 +379,6 @@ gboolean
 gnome_volume_applet_setup (GnomeVolumeApplet *applet,
 			   GList *elements)
 {
-  GtkObject *adj;
   static const GtkActionEntry actions[] = {
     { "RunMixer", NULL, N_("_Open Volume Control"),
       NULL, NULL,
diff --git a/trashapplet/src/trash-empty.c b/trashapplet/src/trash-empty.c
index a274c5d..bb33c5c 100644
--- a/trashapplet/src/trash-empty.c
+++ b/trashapplet/src/trash-empty.c
@@ -118,7 +118,7 @@ trash_empty_update_dialog (gpointer user_data)
 static gboolean
 trash_empty_done (gpointer user_data)
 {
-  gtk_object_destroy (GTK_OBJECT (trash_empty_dialog));
+  gtk_widget_destroy (GTK_WIDGET (trash_empty_dialog));
 
   g_assert (trash_empty_dialog == NULL);
 
@@ -253,7 +253,7 @@ trash_empty_start (GtkWidget *parent)
           g_critical ("failed to parse trash-empty dialog markup");
 
           if (trash_empty_dialog)
-            gtk_object_destroy (GTK_OBJECT (trash_empty_dialog));
+            gtk_widget_destroy (GTK_WIDGET (trash_empty_dialog));
 
           g_object_unref (builder);
           return;
@@ -292,7 +292,7 @@ trash_empty_confirmation_response (GtkDialog *dialog,
   if (response_id == GTK_RESPONSE_YES)
     trash_empty_start (GTK_WIDGET (dialog));
 
-  gtk_object_destroy (GTK_OBJECT (dialog));
+  gtk_widget_destroy (GTK_WIDGET (dialog));
   g_assert (trash_empty_confirm_dialog == NULL);
 }
 
diff --git a/trashapplet/src/trashapplet.c b/trashapplet/src/trashapplet.c
index ed38423..3013912 100644
--- a/trashapplet/src/trashapplet.c
+++ b/trashapplet/src/trashapplet.c
@@ -185,7 +185,7 @@ trash_applet_size_allocate (GtkWidget    *widget,
 }
 
 static void
-trash_applet_destroy (GtkObject *object)
+trash_applet_dispose (GObject *object)
 {
   TrashApplet *applet = TRASH_APPLET (object);
 
@@ -205,8 +205,7 @@ trash_applet_destroy (GtkObject *object)
     g_object_unref (applet->icon);
   applet->icon = NULL;
 
-  GTK_OBJECT_CLASS (trash_applet_parent_class)
-    ->destroy (object);
+  G_OBJECT_CLASS (trash_applet_parent_class)->dispose (object);
 }
 
 static void
@@ -516,7 +515,7 @@ confirm_delete_immediately (GtkWidget *parent_view,
 
   response = gtk_dialog_run (GTK_DIALOG (dialog));
 
-  gtk_object_destroy (GTK_OBJECT (dialog));
+  gtk_widget_destroy (GTK_WIDGET (dialog));
 
   return response == GTK_RESPONSE_YES;
 }
@@ -591,10 +590,10 @@ trash_applet_drag_data_received (GtkWidget        *widget,
 static void
 trash_applet_class_init (TrashAppletClass *class)
 {
-  GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (class);
+  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
 
-  gtkobject_class->destroy = trash_applet_destroy;
+  gobject_class->dispose = trash_applet_dispose;
   widget_class->size_allocate = trash_applet_size_allocate;
   widget_class->button_release_event = trash_applet_button_release;
   widget_class->key_press_event = trash_applet_key_press;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]