image_background_set_color_from_options(fs->imd, TRUE);
image_set_delay_flip(fs->imd, options->fullscreen.clean_flip);
image_auto_refresh_enable(fs->imd, fs->normal_imd->auto_refresh);
-
+
if (options->fullscreen.clean_flip)
{
image_set_update_func(fs->imd, fullscreen_image_update_cb, fs);
image_change_from_image(fs->imd, fs->normal_imd);
+ if (options->stereo.enable_fsmode) {
+ image_stereo_set(fs->imd, options->stereo.fsmode);
+ }
+
gtk_widget_show(fs->window);
/* for hiding the mouse */
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
image_change_from_image(fs->normal_imd, fs->imd);
+
+ if (options->stereo.enable_fsmode) {
+ image_stereo_set(fs->normal_imd, options->stereo.mode);
+ }
+
#ifdef HIDE_WINDOW_IN_FULLSCREEN
gtk_widget_show(fs->normal_window);
#endif
options->metadata.keywords_case_sensitive = c_options->metadata.keywords_case_sensitive;
options->metadata.write_orientation = c_options->metadata.write_orientation;
+ options->stereo.mode = c_options->stereo.mode;
+ options->stereo.fallback = c_options->stereo.fallback;
+ options->stereo.fsmode = c_options->stereo.fsmode;
+ options->stereo.enable_fsmode = c_options->stereo.enable_fsmode;
+ options->stereo.fixed_w = c_options->stereo.fixed_w;
+ options->stereo.fixed_h = c_options->stereo.fixed_h;
+ options->stereo.fixed_x1 = c_options->stereo.fixed_x1;
+ options->stereo.fixed_y1 = c_options->stereo.fixed_y1;
+ options->stereo.fixed_x2 = c_options->stereo.fixed_x2;
+ options->stereo.fixed_y2 = c_options->stereo.fixed_y2;
+
#ifdef DEBUG
set_debug_level(debug_c);
#endif
gtk_widget_show(combo);
}
+static void stereo_mode_menu_cb(GtkWidget *combo, gpointer data)
+{
+ gint *option = data;
+
+ switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
+ {
+ case 0:
+ default:
+ *option = PR_STEREO_NONE;
+ break;
+ case 1:
+ *option = PR_STEREO_ANAGLYPH;
+ break;
+ case 2:
+ *option = PR_STEREO_HORIZ;
+ break;
+ case 3:
+ *option = PR_STEREO_VERT;
+ break;
+ case 4:
+ *option = PR_STEREO_FIXED;
+ break;
+ }
+}
+
+static void add_stereo_mode_menu(GtkWidget *table, gint column, gint row, const gchar *text,
+ guint option, guint *option_c, gboolean add_fixed)
+{
+ GtkWidget *combo;
+ gint current = 0;
+
+ *option_c = option;
+
+ pref_table_label(table, column, row, text, 0.0);
+
+ combo = gtk_combo_box_new_text();
+
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Single image"));
+ if (option == PR_STEREO_NONE) current = 0;
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Anaglyph"));
+ if (option == PR_STEREO_ANAGLYPH) current = 1;
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Side by Side"));
+ if (option == PR_STEREO_HORIZ) current = 2;
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Above - below"));
+ if (option == PR_STEREO_VERT) current = 3;
+
+ if (add_fixed)
+ {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Fixed position"));
+ if (option == PR_STEREO_FIXED) current = 4;
+ }
+
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current);
+
+ g_signal_connect(G_OBJECT(combo), "changed",
+ G_CALLBACK(stereo_mode_menu_cb), option_c);
+
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1,
+ GTK_EXPAND | GTK_FILL, 0, 0, 0);
+ gtk_widget_show(combo);
+}
+
static void filter_store_populate(void)
{
GList *work;
#endif
}
+/* stereo tab */
+static void config_tab_stereo(GtkWidget *notebook)
+{
+ GtkWidget *vbox;
+ GtkWidget *group;
+ GtkWidget *table;
+ vbox = scrolled_notebook_page(notebook, _("Stereo"));
+
+ group = pref_group_new(vbox, FALSE, _("Windowed stereo mode"), GTK_ORIENTATION_VERTICAL);
+
+ table = pref_table_new(group, 2, 1, FALSE, FALSE);
+ add_stereo_mode_menu(table, 0, 0, _("Windowed stereo mode"), options->stereo.mode, &c_options->stereo.mode, FALSE);
+
+ pref_checkbox_new_int(group, _("Fall back to single image mode on 2d"),
+ options->stereo.fallback, &c_options->stereo.fallback);
+
+ group = pref_group_new(vbox, FALSE, _("Fullscreen stereo mode"), GTK_ORIENTATION_VERTICAL);
+ pref_checkbox_new_int(group, _("Use different settings for fullscreen"),
+ options->stereo.enable_fsmode, &c_options->stereo.enable_fsmode);
+ table = pref_table_new(group, 2, 1, FALSE, FALSE);
+ add_stereo_mode_menu(table, 0, 0, _("Fullscreen stereo mode"), options->stereo.fsmode, &c_options->stereo.fsmode, TRUE);
+
+}
+
/* Main preferences window */
static void config_window_create(void)
{
config_tab_files(notebook);
config_tab_metadata(notebook);
config_tab_color(notebook);
+ config_tab_stereo(notebook);
config_tab_behavior(notebook);
gtk_widget_show(notebook);