2009-02-05 21:28:18 +03:00
|
|
|
|
|
|
|
/** \file tty.h
|
|
|
|
* \brief Header: interface to the terminal controlling library
|
|
|
|
*/
|
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
#ifndef MC_TTY_H
|
|
|
|
#define MC_TTY_H
|
2001-09-03 07:07:46 +04:00
|
|
|
|
2005-08-29 12:45:28 +04:00
|
|
|
/*
|
|
|
|
This file is the interface to the terminal controlling library---
|
|
|
|
ncurses, slang or the built-in slang. It provides an additional
|
|
|
|
layer of abstraction above the "real" libraries to keep the number
|
|
|
|
of ifdefs in the other files small.
|
|
|
|
*/
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
#ifdef HAVE_SLANG
|
|
|
|
# include "myslang.h"
|
|
|
|
#endif
|
|
|
|
|
2001-09-03 07:07:46 +04:00
|
|
|
#ifdef USE_NCURSES
|
2002-07-13 09:13:07 +04:00
|
|
|
# ifdef HAVE_NCURSES_CURSES_H
|
|
|
|
# include <ncurses/curses.h>
|
|
|
|
# elif HAVE_NCURSES_H
|
1998-02-27 07:54:42 +03:00
|
|
|
# include <ncurses.h>
|
2002-07-13 09:13:07 +04:00
|
|
|
# else
|
|
|
|
# include <curses.h>
|
1998-02-27 07:54:42 +03:00
|
|
|
# endif
|
2006-05-15 17:26:18 +04:00
|
|
|
#ifdef WANT_TERM_H
|
|
|
|
# include <term.h>
|
|
|
|
#endif /* WANT_TERM_H */
|
2001-09-03 07:07:46 +04:00
|
|
|
#endif /* USE_NCURSES */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2005-09-01 21:06:38 +04:00
|
|
|
/* {{{ Input }}} */
|
|
|
|
|
2005-08-29 12:45:28 +04:00
|
|
|
extern void tty_enable_interrupt_key(void);
|
|
|
|
extern void tty_disable_interrupt_key(void);
|
2009-02-06 01:46:07 +03:00
|
|
|
extern gboolean tty_got_interrupt(void);
|
2005-08-29 12:45:28 +04:00
|
|
|
|
2005-09-01 21:06:38 +04:00
|
|
|
/* {{{ Output }}} */
|
2005-09-01 21:04:05 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
The output functions do not check themselves for screen overflows,
|
|
|
|
so make sure that you never write more than what fits on the screen.
|
|
|
|
While SLang provides such a feature, ncurses does not.
|
|
|
|
*/
|
|
|
|
|
2005-08-29 12:45:28 +04:00
|
|
|
extern void tty_gotoyx(int, int);
|
|
|
|
extern void tty_getyx(int *, int *);
|
2006-02-03 06:55:37 +03:00
|
|
|
|
|
|
|
extern void tty_setcolor(int);
|
|
|
|
|
2005-08-29 12:45:28 +04:00
|
|
|
extern void tty_print_char(int);
|
|
|
|
extern void tty_print_alt_char(int);
|
|
|
|
extern void tty_print_string(const char *);
|
|
|
|
extern void tty_print_one_vline(void);
|
|
|
|
extern void tty_print_one_hline(void);
|
2005-08-29 13:03:10 +04:00
|
|
|
extern void tty_print_vline(int top, int left, int length);
|
|
|
|
extern void tty_print_hline(int top, int left, int length);
|
2005-09-05 02:02:25 +04:00
|
|
|
extern void tty_printf(const char *, ...);
|
2005-08-29 12:45:28 +04:00
|
|
|
|
2006-05-15 17:26:18 +04:00
|
|
|
extern char *tty_tgetstr (const char *name);
|
|
|
|
|
2005-08-29 12:45:28 +04:00
|
|
|
/* legacy interface */
|
|
|
|
|
|
|
|
#define enable_interrupt_key() tty_enable_interrupt_key()
|
|
|
|
#define disable_interrupt_key() tty_disable_interrupt_key()
|
|
|
|
#define got_interrupt() tty_got_interrupt()
|
2005-08-29 14:02:35 +04:00
|
|
|
#define one_hline() tty_print_one_hline()
|
|
|
|
#define one_vline() tty_print_one_vline()
|
2005-08-29 12:45:28 +04:00
|
|
|
|
|
|
|
#ifndef HAVE_SLANG
|
|
|
|
# define acs()
|
|
|
|
# define noacs()
|
|
|
|
#endif
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
#define KEY_KP_ADD 4001
|
|
|
|
#define KEY_KP_SUBTRACT 4002
|
|
|
|
#define KEY_KP_MULTIPLY 4003
|
|
|
|
|
2001-06-15 04:24:14 +04:00
|
|
|
void mc_refresh (void);
|
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
#endif
|