[eog] Set zoomed out antialiasing using a GSettings binding



commit bfef239942645fff4a5efe71d801ccb92a185cf7
Author: Felix Riemann <friemann gnome org>
Date:   Mon Jul 19 21:38:02 2010 +0200

    Set zoomed out antialiasing using a GSettings binding
    
    Moved to EogScrollView from EogWindow.

 src/eog-scroll-view.c |   18 ++++++++++++++++++
 src/eog-window.c      |   31 -------------------------------
 2 files changed, 18 insertions(+), 31 deletions(-)
---
diff --git a/src/eog-scroll-view.c b/src/eog-scroll-view.c
index 228bce9..edfcde9 100644
--- a/src/eog-scroll-view.c
+++ b/src/eog-scroll-view.c
@@ -77,6 +77,7 @@ static GtkTargetEntry target_table[] = {
 enum {
 	PROP_0,
 	PROP_ANTIALIAS_IN,
+	PROP_ANTIALIAS_OUT,
 	PROP_BACKGROUND_COLOR,
 	PROP_SCROLLWHEEL_ZOOM,
 	PROP_TRANSP_COLOR,
@@ -1941,6 +1942,7 @@ eog_scroll_view_set_antialiasing_out (EogScrollView *view, gboolean state)
 	if (priv->interp_type_out != new_interp_type) {
 		priv->interp_type_out = new_interp_type;
 		gtk_widget_queue_draw (GTK_WIDGET (priv->display));
+		g_object_notify (G_OBJECT (view), "antialiasing-out");
 	}
 }
 
@@ -2406,6 +2408,8 @@ eog_scroll_view_init (EogScrollView *view)
 				      NULL, NULL, NULL);
 	g_settings_bind (settings, EOG_CONF_VIEW_EXTRAPOLATE, view,
 			 "antialiasing-in", G_SETTINGS_BIND_GET);
+	g_settings_bind (settings, EOG_CONF_VIEW_INTERPOLATE, view,
+			 "antialiasing-out", G_SETTINGS_BIND_GET);
 
 	g_object_unref (settings);
 }
@@ -2470,6 +2474,12 @@ eog_scroll_view_get_property (GObject *object, guint property_id,
 		g_value_set_boolean (value, filter);
 		break;
 	}
+	case PROP_ANTIALIAS_OUT:
+	{
+		gboolean filter = (priv->interp_type_out != GDK_INTERP_NEAREST);
+		g_value_set_boolean (value, filter);
+		break;
+	}
 	case PROP_USE_BG_COLOR:
 		g_value_set_boolean (value, priv->use_bg_color);
 		break;
@@ -2507,6 +2517,9 @@ eog_scroll_view_set_property (GObject *object, guint property_id,
 	case PROP_ANTIALIAS_IN:
 		eog_scroll_view_set_antialiasing_in (view, g_value_get_boolean (value));
 		break;
+	case PROP_ANTIALIAS_OUT:
+		eog_scroll_view_set_antialiasing_out (view, g_value_get_boolean (value));
+		break;
 	case PROP_USE_BG_COLOR:
 		eog_scroll_view_set_use_bg_color (view, g_value_get_boolean (value));
 		break;
@@ -2552,6 +2565,11 @@ eog_scroll_view_class_init (EogScrollViewClass *klass)
 		g_param_spec_boolean ("antialiasing-in", NULL, NULL, TRUE,
 				      G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
 
+	g_object_class_install_property (
+		gobject_class, PROP_ANTIALIAS_OUT,
+		g_param_spec_boolean ("antialiasing-out", NULL, NULL, TRUE,
+				      G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
 	/**
 	 * EogScrollView:background-color:
 	 *
diff --git a/src/eog-window.c b/src/eog-window.c
index 255417a..0275fcf 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -226,28 +226,6 @@ eog_window_error_quark (void)
 }
 
 static void
-eog_window_interp_out_type_changed_cb (GSettings *settings,
-				       gchar     *key,
-				       gpointer   user_data)
-{
-	EogWindowPrivate *priv;
-	gboolean interpolate_out = TRUE;
-
-	eog_debug (DEBUG_PREFERENCES);
-
-	g_return_if_fail (EOG_IS_WINDOW (user_data));
-
-	priv = EOG_WINDOW (user_data)->priv;
-
-	g_return_if_fail (EOG_IS_SCROLL_VIEW (priv->view));
-
-	interpolate_out = g_settings_get_boolean (settings, key);
-
-	eog_scroll_view_set_antialiasing_out (EOG_SCROLL_VIEW (priv->view),
-					      interpolate_out);
-}
-
-static void
 eog_window_set_gallery_mode (EogWindow           *window,
 			     EogWindowGalleryPos  position,
 			     gboolean             resizable)
@@ -4256,10 +4234,6 @@ eog_window_construct_ui (EogWindow *window)
 
 	gtk_box_pack_end (GTK_BOX (priv->cbox), priv->layout, TRUE, TRUE, 0);
 
-	eog_window_interp_out_type_changed_cb (priv->view_settings,
-					       EOG_CONF_VIEW_INTERPOLATE,
-					       window);
-
 	g_settings_bind (priv->ui_settings, EOG_CONF_UI_IMAGE_GALLERY_POSITION,
 			 window, "gallery-position", G_SETTINGS_BIND_GET);
 	g_settings_bind (priv->ui_settings, EOG_CONF_UI_IMAGE_GALLERY_RESIZABLE,
@@ -4307,11 +4281,6 @@ eog_window_init (EogWindow *window)
 
 	priv->client = gconf_client_get_default ();
 
-	g_signal_connect (priv->view_settings,
-			  "changed::" EOG_CONF_VIEW_INTERPOLATE,
-			  (GCallback) eog_window_interp_out_type_changed_cb,
-			  window);
-
 	priv->client_notifications[EOG_WINDOW_NOTIFY_CAN_SAVE] =
 		gconf_client_notify_add (window->priv->client,
 					 EOG_CONF_DESKTOP_CAN_SAVE,



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