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