Replace GtkObject with Gobject in gtk+2 build

This commit is contained in:
infirit 2014-05-19 14:08:24 +02:00
parent b3097ad42b
commit 53be5f994d
7 changed files with 2 additions and 105 deletions

View File

@ -72,11 +72,7 @@ static void docinfo_dialog_response_cb (GtkDialog *widget,
PlumaWindow *window); PlumaWindow *window);
static void static void
#if GTK_CHECK_VERSION (3, 0, 0) docinfo_dialog_destroy_cb (GObject *obj,
docinfo_dialog_dispose_cb (GObject *obj,
#else
docinfo_dialog_destroy_cb (GtkObject *obj,
#endif
WindowData *data) WindowData *data)
{ {
pluma_debug (DEBUG_PLUGINS); pluma_debug (DEBUG_PLUGINS);
@ -146,14 +142,10 @@ get_docinfo_dialog (PlumaWindow *window,
GTK_WINDOW (window)); GTK_WINDOW (window));
g_signal_connect (dialog->dialog, g_signal_connect (dialog->dialog,
#if GTK_CHECK_VERSION (3, 0, 0)
"dispose",
G_CALLBACK (docinfo_dialog_dispose_cb),
#else
"destroy", "destroy",
G_CALLBACK (docinfo_dialog_destroy_cb), G_CALLBACK (docinfo_dialog_destroy_cb),
#endif
data); data);
g_signal_connect (dialog->dialog, g_signal_connect (dialog->dialog,
"response", "response",
G_CALLBACK (docinfo_dialog_response_cb), G_CALLBACK (docinfo_dialog_response_cb),

View File

@ -92,11 +92,7 @@ static const GtkActionEntry action_entries[] =
}; };
static void static void
#if GTK_CHECK_VERSION (3, 0, 0)
sort_dialog_dispose (GObject *obj, sort_dialog_dispose (GObject *obj,
#else
sort_dialog_destroy (GtkObject *obj,
#endif
gpointer dialog_pointer) gpointer dialog_pointer)
{ {
pluma_debug (DEBUG_PLUGINS); pluma_debug (DEBUG_PLUGINS);
@ -198,13 +194,8 @@ get_sort_dialog (ActionData *action_data)
GTK_RESPONSE_OK); GTK_RESPONSE_OK);
g_signal_connect (dialog->dialog, g_signal_connect (dialog->dialog,
#if GTK_CHECK_VERSION (3, 0, 0)
"dispose", "dispose",
G_CALLBACK (sort_dialog_dispose), G_CALLBACK (sort_dialog_dispose),
#else
"destroy",
G_CALLBACK (sort_dialog_destroy),
#endif
dialog); dialog);
g_signal_connect (dialog->dialog, g_signal_connect (dialog->dialog,

View File

@ -109,11 +109,7 @@ static guint signals [LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE(PlumaSpellCheckerDialog, pluma_spell_checker_dialog, GTK_TYPE_WINDOW) G_DEFINE_TYPE(PlumaSpellCheckerDialog, pluma_spell_checker_dialog, GTK_TYPE_WINDOW)
static void static void
#if GTK_CHECK_VERSION (3, 0,0)
pluma_spell_checker_dialog_dispose (GObject *object) pluma_spell_checker_dialog_dispose (GObject *object)
#else
pluma_spell_checker_dialog_destroy (GtkObject *object)
#endif
{ {
PlumaSpellCheckerDialog *dlg = PLUMA_SPELL_CHECKER_DIALOG (object); PlumaSpellCheckerDialog *dlg = PLUMA_SPELL_CHECKER_DIALOG (object);
@ -129,11 +125,7 @@ pluma_spell_checker_dialog_destroy (GtkObject *object)
dlg->misspelled_word = NULL; dlg->misspelled_word = NULL;
} }
#if GTK_CHECK_VERSION (3, 0,0)
G_OBJECT_CLASS (pluma_spell_checker_dialog_parent_class)->dispose (object); G_OBJECT_CLASS (pluma_spell_checker_dialog_parent_class)->dispose (object);
#else
GTK_OBJECT_CLASS (pluma_spell_checker_dialog_parent_class)->destroy (object);
#endif
} }
static void static void
@ -143,11 +135,7 @@ pluma_spell_checker_dialog_class_init (PlumaSpellCheckerDialogClass * klass)
object_class = G_OBJECT_CLASS (klass); object_class = G_OBJECT_CLASS (klass);
#if GTK_CHECK_VERSION (3, 0, 0)
object_class->dispose = pluma_spell_checker_dialog_dispose; object_class->dispose = pluma_spell_checker_dialog_dispose;
#else
GTK_OBJECT_CLASS (object_class)->destroy = pluma_spell_checker_dialog_destroy;
#endif
signals[IGNORE] = signals[IGNORE] =
g_signal_new ("ignore", g_signal_new ("ignore",

View File

@ -450,11 +450,7 @@ get_time (const gchar* format)
} }
static void static void
#if GTK_CHECK_VERSION (3, 0, 0)
dialog_disposed (GObject *obj, gpointer dialog_pointer) dialog_disposed (GObject *obj, gpointer dialog_pointer)
#else
dialog_destroyed (GtkObject *obj, gpointer dialog_pointer)
#endif
{ {
pluma_debug (DEBUG_PLUGINS); pluma_debug (DEBUG_PLUGINS);
@ -833,13 +829,8 @@ get_configure_dialog (PlumaTimePlugin *plugin)
G_CALLBACK (configure_dialog_button_toggled), G_CALLBACK (configure_dialog_button_toggled),
dialog); dialog);
g_signal_connect (dialog->dialog, g_signal_connect (dialog->dialog,
#if GTK_CHECK_VERSION (3, 0, 0)
"dispose", "dispose",
G_CALLBACK (dialog_disposed), G_CALLBACK (dialog_disposed),
#else
"destroy",
G_CALLBACK (dialog_destroyed),
#endif
dialog); dialog);
g_signal_connect (dialog->custom_entry, g_signal_connect (dialog->custom_entry,
"changed", "changed",
@ -1000,13 +991,8 @@ get_choose_format_dialog (GtkWindow *parent,
G_CALLBACK (choose_format_dialog_button_toggled), G_CALLBACK (choose_format_dialog_button_toggled),
dialog); dialog);
g_signal_connect (dialog->dialog, g_signal_connect (dialog->dialog,
#if GTK_CHECK_VERSION (3, 0, 0)
"dispose", "dispose",
G_CALLBACK (dialog_disposed), G_CALLBACK (dialog_disposed),
#else
"destroy",
G_CALLBACK (dialog_destroyed),
#endif
dialog); dialog);
g_signal_connect (dialog->custom_entry, g_signal_connect (dialog->custom_entry,
"changed", "changed",

View File

@ -120,20 +120,12 @@ pluma_history_entry_get_property (GObject *object,
} }
static void static void
#if GTK_CHECK_VERSION (3, 0, 0)
pluma_history_entry_dispose (GObject *object) pluma_history_entry_dispose (GObject *object)
#else
pluma_history_entry_destroy (GtkObject *object)
#endif
{ {
pluma_history_entry_set_enable_completion (PLUMA_HISTORY_ENTRY (object), pluma_history_entry_set_enable_completion (PLUMA_HISTORY_ENTRY (object),
FALSE); FALSE);
#if GTK_CHECK_VERSION (3, 0, 0)
G_OBJECT_CLASS (pluma_history_entry_parent_class)->dispose (object); G_OBJECT_CLASS (pluma_history_entry_parent_class)->dispose (object);
#else
GTK_OBJECT_CLASS (pluma_history_entry_parent_class)->destroy (object);
#endif
} }
static void static void
@ -158,18 +150,11 @@ static void
pluma_history_entry_class_init (PlumaHistoryEntryClass *klass) pluma_history_entry_class_init (PlumaHistoryEntryClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
#if !GTK_CHECK_VERSION (3, 0, 0)
GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass);
#endif
object_class->set_property = pluma_history_entry_set_property; object_class->set_property = pluma_history_entry_set_property;
object_class->get_property = pluma_history_entry_get_property; object_class->get_property = pluma_history_entry_get_property;
object_class->finalize = pluma_history_entry_finalize; object_class->finalize = pluma_history_entry_finalize;
#if GTK_CHECK_VERSION (3, 0, 0)
object_class->dispose = pluma_history_entry_dispose; object_class->dispose = pluma_history_entry_dispose;
#else
gtkobject_class->destroy = pluma_history_entry_destroy;
#endif
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_HISTORY_ID, PROP_HISTORY_ID,

View File

@ -100,11 +100,7 @@ enum
static guint signals[LAST_SIGNAL] = { 0 }; static guint signals[LAST_SIGNAL] = { 0 };
static void static void
#if GTK_CHECK_VERSION (3, 0, 0)
pluma_notebook_dispose (GObject *object) pluma_notebook_dispose (GObject *object)
#else
pluma_notebook_destroy (GtkObject *object)
#endif
{ {
PlumaNotebook *notebook = PLUMA_NOTEBOOK (object); PlumaNotebook *notebook = PLUMA_NOTEBOOK (object);
@ -124,28 +120,17 @@ pluma_notebook_destroy (GtkObject *object)
notebook->priv->destroy_has_run = TRUE; notebook->priv->destroy_has_run = TRUE;
} }
#if GTK_CHECK_VERSION (3, 0, 0)
G_OBJECT_CLASS (pluma_notebook_parent_class)->dispose (object); G_OBJECT_CLASS (pluma_notebook_parent_class)->dispose (object);
#else
GTK_OBJECT_CLASS (pluma_notebook_parent_class)->destroy (object);
#endif
} }
static void static void
pluma_notebook_class_init (PlumaNotebookClass *klass) pluma_notebook_class_init (PlumaNotebookClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
#if !GTK_CHECK_VERSION (3, 0, 0)
GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass);
#endif
GtkNotebookClass *notebook_class = GTK_NOTEBOOK_CLASS (klass); GtkNotebookClass *notebook_class = GTK_NOTEBOOK_CLASS (klass);
object_class->finalize = pluma_notebook_finalize; object_class->finalize = pluma_notebook_finalize;
#if GTK_CHECK_VERSION (3, 0, 0)
object_class->dispose = pluma_notebook_dispose; object_class->dispose = pluma_notebook_dispose;
#else
gtkobject_class->destroy = pluma_notebook_destroy;
#endif
notebook_class->change_current_page = pluma_notebook_change_current_page; notebook_class->change_current_page = pluma_notebook_change_current_page;
@ -261,13 +246,6 @@ find_tab_num_at_pos (PlumaNotebook *notebook,
tab_pos = gtk_notebook_get_tab_pos (GTK_NOTEBOOK (notebook)); tab_pos = gtk_notebook_get_tab_pos (GTK_NOTEBOOK (notebook));
#if !GTK_CHECK_VERSION (3, 0, 0)
if (GTK_NOTEBOOK (notebook)->first_tab == NULL)
{
return AFTER_ALL_TABS;
}
#endif
/* For some reason unfullscreen + quick click can /* For some reason unfullscreen + quick click can
cause a wrong click event to be reported to the tab */ cause a wrong click event to be reported to the tab */
if (!is_in_notebook_window (notebook, abs_x, abs_y)) if (!is_in_notebook_window (notebook, abs_x, abs_y))
@ -689,11 +667,7 @@ pluma_notebook_new (void)
static void static void
pluma_notebook_switch_page_cb (GtkNotebook *notebook, pluma_notebook_switch_page_cb (GtkNotebook *notebook,
#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *page, GtkWidget *page,
#else
GtkNotebookPage *page,
#endif
guint page_num, guint page_num,
gpointer data) gpointer data)
{ {

View File

@ -108,11 +108,7 @@ struct _PlumaViewPrivate
/* The search entry completion is shared among all the views */ /* The search entry completion is shared among all the views */
GtkListStore *search_completion_model = NULL; GtkListStore *search_completion_model = NULL;
#if GTK_CHECK_VERSION (3, 0, 0)
static void pluma_view_dispose (GObject *object); static void pluma_view_dispose (GObject *object);
#else
static void pluma_view_destroy (GtkObject *object);
#endif
static void pluma_view_finalize (GObject *object); static void pluma_view_finalize (GObject *object);
static gint pluma_view_focus_out (GtkWidget *widget, static gint pluma_view_focus_out (GtkWidget *widget,
GdkEventFocus *event); GdkEventFocus *event);
@ -198,19 +194,12 @@ static void
pluma_view_class_init (PlumaViewClass *klass) pluma_view_class_init (PlumaViewClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
#if !GTK_CHECK_VERSION (3, 0, 0)
GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass);
#endif
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkTextViewClass *text_view_class = GTK_TEXT_VIEW_CLASS (klass); GtkTextViewClass *text_view_class = GTK_TEXT_VIEW_CLASS (klass);
GtkBindingSet *binding_set; GtkBindingSet *binding_set;
#if GTK_CHECK_VERSION (3, 0, 0)
object_class->dispose = pluma_view_dispose; object_class->dispose = pluma_view_dispose;
#else
gtkobject_class->destroy = pluma_view_destroy;
#endif
object_class->finalize = pluma_view_finalize; object_class->finalize = pluma_view_finalize;
widget_class->focus_out_event = pluma_view_focus_out; widget_class->focus_out_event = pluma_view_focus_out;
@ -419,11 +408,7 @@ pluma_view_init (PlumaView *view)
} }
static void static void
#if GTK_CHECK_VERSION (3, 0, 0)
pluma_view_dispose (GObject *object) pluma_view_dispose (GObject *object)
#else
pluma_view_destroy (GtkObject *object)
#endif
{ {
PlumaView *view; PlumaView *view;
@ -448,11 +433,7 @@ pluma_view_destroy (GtkObject *object)
current_buffer_removed (view); current_buffer_removed (view);
g_signal_handlers_disconnect_by_func (view, on_notify_buffer_cb, NULL); g_signal_handlers_disconnect_by_func (view, on_notify_buffer_cb, NULL);
#if GTK_CHECK_VERSION (3, 0, 0)
(* G_OBJECT_CLASS (pluma_view_parent_class)->dispose) (object); (* G_OBJECT_CLASS (pluma_view_parent_class)->dispose) (object);
#else
(* GTK_OBJECT_CLASS (pluma_view_parent_class)->destroy) (object);
#endif
} }
static void static void