From c5cd2b5716b999c32b120b220846e57a3f67e260 Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 2 Feb 2021 15:06:53 +0100 Subject: sixel and osc5379 image display protocols can be chosen in options --- rc.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'rc.c') diff --git a/rc.c b/rc.c index 423e008..656f83a 100644 --- a/rc.c +++ b/rc.c @@ -86,6 +86,7 @@ static int OptionEncode = FALSE; #define CMT_IMAGE_SCALE N_("Scale of image (%)") #define CMT_IMGDISPLAY N_("External command to display image") #define CMT_IMAGE_MAP_LIST N_("Use link list of image map") +#define CMT_INLINE_IMG_PROTOCOL N_("Inline image protocol") #endif #define CMT_MULTICOL N_("Display file names in multi-column format") #define CMT_ALT_ENTITY N_("Use ASCII equivalents to display entities") @@ -363,6 +364,15 @@ static struct sel_c graphic_char_str[] = { {0, NULL, NULL} }; +#ifdef USE_IMAGE +static struct sel_c inlineimgstr[] = { + {N_S(INLINE_IMG_NONE), N_("none")}, + {N_S(INLINE_IMG_OSC5379), N_("mlterm osc 5379")}, + {N_S(INLINE_IMG_SIXEL), N_("sixel")}, + {0, NULL, NULL} +}; +#endif /* USE_IMAGE */ + struct param_ptr params1[] = { {"tabstop", P_NZINT, PI_TEXT, (void *)&Tabstop, CMT_TABSTOP, NULL}, {"indent_incr", P_NZINT, PI_TEXT, (void *)&IndentIncr, CMT_INDENT_INCR, @@ -428,6 +438,8 @@ struct param_ptr params1[] = { NULL}, {"image_map_list", P_INT, PI_ONOFF, (void *)&image_map_list, CMT_IMAGE_MAP_LIST, NULL}, + {"inline_img_protocol", P_INT, PI_SEL_C, (void *)&enable_inline_image, + CMT_INLINE_IMG_PROTOCOL, (void *)inlineimgstr}, #endif {"fold_line", P_INT, PI_ONOFF, (void *)&FoldLine, CMT_FOLD_LINE, NULL}, {"show_lnum", P_INT, PI_ONOFF, (void *)&showLineNum, CMT_SHOW_NUM, NULL}, @@ -1223,7 +1235,7 @@ sync_with_option(void) init_migemo(); #endif #ifdef USE_IMAGE - if (fmInitialized && displayImage) + if (fmInitialized && (displayImage || enable_inline_image)) initImage(); #else displayImage = FALSE; /* XXX */ -- cgit v1.2.3 From f88e49826dc45f5852d678cb268fc595cd848b1b Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 2 Feb 2021 16:40:27 +0100 Subject: Avoid having external programs download images --- rc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rc.c') diff --git a/rc.c b/rc.c index 656f83a..d015d31 100644 --- a/rc.c +++ b/rc.c @@ -367,7 +367,7 @@ static struct sel_c graphic_char_str[] = { #ifdef USE_IMAGE static struct sel_c inlineimgstr[] = { {N_S(INLINE_IMG_NONE), N_("none")}, - {N_S(INLINE_IMG_OSC5379), N_("mlterm osc 5379")}, + {N_S(INLINE_IMG_OSC5379), N_("mlterm")}, {N_S(INLINE_IMG_SIXEL), N_("sixel")}, {0, NULL, NULL} }; -- cgit v1.2.3 From e4570e8b6e17382e1cc4984684f861524d5b02f4 Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 2 Feb 2021 22:14:46 +0100 Subject: Support iTerm2 graphics protocol, replace encodeB with base64_encode --- rc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'rc.c') diff --git a/rc.c b/rc.c index d015d31..b9a849f 100644 --- a/rc.c +++ b/rc.c @@ -369,6 +369,7 @@ static struct sel_c inlineimgstr[] = { {N_S(INLINE_IMG_NONE), N_("none")}, {N_S(INLINE_IMG_OSC5379), N_("mlterm")}, {N_S(INLINE_IMG_SIXEL), N_("sixel")}, + {N_S(INLINE_IMG_ITERM2), N_("iterm2")}, {0, NULL, NULL} }; #endif /* USE_IMAGE */ -- cgit v1.2.3 From 61b5182dbde04700951263529bca508a0a88aa46 Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 6 Feb 2021 00:18:29 +0100 Subject: Clarify inline image setting's wording --- rc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rc.c') diff --git a/rc.c b/rc.c index b9a849f..a265fdc 100644 --- a/rc.c +++ b/rc.c @@ -86,7 +86,7 @@ static int OptionEncode = FALSE; #define CMT_IMAGE_SCALE N_("Scale of image (%)") #define CMT_IMGDISPLAY N_("External command to display image") #define CMT_IMAGE_MAP_LIST N_("Use link list of image map") -#define CMT_INLINE_IMG_PROTOCOL N_("Inline image protocol") +#define CMT_INLINE_IMG_PROTOCOL N_("Inline image display method") #endif #define CMT_MULTICOL N_("Display file names in multi-column format") #define CMT_ALT_ENTITY N_("Use ASCII equivalents to display entities") @@ -366,7 +366,7 @@ static struct sel_c graphic_char_str[] = { #ifdef USE_IMAGE static struct sel_c inlineimgstr[] = { - {N_S(INLINE_IMG_NONE), N_("none")}, + {N_S(INLINE_IMG_NONE), N_("external command")}, {N_S(INLINE_IMG_OSC5379), N_("mlterm")}, {N_S(INLINE_IMG_SIXEL), N_("sixel")}, {N_S(INLINE_IMG_ITERM2), N_("iterm2")}, @@ -435,12 +435,12 @@ struct param_ptr params1[] = { CMT_EXT_IMAGE_VIEWER, NULL}, {"image_scale", P_SCALE, PI_TEXT, (void *)&image_scale, CMT_IMAGE_SCALE, NULL}, + {"inline_img_protocol", P_INT, PI_SEL_C, (void *)&enable_inline_image, + CMT_INLINE_IMG_PROTOCOL, (void *)inlineimgstr}, {"imgdisplay", P_STRING, PI_TEXT, (void *)&Imgdisplay, CMT_IMGDISPLAY, NULL}, {"image_map_list", P_INT, PI_ONOFF, (void *)&image_map_list, CMT_IMAGE_MAP_LIST, NULL}, - {"inline_img_protocol", P_INT, PI_SEL_C, (void *)&enable_inline_image, - CMT_INLINE_IMG_PROTOCOL, (void *)inlineimgstr}, #endif {"fold_line", P_INT, PI_ONOFF, (void *)&FoldLine, CMT_FOLD_LINE, NULL}, {"show_lnum", P_INT, PI_ONOFF, (void *)&showLineNum, CMT_SHOW_NUM, NULL}, -- cgit v1.2.3