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