[evince] [libview] Remove GtkObject
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] [libview] Remove GtkObject
- Date: Mon, 27 Sep 2010 17:38:02 +0000 (UTC)
commit 212d9a536bc60e711b779feb5e8aa33db654997d
Author: Christian Persch <chpe gnome org>
Date: Mon Sep 27 19:36:05 2010 +0200
[libview] Remove GtkObject
Use GObjectClass:dispose instead of GtkObjectClass:destroy.
Based on a patch by Matthias Clasen.
Bug #630676.
libview/ev-view-presentation.c | 19 +++++++++++++------
libview/ev-view.c | 16 +++++++++-------
2 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index 99779b4..2b39ca6 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -901,7 +901,7 @@ ev_view_presentation_update_current_surface (EvViewPresentation *pview,
}
static void
-ev_view_presentation_destroy (GtkObject *object)
+ev_view_presentation_dispose (GObject *object)
{
EvViewPresentation *pview = EV_VIEW_PRESENTATION (object);
@@ -945,7 +945,7 @@ ev_view_presentation_destroy (GtkObject *object)
pview->goto_entry = NULL;
}
- GTK_OBJECT_CLASS (ev_view_presentation_parent_class)->destroy (object);
+ G_OBJECT_CLASS (ev_view_presentation_parent_class)->dispose (object);
}
static void
@@ -1121,7 +1121,11 @@ ev_view_presentation_key_press_event (GtkWidget *widget,
EvViewPresentation *pview = EV_VIEW_PRESENTATION (widget);
if (pview->state == EV_PRESENTATION_END)
+#if GTK_CHECK_VERSION (2, 90, 8)
+ return gtk_bindings_activate_event (G_OBJECT (widget), event);
+#else
return gtk_bindings_activate_event (GTK_OBJECT (widget), event);
+#endif
switch (event->keyval) {
case GDK_KEY_b:
@@ -1177,7 +1181,11 @@ ev_view_presentation_key_press_event (GtkWidget *widget,
return TRUE;
}
- return gtk_bindings_activate_event (GTK_OBJECT (widget), event);
+#if GTK_CHECK_VERSION (2, 90, 8)
+ return gtk_bindings_activate_event (G_OBJECT (widget), event);
+#else
+ return gtk_bindings_activate_event (GTK_OBJECT (widget), event);
+#endif
}
static gboolean
@@ -1419,11 +1427,12 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
GtkBindingSet *binding_set;
klass->change_page = ev_view_presentation_change_page;
+ gobject_class->dispose = ev_view_presentation_dispose;
+
widget_class->size_request = ev_view_presentation_size_request;
widget_class->realize = ev_view_presentation_realize;
#if GTK_CHECK_VERSION (2, 90, 8)
@@ -1437,8 +1446,6 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
widget_class->motion_notify_event = ev_view_presentation_motion_notify_event;
widget_class->scroll_event = ev_view_presentation_scroll_event;
- gtk_object_class->destroy = ev_view_presentation_destroy;
-
gobject_class->constructor = ev_view_presentation_constructor;
gobject_class->set_property = ev_view_presentation_set_property;
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 8d336cc..d8f3c0d 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -221,7 +221,7 @@ static void on_adjustment_value_changed (GtkAdjustment
/*** GObject ***/
static void ev_view_finalize (GObject *object);
-static void ev_view_destroy (GtkObject *object);
+static void ev_view_dispose (GObject *object);
static void ev_view_class_init (EvViewClass *class);
static void ev_view_init (EvView *view);
@@ -4177,7 +4177,11 @@ ev_view_key_press_event (GtkWidget *widget,
return FALSE;
}
- return gtk_bindings_activate_event (GTK_OBJECT (widget), event);
+#if GTK_CHECK_VERSION (2, 90, 8)
+ return gtk_bindings_activate_event (G_OBJECT (widget), event);
+#else
+ return gtk_bindings_activate_event (GTK_OBJECT (widget), event);
+#endif
}
static gint
@@ -4566,7 +4570,7 @@ ev_view_finalize (GObject *object)
}
static void
-ev_view_destroy (GtkObject *object)
+ev_view_dispose (GObject *object)
{
EvView *view = EV_VIEW (object);
@@ -4624,7 +4628,7 @@ ev_view_destroy (GtkObject *object)
ev_view_set_scroll_adjustments (GTK_LAYOUT (view), NULL, NULL);
- GTK_OBJECT_CLASS (ev_view_parent_class)->destroy (object);
+ G_OBJECT_CLASS (ev_view_parent_class)->dispose (object);
}
static AtkObject *
@@ -4664,11 +4668,11 @@ static void
ev_view_class_init (EvViewClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
- GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
GtkLayoutClass *layout_class = GTK_LAYOUT_CLASS (class);
GtkBindingSet *binding_set;
+ object_class->dispose = ev_view_dispose;
object_class->finalize = ev_view_finalize;
#if GTK_CHECK_VERSION (2, 90, 8)
@@ -4695,8 +4699,6 @@ ev_view_class_init (EvViewClass *class)
widget_class->popup_menu = ev_view_popup_menu;
widget_class->query_tooltip = ev_view_query_tooltip;
- gtk_object_class->destroy = ev_view_destroy;
-
layout_class->set_scroll_adjustments = ev_view_set_scroll_adjustments;
class->binding_activated = ev_view_scroll;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]