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