mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-01 21:51:35 +03:00
* 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.
This commit is contained in:
parent
e06e87edc2
commit
c36bf430bf
@ -1,5 +1,10 @@
|
||||
2003-06-22 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* 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.
|
||||
|
@ -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
|
||||
|
37
src/color.c
37
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"));
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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 ()
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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 ();
|
||||
|
||||
|
@ -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
|
||||
|
75
src/text.c
75
src/text.c
@ -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 <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#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 ();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user