*** empty log message ***
[midnight-commander.git] / src / text.c
blob780e9b18168adb180a2d8bfe421ff7461e686a5a
1 /*
2 * Text edition support code
5 */
6 #include <config.h>
8 #include <stdio.h>
10 #define WANT_WIDGETS
11 #include "global.h"
12 #include "win.h"
13 #include "tty.h"
14 #include "key.h"
15 #include "widget.h"
16 #include "main.h"
17 #include "cons.saver.h"
18 #include "textconf.h"
20 char *default_edition_colors =
21 "normal=lightgray,blue:"
22 "selected=black,cyan:"
23 "marked=yellow,blue:"
24 "markselect=yellow,cyan:"
25 "errors=white,red:"
26 "menu=white,cyan:"
27 "reverse=black,lightgray:"
28 "dnormal=black,lightgray:"
29 "dfocus=black,cyan:"
30 "dhotnormal=blue,lightgray:"
31 "dhotfocus=yellow,cyan:"
32 "viewunderline=brightred,blue:"
33 "menuhot=yellow,cyan:"
34 "menusel=white,black:"
35 "menuhotsel=yellow,black:"
36 "helpnormal=black,lightgray:"
37 "helpitalic=red,lightgray:"
38 "helpbold=blue,lightgray:"
39 "helplink=black,cyan:"
40 "helpslink=yellow,blue:"
41 "gauge=white,black:"
42 "input=black,cyan:"
43 "directory=white,blue:"
44 "executable=brightgreen,blue:"
45 "link=lightgray,blue:"
46 "stalledlink=brightred,blue:"
47 "device=brightmagenta,blue:"
48 "core=red,blue:"
49 "special=black,blue:"
50 "editnormal=lightgray,blue:"
51 "editbold=yellow,blue:"
52 "editmarked=black,cyan";
54 void
55 edition_post_exec (void)
57 do_enter_ca_mode ();
59 /* FIXME: Missing on slang endwin? */
60 reset_prog_mode ();
61 flushinp ();
63 keypad (stdscr, TRUE);
64 mc_raw_mode ();
65 channels_up ();
66 enable_mouse ();
67 if (alternate_plus_minus)
68 application_keypad_mode ();
71 void
72 edition_pre_exec (void)
74 if (clear_before_exec)
75 clr_scr ();
76 else {
77 if (!(console_flag || xterm_flag))
78 printf ("\n\n");
81 channels_down ();
82 disable_mouse ();
84 reset_shell_mode ();
85 keypad (stdscr, FALSE);
86 endwin ();
88 numeric_keypad_mode ();
90 /* on xterms: maybe endwin did not leave the terminal on the shell
91 * screen page: do it now.
93 * Do not move this before endwin: in some systems rmcup includes
94 * a call to clear screen, so it will end up clearing the shell screen.
96 do_exit_ca_mode ();
99 void
100 clr_scr (void)
102 standend ();
103 dlg_erase (midnight_dlg);
104 mc_refresh ();
105 doupdate ();