changeset 322:d344bcf37618

Rationalize fullscreen options naming.
author zas_
date Fri, 11 Apr 2008 23:32:22 +0000
parents 20d9b3cd7434
children 4e721492341b
files src/fullscreen.c src/globals.c src/image-overlay.c src/main.c src/preferences.c src/rcfile.c src/typedefs.h
diffstat 7 files changed, 60 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/src/fullscreen.c	Fri Apr 11 23:01:00 2008 +0000
+++ b/src/fullscreen.c	Fri Apr 11 23:32:22 2008 +0000
@@ -194,7 +194,7 @@
 
 static gboolean fullscreen_saver_block_cb(gpointer data)
 {
-	if (options->fullscreen_disable_saver)
+	if (options->fullscreen.disable_saver)
 		{
 		fullscreen_saver_deactivate();
 		}
@@ -234,8 +234,8 @@
 	fs->stop_func = stop_func;
 	fs->stop_data = stop_data;
 
-	if (debug) printf("full screen requests screen %d\n", options->fullscreen_screen);
-	fullscreen_prefs_get_geometry(options->fullscreen_screen, window, &x, &y, &w, &h,
+	if (debug) printf("full screen requests screen %d\n", options->fullscreen.screen);
+	fullscreen_prefs_get_geometry(options->fullscreen.screen, window, &x, &y, &w, &h,
 				      &screen, &same);
 
 	fs->window = window_new(GTK_WINDOW_TOPLEVEL, "fullscreen", NULL, NULL, _("Full screen"));
@@ -243,14 +243,14 @@
 	/* this requests no decorations, if you still have them complain to the window manager author(s) */
 	gtk_window_set_decorated(GTK_WINDOW(fs->window), FALSE);
 
-	if (options->fullscreen_screen < 0)
+	if (options->fullscreen.screen < 0)
 		{
 		/* If we want control of the window size and position this is not what we want.
 		 * Geeqie needs control of which monitor(s) to use for full screen.
 		 */
 		gtk_window_fullscreen(GTK_WINDOW(fs->window));
 		}
-	else if (options->fullscreen_above)
+	else if (options->fullscreen.above)
 		{
 		/* request to be above other windows */
 		gtk_window_set_keep_above(GTK_WINDOW(fs->window), TRUE);
@@ -294,10 +294,10 @@
 		image_background_set_color(fs->imd, &options->window_background_color);
 		}
 
-	image_set_delay_flip(fs->imd, options->fullscreen_clean_flip);
+	image_set_delay_flip(fs->imd, options->fullscreen.clean_flip);
 	image_auto_refresh(fs->imd, fs->normal_imd->auto_refresh_interval);
 
-	if (options->fullscreen_clean_flip)
+	if (options->fullscreen.clean_flip)
 		{
 		image_set_update_func(fs->imd, fullscreen_image_update_cb, fs);
 		image_set_complete_func(fs->imd, fullscreen_image_complete_cb, fs);
--- a/src/globals.c	Fri Apr 11 23:01:00 2008 +0000
+++ b/src/globals.c	Fri Apr 11 23:32:22 2008 +0000
@@ -100,12 +100,12 @@
 	options->user_specified_window_background = FALSE;
 	memset(&options->window_background_color, 0, sizeof(options->window_background_color));
 	
-	options->fullscreen_screen = -1;
-	options->fullscreen_clean_flip = FALSE;
-	options->fullscreen_disable_saver = TRUE;
-	options->fullscreen_above = FALSE;
-	options->show_fullscreen_info = TRUE;
-	options->fullscreen_info = NULL;
+	options->fullscreen.screen = -1;
+	options->fullscreen.clean_flip = FALSE;
+	options->fullscreen.disable_saver = TRUE;
+	options->fullscreen.above = FALSE;
+	options->fullscreen.show_info = TRUE;
+	options->fullscreen.info = NULL;
 	
 	options->dupe_custom_threshold = 99;
 
--- a/src/image-overlay.c	Fri Apr 11 23:01:00 2008 +0000
+++ b/src/image-overlay.c	Fri Apr 11 23:32:22 2008 +0000
@@ -329,7 +329,7 @@
  		}
  	else
  		{
- 		text = image_osd_mkinfo(options->fullscreen_info, imd, vars);
+ 		text = image_osd_mkinfo(options->fullscreen.info, imd, vars);
 		}
 
 	g_free(size);
--- a/src/main.c	Fri Apr 11 23:01:00 2008 +0000
+++ b/src/main.c	Fri Apr 11 23:32:22 2008 +0000
@@ -1178,7 +1178,7 @@
 		options->color_profile_input_name[i] = NULL;
 		}
 
-	options->fullscreen_info = g_strdup("%collection%(%number%/%total%) <b>%name%</b>\n"
+	options->fullscreen.info = g_strdup("%collection%(%number%/%total%) <b>%name%</b>\n"
 				   "%res%|%date%|%size%\n"
 				   "%fAperture%|%fShutterSpeed%|%fISOSpeedRating%|%fFocalLength%|%fExposureBias%\n"
 				   "%fCamera%|%fFlash%");
@@ -1204,7 +1204,7 @@
 			layout_geometry_get(NULL, &options->main_window_x, &options->main_window_y,
 					    &options->main_window_w, &options->main_window_h);
 			}
-		options->show_fullscreen_info = image_osd_get(lw->image, NULL, NULL);
+		options->fullscreen.show_info = image_osd_get(lw->image, NULL, NULL);
 		}
 
 	layout_geometry_get_dividers(NULL, &options->window_hdivider_pos, &options->window_vdivider_pos);
