2009-02-05 21:28:18 +03:00
|
|
|
|
|
|
|
/** \file tty.h
|
2009-02-06 17:46:15 +03:00
|
|
|
* \brief Header: %interface to the terminal controlling library
|
|
|
|
*
|
|
|
|
* This file is the %interface to the terminal controlling library:
|
2009-05-10 19:01:15 +04:00
|
|
|
* slang or ncurses. It provides an additional layer of abstraction
|
|
|
|
* above the "real" libraries to keep the number of ifdefs in the other
|
|
|
|
* files small.
|
2009-02-05 21:28:18 +03:00
|
|
|
*/
|
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
#ifndef MC_TTY_H
|
|
|
|
#define MC_TTY_H
|
2001-09-03 07:07:46 +04:00
|
|
|
|
2009-05-10 19:01:15 +04:00
|
|
|
#include "../../src/global.h" /* include <glib.h> */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
#ifdef HAVE_SLANG
|
2009-05-10 19:01:15 +04:00
|
|
|
# include "../../src/tty/tty-slang.h"
|
|
|
|
#else
|
|
|
|
# include "../../src/tty/tty-ncurses.h"
|
2008-12-29 03:01:53 +03:00
|
|
|
#endif
|
|
|
|
|
2005-09-01 21:06:38 +04:00
|
|
|
/* {{{ Input }}} */
|
|
|
|
|
2009-07-15 22:31:52 +04:00
|
|
|
extern void tty_start_interrupt_key(void);
|
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
|
|
|
|
2009-05-13 17:05:55 +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.
|
|
|
|
*/
|
|
|
|
|
2009-05-10 19:01:15 +04:00
|
|
|
extern void tty_gotoyx(int y, int x);
|
|
|
|
extern void tty_getyx(int *py, int *px);
|
2006-02-03 06:55:37 +03:00
|
|
|
|
2009-05-10 19:01:15 +04:00
|
|
|
extern void tty_print_char(int c);
|
|
|
|
extern void tty_print_alt_char(int c);
|
|
|
|
extern void tty_print_string(const char *s);
|
2009-05-13 17:05:55 +04:00
|
|
|
extern void tty_printf(const char *s, ...);
|
|
|
|
|
|
|
|
extern void tty_set_ugly_line_drawing (gboolean do_ugly);
|
|
|
|
extern gboolean tty_is_ugly_line_drawing (void);
|
2005-08-29 12:45:28 +04:00
|
|
|
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);
|
2009-05-11 18:43:00 +04:00
|
|
|
extern void tty_draw_box (int y, int x, int rows, int cols);
|
2009-05-13 17:05:55 +04:00
|
|
|
|
2006-05-15 17:26:18 +04:00
|
|
|
extern char *tty_tgetstr (const char *name);
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
#define KEY_KP_ADD 4001
|
|
|
|
#define KEY_KP_SUBTRACT 4002
|
|
|
|
#define KEY_KP_MULTIPLY 4003
|
|
|
|
|
2009-05-13 12:38:11 +04:00
|
|
|
void tty_refresh (void);
|
2001-06-15 04:24:14 +04:00
|
|
|
|
2009-05-10 19:01:15 +04:00
|
|
|
#endif /* MC_TTY_H */
|