From 4eb72706ebd0635d23e96bdde7b6f9612d18d4c5 Mon Sep 17 00:00:00 2001 From: ulteq Date: Wed, 22 Aug 2018 10:56:17 +0200 Subject: Add an option to disable inplace edit --- src/options.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/options.h') diff --git a/src/options.h b/src/options.h index 936b4bd..bd2dfad 100644 --- a/src/options.h +++ b/src/options.h @@ -105,6 +105,7 @@ struct __fehoptions { double reload; int sort; int version_sort; + int no_inplace_edit; int debug; int geom_enabled; int geom_flags; -- cgit v1.2.3 From fb1cfca824b9229e110386e35112a0ad8f552553 Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Tue, 2 Oct 2018 23:36:29 +0200 Subject: Actually remove collage mode after ~7 years. --- src/Makefile | 1 - src/collage.c | 208 --------------------------------------------------------- src/feh.h | 1 - src/filelist.c | 2 +- src/main.c | 2 - src/options.c | 12 +--- src/options.h | 1 - test/status | 2 - 8 files changed, 2 insertions(+), 227 deletions(-) delete mode 100644 src/collage.c (limited to 'src/options.h') diff --git a/src/Makefile b/src/Makefile index 8a9f97e..ac4d2fe 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,7 +1,6 @@ include ../config.mk TARGETS = \ - collage.c \ events.c \ feh_png.c \ filelist.c \ diff --git a/src/collage.c b/src/collage.c deleted file mode 100644 index 2a4d9f9..0000000 --- a/src/collage.c +++ /dev/null @@ -1,208 +0,0 @@ -/* collage.c - -Copyright (C) 1999-2003 Tom Gilbert. -Copyright (C) 2010-2018 Daniel Friesel. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies of the Software and its documentation and acknowledgment shall be -given in the documentation and software packages that this Software was -used. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -#include "feh.h" -#include "winwidget.h" -#include "filelist.h" -#include "options.h" - -void init_collage_mode(void) -{ - Imlib_Image im_main; - Imlib_Image im_temp; - int ww, hh, www, hhh, xxx, yyy; - int w = 800, h = 600; - int bg_w = 0, bg_h = 0; - winwidget winwid = NULL; - Imlib_Image bg_im = NULL, im_thumb = NULL; - feh_file *file = NULL; - unsigned char trans_bg = 0; - gib_list *l, *last = NULL; - - mode = "collage"; - - weprintf("the --collage option (aka collage mode) is deprecated\n" - "and will be removed soon\n"); - - /* Use bg image dimensions for default size */ - if (opt.bg && opt.bg_file) { - if (!strcmp(opt.bg_file, "trans")) - trans_bg = 1; - else { - - D(("Time to apply a background to blend onto\n")); - if (feh_load_image_char(&bg_im, opt.bg_file) != 0) { - bg_w = gib_imlib_image_get_width(bg_im); - bg_h = gib_imlib_image_get_height(bg_im); - } - } - } - - if (!opt.limit_w || !opt.limit_h) { - if (bg_im) { - if (opt.verbose) - fputs(PACKAGE - ": No size restriction specified for collage.\n" - " You did specify a background however, so the\n" - " collage size has defaulted to the size of the image\n", - stderr); - opt.limit_w = bg_w; - opt.limit_h = bg_h; - } else { - if (opt.verbose) - fputs(PACKAGE - ": No size restriction specified for collage.\n" - " - For collage mode, you need to specify width and height.\n" - " Using defaults (width 800, height 600)\n", - stderr); - opt.limit_w = 800; - opt.limit_h = 600; - } - } - - w = opt.limit_w; - h = opt.limit_h; - D(("Limiting width to %d and height to %d\n", w, h)); - - im_main = imlib_create_image(w, h); - - if (!im_main) - eprintf("Imlib error creating image"); - - if (bg_im) - gib_imlib_blend_image_onto_image(im_main, bg_im, - gib_imlib_image_has_alpha(bg_im), 0, 0, - bg_w, bg_h, 0, 0, w, h, 1, 0, 0); - else if (trans_bg) { - gib_imlib_image_fill_rectangle(im_main, 0, 0, w, h, 0, 0, 0, 0); - gib_imlib_image_set_has_alpha(im_main, 1); - } else { - /* Colour the background */ - gib_imlib_image_fill_rectangle(im_main, 0, 0, w, h, 0, 0, 0, 255); - } - - if (opt.display) { - winwid = winwidget_create_from_image(im_main, WIN_TYPE_SINGLE); - winwidget_rename(winwid, PACKAGE " [collage mode]"); - winwidget_show(winwid); - } - - for (l = filelist; l; l = l->next) { - file = FEH_FILE(l->data); - if (last) { - filelist = feh_file_remove_from_list(filelist, last); - last = NULL; - } - D(("About to load image %s\n", file->filename)); - if (feh_load_image(&im_temp, file) != 0) { - D(("Successfully loaded %s\n", file->filename)); - if (opt.verbose) - feh_display_status('.'); - www = opt.thumb_w; - hhh = opt.thumb_h; - ww = gib_imlib_image_get_width(im_temp); - hh = gib_imlib_image_get_height(im_temp); - - if (opt.aspect) { - double ratio = 0.0; - - /* Keep the aspect ratio for the thumbnail */ - ratio = ((double) ww / hh) / ((double) www / hhh); - - if (ratio > 1.0) - hhh = opt.thumb_h / ratio; - else if (ratio != 1.0) - www = opt.thumb_w * ratio; - } - - if ((!opt.stretch) && ((www > ww) || (hhh > hh))) { - /* Don't make the image larger unless stretch is specified */ - www = ww; - hhh = hh; - } - - /* pick random coords for thumbnail */ - xxx = ((w - www) * ((double) rand() / RAND_MAX)); - yyy = ((h - hhh) * ((double) rand() / RAND_MAX)); - D(("image going on at x=%d, y=%d\n", xxx, yyy)); - - im_thumb = gib_imlib_create_cropped_scaled_image(im_temp, - 0, 0, ww, hh, www, hhh, 1); - gib_imlib_free_image_and_decache(im_temp); - - if (opt.alpha) { - DATA8 atab[256]; - - D(("Applying alpha options\n")); - gib_imlib_image_set_has_alpha(im_thumb, 1); - memset(atab, opt.alpha_level, sizeof(atab)); - gib_imlib_apply_color_modifier_to_rectangle(im_thumb, - 0, 0, www, hhh, NULL, NULL, NULL, atab); - } - gib_imlib_blend_image_onto_image(im_main, im_thumb, - gib_imlib_image_has_alpha(im_thumb), 0, 0, www, hhh, xxx, - yyy,www, hhh, 1, gib_imlib_image_has_alpha(im_thumb), 0); - gib_imlib_free_image_and_decache(im_thumb); - } else { - last = l; - if (opt.verbose) - feh_display_status('x'); - } - if (opt.display) { - winwidget_render_image(winwid, 0, 0); - if (!feh_main_iteration(0)) - exit(0); - } - } - if (opt.verbose) - fputs("\n", stderr); - - if (opt.output && opt.output_file) { - char output_buf[1024]; - if (opt.output_dir) - snprintf(output_buf, 1024, "%s/%s", opt.output_dir, opt.output_file); - else { - strncpy(output_buf, opt.output_file, 1023); - output_buf[1023] = '\0'; - } - gib_imlib_save_image(im_main, output_buf); - if (opt.verbose) { - int tw, th; - - tw = gib_imlib_image_get_width(im_main); - th = gib_imlib_image_get_height(im_main); - fprintf(stderr, PACKAGE ": File saved as %s\n", output_buf); - fprintf(stderr, - " - Image is %dx%d pixels and contains %d thumbnails\n", - tw, th, (tw / opt.thumb_w) * (th / opt.thumb_h)); - } - } - - if (!opt.display) - gib_imlib_free_image_and_decache(im_main); - - return; -} diff --git a/src/feh.h b/src/feh.h index 009f45b..1d5e918 100644 --- a/src/feh.h +++ b/src/feh.h @@ -132,7 +132,6 @@ void init_xinerama(void); #endif /* HAVE_LIBXINERAMA */ void init_multiwindow_mode(void); void init_thumbnail_mode(void); -void init_collage_mode(void); void init_index_mode(void); void init_slideshow_mode(void); void init_list_mode(void); diff --git a/src/filelist.c b/src/filelist.c index fc9fa35..3f3c96d 100644 --- a/src/filelist.c +++ b/src/filelist.c @@ -491,7 +491,7 @@ void feh_prepare_filelist(void) * we can create a properly sized thumbnail list. */ if (opt.list || opt.preload || opt.customlist || (opt.sort > SORT_MTIME) - || (opt.filter_by_dimensions && (opt.index || opt.collage || opt.thumbs || opt.bgmode))) { + || (opt.filter_by_dimensions && (opt.index || opt.thumbs || opt.bgmode))) { /* For these sort options, we have to preload images */ filelist = feh_file_info_preload(filelist); if (!gib_list_length(filelist)) diff --git a/src/main.c b/src/main.c index 1a76e2d..eff664a 100644 --- a/src/main.c +++ b/src/main.c @@ -59,8 +59,6 @@ int main(int argc, char **argv) if (opt.index) init_index_mode(); - else if (opt.collage) - init_collage_mode(); else if (opt.multiwindow) init_multiwindow_mode(); else if (opt.list || opt.customlist) diff --git a/src/options.c b/src/options.c index 38d2568..afbfafa 100644 --- a/src/options.c +++ b/src/options.c @@ -354,7 +354,6 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"title" , 1, 0, '^'}, {"alpha" , 1, 0, 'a'}, {"bg" , 1, 0, 'b'}, - {"collage" , 0, 0, 'c'}, {"draw-filename" , 0, 0, 'd'}, {"font" , 1, 0, 'e'}, {"filelist" , 1, 0, 'f'}, @@ -578,9 +577,6 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) opt.bg = 1; opt.bg_file = estrdup(optarg); break; - case 'c': - opt.collage = 1; - break; case 'd': opt.draw_filename = 1; break; @@ -853,17 +849,11 @@ static void check_options(void) } } - if ((opt.index + opt.collage) > 1) { - weprintf("you can't use collage mode and index mode together.\n" - " I'm going with index"); - opt.collage = 0; - } - if (opt.full_screen && opt.multiwindow) { eprintf("You cannot combine --fullscreen with --multiwindow"); } - if (opt.list && (opt.multiwindow || opt.index || opt.collage)) { + if (opt.list && (opt.multiwindow || opt.index)) { eprintf("You cannot combine --list with other modes"); } diff --git a/src/options.h b/src/options.h index 606b8e6..72fa03d 100644 --- a/src/options.h +++ b/src/options.h @@ -36,7 +36,6 @@ enum on_last_slide_action { struct __fehoptions { unsigned char multiwindow; unsigned char montage; - unsigned char collage; unsigned char index; unsigned char thumbs; unsigned char slideshow; diff --git a/test/status b/test/status index 2cda6d8..0151bcd 100644 --- a/test/status +++ b/test/status @@ -76,8 +76,6 @@ Overall test status, what's covered / missing [x] correct caption display ---collage - --customlist [x] correct output -- cgit v1.2.3 From 1c36c74c8ff5ad9768c854a2d88fa66fa9fe148f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 4 Nov 2018 22:07:22 +0100 Subject: Disable in-place editing by default --- src/imlib.c | 2 +- src/options.c | 8 ++++---- src/options.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/options.h') diff --git a/src/imlib.c b/src/imlib.c index 2c04128..a48d654 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -1204,7 +1204,7 @@ void feh_edit_inplace(winwidget w, int op) if (!w->file || !w->file->data || !FEH_FILE(w->file->data)->filename) return; - if (opt.no_inplace_edit) { + if (!opt.edit) { imlib_context_set_image(w->im); if (op == INPLACE_EDIT_FLIP) imlib_image_flip_vertical(); diff --git a/src/options.c b/src/options.c index dc6a9ff..19e47f6 100644 --- a/src/options.c +++ b/src/options.c @@ -398,6 +398,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"bg-fill" , 0, 0, 218}, {"bg-max" , 0, 0, 219}, {"no-jump-on-resort", 0, 0, 220}, + {"edit" , 0, 0, 221}, #ifdef HAVE_LIBEXIF {"draw-exif" , 0, 0, 223}, {"auto-rotate" , 0, 0, 242}, @@ -418,7 +419,6 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"conversion-timeout" , 1, 0, 245}, {"version-sort" , 0, 0, 246}, {"offset" , 1, 0, 247}, - {"no-inplace-edit", 0, 0, 248}, {0, 0, 0, 0} }; int optch = 0, cmdx = 0; @@ -731,6 +731,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) case 220: opt.jump_on_resort = 0; break; + case 221: + opt.edit = 1; + break; #ifdef HAVE_LIBEXIF case 223: opt.draw_exif = 1; @@ -806,9 +809,6 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) opt.offset_flags = XParseGeometry(optarg, &opt.offset_x, &opt.offset_y, (unsigned int *)&discard, (unsigned int *)&discard); break; - case 248: - opt.no_inplace_edit = 1; - break; default: break; } diff --git a/src/options.h b/src/options.h index 5734b54..1c68fa0 100644 --- a/src/options.h +++ b/src/options.h @@ -80,6 +80,7 @@ struct __fehoptions { unsigned char keep_zoom_vp; unsigned char insecure_ssl; unsigned char filter_by_dimensions; + unsigned char edit; char *output_file; char *output_dir; @@ -110,7 +111,6 @@ struct __fehoptions { double reload; int sort; int version_sort; - int no_inplace_edit; int debug; int geom_enabled; int geom_flags; -- cgit v1.2.3 From 7b873e26ed203365e9d96760b0ad5a3605574550 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 5 Nov 2018 19:51:57 +0100 Subject: Remove deprecated option --menu-bg --- ChangeLog | 1 + examples/themes | 5 ----- share/images/menubg_aluminium.png | Bin 1862 -> 0 bytes share/images/menubg_aqua.png | Bin 5325 -> 0 bytes share/images/menubg_black.png | Bin 1716 -> 0 bytes share/images/menubg_brushed.png | Bin 8649 -> 0 bytes share/images/menubg_sky.png | Bin 1928 -> 0 bytes src/main.c | 1 - src/menu.c | 2 +- src/options.c | 7 ------- src/options.h | 1 - 11 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 share/images/menubg_aluminium.png delete mode 100644 share/images/menubg_aqua.png delete mode 100644 share/images/menubg_black.png delete mode 100644 share/images/menubg_brushed.png delete mode 100644 share/images/menubg_sky.png (limited to 'src/options.h') diff --git a/ChangeLog b/ChangeLog index 667d204..f2ec192 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ git HEAD * Remove deprecated webcam scripts (feh-cam and gen-cam-menu) * Remove deprecated collage mode (-c/--collage) * Remove deprecated option --cycle-once (use --on-last-slide=quit instead) + * Remove deprecated option --menu-bg * flip and rotation (keys "<", ">", "|", and "_") no longer change the underlying file. This leaves delete ("Ctrl+Delete") as the only destructive action which is enabled by default diff --git a/examples/themes b/examples/themes index d315942..2d77770 100644 --- a/examples/themes +++ b/examples/themes @@ -41,11 +41,6 @@ booth --full-screen --hide-pointer --slideshow-delay 20 # Screw xscreensaver, use feh =) screensave --recursive --full-screen --randomize --slideshow-delay 10 --hide-pointer -# Different menus -aqua --menu-bg /usr/share/feh/images/menubg_aqua.png -sky --menu-bg /usr/share/feh/images/menubg_sky.png -black --menu-bg /usr/share/feh/images/menubg_black.png - # Some more examples, used by the feh developer rfs --full-screen --hide-pointer --auto-zoom --randomize diff --git a/share/images/menubg_aluminium.png b/share/images/menubg_aluminium.png deleted file mode 100644 index eed00f1..0000000 Binary files a/share/images/menubg_aluminium.png and /dev/null differ diff --git a/share/images/menubg_aqua.png b/share/images/menubg_aqua.png deleted file mode 100644 index 3a72590..0000000 Binary files a/share/images/menubg_aqua.png and /dev/null differ diff --git a/share/images/menubg_black.png b/share/images/menubg_black.png deleted file mode 100644 index 08b4c2b..0000000 Binary files a/share/images/menubg_black.png and /dev/null differ diff --git a/share/images/menubg_brushed.png b/share/images/menubg_brushed.png deleted file mode 100644 index 32fad47..0000000 Binary files a/share/images/menubg_brushed.png and /dev/null differ diff --git a/share/images/menubg_sky.png b/share/images/menubg_sky.png deleted file mode 100644 index e0be8ca..0000000 Binary files a/share/images/menubg_sky.png and /dev/null differ diff --git a/src/main.c b/src/main.c index 0d1cc4d..ded0b22 100644 --- a/src/main.c +++ b/src/main.c @@ -216,7 +216,6 @@ void feh_clean_exit(void) { delete_rm_files(); - free(opt.menu_bg); free(opt.menu_font); if(disp) diff --git a/src/menu.c b/src/menu.c index 2f8875d..fcbb490 100644 --- a/src/menu.c +++ b/src/menu.c @@ -134,7 +134,7 @@ feh_menu *feh_menu_new(void) menus = l; if (!bg) { - feh_load_image_char(&bg, opt.menu_bg); + feh_load_image_char(&bg, PREFIX "/share/feh/images/menubg_default.png"); if (bg) { border.left = border.right = border.top = border.bottom = 4; diff --git a/src/options.c b/src/options.c index 298dbab..c6165ac 100644 --- a/src/options.c +++ b/src/options.c @@ -62,7 +62,6 @@ void init_parse_options(int argc, char **argv) opt.scroll_step = 20; opt.menu_font = estrdup(DEFAULT_MENU_FONT); opt.font = NULL; - opt.menu_bg = estrdup(PREFIX "/share/feh/images/menubg_default.png"); opt.max_height = opt.max_width = UINT_MAX; opt.start_list_at = NULL; @@ -319,7 +318,6 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) /* (*name, has_arg, *flag, val) See: struct option in getopts.h */ static struct option lopts[] = { - {"menu-bg" , 1, 0, ')'}, {"debug" , 0, 0, '+'}, {"scale-down" , 0, 0, '.'}, {"max-dimension" , 1, 0, '<'}, @@ -427,11 +425,6 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) switch (optch) { case 0: break; - case ')': - free(opt.menu_bg); - opt.menu_bg = estrdup(optarg); - weprintf("The --menu-bg option is deprecated and will be removed by 2012"); - break; case '+': opt.debug = 1; break; diff --git a/src/options.h b/src/options.h index 1c68fa0..7f8fe9c 100644 --- a/src/options.h +++ b/src/options.h @@ -96,7 +96,6 @@ struct __fehoptions { char *filelistfile; char *menu_font; char *customlist; - char *menu_bg; char *caption_path; char *start_list_at; char *info_cmd; -- cgit v1.2.3