@@ -1479,7 +1479,7 @@
 						    collection_get_first(first_collection));
 			}
 		}
-	image_osd_set(lw->image, FALSE, options->show_fullscreen_info);
+	image_osd_set(lw->image, FALSE, options->fullscreen.show_info);
 
 	g_free(geometry);
 	g_free(cmd_path);
--- a/src/preferences.c	Fri Apr 11 23:01:00 2008 +0000
+++ b/src/preferences.c	Fri Apr 11 23:32:22 2008 +0000
@@ -242,15 +242,15 @@
 		view_window_colors_update();
 		}
 
-	options->fullscreen_screen = c_options->fullscreen_screen;
-	options->fullscreen_clean_flip = c_options->fullscreen_clean_flip;
-	options->fullscreen_disable_saver = c_options->fullscreen_disable_saver;
-	options->fullscreen_above = c_options->fullscreen_above;
-	options->show_fullscreen_info = c_options->show_fullscreen_info;
-	if (c_options->fullscreen_info)
+	options->fullscreen.screen = c_options->fullscreen.screen;
+	options->fullscreen.clean_flip = c_options->fullscreen.clean_flip;
+	options->fullscreen.disable_saver = c_options->fullscreen.disable_saver;
+	options->fullscreen.above = c_options->fullscreen.above;
+	options->fullscreen.show_info = c_options->fullscreen.show_info;
+	if (c_options->fullscreen.info)
 		{
-		g_free(options->fullscreen_info);
-		options->fullscreen_info = g_strdup(c_options->fullscreen_info);
+		g_free(options->fullscreen.info);
+		options->fullscreen.info = g_strdup(c_options->fullscreen.info);
 		}
 
 	options->update_on_time_change = c_options->update_on_time_change;
@@ -776,8 +776,8 @@
 	gtk_text_buffer_get_start_iter(pTextBuffer, &iStart);
 	gtk_text_buffer_get_end_iter(pTextBuffer, &iEnd);
 
-	if (c_options->fullscreen_info) g_free(c_options->fullscreen_info);
-	c_options->fullscreen_info = gtk_text_buffer_get_text(pTextBuffer, &iStart, &iEnd, TRUE);
+	if (c_options->fullscreen.info) g_free(c_options->fullscreen.info);
+	c_options->fullscreen.info = gtk_text_buffer_get_text(pTextBuffer, &iStart, &iEnd, TRUE);
 }
 
 /* general options tab */
@@ -1261,18 +1261,18 @@
 
 	group = pref_group_new(vbox, FALSE, _("Full screen"), GTK_ORIENTATION_VERTICAL);
 
-	c_options->fullscreen_screen = options->fullscreen_screen;
-	c_options->fullscreen_above = options->fullscreen_above;
-	hbox = fullscreen_prefs_selection_new(_("Location:"), &c_options->fullscreen_screen, &c_options->fullscreen_above);
+	c_options->fullscreen.screen = options->fullscreen.screen;
+	c_options->fullscreen.above = options->fullscreen.above;
+	hbox = fullscreen_prefs_selection_new(_("Location:"), &c_options->fullscreen.screen, &c_options->fullscreen.above);
 	gtk_box_pack_start(GTK_BOX(group), hbox, FALSE, FALSE, 0);
 	gtk_widget_show(hbox);
 
 	pref_checkbox_new_int(group, _("Smooth image flip"),
-			      options->fullscreen_clean_flip, &c_options->fullscreen_clean_flip);
+			      options->fullscreen.clean_flip, &c_options->fullscreen.clean_flip);
 	pref_checkbox_new_int(group, _("Disable screen saver"),
-			      options->fullscreen_disable_saver, &c_options->fullscreen_disable_saver);
+			      options->fullscreen.disable_saver, &c_options->fullscreen.disable_saver);
 	pref_checkbox_new_int(group, _("Always show fullscreen info"),
-			      options->show_fullscreen_info, &c_options->show_fullscreen_info);
+			      options->fullscreen.show_info, &c_options->fullscreen.show_info);
 	pref_label_new(group, _("Fullscreen info string"));
 
 	scrolled = gtk_scrolled_window_new(NULL, NULL);
