updated the .TP cleanup for coherency in the key description pages.
[midnight-commander.git] / src / myslang.h
blob70e201def090e0341d7f68efb0f2fa6f7aceb1cd
1 #ifndef __MYSLANG_H
2 #define __MYSLANG_H
4 #ifdef HAVE_SYSTEM_SLANG
5 #ifdef HAVE_SLANG_SLANG_H
6 # include <slang/slang.h>
7 #else
8 # include <slang.h>
9 #endif
10 #else /* !HAVE_SYSTEM_SLANG */
11 # include "slang/include/slang.h"
12 #endif /* !HAVE_SYSTEM_SLANG */
14 enum {
15 KEY_BACKSPACE = 400,
16 KEY_END, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT,
17 KEY_HOME, KEY_A1, KEY_C1, KEY_NPAGE, KEY_PPAGE, KEY_IC,
18 KEY_ENTER, KEY_DC, KEY_SCANCEL, KEY_BTAB
21 #define KEY_F(x) 1000+x
23 #define ACS_VLINE SLSMG_VLINE_CHAR
24 #define ACS_HLINE SLSMG_HLINE_CHAR
25 #define ACS_ULCORNER SLSMG_ULCORN_CHAR
26 #define ACS_LLCORNER SLSMG_LLCORN_CHAR
27 #define ACS_URCORNER SLSMG_URCORN_CHAR
28 #define ACS_LRCORNER SLSMG_LRCORN_CHAR
30 #ifdef HAS_ACS_AS_PCCHARS
31 # define ACS_LTEE 0xC3
32 # define acs() ;
33 # define noacs() ;
34 # define baudrate() 19200
35 #else
36 # define ACS_LTEE 't'
37 # define acs() SLsmg_set_char_set(1)
38 # define noacs() SLsmg_set_char_set (0)
39 # define baudrate() SLang_TT_Baud_Rate
40 #endif
42 enum {
43 COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE,
44 COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE
47 /* When using Slang with color, we have all the indexes free but
48 * those defined here (A_BOLD, A_UNDERLINE, A_REVERSE, A_BOLD_REVERSE)
50 #define A_BOLD 0x40
51 #define A_UNDERLINE 0x40
52 #define A_REVERSE 0x20
53 #define A_BOLD_REVERSE 0x21
55 #ifndef A_NORMAL
56 # define A_NORMAL 0x00
57 #endif
59 #define COLOR_PAIR(x) x
61 #ifndef TRUE
62 # define TRUE 1
63 # define FALSE 0
64 #endif
66 void slang_set_raw_mode (void);
68 #define doupdate()
69 #define raw() slang_set_raw_mode()
70 #define noraw()
71 #define nodelay(x,val) set_slang_delay(val)
72 #define noecho()
73 #define beep() SLtt_beep ()
74 #define keypad(scr,value) slang_keypad (value)
76 #define ungetch(x) SLang_ungetkey(x)
77 #define start_color()
78 #define touchwin(x) SLsmg_touch_lines(0, LINES)
79 #define reset_shell_mode() slang_shell_mode()
80 #define reset_prog_mode() slang_prog_mode()
81 #define flushinp()
83 void slint_goto (int y, int x);
84 void attrset (int color);
85 void set_slang_delay (int);
86 void slang_init (void);
87 void slang_prog_mode (void);
88 void hline (int ch, int len);
89 void vline (int ch, int len);
90 int getch (void);
91 void slang_keypad (int set);
92 void slang_shell_mode (void);
93 void slang_shutdown (void);
94 int has_colors (void);
96 /* copied from slcurses.h (MC version 4.0.7) */
97 #define move(x, y) SLsmg_gotorc(x, y)
98 #define printw SLsmg_printf
99 #define mvprintw(x, y, z) SLsmg_gotorc(x, y); SLsmg_printf(z)
100 #define COLS SLtt_Screen_Cols
101 #define LINES SLtt_Screen_Rows
102 #define standend() SLsmg_normal_video()
104 #ifdef UTF8
106 * Patched S-Lang in Red Hat 8.0 expects wchar_t as the argument to addch()
107 * Avoid conversion by using SLsmg_write_nchars(), which takes char*
109 #undef addch
110 static inline void
111 mc_addch (char c)
113 SLsmg_write_nchars (&c, 1);
115 #define addch(c) mc_addch(c)
116 #else
117 #define addch(c) SLsmg_write_char(c)
118 #endif
120 #define addstr(s) SLsmg_write_string(s)
121 #define refresh() SLsmg_refresh()
122 #define mvaddstr(y, x, s) SLsmg_gotorc(y, x); SLsmg_write_string(s)
123 #define endwin() SLsmg_reset_smg()
125 #define SLsmg_draw_double_box(r,c,dr,dc) SLsmg_draw_box ((r), (c), (dr), (dc))
127 #ifdef HAS_ACS_AS_PCCHARS
128 # define one_vline() addch(ACS_VLINE)
129 # define one_hline() addch(ACS_HLINE)
130 /* This is fast, but unusefull if ! pc_system - doesn't use
131 Alt_Char_Pairs [] :( */
132 #else
133 /* This is slow, but works well :| */
134 # define one_vline() SLsmg_draw_object (SLsmg_get_row(), SLsmg_get_column(), slow_terminal ? ' ' : ACS_VLINE)
135 # define one_hline() SLsmg_draw_object (SLsmg_get_row(), SLsmg_get_column(), slow_terminal ? ' ' : ACS_HLINE)
136 #endif
138 void enable_interrupt_key (void);
139 void disable_interrupt_key (void);
140 #endif /* !__MYSLANG_H */