lib-src/emacsclient.c: Implemented --here option (open a new Emacs tty). Needs...
[bpt/emacs.git] / src / termchar.h
1 /* Flags and parameters describing terminal's characteristics.
2 Copyright (C) 1985, 1986 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
6 GNU Emacs 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 GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 /* Each termcap frame points to its own struct tty_output object in the
22 output_data.tty field. The tty_output structure contains the information
23 that is specific to terminals. */
24 struct tty_output
25 {
26 char *name; /* The name of the device file or 0 if
27 stdin/stdout. */
28 char *type; /* The type of the tty. */
29
30 /* Input/output */
31
32 FILE *input; /* The stream to be used for terminal input. */
33 FILE *output; /* The stream to be used for terminal output. */
34
35 FILE *termscript; /* If nonzero, send all terminal output
36 characters to this stream also. */
37
38 struct emacs_tty old_tty; /* The initial tty mode bits */
39
40 int term_initted; /* 1 if we have been through init_sys_modes. */
41 int old_tty_valid; /* 1 if outer tty status has been recorded. */
42
43
44 /* Redisplay. */
45
46 /* XXX This may cause problems with GC. */
47 Lisp_Object top_frame; /* The topmost frame on this tty. */
48
49 /* The previous terminal frame we displayed on this tty. */
50 struct frame *previous_terminal_frame;
51
52 /* Pixel values.
53 XXX What are these used for? */
54
55 unsigned long background_pixel;
56 unsigned long foreground_pixel;
57
58 /* Terminal characteristics. */
59
60 int must_write_spaces; /* Nonzero means spaces in the text must
61 actually be output; can't just skip over
62 some columns to leave them blank. */
63 int fast_clear_end_of_line; /* Nonzero means terminal has a `ce' string */
64
65 int line_ins_del_ok; /* Terminal can insert and delete lines */
66 int char_ins_del_ok; /* Terminal can insert and delete chars */
67 int scroll_region_ok; /* Terminal supports setting the scroll
68 window */
69 int scroll_region_cost; /* Cost of setting the scroll window,
70 measured in characters. */
71 int memory_below_frame; /* Terminal remembers lines scrolled
72 off bottom */
73
74 #if 0 /* These are not used anywhere. */
75 /* EMACS_INT baud_rate; */ /* Output speed in baud */
76 int min_padding_speed; /* Speed below which no padding necessary. */
77 int dont_calculate_costs; /* Nonzero means don't bother computing
78 various cost tables; we won't use them. */
79 #endif
80
81 struct tty_output *next;
82 };
83
84 extern struct tty_output *tty_list;
85
86
87 #define FRAME_TTY(f) \
88 ((f)->output_method == output_termcap \
89 ? (f)->output_data.tty : (abort(), (struct tty_output *) 0))
90
91 #define CURTTY() FRAME_TTY (SELECTED_FRAME())
92
93 #define TTY_NAME(t) ((t)->name)
94 #define TTY_TYPE(t) ((t)->type)
95
96 #define TTY_INPUT(t) ((t)->input)
97 #define TTY_OUTPUT(t) ((t)->output)
98 #define TTY_TERMSCRIPT(t) ((t)->termscript)
99
100 #define TTY_MUST_WRITE_SPACES(t) ((t)->must_write_spaces)
101 #define TTY_FAST_CLEAR_END_OF_LINE(t) ((t)->fast_clear_end_of_line)
102 #define TTY_LINE_INS_DEL_OK(t) ((t)->line_ins_del_ok)
103 #define TTY_CHAR_INS_DEL_OK(t) ((t)->char_ins_del_ok)
104 #define TTY_SCROLL_REGION_OK(t) ((t)->scroll_region_ok)
105 #define TTY_SCROLL_REGION_COST(t) ((t)->scroll_region_cost)
106 #define TTY_MEMORY_BELOW_FRAME(t) ((t)->memory_below_frame)
107
108 #if 0
109 /* These are not used anywhere. */
110 #define TTY_MIN_PADDING_SPEED(t) ((t)->min_padding_speed)
111 #define TTY_DONT_CALCULATE_COSTS(t) ((t)->dont_calculate_costs)
112 #endif
113
114 /* arch-tag: bf9f0d49-842b-42fb-9348-ec8759b27193
115 (do not change this comment) */