Ticket #1930: src/strutil8bit.c: fixed missing include of fs.h
[free-mc.git] / src / tty / tty.h
bloba37e793e392b7712622926212dc2dc891e6d0a65
2 /** \file tty.h
3 * \brief Header: %interface to the terminal controlling library
5 * This file is the %interface to the terminal controlling library:
6 * slang or ncurses. It provides an additional layer of abstraction
7 * above the "real" libraries to keep the number of ifdefs in the other
8 * files small.
9 */
11 #ifndef MC_TTY_H
12 #define MC_TTY_H
14 #include "../../src/global.h" /* include <glib.h> */
16 #ifdef HAVE_SLANG
17 # include "../../src/tty/tty-slang.h"
18 #else
19 # include "../../src/tty/tty-ncurses.h"
20 #endif
22 /* {{{ Input }}} */
24 extern void tty_init (gboolean slow, gboolean ugly_lines);
25 extern void tty_shutdown (void);
27 extern gboolean tty_is_slow (void);
29 extern void tty_start_interrupt_key (void);
30 extern void tty_enable_interrupt_key (void);
31 extern void tty_disable_interrupt_key (void);
32 extern gboolean tty_got_interrupt (void);
34 extern void tty_reset_prog_mode (void);
35 extern void tty_reset_shell_mode (void);
37 extern void tty_raw_mode (void);
38 extern void tty_noraw_mode (void);
40 extern void tty_noecho (void);
41 extern int tty_flush_input (void);
43 extern void tty_keypad (gboolean set);
44 extern void tty_nodelay (gboolean set);
45 extern int tty_baudrate (void);
47 extern int tty_lowlevel_getch (void);
49 /* {{{ Output }}} */
52 The output functions do not check themselves for screen overflows,
53 so make sure that you never write more than what fits on the screen.
54 While SLang provides such a feature, ncurses does not.
57 extern int tty_reset_screen (void);
58 extern void tty_touch_screen (void);
60 extern void tty_gotoyx (int y, int x);
61 extern void tty_getyx (int *py, int *px);
63 extern void tty_set_alt_charset (gboolean alt_charset);
65 extern void tty_display_8bit (gboolean what);
66 extern void tty_print_char (int c);
67 extern void tty_print_alt_char (int c);
68 extern void tty_print_anychar (int c);
69 extern void tty_print_string (const char *s);
70 extern void tty_printf (const char *s, ...);
72 extern void tty_print_one_vline (void);
73 extern void tty_print_one_hline (void);
74 extern void tty_draw_hline (int y, int x, int ch, int len);
75 extern void tty_draw_vline (int y, int x, int ch, int len);
76 extern void tty_draw_box (int y, int x, int rows, int cols);
77 extern void tty_fill_region (int y, int x, int rows, int cols, unsigned char ch);
79 extern int mc_tty_ugly_frm[];
81 typedef enum {
82 MC_TTY_FRM_thinvert,
83 MC_TTY_FRM_thinhoriz,
84 MC_TTY_FRM_vert,
85 MC_TTY_FRM_horiz,
86 MC_TTY_FRM_lefttop,
87 MC_TTY_FRM_righttop,
88 MC_TTY_FRM_leftbottom,
89 MC_TTY_FRM_rightbottom,
90 MC_TTY_FRM_centertop,
91 MC_TTY_FRM_centerbottom,
92 MC_TTY_FRM_leftmiddle,
93 MC_TTY_FRM_rightmiddle,
94 MC_TTY_FRM_centermiddle,
95 MC_TTY_FRM_MAX
96 } mc_tty_frm_t;
98 extern char *tty_tgetstr (const char *name);
100 extern void tty_beep (void);
102 #define KEY_KP_ADD 4001
103 #define KEY_KP_SUBTRACT 4002
104 #define KEY_KP_MULTIPLY 4003
106 extern void tty_refresh (void);
107 extern void tty_setup_sigwinch (void (*handler) (int));
109 extern int mc_tty_normalize_lines_char (const char *);
111 #endif /* MC_TTY_H */