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