Back to index

tetex-bin  3.0
terminal.h
Go to the documentation of this file.
00001 /* terminal.h -- The external interface to terminal I/O.
00002    $Id: terminal.h,v 1.3 2004/04/11 17:56:46 karl Exp $
00003 
00004    Copyright (C) 1993, 1996, 1997, 2001, 2002, 2004 Free Software
00005    Foundation, Inc.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2, or (at your option)
00010    any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020 
00021    Written by Brian Fox (bfox@ai.mit.edu). */
00022 
00023 #if !defined (TERMINAL_H)
00024 #define TERMINAL_H
00025 
00026 #include "info.h"
00027 
00028 /* For almost every function externally visible from terminal.c, there is
00029    a corresponding "hook" function which can be bound in order to replace
00030    the functionality of the one found in terminal.c.  This is how we go
00031    about implemented X window display. */
00032 
00033 /* The width and height of the terminal. */
00034 extern int screenwidth, screenheight;
00035 
00036 /* Non-zero means this terminal can't really do anything. */
00037 extern int terminal_is_dumb_p;
00038 
00039 /* Non-zero means that this terminal has a meta key. */
00040 extern int terminal_has_meta_p;
00041 
00042 /* Non-zero means that this terminal can produce a visible bell. */
00043 extern int terminal_has_visible_bell_p;
00044 
00045 /* Non-zero means to use that visible bell if at all possible. */
00046 extern int terminal_use_visible_bell_p;
00047 
00048 /* Non-zero means that this terminal can scroll lines up and down. */
00049 extern int terminal_can_scroll;
00050 
00051 /* Initialize the terminal which is known as TERMINAL_NAME.  If this terminal
00052    doesn't have cursor addressability, TERMINAL_IS_DUMB_P becomes non-zero.
00053    The variables SCREENHEIGHT and SCREENWIDTH are set to the dimensions that
00054    this terminal actually has.  The variable TERMINAL_HAS_META_P becomes non-
00055    zero if this terminal supports a Meta key. */
00056 extern void terminal_initialize_terminal (char *terminal_name);
00057 extern VFunction *terminal_initialize_terminal_hook;
00058 
00059 /* Return the current screen width and height in the variables
00060    SCREENWIDTH and SCREENHEIGHT. */
00061 extern void terminal_get_screen_size (void);
00062 extern VFunction *terminal_get_screen_size_hook;
00063 
00064 /* Save and restore tty settings. */
00065 extern void terminal_prep_terminal (void);
00066 extern void terminal_unprep_terminal (void);
00067 
00068 extern VFunction *terminal_prep_terminal_hook;
00069 extern VFunction *terminal_unprep_terminal_hook;
00070 
00071 /* Re-initialize the terminal to TERMINAL_NAME. */
00072 extern void terminal_new_terminal (char *terminal_name);
00073 extern VFunction *terminal_new_terminal_hook;
00074 
00075 /* Move the cursor to the terminal location of X and Y. */
00076 extern void terminal_goto_xy (int x, int y);
00077 extern VFunction *terminal_goto_xy_hook;
00078 
00079 /* Print STRING to the terminal at the current position. */
00080 extern void terminal_put_text (char *string);
00081 extern VFunction *terminal_put_text_hook;
00082 
00083 /* Print NCHARS from STRING to the terminal at the current position. */
00084 extern void terminal_write_chars (char *string, int nchars);
00085 extern VFunction *terminal_write_chars_hook;
00086 
00087 /* Clear from the current position of the cursor to the end of the line. */
00088 extern void terminal_clear_to_eol (void);
00089 extern VFunction *terminal_clear_to_eol_hook;
00090 
00091 /* Clear the entire terminal screen. */
00092 extern void terminal_clear_screen (void);
00093 extern VFunction *terminal_clear_screen_hook;
00094 
00095 /* Move the cursor up one line. */
00096 extern void terminal_up_line (void);
00097 extern VFunction *terminal_up_line_hook;
00098 
00099 /* Move the cursor down one line. */
00100 extern void terminal_down_line (void);
00101 extern VFunction *terminal_down_line_hook;
00102 
00103 /* Turn on reverse video if possible. */
00104 extern void terminal_begin_inverse (void);
00105 extern VFunction *terminal_begin_inverse_hook;
00106 
00107 /* Turn off reverse video if possible. */
00108 extern void terminal_end_inverse (void);
00109 extern VFunction *terminal_end_inverse_hook;
00110 
00111 /* Scroll an area of the terminal, starting with the region from START
00112    to END, AMOUNT lines.  If AMOUNT is negative, the lines are scrolled
00113    towards the top of the screen, else they are scrolled towards the
00114    bottom of the screen. */
00115 extern void terminal_scroll_terminal (int start, int end, int amount);
00116 extern VFunction *terminal_scroll_terminal_hook;
00117 
00118 /* Ring the terminal bell.  The bell is run visibly if it both has one and
00119    terminal_use_visible_bell_p is non-zero. */
00120 extern void terminal_ring_bell (void);
00121 extern VFunction *terminal_ring_bell_hook;
00122 
00123 /* The key sequences output by special keys, if this terminal has any. */
00124 extern char *term_ku, *term_kd, *term_kr, *term_kl;
00125 extern char *term_kP, *term_kN;
00126 extern char *term_ke, *term_kh;
00127 extern char *term_kx, *term_ki;
00128 extern char *term_kD;
00129 
00130 #endif /* !TERMINAL_H */