2009-02-05 20:28:18 +02:00
|
|
|
|
|
|
|
/** \file tty.h
|
2009-02-06 16:46:15 +02: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 20:28:18 +02:00
|
|
|
*/
|
|
|
|
|
2004-12-03 19:17:46 +00:00
|
|
|
#ifndef MC_TTY_H
|
|
|
|
#define MC_TTY_H
|
2001-09-03 03:07:46 +00:00
|
|
|
|
2009-05-10 19:01:15 +04:00
|
|
|
#include "../../src/global.h" /* include <glib.h> */
|
1998-02-27 04:54:42 +00: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 02:01:53 +02:00
|
|
|
#endif
|
|
|
|
|
2005-09-01 17:06:38 +00:00
|
|
|
/* {{{ Input }}} */
|
|
|
|
|
2009-06-08 15:59:04 +04:00
|
|
|
extern void tty_init_slang (void);
|
|
|
|
extern void tty_init_curses (void);
|
|
|
|
extern void tty_shutdown (void);
|
|
|
|
|
2009-07-15 22:31:52 +04:00
|
|
|
extern void tty_start_interrupt_key(void);
|
2005-08-29 08:45:28 +00:00
|
|
|
extern void tty_enable_interrupt_key(void);
|
|
|
|
extern void tty_disable_interrupt_key(void);
|
2009-02-05 23:46:07 +01:00
|
|
|
extern gboolean tty_got_interrupt(void);
|
2005-08-29 08:45:28 +00:00
|
|
|
|
2009-05-31 16:23:10 +04:00
|
|
|
extern void tty_reset_prog_mode (void);
|
|
|
|
extern void tty_reset_shell_mode (void);
|
|
|
|
|
2009-05-19 20:12:29 +04:00
|
|
|
extern void tty_raw_mode (void);
|
|
|
|
extern void tty_noraw_mode (void);
|
2009-05-13 17:05:55 +04:00
|
|
|
|
2009-06-02 21:40:37 +04:00
|
|
|
extern void tty_noecho (void);
|
|
|
|
extern int tty_flush_input (void);
|
|
|
|
|
2009-05-31 16:23:10 +04:00
|
|
|
extern void tty_keypad (gboolean set);
|
|
|
|
extern void tty_nodelay (gboolean set);
|
2009-06-02 08:55:07 +04:00
|
|
|
extern int tty_baudrate (void);
|
2009-05-31 16:23:10 +04:00
|
|
|
|
2005-09-01 17:06:38 +00:00
|
|
|
/* {{{ Output }}} */
|
2005-09-01 17:04:05 +00: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-06-02 21:40:37 +04:00
|
|
|
extern int tty_reset_screen (void);
|
2009-06-02 08:55:07 +04:00
|
|
|
extern void tty_touch_screen (void);
|
|
|
|
|
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 03:55:37 +00:00
|
|
|
|
2009-06-02 08:55:07 +04:00
|
|
|
extern void tty_set_alt_charset (gboolean alt_charset);
|
|
|
|
|
2009-06-08 13:49:46 +04:00
|
|
|
extern void tty_display_8bit (gboolean what);
|
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);
|
2009-06-03 23:07:06 +04:00
|
|
|
extern void tty_print_one_vline (gboolean is_slow_term);
|
|
|
|
extern void tty_print_one_hline (gboolean is_slow_term);
|
|
|
|
extern void tty_draw_hline (int y, int x, int ch, int len);
|
|
|
|
extern void tty_draw_vline (int y, int x, int ch, int len);
|
2009-05-11 18:43:00 +04:00
|
|
|
extern void tty_draw_box (int y, int x, int rows, int cols);
|
2009-05-26 18:56:42 +04:00
|
|
|
extern void tty_fill_region (int y, int x, int rows, int cols, unsigned char ch);
|
2009-05-13 17:05:55 +04:00
|
|
|
|
2006-05-15 13:26:18 +00:00
|
|
|
extern char *tty_tgetstr (const char *name);
|
|
|
|
|
2009-05-31 16:23:10 +04:00
|
|
|
extern void tty_beep (void);
|
|
|
|
|
1998-02-27 04:54:42 +00: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 00:24:14 +00:00
|
|
|
|
2009-05-10 19:01:15 +04:00
|
|
|
#endif /* MC_TTY_H */
|