diff --git a/src/ChangeLog b/src/ChangeLog index 4583d41c7..6d6f383db 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2003-06-22 Pavel Roskin + * text.c: Eliminate. Move colors to color.c and clr_scr() to + layout.c. + * main.c (restore_console): Eliminate, use handle_console(). + * Makefile.am: Remove text.c. + * execute.c: New file with all functions for execution and toggling panels not specific to subshell. * execute.h: Corresponding header. diff --git a/src/Makefile.am b/src/Makefile.am index c3f19af64..46e319814 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -56,7 +56,7 @@ SRCS = achown.c achown.h background.c background.h boxes.c boxes.h \ option.h panel.h panelize.c panelize.h poptalloca.h popt.c \ poptconfig.c popt.h popthelp.c poptint.h poptparse.c profile.c \ profile.h regex.c rxvt.c screen.c setup.c setup.h slint.c \ - subshell.c subshell.h terms.c text.c textconf.c textconf.h \ + subshell.c subshell.h terms.c textconf.c textconf.h \ tree.c tree.h treestore.c treestore.h tty.h user.c user.h \ util.c util.h utilunix.c view.c view.h widget.c widget.h \ win.c win.h wtools.c wtools.h diff --git a/src/color.c b/src/color.c index add61720a..0cf18a018 100644 --- a/src/color.c +++ b/src/color.c @@ -124,6 +124,40 @@ static struct color_table_s const color_table [] = { { "default", 0 } /* default color of the terminal */ }; +static char *default_colors = +"normal=lightgray,blue:" +"selected=black,cyan:" +"marked=yellow,blue:" +"markselect=yellow,cyan:" +"errors=white,red:" +"menu=white,cyan:" +"reverse=black,lightgray:" +"dnormal=black,lightgray:" +"dfocus=black,cyan:" +"dhotnormal=blue,lightgray:" +"dhotfocus=blue,cyan:" +"viewunderline=brightred,blue:" +"menuhot=yellow,cyan:" +"menusel=white,black:" +"menuhotsel=yellow,black:" +"helpnormal=black,lightgray:" +"helpitalic=red,lightgray:" +"helpbold=blue,lightgray:" +"helplink=black,cyan:" +"helpslink=yellow,blue:" +"gauge=white,black:" +"input=black,cyan:" +"directory=white,blue:" +"executable=brightgreen,blue:" +"link=lightgray,blue:" +"stalelink=brightred,blue:" +"device=brightmagenta,blue:" +"core=red,blue:" +"special=black,blue:" +"editnormal=lightgray,blue:" +"editbold=yellow,blue:" +"editmarked=black,cyan"; + #ifdef HAVE_SLANG # define color_value(i) color_table [i].name # define color_name(i) color_table [i].name @@ -211,9 +245,8 @@ static void configure_colors_string (char *the_color_string) static void configure_colors (void) { extern char *command_line_colors; - extern char *default_edition_colors; - configure_colors_string (default_edition_colors); + configure_colors_string (default_colors); configure_colors_string (setup_color_string); configure_colors_string (term_color_string); configure_colors_string (getenv ("MC_COLOR_TABLE")); diff --git a/src/execute.c b/src/execute.c index 9064f8635..f3799c0f5 100644 --- a/src/execute.c +++ b/src/execute.c @@ -105,7 +105,7 @@ do_execute (const char *shell, const char *command, int flags) save_cwds_stat (); pre_exec (); if (console_flag) - restore_console (); + handle_console (CONSOLE_RESTORE); if (!use_subshell && !(flags & EXECUTE_INTERNAL && command)) { printf ("%s%s%s\n", last_paused ? "\r\n" : "", prompt, command); @@ -222,7 +222,7 @@ toggle_panels (void) do_exit_ca_mode (); mc_raw_mode (); if (console_flag) - restore_console (); + handle_console (CONSOLE_RESTORE); #ifdef HAVE_SUBSHELL_SUPPORT if (use_subshell) { @@ -283,7 +283,7 @@ do_suspend_cmd (void) pre_exec (); if (console_flag && !use_subshell) - restore_console (); + handle_console (CONSOLE_RESTORE); #ifdef SIGTSTP { diff --git a/src/layout.c b/src/layout.c index 8b2862b07..37c81ac95 100644 --- a/src/layout.c +++ b/src/layout.c @@ -609,6 +609,15 @@ void init_curses (void) } #endif /* ! HAVE_SLANG */ +void +clr_scr (void) +{ + standend (); + dlg_erase (midnight_dlg); + mc_refresh (); + doupdate (); +} + void done_screen () { diff --git a/src/layout.h b/src/layout.h index 74526d3c4..81f673289 100644 --- a/src/layout.h +++ b/src/layout.h @@ -25,6 +25,9 @@ Widget *get_panel_widget (int index); void set_hintbar (char *str); +/* Clear screen */ +void clr_scr (void); + extern int winch_flag; extern int equal_split; extern int first_panel_size; diff --git a/src/main.c b/src/main.c index df33ead36..f96407f5f 100644 --- a/src/main.c +++ b/src/main.c @@ -465,12 +465,6 @@ do_update_prompt (void) } #endif /* HAVE_SUBSHELL_SUPPORT */ -void -restore_console (void) -{ - handle_console (CONSOLE_RESTORE); -} - void change_panel (void) { @@ -2369,7 +2363,7 @@ main (int argc, char *argv[]) #endif if (console_flag && !(quit & SUBSHELL_EXIT)) - restore_console (); + handle_console (CONSOLE_RESTORE); if (alternate_plus_minus) numeric_keypad_mode (); diff --git a/src/main.h b/src/main.h index b6748652f..0133abc2c 100644 --- a/src/main.h +++ b/src/main.h @@ -104,9 +104,6 @@ extern char *shell; /* directory specified on command line for startup */ extern char *this_dir; -void clr_scr (void); -void restore_console (void); - enum cd_enum { cd_parse_command, cd_exact diff --git a/src/text.c b/src/text.c deleted file mode 100644 index 833727dce..000000000 --- a/src/text.c +++ /dev/null @@ -1,75 +0,0 @@ -/* Text edition support code. - - Copyright (C) 2001-2002 Free Software Foundation - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include - -#include - -#define WANT_WIDGETS -#include "global.h" -#include "win.h" -#include "tty.h" -#include "key.h" -#include "widget.h" -#include "main.h" -#include "cons.saver.h" -#include "textconf.h" - -char *default_edition_colors = -"normal=lightgray,blue:" -"selected=black,cyan:" -"marked=yellow,blue:" -"markselect=yellow,cyan:" -"errors=white,red:" -"menu=white,cyan:" -"reverse=black,lightgray:" -"dnormal=black,lightgray:" -"dfocus=black,cyan:" -"dhotnormal=blue,lightgray:" -"dhotfocus=blue,cyan:" -"viewunderline=brightred,blue:" -"menuhot=yellow,cyan:" -"menusel=white,black:" -"menuhotsel=yellow,black:" -"helpnormal=black,lightgray:" -"helpitalic=red,lightgray:" -"helpbold=blue,lightgray:" -"helplink=black,cyan:" -"helpslink=yellow,blue:" -"gauge=white,black:" -"input=black,cyan:" -"directory=white,blue:" -"executable=brightgreen,blue:" -"link=lightgray,blue:" -"stalelink=brightred,blue:" -"device=brightmagenta,blue:" -"core=red,blue:" -"special=black,blue:" -"editnormal=lightgray,blue:" -"editbold=yellow,blue:" -"editmarked=black,cyan"; - -void -clr_scr (void) -{ - standend (); - dlg_erase (midnight_dlg); - mc_refresh (); - doupdate (); -} -