Mercurial > geeqie
changeset 334:df868b947aa0
Rename image-related options.
author | zas_ |
---|---|
date | Sat, 12 Apr 2008 15:04:58 +0000 |
parents | 767b53cd9ab7 |
children | 0cb7f0ac5c20 |
files | src/globals.c src/image.c src/img-view.c src/layout_image.c src/main.c src/pan-view.c src/preferences.c src/rcfile.c src/slideshow.c src/typedefs.h src/view_file_icon.c src/view_file_list.c |
diffstat | 12 files changed, 175 insertions(+), 174 deletions(-) [+] |
line wrap: on
line diff
--- a/src/globals.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/globals.c Sat Apr 12 15:04:58 2008 +0000 @@ -50,15 +50,15 @@ options->safe_delete_path = NULL; options->safe_delete_size = 128; options->restore_tool = FALSE; - options->zoom_mode = ZOOM_RESET_ORIGINAL; - options->two_pass_zoom = TRUE; - options->scroll_reset_method = SCROLL_RESET_TOPLEFT; - options->fit_window = FALSE; - options->limit_window_size = FALSE; - options->zoom_to_fit_expands = TRUE; - options->max_window_size = 100; - options->limit_autofit_size = FALSE; - options->max_autofit_size = 100; + options->image.zoom_mode = ZOOM_RESET_ORIGINAL; + options->image.zoom_2pass = TRUE; + options->image.scroll_reset_method = SCROLL_RESET_TOPLEFT; + options->image.fit_window_to_image = FALSE; + options->image.limit_window_size = FALSE; + options->image.zoom_to_fit_allow_expand = TRUE; + options->image.max_window_size = 100; + options->image.limit_autofit_size = FALSE; + options->image.max_autofit_size = 100; options->thumbnails.max_width = DEFAULT_THUMB_WIDTH; options->thumbnails.max_height = DEFAULT_THUMB_HEIGHT; options->thumbnails.enable_caching = TRUE; @@ -86,14 +86,14 @@ options->collections.rectangular_selection = FALSE; - options->tile_cache_max = 10; + options->image.tile_cache_max = 10; options->thumbnails.quality = (gint)GDK_INTERP_TILES; - options->zoom_quality = (gint)GDK_INTERP_BILINEAR; - options->dither_quality = (gint)GDK_RGB_DITHER_NORMAL; + options->image.zoom_quality = (gint)GDK_INTERP_BILINEAR; + options->image.dither_quality = (gint)GDK_RGB_DITHER_NORMAL; - options->zoom_increment = 5; + options->image.zoom_increment = 5; - options->enable_read_ahead = TRUE; + options->image.enable_read_ahead = TRUE; options->place_dialogs_under_mouse = FALSE; @@ -124,7 +124,7 @@ options->lazy_image_sync = FALSE; options->update_on_time_change = TRUE; - options->exif_rotate_enable = TRUE; + options->image.exif_rotate_enable = TRUE; /* color profiles */ options->color_profile.enabled = FALSE;
--- a/src/image.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/image.c Sat Apr 12 15:04:58 2008 +0000 @@ -427,13 +427,13 @@ if (!image_get_pixbuf(imd)) return; - if (options->exif_rotate_enable || + if (options->image.exif_rotate_enable || (imd->color_profile_enable && imd->color_profile_use_image) ) { exif = exif_read_fd(imd->image_fd, (imd->color_profile_enable && imd->color_profile_use_image)); } - if (options->exif_rotate_enable && exif) + if (options->image.exif_rotate_enable && exif) { gint orientation; @@ -938,7 +938,7 @@ pixbuf = image_get_pixbuf(imd); - if (options->enable_read_ahead && imd->image_fd && pixbuf) + if (options->image.enable_read_ahead && imd->image_fd && pixbuf) { if (imd->il) { @@ -1090,7 +1090,7 @@ imd->title_right = g_strdup(title_right); imd->title_show_zoom = show_zoom; - if (!options->fit_window) window = NULL; + if (!options->image.fit_window_to_image) window = NULL; pixbuf_renderer_set_parent((PixbufRenderer *)imd->pr, (GtkWindow *)window); @@ -1663,7 +1663,7 @@ pixbuf_renderer_get_scaled_size((PixbufRenderer *)imd->pr, &width, &height); } - pb = gdk_pixbuf_scale_simple(pixbuf, width, height, (GdkInterpType)options->zoom_quality); + pb = gdk_pixbuf_scale_simple(pixbuf, width, height, (GdkInterpType)options->image.zoom_quality); gdk_pixbuf_render_pixmap_and_mask (pb, &pixmap, NULL, 128); gdk_window_set_back_pixmap(rootwindow, pixmap, FALSE); @@ -1715,17 +1715,17 @@ static void image_options_set(ImageWindow *imd) { - g_object_set(G_OBJECT(imd->pr), "zoom_quality", options->zoom_quality, - "zoom_2pass", options->two_pass_zoom, - "zoom_expand", options->zoom_to_fit_expands, - "dither_quality", options->dither_quality, - "scroll_reset", options->scroll_reset_method, - "cache_display", options->tile_cache_max, - "window_fit", (imd->top_window_sync && options->fit_window), - "window_limit", options->limit_window_size, - "window_limit_value", options->max_window_size, - "autofit_limit", options->limit_autofit_size, - "autofit_limit_value", options->max_autofit_size, + g_object_set(G_OBJECT(imd->pr), "zoom_quality", options->image.zoom_quality, + "zoom_2pass", options->image.zoom_2pass, + "zoom_expand", options->image.zoom_to_fit_allow_expand, + "dither_quality", options->image.dither_quality, + "scroll_reset", options->image.scroll_reset_method, + "cache_display", options->image.tile_cache_max, + "window_fit", (imd->top_window_sync && options->image.fit_window_to_image), + "window_limit", options->image.limit_window_size, + "window_limit_value", options->image.max_window_size, + "autofit_limit", options->image.limit_autofit_size, + "autofit_limit_value", options->image.max_autofit_size, NULL);
--- a/src/img-view.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/img-view.c Sat Apr 12 15:04:58 2008 +0000 @@ -112,7 +112,7 @@ if (next) { info = collection_next_by_info(cd, info); - if (options->enable_read_ahead) + if (options->image.enable_read_ahead) { read_ahead_info = collection_next_by_info(cd, info); if (!read_ahead_info) read_ahead_info = collection_prev_by_info(cd, info); @@ -121,7 +121,7 @@ else { info = collection_prev_by_info(cd, info); - if (options->enable_read_ahead) + if (options->image.enable_read_ahead) { read_ahead_info = collection_prev_by_info(cd, info); if (!read_ahead_info) read_ahead_info = collection_next_by_info(cd, info); @@ -130,7 +130,7 @@ if (info) { - image_change_from_collection(imd, cd, info, image_zoom_get_default(imd, options->zoom_mode)); + image_change_from_collection(imd, cd, info, image_zoom_get_default(imd, options->image.zoom_mode)); if (read_ahead_info) image_prebuffer_set(imd, read_ahead_info->fd); } @@ -151,17 +151,17 @@ if (last) { info = collection_get_last(cd); - if (options->enable_read_ahead) read_ahead_info = collection_prev_by_info(cd, info); + if (options->image.enable_read_ahead) read_ahead_info = collection_prev_by_info(cd, info); } else { info = collection_get_first(cd); - if (options->enable_read_ahead) read_ahead_info = collection_next_by_info(cd, info); + if (options->image.enable_read_ahead) read_ahead_info = collection_next_by_info(cd, info); } if (info) { - image_change_from_collection(imd, cd, info, image_zoom_get_default(imd, options->zoom_mode)); + image_change_from_collection(imd, cd, info, image_zoom_get_default(imd, options->image.zoom_mode)); if (read_ahead_info) image_prebuffer_set(imd, read_ahead_info->fd); } } @@ -221,9 +221,9 @@ vw->list_pointer = work; fd = work->data; - image_change_fd(imd, fd, image_zoom_get_default(imd, options->zoom_mode)); + image_change_fd(imd, fd, image_zoom_get_default(imd, options->image.zoom_mode)); - if (options->enable_read_ahead && work_ahead) + if (options->image.enable_read_ahead && work_ahead) { FileData *next_fd = work_ahead->data; image_prebuffer_set(imd, next_fd); @@ -252,9 +252,9 @@ vw->list_pointer = work; fd = work->data; - image_change_fd(imd, fd, image_zoom_get_default(imd, options->zoom_mode)); + image_change_fd(imd, fd, image_zoom_get_default(imd, options->image.zoom_mode)); - if (options->enable_read_ahead && work_ahead) + if (options->image.enable_read_ahead && work_ahead) { FileData *next_fd = work_ahead->data; image_prebuffer_set(imd, next_fd); @@ -877,8 +877,8 @@ G_CALLBACK(view_window_key_press_cb), vw); if (cd && info) { - image_change_from_collection(vw->imd, cd, info, image_zoom_get_default(NULL, options->zoom_mode)); - if (options->enable_read_ahead) + image_change_from_collection(vw->imd, cd, info, image_zoom_get_default(NULL, options->image.zoom_mode)); + if (options->image.enable_read_ahead) { CollectInfo * r_info = collection_next_by_info(cd, info); if (!r_info) r_info = collection_prev_by_info(cd, info); @@ -889,9 +889,9 @@ { view_window_set_list(vw, list); vw->list_pointer = vw->list; - image_change_fd(vw->imd, (FileData *)vw->list->data, image_zoom_get_default(NULL, options->zoom_mode)); + image_change_fd(vw->imd, (FileData *)vw->list->data, image_zoom_get_default(NULL, options->image.zoom_mode)); - if (options->enable_read_ahead) + if (options->image.enable_read_ahead) { GList *work = vw->list->next; if (work) image_prebuffer_set(vw->imd, (FileData *)work->data); @@ -899,7 +899,7 @@ } else { - image_change_fd(vw->imd, fd, image_zoom_get_default(NULL, options->zoom_mode)); + image_change_fd(vw->imd, fd, image_zoom_get_default(NULL, options->image.zoom_mode)); } if (image_zoom_get(vw->imd) == 0.0) @@ -910,10 +910,10 @@ { pixbuf_renderer_get_scaled_size(PIXBUF_RENDERER(vw->imd->pr), &w, &h); } - if (options->limit_window_size) + if (options->image.limit_window_size) { - gint mw = gdk_screen_width() * options->max_window_size / 100; - gint mh = gdk_screen_height() * options->max_window_size / 100; + gint mw = gdk_screen_width() * options->image.max_window_size / 100; + gint mh = gdk_screen_height() * options->image.max_window_size / 100; if (w > mw) w = mw; if (h > mh) h = mh; @@ -1351,10 +1351,10 @@ vw->list_pointer = vw->list; fd = vw->list->data; - image_change_fd(vw->imd, fd, image_zoom_get_default(vw->imd, options->zoom_mode)); + image_change_fd(vw->imd, fd, image_zoom_get_default(vw->imd, options->image.zoom_mode)); work = vw->list->next; - if (options->enable_read_ahead && work) + if (options->image.enable_read_ahead && work) { fd = work->data; image_prebuffer_set(vw->imd, fd); @@ -1362,7 +1362,7 @@ } else { - image_change_fd(vw->imd, NULL, image_zoom_get_default(vw->imd, options->zoom_mode)); + image_change_fd(vw->imd, NULL, image_zoom_get_default(vw->imd, options->image.zoom_mode)); } } @@ -1481,7 +1481,7 @@ if (source && info_list) { - image_change_from_collection(imd, source, info_list->data, image_zoom_get_default(imd, options->zoom_mode)); + image_change_from_collection(imd, source, info_list->data, image_zoom_get_default(imd, options->image.zoom_mode)); } else { @@ -1492,7 +1492,7 @@ vw->list_pointer = vw->list; } - image_change_fd(imd, fd, image_zoom_get_default(imd, options->zoom_mode)); + image_change_fd(imd, fd, image_zoom_get_default(imd, options->image.zoom_mode)); } } } @@ -1598,7 +1598,7 @@ } if (image_get_fd(imd) == image_fd) { - image_change_fd(imd, NULL, image_zoom_get_default(imd, options->zoom_mode)); + image_change_fd(imd, NULL, image_zoom_get_default(imd, options->image.zoom_mode)); } } @@ -1644,7 +1644,7 @@ fd = NULL; } - image_change_fd(imd, fd, image_zoom_get_default(imd, options->zoom_mode)); + image_change_fd(imd, fd, image_zoom_get_default(imd, options->image.zoom_mode)); } }
--- a/src/layout_image.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/layout_image.c Sat Apr 12 15:04:58 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, options->zoom_mode)); + image_change_fd(lw->image, fd, image_zoom_get_default(lw->image, options->image.zoom_mode)); image_set_scroll_center(lw->image, sx, sy); @@ -1135,7 +1135,7 @@ } */ layout_image_set_fd(lw, fd); - if (options->enable_read_ahead) image_prebuffer_set(lw->image, read_ahead_fd); + if (options->image.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, options->zoom_mode)); - if (options->enable_read_ahead) + image_change_from_collection(lw->image, cd, info, image_zoom_get_default(lw->image, options->image.zoom_mode)); + if (options->image.enable_read_ahead) { CollectInfo *r_info; if (forward)
--- a/src/main.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/main.c Sat Apr 12 15:04:58 2008 +0000 @@ -113,7 +113,7 @@ gdouble get_zoom_increment(void) { - return ((options->zoom_increment != 0) ? (gdouble)options->zoom_increment / 10.0 : 1.0); + return ((options->image.zoom_increment != 0) ? (gdouble)options->image.zoom_increment / 10.0 : 1.0); } /*
--- a/src/pan-view.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/pan-view.c Sat Apr 12 15:04:58 2008 +0000 @@ -131,7 +131,7 @@ tmp = pi->pixbuf; pi->pixbuf = gdk_pixbuf_scale_simple(tmp, pi->width, pi->height, - (GdkInterpType)options->zoom_quality); + (GdkInterpType)options->image.zoom_quality); g_object_unref(tmp); }
--- a/src/preferences.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/preferences.c Sat Apr 12 15:04:58 2008 +0000 @@ -111,24 +111,24 @@ static void zoom_mode_original_cb(GtkWidget *widget, gpointer data) { if (GTK_TOGGLE_BUTTON (widget)->active) - c_options->zoom_mode = ZOOM_RESET_ORIGINAL; + c_options->image.zoom_mode = ZOOM_RESET_ORIGINAL; } static void zoom_mode_fit_cb(GtkWidget *widget, gpointer data) { if (GTK_TOGGLE_BUTTON (widget)->active) - c_options->zoom_mode = ZOOM_RESET_FIT_WINDOW; + c_options->image.zoom_mode = ZOOM_RESET_FIT_WINDOW; } static void zoom_mode_none_cb(GtkWidget *widget, gpointer data) { if (GTK_TOGGLE_BUTTON (widget)->active) - c_options->zoom_mode = ZOOM_RESET_NONE; + c_options->image.zoom_mode = ZOOM_RESET_NONE; } static void zoom_increment_cb(GtkWidget *spin, gpointer data) { - c_options->zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 10.0 + 0.01); + c_options->image.zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 10.0 + 0.01); } static void slideshow_delay_cb(GtkWidget *spin, gpointer data) @@ -189,14 +189,14 @@ options->safe_delete_size = c_options->safe_delete_size; options->restore_tool = c_options->restore_tool; options->save_window_positions = c_options->save_window_positions; - options->zoom_mode = c_options->zoom_mode; - options->two_pass_zoom = c_options->two_pass_zoom; - options->fit_window = c_options->fit_window; - options->limit_window_size = c_options->limit_window_size; - options->zoom_to_fit_expands = c_options->zoom_to_fit_expands; - options->max_window_size = c_options->max_window_size; - options->limit_autofit_size = c_options->limit_autofit_size; - options->max_autofit_size = c_options->max_autofit_size; + options->image.zoom_mode = c_options->image.zoom_mode; + options->image.zoom_2pass = c_options->image.zoom_2pass; + options->image.fit_window_to_image = c_options->image.fit_window_to_image; + options->image.limit_window_size = c_options->image.limit_window_size; + options->image.zoom_to_fit_allow_expand = c_options->image.zoom_to_fit_allow_expand; + options->image.max_window_size = c_options->image.max_window_size; + options->image.limit_autofit_size = c_options->image.limit_autofit_size; + options->image.max_autofit_size = c_options->image.max_autofit_size; options->progressive_key_scrolling = c_options->progressive_key_scrolling; options->thumbnails.max_width = c_options->thumbnails.max_width; options->thumbnails.max_height = c_options->thumbnails.max_height; @@ -224,14 +224,14 @@ options->collections.rectangular_selection = c_options->collections.rectangular_selection; - options->tile_cache_max = c_options->tile_cache_max; + options->image.tile_cache_max = c_options->image.tile_cache_max; options->thumbnails.quality = c_options->thumbnails.quality; - options->zoom_quality = c_options->zoom_quality; + options->image.zoom_quality = c_options->image.zoom_quality; - options->zoom_increment = c_options->zoom_increment; + options->image.zoom_increment = c_options->image.zoom_increment; - options->enable_read_ahead = c_options->enable_read_ahead; + options->image.enable_read_ahead = c_options->image.enable_read_ahead; if (options->user_specified_window_background != c_options->user_specified_window_background || !gdk_color_equal(&options->window_background_color, &c_options->window_background_color)) @@ -254,7 +254,7 @@ } options->update_on_time_change = c_options->update_on_time_change; - options->exif_rotate_enable = c_options->exif_rotate_enable; + options->image.exif_rotate_enable = c_options->image.exif_rotate_enable; options->dupe_custom_threshold = c_options->dupe_custom_threshold; @@ -879,42 +879,42 @@ group = pref_group_new(vbox, FALSE, _("Zoom"), GTK_ORIENTATION_VERTICAL); #if 0 - add_dither_menu(dither_quality, &c_options->dither_quality, _("Dithering method:"), group); + add_dither_menu(dither_quality, &c_options->image.dither_quality, _("Dithering method:"), group); #endif table = pref_table_new(group, 2, 1, FALSE, FALSE); - add_quality_menu(table, 0, 0, _("Quality:"), options->zoom_quality, &c_options->zoom_quality); + add_quality_menu(table, 0, 0, _("Quality:"), options->image.zoom_quality, &c_options->image.zoom_quality); pref_checkbox_new_int(group, _("Two pass zooming"), - options->two_pass_zoom, &c_options->two_pass_zoom); + options->image.zoom_2pass, &c_options->image.zoom_2pass); pref_checkbox_new_int(group, _("Allow enlargement of image for zoom to fit"), - options->zoom_to_fit_expands, &c_options->zoom_to_fit_expands); + options->image.zoom_to_fit_allow_expand, &c_options->image.zoom_to_fit_allow_expand); hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); ct_button = pref_checkbox_new_int(hbox, _("Limit image size when autofitting (%):"), - options->limit_autofit_size, &c_options->limit_autofit_size); + options->image.limit_autofit_size, &c_options->image.limit_autofit_size); spin = pref_spin_new_int(hbox, NULL, NULL, 10, 150, 1, - options->max_autofit_size, &c_options->max_autofit_size); + options->image.max_autofit_size, &c_options->image.max_autofit_size); pref_checkbox_link_sensitivity(ct_button, spin); - c_options->zoom_increment = options->zoom_increment; + c_options->image.zoom_increment = options->image.zoom_increment; spin = pref_spin_new(group, _("Zoom increment:"), NULL, - 0.1, 4.0, 0.1, 1, (double)options->zoom_increment / 10.0, + 0.1, 4.0, 0.1, 1, (double)options->image.zoom_increment / 10.0, G_CALLBACK(zoom_increment_cb), NULL); gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS); group = pref_group_new(vbox, FALSE, _("When new image is selected:"), GTK_ORIENTATION_VERTICAL); - c_options->zoom_mode = options->zoom_mode; + c_options->image.zoom_mode = options->image.zoom_mode; button = pref_radiobutton_new(group, NULL, _("Zoom to original size"), - (options->zoom_mode == ZOOM_RESET_ORIGINAL), + (options->image.zoom_mode == ZOOM_RESET_ORIGINAL), G_CALLBACK(zoom_mode_original_cb), NULL); button = pref_radiobutton_new(group, button, _("Fit image to window"), - (options->zoom_mode == ZOOM_RESET_FIT_WINDOW), + (options->image.zoom_mode == ZOOM_RESET_FIT_WINDOW), G_CALLBACK(zoom_mode_fit_cb), NULL); button = pref_radiobutton_new(group, button, _("Leave Zoom at previous setting"), - (options->zoom_mode == ZOOM_RESET_NONE), + (options->image.zoom_mode == ZOOM_RESET_NONE), G_CALLBACK(zoom_mode_none_cb), NULL); group = pref_group_new(vbox, FALSE, _("Appearance"), GTK_ORIENTATION_VERTICAL); @@ -930,9 +930,9 @@ pref_checkbox_new_int(group, _("Refresh on file change"), options->update_on_time_change, &c_options->update_on_time_change); pref_checkbox_new_int(group, _("Preload next image"), - options->enable_read_ahead, &c_options->enable_read_ahead); + options->image.enable_read_ahead, &c_options->image.enable_read_ahead); pref_checkbox_new_int(group, _("Auto rotate image using Exif information"), - options->exif_rotate_enable, &c_options->exif_rotate_enable); + options->image.exif_rotate_enable, &c_options->image.exif_rotate_enable); } /* windows tab */ @@ -961,14 +961,14 @@ group = pref_group_new(vbox, FALSE, _("Size"), GTK_ORIENTATION_VERTICAL); pref_checkbox_new_int(group, _("Fit window to image when tools are hidden/floating"), - options->fit_window, &c_options->fit_window); + options->image.fit_window_to_image, &c_options->image.fit_window_to_image); hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); ct_button = pref_checkbox_new_int(hbox, _("Limit size when auto-sizing window (%):"), - options->limit_window_size, &c_options->limit_window_size); + options->image.limit_window_size, &c_options->image.limit_window_size); spin = pref_spin_new_int(hbox, NULL, NULL, 10, 150, 1, - options->max_window_size, &c_options->max_window_size); + options->image.max_window_size, &c_options->image.max_window_size); pref_checkbox_link_sensitivity(ct_button, spin); group = pref_group_new(vbox, FALSE, _("Layout"), GTK_ORIENTATION_VERTICAL); @@ -1374,7 +1374,7 @@ 0, 100, 1, options->dupe_custom_threshold, &c_options->dupe_custom_threshold); pref_spin_new_int(group, _("Offscreen cache size (Mb per image):"), NULL, - 0, 128, 1, options->tile_cache_max, &c_options->tile_cache_max); + 0, 128, 1, options->image.tile_cache_max, &c_options->image.tile_cache_max); group = pref_group_new(vbox, FALSE, _("Color profiles"), GTK_ORIENTATION_VERTICAL); #ifndef HAVE_LCMS
--- a/src/rcfile.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/rcfile.c Sat Apr 12 15:04:58 2008 +0000 @@ -287,30 +287,35 @@ write_bool_option(ssi, "tree_descend_folders", options->tree_descend_subdirs); write_bool_option(ssi, "lazy_image_sync", options->lazy_image_sync); write_bool_option(ssi, "update_on_time_change", options->update_on_time_change); - write_bool_option(ssi, "exif_auto_rotate", options->exif_rotate_enable); + write_bool_option(ssi, "exif_auto_rotate", options->image.exif_rotate_enable); secure_fputc(ssi, '\n'); write_bool_option(ssi, "enable_startup_path", options->startup_path_enable); write_char_option(ssi, "startup_path", options->startup_path); secure_fputc(ssi, '\n'); - secure_fprintf(ssi, "zoom_mode: "); - if (options->zoom_mode == ZOOM_RESET_ORIGINAL) secure_fprintf(ssi, "original\n"); - if (options->zoom_mode == ZOOM_RESET_FIT_WINDOW) secure_fprintf(ssi, "fit\n"); - if (options->zoom_mode == ZOOM_RESET_NONE) secure_fprintf(ssi, "dont_change\n"); - write_bool_option(ssi, "two_pass_scaling", options->two_pass_zoom); - write_bool_option(ssi, "zoom_to_fit_allow_expand", options->zoom_to_fit_expands); - secure_fputc(ssi, '\n'); + secure_fprintf(ssi, "##### Image Options #####\n\n"); - write_bool_option(ssi, "fit_window_to_image", options->fit_window); - write_bool_option(ssi, "limit_window_size", options->limit_window_size); - write_int_option(ssi, "max_window_size", options->max_window_size); - write_bool_option(ssi, "limit_autofit_size", options->limit_autofit_size); - write_int_option(ssi, "max_autofit_size", options->max_autofit_size); + secure_fprintf(ssi, "image.zoom_mode: "); + if (options->image.zoom_mode == ZOOM_RESET_ORIGINAL) secure_fprintf(ssi, "original\n"); + if (options->image.zoom_mode == ZOOM_RESET_FIT_WINDOW) secure_fprintf(ssi, "fit\n"); + if (options->image.zoom_mode == ZOOM_RESET_NONE) secure_fprintf(ssi, "dont_change\n"); + write_bool_option(ssi, "image.zoom_2pass", options->image.zoom_2pass); + write_bool_option(ssi, "image.zoom_to_fit_allow_expand", options->image.zoom_to_fit_allow_expand); + write_bool_option(ssi, "image.fit_window_to_image", options->image.fit_window_to_image); + write_bool_option(ssi, "image.limit_window_size", options->image.limit_window_size); + write_int_option(ssi, "image.max_window_size", options->image.max_window_size); + write_bool_option(ssi, "image.limit_autofit_size", options->image.limit_autofit_size); + write_int_option(ssi, "image.max_autofit_size", options->image.max_autofit_size); + write_int_option(ssi, "image.scroll_reset_method", options->image.scroll_reset_method); + write_int_option(ssi, "image_cache_size_max", options->image.tile_cache_max); + write_int_option(ssi, "image.zoom_quality", options->image.zoom_quality); + write_int_option(ssi, "image.dither_quality", options->image.dither_quality); + write_int_option(ssi, "image.zoom_increment", options->image.zoom_increment); + write_bool_option(ssi, "image.enable_read_ahead", options->image.enable_read_ahead); secure_fputc(ssi, '\n'); write_bool_option(ssi, "progressive_keyboard_scrolling", options->progressive_key_scrolling); - write_int_option(ssi, "scroll_reset_method", options->scroll_reset_method); secure_fputc(ssi, '\n'); write_bool_option(ssi, "thumbnails.enabled", options->thumbnails.enabled); @@ -348,11 +353,6 @@ write_bool_option(ssi, "mouse_wheel_scrolls", options->mousewheel_scrolls); write_bool_option(ssi, "in_place_rename", options->enable_in_place_rename); write_int_option(ssi, "open_recent_max", options->recent_list_max); - write_int_option(ssi, "image_cache_size_max", options->tile_cache_max); - write_int_option(ssi, "zoom_quality", options->zoom_quality); - write_int_option(ssi, "dither_quality", options->dither_quality); - write_int_option(ssi, "zoom_increment", options->zoom_increment); - write_bool_option(ssi, "enable_read_ahead", options->enable_read_ahead); write_bool_option(ssi, "display_dialogs_under_mouse", options->place_dialogs_under_mouse); secure_fputc(ssi, '\n'); @@ -544,39 +544,50 @@ "lazy_image_sync", value, options->lazy_image_sync); options->update_on_time_change = read_bool_option(f, option, "update_on_time_change", value, options->update_on_time_change); - options->exif_rotate_enable = read_bool_option(f, option, - "exif_auto_rotate", value, options->exif_rotate_enable); + options->image.exif_rotate_enable = read_bool_option(f, option, + "exif_auto_rotate", value, options->image.exif_rotate_enable); options->startup_path_enable = read_bool_option(f, option, "enable_startup_path", value, options->startup_path_enable); options->startup_path = read_char_option(f, option, "startup_path", value_all, options->startup_path); - if (strcasecmp(option, "zoom_mode") == 0) + if (strcasecmp(option, "image.zoom_mode") == 0) { - if (strcasecmp(value, "original") == 0) options->zoom_mode = ZOOM_RESET_ORIGINAL; - if (strcasecmp(value, "fit") == 0) options->zoom_mode = ZOOM_RESET_FIT_WINDOW; - if (strcasecmp(value, "dont_change") == 0) options->zoom_mode = ZOOM_RESET_NONE; + if (strcasecmp(value, "original") == 0) options->image.zoom_mode = ZOOM_RESET_ORIGINAL; + if (strcasecmp(value, "fit") == 0) options->image.zoom_mode = ZOOM_RESET_FIT_WINDOW; + if (strcasecmp(value, "dont_change") == 0) options->image.zoom_mode = ZOOM_RESET_NONE; } - options->two_pass_zoom = read_bool_option(f, option, - "two_pass_scaling", value, options->two_pass_zoom); - options->zoom_to_fit_expands = read_bool_option(f, option, - "zoom_to_fit_allow_expand", value, options->zoom_to_fit_expands); + options->image.zoom_2pass = read_bool_option(f, option, + "image.zoom_2pass", value, options->image.zoom_2pass); + options->image.zoom_to_fit_allow_expand = read_bool_option(f, option, + "image.zoom_to_fit_allow_expand", value, options->image.zoom_to_fit_allow_expand); + options->image.fit_window_to_image = read_bool_option(f, option, + "image.fit_window_to_image", value, options->image.fit_window_to_image); + options->image.limit_window_size = read_bool_option(f, option, + "image.limit_window_size", value, options->image.limit_window_size); + options->image.max_window_size = read_int_option(f, option, + "image.max_window_size", value, options->image.max_window_size); + options->image.limit_autofit_size = read_bool_option(f, option, + "image.limit_autofit_size", value, options->image.limit_autofit_size); + options->image.max_autofit_size = read_int_option(f, option, + "image.max_autofit_size", value, options->image.max_autofit_size); + options->image.scroll_reset_method = read_int_option(f, option, + "image.scroll_reset_method", value, options->image.scroll_reset_method); + options->image.tile_cache_max = read_int_option(f, option, + "image.cache_size_max", value, options->image.tile_cache_max); + options->image.zoom_quality = CLAMP(read_int_option(f, option, + "image.zoom_quality", value, options->image.zoom_quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER); + options->image.dither_quality = CLAMP(read_int_option(f, option, + "image.dither_quality", value, options->image.dither_quality), GDK_RGB_DITHER_NONE, GDK_RGB_DITHER_MAX); + options->image.zoom_increment = read_int_option(f, option, + "image.zoom_increment", value, options->image.zoom_increment); + options->image.enable_read_ahead = read_bool_option(f, option, + "image.enable_read_ahead", value, options->image.enable_read_ahead); - options->fit_window = read_bool_option(f, option, - "fit_window_to_image", value, options->fit_window); - options->limit_window_size = read_bool_option(f, option, - "limit_window_size", value, options->limit_window_size); - options->max_window_size = read_int_option(f, option, - "max_window_size", value, options->max_window_size); - options->limit_autofit_size = read_bool_option(f, option, - "limit_autofit_size", value, options->limit_autofit_size); - options->max_autofit_size = read_int_option(f, option, - "max_autofit_size", value, options->max_autofit_size); options->progressive_key_scrolling = read_bool_option(f, option, "progressive_keyboard_scrolling", value, options->progressive_key_scrolling); - options->scroll_reset_method = read_int_option(f, option, - "scroll_reset_method", value, options->scroll_reset_method); + options->thumbnails.enabled = read_bool_option(f, option, "thumbnails.enabled", value, options->thumbnails.enabled); @@ -638,20 +649,6 @@ options->recent_list_max = read_int_option(f, option, "open_recent_max", value, options->recent_list_max); - options->tile_cache_max = read_int_option(f, option, - "image_cache_size_max", value, options->tile_cache_max); - - options->zoom_quality = CLAMP(read_int_option(f, option, - "zoom_quality", value, options->zoom_quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER); - options->dither_quality = CLAMP(read_int_option(f, option, - "dither_quality", value, options->dither_quality), GDK_RGB_DITHER_NONE, GDK_RGB_DITHER_MAX); - - options->zoom_increment = read_int_option(f, option, - "zoom_increment", value, options->zoom_increment); - - options->enable_read_ahead = read_bool_option(f, option, - "enable_read_ahead", value, options->enable_read_ahead); - options->place_dialogs_under_mouse = read_bool_option(f, option, "display_dialogs_under_mouse", value, options->place_dialogs_under_mouse);
--- a/src/slideshow.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/slideshow.c Sat Apr 12 15:04:58 2008 +0000 @@ -183,7 +183,7 @@ if (ss->filelist) { ss->slide_fd = file_data_ref((FileData *)g_list_nth_data(ss->filelist, row)); - image_change_fd(ss->imd, ss->slide_fd, image_zoom_get_default(ss->imd, options->zoom_mode)); + image_change_fd(ss->imd, ss->slide_fd, image_zoom_get_default(ss->imd, options->image.zoom_mode)); } else if (ss->cd) { @@ -192,7 +192,7 @@ info = g_list_nth_data(ss->cd->list, row); ss->slide_fd = file_data_ref(info->fd); - image_change_from_collection(ss->imd, ss->cd, info, image_zoom_get_default(ss->imd, options->zoom_mode)); + image_change_from_collection(ss->imd, ss->cd, info, image_zoom_get_default(ss->imd, options->image.zoom_mode)); } else { @@ -200,7 +200,7 @@ if (ss->from_selection) { - image_change_fd(ss->imd, ss->slide_fd, image_zoom_get_default(ss->imd, options->zoom_mode)); + image_change_fd(ss->imd, ss->slide_fd, image_zoom_get_default(ss->imd, options->image.zoom_mode)); layout_status_update_info(ss->layout, NULL); } else @@ -221,7 +221,7 @@ /* read ahead */ - if (options->enable_read_ahead) + if (options->image.enable_read_ahead) { gint r; if (forward)
--- a/src/typedefs.h Sat Apr 12 09:41:44 2008 +0000 +++ b/src/typedefs.h Sat Apr 12 15:04:58 2008 +0000 @@ -782,22 +782,26 @@ gint recent_list_max; /* image */ - gint exif_rotate_enable; - gint zoom_mode; - gint two_pass_zoom; - gint scroll_reset_method; - gint fit_window; - gint limit_window_size; - gint zoom_to_fit_expands; - gint max_window_size; - gint limit_autofit_size; - gint max_autofit_size; - gint tile_cache_max; /* in megabytes */ - gint zoom_quality; - gint dither_quality; - gint zoom_increment; /* 10 is 1.0, 5 is 0.05, 20 is 2.0, etc. */ - gint enable_read_ahead; - + struct { + gint exif_rotate_enable; + gint scroll_reset_method; + gint fit_window_to_image; + gint limit_window_size; + gint max_window_size; + gint limit_autofit_size; + gint max_autofit_size; + + gint tile_cache_max; /* in megabytes */ + gint dither_quality; + gint enable_read_ahead; + + gint zoom_mode; + gint zoom_2pass; + gint zoom_to_fit_allow_expand; + gint zoom_quality; + gint zoom_increment; /* 10 is 1.0, 5 is 0.05, 20 is 2.0, etc. */ + } image; + gint user_specified_window_background; GdkColor window_background_color;
--- a/src/view_file_icon.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/view_file_icon.c Sat Apr 12 15:04:58 2008 +0000 @@ -380,7 +380,7 @@ cur_fd = layout_image_get_fd(vfi->layout); if (sel_fd == cur_fd) return; /* no change */ - if (options->enable_read_ahead) + if (options->image.enable_read_ahead) { gint row;
--- a/src/view_file_list.c Sat Apr 12 09:41:44 2008 +0000 +++ b/src/view_file_list.c Sat Apr 12 15:04:58 2008 +0000 @@ -848,7 +848,7 @@ row = g_list_index(vfl->list, sel_fd); // FIXME sidecar data - if (sel_fd && options->enable_read_ahead && row >= 0) + if (sel_fd && options->image.enable_read_ahead && row >= 0) { if (row > g_list_index(vfl->list, cur_fd) && row + 1 < vflist_count(vfl, NULL))