1
1
mc/src/tty/tty.h

66 строки
1.8 KiB
C
Исходник Обычный вид История

/** \file tty.h
* \brief Header: %interface to the terminal controlling library
*
* This file is the %interface to the terminal controlling library:
* 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.
*/
#ifndef MC_TTY_H
#define MC_TTY_H
#include "../../src/global.h" /* include <glib.h> */
1998-02-27 07:54:42 +03:00
#ifdef HAVE_SLANG
# include "../../src/tty/tty-slang.h"
#else
# include "../../src/tty/tty-ncurses.h"
#endif
2005-09-01 21:06:38 +04:00
/* {{{ Input }}} */
extern void tty_start_interrupt_key(void);
extern void tty_enable_interrupt_key(void);
extern void tty_disable_interrupt_key(void);
extern gboolean tty_got_interrupt(void);
extern void tty_raw_mode (void);
extern void tty_noraw_mode (void);
2005-09-01 21:06:38 +04:00
/* {{{ Output }}} */
/*
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.
*/
extern void tty_gotoyx(int y, int x);
extern void tty_getyx(int *py, int *px);
extern void tty_print_char(int c);
extern void tty_print_alt_char(int c);
extern void tty_print_string(const char *s);
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);
extern void tty_print_one_vline(void);
extern void tty_print_one_hline(void);
extern void tty_print_vline(int top, int left, int length);
extern void tty_print_hline(int top, int left, int length);
extern void tty_draw_box (int y, int x, int rows, int cols);
extern void tty_fill_region (int y, int x, int rows, int cols, unsigned char ch);
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);
#endif /* MC_TTY_H */