428
|
1 /* Definitions of marked slots in windows and window configs
|
|
2 Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
|
844
|
4 Copyright (C) 1995, 1996, 2001, 2002 Ben Wing.
|
428
|
5 Copyright (C) 1996 Chuck Thompson.
|
|
6
|
|
7 This file is part of XEmacs.
|
|
8
|
|
9 XEmacs is free software; you can redistribute it and/or modify it
|
|
10 under the terms of the GNU General Public License as published by the
|
|
11 Free Software Foundation; either version 2, or (at your option) any
|
|
12 later version.
|
|
13
|
|
14 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
17 for more details.
|
|
18
|
|
19 You should have received a copy of the GNU General Public License
|
|
20 along with XEmacs; see the file COPYING. If not, write to
|
|
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
22 Boston, MA 02111-1307, USA. */
|
|
23
|
|
24 /* Split out of window.h and window.c
|
|
25 by Kirill Katsnelson <kkm@kis.ru>, May 1998 */
|
|
26
|
617
|
27 /* Separation into WINDOW_SLOT / WINDOW_SAVED_SLOT by Ben Wing, June 2001.
|
|
28
|
|
29 NOTE: No semicolons after slot declarations in this file! The
|
|
30 definitions of WINDOW_SLOT (and possibly WINDOW_SAVED_SLOT) need
|
844
|
31 to include a semicolon. This is because these may be defined as
|
|
32 nothing, and some compilers don't tolerate extra semicolons in
|
|
33 structure definitions.
|
617
|
34
|
|
35 WINDOW_SLOT declares a Lisp_Object that is not copied into the
|
|
36 saved_window struct of a window configuration, or is handled in
|
|
37 a special way in window configurations.
|
|
38 WINDOW_SLOT_ARRAY is the same for an array of Lisp_Objects.
|
|
39 WINDOW_SAVED_SLOT declares a Lisp_Object that is copied with no
|
|
40 special handling into the saved_window struct of a window
|
|
41 configuration. You must also declare the comparison function,
|
|
42 either EQ or EQUAL_WRAPPED (i.e. Feq() or Fequal()).
|
|
43 WINDOW_SAVED_SLOT_ARRAY is the same for an array of Lisp_Objects.
|
|
44
|
1204
|
45 Callers should define WINDOW_SLOT (with a terminating semicolon if not
|
|
46 blank), and WINDOW_SAVED_SLOT if different; otherwise the latter will be
|
|
47 defined using WINDOW_SLOT. Callers should also either (a) do nothing
|
|
48 else (which defines WINDOW_SLOT_ARRAY using a for() loop, appropriate
|
|
49 for normal code), define WINDOW_SLOT_DECLARATION (which defines
|
|
50 WINDOW_SLOT_ARRAY using WINDOW_SLOT (slot[size]), appropriate for a
|
|
51 struct definition), or define WINDOW_SLOT_ARRAY themselves. In the
|
|
52 first two cases, WINDOW_SAVED_SLOT_ARRAY will be defined in the same
|
|
53 fashion, using WINDOW_SAVED_SLOT. In the last case, if
|
|
54 WINDOW_SAVED_SLOT is defined, the caller must provide an appropriate
|
|
55 definition of WINDOW_SAVED_SLOT_ARRAY; otherwise, it will be defined
|
|
56 using WINDOW_SLOT_ARRAY.
|
617
|
57
|
|
58 Callers do not need to undefine these definitions; it is done
|
|
59 automatically.
|
|
60 */
|
|
61
|
1204
|
62 #ifdef WINDOW_SLOT_ARRAY
|
|
63 # ifndef WINDOW_SAVED_SLOT_ARRAY
|
|
64 # ifdef WINDOW_SAVED_SLOT
|
|
65 # error must define WINDOW_SAVED_SLOT_ARRAY if WINDOW_SAVED_SLOT and WINDOW_SLOT_ARRAY are defined
|
|
66 # else
|
|
67 # define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) \
|
|
68 WINDOW_SLOT_ARRAY (slot, size)
|
|
69 # endif /* WINDOW_SAVED_SLOT */
|
|
70 # endif /* not WINDOW_SAVED_SLOT_ARRAY */
|
|
71 #elif defined (WINDOW_SLOT_DECLARATION) /* not WINDOW_SLOT_ARRAY */
|
|
72 # define WINDOW_SLOT_ARRAY(slot, size) WINDOW_SLOT (slot[size])
|
|
73 # define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) \
|
617
|
74 WINDOW_SAVED_SLOT (slot[size], compare)
|
1204
|
75 #else /* not WINDOW_SLOT_DECLARATION, not WINDOW_SLOT_ARRAY */
|
|
76 # define WINDOW_SLOT_ARRAY(slot, size) do { \
|
617
|
77 int wsaidx; \
|
|
78 for (wsaidx = 0; wsaidx < size; wsaidx++) \
|
|
79 { \
|
|
80 WINDOW_SLOT (slot[wsaidx]); \
|
|
81 } \
|
|
82 } while (0);
|
1204
|
83 # define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) do { \
|
617
|
84 int wsaidx; \
|
|
85 for (wsaidx = 0; wsaidx < size; wsaidx++) \
|
|
86 { \
|
|
87 WINDOW_SAVED_SLOT (slot[wsaidx], compare); \
|
|
88 } \
|
|
89 } while (0);
|
|
90 #endif /* WINDOW_SLOT_DECLARATION */
|
|
91
|
1204
|
92 #ifndef WINDOW_SAVED_SLOT
|
|
93 #define WINDOW_SAVED_SLOT(slot, compare) WINDOW_SLOT (slot)
|
|
94 #endif
|
|
95
|
428
|
96 #define EQUAL_WRAPPED(x,y) internal_equal ((x), (y), 0)
|
|
97
|
617
|
98
|
|
99 /* The frame this window is on. */
|
|
100 WINDOW_SLOT (frame)
|
|
101 /* t if this window is a minibuffer window. */
|
|
102 WINDOW_SLOT (mini_p)
|
|
103 /* Following child (to right or down) at same level of tree */
|
|
104 WINDOW_SLOT (next)
|
|
105 /* Preceding child (to left or up) at same level of tree */
|
|
106 WINDOW_SLOT (prev)
|
|
107 /* First child of this window. */
|
|
108 /* vchild is used if this is a vertical combination,
|
|
109 hchild if this is a horizontal combination. */
|
|
110 WINDOW_SLOT (hchild)
|
|
111 WINDOW_SLOT (vchild)
|
|
112 /* The window this one is a child of. */
|
|
113 WINDOW_SLOT (parent)
|
|
114
|
|
115 /* The buffer displayed in this window */
|
|
116 /* Of the fields vchild, hchild and buffer, only one is non-nil. */
|
|
117 WINDOW_SLOT (buffer)
|
|
118 /* A marker pointing to where in the text to start displaying */
|
|
119 /* need one for each set of display structures */
|
|
120 WINDOW_SLOT_ARRAY (start, 3)
|
|
121 /* A marker pointing to where in the text point is in this window,
|
|
122 used only when the window is not selected.
|
|
123 This exists so that when multiple windows show one buffer
|
|
124 each one can have its own value of point. */
|
|
125 /* need one for each set of display structures */
|
|
126 WINDOW_SLOT_ARRAY (pointm, 3)
|
|
127 /* A marker pointing to where in the text the scrollbar is pointing;
|
|
128 #### moved to scrollbar.c? */
|
|
129 WINDOW_SLOT (sb_point)
|
844
|
130 /* A table that remembers (in marker form) the value of point in buffers
|
|
131 previously displayed in this window. Switching back to those buffers
|
|
132 causes the remembered point value to become current, rather than the
|
|
133 buffer's point. This is so that you get sensible behavior if you have
|
|
134 a buffer displayed in multiple windows and temporarily switch away and
|
|
135 then back in one window. We don't save or restore this table in a
|
|
136 window configuration, since that would be counterproductive -- we
|
|
137 always want to remember the most recent value of point in buffers we
|
|
138 switched away from. */
|
|
139 WINDOW_SLOT (saved_point_cache)
|
|
140 /* A table that remembers (in marker form) the value of window start in
|
|
141 buffers previously displayed in this window. Save reason as for
|
|
142 the previous table. */
|
|
143 WINDOW_SLOT (saved_last_window_start_cache)
|
617
|
144
|
|
145 /* Number saying how recently window was selected */
|
|
146 WINDOW_SLOT (use_time)
|
|
147 /* text.modified of displayed buffer as of last time display completed */
|
|
148 WINDOW_SLOT_ARRAY (last_modified, 3)
|
|
149 /* Value of point at that time */
|
|
150 WINDOW_SLOT_ARRAY (last_point, 3)
|
|
151 /* Value of start at that time */
|
|
152 WINDOW_SLOT_ARRAY (last_start, 3)
|
|
153 /* buf.face_change as of last time display completed */
|
|
154 WINDOW_SLOT_ARRAY (last_facechange, 3)
|
|
155
|
|
156 /* we cannot have a per-device cache of widgets / subwindows because
|
|
157 each visible instance needs to be a separate instance. The lowest
|
|
158 level of granularity we can get easily is the window that the
|
|
159 subwindow is in. This will fail if we attach the same subwindow
|
|
160 twice to a buffer. However, we are quite unlikely to do this,
|
|
161 especially with buttons which will need individual callbacks. The
|
|
162 proper solution is probably not worth the effort. */
|
|
163 WINDOW_SLOT (subwindow_instance_cache)
|
|
164
|
|
165 WINDOW_SLOT (line_cache_last_updated)
|
|
166
|
428
|
167 /*** Non-specifier vars of window and window config ***/
|
|
168
|
|
169 /* Non-nil means window is marked as dedicated. */
|
617
|
170 WINDOW_SAVED_SLOT (dedicated, EQ)
|
428
|
171
|
|
172 /*** specifier values cached in the struct window ***/
|
|
173
|
|
174 /* Display-table to use for displaying chars in this window. */
|
617
|
175 WINDOW_SAVED_SLOT (display_table, EQUAL_WRAPPED)
|
428
|
176 /* Thickness of modeline shadow, in pixels. If negative, draw
|
|
177 as recessed. */
|
617
|
178 WINDOW_SAVED_SLOT (modeline_shadow_thickness, EQ)
|
428
|
179 /* Non-nil means to display a modeline for the buffer. */
|
617
|
180 WINDOW_SAVED_SLOT (has_modeline_p, EQ)
|
428
|
181 /* Thickness of vertical divider shadow, in pixels. If negative, draw as
|
|
182 recessed. */
|
617
|
183 WINDOW_SAVED_SLOT (vertical_divider_shadow_thickness, EQ)
|
428
|
184 /* Divider surface width (not counting 3-d borders) */
|
617
|
185 WINDOW_SAVED_SLOT (vertical_divider_line_width, EQ)
|
442
|
186 /* Spacing between outer edge of divider border and window edge */
|
617
|
187 WINDOW_SAVED_SLOT (vertical_divider_spacing, EQ)
|
428
|
188 /* Whether vertical dividers are always displayed */
|
617
|
189 WINDOW_SAVED_SLOT (vertical_divider_always_visible_p, EQ)
|
428
|
190
|
|
191 #ifdef HAVE_SCROLLBARS
|
|
192 /* Width of vertical scrollbars. */
|
617
|
193 WINDOW_SAVED_SLOT (scrollbar_width, EQ)
|
428
|
194 /* Height of horizontal scrollbars. */
|
617
|
195 WINDOW_SAVED_SLOT (scrollbar_height, EQ)
|
428
|
196 /* Whether the scrollbars are visible */
|
617
|
197 WINDOW_SAVED_SLOT (horizontal_scrollbar_visible_p, EQ)
|
|
198 WINDOW_SAVED_SLOT (vertical_scrollbar_visible_p, EQ)
|
428
|
199 /* Scrollbar positions */
|
617
|
200 WINDOW_SAVED_SLOT (scrollbar_on_left_p, EQ)
|
|
201 WINDOW_SAVED_SLOT (scrollbar_on_top_p, EQ)
|
428
|
202 /* Pointer to use for vertical and horizontal scrollbars. */
|
617
|
203 WINDOW_SAVED_SLOT (scrollbar_pointer, EQ)
|
428
|
204 #endif /* HAVE_SCROLLBARS */
|
|
205 #ifdef HAVE_TOOLBARS
|
|
206 /* Toolbar specification for each of the four positions.
|
|
207 This is not a size hog because the value here is not copied,
|
|
208 and will be shared with the specs in the specifier. */
|
617
|
209 WINDOW_SAVED_SLOT_ARRAY (toolbar, 4, EQUAL_WRAPPED)
|
428
|
210 /* Toolbar size for each of the four positions. */
|
617
|
211 WINDOW_SAVED_SLOT_ARRAY (toolbar_size, 4, EQUAL_WRAPPED)
|
428
|
212 /* Toolbar border width for each of the four positions. */
|
617
|
213 WINDOW_SAVED_SLOT_ARRAY (toolbar_border_width, 4, EQUAL_WRAPPED)
|
428
|
214 /* Toolbar visibility status for each of the four positions. */
|
617
|
215 WINDOW_SAVED_SLOT_ARRAY (toolbar_visible_p, 4, EQUAL_WRAPPED)
|
428
|
216 /* Caption status of toolbar. */
|
617
|
217 WINDOW_SAVED_SLOT (toolbar_buttons_captioned_p, EQ)
|
428
|
218 /* The following five don't really need to be cached except
|
|
219 that we need to know when they've changed. */
|
617
|
220 WINDOW_SAVED_SLOT (default_toolbar, EQUAL_WRAPPED)
|
|
221 WINDOW_SAVED_SLOT (default_toolbar_width, EQ)
|
|
222 WINDOW_SAVED_SLOT (default_toolbar_height, EQ)
|
|
223 WINDOW_SAVED_SLOT (default_toolbar_visible_p, EQ)
|
|
224 WINDOW_SAVED_SLOT (default_toolbar_border_width, EQ)
|
744
|
225 WINDOW_SAVED_SLOT (toolbar_shadow_thickness, EQ)
|
428
|
226 #endif /* HAVE_TOOLBARS */
|
|
227
|
|
228 /* Gutter specification for each of the four positions.
|
|
229 This is not a size hog because the value here is not copied,
|
|
230 and will be shared with the specs in the specifier. */
|
617
|
231 WINDOW_SAVED_SLOT_ARRAY (gutter, 4, EQUAL_WRAPPED)
|
442
|
232 /* Real (pre-calculated) gutter specification for each of the four positions.
|
|
233 This is not a specifier, it is calculated by the specifier change
|
|
234 functions. */
|
617
|
235 WINDOW_SAVED_SLOT_ARRAY (real_gutter, 4, EQUAL_WRAPPED)
|
428
|
236 /* Gutter size for each of the four positions. */
|
617
|
237 WINDOW_SAVED_SLOT_ARRAY (gutter_size, 4, EQUAL_WRAPPED)
|
428
|
238 /* Real (pre-calculated) gutter size for each of the four positions.
|
|
239 This is not a specifier, it is calculated by the specifier change
|
|
240 functions. */
|
617
|
241 WINDOW_SAVED_SLOT_ARRAY (real_gutter_size, 4, EQUAL_WRAPPED)
|
428
|
242 /* Gutter border width for each of the four positions. */
|
617
|
243 WINDOW_SAVED_SLOT_ARRAY (gutter_border_width, 4, EQUAL_WRAPPED)
|
428
|
244 /* Gutter visibility status for each of the four positions. */
|
617
|
245 WINDOW_SAVED_SLOT_ARRAY (gutter_visible_p, 4, EQUAL_WRAPPED)
|
428
|
246 /* The following five don't really need to be cached except
|
|
247 that we need to know when they've changed. */
|
617
|
248 WINDOW_SAVED_SLOT (default_gutter, EQUAL_WRAPPED)
|
|
249 WINDOW_SAVED_SLOT (default_gutter_width, EQ)
|
|
250 WINDOW_SAVED_SLOT (default_gutter_height, EQ)
|
|
251 WINDOW_SAVED_SLOT (default_gutter_visible_p, EQ)
|
|
252 WINDOW_SAVED_SLOT (default_gutter_border_width, EQ)
|
428
|
253 /* margins */
|
617
|
254 WINDOW_SAVED_SLOT (left_margin_width, EQ)
|
|
255 WINDOW_SAVED_SLOT (right_margin_width, EQ)
|
|
256 WINDOW_SAVED_SLOT (minimum_line_ascent, EQ)
|
|
257 WINDOW_SAVED_SLOT (minimum_line_descent, EQ)
|
|
258 WINDOW_SAVED_SLOT (use_left_overflow, EQ)
|
|
259 WINDOW_SAVED_SLOT (use_right_overflow, EQ)
|
428
|
260 #ifdef HAVE_MENUBARS
|
|
261 /* Visibility of menubar. */
|
617
|
262 WINDOW_SAVED_SLOT (menubar_visible_p, EQ)
|
428
|
263 #endif /* HAVE_MENUBARS */
|
617
|
264 WINDOW_SAVED_SLOT (text_cursor_visible_p, EQ)
|
428
|
265
|
|
266 /* Hara-kiri */
|
|
267 #undef EQUAL_WRAPPED
|
|
268 #undef WINDOW_SLOT_DECLARATION
|
|
269 #undef WINDOW_SLOT
|
|
270 #undef WINDOW_SLOT_ARRAY
|
617
|
271 #undef WINDOW_SAVED_SLOT
|
|
272 #undef WINDOW_SAVED_SLOT_ARRAY
|