Mercurial > hg > xemacs-beta
annotate src/gutter.c @ 5587:3fde0e346ad7
Prevent assert at frame.c, l. 6311 by initializing glyph cachels.
* frame.c (Fmake_frame): Ensure that reset_glyph_cachels gets called.
(setup_minibuffer_frame): Improve header comment.
* redisplay.c (redisplay_window): Update comment.
Remove code checking for uninitialized face_cachels and glyph_cachels.
Can't happen in theory, and guarded by asserts in practice.
* window.c (allocate_window): Update comment on reset_*_cachels.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Sat, 29 Oct 2011 00:35:33 +0900 |
parents | 56144c8593a8 |
children | 77d7b77909c2 |
rev | line source |
---|---|
428 | 1 /* Gutter implementation. |
442 | 2 Copyright (C) 1999, 2000 Andy Piper. |
5043 | 3 Copyright (C) 2010 Ben Wing. |
428 | 4 |
5 This file is part of XEmacs. | |
6 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5090
diff
changeset
|
7 XEmacs is free software: you can redistribute it and/or modify it |
428 | 8 under the terms of the GNU General Public License as published by the |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5090
diff
changeset
|
9 Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5090
diff
changeset
|
10 option) any later version. |
428 | 11 |
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5090
diff
changeset
|
18 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
428 | 19 |
20 /* Synched up with: Not in FSF. */ | |
21 | |
22 /* written by Andy Piper <andy@xemacs.org> with specifiers partially | |
23 ripped-off from toolbar.c */ | |
24 | |
25 #include <config.h> | |
26 #include "lisp.h" | |
27 | |
28 #include "buffer.h" | |
872 | 29 #include "frame-impl.h" |
30 #include "device-impl.h" | |
428 | 31 #include "faces.h" |
32 #include "glyphs.h" | |
33 #include "redisplay.h" | |
34 #include "window.h" | |
35 #include "gutter.h" | |
36 | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
37 Lisp_Object Vgutter[NUM_EDGES]; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
38 Lisp_Object Vgutter_size[NUM_EDGES]; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
39 Lisp_Object Vgutter_visible_p[NUM_EDGES]; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
40 Lisp_Object Vgutter_border_width[NUM_EDGES]; |
428 | 41 |
42 Lisp_Object Vdefault_gutter, Vdefault_gutter_visible_p; | |
43 Lisp_Object Vdefault_gutter_width, Vdefault_gutter_height; | |
44 Lisp_Object Vdefault_gutter_border_width; | |
45 | |
46 Lisp_Object Vdefault_gutter_position; | |
47 | |
48 Lisp_Object Qgutter_size; | |
442 | 49 Lisp_Object Qgutter_visible; |
50 Lisp_Object Qdefault_gutter_position_changed_hook; | |
51 | |
52 static void | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
53 update_gutter_geometry (struct frame *f, enum edge_pos pos); |
428 | 54 |
442 | 55 #if 0 |
428 | 56 static Lisp_Object |
57 frame_topmost_window (struct frame *f) | |
58 { | |
59 Lisp_Object w = FRAME_ROOT_WINDOW (f); | |
60 | |
61 do { | |
62 while (!NILP (XWINDOW (w)->vchild)) | |
63 { | |
64 w = XWINDOW (w)->vchild; | |
65 } | |
66 } while (!NILP (XWINDOW (w)->hchild) && !NILP (w = XWINDOW (w)->hchild)); | |
67 | |
68 return w; | |
69 } | |
442 | 70 #endif |
428 | 71 |
72 static Lisp_Object | |
73 frame_bottommost_window (struct frame *f) | |
74 { | |
75 Lisp_Object w = FRAME_ROOT_WINDOW (f); | |
76 | |
77 do { | |
78 while (!NILP (XWINDOW (w)->vchild)) | |
79 { | |
80 w = XWINDOW (w)->vchild; | |
81 while (!NILP (XWINDOW (w)->next)) | |
82 { | |
83 w = XWINDOW (w)->next; | |
84 } | |
85 } | |
86 } while (!NILP (XWINDOW (w)->hchild) && !NILP (w = XWINDOW (w)->hchild)); | |
87 | |
88 return w; | |
89 } | |
90 | |
91 #if 0 | |
92 static Lisp_Object | |
93 frame_leftmost_window (struct frame *f) | |
94 { | |
95 Lisp_Object w = FRAME_ROOT_WINDOW (f); | |
96 | |
97 do { | |
98 while (!NILP (XWINDOW (w)->hchild)) | |
99 { | |
100 w = XWINDOW (w)->hchild; | |
101 } | |
102 } while (!NILP (XWINDOW (w)->vchild) && !NILP (w = XWINDOW (w)->vchild)); | |
103 | |
104 return w; | |
105 } | |
106 | |
107 static Lisp_Object | |
108 frame_rightmost_window (struct frame *f) | |
109 { | |
110 Lisp_Object w = FRAME_ROOT_WINDOW (f); | |
111 | |
112 do { | |
113 while (!NILP (XWINDOW (w)->hchild)) | |
114 { | |
115 w = XWINDOW (w)->hchild; | |
116 while (!NILP (XWINDOW (w)->next)) | |
117 { | |
118 w = XWINDOW (w)->next; | |
119 } | |
120 } | |
121 } while (!NILP (XWINDOW (w)->vchild) && !NILP (w = XWINDOW (w)->vchild)); | |
122 return w; | |
123 } | |
124 #endif | |
125 | |
126 /* calculate the coordinates of a gutter for the current frame and | |
127 selected window. we have to be careful in calculating this as we | |
128 need to use *two* windows, the currently selected window will give | |
129 us the actual height, width and contents of the gutter, but if we | |
130 use this for calculating the gutter positions we run into trouble | |
131 if it is not the window nearest the gutter. Instead we predetermine | |
132 the nearest window and then use that.*/ | |
133 static void | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
134 get_gutter_coords (struct frame *f, enum edge_pos pos, int *x, int *y, |
428 | 135 int *width, int *height) |
136 { | |
5090 | 137 /* We use the bottommost window (not the minibuffer, but the bottommost |
138 non-minibuffer window) rather than any FRAME_BOTTOM_GUTTER_START | |
139 because the gutter goes *above* the minibuffer -- for this same reason, | |
140 FRAME_BOTTOM_GUTTER_START isn't currently defined. */ | |
141 struct window *bot = XWINDOW (frame_bottommost_window (f)); | |
428 | 142 /* The top and bottom gutters take precedence over the left and |
143 right. */ | |
144 switch (pos) | |
145 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
146 case TOP_EDGE: |
5090 | 147 *x = FRAME_LEFT_GUTTER_START (f); |
148 *y = FRAME_TOP_GUTTER_START (f); | |
149 *width = FRAME_RIGHT_GUTTER_END (f) - *x; | |
428 | 150 *height = FRAME_TOP_GUTTER_BOUNDS (f); |
151 break; | |
152 | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
153 case BOTTOM_EDGE: |
5090 | 154 *x = FRAME_LEFT_GUTTER_START (f); |
155 #ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER | |
156 *y = FRAME_BOTTOM_GUTTER_START (f); | |
157 #else | |
442 | 158 *y = WINDOW_BOTTOM (bot); |
5090 | 159 #endif |
160 *width = FRAME_RIGHT_GUTTER_END (f) - *x; | |
428 | 161 *height = FRAME_BOTTOM_GUTTER_BOUNDS (f); |
162 break; | |
163 | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
164 case LEFT_EDGE: |
5090 | 165 *x = FRAME_LEFT_GUTTER_START (f); |
166 *y = FRAME_TOP_GUTTER_END (f); | |
428 | 167 *width = FRAME_LEFT_GUTTER_BOUNDS (f); |
5090 | 168 *height = WINDOW_BOTTOM (bot) - *y; |
428 | 169 break; |
442 | 170 |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
171 case RIGHT_EDGE: |
5090 | 172 *x = FRAME_RIGHT_GUTTER_START (f); |
173 *y = FRAME_TOP_GUTTER_END (f); | |
428 | 174 *width = FRAME_RIGHT_GUTTER_BOUNDS (f); |
5090 | 175 *height = WINDOW_BOTTOM (bot) - *y; |
428 | 176 break; |
177 | |
178 default: | |
2500 | 179 ABORT (); |
428 | 180 } |
181 } | |
182 | |
446 | 183 /* |
184 display_boxes_in_gutter_p | |
185 | |
186 Determine whether the required display_glyph_area is completely | |
187 inside the gutter. -1 means the display_box is not in the gutter. 1 | |
188 means the display_box and the display_glyph_area are in the | |
189 window. 0 means the display_box is in the gutter but the | |
190 display_glyph_area is not. */ | |
191 int display_boxes_in_gutter_p (struct frame *f, struct display_box* db, | |
192 struct display_glyph_area* dga) | |
193 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
194 enum edge_pos pos; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
195 EDGE_POS_LOOP (pos) |
446 | 196 { |
197 if (FRAME_GUTTER_VISIBLE (f, pos)) | |
198 { | |
199 int x, y, width, height; | |
200 get_gutter_coords (f, pos, &x, &y, &width, &height); | |
201 if (db->xpos + dga->xoffset >= x | |
202 && | |
203 db->ypos + dga->yoffset >= y | |
204 && | |
205 db->xpos + dga->xoffset + dga->width <= x + width | |
206 && | |
207 db->ypos + dga->yoffset + dga->height <= y + height) | |
208 return 1; | |
209 else if (db->xpos >= x && db->ypos >= y | |
210 && db->xpos + db->width <= x + width | |
211 && db->ypos + db->height <= y + height) | |
212 return 0; | |
213 } | |
214 } | |
215 return -1; | |
216 } | |
217 | |
442 | 218 /* Convert the gutter specifier into something we can actually |
219 display. */ | |
220 static Lisp_Object construct_window_gutter_spec (struct window* w, | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
221 enum edge_pos pos) |
442 | 222 { |
223 Lisp_Object rest, *args; | |
224 int nargs = 0; | |
225 Lisp_Object gutter = RAW_WINDOW_GUTTER (w, pos); | |
226 | |
227 if (STRINGP (gutter) || NILP (gutter)) | |
228 return gutter; | |
229 | |
230 GET_LIST_LENGTH (gutter, nargs); | |
231 args = alloca_array (Lisp_Object, nargs >> 1); | |
232 nargs = 0; | |
233 | |
234 for (rest = gutter; !NILP (rest); rest = XCDR (XCDR (rest))) | |
235 { | |
236 /* We only put things in the real gutter that are declared to be | |
4186 | 237 visible. */ |
442 | 238 if (!CONSP (WINDOW_GUTTER_VISIBLE (w, pos)) |
239 || | |
240 !NILP (Fmemq (XCAR (rest), WINDOW_GUTTER_VISIBLE (w, pos)))) | |
241 { | |
242 args [nargs++] = XCAR (XCDR (rest)); | |
243 } | |
244 } | |
245 | |
246 return Fconcat (nargs, args); | |
247 } | |
248 | |
444 | 249 /* Sizing gutters is a pain so we try and help the user by determining |
250 what height will accommodate all lines. This is useless on left and | |
251 right gutters as we always have a maximal number of lines. */ | |
252 static int | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
253 calculate_gutter_size_from_display_lines (enum edge_pos pos, |
444 | 254 display_line_dynarr* ddla) |
255 { | |
256 int size = 0; | |
257 struct display_line *dl; | |
258 | |
259 /* For top and bottom the calculation is easy. */ | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
260 if (pos == TOP_EDGE || pos == BOTTOM_EDGE) |
444 | 261 { |
262 /* grab coordinates of last line */ | |
263 if (Dynarr_length (ddla)) | |
264 { | |
265 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); | |
4186 | 266 size = (dl->ypos + dl->descent - dl->clip) |
4967 | 267 - (Dynarr_begin (ddla)->ypos - Dynarr_begin (ddla)->ascent); |
444 | 268 } |
269 } | |
270 /* For left and right we have to do some maths. */ | |
271 else | |
272 { | |
273 int start_pos = 0, end_pos = 0, line; | |
274 for (line = 0; line < Dynarr_length (ddla); line++) | |
275 { | |
276 int block; | |
277 dl = Dynarr_atp (ddla, line); | |
278 | |
279 for (block = 0; block < Dynarr_largest (dl->display_blocks); block++) | |
280 { | |
281 struct display_block *db = Dynarr_atp (dl->display_blocks, block); | |
282 | |
283 if (db->type == TEXT) | |
284 { | |
285 start_pos = min (db->start_pos, start_pos); | |
286 end_pos = max (db->end_pos, end_pos); | |
287 } | |
288 } | |
289 } | |
290 size = end_pos - start_pos; | |
291 } | |
292 | |
293 return size; | |
294 } | |
295 | |
296 static Lisp_Object | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
297 calculate_gutter_size (struct window *w, enum edge_pos pos) |
444 | 298 { |
299 struct frame* f = XFRAME (WINDOW_FRAME (w)); | |
1318 | 300 display_line_dynarr *ddla; |
444 | 301 Lisp_Object ret = Qnil; |
302 | |
1318 | 303 /* Callers need to handle this. */ |
304 assert (!in_display); | |
444 | 305 /* degenerate case */ |
306 if (NILP (RAW_WINDOW_GUTTER (w, pos)) | |
307 || | |
308 !FRAME_VISIBLE_P (f) | |
309 || | |
310 NILP (w->buffer)) | |
311 return Qnil; | |
312 | |
1318 | 313 if (!in_display) |
314 { | |
315 int count; | |
316 | |
317 /* We are calling directly into redisplay from the outside, so turn on | |
318 critical section protection. */ | |
319 count = enter_redisplay_critical_section (); | |
444 | 320 |
1318 | 321 ddla = Dynarr_new (display_line); |
322 /* generate some display lines */ | |
323 generate_displayable_area (w, WINDOW_GUTTER (w, pos), | |
5090 | 324 FRAME_LEFT_GUTTER_START (f), |
325 FRAME_TOP_GUTTER_START (f), | |
326 FRAME_RIGHT_GUTTER_END (f) | |
327 - FRAME_LEFT_GUTTER_START (f), | |
328 #ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER | |
329 FRAME_BOTTOM_GUTTER_END (f) | |
330 #else | |
331 /* #### GEOM! This is how it used to read, | |
332 and this includes both gutter and | |
333 minibuffer below it. Not clear whether | |
334 it was intended that way. --ben */ | |
335 FRAME_BOTTOM_INTERNAL_BORDER_START (f) | |
336 #endif | |
337 - FRAME_TOP_GUTTER_START (f), | |
4186 | 338 ddla, 0, DEFAULT_INDEX); |
444 | 339 |
1318 | 340 /* Let GC happen again. */ |
341 exit_redisplay_critical_section (count); | |
444 | 342 |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
343 ret = make_fixnum (calculate_gutter_size_from_display_lines (pos, ddla)); |
1318 | 344 free_display_lines (ddla); |
345 } | |
444 | 346 |
347 return ret; | |
348 } | |
349 | |
428 | 350 static void |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
351 output_gutter (struct frame *f, enum edge_pos pos, int force) |
428 | 352 { |
353 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); | |
354 struct device *d = XDEVICE (f->device); | |
355 struct window* w = XWINDOW (window); | |
356 int x, y, width, height, ypos; | |
440 | 357 int line, border_width; |
358 face_index findex; | |
428 | 359 display_line_dynarr* ddla, *cdla; |
442 | 360 struct display_line *dl = 0; |
428 | 361 int cdla_len; |
362 | |
440 | 363 if (!WINDOW_LIVE_P (w)) |
364 return; | |
365 | |
366 border_width = FRAME_GUTTER_BORDER_WIDTH (f, pos); | |
442 | 367 findex = get_builtin_face_cache_index (w, Vwidget_face); |
440 | 368 |
442 | 369 if (!f->current_display_lines[pos]) |
370 f->current_display_lines[pos] = Dynarr_new (display_line); | |
371 if (!f->desired_display_lines[pos]) | |
372 f->desired_display_lines[pos] = Dynarr_new (display_line); | |
428 | 373 |
442 | 374 ddla = f->desired_display_lines[pos]; |
375 cdla = f->current_display_lines[pos]; | |
428 | 376 cdla_len = Dynarr_length (cdla); |
377 | |
378 get_gutter_coords (f, pos, &x, &y, &width, &height); | |
379 /* generate some display lines */ | |
380 generate_displayable_area (w, WINDOW_GUTTER (w, pos), | |
381 x + border_width, y + border_width, | |
442 | 382 width - 2 * border_width, |
428 | 383 height - 2 * border_width, ddla, 0, findex); |
442 | 384 |
385 /* We only output the gutter if we think something of significance | |
386 has changed. This is, for example, because redisplay can cause | |
387 new face cache elements to get added causing compare_runes to | |
388 fail because the findex for a particular face has changed. */ | |
389 if (force || f->faces_changed || f->frame_changed || | |
390 f->gutter_changed || f->glyphs_changed || | |
391 f->size_changed || f->subwindows_changed || | |
392 w->windows_changed || f->windows_structure_changed || | |
393 cdla_len != Dynarr_length (ddla) || | |
394 (f->extents_changed && w->gutter_extent_modiff[pos])) | |
428 | 395 { |
442 | 396 #ifdef DEBUG_GUTTERS |
4186 | 397 stderr_out ("gutter redisplay [%s %dx%d@%d+%d] triggered by %s,\n", |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
398 pos == TOP_EDGE ? "TOP" : |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
399 pos == BOTTOM_EDGE ? "BOTTOM" : |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
400 pos == LEFT_EDGE ? "LEFT" : "RIGHT", |
446 | 401 width, height, x, y, force ? "force" : |
442 | 402 f->faces_changed ? "f->faces_changed" : |
403 f->frame_changed ? "f->frame_changed" : | |
404 f->gutter_changed ? "f->gutter_changed" : | |
405 f->glyphs_changed ? "f->glyphs_changed" : | |
406 f->size_changed ? "f->size_changed" : | |
407 f->subwindows_changed ? "f->subwindows_changed" : | |
408 w->windows_changed ? "w->windows_changed" : | |
409 f->windows_structure_changed ? "f->windows_structure_changed" : | |
410 cdla_len != Dynarr_length (ddla) ? "different display structures" : | |
411 f->extents_changed && w->gutter_extent_modiff[pos] ? | |
412 "f->extents_changed && w->gutter_extent_modiff[pos]" : "<null>"); | |
413 #endif | |
414 /* Output each line. */ | |
415 for (line = 0; line < Dynarr_length (ddla); line++) | |
416 { | |
417 output_display_line (w, cdla, ddla, line, -1, -1); | |
418 } | |
419 | |
420 /* If the number of display lines has shrunk, adjust. */ | |
421 if (cdla_len > Dynarr_length (ddla)) | |
422 { | |
5038 | 423 Dynarr_set_lengthr (cdla, Dynarr_length (ddla)); |
442 | 424 } |
425 | |
426 /* grab coordinates of last line and blank after it. */ | |
427 if (Dynarr_length (ddla) > 0) | |
428 { | |
4844
91b3d00e717f
Various cleanups for Dynarr code, from Unicode-internal ws
Ben Wing <ben@xemacs.org>
parents:
4186
diff
changeset
|
429 dl = Dynarr_lastp (ddla); |
442 | 430 ypos = dl->ypos + dl->descent - dl->clip; |
431 } | |
432 else | |
433 ypos = y; | |
428 | 434 |
442 | 435 redisplay_clear_region (window, findex, x + border_width , ypos, |
436 width - 2 * border_width, height - (ypos - y) - border_width); | |
437 /* If, for some reason, we have more to display than we have | |
4186 | 438 room for, and we are allowed to resize the gutter, then make |
439 sure this happens before the next time we try and | |
440 output. This can happen when face font sizes change. */ | |
441 if (dl && EQ (w->gutter_size[pos], Qautodetect) | |
444 | 442 && (dl->clip > 0 || |
4186 | 443 calculate_gutter_size_from_display_lines (pos, ddla) > |
444 | 444 WINDOW_GUTTER_SIZE_INTERNAL (w, pos))) |
442 | 445 { |
446 /* #### Ideally we would just mark the specifier as dirty | |
447 and everything else would "just work". Unfortunately we have | |
448 two problems with this. One is that the specifier cache | |
449 won't be recalculated unless the specifier code thinks the | |
450 cached value has actually changed, even though we have | |
451 marked the specifier as dirty. Additionally, although doing | |
452 this results in a gutter size change, we never seem to get | |
453 back into redisplay so that the frame size can be updated. I | |
454 think this is because we are already in redisplay and later | |
455 on the frame will be marked as clean. Thus we also have to | |
456 force a pending recalculation of the frame size. */ | |
457 w->gutter_size[pos] = Qnil; | |
458 Fset_specifier_dirty_flag (Vgutter_size[pos]); | |
459 update_gutter_geometry (f, pos); | |
460 } | |
461 | |
462 /* bevel the gutter area if so desired */ | |
463 if (border_width != 0) | |
464 { | |
465 MAYBE_DEVMETH (d, bevel_area, | |
466 (w, findex, x, y, width, height, border_width, | |
467 EDGE_ALL, EDGE_BEVEL_OUT)); | |
468 } | |
469 } | |
470 else | |
428 | 471 { |
442 | 472 /* Nothing of significance happened so sync the display line |
4186 | 473 structs. */ |
442 | 474 for (line = 0; line < Dynarr_length (ddla); line++) |
475 { | |
476 sync_display_line_structs (w, line, 1, cdla, ddla); | |
477 } | |
428 | 478 } |
479 | |
442 | 480 w->gutter_extent_modiff [pos] = 0; |
428 | 481 } |
482 | |
483 static void | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
484 clear_gutter (struct frame *f, enum edge_pos pos) |
428 | 485 { |
486 int x, y, width, height; | |
487 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); | |
488 face_index findex = get_builtin_face_cache_index (XWINDOW (window), | |
442 | 489 Vwidget_face); |
428 | 490 get_gutter_coords (f, pos, &x, &y, &width, &height); |
491 | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
492 f->gutter_was_visible[pos] = 0; |
428 | 493 |
494 redisplay_clear_region (window, findex, x, y, width, height); | |
495 } | |
496 | |
617 | 497 /* [[#### I don't currently believe that redisplay needs to mark the |
442 | 498 glyphs in its structures since these will always be referenced from |
499 somewhere else. However, I'm not sure enough to stake my life on it | |
617 | 500 at this point, so we do the safe thing.]] |
501 | |
502 ALWAYS mark everything. --ben */ | |
442 | 503 |
504 /* See the comment in image_instantiate_cache_result as to why marking | |
505 the glyph will also mark the image_instance. */ | |
506 void | |
617 | 507 mark_gutters (struct frame *f) |
442 | 508 { |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
509 enum edge_pos pos; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
510 EDGE_POS_LOOP (pos) |
442 | 511 { |
512 if (f->current_display_lines[pos]) | |
513 mark_redisplay_structs (f->current_display_lines[pos]); | |
617 | 514 /* [[#### Do we really need to mark the desired lines?]] |
4186 | 515 ALWAYS mark everything. --ben */ |
442 | 516 if (f->desired_display_lines[pos]) |
517 mark_redisplay_structs (f->desired_display_lines[pos]); | |
518 } | |
519 } | |
520 | |
521 /* This is called by extent_changed_for_redisplay, so that redisplay | |
522 knows exactly what extents have changed. */ | |
523 void | |
524 gutter_extent_signal_changed_region_maybe (Lisp_Object obj, | |
2286 | 525 Charbpos UNUSED (start), |
526 Charbpos UNUSED (end)) | |
442 | 527 { |
528 /* #### Start and end are currently ignored but could be used by a | |
529 more optimal gutter redisplay. We currently loop over all frames | |
530 here, this could be optimized. */ | |
531 Lisp_Object frmcons, devcons, concons; | |
532 | |
533 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) | |
534 { | |
535 struct frame *f = XFRAME (XCAR (frmcons)); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
536 enum edge_pos pos; |
442 | 537 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); |
538 struct window* w = XWINDOW (window); | |
539 | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
540 EDGE_POS_LOOP (pos) |
442 | 541 { |
542 if (EQ (WINDOW_GUTTER (w, pos), obj)) | |
543 { | |
544 w->gutter_extent_modiff[pos]++; | |
545 } | |
546 } | |
547 } | |
548 } | |
549 | |
550 /* We have to change the gutter geometry separately to the gutter | |
551 update since it needs to occur outside of redisplay proper. */ | |
552 static void | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
553 update_gutter_geometry (struct frame *f, enum edge_pos pos) |
442 | 554 { |
555 /* If the gutter geometry has changed then re-layout the | |
556 frame. If we are in display there is almost no point in doing | |
557 anything else since the frame size changes will be delayed | |
558 until we are out of redisplay proper. */ | |
559 if (FRAME_GUTTER_BOUNDS (f, pos) != f->current_gutter_bounds[pos]) | |
560 { | |
561 int width, height; | |
5043 | 562 pixel_to_frame_unit_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), |
442 | 563 &width, &height); |
5043 | 564 change_frame_size (f, width, height, 0); |
905 | 565 MARK_FRAME_LAYOUT_CHANGED (f); |
442 | 566 } |
567 | |
568 /* Mark sizes as up-to-date. */ | |
569 f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); | |
570 } | |
571 | |
572 void | |
573 update_frame_gutter_geometry (struct frame *f) | |
574 { | |
4186 | 575 if (f->gutter_changed |
576 || f->frame_layout_changed | |
905 | 577 || f->windows_structure_changed) |
442 | 578 { |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
579 enum edge_pos pos; |
442 | 580 |
581 /* If the gutter geometry has changed then re-layout the | |
4186 | 582 frame. If we are in display there is almost no point in doing |
583 anything else since the frame size changes will be delayed | |
584 until we are out of redisplay proper. */ | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
585 EDGE_POS_LOOP (pos) |
442 | 586 { |
587 update_gutter_geometry (f, pos); | |
588 } | |
589 } | |
590 } | |
591 | |
428 | 592 void |
593 update_frame_gutters (struct frame *f) | |
594 { | |
442 | 595 if (f->faces_changed || f->frame_changed || |
596 f->gutter_changed || f->glyphs_changed || | |
597 f->size_changed || f->subwindows_changed || | |
598 f->windows_changed || f->windows_structure_changed || | |
905 | 599 f->extents_changed || f->frame_layout_changed) |
428 | 600 { |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
601 enum edge_pos pos; |
442 | 602 |
428 | 603 /* We don't actually care about these when outputting the gutter |
4186 | 604 so locally disable them. */ |
428 | 605 int local_clip_changed = f->clip_changed; |
606 int local_buffers_changed = f->buffers_changed; | |
607 f->clip_changed = 0; | |
608 f->buffers_changed = 0; | |
609 | |
610 /* and output */ | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
611 EDGE_POS_LOOP (pos) |
428 | 612 { |
613 if (FRAME_GUTTER_VISIBLE (f, pos)) | |
442 | 614 output_gutter (f, pos, 0); |
615 | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
616 else if (f->gutter_was_visible[pos]) |
442 | 617 clear_gutter (f, pos); |
428 | 618 } |
442 | 619 |
428 | 620 f->clip_changed = local_clip_changed; |
621 f->buffers_changed = local_buffers_changed; | |
622 f->gutter_changed = 0; | |
623 } | |
624 } | |
625 | |
626 void | |
627 reset_gutter_display_lines (struct frame* f) | |
628 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
629 enum edge_pos pos; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
630 EDGE_POS_LOOP (pos) |
442 | 631 { |
632 if (f->current_display_lines[pos]) | |
633 Dynarr_reset (f->current_display_lines[pos]); | |
634 } | |
428 | 635 } |
636 | |
637 static void | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
638 redraw_exposed_gutter (struct frame *f, enum edge_pos pos, int x, int y, |
428 | 639 int width, int height) |
640 { | |
641 int g_x, g_y, g_width, g_height; | |
642 | |
643 get_gutter_coords (f, pos, &g_x, &g_y, &g_width, &g_height); | |
644 | |
645 if (((y + height) < g_y) || (y > (g_y + g_height)) || !height || !width || !g_height || !g_width) | |
646 return; | |
647 if (((x + width) < g_x) || (x > (g_x + g_width))) | |
648 return; | |
649 | |
442 | 650 #ifdef DEBUG_WIDGETS |
639 | 651 stderr_out ("redrawing gutter after expose %d+%d, %dx%d\n", |
442 | 652 x, y, width, height); |
653 #endif | |
428 | 654 /* #### optimize this - redrawing the whole gutter for every expose |
655 is very expensive. We reset the current display lines because if | |
656 they're being exposed they are no longer current. */ | |
657 reset_gutter_display_lines (f); | |
658 | |
659 /* Even if none of the gutter is in the area, the blank region at | |
660 the very least must be because the first thing we did is verify | |
661 that some portion of the gutter is in the exposed region. */ | |
442 | 662 output_gutter (f, pos, 1); |
428 | 663 } |
664 | |
665 void | |
666 redraw_exposed_gutters (struct frame *f, int x, int y, int width, | |
667 int height) | |
668 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
669 enum edge_pos pos; |
442 | 670 |
1318 | 671 /* We are already inside the critical section -- our caller did that. */ |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
672 EDGE_POS_LOOP (pos) |
428 | 673 { |
674 if (FRAME_GUTTER_VISIBLE (f, pos)) | |
675 redraw_exposed_gutter (f, pos, x, y, width, height); | |
676 } | |
677 } | |
678 | |
679 void | |
680 free_frame_gutters (struct frame *f) | |
681 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
682 enum edge_pos pos; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
683 EDGE_POS_LOOP (pos) |
428 | 684 { |
442 | 685 if (f->current_display_lines[pos]) |
686 { | |
687 free_display_lines (f->current_display_lines[pos]); | |
688 f->current_display_lines[pos] = 0; | |
689 } | |
690 if (f->desired_display_lines[pos]) | |
691 { | |
692 free_display_lines (f->desired_display_lines[pos]); | |
693 f->desired_display_lines[pos] = 0; | |
694 } | |
428 | 695 } |
696 } | |
697 | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
698 static enum edge_pos |
428 | 699 decode_gutter_position (Lisp_Object position) |
700 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
701 if (EQ (position, Qtop)) return TOP_EDGE; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
702 if (EQ (position, Qbottom)) return BOTTOM_EDGE; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
703 if (EQ (position, Qleft)) return LEFT_EDGE; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
704 if (EQ (position, Qright)) return RIGHT_EDGE; |
563 | 705 invalid_constant ("Invalid gutter position", position); |
428 | 706 |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
707 RETURN_NOT_REACHED (TOP_EDGE); |
428 | 708 } |
709 | |
710 DEFUN ("set-default-gutter-position", Fset_default_gutter_position, 1, 1, 0, /* | |
711 Set the position that the `default-gutter' will be displayed at. | |
3025 | 712 Valid positions are `top', `bottom', `left' and `right'. |
428 | 713 See `default-gutter-position'. |
714 */ | |
715 (position)) | |
716 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
717 enum edge_pos cur = decode_gutter_position (Vdefault_gutter_position); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
718 enum edge_pos new_ = decode_gutter_position (position); |
428 | 719 |
3025 | 720 if (cur != new_) |
428 | 721 { |
722 /* The following calls will automatically cause the dirty | |
723 flags to be set; we delay frame size changes to avoid | |
724 lots of frame flickering. */ | |
725 /* #### I think this should be GC protected. -sb */ | |
1318 | 726 int depth = begin_hold_frame_size_changes (); |
727 | |
428 | 728 set_specifier_fallback (Vgutter[cur], list1 (Fcons (Qnil, Qnil))); |
3025 | 729 set_specifier_fallback (Vgutter[new_], Vdefault_gutter); |
428 | 730 set_specifier_fallback (Vgutter_size[cur], list1 (Fcons (Qnil, Qzero))); |
3025 | 731 set_specifier_fallback (Vgutter_size[new_], |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
732 new_ == TOP_EDGE || new_ == BOTTOM_EDGE |
428 | 733 ? Vdefault_gutter_height |
734 : Vdefault_gutter_width); | |
735 set_specifier_fallback (Vgutter_border_width[cur], | |
736 list1 (Fcons (Qnil, Qzero))); | |
3025 | 737 set_specifier_fallback (Vgutter_border_width[new_], |
428 | 738 Vdefault_gutter_border_width); |
444 | 739 set_specifier_fallback (Vgutter_visible_p[cur], list1 (Fcons (Qnil, Qt))); |
3025 | 740 set_specifier_fallback (Vgutter_visible_p[new_], Vdefault_gutter_visible_p); |
1318 | 741 Vdefault_gutter_position = position; |
442 | 742 |
1318 | 743 unbind_to (depth); |
428 | 744 } |
745 | |
442 | 746 run_hook (Qdefault_gutter_position_changed_hook); |
747 | |
428 | 748 return position; |
749 } | |
750 | |
751 DEFUN ("default-gutter-position", Fdefault_gutter_position, 0, 0, 0, /* | |
752 Return the position that the `default-gutter' will be displayed at. | |
753 The `default-gutter' will only be displayed here if the corresponding | |
754 position-specific gutter specifier does not provide a value. | |
755 */ | |
756 ()) | |
757 { | |
758 return Vdefault_gutter_position; | |
759 } | |
760 | |
761 DEFUN ("gutter-pixel-width", Fgutter_pixel_width, 0, 2, 0, /* | |
762 Return the pixel width of the gutter at POS in LOCALE. | |
763 POS defaults to the default gutter position. LOCALE defaults to | |
764 the current window. | |
765 */ | |
766 (pos, locale)) | |
767 { | |
768 int x, y, width, height; | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
769 enum edge_pos p = TOP_EDGE; |
428 | 770 struct frame *f = decode_frame (FW_FRAME (locale)); |
771 | |
772 if (NILP (pos)) | |
773 pos = Vdefault_gutter_position; | |
774 p = decode_gutter_position (pos); | |
775 | |
776 get_gutter_coords (f, p, &x, &y, &width, &height); | |
777 width -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2); | |
778 | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
779 return make_fixnum (width); |
428 | 780 } |
781 | |
782 DEFUN ("gutter-pixel-height", Fgutter_pixel_height, 0, 2, 0, /* | |
783 Return the pixel height of the gutter at POS in LOCALE. | |
784 POS defaults to the default gutter position. LOCALE defaults to | |
785 the current window. | |
786 */ | |
787 (pos, locale)) | |
788 { | |
789 int x, y, width, height; | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
790 enum edge_pos p = TOP_EDGE; |
428 | 791 struct frame *f = decode_frame (FW_FRAME (locale)); |
792 | |
793 if (NILP (pos)) | |
794 pos = Vdefault_gutter_position; | |
795 p = decode_gutter_position (pos); | |
796 | |
797 get_gutter_coords (f, p, &x, &y, &width, &height); | |
798 height -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2); | |
799 | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
800 return make_fixnum (height); |
428 | 801 } |
802 | |
803 DEFINE_SPECIFIER_TYPE (gutter); | |
804 | |
805 static void | |
2286 | 806 gutter_after_change (Lisp_Object UNUSED (specifier), |
807 Lisp_Object UNUSED (locale)) | |
428 | 808 { |
809 MARK_GUTTER_CHANGED; | |
810 } | |
811 | |
812 static void | |
813 gutter_validate (Lisp_Object instantiator) | |
814 { | |
815 if (NILP (instantiator)) | |
816 return; | |
817 | |
442 | 818 /* Must be a string or a plist. */ |
819 if (!STRINGP (instantiator) && NILP (Fvalid_plist_p (instantiator))) | |
563 | 820 sferror ("Gutter spec must be string, plist or nil", instantiator); |
442 | 821 |
428 | 822 if (!STRINGP (instantiator)) |
442 | 823 { |
824 Lisp_Object rest; | |
825 | |
826 for (rest = instantiator; !NILP (rest); rest = XCDR (XCDR (rest))) | |
827 { | |
828 if (!SYMBOLP (XCAR (rest)) | |
829 || !STRINGP (XCAR (XCDR (rest)))) | |
563 | 830 sferror ("Gutter plist spec must contain strings", instantiator); |
442 | 831 } |
832 } | |
428 | 833 } |
834 | |
835 DEFUN ("gutter-specifier-p", Fgutter_specifier_p, 1, 1, 0, /* | |
836 Return non-nil if OBJECT is a gutter specifier. | |
837 | |
442 | 838 See `make-gutter-specifier' for a description of possible gutter |
839 instantiators. | |
428 | 840 */ |
841 (object)) | |
842 { | |
843 return GUTTER_SPECIFIERP (object) ? Qt : Qnil; | |
844 } | |
845 | |
846 | |
847 /* | |
848 Helper for invalidating the real specifier when default | |
849 specifier caching changes | |
850 */ | |
851 static void | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
852 recompute_overlaying_specifier (Lisp_Object real_one[NUM_EDGES]) |
428 | 853 { |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
854 enum edge_pos pos = decode_gutter_position (Vdefault_gutter_position); |
428 | 855 Fset_specifier_dirty_flag (real_one[pos]); |
856 } | |
857 | |
1318 | 858 static void gutter_specs_changed (Lisp_Object specifier, struct window *w, |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
859 Lisp_Object oldval, enum edge_pos pos); |
1318 | 860 |
861 static void | |
862 gutter_specs_changed_1 (Lisp_Object arg) | |
863 { | |
864 gutter_specs_changed (X1ST (arg), XWINDOW (X2ND (arg)), | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
865 X3RD (arg), (enum edge_pos) XFIXNUM (X4TH (arg))); |
1318 | 866 free_list (arg); |
867 } | |
868 | |
428 | 869 static void |
870 gutter_specs_changed (Lisp_Object specifier, struct window *w, | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
871 Lisp_Object oldval, enum edge_pos pos) |
428 | 872 { |
1318 | 873 if (in_display) |
874 register_post_redisplay_action (gutter_specs_changed_1, | |
875 list4 (specifier, wrap_window (w), | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
876 oldval, make_fixnum (pos))); |
1318 | 877 else |
878 { | |
879 w->real_gutter[pos] = construct_window_gutter_spec (w, pos); | |
880 w->real_gutter_size[pos] = w->gutter_size[pos]; | |
442 | 881 |
1318 | 882 if (EQ (w->real_gutter_size[pos], Qautodetect) |
883 && !NILP (w->gutter_visible_p[pos])) | |
884 { | |
885 w->real_gutter_size [pos] = calculate_gutter_size (w, pos); | |
886 } | |
887 MARK_GUTTER_CHANGED; | |
888 MARK_MODELINE_CHANGED; | |
889 MARK_WINDOWS_CHANGED (w); | |
428 | 890 } |
891 } | |
892 | |
442 | 893 /* We define all of these so we can access which actual gutter changed. */ |
894 static void | |
895 top_gutter_specs_changed (Lisp_Object specifier, struct window *w, | |
896 Lisp_Object oldval) | |
897 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
898 gutter_specs_changed (specifier, w, oldval, TOP_EDGE); |
442 | 899 } |
900 | |
901 static void | |
902 bottom_gutter_specs_changed (Lisp_Object specifier, struct window *w, | |
903 Lisp_Object oldval) | |
904 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
905 gutter_specs_changed (specifier, w, oldval, BOTTOM_EDGE); |
442 | 906 } |
907 | |
908 static void | |
909 left_gutter_specs_changed (Lisp_Object specifier, struct window *w, | |
910 Lisp_Object oldval) | |
911 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
912 gutter_specs_changed (specifier, w, oldval, LEFT_EDGE); |
442 | 913 } |
914 | |
915 static void | |
916 right_gutter_specs_changed (Lisp_Object specifier, struct window *w, | |
917 Lisp_Object oldval) | |
918 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
919 gutter_specs_changed (specifier, w, oldval, RIGHT_EDGE); |
442 | 920 } |
921 | |
428 | 922 static void |
2286 | 923 default_gutter_specs_changed (Lisp_Object UNUSED (specifier), |
924 struct window *UNUSED (w), | |
925 Lisp_Object UNUSED (oldval)) | |
428 | 926 { |
927 recompute_overlaying_specifier (Vgutter); | |
928 } | |
929 | |
1318 | 930 static void gutter_geometry_changed_in_window (Lisp_Object specifier, |
931 struct window *w, | |
932 Lisp_Object oldval); | |
933 | |
934 static void | |
935 gutter_geometry_changed_in_window_1 (Lisp_Object arg) | |
936 { | |
937 gutter_geometry_changed_in_window (X1ST (arg), XWINDOW (X2ND (arg)), | |
938 X3RD (arg)); | |
939 free_list (arg); | |
940 } | |
941 | |
428 | 942 static void |
943 gutter_geometry_changed_in_window (Lisp_Object specifier, struct window *w, | |
944 Lisp_Object oldval) | |
945 { | |
1318 | 946 if (in_display) |
947 register_post_redisplay_action (gutter_geometry_changed_in_window_1, | |
948 list3 (specifier, wrap_window (w), | |
949 oldval)); | |
950 else | |
428 | 951 { |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
952 enum edge_pos pos; |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
953 EDGE_POS_LOOP (pos) |
428 | 954 { |
1318 | 955 w->real_gutter_size[pos] = w->gutter_size[pos]; |
956 if (EQ (w->real_gutter_size[pos], Qautodetect) | |
957 && !NILP (w->gutter_visible_p[pos])) | |
958 { | |
959 w->real_gutter_size [pos] = calculate_gutter_size (w, pos); | |
960 } | |
428 | 961 } |
442 | 962 |
1318 | 963 MARK_GUTTER_CHANGED; |
964 MARK_MODELINE_CHANGED; | |
965 MARK_WINDOWS_CHANGED (w); | |
966 } | |
428 | 967 } |
968 | |
969 static void | |
2286 | 970 default_gutter_size_changed_in_window (Lisp_Object UNUSED (specifier), |
971 struct window *UNUSED (w), | |
972 Lisp_Object UNUSED (oldval)) | |
428 | 973 { |
974 recompute_overlaying_specifier (Vgutter_size); | |
975 } | |
976 | |
977 static void | |
2286 | 978 default_gutter_border_width_changed_in_window (Lisp_Object UNUSED (specifier), |
979 struct window *UNUSED (w), | |
980 Lisp_Object UNUSED (oldval)) | |
428 | 981 { |
982 recompute_overlaying_specifier (Vgutter_border_width); | |
983 } | |
984 | |
985 static void | |
2286 | 986 default_gutter_visible_p_changed_in_window (Lisp_Object UNUSED (specifier), |
987 struct window *UNUSED (w), | |
988 Lisp_Object UNUSED (oldval)) | |
428 | 989 { |
990 recompute_overlaying_specifier (Vgutter_visible_p); | |
442 | 991 /* Need to reconstruct the gutter specifier as it is affected by the |
992 visibility. */ | |
993 recompute_overlaying_specifier (Vgutter); | |
428 | 994 } |
995 | |
996 | |
997 DECLARE_SPECIFIER_TYPE (gutter_size); | |
998 #define GUTTER_SIZE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_size) | |
999 DEFINE_SPECIFIER_TYPE (gutter_size); | |
1000 | |
1001 static void | |
1002 gutter_size_validate (Lisp_Object instantiator) | |
1003 { | |
1004 if (NILP (instantiator)) | |
1005 return; | |
1006 | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
1007 if (!FIXNUMP (instantiator) && !EQ (instantiator, Qautodetect)) |
3025 | 1008 invalid_argument ("Gutter size must be an integer or `autodetect'", instantiator); |
428 | 1009 } |
1010 | |
1011 DEFUN ("gutter-size-specifier-p", Fgutter_size_specifier_p, 1, 1, 0, /* | |
1012 Return non-nil if OBJECT is a gutter-size specifier. | |
442 | 1013 |
1014 See `make-gutter-size-specifier' for a description of possible gutter-size | |
1015 instantiators. | |
428 | 1016 */ |
1017 (object)) | |
1018 { | |
1019 return GUTTER_SIZE_SPECIFIERP (object) ? Qt : Qnil; | |
1020 } | |
1021 | |
442 | 1022 DECLARE_SPECIFIER_TYPE (gutter_visible); |
1023 #define GUTTER_VISIBLE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_visible) | |
1024 DEFINE_SPECIFIER_TYPE (gutter_visible); | |
1025 | |
1026 static void | |
1027 gutter_visible_validate (Lisp_Object instantiator) | |
1028 { | |
1029 if (NILP (instantiator)) | |
1030 return; | |
1031 | |
1032 if (!NILP (instantiator) && !EQ (instantiator, Qt) && !CONSP (instantiator)) | |
563 | 1033 invalid_argument ("Gutter visibility must be a boolean or list of symbols", |
442 | 1034 instantiator); |
1035 | |
1036 if (CONSP (instantiator)) | |
1037 { | |
2367 | 1038 EXTERNAL_LIST_LOOP_2 (elt, instantiator) |
442 | 1039 { |
2367 | 1040 if (!SYMBOLP (elt)) |
563 | 1041 invalid_argument ("Gutter visibility must be a boolean or list of symbols", |
442 | 1042 instantiator); |
1043 } | |
1044 } | |
1045 } | |
1046 | |
1047 DEFUN ("gutter-visible-specifier-p", Fgutter_visible_specifier_p, 1, 1, 0, /* | |
1048 Return non-nil if OBJECT is a gutter-visible specifier. | |
1049 | |
1050 See `make-gutter-visible-specifier' for a description of possible | |
1051 gutter-visible instantiators. | |
1052 */ | |
1053 (object)) | |
1054 { | |
1055 return GUTTER_VISIBLE_SPECIFIERP (object) ? Qt : Qnil; | |
1056 } | |
1057 | |
428 | 1058 DEFUN ("redisplay-gutter-area", Fredisplay_gutter_area, 0, 0, 0, /* |
1059 Ensure that all gutters are correctly showing their gutter specifier. | |
1060 */ | |
1061 ()) | |
1062 { | |
1063 Lisp_Object devcons, concons; | |
1064 | |
1318 | 1065 /* Can't reentrantly enter redisplay */ |
1066 if (in_display) | |
1067 return Qnil; | |
1068 | |
428 | 1069 DEVICE_LOOP_NO_BREAK (devcons, concons) |
1070 { | |
1071 struct device *d = XDEVICE (XCAR (devcons)); | |
1072 Lisp_Object frmcons; | |
1073 | |
1074 DEVICE_FRAME_LOOP (frmcons, d) | |
1075 { | |
1076 struct frame *f = XFRAME (XCAR (frmcons)); | |
1077 | |
442 | 1078 MAYBE_DEVMETH (d, frame_output_begin, (f)); |
1079 | |
1080 /* Sequence is quite important here. We not only want to | |
1081 redisplay the gutter area but we also want to flush any | |
1082 frame size changes out so that the gutter redisplay happens | |
1083 in a kosha environment. | |
1084 | |
1085 This is not only so that things look right but so that | |
1086 glyph redisplay optimization kicks in, by default display | |
1087 lines will be completely re-output if | |
1088 f->windows_structure_changed is 1, and this is true if | |
1089 frame size changes haven't been flushed out. Once frame | |
1090 size changes have been flushed out we then need to | |
1091 redisplay the frame in order to flush out pending window | |
1092 size changes. */ | |
1093 update_frame_gutter_geometry (f); | |
428 | 1094 |
442 | 1095 if (f->windows_structure_changed) |
1096 redisplay_frame (f, 1); | |
1097 else if (FRAME_REPAINT_P (f)) | |
1098 { | |
853 | 1099 int depth; |
1100 | |
442 | 1101 /* We have to be "in display" when we output the gutter |
4186 | 1102 - make it so. */ |
853 | 1103 depth = enter_redisplay_critical_section (); |
442 | 1104 update_frame_gutters (f); |
853 | 1105 exit_redisplay_critical_section (depth); |
442 | 1106 } |
1107 | |
1108 MAYBE_DEVMETH (d, frame_output_end, (f)); | |
1109 } | |
1110 | |
1111 d->gutter_changed = 0; | |
428 | 1112 } |
1113 | |
442 | 1114 /* This is so that further changes to the gutters will trigger redisplay. */ |
1115 gutter_changed_set = 0; | |
1116 gutter_changed = 0; | |
1117 | |
428 | 1118 return Qnil; |
1119 } | |
1120 | |
1121 void | |
1122 init_frame_gutters (struct frame *f) | |
1123 { | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1124 enum edge_pos pos; |
428 | 1125 struct window* w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); |
1126 /* We are here as far in frame creation so cached specifiers are | |
1127 already recomputed, and possibly modified by resource | |
1128 initialization. We need to recalculate autodetected gutters. */ | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1129 EDGE_POS_LOOP (pos) |
428 | 1130 { |
442 | 1131 w->real_gutter[pos] = construct_window_gutter_spec (w, pos); |
428 | 1132 w->real_gutter_size[pos] = w->gutter_size[pos]; |
1133 if (EQ (w->gutter_size[pos], Qautodetect) | |
1134 && !NILP (w->gutter_visible_p[pos])) | |
1135 { | |
1136 w->real_gutter_size [pos] = calculate_gutter_size (w, pos); | |
1137 MARK_GUTTER_CHANGED; | |
1138 MARK_WINDOWS_CHANGED (w); | |
1139 } | |
1140 } | |
442 | 1141 |
1142 /* Keep a record of the current sizes of things. */ | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1143 EDGE_POS_LOOP (pos) |
442 | 1144 { |
1145 f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); | |
1146 } | |
428 | 1147 } |
1148 | |
1149 void | |
1150 syms_of_gutter (void) | |
1151 { | |
1152 DEFSUBR (Fgutter_specifier_p); | |
1153 DEFSUBR (Fgutter_size_specifier_p); | |
442 | 1154 DEFSUBR (Fgutter_visible_specifier_p); |
428 | 1155 DEFSUBR (Fset_default_gutter_position); |
1156 DEFSUBR (Fdefault_gutter_position); | |
1157 DEFSUBR (Fgutter_pixel_height); | |
1158 DEFSUBR (Fgutter_pixel_width); | |
1159 DEFSUBR (Fredisplay_gutter_area); | |
1160 | |
563 | 1161 DEFSYMBOL (Qgutter_size); |
1162 DEFSYMBOL (Qgutter_visible); | |
1163 DEFSYMBOL (Qdefault_gutter_position_changed_hook); | |
428 | 1164 } |
1165 | |
1166 void | |
1167 vars_of_gutter (void) | |
1168 { | |
1169 staticpro (&Vdefault_gutter_position); | |
1170 Vdefault_gutter_position = Qtop; | |
1171 | |
1172 Fprovide (Qgutter); | |
1173 } | |
1174 | |
1175 void | |
1176 specifier_type_create_gutter (void) | |
1177 { | |
1178 INITIALIZE_SPECIFIER_TYPE (gutter, "gutter", "gutter-specifier-p"); | |
1179 SPECIFIER_HAS_METHOD (gutter, validate); | |
1180 SPECIFIER_HAS_METHOD (gutter, after_change); | |
1181 | |
1182 INITIALIZE_SPECIFIER_TYPE (gutter_size, "gutter-size", "gutter-size-specifier-p"); | |
442 | 1183 SPECIFIER_HAS_METHOD (gutter_size, validate); |
428 | 1184 |
442 | 1185 INITIALIZE_SPECIFIER_TYPE (gutter_visible, "gutter-visible", "gutter-visible-specifier-p"); |
1186 SPECIFIER_HAS_METHOD (gutter_visible, validate); | |
428 | 1187 } |
1188 | |
1189 void | |
1190 reinit_specifier_type_create_gutter (void) | |
1191 { | |
1192 REINITIALIZE_SPECIFIER_TYPE (gutter); | |
1193 REINITIALIZE_SPECIFIER_TYPE (gutter_size); | |
442 | 1194 REINITIALIZE_SPECIFIER_TYPE (gutter_visible); |
428 | 1195 } |
1196 | |
1197 void | |
1198 specifier_vars_of_gutter (void) | |
1199 { | |
1200 Lisp_Object fb; | |
1201 | |
1202 DEFVAR_SPECIFIER ("default-gutter", &Vdefault_gutter /* | |
1203 Specifier for a fallback gutter. | |
1204 Use `set-specifier' to change this. | |
1205 | |
1206 The position of this gutter is specified in the function | |
1207 `default-gutter-position'. If the corresponding position-specific | |
3025 | 1208 gutter (e.g. `top-gutter' if `default-gutter-position' is `top') |
428 | 1209 does not specify a gutter in a particular domain (usually a window), |
1210 then the value of `default-gutter' in that domain, if any, will be | |
1211 used instead. | |
1212 | |
1213 Note that the gutter at any particular position will not be | |
1214 displayed unless its visibility flag is true and its thickness | |
1215 \(width or height, depending on orientation) is non-zero. The | |
1216 visibility is controlled by the specifiers `top-gutter-visible-p', | |
1217 `bottom-gutter-visible-p', `left-gutter-visible-p', and | |
1218 `right-gutter-visible-p', and the thickness is controlled by the | |
1219 specifiers `top-gutter-height', `bottom-gutter-height', | |
1220 `left-gutter-width', and `right-gutter-width'. | |
1221 | |
1222 Note that one of the four visibility specifiers inherits from | |
1223 `default-gutter-visibility' and one of the four thickness | |
1224 specifiers inherits from either `default-gutter-width' or | |
1225 `default-gutter-height' (depending on orientation), just | |
1226 like for the gutter description specifiers (e.g. `top-gutter') | |
1227 mentioned above. | |
1228 | |
1229 Therefore, if you are setting `default-gutter', you should control | |
1230 the visibility and thickness using `default-gutter-visible-p', | |
1231 `default-gutter-width', and `default-gutter-height', rather than | |
1232 using position-specific specifiers. That way, you will get sane | |
1233 behavior if the user changes the default gutter position. | |
1234 | |
442 | 1235 The gutter value should be a string, a property list of strings or |
1236 nil. You can attach extents and glyphs to the string and hence display | |
1237 glyphs and text in other fonts in the gutter area. If the gutter value | |
1238 is a property list then the strings will be concatenated together | |
1239 before being displayed. */ ); | |
428 | 1240 |
1241 Vdefault_gutter = Fmake_specifier (Qgutter); | |
1242 /* #### It would be even nicer if the specifier caching | |
1243 automatically knew about specifier fallbacks, so we didn't | |
1244 have to do it ourselves. */ | |
1245 set_specifier_caching (Vdefault_gutter, | |
438 | 1246 offsetof (struct window, default_gutter), |
428 | 1247 default_gutter_specs_changed, |
444 | 1248 0, 0, 1); |
428 | 1249 |
1250 DEFVAR_SPECIFIER ("top-gutter", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1251 &Vgutter[TOP_EDGE] /* |
428 | 1252 Specifier for the gutter at the top of the frame. |
1253 Use `set-specifier' to change this. | |
1254 See `default-gutter' for a description of a valid gutter instantiator. | |
1255 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1256 Vgutter[TOP_EDGE] = Fmake_specifier (Qgutter); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1257 set_specifier_caching (Vgutter[TOP_EDGE], |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1258 offsetof (struct window, gutter[TOP_EDGE]), |
442 | 1259 top_gutter_specs_changed, |
444 | 1260 0, 0, 1); |
428 | 1261 |
1262 DEFVAR_SPECIFIER ("bottom-gutter", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1263 &Vgutter[BOTTOM_EDGE] /* |
428 | 1264 Specifier for the gutter at the bottom of the frame. |
1265 Use `set-specifier' to change this. | |
1266 See `default-gutter' for a description of a valid gutter instantiator. | |
1267 | |
1268 Note that, unless the `default-gutter-position' is `bottom', by | |
1269 default the height of the bottom gutter (controlled by | |
1270 `bottom-gutter-height') is 0; thus, a bottom gutter will not be | |
1271 displayed even if you provide a value for `bottom-gutter'. | |
1272 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1273 Vgutter[BOTTOM_EDGE] = Fmake_specifier (Qgutter); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1274 set_specifier_caching (Vgutter[BOTTOM_EDGE], |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1275 offsetof (struct window, gutter[BOTTOM_EDGE]), |
442 | 1276 bottom_gutter_specs_changed, |
444 | 1277 0, 0, 1); |
428 | 1278 |
1279 DEFVAR_SPECIFIER ("left-gutter", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1280 &Vgutter[LEFT_EDGE] /* |
428 | 1281 Specifier for the gutter at the left edge of the frame. |
1282 Use `set-specifier' to change this. | |
1283 See `default-gutter' for a description of a valid gutter instantiator. | |
1284 | |
1285 Note that, unless the `default-gutter-position' is `left', by | |
1286 default the height of the left gutter (controlled by | |
1287 `left-gutter-width') is 0; thus, a left gutter will not be | |
1288 displayed even if you provide a value for `left-gutter'. | |
1289 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1290 Vgutter[LEFT_EDGE] = Fmake_specifier (Qgutter); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1291 set_specifier_caching (Vgutter[LEFT_EDGE], |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1292 offsetof (struct window, gutter[LEFT_EDGE]), |
442 | 1293 left_gutter_specs_changed, |
444 | 1294 0, 0, 1); |
428 | 1295 |
1296 DEFVAR_SPECIFIER ("right-gutter", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1297 &Vgutter[RIGHT_EDGE] /* |
428 | 1298 Specifier for the gutter at the right edge of the frame. |
1299 Use `set-specifier' to change this. | |
1300 See `default-gutter' for a description of a valid gutter instantiator. | |
1301 | |
1302 Note that, unless the `default-gutter-position' is `right', by | |
1303 default the height of the right gutter (controlled by | |
1304 `right-gutter-width') is 0; thus, a right gutter will not be | |
1305 displayed even if you provide a value for `right-gutter'. | |
1306 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1307 Vgutter[RIGHT_EDGE] = Fmake_specifier (Qgutter); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1308 set_specifier_caching (Vgutter[RIGHT_EDGE], |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1309 offsetof (struct window, gutter[RIGHT_EDGE]), |
442 | 1310 right_gutter_specs_changed, |
444 | 1311 0, 0, 1); |
428 | 1312 |
1313 /* initially, top inherits from default; this can be | |
1314 changed with `set-default-gutter-position'. */ | |
1315 fb = list1 (Fcons (Qnil, Qnil)); | |
1316 set_specifier_fallback (Vdefault_gutter, fb); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1317 set_specifier_fallback (Vgutter[TOP_EDGE], Vdefault_gutter); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1318 set_specifier_fallback (Vgutter[BOTTOM_EDGE], fb); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1319 set_specifier_fallback (Vgutter[LEFT_EDGE], fb); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1320 set_specifier_fallback (Vgutter[RIGHT_EDGE], fb); |
428 | 1321 |
1322 DEFVAR_SPECIFIER ("default-gutter-height", &Vdefault_gutter_height /* | |
1323 *Height of the default gutter, if it's oriented horizontally. | |
1324 This is a specifier; use `set-specifier' to change it. | |
1325 | |
1326 The position of the default gutter is specified by the function | |
1327 `set-default-gutter-position'. If the corresponding position-specific | |
1328 gutter thickness specifier (e.g. `top-gutter-height' if | |
3025 | 1329 `default-gutter-position' is `top') does not specify a thickness in a |
428 | 1330 particular domain (a window or a frame), then the value of |
1331 `default-gutter-height' or `default-gutter-width' (depending on the | |
1332 gutter orientation) in that domain, if any, will be used instead. | |
1333 | |
1334 Note that `default-gutter-height' is only used when | |
3025 | 1335 `default-gutter-position' is `top' or `bottom', and `default-gutter-width' |
1336 is only used when `default-gutter-position' is `left' or `right'. | |
428 | 1337 |
1338 Note that all of the position-specific gutter thickness specifiers | |
1339 have a fallback value of zero when they do not correspond to the | |
1340 default gutter. Therefore, you will have to set a non-zero thickness | |
1341 value if you want a position-specific gutter to be displayed. | |
1342 | |
3025 | 1343 If you set the height to `autodetect' the size of the gutter will be |
428 | 1344 calculated to be large enough to hold the contents of the gutter. This |
1345 is the default. | |
1346 */ ); | |
1347 Vdefault_gutter_height = Fmake_specifier (Qgutter_size); | |
1348 set_specifier_caching (Vdefault_gutter_height, | |
438 | 1349 offsetof (struct window, default_gutter_height), |
428 | 1350 default_gutter_size_changed_in_window, |
444 | 1351 0, 0, 1); |
428 | 1352 |
1353 DEFVAR_SPECIFIER ("default-gutter-width", &Vdefault_gutter_width /* | |
1354 *Width of the default gutter, if it's oriented vertically. | |
1355 This is a specifier; use `set-specifier' to change it. | |
1356 | |
1357 See `default-gutter-height' for more information. | |
1358 */ ); | |
444 | 1359 Vdefault_gutter_width = Fmake_specifier (Qgutter_size); |
428 | 1360 set_specifier_caching (Vdefault_gutter_width, |
438 | 1361 offsetof (struct window, default_gutter_width), |
428 | 1362 default_gutter_size_changed_in_window, |
444 | 1363 0, 0, 1); |
428 | 1364 |
1365 DEFVAR_SPECIFIER ("top-gutter-height", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1366 &Vgutter_size[TOP_EDGE] /* |
428 | 1367 *Height of the top gutter. |
1368 This is a specifier; use `set-specifier' to change it. | |
1369 | |
1370 See `default-gutter-height' for more information. | |
1371 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1372 Vgutter_size[TOP_EDGE] = Fmake_specifier (Qgutter_size); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1373 set_specifier_caching (Vgutter_size[TOP_EDGE], |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1374 offsetof (struct window, gutter_size[TOP_EDGE]), |
444 | 1375 gutter_geometry_changed_in_window, 0, 0, 1); |
428 | 1376 |
1377 DEFVAR_SPECIFIER ("bottom-gutter-height", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1378 &Vgutter_size[BOTTOM_EDGE] /* |
428 | 1379 *Height of the bottom gutter. |
1380 This is a specifier; use `set-specifier' to change it. | |
1381 | |
1382 See `default-gutter-height' for more information. | |
1383 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1384 Vgutter_size[BOTTOM_EDGE] = Fmake_specifier (Qgutter_size); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1385 set_specifier_caching (Vgutter_size[BOTTOM_EDGE], |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1386 offsetof (struct window, gutter_size[BOTTOM_EDGE]), |
444 | 1387 gutter_geometry_changed_in_window, 0, 0, 1); |
428 | 1388 |
1389 DEFVAR_SPECIFIER ("left-gutter-width", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1390 &Vgutter_size[LEFT_EDGE] /* |
428 | 1391 *Width of left gutter. |
1392 This is a specifier; use `set-specifier' to change it. | |
1393 | |
1394 See `default-gutter-height' for more information. | |
1395 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1396 Vgutter_size[LEFT_EDGE] = Fmake_specifier (Qgutter_size); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1397 set_specifier_caching (Vgutter_size[LEFT_EDGE], |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1398 offsetof (struct window, gutter_size[LEFT_EDGE]), |
444 | 1399 gutter_geometry_changed_in_window, 0, 0, 1); |
428 | 1400 |
1401 DEFVAR_SPECIFIER ("right-gutter-width", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1402 &Vgutter_size[RIGHT_EDGE] /* |
428 | 1403 *Width of right gutter. |
1404 This is a specifier; use `set-specifier' to change it. | |
1405 | |
1406 See `default-gutter-height' for more information. | |
1407 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1408 Vgutter_size[RIGHT_EDGE] = Fmake_specifier (Qgutter_size); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1409 set_specifier_caching (Vgutter_size[RIGHT_EDGE], |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1410 offsetof (struct window, gutter_size[RIGHT_EDGE]), |
444 | 1411 gutter_geometry_changed_in_window, 0, 0, 1); |
428 | 1412 |
1413 fb = Qnil; | |
1414 #ifdef HAVE_TTY | |
1415 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); | |
1416 #endif | |
462 | 1417 #ifdef HAVE_GTK |
1418 fb = Fcons (Fcons (list1 (Qgtk), Qautodetect), fb); | |
1419 #endif | |
428 | 1420 #ifdef HAVE_X_WINDOWS |
1421 fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb); | |
1422 #endif | |
1423 #ifdef HAVE_MS_WINDOWS | |
440 | 1424 fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb); |
428 | 1425 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb); |
1426 #endif | |
1427 if (!NILP (fb)) | |
1428 set_specifier_fallback (Vdefault_gutter_height, fb); | |
1429 | |
1430 fb = Qnil; | |
1431 #ifdef HAVE_TTY | |
444 | 1432 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); |
428 | 1433 #endif |
1434 #ifdef HAVE_X_WINDOWS | |
444 | 1435 fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb); |
428 | 1436 #endif |
462 | 1437 #ifdef HAVE_GTK |
1438 fb = Fcons (Fcons (list1 (Qgtk), Qautodetect), fb); | |
1439 #endif | |
428 | 1440 #ifdef HAVE_MS_WINDOWS |
444 | 1441 fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb); |
1442 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb); | |
428 | 1443 #endif |
1444 if (!NILP (fb)) | |
1445 set_specifier_fallback (Vdefault_gutter_width, fb); | |
1446 | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1447 set_specifier_fallback (Vgutter_size[TOP_EDGE], Vdefault_gutter_height); |
428 | 1448 fb = list1 (Fcons (Qnil, Qzero)); |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1449 set_specifier_fallback (Vgutter_size[BOTTOM_EDGE], fb); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1450 set_specifier_fallback (Vgutter_size[LEFT_EDGE], fb); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1451 set_specifier_fallback (Vgutter_size[RIGHT_EDGE], fb); |
428 | 1452 |
1453 DEFVAR_SPECIFIER ("default-gutter-border-width", | |
1454 &Vdefault_gutter_border_width /* | |
1455 *Width of the border around the default gutter. | |
1456 This is a specifier; use `set-specifier' to change it. | |
1457 | |
1458 The position of the default gutter is specified by the function | |
1459 `set-default-gutter-position'. If the corresponding position-specific | |
1460 gutter border width specifier (e.g. `top-gutter-border-width' if | |
3025 | 1461 `default-gutter-position' is `top') does not specify a border width in a |
428 | 1462 particular domain (a window or a frame), then the value of |
1463 `default-gutter-border-width' in that domain, if any, will be used | |
1464 instead. | |
1465 | |
1466 */ ); | |
1467 Vdefault_gutter_border_width = Fmake_specifier (Qnatnum); | |
1468 set_specifier_caching (Vdefault_gutter_border_width, | |
438 | 1469 offsetof (struct window, default_gutter_border_width), |
428 | 1470 default_gutter_border_width_changed_in_window, |
444 | 1471 0, 0, 0); |
428 | 1472 |
1473 DEFVAR_SPECIFIER ("top-gutter-border-width", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1474 &Vgutter_border_width[TOP_EDGE] /* |
428 | 1475 *Border width of the top gutter. |
1476 This is a specifier; use `set-specifier' to change it. | |
1477 | |
1478 See `default-gutter-height' for more information. | |
1479 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1480 Vgutter_border_width[TOP_EDGE] = Fmake_specifier (Qnatnum); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1481 set_specifier_caching (Vgutter_border_width[TOP_EDGE], |
438 | 1482 offsetof (struct window, |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1483 gutter_border_width[TOP_EDGE]), |
444 | 1484 gutter_geometry_changed_in_window, 0, 0, 0); |
428 | 1485 |
1486 DEFVAR_SPECIFIER ("bottom-gutter-border-width", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1487 &Vgutter_border_width[BOTTOM_EDGE] /* |
428 | 1488 *Border width of the bottom gutter. |
1489 This is a specifier; use `set-specifier' to change it. | |
1490 | |
1491 See `default-gutter-height' for more information. | |
1492 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1493 Vgutter_border_width[BOTTOM_EDGE] = Fmake_specifier (Qnatnum); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1494 set_specifier_caching (Vgutter_border_width[BOTTOM_EDGE], |
438 | 1495 offsetof (struct window, |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1496 gutter_border_width[BOTTOM_EDGE]), |
444 | 1497 gutter_geometry_changed_in_window, 0, 0, 0); |
428 | 1498 |
1499 DEFVAR_SPECIFIER ("left-gutter-border-width", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1500 &Vgutter_border_width[LEFT_EDGE] /* |
428 | 1501 *Border width of left gutter. |
1502 This is a specifier; use `set-specifier' to change it. | |
1503 | |
1504 See `default-gutter-height' for more information. | |
1505 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1506 Vgutter_border_width[LEFT_EDGE] = Fmake_specifier (Qnatnum); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1507 set_specifier_caching (Vgutter_border_width[LEFT_EDGE], |
438 | 1508 offsetof (struct window, |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1509 gutter_border_width[LEFT_EDGE]), |
444 | 1510 gutter_geometry_changed_in_window, 0, 0, 0); |
428 | 1511 |
1512 DEFVAR_SPECIFIER ("right-gutter-border-width", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1513 &Vgutter_border_width[RIGHT_EDGE] /* |
428 | 1514 *Border width of right gutter. |
1515 This is a specifier; use `set-specifier' to change it. | |
1516 | |
1517 See `default-gutter-height' for more information. | |
1518 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1519 Vgutter_border_width[RIGHT_EDGE] = Fmake_specifier (Qnatnum); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1520 set_specifier_caching (Vgutter_border_width[RIGHT_EDGE], |
438 | 1521 offsetof (struct window, |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1522 gutter_border_width[RIGHT_EDGE]), |
444 | 1523 gutter_geometry_changed_in_window, 0, 0, 0); |
428 | 1524 |
1525 fb = Qnil; | |
1526 #ifdef HAVE_TTY | |
1527 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); | |
1528 #endif | |
1529 #ifdef HAVE_X_WINDOWS | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
1530 fb = Fcons (Fcons (list1 (Qx), make_fixnum (DEFAULT_GUTTER_BORDER_WIDTH)), fb); |
428 | 1531 #endif |
1532 #ifdef HAVE_MS_WINDOWS | |
440 | 1533 fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb); |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
1534 fb = Fcons (Fcons (list1 (Qmswindows), make_fixnum (DEFAULT_GUTTER_BORDER_WIDTH)), fb); |
428 | 1535 #endif |
1536 if (!NILP (fb)) | |
1537 set_specifier_fallback (Vdefault_gutter_border_width, fb); | |
1538 | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1539 set_specifier_fallback (Vgutter_border_width[TOP_EDGE], Vdefault_gutter_border_width); |
428 | 1540 fb = list1 (Fcons (Qnil, Qzero)); |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1541 set_specifier_fallback (Vgutter_border_width[BOTTOM_EDGE], fb); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1542 set_specifier_fallback (Vgutter_border_width[LEFT_EDGE], fb); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1543 set_specifier_fallback (Vgutter_border_width[RIGHT_EDGE], fb); |
428 | 1544 |
1545 DEFVAR_SPECIFIER ("default-gutter-visible-p", &Vdefault_gutter_visible_p /* | |
1546 *Whether the default gutter is visible. | |
1547 This is a specifier; use `set-specifier' to change it. | |
1548 | |
1549 The position of the default gutter is specified by the function | |
1550 `set-default-gutter-position'. If the corresponding position-specific | |
1551 gutter visibility specifier (e.g. `top-gutter-visible-p' if | |
3025 | 1552 `default-gutter-position' is `top') does not specify a visible-p value |
428 | 1553 in a particular domain (a window or a frame), then the value of |
1554 `default-gutter-visible-p' in that domain, if any, will be used | |
1555 instead. | |
1556 | |
1557 `default-gutter-visible-p' and all of the position-specific gutter | |
1558 visibility specifiers have a fallback value of true. | |
1559 */ ); | |
442 | 1560 Vdefault_gutter_visible_p = Fmake_specifier (Qgutter_visible); |
428 | 1561 set_specifier_caching (Vdefault_gutter_visible_p, |
438 | 1562 offsetof (struct window, |
1563 default_gutter_visible_p), | |
428 | 1564 default_gutter_visible_p_changed_in_window, |
444 | 1565 0, 0, 0); |
428 | 1566 |
1567 DEFVAR_SPECIFIER ("top-gutter-visible-p", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1568 &Vgutter_visible_p[TOP_EDGE] /* |
428 | 1569 *Whether the top gutter is visible. |
1570 This is a specifier; use `set-specifier' to change it. | |
1571 | |
1572 See `default-gutter-visible-p' for more information. | |
1573 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1574 Vgutter_visible_p[TOP_EDGE] = Fmake_specifier (Qgutter_visible); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1575 set_specifier_caching (Vgutter_visible_p[TOP_EDGE], |
438 | 1576 offsetof (struct window, |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1577 gutter_visible_p[TOP_EDGE]), |
444 | 1578 top_gutter_specs_changed, 0, 0, 0); |
428 | 1579 |
1580 DEFVAR_SPECIFIER ("bottom-gutter-visible-p", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1581 &Vgutter_visible_p[BOTTOM_EDGE] /* |
428 | 1582 *Whether the bottom gutter is visible. |
1583 This is a specifier; use `set-specifier' to change it. | |
1584 | |
1585 See `default-gutter-visible-p' for more information. | |
1586 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1587 Vgutter_visible_p[BOTTOM_EDGE] = Fmake_specifier (Qgutter_visible); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1588 set_specifier_caching (Vgutter_visible_p[BOTTOM_EDGE], |
438 | 1589 offsetof (struct window, |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1590 gutter_visible_p[BOTTOM_EDGE]), |
444 | 1591 bottom_gutter_specs_changed, 0, 0, 0); |
428 | 1592 |
1593 DEFVAR_SPECIFIER ("left-gutter-visible-p", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1594 &Vgutter_visible_p[LEFT_EDGE] /* |
428 | 1595 *Whether the left gutter is visible. |
1596 This is a specifier; use `set-specifier' to change it. | |
1597 | |
1598 See `default-gutter-visible-p' for more information. | |
1599 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1600 Vgutter_visible_p[LEFT_EDGE] = Fmake_specifier (Qgutter_visible); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1601 set_specifier_caching (Vgutter_visible_p[LEFT_EDGE], |
438 | 1602 offsetof (struct window, |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1603 gutter_visible_p[LEFT_EDGE]), |
444 | 1604 left_gutter_specs_changed, 0, 0, 0); |
428 | 1605 |
1606 DEFVAR_SPECIFIER ("right-gutter-visible-p", | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1607 &Vgutter_visible_p[RIGHT_EDGE] /* |
428 | 1608 *Whether the right gutter is visible. |
1609 This is a specifier; use `set-specifier' to change it. | |
1610 | |
1611 See `default-gutter-visible-p' for more information. | |
1612 */ ); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1613 Vgutter_visible_p[RIGHT_EDGE] = Fmake_specifier (Qgutter_visible); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1614 set_specifier_caching (Vgutter_visible_p[RIGHT_EDGE], |
438 | 1615 offsetof (struct window, |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1616 gutter_visible_p[RIGHT_EDGE]), |
444 | 1617 right_gutter_specs_changed, 0, 0, 0); |
428 | 1618 |
1619 /* initially, top inherits from default; this can be | |
1620 changed with `set-default-gutter-position'. */ | |
1621 fb = list1 (Fcons (Qnil, Qt)); | |
1622 set_specifier_fallback (Vdefault_gutter_visible_p, fb); | |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1623 set_specifier_fallback (Vgutter_visible_p[TOP_EDGE], |
428 | 1624 Vdefault_gutter_visible_p); |
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1625 set_specifier_fallback (Vgutter_visible_p[BOTTOM_EDGE], fb); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1626 set_specifier_fallback (Vgutter_visible_p[LEFT_EDGE], fb); |
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1627 set_specifier_fallback (Vgutter_visible_p[RIGHT_EDGE], fb); |
428 | 1628 } |