diff --git a/0.75_My_PuTTY/config.c b/0.75_My_PuTTY/config.c index 5aec8e1..87fe205 100644 --- a/0.75_My_PuTTY/config.c +++ b/0.75_My_PuTTY/config.c @@ -1628,7 +1628,7 @@ static void charclass_handler(union control *ctrl, dlgparam *dlg, } struct colour_data { -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR union control *listbox, *redit, *gedit, *bedit, *button, *bold_checkbox, *underline_checkbox, *selected_checkbox; #else @@ -1643,7 +1643,7 @@ static const char *const colours[] = { #undef CONF_COLOUR_NAME_DECL }; -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR 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, @@ -1708,7 +1708,7 @@ static void colour_handler(union control *ctrl, dlgparam *dlg, bool update = false, clear = false; int r, g, b; -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR if (ctrl == cd->bold_checkbox) { conf_set_int(conf,CONF_bold_colour,1); dlg_control_enable(cd->bold_checkbox, dlg,0); @@ -1751,7 +1751,7 @@ static void colour_handler(union control *ctrl, dlgparam *dlg, dlg_listbox_clear(ctrl, dlg); for (i = 0; i < lenof(colours); i++) -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR /* This allows us to hide list items we don't need to * see: if bold-as-colour (or underline) turned off, we just hide those bold * choices to decrease user confusion. And, of course, it looks @@ -1790,7 +1790,7 @@ static void colour_handler(union control *ctrl, dlgparam *dlg, clear = true; } else { clear = false; -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR /* I know this looks a bit weird, but I just had no * other choice. Other way it would break existing code and * worse yet, existing saved session structure. @@ -1821,7 +1821,7 @@ static void colour_handler(union control *ctrl, dlgparam *dlg, i = dlg_listbox_index(cd->listbox, dlg); if (i >= 0) { -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR 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 @@ -1845,7 +1845,7 @@ static void colour_handler(union control *ctrl, dlgparam *dlg, * EVENT_CALLBACK when it's finished and allow us to * pick up the results. */ -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR 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, @@ -1861,7 +1861,7 @@ static void colour_handler(union control *ctrl, dlgparam *dlg, * return nonzero on success, or zero if the colour * selector did nothing (user hit Cancel, for example). */ -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR 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)) { @@ -3485,7 +3485,7 @@ if( !GetPuttyFlag() ) { "Both", I(3), NULL); -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR cd = (struct colour_data *) ctrl_alloc(b, sizeof(struct colour_data)); memset(cd , 0, sizeof(*cd )); cd->bold_checkbox = @@ -3506,8 +3506,7 @@ if( !GetPuttyFlag() ) { " Modify button to change its appearance.", HELPCTX(colours_config)); ctrl_columns(s, 2, 67, 33); - cd = (struct colour_data *)ctrl_alloc(b, sizeof(struct colour_data)); -#ifndef MOD_TUTTY +#ifndef MOD_TUTTYCOLOR cd = (struct colour_data *)ctrl_alloc(b, sizeof(struct colour_data)); #endif cd->listbox = ctrl_listbox(s, "Select a colour to adjust:", 'u', diff --git a/0.75_My_PuTTY/putty.h b/0.75_My_PuTTY/putty.h index b97768a..fda526f 100644 --- a/0.75_My_PuTTY/putty.h +++ b/0.75_My_PuTTY/putty.h @@ -106,7 +106,7 @@ enum { * terminal.c itself. */ -#ifdef MOD_TUTTY /* 4+8 more special TUTTY colors */ +#ifdef MOD_TUTTYCOLOR /* 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 */ @@ -118,7 +118,7 @@ enum { /* The list macro for the conf colours also gives the textual names * used in the GUI configurer */ -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR #define CONF_COLOUR_LIST(X) \ X(fg, "Default Foreground") \ X(fg_bold, "Default Bold Foreground") \ diff --git a/0.75_My_PuTTY/settings.c b/0.75_My_PuTTY/settings.c index 32190ff..5b42da1 100644 --- a/0.75_My_PuTTY/settings.c +++ b/0.75_My_PuTTY/settings.c @@ -734,6 +734,8 @@ void save_open_settings(settings_w *sesskey, Conf *conf) write_setting_i(sesskey, "WindowMaximizable", conf_get_int(conf, CONF_window_maximizable) ); write_setting_i(sesskey, "WindowHasSysMenu", conf_get_int(conf, CONF_window_has_sysmenu) ); write_setting_i(sesskey, "DisableBottomButtons", conf_get_int(conf, CONF_bottom_buttons) ); +#endif +#ifdef MOD_TUTTYCOLOR write_setting_i(sesskey, "BoldAsColourTest", conf_get_int(conf, CONF_bold_colour) ); write_setting_i(sesskey, "UnderlinedAsColour", conf_get_int(conf, CONF_under_colour) ); write_setting_i(sesskey, "SelectedAsColour", conf_get_int(conf, CONF_sel_colour) ); @@ -1362,6 +1364,8 @@ void load_open_settings(settings_r *sesskey, Conf *conf) gppi(sesskey, "WindowMaximizable", 1, conf, CONF_window_maximizable); gppi(sesskey, "WindowHasSysMenu", 1, conf, CONF_window_has_sysmenu); gppi(sesskey, "DisableBottomButtons", 1, conf, CONF_bottom_buttons); +#endif +#ifdef MOD_TUTTYCOLOR gppi(sesskey, "BoldAsColourTest", 1, conf, CONF_bold_colour); gppi(sesskey, "UnderlinedAsColour", 0, conf, CONF_under_colour); gppi(sesskey, "SelectedAsColour", 0, conf, CONF_sel_colour); diff --git a/0.75_My_PuTTY/terminal.c b/0.75_My_PuTTY/terminal.c index 6dd86ae..cc691e7 100644 --- a/0.75_My_PuTTY/terminal.c +++ b/0.75_My_PuTTY/terminal.c @@ -6167,7 +6167,7 @@ static void do_paint(Terminal *term) posPle_left(scrpos, term->selend)); } else selected = false; -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR tattr = (tattr ^ rv ^ (selected ? ATTR_SELECTED : 0)); #else tattr = (tattr ^ rv diff --git a/0.75_My_PuTTY/windows/MAKEFILE.MINGW b/0.75_My_PuTTY/windows/MAKEFILE.MINGW index bbce1c6..f4598d9 100644 --- a/0.75_My_PuTTY/windows/MAKEFILE.MINGW +++ b/0.75_My_PuTTY/windows/MAKEFILE.MINGW @@ -125,7 +125,7 @@ UTF8MOUSE_OBJS = fromucs.o slookup.o sbcsdat.o sbcs.o utf8.o ################################################################################ CFLAGS += -DWINVER=0x0501 -D_WIN32_WINDOWS=0x0410 -D_WIN32_WINNT=0x0501 -# -DMOD_PERSO -DMOD_BACKGROUNDIMAGE -DMOD_RECONNECT -DMOD_HYPERLINK -DMOD_ZMODEM -DMOD_PROXY -DMOD_STARTBUTTON -DMOD_LAUNCHER -DMOD_SAVEDUMP -DMOD_KEYMAPPING -DMOD_TUTTY -DMOD_PORTKNOCKING -DMOD_PUTTYX -DMOD_WTS -DMOD_PRINTCLIP -DMOD_RUTTY -DMOD_ADB \ +# -DMOD_PERSO -DMOD_BACKGROUNDIMAGE -DMOD_RECONNECT -DMOD_HYPERLINK -DMOD_ZMODEM -DMOD_PROXY -DMOD_STARTBUTTON -DMOD_LAUNCHER -DMOD_SAVEDUMP -DMOD_KEYMAPPING -DMOD_TUTTY -DMOD_TUTTYCOLOR -DMOD_PORTKNOCKING -DMOD_PUTTYX -DMOD_WTS -DMOD_PRINTCLIP -DMOD_RUTTY -DMOD_ADB \ # Flag special FLJ @@ -157,6 +157,7 @@ CFLAGS += \ -DMOD_LAUNCHER \ -DMOD_RECONNECT \ -DMOD_RUTTY \ + -DMOD_TUTTY \ -DMOD_ADB \ -DMOD_BACKGROUNDIMAGE \ -DMOD_ZMODEM \ @@ -170,7 +171,8 @@ CFLAGS += \ -I../../bcrypt \ -I../../md5 -I../../regex -I../../url -I../../rutty -# -DMOD_TUTTY \ + +# -DMOD_TUTTYCOLOR # Autre flag a gérer diff --git a/0.75_My_PuTTY/windows/window.c b/0.75_My_PuTTY/windows/window.c index 0a946d4..f81db15 100644 --- a/0.75_My_PuTTY/windows/window.c +++ b/0.75_My_PuTTY/windows/window.c @@ -6023,7 +6023,7 @@ static void do_text_internal( attr |= (260 << ATTR_FGSHIFT) | (261 << ATTR_BGSHIFT); is_cursor = true; } -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR if (!conf_get_int(conf,CONF_sel_colour) && (attr & ATTR_SELECTED)) { attr &= ~ATTR_SELECTED; attr |= ATTR_REVERSE; @@ -6127,7 +6127,7 @@ static void do_text_internal( if (nbg < 16) nbg |= 8; else if (nbg >= 256) nbg |= 1; } -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR /* * quick & dirty hack: underlined text has colour preference over bold & normal * another one: selected text have absolute preference over all other attributes diff --git a/kitty.c b/kitty.c index c038e73..f7977e9 100644 --- a/kitty.c +++ b/kitty.c @@ -4666,7 +4666,7 @@ void ResetWindow(int reinit) ; void NegativeColours(HWND hwnd) { int i ; -#ifdef MOD_TUTTY +#ifdef MOD_TUTTYCOLOR for (i = 0; i < 34; i++) { #else for (i = 0; i < 22; i++) { diff --git a/kitty_savedump.c b/kitty_savedump.c index bbe94e2..e2c418b 100644 --- a/kitty_savedump.c +++ b/kitty_savedump.c @@ -652,6 +652,8 @@ void SaveDumpConfig( FILE *fp, Conf * conf ) { fprintf( fp, "window_maximizable=%d\n", conf_get_int(conf,CONF_window_maximizable) ) ; fprintf( fp, "window_has_sysmenu=%d\n", conf_get_int(conf,CONF_window_has_sysmenu) ) ; fprintf( fp, "bottom_buttons=%d\n", conf_get_int(conf,CONF_bottom_buttons) ) ; +#endif +#ifdef MOD_TUTTYCOLOR fprintf( fp, "bold_colour=%d\n", conf_get_int(conf,CONF_bold_colour) ) ; fprintf( fp, "under_colour=%d\n", conf_get_int(conf,CONF_under_colour) ) ; fprintf( fp, "sel_colour=%d\n", conf_get_int(conf,CONF_sel_colour) ) ; diff --git a/kitty_settings.c b/kitty_settings.c index ce989cf..db19788 100644 --- a/kitty_settings.c +++ b/kitty_settings.c @@ -231,6 +231,8 @@ void save_open_settings_forced(char *filename, Conf *conf) { write_setting_i_forced(sesskey, "WindowMaximizable", conf_get_int(conf, CONF_window_maximizable) ); write_setting_i_forced(sesskey, "WindowHasSysMenu", conf_get_int(conf, CONF_window_has_sysmenu) ); write_setting_i_forced(sesskey, "DisableBottomButtons", conf_get_int(conf, CONF_bottom_buttons) ); +#endif +#ifdef MOD_TUTTYCOLOR write_setting_i_forced(sesskey, "BoldAsColourTest", conf_get_int(conf, CONF_bold_colour) ); write_setting_i_forced(sesskey, "UnderlinedAsColour", conf_get_int(conf, CONF_under_colour) ); write_setting_i_forced(sesskey, "SelectedAsColour", conf_get_int(conf, CONF_sel_colour) ); @@ -826,6 +828,8 @@ void load_open_settings_forced(char *filename, Conf *conf) { gppi_forced(sesskey, "WindowMaximizable", 1, conf, CONF_window_maximizable); gppi_forced(sesskey, "WindowHasSysMenu", 1, conf, CONF_window_has_sysmenu); gppi_forced(sesskey, "DisableBottomButtons", 1, conf, CONF_bottom_buttons); +#endif +#ifdef MOD_TUTTY gppi_forced(sesskey, "BoldAsColourTest", 1, conf, CONF_bold_colour); gppi_forced(sesskey, "UnderlinedAsColour", 0, conf, CONF_under_colour); gppi_forced(sesskey, "SelectedAsColour", 0, conf, CONF_sel_colour);