2004-12-03 22:17:46 +03:00
|
|
|
#ifndef MC_MYSLANG_H
|
|
|
|
#define MC_MYSLANG_H
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2005-03-19 20:27:36 +03:00
|
|
|
#ifndef HAVE_SYSTEM_SLANG
|
2004-10-12 08:32:04 +04:00
|
|
|
# include "../slang/include/slang.h"
|
|
|
|
#else
|
2001-05-29 05:34:27 +04:00
|
|
|
#ifdef HAVE_SLANG_SLANG_H
|
1998-02-27 07:54:42 +03:00
|
|
|
# include <slang/slang.h>
|
|
|
|
#else
|
2001-12-22 01:15:24 +03:00
|
|
|
# include <slang.h>
|
2004-10-12 08:32:04 +04:00
|
|
|
#endif /* HAVE_SLANG_SLANG_H */
|
1998-02-27 07:54:42 +03:00
|
|
|
#endif
|
|
|
|
|
2002-08-22 10:56:35 +04:00
|
|
|
enum {
|
|
|
|
KEY_BACKSPACE = 400,
|
|
|
|
KEY_END, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT,
|
|
|
|
KEY_HOME, KEY_A1, KEY_C1, KEY_NPAGE, KEY_PPAGE, KEY_IC,
|
|
|
|
KEY_ENTER, KEY_DC, KEY_SCANCEL, KEY_BTAB
|
|
|
|
};
|
|
|
|
|
2003-09-11 01:33:12 +04:00
|
|
|
#define KEY_F(x) (1000+x)
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
#define ACS_VLINE SLSMG_VLINE_CHAR
|
|
|
|
#define ACS_HLINE SLSMG_HLINE_CHAR
|
|
|
|
#define ACS_ULCORNER SLSMG_ULCORN_CHAR
|
|
|
|
#define ACS_LLCORNER SLSMG_LLCORN_CHAR
|
|
|
|
#define ACS_URCORNER SLSMG_URCORN_CHAR
|
|
|
|
#define ACS_LRCORNER SLSMG_LRCORN_CHAR
|
|
|
|
|
1999-01-10 11:55:35 +03:00
|
|
|
#ifdef HAS_ACS_AS_PCCHARS
|
1998-02-27 07:54:42 +03:00
|
|
|
# define ACS_LTEE 0xC3
|
|
|
|
# define acs() ;
|
|
|
|
# define noacs() ;
|
|
|
|
# define baudrate() 19200
|
|
|
|
#else
|
|
|
|
# define ACS_LTEE 't'
|
|
|
|
# define acs() SLsmg_set_char_set(1)
|
|
|
|
# define noacs() SLsmg_set_char_set (0)
|
|
|
|
# define baudrate() SLang_TT_Baud_Rate
|
|
|
|
#endif
|
|
|
|
|
|
|
|
enum {
|
|
|
|
COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE,
|
|
|
|
COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE
|
|
|
|
};
|
|
|
|
|
|
|
|
/* When using Slang with color, we have all the indexes free but
|
|
|
|
* those defined here (A_BOLD, A_UNDERLINE, A_REVERSE, A_BOLD_REVERSE)
|
|
|
|
*/
|
|
|
|
#define A_BOLD 0x40
|
|
|
|
#define A_UNDERLINE 0x40
|
|
|
|
#define A_REVERSE 0x20
|
|
|
|
#define A_BOLD_REVERSE 0x21
|
|
|
|
|
|
|
|
#ifndef A_NORMAL
|
|
|
|
# define A_NORMAL 0x00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define COLOR_PAIR(x) x
|
1998-10-30 20:51:28 +03:00
|
|
|
|
|
|
|
#ifndef TRUE
|
|
|
|
# define TRUE 1
|
|
|
|
# define FALSE 0
|
|
|
|
#endif
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
void slang_set_raw_mode (void);
|
|
|
|
|
|
|
|
#define doupdate()
|
|
|
|
#define raw() slang_set_raw_mode()
|
|
|
|
#define noraw()
|
|
|
|
#define nodelay(x,val) set_slang_delay(val)
|
|
|
|
#define noecho()
|
|
|
|
#define beep() SLtt_beep ()
|
|
|
|
#define keypad(scr,value) slang_keypad (value)
|
|
|
|
|
|
|
|
#define ungetch(x) SLang_ungetkey(x)
|
|
|
|
#define start_color()
|
|
|
|
#define touchwin(x) SLsmg_touch_lines(0, LINES)
|
2001-09-08 08:37:19 +04:00
|
|
|
#define reset_shell_mode() slang_shell_mode()
|
|
|
|
#define reset_prog_mode() slang_prog_mode()
|
1998-02-27 07:54:42 +03:00
|
|
|
#define flushinp()
|
|
|
|
|
|
|
|
void slint_goto (int y, int x);
|
|
|
|
void attrset (int color);
|
|
|
|
void set_slang_delay (int);
|
|
|
|
void slang_init (void);
|
|
|
|
void slang_prog_mode (void);
|
|
|
|
void hline (int ch, int len);
|
|
|
|
void vline (int ch, int len);
|
|
|
|
int getch (void);
|
|
|
|
void slang_keypad (int set);
|
|
|
|
void slang_shell_mode (void);
|
|
|
|
void slang_shutdown (void);
|
|
|
|
int has_colors (void);
|
|
|
|
|
2001-09-08 08:37:19 +04:00
|
|
|
#define move(x, y) SLsmg_gotorc(x, y)
|
2002-11-15 04:35:12 +03:00
|
|
|
#define getyx(stdscr, row, col) \
|
|
|
|
do { \
|
|
|
|
row = SLsmg_get_row(); \
|
|
|
|
col = SLsmg_get_column(); \
|
|
|
|
} while (0)
|
1998-02-27 07:54:42 +03:00
|
|
|
#define printw SLsmg_printf
|
|
|
|
#define COLS SLtt_Screen_Cols
|
|
|
|
#define LINES SLtt_Screen_Rows
|
2001-09-08 08:37:19 +04:00
|
|
|
#define standend() SLsmg_normal_video()
|
2002-10-22 08:16:07 +04:00
|
|
|
|
|
|
|
#ifdef UTF8
|
|
|
|
/*
|
|
|
|
* Patched S-Lang in Red Hat 8.0 expects wchar_t as the argument to addch()
|
|
|
|
* Avoid conversion by using SLsmg_write_nchars(), which takes char*
|
|
|
|
*/
|
|
|
|
#undef addch
|
|
|
|
static inline void
|
|
|
|
mc_addch (char c)
|
|
|
|
{
|
|
|
|
SLsmg_write_nchars (&c, 1);
|
|
|
|
}
|
|
|
|
#define addch(c) mc_addch(c)
|
|
|
|
#else
|
2001-09-08 08:37:19 +04:00
|
|
|
#define addch(c) SLsmg_write_char(c)
|
2002-10-22 08:16:07 +04:00
|
|
|
#endif
|
|
|
|
|
2004-09-19 19:55:58 +04:00
|
|
|
#define addstr(s) SLsmg_write_string(const_cast(char *, s))
|
2001-09-08 08:37:19 +04:00
|
|
|
#define refresh() SLsmg_refresh()
|
2004-09-19 19:55:58 +04:00
|
|
|
#define mvaddstr(y, x, s) SLsmg_gotorc(y, x); SLsmg_write_string(const_cast(char *, s))
|
2001-09-08 08:37:19 +04:00
|
|
|
#define endwin() SLsmg_reset_smg()
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
#define SLsmg_draw_double_box(r,c,dr,dc) SLsmg_draw_box ((r), (c), (dr), (dc))
|
|
|
|
|
1999-01-10 11:55:35 +03:00
|
|
|
#ifdef HAS_ACS_AS_PCCHARS
|
1998-03-23 08:27:15 +03:00
|
|
|
# define one_vline() addch(ACS_VLINE)
|
|
|
|
# define one_hline() addch(ACS_HLINE)
|
2003-06-02 23:26:55 +04:00
|
|
|
/* This is fast, but only useful on PC system as it doesn't use
|
1998-02-27 07:54:42 +03:00
|
|
|
Alt_Char_Pairs [] :( */
|
|
|
|
#else
|
2004-12-03 22:17:46 +03:00
|
|
|
/* This is slow, but works well :| */
|
|
|
|
# define one_vline() SLsmg_draw_object (SLsmg_get_row(), SLsmg_get_column(), slow_terminal ? ' ' : ACS_VLINE)
|
|
|
|
# define one_hline() SLsmg_draw_object (SLsmg_get_row(), SLsmg_get_column(), slow_terminal ? ' ' : ACS_HLINE)
|
|
|
|
#endif
|
1998-02-27 07:54:42 +03:00
|
|
|
|
1998-12-03 00:27:27 +03:00
|
|
|
void enable_interrupt_key (void);
|
|
|
|
void disable_interrupt_key (void);
|
2004-12-03 22:17:46 +03:00
|
|
|
|
|
|
|
#endif
|