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
|
|
45 Callers should define WINDOW_SLOT (with a terminating semicolon if
|
|
46 not blank), and WINDOW_SAVED_SLOT if different; otherwise the
|
|
47 latter will be defined using WINDOW_SLOT. Callers do not define
|
|
48 the _ARRAY versions. Instead, they either do or do not define
|
|
49 WINDOW_SLOT_DECLARATION. It should be defined in the definition of
|
|
50 a struct and not elsewhere.
|
|
51
|
|
52 Callers do not need to undefine these definitions; it is done
|
|
53 automatically.
|
|
54 */
|
|
55
|
|
56 #ifndef WINDOW_SAVED_SLOT
|
|
57 #define WINDOW_SAVED_SLOT(slot, compare) WINDOW_SLOT (slot)
|
428
|
58 #endif
|
|
59
|
617
|
60 #ifdef WINDOW_SLOT_DECLARATION
|
|
61 #define WINDOW_SLOT_ARRAY(slot, size) WINDOW_SLOT (slot[size])
|
|
62 #define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) \
|
|
63 WINDOW_SAVED_SLOT (slot[size], compare)
|
|
64 #else
|
|
65 #define WINDOW_SLOT_ARRAY(slot, size) do { \
|
|
66 int wsaidx; \
|
|
67 for (wsaidx = 0; wsaidx < size; wsaidx++) \
|
|
68 { \
|
|
69 WINDOW_SLOT (slot[wsaidx]); \
|
|
70 } \
|
|
71 } while (0);
|
|
72 #define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) do { \
|
|
73 int wsaidx; \
|
|
74 for (wsaidx = 0; wsaidx < size; wsaidx++) \
|
|
75 { \
|
|
76 WINDOW_SAVED_SLOT (slot[wsaidx], compare); \
|
|
77 } \
|
|
78 } while (0);
|
|
79 #endif /* WINDOW_SLOT_DECLARATION */
|
|
80
|
428
|
81 #define EQUAL_WRAPPED(x,y) internal_equal ((x), (y), 0)
|
|
82
|
617
|
83
|
|
84 /* The frame this window is on. */
|
|
85 WINDOW_SLOT (frame)
|
|
86 /* t if this window is a minibuffer window. */
|
|
87 WINDOW_SLOT (mini_p)
|
|
88 /* Following child (to right or down) at same level of tree */
|
|
89 WINDOW_SLOT (next)
|
|
90 /* Preceding child (to left or up) at same level of tree */
|
|
91 WINDOW_SLOT (prev)
|
|
92 /* First child of this window. */
|
|
93 /* vchild is used if this is a vertical combination,
|
|
94 hchild if this is a horizontal combination. */
|
|
95 WINDOW_SLOT (hchild)
|
|
96 WINDOW_SLOT (vchild)
|
|
97 /* The window this one is a child of. */
|
|
98 WINDOW_SLOT (parent)
|
|
99
|
|
100 /* The buffer displayed in this window */
|
|
101 /* Of the fields vchild, hchild and buffer, only one is non-nil. */
|
|
102 WINDOW_SLOT (buffer)
|
|
103 /* A marker pointing to where in the text to start displaying */
|
|
104 /* need one for each set of display structures */
|
|
105 WINDOW_SLOT_ARRAY (start, 3)
|
|
106 /* A marker pointing to where in the text point is in this window,
|
|
107 used only when the window is not selected.
|
|
108 This exists so that when multiple windows show one buffer
|
|
109 each one can have its own value of point. */
|
|
110 /* need one for each set of display structures */
|
|
111 WINDOW_SLOT_ARRAY (pointm, 3)
|
|
112 /* A marker pointing to where in the text the scrollbar is pointing;
|
|
113 #### moved to scrollbar.c? */
|
|
114 WINDOW_SLOT (sb_point)
|
844
|
115 /* A table that remembers (in marker form) the value of point in buffers
|
|
116 previously displayed in this window. Switching back to those buffers
|
|
117 causes the remembered point value to become current, rather than the
|
|
118 buffer's point. This is so that you get sensible behavior if you have
|
|
119 a buffer displayed in multiple windows and temporarily switch away and
|
|
120 then back in one window. We don't save or restore this table in a
|
|
121 window configuration, since that would be counterproductive -- we
|
|
122 always want to remember the most recent value of point in buffers we
|
|
123 switched away from. */
|
|
124 WINDOW_SLOT (saved_point_cache)
|
|
125 /* A table that remembers (in marker form) the value of window start in
|
|
126 buffers previously displayed in this window. Save reason as for
|
|
127 the previous table. */
|
|
128 WINDOW_SLOT (saved_last_window_start_cache)
|
617
|
129
|
|
130 /* Number saying how recently window was selected */
|
|
131 WINDOW_SLOT (use_time)
|
|
132 /* text.modified of displayed buffer as of last time display completed */
|
|
133 WINDOW_SLOT_ARRAY (last_modified, 3)
|
|
134 /* Value of point at that time */
|
|
135 WINDOW_SLOT_ARRAY (last_point, 3)
|
|
136 /* Value of start at that time */
|
|
137 WINDOW_SLOT_ARRAY (last_start, 3)
|
|
138 /* buf.face_change as of last time display completed */
|
|
139 WINDOW_SLOT_ARRAY (last_facechange, 3)
|
|
140
|
|
141 /* we cannot have a per-device cache of widgets / subwindows because
|
|
142 each visible instance needs to be a separate instance. The lowest
|
|
143 level of granularity we can get easily is the window that the
|
|
144 subwindow is in. This will fail if we attach the same subwindow
|
|
145 twice to a buffer. However, we are quite unlikely to do this,
|
|
146 especially with buttons which will need individual callbacks. The
|
|
147 proper solution is probably not worth the effort. */
|
|
148 WINDOW_SLOT (subwindow_instance_cache)
|
|
149
|
|
150 WINDOW_SLOT (line_cache_last_updated)
|
|
151
|
|
152 /* If redisplay in this window goes beyond this buffer position,
|
|
153 must run the redisplay-end-trigger-functions. */
|
|
154 WINDOW_SLOT (redisplay_end_trigger)
|
|
155
|
428
|
156 /*** Non-specifier vars of window and window config ***/
|
|
157
|
|
158 /* Non-nil means window is marked as dedicated. */
|
617
|
159 WINDOW_SAVED_SLOT (dedicated, EQ)
|
428
|
160
|
|
161 /*** specifier values cached in the struct window ***/
|
|
162
|
|
163 /* Display-table to use for displaying chars in this window. */
|
617
|
164 WINDOW_SAVED_SLOT (display_table, EQUAL_WRAPPED)
|
428
|
165 /* Thickness of modeline shadow, in pixels. If negative, draw
|
|
166 as recessed. */
|
617
|
167 WINDOW_SAVED_SLOT (modeline_shadow_thickness, EQ)
|
428
|
168 /* Non-nil means to display a modeline for the buffer. */
|
617
|
169 WINDOW_SAVED_SLOT (has_modeline_p, EQ)
|
428
|
170 /* Thickness of vertical divider shadow, in pixels. If negative, draw as
|
|
171 recessed. */
|
617
|
172 WINDOW_SAVED_SLOT (vertical_divider_shadow_thickness, EQ)
|
428
|
173 /* Divider surface width (not counting 3-d borders) */
|
617
|
174 WINDOW_SAVED_SLOT (vertical_divider_line_width, EQ)
|
442
|
175 /* Spacing between outer edge of divider border and window edge */
|
617
|
176 WINDOW_SAVED_SLOT (vertical_divider_spacing, EQ)
|
428
|
177 /* Whether vertical dividers are always displayed */
|
617
|
178 WINDOW_SAVED_SLOT (vertical_divider_always_visible_p, EQ)
|
428
|
179
|
|
180 #ifdef HAVE_SCROLLBARS
|
|
181 /* Width of vertical scrollbars. */
|
617
|
182 WINDOW_SAVED_SLOT (scrollbar_width, EQ)
|
428
|
183 /* Height of horizontal scrollbars. */
|
617
|
184 WINDOW_SAVED_SLOT (scrollbar_height, EQ)
|
428
|
185 /* Whether the scrollbars are visible */
|
617
|
186 WINDOW_SAVED_SLOT (horizontal_scrollbar_visible_p, EQ)
|
|
187 WINDOW_SAVED_SLOT (vertical_scrollbar_visible_p, EQ)
|
428
|
188 /* Scrollbar positions */
|
617
|
189 WINDOW_SAVED_SLOT (scrollbar_on_left_p, EQ)
|
|
190 WINDOW_SAVED_SLOT (scrollbar_on_top_p, EQ)
|
428
|
191 /* Pointer to use for vertical and horizontal scrollbars. */
|
617
|
192 WINDOW_SAVED_SLOT (scrollbar_pointer, EQ)
|
428
|
193 #endif /* HAVE_SCROLLBARS */
|
|
194 #ifdef HAVE_TOOLBARS
|
|
195 /* Toolbar specification for each of the four positions.
|
|
196 This is not a size hog because the value here is not copied,
|
|
197 and will be shared with the specs in the specifier. */
|
617
|
198 WINDOW_SAVED_SLOT_ARRAY (toolbar, 4, EQUAL_WRAPPED)
|
428
|
199 /* Toolbar size for each of the four positions. */
|
617
|
200 WINDOW_SAVED_SLOT_ARRAY (toolbar_size, 4, EQUAL_WRAPPED)
|
428
|
201 /* Toolbar border width for each of the four positions. */
|
617
|
202 WINDOW_SAVED_SLOT_ARRAY (toolbar_border_width, 4, EQUAL_WRAPPED)
|
428
|
203 /* Toolbar visibility status for each of the four positions. */
|
617
|
204 WINDOW_SAVED_SLOT_ARRAY (toolbar_visible_p, 4, EQUAL_WRAPPED)
|
428
|
205 /* Caption status of toolbar. */
|
617
|
206 WINDOW_SAVED_SLOT (toolbar_buttons_captioned_p, EQ)
|
428
|
207 /* The following five don't really need to be cached except
|
|
208 that we need to know when they've changed. */
|
617
|
209 WINDOW_SAVED_SLOT (default_toolbar, EQUAL_WRAPPED)
|
|
210 WINDOW_SAVED_SLOT (default_toolbar_width, EQ)
|
|
211 WINDOW_SAVED_SLOT (default_toolbar_height, EQ)
|
|
212 WINDOW_SAVED_SLOT (default_toolbar_visible_p, EQ)
|
|
213 WINDOW_SAVED_SLOT (default_toolbar_border_width, EQ)
|
744
|
214 WINDOW_SAVED_SLOT (toolbar_shadow_thickness, EQ)
|
428
|
215 #endif /* HAVE_TOOLBARS */
|
|
216
|
|
217 /* Gutter specification for each of the four positions.
|
|
218 This is not a size hog because the value here is not copied,
|
|
219 and will be shared with the specs in the specifier. */
|
617
|
220 WINDOW_SAVED_SLOT_ARRAY (gutter, 4, EQUAL_WRAPPED)
|
442
|
221 /* Real (pre-calculated) gutter specification for each of the four positions.
|
|
222 This is not a specifier, it is calculated by the specifier change
|
|
223 functions. */
|
617
|
224 WINDOW_SAVED_SLOT_ARRAY (real_gutter, 4, EQUAL_WRAPPED)
|
428
|
225 /* Gutter size for each of the four positions. */
|
617
|
226 WINDOW_SAVED_SLOT_ARRAY (gutter_size, 4, EQUAL_WRAPPED)
|
428
|
227 /* Real (pre-calculated) gutter size for each of the four positions.
|
|
228 This is not a specifier, it is calculated by the specifier change
|
|
229 functions. */
|
617
|
230 WINDOW_SAVED_SLOT_ARRAY (real_gutter_size, 4, EQUAL_WRAPPED)
|
428
|
231 /* Gutter border width for each of the four positions. */
|
617
|
232 WINDOW_SAVED_SLOT_ARRAY (gutter_border_width, 4, EQUAL_WRAPPED)
|
428
|
233 /* Gutter visibility status for each of the four positions. */
|
617
|
234 WINDOW_SAVED_SLOT_ARRAY (gutter_visible_p, 4, EQUAL_WRAPPED)
|
428
|
235 /* The following five don't really need to be cached except
|
|
236 that we need to know when they've changed. */
|
617
|
237 WINDOW_SAVED_SLOT (default_gutter, EQUAL_WRAPPED)
|
|
238 WINDOW_SAVED_SLOT (default_gutter_width, EQ)
|
|
239 WINDOW_SAVED_SLOT (default_gutter_height, EQ)
|
|
240 WINDOW_SAVED_SLOT (default_gutter_visible_p, EQ)
|
|
241 WINDOW_SAVED_SLOT (default_gutter_border_width, EQ)
|
428
|
242 /* margins */
|
617
|
243 WINDOW_SAVED_SLOT (left_margin_width, EQ)
|
|
244 WINDOW_SAVED_SLOT (right_margin_width, EQ)
|
|
245 WINDOW_SAVED_SLOT (minimum_line_ascent, EQ)
|
|
246 WINDOW_SAVED_SLOT (minimum_line_descent, EQ)
|
|
247 WINDOW_SAVED_SLOT (use_left_overflow, EQ)
|
|
248 WINDOW_SAVED_SLOT (use_right_overflow, EQ)
|
428
|
249 #ifdef HAVE_MENUBARS
|
|
250 /* Visibility of menubar. */
|
617
|
251 WINDOW_SAVED_SLOT (menubar_visible_p, EQ)
|
428
|
252 #endif /* HAVE_MENUBARS */
|
617
|
253 WINDOW_SAVED_SLOT (text_cursor_visible_p, EQ)
|
428
|
254
|
|
255 /* Hara-kiri */
|
|
256 #undef EQUAL_WRAPPED
|
|
257 #undef WINDOW_SLOT_DECLARATION
|
|
258 #undef WINDOW_SLOT
|
|
259 #undef WINDOW_SLOT_ARRAY
|
617
|
260 #undef WINDOW_SAVED_SLOT
|
|
261 #undef WINDOW_SAVED_SLOT_ARRAY
|