Commit 2e017bbf authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Use enum for opt.image_bg, rename --image-bg default to --image-bg checks

parent af2a4423
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ git HEAD
    * Fix useless memory use when using feh --reload on HTTP URLs
      (fun fact: strictly speaking, this was not a memory leak)
      <https://github.com/derf/feh/issues/62>
    * "--image-bg default" was renamed to "--image-bg checks"

Sun, 11 Sep 2011 12:46:50 +0200  Daniel Friesel <derf@finalrewind.org>

+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ enum slide_change { SLIDE_NEXT, SLIDE_PREV, SLIDE_RAND, SLIDE_FIRST, SLIDE_LAST,
	SLIDE_JUMP_BACK
};

enum image_bg { IMAGE_BG_CHECKS = 0, IMAGE_BG_BLACK, IMAGE_BG_WHITE };

#define INPLACE_EDIT_FLIP   -1
#define INPLACE_EDIT_MIRROR -2

+8 −3
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ void init_parse_options(int argc, char **argv)
	opt.thumb_redraw = 10;
	opt.menu_font = estrdup(DEFAULT_MENU_FONT);
	opt.font = NULL;
	opt.image_bg = estrdup("default");
	opt.menu_bg = estrdup(PREFIX "/share/feh/images/menubg_default.png");
	opt.menu_style = estrdup(PREFIX "/share/feh/fonts/menu.style");

@@ -606,8 +605,14 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
			weprintf("The --menu-bg option is deprecated and will be removed by 2012");
			break;
		case 'B':
			free(opt.image_bg);
			opt.image_bg = estrdup(optarg);
			if (!strcmp(optarg, "checks"))
				opt.image_bg = IMAGE_BG_CHECKS;
			else if (!strcmp(optarg, "white"))
				opt.image_bg = IMAGE_BG_WHITE;
			else if (!strcmp(optarg, "black"))
				opt.image_bg = IMAGE_BG_BLACK;
			else
				weprintf("Unknown argument to --image-bg: %s", optarg);
			break;
		case 'D':
			opt.slideshow_delay = atof(optarg);
+1 −1
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ struct __fehoptions {
	unsigned char cycle_once;
	unsigned char hold_actions[10];
	unsigned char text_bg;
	unsigned char image_bg;

	char *output_file;
	char *output_dir;
@@ -84,7 +85,6 @@ struct __fehoptions {
	char *menu_font;
	char *customlist;
	char *menu_bg;
	char *image_bg;
	char *menu_style;
	char *caption_path;
	char *start_list_at;
+3 −3
Original line number Diff line number Diff line
@@ -350,7 +350,7 @@ void winwidget_setup_pixmaps(winwidget winwid)
			if (winwid->gc == None) {
				XGCValues gcval;

				if (!strcmp(opt.image_bg, "white"))
				if (opt.image_bg == IMAGE_BG_WHITE)
					gcval.foreground = WhitePixel(disp, DefaultScreen(disp));
				else
					gcval.foreground = BlackPixel(disp, DefaultScreen(disp));
@@ -626,9 +626,9 @@ Pixmap feh_create_checks(void)
		if (!checks)
			eprintf("Unable to create a teeny weeny imlib image. I detect problems");

		if (strncmp(opt.image_bg, "white", 5) == 0)
		if (opt.image_bg == IMAGE_BG_WHITE)
			gib_imlib_image_fill_rectangle(checks, 0, 0, 16, 16, 255, 255, 255, 255);
		else if (strncmp(opt.image_bg, "black", 5) == 0)
		else if (opt.image_bg == IMAGE_BG_BLACK)
			gib_imlib_image_fill_rectangle(checks, 0, 0, 16, 16, 0, 0, 0, 255);
		else {
			gib_imlib_image_fill_rectangle(checks, 0, 0, 16, 16, 144, 144, 144, 255);
Loading