diff src/layout_image.c @ 318:b16b9b8979e5

Add a new struct ConfOptions to handle options. Changes were made among the code to use only one global var named "options" of type ConfOptions *. Initialization takes place in new init_options().
author zas_
date Fri, 11 Apr 2008 22:14:36 +0000
parents c1f75ee307ec
children c74af1cbd61a
line wrap: on
line diff
--- a/src/layout_image.c	Fri Apr 11 20:35:37 2008 +0000
+++ b/src/layout_image.c	Fri Apr 11 22:14:36 2008 +0000
@@ -1111,7 +1111,7 @@
 
 	image_get_scroll_center(lw->image, &sx, &sy);
 
-	image_change_fd(lw->image, fd, image_zoom_get_default(lw->image, zoom_mode));
+	image_change_fd(lw->image, fd, image_zoom_get_default(lw->image, options->zoom_mode));
 
 	image_set_scroll_center(lw->image, sx, sy);
 
@@ -1135,7 +1135,7 @@
 		}
 */
 	layout_image_set_fd(lw, fd);
-	if (enable_read_ahead) image_prebuffer_set(lw->image, read_ahead_fd);
+	if (options->enable_read_ahead) image_prebuffer_set(lw->image, read_ahead_fd);
 }
 
 void layout_image_set_index(LayoutWindow *lw, gint index)
@@ -1203,8 +1203,8 @@
 {
 	if (!layout_valid(&lw)) return;
 
-	image_change_from_collection(lw->image, cd, info, image_zoom_get_default(lw->image, zoom_mode));
-	if (enable_read_ahead)
+	image_change_from_collection(lw->image, cd, info, image_zoom_get_default(lw->image, options->zoom_mode));
+	if (options->enable_read_ahead)
 		{
 		CollectInfo *r_info;
 		if (forward)
@@ -1556,7 +1556,7 @@
 				break;
 			}
 		}
-	else if ( (state & GDK_SHIFT_MASK) != (mousewheel_scrolls))
+	else if ( (state & GDK_SHIFT_MASK) != (options->mousewheel_scrolls))
 		{
 		switch (direction)
 			{
@@ -1698,7 +1698,7 @@
 
 		gtk_widget_ref(lw->split_images[i]->widget);
 
-		image_background_set_color(lw->split_images[i], user_specified_window_background ? &window_background_color : NULL);
+		image_background_set_color(lw->split_images[i], options->user_specified_window_background ? &options->window_background_color : NULL);
 
 		image_auto_refresh(lw->split_images[i], 0);