summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-06-02 18:10:47 +0200
committerinfirit <[email protected]>2014-06-02 22:15:46 +0200
commit53a1fe800f9f0c90dc298ba228b29852147794bb (patch)
tree9dd51bac0cfdeb6767577986362c553709f3b333
parent4aebcf242c792e3c6e4b0162a74b90c7d882fb38 (diff)
downloadmate-applets-53a1fe800f9f0c90dc298ba228b29852147794bb.tar.bz2
mate-applets-53a1fe800f9f0c90dc298ba228b29852147794bb.tar.xz
Replace GtkObject with GObject also for gtk2
-rw-r--r--battstat/battstat-upower.c6
-rw-r--r--battstat/battstat_applet.c22
-rw-r--r--charpick/charpick.c12
-rw-r--r--cpufreq/src/cpufreq-applet.c20
-rw-r--r--drivemount/drive-button.c25
-rw-r--r--drivemount/drive-list.c17
-rw-r--r--geyes/geyes.c9
-rw-r--r--mateweather/mateweather-applet.c4
-rw-r--r--mateweather/mateweather-pref.c4
-rw-r--r--trashapplet/src/trash-empty.c12
-rw-r--r--trashapplet/src/trashapplet.c20
11 files changed, 4 insertions, 147 deletions
diff --git a/battstat/battstat-upower.c b/battstat/battstat-upower.c
index b0838176..792be860 100644
--- a/battstat/battstat-upower.c
+++ b/battstat/battstat-upower.c
@@ -325,15 +325,9 @@ error_dialog( const char *fmt , ...)
dialog = gtk_message_dialog_new( NULL, 0, GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK, "%s", str);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_swapped( G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (dialog) );
-#else
- g_signal_connect_swapped( GTK_OBJECT (dialog), "response",
- G_CALLBACK (gtk_widget_destroy),
- GTK_OBJECT (dialog) );
-#endif
gtk_widget_show_all( dialog );
}
diff --git a/battstat/battstat_applet.c b/battstat/battstat_applet.c
index 5ecac451..25a83d06 100644
--- a/battstat/battstat_applet.c
+++ b/battstat/battstat_applet.c
@@ -384,15 +384,9 @@ battstat_error_dialog( GtkWidget *applet, const char *msg )
gtk_window_set_screen( GTK_WINDOW (dialog),
gtk_widget_get_screen (GTK_WIDGET (applet)) );
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_swapped( G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (dialog) );
-#else
- g_signal_connect_swapped( GTK_OBJECT (dialog), "response",
- G_CALLBACK (gtk_widget_destroy),
- GTK_OBJECT (dialog) );
-#endif
gtk_widget_show_all( dialog );
}
@@ -515,15 +509,9 @@ battery_full_dialog (GtkWidget *applet)
GTK_STOCK_OK,
GTK_RESPONSE_ACCEPT,
NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_swapped (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (dialog));
-#else
- g_signal_connect_swapped (GTK_OBJECT (dialog), "response",
- G_CALLBACK (gtk_widget_destroy),
- GTK_OBJECT (dialog));
-#endif
gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
hbox = gtk_hbox_new (FALSE, 6);
@@ -679,11 +667,7 @@ battery_low_dialog( ProgressData *battery, BatteryStatus *info )
gtk_dialog_set_default_response( GTK_DIALOG (battery->battery_low_dialog),
GTK_RESPONSE_ACCEPT );
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_swapped( G_OBJECT (battery->battery_low_dialog),
-#else
- g_signal_connect_swapped( GTK_OBJECT (battery->battery_low_dialog),
-#endif
"response",
G_CALLBACK (battery_low_dialog_destroy),
battery );
@@ -1749,15 +1733,9 @@ create_layout(ProgressData *battstat)
g_object_ref( battstat->status );
g_object_ref( battstat->percent );
g_object_ref( battstat->battery );
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_ref_sink( G_OBJECT( battstat->status ) );
g_object_ref_sink( G_OBJECT( battstat->percent ) );
g_object_ref_sink( G_OBJECT( battstat->battery ) );
-#else
- g_object_ref_sink( GTK_OBJECT( battstat->status ) );
- g_object_ref_sink( GTK_OBJECT( battstat->percent ) );
- g_object_ref_sink( GTK_OBJECT( battstat->battery ) );
-#endif
/* 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 7641e468..4afab222 100644
--- a/charpick/charpick.c
+++ b/charpick/charpick.c
@@ -12,10 +12,6 @@
#include <libmate-desktop/mate-aboutdialog.h>
#include "charpick.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define GTK_OBJECT(x) G_OBJECT(x)
-#endif
-
/* The comment for each char list has the html entity names of the chars */
/* All gunicar codes should end in 0 */
@@ -495,10 +491,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);
}
@@ -774,10 +770,10 @@ charpicker_applet_fill (MatePanelApplet *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 aaa4ae4e..a053da5a 100644
--- a/cpufreq/src/cpufreq-applet.c
+++ b/cpufreq/src/cpufreq-applet.c
@@ -99,11 +99,7 @@ static void cpufreq_applet_update (CPUFreqApplet *applet,
CPUFreqMonitor *monitor);
static void cpufreq_applet_refresh (CPUFreqApplet *applet);
-#if GTK_CHECK_VERSION (3, 0, 0)
static void cpufreq_applet_dispose (GObject *widget);
-#else
-static void cpufreq_applet_destroy (GtkObject *widget);
-#endif
static gboolean cpufreq_applet_button_press (GtkWidget *widget,
GdkEventButton *event);
static gboolean cpufreq_applet_key_press (GtkWidget *widget,
@@ -228,18 +224,10 @@ static void
cpufreq_applet_class_init (CPUFreqAppletClass *klass)
{
MatePanelAppletClass *applet_class = MATE_PANEL_APPLET_CLASS (klass);
-#if GTK_CHECK_VERSION (3, 0, 0)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-#else
- GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass);
-#endif
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-#if GTK_CHECK_VERSION (3, 0, 0)
gobject_class->dispose = cpufreq_applet_dispose;
-#else
- gtkobject_class->destroy = cpufreq_applet_destroy;
-#endif
widget_class->size_allocate = cpufreq_applet_size_allocate;
#if GTK_CHECK_VERSION (3, 0, 0)
@@ -254,11 +242,7 @@ cpufreq_applet_class_init (CPUFreqAppletClass *klass)
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
cpufreq_applet_dispose (GObject *widget)
-#else
-cpufreq_applet_destroy (GtkObject *widget)
-#endif
{
CPUFreqApplet *applet;
gint i;
@@ -287,11 +271,7 @@ cpufreq_applet_destroy (GtkObject *widget)
applet->popup = NULL;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
G_OBJECT_CLASS (cpufreq_applet_parent_class)->dispose (widget);
-#else
- GTK_OBJECT_CLASS (cpufreq_applet_parent_class)->destroy (widget);
-#endif
}
static void
diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c
index be8b4fa5..51f13c1c 100644
--- a/drivemount/drive-button.c
+++ b/drivemount/drive-button.c
@@ -53,11 +53,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);
-#if GTK_CHECK_VERSION (3, 0, 0)
static void drive_button_dispose (GObject *object);
-#else
-static void drive_button_destroy (GtkObject *object);
-#endif
#if 0
static void drive_button_unrealize (GtkWidget *widget);
#endif /* 0 */
@@ -71,11 +67,7 @@ static void drive_button_theme_change (GtkIconTheme *icon_theme,
static void
drive_button_class_init (DriveButtonClass *class)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
G_OBJECT_CLASS(class)->dispose = drive_button_dispose;
-#else
- GTK_OBJECT_CLASS(class)->destroy = drive_button_destroy;
-#endif
GTK_WIDGET_CLASS(class)->button_press_event = drive_button_button_press;
GTK_WIDGET_CLASS(class)->key_press_event = drive_button_key_press;
@@ -142,11 +134,7 @@ drive_button_new_from_mount (GMount *mount)
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
drive_button_dispose (GObject *object)
-#else
-drive_button_destroy (GtkObject *object)
-#endif
{
DriveButton *self = DRIVE_BUTTON (object);
@@ -158,13 +146,8 @@ drive_button_destroy (GtkObject *object)
drive_button_reset_popup (self);
-#if GTK_CHECK_VERSION (3, 0, 0)
if (G_OBJECT_CLASS (drive_button_parent_class)->dispose)
(* G_OBJECT_CLASS (drive_button_parent_class)->dispose) (object);
-#else
- if (GTK_OBJECT_CLASS (drive_button_parent_class)->destroy)
- (* GTK_OBJECT_CLASS (drive_button_parent_class)->destroy) (object);
-#endif
}
#if 0
@@ -476,11 +459,7 @@ static void
drive_button_reset_popup (DriveButton *self)
{
if (self->popup_menu)
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_destroy (GTK_WIDGET (self->popup_menu));
-#else
- gtk_object_destroy (GTK_OBJECT (self->popup_menu));
-#endif
self->popup_menu = NULL;
}
@@ -623,11 +602,7 @@ open_drive (DriveButton *self, GtkWidget *item)
else
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "Could not find Caja", NULL);
g_signal_connect (dialog, "response",
-#if GTK_CHECK_VERSION (3, 0, 0)
G_CALLBACK (gtk_widget_destroy), NULL);
-#else
- G_CALLBACK (gtk_object_destroy), NULL);
-#endif
gtk_widget_show (dialog);
g_error_free (error);
}
diff --git a/drivemount/drive-list.c b/drivemount/drive-list.c
index 26163160..e249482f 100644
--- a/drivemount/drive-list.c
+++ b/drivemount/drive-list.c
@@ -35,11 +35,7 @@ G_DEFINE_TYPE (DriveList, drive_list, GTK_TYPE_TABLE);
static GVolumeMonitor *volume_monitor = NULL;
static void drive_list_finalize (GObject *object);
-#if GTK_CHECK_VERSION (3, 0, 0)
static void drive_list_dispose (GObject *object);
-#else
-static void drive_list_destroy (GtkObject *object);
-#endif
static void drive_list_add (GtkContainer *container, GtkWidget *child);
static void drive_list_remove (GtkContainer *container, GtkWidget *child);
@@ -74,11 +70,7 @@ static void
drive_list_class_init (DriveListClass *class)
{
G_OBJECT_CLASS (class)->finalize = drive_list_finalize;
-#if GTK_CHECK_VERSION (3, 0, 0)
G_OBJECT_CLASS (class)->dispose = drive_list_dispose;
-#else
- GTK_OBJECT_CLASS (class)->destroy = drive_list_destroy;
-#endif
GTK_CONTAINER_CLASS (class)->add = drive_list_add;
GTK_CONTAINER_CLASS (class)->remove = drive_list_remove;
}
@@ -152,11 +144,7 @@ drive_list_finalize (GObject *object)
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
drive_list_dispose (GObject *object)
-#else
-drive_list_destroy (GtkObject *object)
-#endif
{
DriveList *self = DRIVE_LIST (object);
@@ -177,13 +165,8 @@ drive_list_destroy (GtkObject *object)
g_source_remove (self->layout_tag);
self->layout_tag = 0;
-#if GTK_CHECK_VERSION (3, 0, 0)
if (G_OBJECT_CLASS (drive_list_parent_class)->dispose)
(* G_OBJECT_CLASS (drive_list_parent_class)->dispose) (object);
-#else
- if (GTK_OBJECT_CLASS (drive_list_parent_class)->destroy)
- (* GTK_OBJECT_CLASS (drive_list_parent_class)->destroy) (object);
-#endif
}
static void
diff --git a/geyes/geyes.c b/geyes/geyes.c
index f0bcd5c8..161c1682 100644
--- a/geyes/geyes.c
+++ b/geyes/geyes.c
@@ -304,11 +304,7 @@ create_eyes (MatePanelApplet *applet)
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
dispose_cb (GObject *object, EyesApplet *eyes_applet)
-#else
-destroy_cb (GtkObject *object, EyesApplet *eyes_applet)
-#endif
{
g_return_if_fail (eyes_applet);
@@ -446,13 +442,8 @@ geyes_applet_fill (MatePanelApplet *applet)
G_CALLBACK (applet_back_change),
eyes_applet);
g_signal_connect (eyes_applet->vbox,
-#if GTK_CHECK_VERSION (3, 0, 0)
"dispose",
G_CALLBACK (dispose_cb),
-#else
- "destroy",
- G_CALLBACK (destroy_cb),
-#endif
eyes_applet);
gtk_widget_show_all (GTK_WIDGET (eyes_applet->applet));
diff --git a/mateweather/mateweather-applet.c b/mateweather/mateweather-applet.c
index 6383626b..2c0f55c1 100644
--- a/mateweather/mateweather-applet.c
+++ b/mateweather/mateweather-applet.c
@@ -343,11 +343,7 @@ void mateweather_applet_create (MateWeatherApplet *gw_applet)
G_CALLBACK(size_allocate_cb), gw_applet);
g_signal_connect (G_OBJECT(gw_applet->applet), "destroy",
G_CALLBACK (applet_destroy), gw_applet);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect (G_OBJECT(gw_applet->applet), "button_press_event",
-#else
- g_signal_connect (GTK_OBJECT(gw_applet->applet), "button_press_event",
-#endif
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/mateweather/mateweather-pref.c b/mateweather/mateweather-pref.c
index 4ac80e8a..672aa8e9 100644
--- a/mateweather/mateweather-pref.c
+++ b/mateweather/mateweather-pref.c
@@ -789,11 +789,7 @@ static void mateweather_pref_create(MateWeatherPref* pref)
GtkWidget* pref_basic_update_alignment;
GtkWidget* pref_basic_update_lbl;
GtkWidget* pref_basic_update_hbox;
-#if GTK_CHECK_VERSION (3, 0, 0)
GObject* pref_basic_update_spin_adj;
-#else
- GtkObject* pref_basic_update_spin_adj;
-#endif
GtkWidget* pref_basic_update_sec_lbl;
GtkWidget* pref_basic_note_lbl;
GtkWidget* pref_loc_hbox;
diff --git a/trashapplet/src/trash-empty.c b/trashapplet/src/trash-empty.c
index 18a1260a..6505e50c 100644
--- a/trashapplet/src/trash-empty.c
+++ b/trashapplet/src/trash-empty.c
@@ -125,11 +125,7 @@ trash_empty_update_dialog (gpointer user_data)
static gboolean
trash_empty_done (gpointer user_data)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_destroy (GTK_WIDGET (trash_empty_dialog));
-#else
- gtk_object_destroy (GTK_OBJECT (trash_empty_dialog));
-#endif
g_assert (trash_empty_dialog == NULL);
@@ -264,11 +260,7 @@ trash_empty_start (GtkWidget *parent)
g_critical ("failed to parse trash-empty dialog markup");
if (trash_empty_dialog)
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_destroy (GTK_WIDGET (trash_empty_dialog));
-#else
- gtk_object_destroy (GTK_OBJECT (trash_empty_dialog));
-#endif
g_object_unref (builder);
return;
@@ -310,11 +302,7 @@ trash_empty_confirmation_response (GtkDialog *dialog,
if (response_id == GTK_RESPONSE_YES)
trash_empty_start (GTK_WIDGET (dialog));
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_destroy (GTK_WIDGET (dialog));
-#else
- gtk_object_destroy (GTK_OBJECT (dialog));
-#endif
g_assert (trash_empty_confirm_dialog == NULL);
}
diff --git a/trashapplet/src/trashapplet.c b/trashapplet/src/trashapplet.c
index 709e9d3b..be92ca9d 100644
--- a/trashapplet/src/trashapplet.c
+++ b/trashapplet/src/trashapplet.c
@@ -188,11 +188,7 @@ trash_applet_size_allocate (GtkWidget *widget,
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
trash_applet_dispose (GObject *object)
-#else
-trash_applet_destroy (GtkObject *object)
-#endif
{
TrashApplet *applet = TRASH_APPLET (object);
@@ -212,11 +208,7 @@ trash_applet_destroy (GtkObject *object)
g_object_unref (applet->icon);
applet->icon = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
G_OBJECT_CLASS (trash_applet_parent_class)->dispose (object);
-#else
- GTK_OBJECT_CLASS (trash_applet_parent_class)->destroy (object);
-#endif
}
static void
@@ -530,11 +522,7 @@ confirm_delete_immediately (GtkWidget *parent_view,
response = gtk_dialog_run (GTK_DIALOG (dialog));
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_destroy (GTK_WIDGET (dialog));
-#else
- gtk_object_destroy (GTK_OBJECT (dialog));
-#endif
return response == GTK_RESPONSE_YES;
}
@@ -609,18 +597,10 @@ trash_applet_drag_data_received (GtkWidget *widget,
static void
trash_applet_class_init (TrashAppletClass *class)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-#else
- GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (class);
-#endif
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
-#if GTK_CHECK_VERSION (3, 0, 0)
gobject_class->dispose = trash_applet_dispose;
-#else
- gtkobject_class->destroy = trash_applet_destroy;
-#endif
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;