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
|
|
|
|
2010-01-20 17:11:52 +02:00
|
|
|
#include "lib/global.h" /* include <glib.h> */
|
1998-02-27 04:54:42 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_SLANG
|
2010-01-07 01:57:27 +02:00
|
|
|
# include "tty-slang.h"
|
2009-05-10 19:01:15 +04:00
|
|
|
#else
|
2010-01-07 01:57:27 +02:00
|
|
|
# include "tty-ncurses.h"
|
2008-12-29 02:01:53 +02:00
|
|
|
#endif
|
|
|
|
|
2005-09-01 17:06:38 +00:00
|
|
|
/* {{{ Input }}} */
|
|
|
|
|
2010-02-15 11:21:30 +00:00
|
|
|
extern int reset_hp_softkeys;
|
|
|
|
|
2009-07-12 14:22:41 +04:00
|
|
|
extern void tty_init (gboolean slow, gboolean ugly_lines);
|
2009-06-08 15:59:04 +04:00
|
|
|
extern void tty_shutdown (void);
|
|
|
|
|
2009-07-12 14:22:41 +04:00
|
|
|
extern gboolean tty_is_slow (void);
|
|
|
|
|
2009-09-17 01:07:04 +03:00
|
|
|
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);
|
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
|
|
|
|
2009-06-19 21:33:41 +04:00
|
|
|
extern int tty_lowlevel_getch (void);
|
|
|
|
|
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-09-17 01:07:04 +03: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-09-17 01:07:04 +03:00
|
|
|
extern void tty_print_char (int c);
|
2010-03-17 22:19:03 +03:00
|
|
|
extern void tty_print_alt_char (int c, gboolean single);
|
2009-09-17 01:07:04 +03:00
|
|
|
extern void tty_print_anychar (int c);
|
|
|
|
extern void tty_print_string (const char *s);
|
|
|
|
extern void tty_printf (const char *s, ...);
|
2009-05-13 17:05:55 +04:00
|
|
|
|
2010-03-21 11:58:45 +03:00
|
|
|
extern void tty_print_one_vline (gboolean single);
|
|
|
|
extern void tty_print_one_hline (gboolean single);
|
2009-06-03 23:07:06 +04:00
|
|
|
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);
|
2010-03-18 21:44:35 +03:00
|
|
|
extern void tty_draw_box (int y, int x, int rows, int cols);
|
|
|
|
extern void tty_draw_double_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
|
|
|
|
2009-09-04 16:31:38 +03:00
|
|
|
extern int mc_tty_ugly_frm[];
|
|
|
|
|
2009-09-17 01:07:04 +03:00
|
|
|
typedef enum {
|
2009-09-04 16:31:38 +03:00
|
|
|
MC_TTY_FRM_thinvert,
|
|
|
|
MC_TTY_FRM_thinhoriz,
|
|
|
|
MC_TTY_FRM_vert,
|
|
|
|
MC_TTY_FRM_horiz,
|
|
|
|
MC_TTY_FRM_lefttop,
|
|
|
|
MC_TTY_FRM_righttop,
|
|
|
|
MC_TTY_FRM_leftbottom,
|
|
|
|
MC_TTY_FRM_rightbottom,
|
2009-09-09 17:56:52 +03:00
|
|
|
MC_TTY_FRM_centertop,
|
|
|
|
MC_TTY_FRM_centerbottom,
|
2009-09-04 16:31:38 +03:00
|
|
|
MC_TTY_FRM_leftmiddle,
|
2009-09-09 17:56:52 +03:00
|
|
|
MC_TTY_FRM_rightmiddle,
|
2009-09-10 15:14:18 +03:00
|
|
|
MC_TTY_FRM_centermiddle,
|
2010-03-17 22:19:03 +03:00
|
|
|
|
|
|
|
MC_TTY_FRM_grpvert,
|
|
|
|
MC_TTY_FRM_grphoriz,
|
|
|
|
MC_TTY_FRM_grplefttop,
|
|
|
|
MC_TTY_FRM_grprighttop,
|
|
|
|
MC_TTY_FRM_grpleftbottom,
|
|
|
|
MC_TTY_FRM_grprightbottom,
|
|
|
|
MC_TTY_FRM_grpcentertop,
|
|
|
|
MC_TTY_FRM_grpcenterbottom,
|
|
|
|
MC_TTY_FRM_grpleftmiddle,
|
|
|
|
MC_TTY_FRM_grprightmiddle,
|
|
|
|
MC_TTY_FRM_grpcentermiddle,
|
|
|
|
|
2009-09-09 17:56:52 +03:00
|
|
|
MC_TTY_FRM_MAX
|
2009-09-04 16:31:38 +03:00
|
|
|
} mc_tty_frm_t;
|
2009-08-23 20:42:28 +00: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-08-06 13:17:01 +04:00
|
|
|
extern void tty_refresh (void);
|
|
|
|
extern void tty_setup_sigwinch (void (*handler) (int));
|
2001-06-15 00:24:14 +00:00
|
|
|
|
2009-09-17 01:07:04 +03:00
|
|
|
extern int mc_tty_normalize_lines_char (const char *);
|
2009-09-14 16:43:03 +03:00
|
|
|
|
2009-09-17 01:07:04 +03:00
|
|
|
#endif /* MC_TTY_H */
|