1 | /* terminal.h -- The external interface to terminal I/O.
|
---|
2 | $Id: terminal.h,v 1.3 2004/04/11 17:56:46 karl Exp $
|
---|
3 |
|
---|
4 | Copyright (C) 1993, 1996, 1997, 2001, 2002, 2004 Free Software
|
---|
5 | Foundation, Inc.
|
---|
6 |
|
---|
7 | This program is free software; you can redistribute it and/or modify
|
---|
8 | it under the terms of the GNU General Public License as published by
|
---|
9 | the Free Software Foundation; either version 2, or (at your option)
|
---|
10 | any later version.
|
---|
11 |
|
---|
12 | This program is distributed in the hope that it will be useful,
|
---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | GNU General Public License for more details.
|
---|
16 |
|
---|
17 | You should have received a copy of the GNU General Public License
|
---|
18 | along with this program; if not, write to the Free Software
|
---|
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
---|
20 |
|
---|
21 | Written by Brian Fox (bfox@ai.mit.edu). */
|
---|
22 |
|
---|
23 | #if !defined (TERMINAL_H)
|
---|
24 | #define TERMINAL_H
|
---|
25 |
|
---|
26 | #include "info.h"
|
---|
27 |
|
---|
28 | /* For almost every function externally visible from terminal.c, there is
|
---|
29 | a corresponding "hook" function which can be bound in order to replace
|
---|
30 | the functionality of the one found in terminal.c. This is how we go
|
---|
31 | about implemented X window display. */
|
---|
32 |
|
---|
33 | /* The width and height of the terminal. */
|
---|
34 | extern int screenwidth, screenheight;
|
---|
35 |
|
---|
36 | /* Non-zero means this terminal can't really do anything. */
|
---|
37 | extern int terminal_is_dumb_p;
|
---|
38 |
|
---|
39 | /* Non-zero means that this terminal has a meta key. */
|
---|
40 | extern int terminal_has_meta_p;
|
---|
41 |
|
---|
42 | /* Non-zero means that this terminal can produce a visible bell. */
|
---|
43 | extern int terminal_has_visible_bell_p;
|
---|
44 |
|
---|
45 | /* Non-zero means to use that visible bell if at all possible. */
|
---|
46 | extern int terminal_use_visible_bell_p;
|
---|
47 |
|
---|
48 | /* Non-zero means that this terminal can scroll lines up and down. */
|
---|
49 | extern int terminal_can_scroll;
|
---|
50 |
|
---|
51 | /* Initialize the terminal which is known as TERMINAL_NAME. If this terminal
|
---|
52 | doesn't have cursor addressability, TERMINAL_IS_DUMB_P becomes non-zero.
|
---|
53 | The variables SCREENHEIGHT and SCREENWIDTH are set to the dimensions that
|
---|
54 | this terminal actually has. The variable TERMINAL_HAS_META_P becomes non-
|
---|
55 | zero if this terminal supports a Meta key. */
|
---|
56 | extern void terminal_initialize_terminal (char *terminal_name);
|
---|
57 | extern VFunction *terminal_initialize_terminal_hook;
|
---|
58 |
|
---|
59 | /* Return the current screen width and height in the variables
|
---|
60 | SCREENWIDTH and SCREENHEIGHT. */
|
---|
61 | extern void terminal_get_screen_size (void);
|
---|
62 | extern VFunction *terminal_get_screen_size_hook;
|
---|
63 |
|
---|
64 | /* Save and restore tty settings. */
|
---|
65 | extern void terminal_prep_terminal (void);
|
---|
66 | extern void terminal_unprep_terminal (void);
|
---|
67 |
|
---|
68 | extern VFunction *terminal_prep_terminal_hook;
|
---|
69 | extern VFunction *terminal_unprep_terminal_hook;
|
---|
70 |
|
---|
71 | /* Re-initialize the terminal to TERMINAL_NAME. */
|
---|
72 | extern void terminal_new_terminal (char *terminal_name);
|
---|
73 | extern VFunction *terminal_new_terminal_hook;
|
---|
74 |
|
---|
75 | /* Move the cursor to the terminal location of X and Y. */
|
---|
76 | extern void terminal_goto_xy (int x, int y);
|
---|
77 | extern VFunction *terminal_goto_xy_hook;
|
---|
78 |
|
---|
79 | /* Print STRING to the terminal at the current position. */
|
---|
80 | extern void terminal_put_text (char *string);
|
---|
81 | extern VFunction *terminal_put_text_hook;
|
---|
82 |
|
---|
83 | /* Print NCHARS from STRING to the terminal at the current position. */
|
---|
84 | extern void terminal_write_chars (char *string, int nchars);
|
---|
85 | extern VFunction *terminal_write_chars_hook;
|
---|
86 |
|
---|
87 | /* Clear from the current position of the cursor to the end of the line. */
|
---|
88 | extern void terminal_clear_to_eol (void);
|
---|
89 | extern VFunction *terminal_clear_to_eol_hook;
|
---|
90 |
|
---|
91 | /* Clear the entire terminal screen. */
|
---|
92 | extern void terminal_clear_screen (void);
|
---|
93 | extern VFunction *terminal_clear_screen_hook;
|
---|
94 |
|
---|
95 | /* Move the cursor up one line. */
|
---|
96 | extern void terminal_up_line (void);
|
---|
97 | extern VFunction *terminal_up_line_hook;
|
---|
98 |
|
---|
99 | /* Move the cursor down one line. */
|
---|
100 | extern void terminal_down_line (void);
|
---|
101 | extern VFunction *terminal_down_line_hook;
|
---|
102 |
|
---|
103 | /* Turn on reverse video if possible. */
|
---|
104 | extern void terminal_begin_inverse (void);
|
---|
105 | extern VFunction *terminal_begin_inverse_hook;
|
---|
106 |
|
---|
107 | /* Turn off reverse video if possible. */
|
---|
108 | extern void terminal_end_inverse (void);
|
---|
109 | extern VFunction *terminal_end_inverse_hook;
|
---|
110 |
|
---|
111 | /* Scroll an area of the terminal, starting with the region from START
|
---|
112 | to END, AMOUNT lines. If AMOUNT is negative, the lines are scrolled
|
---|
113 | towards the top of the screen, else they are scrolled towards the
|
---|
114 | bottom of the screen. */
|
---|
115 | extern void terminal_scroll_terminal (int start, int end, int amount);
|
---|
116 | extern VFunction *terminal_scroll_terminal_hook;
|
---|
117 |
|
---|
118 | /* Ring the terminal bell. The bell is run visibly if it both has one and
|
---|
119 | terminal_use_visible_bell_p is non-zero. */
|
---|
120 | extern void terminal_ring_bell (void);
|
---|
121 | extern VFunction *terminal_ring_bell_hook;
|
---|
122 |
|
---|
123 | /* The key sequences output by special keys, if this terminal has any. */
|
---|
124 | extern char *term_ku, *term_kd, *term_kr, *term_kl;
|
---|
125 | extern char *term_kP, *term_kN;
|
---|
126 | extern char *term_ke, *term_kh;
|
---|
127 | extern char *term_kx, *term_ki;
|
---|
128 | extern char *term_kD;
|
---|
129 |
|
---|
130 | #endif /* !TERMINAL_H */
|
---|