Just a little correction at the it.po file.
[midnight-commander.git] / src / myslang.h
blobb5d17235b54c77529be4e8214e84439d1a4bbe19
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 #define move(x, y) SLsmg_gotorc(x, y)
97 #define getyx(stdscr, row, col) \
98 do { \
99 row = SLsmg_get_row(); \
100 col = SLsmg_get_column(); \
101 } while (0)
102 #define printw SLsmg_printf
103 #define COLS SLtt_Screen_Cols
104 #define LINES SLtt_Screen_Rows
105 #define standend() SLsmg_normal_video()
107 #ifdef UTF8
109 * Patched S-Lang in Red Hat 8.0 expects wchar_t as the argument to addch()
110 * Avoid conversion by using SLsmg_write_nchars(), which takes char*
112 #undef addch
113 static inline void
114 mc_addch (char c)
116 SLsmg_write_nchars (&c, 1);
118 #define addch(c) mc_addch(c)
119 #else
120 #define addch(c) SLsmg_write_char(c)
121 #endif
123 #define addstr(s) SLsmg_write_string(s)
124 #define refresh() SLsmg_refresh()
125 #define mvaddstr(y, x, s) SLsmg_gotorc(y, x); SLsmg_write_string(s)
126 #define endwin() SLsmg_reset_smg()
128 #define SLsmg_draw_double_box(r,c,dr,dc) SLsmg_draw_box ((r), (c), (dr), (dc))
130 #ifdef HAS_ACS_AS_PCCHARS
131 # define one_vline() addch(ACS_VLINE)
132 # define one_hline() addch(ACS_HLINE)
133 /* This is fast, but unusefull if ! pc_system - doesn't use
134 Alt_Char_Pairs [] :( */
135 #else
136 /* This is slow, but works well :| */
137 # define one_vline() SLsmg_draw_object (SLsmg_get_row(), SLsmg_get_column(), slow_terminal ? ' ' : ACS_VLINE)
138 # define one_hline() SLsmg_draw_object (SLsmg_get_row(), SLsmg_get_column(), slow_terminal ? ' ' : ACS_HLINE)
139 #endif
141 void enable_interrupt_key (void);
142 void disable_interrupt_key (void);
143 #endif /* !__MYSLANG_H */