diff options
author | infirit <[email protected]> | 2014-07-25 20:11:47 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2014-07-25 20:27:30 +0200 |
commit | ce0c44174000d1a38ae79b2c04f73dd250451d14 (patch) | |
tree | bbc8ae5609ac0533fbc3fd9c37abbdd62094ac18 /src | |
parent | fe245c3ae28bd9638bcbbb0f1982a356635e8f2c (diff) | |
download | eom-ce0c44174000d1a38ae79b2c04f73dd250451d14.tar.bz2 eom-ce0c44174000d1a38ae79b2c04f73dd250451d14.tar.xz |
Cleanup GtkObject<->GtkWidget code.
Diffstat (limited to 'src')
-rw-r--r-- | src/eom-sidebar.c | 23 | ||||
-rw-r--r-- | src/eom-thumb-view.c | 38 |
2 files changed, 28 insertions, 33 deletions
diff --git a/src/eom-sidebar.c b/src/eom-sidebar.c index 4ca9e89..a8a3e40 100644 --- a/src/eom-sidebar.c +++ b/src/eom-sidebar.c @@ -88,11 +88,11 @@ eom_sidebar_destroy (GtkObject *object) eom_sidebar->priv->page_model = NULL; } - #if GTK_CHECK_VERSION(3, 0, 0) +#if GTK_CHECK_VERSION(3, 0, 0) (* GTK_WIDGET_CLASS (eom_sidebar_parent_class)->destroy) (object); - #else +#else (* GTK_OBJECT_CLASS (eom_sidebar_parent_class)->destroy) (object); - #endif +#endif } static void @@ -187,28 +187,25 @@ eom_sidebar_get_property (GObject *object, static void eom_sidebar_class_init (EomSidebarClass *eom_sidebar_class) { - // REFERENCE: - // https://git.gnome.org/browse/eog/tree/src/eog-sidebar.c?h=gnome-3-0 - GObjectClass *g_object_class; GtkWidgetClass *widget_class; - #if !GTK_CHECK_VERSION(3, 0, 0) +#if !GTK_CHECK_VERSION(3, 0, 0) GtkObjectClass *gtk_object_klass; - #endif +#endif g_object_class = G_OBJECT_CLASS (eom_sidebar_class); widget_class = GTK_WIDGET_CLASS (eom_sidebar_class); - #if !GTK_CHECK_VERSION(3, 0, 0) +#if !GTK_CHECK_VERSION(3, 0, 0) gtk_object_klass = GTK_OBJECT_CLASS (eom_sidebar_class); - #endif +#endif g_type_class_add_private (g_object_class, sizeof (EomSidebarPrivate)); - #if GTK_CHECK_VERSION(3, 0, 0) +#if GTK_CHECK_VERSION(3, 0, 0) widget_class->destroy = eom_sidebar_destroy; - #else +#else gtk_object_klass->destroy = eom_sidebar_destroy; - #endif +#endif g_object_class->get_property = eom_sidebar_get_property; g_object_class->set_property = eom_sidebar_set_property; diff --git a/src/eom-thumb-view.c b/src/eom-thumb-view.c index eb40d01..6302867 100644 --- a/src/eom-thumb-view.c +++ b/src/eom-thumb-view.c @@ -70,42 +70,40 @@ eom_thumb_view_finalize (GObject *object) G_OBJECT_CLASS (eom_thumb_view_parent_class)->finalize (object); } +static void #if GTK_CHECK_VERSION(3, 0, 0) -eom_thumb_view_dispose (GObject *object) -{ - EomThumbView *thumbview; - g_return_if_fail (EOM_IS_THUMB_VIEW (object)); - thumbview = EOM_THUMB_VIEW (object); - - G_OBJECT_CLASS (eom_thumb_view_parent_class)->dispose (object); -} +eom_thumb_view_destroy (GtkWidget *object) #else -static void eom_thumb_view_destroy (GtkObject *object) +#endif { EomThumbView *thumbview; g_return_if_fail (EOM_IS_THUMB_VIEW (object)); thumbview = EOM_THUMB_VIEW (object); +#if GTK_CHECK_VERSION(3, 0, 0) + GTK_WIDGET_CLASS (eom_thumb_view_parent_class)->destroy (object); +#else GTK_OBJECT_CLASS (eom_thumb_view_parent_class)->destroy (object); -} #endif +} static void eom_thumb_view_class_init (EomThumbViewClass *class) { - #if GTK_CHECK_VERSION(3, 0, 0) - GObjectClass *gobject_class = G_OBJECT_CLASS (class); - - gobject_class->constructed = eom_thumb_view_init; - gobject_class->dispose = eom_thumb_view_dispose; - #else GObjectClass *gobject_class = G_OBJECT_CLASS (class); +#if GTK_CHECK_VERSION(3, 0, 0) + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); +#else GtkObjectClass *object_class = GTK_OBJECT_CLASS (class); +#endif gobject_class->finalize = eom_thumb_view_finalize; +#if GTK_CHECK_VERSION(3, 0, 0) + widget_class->destroy = eom_thumb_view_destroy; +#else object_class->destroy = eom_thumb_view_destroy; - #endif +#endif g_type_class_add_private (class, sizeof (EomThumbViewPrivate)); } @@ -243,11 +241,11 @@ thumbview_on_adjustment_changed_cb (EomThumbView *thumbview, static void thumbview_on_parent_set_cb (GtkWidget *widget, - #if GTK_CHECK_VERSION(3, 0, 0) +#if GTK_CHECK_VERSION(3, 0, 0) GtkWidget *old_parent, - #else +#else GtkObject *old_parent, - #endif +#endif gpointer user_data) { EomThumbView *thumbview = EOM_THUMB_VIEW (widget); |