Codepage messages related translated & other stuff...
[midnight-commander.git] / src / text.c
blobbe9817dbc4050a6aab19bda8b9c41b8507db3308
1 /*
2 * Text edition support code
5 */
6 #include <config.h>
8 #ifdef HAVE_X
9 #error This file is for text-mode editions only.
10 #endif
12 #include <stdio.h>
14 #define WANT_WIDGETS
15 #include "win.h"
16 #include "tty.h"
17 #include "key.h"
18 #include "widget.h"
19 #include "main.h"
20 #include "cons.saver.h"
21 #include "textconf.h"
23 char *default_edition_colors =
24 "normal=lightgray,blue:"
25 "selected=black,cyan:"
26 "marked=yellow,blue:"
27 "markselect=yellow,cyan:"
28 "errors=white,red:"
29 "menu=white,cyan:"
30 "reverse=black,lightgray:"
31 "dnormal=black,lightgray:"
32 "dfocus=black,cyan:"
33 "dhotnormal=yellow,lightgray:"
34 "dhotfocus=yellow,cyan:"
35 "viewunderline=brightred,blue:"
36 "menuhot=yellow,cyan:"
37 "menusel=white,black:"
38 "menuhotsel=yellow,black:"
39 "helpnormal=black,lightgray:"
40 "helpitalic=red,lightgray:"
41 "helpbold=blue,lightgray:"
42 "helplink=black,cyan:"
43 "helpslink=yellow,blue:"
44 "gauge=white,black:"
45 "input=black,cyan:"
46 "directory=white,blue:"
47 "executable=brightgreen,blue:"
48 "link=lightgray,blue:"
49 "stalledlink=brightred,blue:"
50 "device=brightmagenta,blue:"
51 "core=red,blue:"
52 "special=black,blue:"
53 "editnormal=lightgray,blue:"
54 "editbold=yellow,blue:"
55 "editmarked=black,cyan";
57 void
58 edition_post_exec (void)
60 do_enter_ca_mode ();
62 /* FIXME: Missing on slang endwin? */
63 reset_prog_mode ();
64 flushinp ();
66 keypad (stdscr, TRUE);
67 mc_raw_mode ();
68 channels_up ();
69 if (use_mouse_p)
70 init_mouse ();
71 if (alternate_plus_minus)
72 application_keypad_mode ();
75 void
76 edition_pre_exec (void)
78 if (clear_before_exec)
79 clr_scr ();
80 else {
81 if (!(console_flag || xterm_flag))
82 printf ("\n\n");
85 channels_down ();
86 if (use_mouse_p)
87 shut_mouse ();
89 reset_shell_mode ();
90 keypad (stdscr, FALSE);
91 endwin ();
93 numeric_keypad_mode ();
95 /* on xterms: maybe endwin did not leave the terminal on the shell
96 * screen page: do it now.
98 * Do not move this before endwin: in some systems rmcup includes
99 * a call to clear screen, so it will end up clearing the sheel screen.
101 if (!status_using_ncurses){
102 do_exit_ca_mode ();
106 void
107 clr_scr (void)
109 standend ();
110 dlg_erase (midnight_dlg);
111 mc_refresh ();
112 doupdate ();