@@ -1303,7 +1303,7 @@
 	gtk_widget_show(fullscreen_info_view);
 
 	buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(fullscreen_info_view));
-	gtk_text_buffer_set_text(buffer, options->fullscreen_info, -1);
+	gtk_text_buffer_set_text(buffer, options->fullscreen.info, -1);
 	g_signal_connect(G_OBJECT(buffer), "changed",
 			 G_CALLBACK(fullscreen_info_view_changed_cb), fullscreen_info_view);
 
--- a/src/rcfile.c	Fri Apr 11 23:01:00 2008 +0000
+++ b/src/rcfile.c	Fri Apr 11 23:32:22 2008 +0000
@@ -360,12 +360,12 @@
 	write_color_option(ssi, "window_background_color", &options->window_background_color);
 	secure_fputc(ssi, '\n');
 
-	write_int_option(ssi, "fullscreen_screen", options->fullscreen_screen);
-	write_bool_option(ssi, "fullscreen_clean_flip", options->fullscreen_clean_flip);
-	write_bool_option(ssi, "fullscreen_disable_saver", options->fullscreen_disable_saver);
-	write_bool_option(ssi, "fullscreen_above", options->fullscreen_above);
-	write_bool_option(ssi, "show_fullscreen_info", options->show_fullscreen_info);
-	write_char_option(ssi, "fullscreen_info", options->fullscreen_info);
+	write_int_option(ssi, "fullscreen.screen", options->fullscreen.screen);
+	write_bool_option(ssi, "fullscreen.clean_flip", options->fullscreen.clean_flip);
+	write_bool_option(ssi, "fullscreen.disable_saver", options->fullscreen.disable_saver);
+	write_bool_option(ssi, "fullscreen.above", options->fullscreen.above);
+	write_bool_option(ssi, "fullscreen.show_info", options->fullscreen.show_info);
+	write_char_option(ssi, "fullscreen.info", options->fullscreen.info);
 	secure_fputc(ssi, '\n');
 
 	write_int_option(ssi, "custom_similarity_threshold", options->dupe_custom_threshold);
@@ -660,18 +660,18 @@
 		read_color_option(f, option,
 			"window_background_color", value, &options->window_background_color);
 
-		options->fullscreen_screen = read_int_option(f, option,
-			"fullscreen_screen", value, options->fullscreen_screen);
-		options->fullscreen_clean_flip = read_bool_option(f, option,
-			"fullscreen_clean_flip", value, options->fullscreen_clean_flip);
-		options->fullscreen_disable_saver = read_bool_option(f, option,
-			"fullscreen_disable_saver", value, options->fullscreen_disable_saver);
-		options->fullscreen_above = read_bool_option(f, option,
-			"fullscreen_above", value, options->fullscreen_above);
-		options->show_fullscreen_info = read_bool_option(f, option,
-			"show_fullscreen_info", value, options->show_fullscreen_info);
-		options->fullscreen_info = read_char_option(f, option,
-			"fullscreen_info", value_all, options->fullscreen_info);
+		options->fullscreen.screen = read_int_option(f, option,
+			"fullscreen.screen", value, options->fullscreen.screen);
+		options->fullscreen.clean_flip = read_bool_option(f, option,
+			"fullscreen.clean_flip", value, options->fullscreen.clean_flip);
+		options->fullscreen.disable_saver = read_bool_option(f, option,
+			"fullscreen.disable_saver", value, options->fullscreen.disable_saver);
+		options->fullscreen.above = read_bool_option(f, option,
+			"fullscreen.above", value, options->fullscreen.above);
+		options->fullscreen.show_info = read_bool_option(f, option,
+			"fullscreen.show_info", value, options->fullscreen.show_info);
+		options->fullscreen.info = read_char_option(f, option,
+			"fullscreen.info", value_all, options->fullscreen.info);
 
 		options->dupe_custom_threshold = read_int_option(f, option,
 			"custom_similarity_threshold", value, options->dupe_custom_threshold);
--- a/src/typedefs.h	Fri Apr 11 23:01:00 2008 +0000
+++ b/src/typedefs.h	Fri Apr 11 23:32:22 2008 +0000
@@ -796,12 +796,14 @@
 	gint user_specified_window_background;
 	GdkColor window_background_color;
 
-	gint fullscreen_screen;
-	gint fullscreen_clean_flip;
-	gint fullscreen_disable_saver;
-	gint fullscreen_above;
-	gint show_fullscreen_info;
-	gchar *fullscreen_info;
+	struct 	{
+		gint screen;
+		gint clean_flip;
+		gint disable_saver;
+		gint above;
+		gint show_info;
+		gchar *info;
+	} fullscreen;
 
 	gint dupe_custom_threshold;