OSDN Git Service

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