0.75 try to re-integrate TuTTY patch

This commit is contained in:
cyd01
2021-10-26 18:32:18 +02:00
parent e026c881f0
commit e7e682bb70
3 changed files with 35 additions and 14 deletions
+7 -4
View File
@@ -1646,8 +1646,10 @@ static const char *const colours[] = {
#ifdef MOD_TUTTY
void dlg_control_enable(union control *ctrl, void *dlg, int enable);
static const int itemcolour[] = {
0, 1, 2, 0, 1, 2, 0, 0, 3, 3, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2,
0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2
0, 1, 2, 0, 1, 2, 0, 0, 3, 3,
0, 1, 2, 0, 1, 2, 0, 1, 2, 0,
1, 2, 0, 1, 2, 0, 1, 2, 0, 1,
2, 0, 1, 2
};
static const int idxcolour[2][2][2][34] = {
@@ -1747,6 +1749,7 @@ static void colour_handler(union control *ctrl, dlgparam *dlg,
int i;
dlg_update_start(ctrl, dlg);
dlg_listbox_clear(ctrl, dlg);
for (i = 0; i < lenof(colours); i++)
#ifdef MOD_TUTTY
/* This allows us to hide list items we don't need to
@@ -1843,7 +1846,7 @@ static void colour_handler(union control *ctrl, dlgparam *dlg,
* pick up the results.
*/
#ifdef MOD_TUTTY
i = idxcolour[conf_get_int(conf,CONF_bold_colour)][conf_get_int(conf,CONF_under_colour)][conf_get_int(conf,CONF_sel_colour)][i];
i = idxcolour[conf_get_int(conf,CONF_bold_colour)][conf_get_int(conf,CONF_under_colour)][conf_get_int(conf,CONF_sel_colour)][i];
#endif
dlg_coloursel_start(ctrl, dlg,
conf_get_int_int(conf, CONF_colours, i*3+0),
@@ -1859,7 +1862,7 @@ static void colour_handler(union control *ctrl, dlgparam *dlg,
* selector did nothing (user hit Cancel, for example).
*/
#ifdef MOD_TUTTY
i = idxcolour[conf_get_int(conf,CONF_bold_colour)][conf_get_int(conf,CONF_under_colour)][conf_get_int(conf,CONF_sel_colour)][i];
i = idxcolour[conf_get_int(conf,CONF_bold_colour)][conf_get_int(conf,CONF_under_colour)][conf_get_int(conf,CONF_sel_colour)][i];
#endif
if (dlg_coloursel_results(ctrl, dlg, &r, &g, &b)) {
conf_set_int_int(conf, CONF_colours, i*3+0, r);
+24 -8
View File
@@ -106,10 +106,10 @@ enum {
* terminal.c itself.
*/
#ifdef MOD_TUTTY
#define CONF_NCOLOURS 26 /* 16 + 6 special ones */
#define OSCP_NCOLOURS 26 /* same as CONF, but different order */
#define OSC4_NCOLOURS 326 /* 256 + the same 6 special ones */
#ifdef MOD_TUTTY /* 4+8 more special TUTTY colors */
#define CONF_NCOLOURS 34 /* 16 + 18 (6+4+8) special ones */
#define OSCP_NCOLOURS 34 /* same as CONF, but different order */
#define OSC4_NCOLOURS 274 /* 256 + the same 18 (6+4+8) special ones */
#else
#define CONF_NCOLOURS 22 /* 16 + 6 special ones */
#define OSCP_NCOLOURS 22 /* same as CONF, but different order */
@@ -132,20 +132,28 @@ enum {
X(sel_bg,"Selected Text Background") \
X(black, "ANSI Black") \
X(black_bold, "ANSI Black Bold") \
X(black_underline,"ANSI Black Underlined") \
X(red, "ANSI Red") \
X(red_bold, "ANSI Red Bold") \
X(red_underline,"ANSI Red Underlined") \
X(green, "ANSI Green") \
X(green_bold, "ANSI Green Bold") \
X(green_underline,"ANSI Green Underlined") \
X(yellow, "ANSI Yellow") \
X(yellow_bold, "ANSI Yellow Bold") \
X(yellow_underline,"ANSI Yellow Underlined") \
X(blue, "ANSI Blue") \
X(blue_bold, "ANSI Blue Bold") \
X(blue_underline,"ANSI Blue Underlined") \
X(magenta, "ANSI Magenta") \
X(magenta_bold, "ANSI Magenta Bold") \
X(magenta_underline,"ANSI Magenta Underlined") \
X(cyan, "ANSI Cyan") \
X(cyan_bold, "ANSI Cyan Bold") \
X(cyan_underline,"ANSI Cyan Underlined") \
X(white, "ANSI White") \
X(white_bold, "ANSI White Bold") \
X(white_underline,"ANSI White Underlined") \
/* end of list */
#define OSCP_COLOUR_LIST(X) \
@@ -188,10 +196,18 @@ enum {
X(bg_bold) \
X(cursor_fg) \
X(cursor_bg) \
X(fg_underline) \
X(bg_underline) \
X(sel_fg) \
X(sel_bg) \
X(fg_underline) \
X(bg_underline) \
X(sel_fg) \
X(sel_bg) \
X(black_underline) \
X(red_underline) \
X(green_underline) \
X(yellow_underline) \
X(blue_underline) \
X(magenta_underline) \
X(cyan_underline) \
X(white_underline) \
/* end of list */
#else
#define CONF_COLOUR_LIST(X) \
+4 -2
View File
@@ -1371,8 +1371,10 @@ void load_open_settings(settings_r *sesskey, Conf *conf)
"0,255,0", "0,0,0", "85,85,85", "187,0,0", "255,85,85",
"0,187,0", "85,255,85", "187,187,0", "255,255,85", "0,0,187",
"85,85,255", "187,0,187", "255,85,255", "0,187,187",
"85,255,255", "187,187,187", "255,255,255", "187,187,187",
"0,0,0", "0,0,0", "187,0,0", "0,187,0", "187,187,0", "0,0,187",
"85,255,255", "187,187,187", "255,255,255",
"187,187,187",
"0,0,0", "0,0,0", "187,0,0", "0,187,0"
, "187,187,0", "0,0,187",
"187,0,187", "0,187,187", "187,187,187", "0,0,0", "187,187,187"
};
#else