Mercurial > emacs
comparison src/frame.h @ 261:731afdb0842c
Initial revision
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Fri, 10 May 1991 21:15:23 +0000 |
parents | |
children | 1ad871406b12 |
comparison
equal
deleted
inserted
replaced
260:cbc9580b880f | 261:731afdb0842c |
---|---|
1 /* Define screen-object for GNU Emacs. | |
2 Copyright (C) 1988 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 1, 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | |
20 | |
21 #ifdef MULTI_SCREEN | |
22 | |
23 enum output_method | |
24 { output_termcap, output_x_window }; | |
25 | |
26 struct screen | |
27 { | |
28 int size; | |
29 struct Lisp_Vector *next; | |
30 | |
31 /* glyphs as they appear on the screen */ | |
32 struct screen_glyphs *current_glyphs; | |
33 | |
34 /* glyphs we'd like to appear on the screen */ | |
35 struct screen_glyphs *desired_glyphs; | |
36 | |
37 /* Cost of inserting 1 line on this screen */ | |
38 int *insert_line_cost; | |
39 | |
40 /* Cost of deleting 1 line on this screen */ | |
41 int *delete_line_cost; | |
42 | |
43 /* Cost of inserting n lines on this screen */ | |
44 int *insert_n_lines_cost; | |
45 | |
46 /* Cost of deleting n lines on this screen */ | |
47 int *delete_n_lines_cost; | |
48 | |
49 /* glyphs for the mode line */ | |
50 struct screen_glyphs *temp_glyphs; | |
51 | |
52 /* Intended cursor position of this screen. | |
53 Measured in characters, counting from upper left corner | |
54 within the screen. */ | |
55 int cursor_x; | |
56 int cursor_y; | |
57 | |
58 /* Actual cursor position of this screen. | |
59 (Not used for terminal screens.) */ | |
60 int phys_cursor_x; | |
61 int phys_cursor_y; | |
62 | |
63 /* Size of this screen, in units of characters. */ | |
64 int height; | |
65 int width; | |
66 | |
67 /* New height and width for pending size change. 0 if no change pending. */ | |
68 int new_height, new_width; | |
69 | |
70 /* Name of this screen: a Lisp string. */ | |
71 Lisp_Object name; | |
72 | |
73 /* This screen's root window. Every screen has one. | |
74 If the screen has only a minibuffer window, this is it. | |
75 Otherwise, if the screen has a minibuffer window, this is its sibling. */ | |
76 Lisp_Object root_window; | |
77 | |
78 /* This screen's selected window. | |
79 Each screen has its own window hierarchy | |
80 and one of the windows in it is selected within the screen. | |
81 The selected window of the selected screen is Emacs's selected window. */ | |
82 Lisp_Object selected_window; | |
83 | |
84 /* This screen's minibuffer window. | |
85 Most screens have their own minibuffer windows, | |
86 but only the selected screen's minibuffer window | |
87 can actually appear to exist. */ | |
88 Lisp_Object minibuffer_window; | |
89 | |
90 /* Parameter alist of this screen. | |
91 These are the parameters specified when creating the screen | |
92 or modified with modify-screen-parameters. */ | |
93 Lisp_Object param_alist; | |
94 | |
95 /* The output method says how the contents of this screen | |
96 are displayed. It could be using termcap, or using an X window. */ | |
97 enum output_method output_method; | |
98 | |
99 /* A structure of auxiliary data used for displaying the contents. | |
100 struct x_display is used for X window screens; | |
101 it is defined in xterm.h. */ | |
102 union display { struct x_display *x; int nothing; } display; | |
103 | |
104 /* Nonzero if last attempt at redisplay on this screen was preempted. */ | |
105 char display_preempted; | |
106 | |
107 /* Nonzero if screen is currently displayed. */ | |
108 char visible; | |
109 | |
110 /* Nonzero if window is currently iconified. | |
111 This and visible are mutually exclusive. */ | |
112 char iconified; | |
113 | |
114 /* Nonzero if this screen should be redrawn. */ | |
115 char garbaged; | |
116 | |
117 /* True if screen actually has a minibuffer window on it. | |
118 0 if using a minibuffer window that isn't on this screen. */ | |
119 char has_minibuffer; | |
120 | |
121 /* 0 means, if this screen has just one window, | |
122 show no modeline for that window. */ | |
123 char wants_modeline; | |
124 | |
125 /* Non-0 means raise this screen to the top of the heap when selected. */ | |
126 char auto_raise; | |
127 | |
128 /* Non-0 means lower this screen to the bottom of the stack when left. */ | |
129 char auto_lower; | |
130 | |
131 /* True if screen's root window can't be split. */ | |
132 char no_split; | |
133 | |
134 /* Storage for messages to this screen. */ | |
135 char *message_buf; | |
136 | |
137 /* Nonnegative if current redisplay should not do scroll computation | |
138 for lines beyond a certain vpos. This is the vpos. */ | |
139 int scroll_bottom_vpos; | |
140 }; | |
141 | |
142 typedef struct screen *SCREEN_PTR; | |
143 | |
144 #define XSCREEN(p) ((struct screen *) XPNTR (p)) | |
145 #define XSETSCREEN(p, v) ((struct screen *) XSETPNTR (p, v)) | |
146 | |
147 #define WINDOW_SCREEN(w) (w)->screen | |
148 | |
149 #define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1, s->garbaged = 1) | |
150 #define SCREEN_IS_TERMCAP(s) ((s)->output_method == output_termcap) | |
151 #define SCREEN_IS_X(s) ((s)->output_method == output_x_window) | |
152 #define SCREEN_CURRENT_GLYPHS(s) (s)->current_glyphs | |
153 #define SCREEN_DESIRED_GLYPHS(s) (s)->desired_glyphs | |
154 #define SCREEN_TEMP_GLYPHS(s) (s)->temp_glyphs | |
155 #define SCREEN_HEIGHT(s) (s)->height | |
156 #define SCREEN_WIDTH(s) (s)->width | |
157 #define SCREEN_NEW_HEIGHT(s) (s)->new_height | |
158 #define SCREEN_NEW_WIDTH(s) (s)->new_width | |
159 #define SCREEN_CURSOR_X(s) (s)->cursor_x | |
160 #define SCREEN_CURSOR_Y(s) (s)->cursor_y | |
161 #define SCREEN_VISIBLE_P(s) (s)->visible | |
162 #define SCREEN_GARBAGED_P(s) (s)->garbaged | |
163 #define SCREEN_NO_SPLIT_P(s) (s)->no_split | |
164 #define SCREEN_WANTS_MODELINE_P(s) (s)->wants_modeline | |
165 #define SCREEN_ICONIFIED_P(s) (s)->iconified | |
166 #define SCREEN_MINIBUF_WINDOW(s) (s)->minibuffer_window | |
167 #define SCREEN_ROOT_WINDOW(s) (s)->root_window | |
168 #define SCREEN_SELECTED_WINDOW(s) (s)->selected_window | |
169 #define SCREENP(s) (XTYPE(s) == Lisp_Screen) | |
170 #define SET_GLYPHS_SCREEN(glyphs,screen) ((glyphs)->screen = (screen)) | |
171 #define SCREEN_INSERT_COST(s) (s)->insert_line_cost | |
172 #define SCREEN_DELETE_COST(s) (s)->delete_line_cost | |
173 #define SCREEN_INSERTN_COST(s) (s)->insert_n_lines_cost | |
174 #define SCREEN_DELETEN_COST(s) (s)->delete_n_lines_cost | |
175 #define SCREEN_MESSAGE_BUF(s) (s)->message_buf | |
176 #define SCREEN_SCROLL_BOTTOM_VPOS(s) (s)->scroll_bottom_vpos | |
177 | |
178 #define CHECK_SCREEN(x, i) \ | |
179 { if (XTYPE ((x)) != Lisp_Screen) x = wrong_type_argument (Qscreenp, (x)); } | |
180 extern Lisp_Object Qscreenp; | |
181 | |
182 extern struct screen *selected_screen; | |
183 | |
184 extern struct screen *make_terminal_screen (); | |
185 extern struct screen *make_screen (); | |
186 extern struct screen *make_minibuffer_screen (); | |
187 extern struct screen *make_screen_without_minibuffer (); | |
188 | |
189 extern Lisp_Object Vscreen_list; | |
190 extern Lisp_Object Vglobal_minibuffer_screen; | |
191 | |
192 extern Lisp_Object Vterminal_screen; | |
193 | |
194 #else /* not MULTI_SCREEN */ | |
195 | |
196 /* These definitions are used in a single-screen version of Emacs. */ | |
197 | |
198 #define SCREEN_PTR int | |
199 | |
200 extern int selected_screen; | |
201 | |
202 #define XSCREEN(s) selected_screen | |
203 #define WINDOW_SCREEN(w) selected_screen | |
204 | |
205 #define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1) | |
206 #define SCREEN_IS_TERMCAP(s) 1 | |
207 #define SCREEN_CURRENT_GLYPHS(s) current_glyphs | |
208 #define SCREEN_DESIRED_GLYPHS(s) desired_glyphs | |
209 #define SCREEN_TEMP_GLYPHS(s) temp_glyphs | |
210 #define SCREEN_HEIGHT(s) screen_height | |
211 #define SCREEN_WIDTH(s) screen_width | |
212 #define SCREEN_NEW_HEIGHT(s) delayed_screen_height | |
213 #define SCREEN_NEW_WIDTH(s) delayed_screen_width | |
214 #define SCREEN_CURSOR_X(s) cursX | |
215 #define SCREEN_CURSOR_Y(s) cursY | |
216 #define SCREEN_VISIBLE_P(s) 1 | |
217 #define SCREEN_GARBAGED_P(s) screen_garbaged | |
218 #define SCREEN_NO_SPLIT_P(s) 0 | |
219 #define SCREEN_WANTS_MODELINE_P(s) 1 | |
220 #define SCREEN_ICONIFIED_P(s) 0 | |
221 #define SCREEN_MINIBUF_WINDOW(s) minibuf_window | |
222 #define SCREEN_ROOT_WINDOW(s) root_window | |
223 #define SCREEN_SELECTED_WINDOW(s) selected_window | |
224 #define SCREENP(s) 0 | |
225 #define SET_GLYPHS_SCREEN(glyphs,screen) | |
226 #define SCREEN_INSERT_COST(screen) insert_line_cost | |
227 #define SCREEN_DELETE_COST(screen) delete_line_cost | |
228 #define SCREEN_INSERTN_COST(screen) insert_n_lines_cost | |
229 #define SCREEN_DELETEN_COST(screen) delete_n_lines_cost | |
230 #define SCREEN_MESSAGE_BUF(s) message_buf | |
231 #define SCREEN_SCROLL_BOTTOM_VPOS scroll_bottom_vpos; | |
232 | |
233 extern int screen_width, screen_height; | |
234 extern int cursX, cursY; | |
235 | |
236 #endif /* not MULTI_SCREEN */ |