Mercurial > hg > xemacs-beta
annotate src/gutter.c @ 5088:207dad9e74f7
Signal an error upon reading 1/0.
Thanks to Ben Wing for finding the problem. See xemacs-patches message with ID
<870180fe1003021239k77d81203xb7b6f94ce83208b3@mail.gmail.com> and also
<d7ba68911002240223u36bb87c2nf4ccfde06b5519cc@mail.gmail.com> in xemacs-beta.
| author | Jerry James <james@xemacs.org> |
|---|---|
| date | Tue, 02 Mar 2010 13:42:37 -0700 |
| parents | d372b17f63ce |
| children | 0ca81354c4c7 |
| 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 { | |
| 139 struct window | |
| 140 * bot = XWINDOW (frame_bottommost_window (f)); | |
| 141 /* The top and bottom gutters take precedence over the left and | |
| 142 right. */ | |
| 143 switch (pos) | |
| 144 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
145 case TOP_EDGE: |
| 428 | 146 *x = FRAME_LEFT_BORDER_END (f); |
| 147 *y = FRAME_TOP_BORDER_END (f); | |
| 442 | 148 *width = FRAME_RIGHT_BORDER_START (f) |
| 428 | 149 - FRAME_LEFT_BORDER_END (f); |
| 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: |
| 428 | 154 *x = FRAME_LEFT_BORDER_END (f); |
| 442 | 155 *y = WINDOW_BOTTOM (bot); |
| 156 *width = FRAME_RIGHT_BORDER_START (f) | |
| 428 | 157 - FRAME_LEFT_BORDER_END (f); |
| 158 *height = FRAME_BOTTOM_GUTTER_BOUNDS (f); | |
| 159 break; | |
| 160 | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
161 case LEFT_EDGE: |
| 428 | 162 *x = FRAME_LEFT_BORDER_END (f); |
| 442 | 163 *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); |
| 428 | 164 *width = FRAME_LEFT_GUTTER_BOUNDS (f); |
| 165 *height = WINDOW_BOTTOM (bot) | |
| 442 | 166 - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); |
| 428 | 167 break; |
| 442 | 168 |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
169 case RIGHT_EDGE: |
| 428 | 170 *x = FRAME_RIGHT_BORDER_START (f) |
| 171 - FRAME_RIGHT_GUTTER_BOUNDS (f); | |
| 442 | 172 *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); |
| 428 | 173 *width = FRAME_RIGHT_GUTTER_BOUNDS (f); |
| 174 *height = WINDOW_BOTTOM (bot) | |
| 442 | 175 - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); |
| 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), | |
| 324 FRAME_LEFT_BORDER_END (f), | |
| 325 FRAME_TOP_BORDER_END (f), | |
| 326 FRAME_RIGHT_BORDER_START (f) | |
| 327 - FRAME_LEFT_BORDER_END (f), | |
| 328 FRAME_BOTTOM_BORDER_START (f) | |
| 329 - FRAME_TOP_BORDER_END (f), | |
| 4186 | 330 ddla, 0, DEFAULT_INDEX); |
| 444 | 331 |
| 1318 | 332 /* Let GC happen again. */ |
| 333 exit_redisplay_critical_section (count); | |
| 444 | 334 |
| 1318 | 335 ret = make_int (calculate_gutter_size_from_display_lines (pos, ddla)); |
| 336 free_display_lines (ddla); | |
| 337 } | |
| 444 | 338 |
| 339 return ret; | |
| 340 } | |
| 341 | |
| 428 | 342 static void |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
343 output_gutter (struct frame *f, enum edge_pos pos, int force) |
| 428 | 344 { |
| 345 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); | |
| 346 struct device *d = XDEVICE (f->device); | |
| 347 struct window* w = XWINDOW (window); | |
| 348 int x, y, width, height, ypos; | |
| 440 | 349 int line, border_width; |
| 350 face_index findex; | |
| 428 | 351 display_line_dynarr* ddla, *cdla; |
| 442 | 352 struct display_line *dl = 0; |
| 428 | 353 int cdla_len; |
| 354 | |
| 440 | 355 if (!WINDOW_LIVE_P (w)) |
| 356 return; | |
| 357 | |
| 358 border_width = FRAME_GUTTER_BORDER_WIDTH (f, pos); | |
| 442 | 359 findex = get_builtin_face_cache_index (w, Vwidget_face); |
| 440 | 360 |
| 442 | 361 if (!f->current_display_lines[pos]) |
| 362 f->current_display_lines[pos] = Dynarr_new (display_line); | |
| 363 if (!f->desired_display_lines[pos]) | |
| 364 f->desired_display_lines[pos] = Dynarr_new (display_line); | |
| 428 | 365 |
| 442 | 366 ddla = f->desired_display_lines[pos]; |
| 367 cdla = f->current_display_lines[pos]; | |
| 428 | 368 cdla_len = Dynarr_length (cdla); |
| 369 | |
| 370 get_gutter_coords (f, pos, &x, &y, &width, &height); | |
| 371 /* generate some display lines */ | |
| 372 generate_displayable_area (w, WINDOW_GUTTER (w, pos), | |
| 373 x + border_width, y + border_width, | |
| 442 | 374 width - 2 * border_width, |
| 428 | 375 height - 2 * border_width, ddla, 0, findex); |
| 442 | 376 |
| 377 /* We only output the gutter if we think something of significance | |
| 378 has changed. This is, for example, because redisplay can cause | |
| 379 new face cache elements to get added causing compare_runes to | |
| 380 fail because the findex for a particular face has changed. */ | |
| 381 if (force || f->faces_changed || f->frame_changed || | |
| 382 f->gutter_changed || f->glyphs_changed || | |
| 383 f->size_changed || f->subwindows_changed || | |
| 384 w->windows_changed || f->windows_structure_changed || | |
| 385 cdla_len != Dynarr_length (ddla) || | |
| 386 (f->extents_changed && w->gutter_extent_modiff[pos])) | |
| 428 | 387 { |
| 442 | 388 #ifdef DEBUG_GUTTERS |
| 4186 | 389 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
|
390 pos == TOP_EDGE ? "TOP" : |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
391 pos == BOTTOM_EDGE ? "BOTTOM" : |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
392 pos == LEFT_EDGE ? "LEFT" : "RIGHT", |
| 446 | 393 width, height, x, y, force ? "force" : |
| 442 | 394 f->faces_changed ? "f->faces_changed" : |
| 395 f->frame_changed ? "f->frame_changed" : | |
| 396 f->gutter_changed ? "f->gutter_changed" : | |
| 397 f->glyphs_changed ? "f->glyphs_changed" : | |
| 398 f->size_changed ? "f->size_changed" : | |
| 399 f->subwindows_changed ? "f->subwindows_changed" : | |
| 400 w->windows_changed ? "w->windows_changed" : | |
| 401 f->windows_structure_changed ? "f->windows_structure_changed" : | |
| 402 cdla_len != Dynarr_length (ddla) ? "different display structures" : | |
| 403 f->extents_changed && w->gutter_extent_modiff[pos] ? | |
| 404 "f->extents_changed && w->gutter_extent_modiff[pos]" : "<null>"); | |
| 405 #endif | |
| 406 /* Output each line. */ | |
| 407 for (line = 0; line < Dynarr_length (ddla); line++) | |
| 408 { | |
| 409 output_display_line (w, cdla, ddla, line, -1, -1); | |
| 410 } | |
| 411 | |
| 412 /* If the number of display lines has shrunk, adjust. */ | |
| 413 if (cdla_len > Dynarr_length (ddla)) | |
| 414 { | |
| 5038 | 415 Dynarr_set_lengthr (cdla, Dynarr_length (ddla)); |
| 442 | 416 } |
| 417 | |
| 418 /* grab coordinates of last line and blank after it. */ | |
| 419 if (Dynarr_length (ddla) > 0) | |
| 420 { | |
|
4844
91b3d00e717f
Various cleanups for Dynarr code, from Unicode-internal ws
Ben Wing <ben@xemacs.org>
parents:
4186
diff
changeset
|
421 dl = Dynarr_lastp (ddla); |
| 442 | 422 ypos = dl->ypos + dl->descent - dl->clip; |
| 423 } | |
| 424 else | |
| 425 ypos = y; | |
| 428 | 426 |
| 442 | 427 redisplay_clear_region (window, findex, x + border_width , ypos, |
| 428 width - 2 * border_width, height - (ypos - y) - border_width); | |
| 429 /* If, for some reason, we have more to display than we have | |
| 4186 | 430 room for, and we are allowed to resize the gutter, then make |
| 431 sure this happens before the next time we try and | |
| 432 output. This can happen when face font sizes change. */ | |
| 433 if (dl && EQ (w->gutter_size[pos], Qautodetect) | |
| 444 | 434 && (dl->clip > 0 || |
| 4186 | 435 calculate_gutter_size_from_display_lines (pos, ddla) > |
| 444 | 436 WINDOW_GUTTER_SIZE_INTERNAL (w, pos))) |
| 442 | 437 { |
| 438 /* #### Ideally we would just mark the specifier as dirty | |
| 439 and everything else would "just work". Unfortunately we have | |
| 440 two problems with this. One is that the specifier cache | |
| 441 won't be recalculated unless the specifier code thinks the | |
| 442 cached value has actually changed, even though we have | |
| 443 marked the specifier as dirty. Additionally, although doing | |
| 444 this results in a gutter size change, we never seem to get | |
| 445 back into redisplay so that the frame size can be updated. I | |
| 446 think this is because we are already in redisplay and later | |
| 447 on the frame will be marked as clean. Thus we also have to | |
| 448 force a pending recalculation of the frame size. */ | |
| 449 w->gutter_size[pos] = Qnil; | |
| 450 Fset_specifier_dirty_flag (Vgutter_size[pos]); | |
| 451 update_gutter_geometry (f, pos); | |
| 452 } | |
| 453 | |
| 454 /* bevel the gutter area if so desired */ | |
| 455 if (border_width != 0) | |
| 456 { | |
| 457 MAYBE_DEVMETH (d, bevel_area, | |
| 458 (w, findex, x, y, width, height, border_width, | |
| 459 EDGE_ALL, EDGE_BEVEL_OUT)); | |
| 460 } | |
| 461 } | |
| 462 else | |
| 428 | 463 { |
| 442 | 464 /* Nothing of significance happened so sync the display line |
| 4186 | 465 structs. */ |
| 442 | 466 for (line = 0; line < Dynarr_length (ddla); line++) |
| 467 { | |
| 468 sync_display_line_structs (w, line, 1, cdla, ddla); | |
| 469 } | |
| 428 | 470 } |
| 471 | |
| 442 | 472 w->gutter_extent_modiff [pos] = 0; |
| 428 | 473 } |
| 474 | |
| 475 static void | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
476 clear_gutter (struct frame *f, enum edge_pos pos) |
| 428 | 477 { |
| 478 int x, y, width, height; | |
| 479 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); | |
| 480 face_index findex = get_builtin_face_cache_index (XWINDOW (window), | |
| 442 | 481 Vwidget_face); |
| 428 | 482 get_gutter_coords (f, pos, &x, &y, &width, &height); |
| 483 | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
484 f->gutter_was_visible[pos] = 0; |
| 428 | 485 |
| 486 redisplay_clear_region (window, findex, x, y, width, height); | |
| 487 } | |
| 488 | |
| 617 | 489 /* [[#### I don't currently believe that redisplay needs to mark the |
| 442 | 490 glyphs in its structures since these will always be referenced from |
| 491 somewhere else. However, I'm not sure enough to stake my life on it | |
| 617 | 492 at this point, so we do the safe thing.]] |
| 493 | |
| 494 ALWAYS mark everything. --ben */ | |
| 442 | 495 |
| 496 /* See the comment in image_instantiate_cache_result as to why marking | |
| 497 the glyph will also mark the image_instance. */ | |
| 498 void | |
| 617 | 499 mark_gutters (struct frame *f) |
| 442 | 500 { |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
501 enum edge_pos pos; |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
502 EDGE_POS_LOOP (pos) |
| 442 | 503 { |
| 504 if (f->current_display_lines[pos]) | |
| 505 mark_redisplay_structs (f->current_display_lines[pos]); | |
| 617 | 506 /* [[#### Do we really need to mark the desired lines?]] |
| 4186 | 507 ALWAYS mark everything. --ben */ |
| 442 | 508 if (f->desired_display_lines[pos]) |
| 509 mark_redisplay_structs (f->desired_display_lines[pos]); | |
| 510 } | |
| 511 } | |
| 512 | |
| 513 /* This is called by extent_changed_for_redisplay, so that redisplay | |
| 514 knows exactly what extents have changed. */ | |
| 515 void | |
| 516 gutter_extent_signal_changed_region_maybe (Lisp_Object obj, | |
| 2286 | 517 Charbpos UNUSED (start), |
| 518 Charbpos UNUSED (end)) | |
| 442 | 519 { |
| 520 /* #### Start and end are currently ignored but could be used by a | |
| 521 more optimal gutter redisplay. We currently loop over all frames | |
| 522 here, this could be optimized. */ | |
| 523 Lisp_Object frmcons, devcons, concons; | |
| 524 | |
| 525 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) | |
| 526 { | |
| 527 struct frame *f = XFRAME (XCAR (frmcons)); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
528 enum edge_pos pos; |
| 442 | 529 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); |
| 530 struct window* w = XWINDOW (window); | |
| 531 | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
532 EDGE_POS_LOOP (pos) |
| 442 | 533 { |
| 534 if (EQ (WINDOW_GUTTER (w, pos), obj)) | |
| 535 { | |
| 536 w->gutter_extent_modiff[pos]++; | |
| 537 } | |
| 538 } | |
| 539 } | |
| 540 } | |
| 541 | |
| 542 /* We have to change the gutter geometry separately to the gutter | |
| 543 update since it needs to occur outside of redisplay proper. */ | |
| 544 static void | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
545 update_gutter_geometry (struct frame *f, enum edge_pos pos) |
| 442 | 546 { |
| 547 /* If the gutter geometry has changed then re-layout the | |
| 548 frame. If we are in display there is almost no point in doing | |
| 549 anything else since the frame size changes will be delayed | |
| 550 until we are out of redisplay proper. */ | |
| 551 if (FRAME_GUTTER_BOUNDS (f, pos) != f->current_gutter_bounds[pos]) | |
| 552 { | |
| 553 int width, height; | |
| 5043 | 554 pixel_to_frame_unit_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), |
| 442 | 555 &width, &height); |
| 5043 | 556 change_frame_size (f, width, height, 0); |
| 905 | 557 MARK_FRAME_LAYOUT_CHANGED (f); |
| 442 | 558 } |
| 559 | |
| 560 /* Mark sizes as up-to-date. */ | |
| 561 f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); | |
| 562 } | |
| 563 | |
| 564 void | |
| 565 update_frame_gutter_geometry (struct frame *f) | |
| 566 { | |
| 4186 | 567 if (f->gutter_changed |
| 568 || f->frame_layout_changed | |
| 905 | 569 || f->windows_structure_changed) |
| 442 | 570 { |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
571 enum edge_pos pos; |
| 442 | 572 |
| 573 /* If the gutter geometry has changed then re-layout the | |
| 4186 | 574 frame. If we are in display there is almost no point in doing |
| 575 anything else since the frame size changes will be delayed | |
| 576 until we are out of redisplay proper. */ | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
577 EDGE_POS_LOOP (pos) |
| 442 | 578 { |
| 579 update_gutter_geometry (f, pos); | |
| 580 } | |
| 581 } | |
| 582 } | |
| 583 | |
| 428 | 584 void |
| 585 update_frame_gutters (struct frame *f) | |
| 586 { | |
| 442 | 587 if (f->faces_changed || f->frame_changed || |
| 588 f->gutter_changed || f->glyphs_changed || | |
| 589 f->size_changed || f->subwindows_changed || | |
| 590 f->windows_changed || f->windows_structure_changed || | |
| 905 | 591 f->extents_changed || f->frame_layout_changed) |
| 428 | 592 { |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
593 enum edge_pos pos; |
| 442 | 594 |
| 428 | 595 /* We don't actually care about these when outputting the gutter |
| 4186 | 596 so locally disable them. */ |
| 428 | 597 int local_clip_changed = f->clip_changed; |
| 598 int local_buffers_changed = f->buffers_changed; | |
| 599 f->clip_changed = 0; | |
| 600 f->buffers_changed = 0; | |
| 601 | |
| 602 /* and output */ | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
603 EDGE_POS_LOOP (pos) |
| 428 | 604 { |
| 605 if (FRAME_GUTTER_VISIBLE (f, pos)) | |
| 442 | 606 output_gutter (f, pos, 0); |
| 607 | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
608 else if (f->gutter_was_visible[pos]) |
| 442 | 609 clear_gutter (f, pos); |
| 428 | 610 } |
| 442 | 611 |
| 428 | 612 f->clip_changed = local_clip_changed; |
| 613 f->buffers_changed = local_buffers_changed; | |
| 614 f->gutter_changed = 0; | |
| 615 } | |
| 616 } | |
| 617 | |
| 618 void | |
| 619 reset_gutter_display_lines (struct frame* f) | |
| 620 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
621 enum edge_pos pos; |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
622 EDGE_POS_LOOP (pos) |
| 442 | 623 { |
| 624 if (f->current_display_lines[pos]) | |
| 625 Dynarr_reset (f->current_display_lines[pos]); | |
| 626 } | |
| 428 | 627 } |
| 628 | |
| 629 static void | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
630 redraw_exposed_gutter (struct frame *f, enum edge_pos pos, int x, int y, |
| 428 | 631 int width, int height) |
| 632 { | |
| 633 int g_x, g_y, g_width, g_height; | |
| 634 | |
| 635 get_gutter_coords (f, pos, &g_x, &g_y, &g_width, &g_height); | |
| 636 | |
| 637 if (((y + height) < g_y) || (y > (g_y + g_height)) || !height || !width || !g_height || !g_width) | |
| 638 return; | |
| 639 if (((x + width) < g_x) || (x > (g_x + g_width))) | |
| 640 return; | |
| 641 | |
| 442 | 642 #ifdef DEBUG_WIDGETS |
| 639 | 643 stderr_out ("redrawing gutter after expose %d+%d, %dx%d\n", |
| 442 | 644 x, y, width, height); |
| 645 #endif | |
| 428 | 646 /* #### optimize this - redrawing the whole gutter for every expose |
| 647 is very expensive. We reset the current display lines because if | |
| 648 they're being exposed they are no longer current. */ | |
| 649 reset_gutter_display_lines (f); | |
| 650 | |
| 651 /* Even if none of the gutter is in the area, the blank region at | |
| 652 the very least must be because the first thing we did is verify | |
| 653 that some portion of the gutter is in the exposed region. */ | |
| 442 | 654 output_gutter (f, pos, 1); |
| 428 | 655 } |
| 656 | |
| 657 void | |
| 658 redraw_exposed_gutters (struct frame *f, int x, int y, int width, | |
| 659 int height) | |
| 660 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
661 enum edge_pos pos; |
| 442 | 662 |
| 1318 | 663 /* 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
|
664 EDGE_POS_LOOP (pos) |
| 428 | 665 { |
| 666 if (FRAME_GUTTER_VISIBLE (f, pos)) | |
| 667 redraw_exposed_gutter (f, pos, x, y, width, height); | |
| 668 } | |
| 669 } | |
| 670 | |
| 671 void | |
| 672 free_frame_gutters (struct frame *f) | |
| 673 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
674 enum edge_pos pos; |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
675 EDGE_POS_LOOP (pos) |
| 428 | 676 { |
| 442 | 677 if (f->current_display_lines[pos]) |
| 678 { | |
| 679 free_display_lines (f->current_display_lines[pos]); | |
| 680 f->current_display_lines[pos] = 0; | |
| 681 } | |
| 682 if (f->desired_display_lines[pos]) | |
| 683 { | |
| 684 free_display_lines (f->desired_display_lines[pos]); | |
| 685 f->desired_display_lines[pos] = 0; | |
| 686 } | |
| 428 | 687 } |
| 688 } | |
| 689 | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
690 static enum edge_pos |
| 428 | 691 decode_gutter_position (Lisp_Object position) |
| 692 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
693 if (EQ (position, Qtop)) return TOP_EDGE; |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
694 if (EQ (position, Qbottom)) return BOTTOM_EDGE; |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
695 if (EQ (position, Qleft)) return LEFT_EDGE; |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
696 if (EQ (position, Qright)) return RIGHT_EDGE; |
| 563 | 697 invalid_constant ("Invalid gutter position", position); |
| 428 | 698 |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
699 RETURN_NOT_REACHED (TOP_EDGE); |
| 428 | 700 } |
| 701 | |
| 702 DEFUN ("set-default-gutter-position", Fset_default_gutter_position, 1, 1, 0, /* | |
| 703 Set the position that the `default-gutter' will be displayed at. | |
| 3025 | 704 Valid positions are `top', `bottom', `left' and `right'. |
| 428 | 705 See `default-gutter-position'. |
| 706 */ | |
| 707 (position)) | |
| 708 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
709 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
|
710 enum edge_pos new_ = decode_gutter_position (position); |
| 428 | 711 |
| 3025 | 712 if (cur != new_) |
| 428 | 713 { |
| 714 /* The following calls will automatically cause the dirty | |
| 715 flags to be set; we delay frame size changes to avoid | |
| 716 lots of frame flickering. */ | |
| 717 /* #### I think this should be GC protected. -sb */ | |
| 1318 | 718 int depth = begin_hold_frame_size_changes (); |
| 719 | |
| 428 | 720 set_specifier_fallback (Vgutter[cur], list1 (Fcons (Qnil, Qnil))); |
| 3025 | 721 set_specifier_fallback (Vgutter[new_], Vdefault_gutter); |
| 428 | 722 set_specifier_fallback (Vgutter_size[cur], list1 (Fcons (Qnil, Qzero))); |
| 3025 | 723 set_specifier_fallback (Vgutter_size[new_], |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
724 new_ == TOP_EDGE || new_ == BOTTOM_EDGE |
| 428 | 725 ? Vdefault_gutter_height |
| 726 : Vdefault_gutter_width); | |
| 727 set_specifier_fallback (Vgutter_border_width[cur], | |
| 728 list1 (Fcons (Qnil, Qzero))); | |
| 3025 | 729 set_specifier_fallback (Vgutter_border_width[new_], |
| 428 | 730 Vdefault_gutter_border_width); |
| 444 | 731 set_specifier_fallback (Vgutter_visible_p[cur], list1 (Fcons (Qnil, Qt))); |
| 3025 | 732 set_specifier_fallback (Vgutter_visible_p[new_], Vdefault_gutter_visible_p); |
| 1318 | 733 Vdefault_gutter_position = position; |
| 442 | 734 |
| 1318 | 735 unbind_to (depth); |
| 428 | 736 } |
| 737 | |
| 442 | 738 run_hook (Qdefault_gutter_position_changed_hook); |
| 739 | |
| 428 | 740 return position; |
| 741 } | |
| 742 | |
| 743 DEFUN ("default-gutter-position", Fdefault_gutter_position, 0, 0, 0, /* | |
| 744 Return the position that the `default-gutter' will be displayed at. | |
| 745 The `default-gutter' will only be displayed here if the corresponding | |
| 746 position-specific gutter specifier does not provide a value. | |
| 747 */ | |
| 748 ()) | |
| 749 { | |
| 750 return Vdefault_gutter_position; | |
| 751 } | |
| 752 | |
| 753 DEFUN ("gutter-pixel-width", Fgutter_pixel_width, 0, 2, 0, /* | |
| 754 Return the pixel width of the gutter at POS in LOCALE. | |
| 755 POS defaults to the default gutter position. LOCALE defaults to | |
| 756 the current window. | |
| 757 */ | |
| 758 (pos, locale)) | |
| 759 { | |
| 760 int x, y, width, height; | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
761 enum edge_pos p = TOP_EDGE; |
| 428 | 762 struct frame *f = decode_frame (FW_FRAME (locale)); |
| 763 | |
| 764 if (NILP (pos)) | |
| 765 pos = Vdefault_gutter_position; | |
| 766 p = decode_gutter_position (pos); | |
| 767 | |
| 768 get_gutter_coords (f, p, &x, &y, &width, &height); | |
| 769 width -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2); | |
| 770 | |
| 771 return make_int (width); | |
| 772 } | |
| 773 | |
| 774 DEFUN ("gutter-pixel-height", Fgutter_pixel_height, 0, 2, 0, /* | |
| 775 Return the pixel height of the gutter at POS in LOCALE. | |
| 776 POS defaults to the default gutter position. LOCALE defaults to | |
| 777 the current window. | |
| 778 */ | |
| 779 (pos, locale)) | |
| 780 { | |
| 781 int x, y, width, height; | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
782 enum edge_pos p = TOP_EDGE; |
| 428 | 783 struct frame *f = decode_frame (FW_FRAME (locale)); |
| 784 | |
| 785 if (NILP (pos)) | |
| 786 pos = Vdefault_gutter_position; | |
| 787 p = decode_gutter_position (pos); | |
| 788 | |
| 789 get_gutter_coords (f, p, &x, &y, &width, &height); | |
| 790 height -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2); | |
| 791 | |
| 792 return make_int (height); | |
| 793 } | |
| 794 | |
| 795 DEFINE_SPECIFIER_TYPE (gutter); | |
| 796 | |
| 797 static void | |
| 2286 | 798 gutter_after_change (Lisp_Object UNUSED (specifier), |
| 799 Lisp_Object UNUSED (locale)) | |
| 428 | 800 { |
| 801 MARK_GUTTER_CHANGED; | |
| 802 } | |
| 803 | |
| 804 static void | |
| 805 gutter_validate (Lisp_Object instantiator) | |
| 806 { | |
| 807 if (NILP (instantiator)) | |
| 808 return; | |
| 809 | |
| 442 | 810 /* Must be a string or a plist. */ |
| 811 if (!STRINGP (instantiator) && NILP (Fvalid_plist_p (instantiator))) | |
| 563 | 812 sferror ("Gutter spec must be string, plist or nil", instantiator); |
| 442 | 813 |
| 428 | 814 if (!STRINGP (instantiator)) |
| 442 | 815 { |
| 816 Lisp_Object rest; | |
| 817 | |
| 818 for (rest = instantiator; !NILP (rest); rest = XCDR (XCDR (rest))) | |
| 819 { | |
| 820 if (!SYMBOLP (XCAR (rest)) | |
| 821 || !STRINGP (XCAR (XCDR (rest)))) | |
| 563 | 822 sferror ("Gutter plist spec must contain strings", instantiator); |
| 442 | 823 } |
| 824 } | |
| 428 | 825 } |
| 826 | |
| 827 DEFUN ("gutter-specifier-p", Fgutter_specifier_p, 1, 1, 0, /* | |
| 828 Return non-nil if OBJECT is a gutter specifier. | |
| 829 | |
| 442 | 830 See `make-gutter-specifier' for a description of possible gutter |
| 831 instantiators. | |
| 428 | 832 */ |
| 833 (object)) | |
| 834 { | |
| 835 return GUTTER_SPECIFIERP (object) ? Qt : Qnil; | |
| 836 } | |
| 837 | |
| 838 | |
| 839 /* | |
| 840 Helper for invalidating the real specifier when default | |
| 841 specifier caching changes | |
| 842 */ | |
| 843 static void | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
844 recompute_overlaying_specifier (Lisp_Object real_one[NUM_EDGES]) |
| 428 | 845 { |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
846 enum edge_pos pos = decode_gutter_position (Vdefault_gutter_position); |
| 428 | 847 Fset_specifier_dirty_flag (real_one[pos]); |
| 848 } | |
| 849 | |
| 1318 | 850 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
|
851 Lisp_Object oldval, enum edge_pos pos); |
| 1318 | 852 |
| 853 static void | |
| 854 gutter_specs_changed_1 (Lisp_Object arg) | |
| 855 { | |
| 856 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
|
857 X3RD (arg), (enum edge_pos) XINT (X4TH (arg))); |
| 1318 | 858 free_list (arg); |
| 859 } | |
| 860 | |
| 428 | 861 static void |
| 862 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
|
863 Lisp_Object oldval, enum edge_pos pos) |
| 428 | 864 { |
| 1318 | 865 if (in_display) |
| 866 register_post_redisplay_action (gutter_specs_changed_1, | |
| 867 list4 (specifier, wrap_window (w), | |
| 868 oldval, make_int (pos))); | |
| 869 else | |
| 870 { | |
| 871 w->real_gutter[pos] = construct_window_gutter_spec (w, pos); | |
| 872 w->real_gutter_size[pos] = w->gutter_size[pos]; | |
| 442 | 873 |
| 1318 | 874 if (EQ (w->real_gutter_size[pos], Qautodetect) |
| 875 && !NILP (w->gutter_visible_p[pos])) | |
| 876 { | |
| 877 w->real_gutter_size [pos] = calculate_gutter_size (w, pos); | |
| 878 } | |
| 879 MARK_GUTTER_CHANGED; | |
| 880 MARK_MODELINE_CHANGED; | |
| 881 MARK_WINDOWS_CHANGED (w); | |
| 428 | 882 } |
| 883 } | |
| 884 | |
| 442 | 885 /* We define all of these so we can access which actual gutter changed. */ |
| 886 static void | |
| 887 top_gutter_specs_changed (Lisp_Object specifier, struct window *w, | |
| 888 Lisp_Object oldval) | |
| 889 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
890 gutter_specs_changed (specifier, w, oldval, TOP_EDGE); |
| 442 | 891 } |
| 892 | |
| 893 static void | |
| 894 bottom_gutter_specs_changed (Lisp_Object specifier, struct window *w, | |
| 895 Lisp_Object oldval) | |
| 896 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
897 gutter_specs_changed (specifier, w, oldval, BOTTOM_EDGE); |
| 442 | 898 } |
| 899 | |
| 900 static void | |
| 901 left_gutter_specs_changed (Lisp_Object specifier, struct window *w, | |
| 902 Lisp_Object oldval) | |
| 903 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
904 gutter_specs_changed (specifier, w, oldval, LEFT_EDGE); |
| 442 | 905 } |
| 906 | |
| 907 static void | |
| 908 right_gutter_specs_changed (Lisp_Object specifier, struct window *w, | |
| 909 Lisp_Object oldval) | |
| 910 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
911 gutter_specs_changed (specifier, w, oldval, RIGHT_EDGE); |
| 442 | 912 } |
| 913 | |
| 428 | 914 static void |
| 2286 | 915 default_gutter_specs_changed (Lisp_Object UNUSED (specifier), |
| 916 struct window *UNUSED (w), | |
| 917 Lisp_Object UNUSED (oldval)) | |
| 428 | 918 { |
| 919 recompute_overlaying_specifier (Vgutter); | |
| 920 } | |
| 921 | |
| 1318 | 922 static void gutter_geometry_changed_in_window (Lisp_Object specifier, |
| 923 struct window *w, | |
| 924 Lisp_Object oldval); | |
| 925 | |
| 926 static void | |
| 927 gutter_geometry_changed_in_window_1 (Lisp_Object arg) | |
| 928 { | |
| 929 gutter_geometry_changed_in_window (X1ST (arg), XWINDOW (X2ND (arg)), | |
| 930 X3RD (arg)); | |
| 931 free_list (arg); | |
| 932 } | |
| 933 | |
| 428 | 934 static void |
| 935 gutter_geometry_changed_in_window (Lisp_Object specifier, struct window *w, | |
| 936 Lisp_Object oldval) | |
| 937 { | |
| 1318 | 938 if (in_display) |
| 939 register_post_redisplay_action (gutter_geometry_changed_in_window_1, | |
| 940 list3 (specifier, wrap_window (w), | |
| 941 oldval)); | |
| 942 else | |
| 428 | 943 { |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
944 enum edge_pos pos; |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
945 EDGE_POS_LOOP (pos) |
| 428 | 946 { |
| 1318 | 947 w->real_gutter_size[pos] = w->gutter_size[pos]; |
| 948 if (EQ (w->real_gutter_size[pos], Qautodetect) | |
| 949 && !NILP (w->gutter_visible_p[pos])) | |
| 950 { | |
| 951 w->real_gutter_size [pos] = calculate_gutter_size (w, pos); | |
| 952 } | |
| 428 | 953 } |
| 442 | 954 |
| 1318 | 955 MARK_GUTTER_CHANGED; |
| 956 MARK_MODELINE_CHANGED; | |
| 957 MARK_WINDOWS_CHANGED (w); | |
| 958 } | |
| 428 | 959 } |
| 960 | |
| 961 static void | |
| 2286 | 962 default_gutter_size_changed_in_window (Lisp_Object UNUSED (specifier), |
| 963 struct window *UNUSED (w), | |
| 964 Lisp_Object UNUSED (oldval)) | |
| 428 | 965 { |
| 966 recompute_overlaying_specifier (Vgutter_size); | |
| 967 } | |
| 968 | |
| 969 static void | |
| 2286 | 970 default_gutter_border_width_changed_in_window (Lisp_Object UNUSED (specifier), |
| 971 struct window *UNUSED (w), | |
| 972 Lisp_Object UNUSED (oldval)) | |
| 428 | 973 { |
| 974 recompute_overlaying_specifier (Vgutter_border_width); | |
| 975 } | |
| 976 | |
| 977 static void | |
| 2286 | 978 default_gutter_visible_p_changed_in_window (Lisp_Object UNUSED (specifier), |
| 979 struct window *UNUSED (w), | |
| 980 Lisp_Object UNUSED (oldval)) | |
| 428 | 981 { |
| 982 recompute_overlaying_specifier (Vgutter_visible_p); | |
| 442 | 983 /* Need to reconstruct the gutter specifier as it is affected by the |
| 984 visibility. */ | |
| 985 recompute_overlaying_specifier (Vgutter); | |
| 428 | 986 } |
| 987 | |
| 988 | |
| 989 DECLARE_SPECIFIER_TYPE (gutter_size); | |
| 990 #define GUTTER_SIZE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_size) | |
| 991 DEFINE_SPECIFIER_TYPE (gutter_size); | |
| 992 | |
| 993 static void | |
| 994 gutter_size_validate (Lisp_Object instantiator) | |
| 995 { | |
| 996 if (NILP (instantiator)) | |
| 997 return; | |
| 998 | |
| 999 if (!INTP (instantiator) && !EQ (instantiator, Qautodetect)) | |
| 3025 | 1000 invalid_argument ("Gutter size must be an integer or `autodetect'", instantiator); |
| 428 | 1001 } |
| 1002 | |
| 1003 DEFUN ("gutter-size-specifier-p", Fgutter_size_specifier_p, 1, 1, 0, /* | |
| 1004 Return non-nil if OBJECT is a gutter-size specifier. | |
| 442 | 1005 |
| 1006 See `make-gutter-size-specifier' for a description of possible gutter-size | |
| 1007 instantiators. | |
| 428 | 1008 */ |
| 1009 (object)) | |
| 1010 { | |
| 1011 return GUTTER_SIZE_SPECIFIERP (object) ? Qt : Qnil; | |
| 1012 } | |
| 1013 | |
| 442 | 1014 DECLARE_SPECIFIER_TYPE (gutter_visible); |
| 1015 #define GUTTER_VISIBLE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_visible) | |
| 1016 DEFINE_SPECIFIER_TYPE (gutter_visible); | |
| 1017 | |
| 1018 static void | |
| 1019 gutter_visible_validate (Lisp_Object instantiator) | |
| 1020 { | |
| 1021 if (NILP (instantiator)) | |
| 1022 return; | |
| 1023 | |
| 1024 if (!NILP (instantiator) && !EQ (instantiator, Qt) && !CONSP (instantiator)) | |
| 563 | 1025 invalid_argument ("Gutter visibility must be a boolean or list of symbols", |
| 442 | 1026 instantiator); |
| 1027 | |
| 1028 if (CONSP (instantiator)) | |
| 1029 { | |
| 2367 | 1030 EXTERNAL_LIST_LOOP_2 (elt, instantiator) |
| 442 | 1031 { |
| 2367 | 1032 if (!SYMBOLP (elt)) |
| 563 | 1033 invalid_argument ("Gutter visibility must be a boolean or list of symbols", |
| 442 | 1034 instantiator); |
| 1035 } | |
| 1036 } | |
| 1037 } | |
| 1038 | |
| 1039 DEFUN ("gutter-visible-specifier-p", Fgutter_visible_specifier_p, 1, 1, 0, /* | |
| 1040 Return non-nil if OBJECT is a gutter-visible specifier. | |
| 1041 | |
| 1042 See `make-gutter-visible-specifier' for a description of possible | |
| 1043 gutter-visible instantiators. | |
| 1044 */ | |
| 1045 (object)) | |
| 1046 { | |
| 1047 return GUTTER_VISIBLE_SPECIFIERP (object) ? Qt : Qnil; | |
| 1048 } | |
| 1049 | |
| 428 | 1050 DEFUN ("redisplay-gutter-area", Fredisplay_gutter_area, 0, 0, 0, /* |
| 1051 Ensure that all gutters are correctly showing their gutter specifier. | |
| 1052 */ | |
| 1053 ()) | |
| 1054 { | |
| 1055 Lisp_Object devcons, concons; | |
| 1056 | |
| 1318 | 1057 /* Can't reentrantly enter redisplay */ |
| 1058 if (in_display) | |
| 1059 return Qnil; | |
| 1060 | |
| 428 | 1061 DEVICE_LOOP_NO_BREAK (devcons, concons) |
| 1062 { | |
| 1063 struct device *d = XDEVICE (XCAR (devcons)); | |
| 1064 Lisp_Object frmcons; | |
| 1065 | |
| 1066 DEVICE_FRAME_LOOP (frmcons, d) | |
| 1067 { | |
| 1068 struct frame *f = XFRAME (XCAR (frmcons)); | |
| 1069 | |
| 442 | 1070 MAYBE_DEVMETH (d, frame_output_begin, (f)); |
| 1071 | |
| 1072 /* Sequence is quite important here. We not only want to | |
| 1073 redisplay the gutter area but we also want to flush any | |
| 1074 frame size changes out so that the gutter redisplay happens | |
| 1075 in a kosha environment. | |
| 1076 | |
| 1077 This is not only so that things look right but so that | |
| 1078 glyph redisplay optimization kicks in, by default display | |
| 1079 lines will be completely re-output if | |
| 1080 f->windows_structure_changed is 1, and this is true if | |
| 1081 frame size changes haven't been flushed out. Once frame | |
| 1082 size changes have been flushed out we then need to | |
| 1083 redisplay the frame in order to flush out pending window | |
| 1084 size changes. */ | |
| 1085 update_frame_gutter_geometry (f); | |
| 428 | 1086 |
| 442 | 1087 if (f->windows_structure_changed) |
| 1088 redisplay_frame (f, 1); | |
| 1089 else if (FRAME_REPAINT_P (f)) | |
| 1090 { | |
| 853 | 1091 int depth; |
| 1092 | |
| 442 | 1093 /* We have to be "in display" when we output the gutter |
| 4186 | 1094 - make it so. */ |
| 853 | 1095 depth = enter_redisplay_critical_section (); |
| 442 | 1096 update_frame_gutters (f); |
| 853 | 1097 exit_redisplay_critical_section (depth); |
| 442 | 1098 } |
| 1099 | |
| 1100 MAYBE_DEVMETH (d, frame_output_end, (f)); | |
| 1101 } | |
| 1102 | |
| 1103 d->gutter_changed = 0; | |
| 428 | 1104 } |
| 1105 | |
| 442 | 1106 /* This is so that further changes to the gutters will trigger redisplay. */ |
| 1107 gutter_changed_set = 0; | |
| 1108 gutter_changed = 0; | |
| 1109 | |
| 428 | 1110 return Qnil; |
| 1111 } | |
| 1112 | |
| 1113 void | |
| 1114 init_frame_gutters (struct frame *f) | |
| 1115 { | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1116 enum edge_pos pos; |
| 428 | 1117 struct window* w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); |
| 1118 /* We are here as far in frame creation so cached specifiers are | |
| 1119 already recomputed, and possibly modified by resource | |
| 1120 initialization. We need to recalculate autodetected gutters. */ | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1121 EDGE_POS_LOOP (pos) |
| 428 | 1122 { |
| 442 | 1123 w->real_gutter[pos] = construct_window_gutter_spec (w, pos); |
| 428 | 1124 w->real_gutter_size[pos] = w->gutter_size[pos]; |
| 1125 if (EQ (w->gutter_size[pos], Qautodetect) | |
| 1126 && !NILP (w->gutter_visible_p[pos])) | |
| 1127 { | |
| 1128 w->real_gutter_size [pos] = calculate_gutter_size (w, pos); | |
| 1129 MARK_GUTTER_CHANGED; | |
| 1130 MARK_WINDOWS_CHANGED (w); | |
| 1131 } | |
| 1132 } | |
| 442 | 1133 |
| 1134 /* 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
|
1135 EDGE_POS_LOOP (pos) |
| 442 | 1136 { |
| 1137 f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); | |
| 1138 } | |
| 428 | 1139 } |
| 1140 | |
| 1141 void | |
| 1142 syms_of_gutter (void) | |
| 1143 { | |
| 1144 DEFSUBR (Fgutter_specifier_p); | |
| 1145 DEFSUBR (Fgutter_size_specifier_p); | |
| 442 | 1146 DEFSUBR (Fgutter_visible_specifier_p); |
| 428 | 1147 DEFSUBR (Fset_default_gutter_position); |
| 1148 DEFSUBR (Fdefault_gutter_position); | |
| 1149 DEFSUBR (Fgutter_pixel_height); | |
| 1150 DEFSUBR (Fgutter_pixel_width); | |
| 1151 DEFSUBR (Fredisplay_gutter_area); | |
| 1152 | |
| 563 | 1153 DEFSYMBOL (Qgutter_size); |
| 1154 DEFSYMBOL (Qgutter_visible); | |
| 1155 DEFSYMBOL (Qdefault_gutter_position_changed_hook); | |
| 428 | 1156 } |
| 1157 | |
| 1158 void | |
| 1159 vars_of_gutter (void) | |
| 1160 { | |
| 1161 staticpro (&Vdefault_gutter_position); | |
| 1162 Vdefault_gutter_position = Qtop; | |
| 1163 | |
| 1164 Fprovide (Qgutter); | |
| 1165 } | |
| 1166 | |
| 1167 void | |
| 1168 specifier_type_create_gutter (void) | |
| 1169 { | |
| 1170 INITIALIZE_SPECIFIER_TYPE (gutter, "gutter", "gutter-specifier-p"); | |
| 1171 SPECIFIER_HAS_METHOD (gutter, validate); | |
| 1172 SPECIFIER_HAS_METHOD (gutter, after_change); | |
| 1173 | |
| 1174 INITIALIZE_SPECIFIER_TYPE (gutter_size, "gutter-size", "gutter-size-specifier-p"); | |
| 442 | 1175 SPECIFIER_HAS_METHOD (gutter_size, validate); |
| 428 | 1176 |
| 442 | 1177 INITIALIZE_SPECIFIER_TYPE (gutter_visible, "gutter-visible", "gutter-visible-specifier-p"); |
| 1178 SPECIFIER_HAS_METHOD (gutter_visible, validate); | |
| 428 | 1179 } |
| 1180 | |
| 1181 void | |
| 1182 reinit_specifier_type_create_gutter (void) | |
| 1183 { | |
| 1184 REINITIALIZE_SPECIFIER_TYPE (gutter); | |
| 1185 REINITIALIZE_SPECIFIER_TYPE (gutter_size); | |
| 442 | 1186 REINITIALIZE_SPECIFIER_TYPE (gutter_visible); |
| 428 | 1187 } |
| 1188 | |
| 1189 void | |
| 1190 specifier_vars_of_gutter (void) | |
| 1191 { | |
| 1192 Lisp_Object fb; | |
| 1193 | |
| 1194 DEFVAR_SPECIFIER ("default-gutter", &Vdefault_gutter /* | |
| 1195 Specifier for a fallback gutter. | |
| 1196 Use `set-specifier' to change this. | |
| 1197 | |
| 1198 The position of this gutter is specified in the function | |
| 1199 `default-gutter-position'. If the corresponding position-specific | |
| 3025 | 1200 gutter (e.g. `top-gutter' if `default-gutter-position' is `top') |
| 428 | 1201 does not specify a gutter in a particular domain (usually a window), |
| 1202 then the value of `default-gutter' in that domain, if any, will be | |
| 1203 used instead. | |
| 1204 | |
| 1205 Note that the gutter at any particular position will not be | |
| 1206 displayed unless its visibility flag is true and its thickness | |
| 1207 \(width or height, depending on orientation) is non-zero. The | |
| 1208 visibility is controlled by the specifiers `top-gutter-visible-p', | |
| 1209 `bottom-gutter-visible-p', `left-gutter-visible-p', and | |
| 1210 `right-gutter-visible-p', and the thickness is controlled by the | |
| 1211 specifiers `top-gutter-height', `bottom-gutter-height', | |
| 1212 `left-gutter-width', and `right-gutter-width'. | |
| 1213 | |
| 1214 Note that one of the four visibility specifiers inherits from | |
| 1215 `default-gutter-visibility' and one of the four thickness | |
| 1216 specifiers inherits from either `default-gutter-width' or | |
| 1217 `default-gutter-height' (depending on orientation), just | |
| 1218 like for the gutter description specifiers (e.g. `top-gutter') | |
| 1219 mentioned above. | |
| 1220 | |
| 1221 Therefore, if you are setting `default-gutter', you should control | |
| 1222 the visibility and thickness using `default-gutter-visible-p', | |
| 1223 `default-gutter-width', and `default-gutter-height', rather than | |
| 1224 using position-specific specifiers. That way, you will get sane | |
| 1225 behavior if the user changes the default gutter position. | |
| 1226 | |
| 442 | 1227 The gutter value should be a string, a property list of strings or |
| 1228 nil. You can attach extents and glyphs to the string and hence display | |
| 1229 glyphs and text in other fonts in the gutter area. If the gutter value | |
| 1230 is a property list then the strings will be concatenated together | |
| 1231 before being displayed. */ ); | |
| 428 | 1232 |
| 1233 Vdefault_gutter = Fmake_specifier (Qgutter); | |
| 1234 /* #### It would be even nicer if the specifier caching | |
| 1235 automatically knew about specifier fallbacks, so we didn't | |
| 1236 have to do it ourselves. */ | |
| 1237 set_specifier_caching (Vdefault_gutter, | |
| 438 | 1238 offsetof (struct window, default_gutter), |
| 428 | 1239 default_gutter_specs_changed, |
| 444 | 1240 0, 0, 1); |
| 428 | 1241 |
| 1242 DEFVAR_SPECIFIER ("top-gutter", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1243 &Vgutter[TOP_EDGE] /* |
| 428 | 1244 Specifier for the gutter at the top of the frame. |
| 1245 Use `set-specifier' to change this. | |
| 1246 See `default-gutter' for a description of a valid gutter instantiator. | |
| 1247 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1248 Vgutter[TOP_EDGE] = Fmake_specifier (Qgutter); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1249 set_specifier_caching (Vgutter[TOP_EDGE], |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1250 offsetof (struct window, gutter[TOP_EDGE]), |
| 442 | 1251 top_gutter_specs_changed, |
| 444 | 1252 0, 0, 1); |
| 428 | 1253 |
| 1254 DEFVAR_SPECIFIER ("bottom-gutter", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1255 &Vgutter[BOTTOM_EDGE] /* |
| 428 | 1256 Specifier for the gutter at the bottom of the frame. |
| 1257 Use `set-specifier' to change this. | |
| 1258 See `default-gutter' for a description of a valid gutter instantiator. | |
| 1259 | |
| 1260 Note that, unless the `default-gutter-position' is `bottom', by | |
| 1261 default the height of the bottom gutter (controlled by | |
| 1262 `bottom-gutter-height') is 0; thus, a bottom gutter will not be | |
| 1263 displayed even if you provide a value for `bottom-gutter'. | |
| 1264 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1265 Vgutter[BOTTOM_EDGE] = Fmake_specifier (Qgutter); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1266 set_specifier_caching (Vgutter[BOTTOM_EDGE], |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1267 offsetof (struct window, gutter[BOTTOM_EDGE]), |
| 442 | 1268 bottom_gutter_specs_changed, |
| 444 | 1269 0, 0, 1); |
| 428 | 1270 |
| 1271 DEFVAR_SPECIFIER ("left-gutter", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1272 &Vgutter[LEFT_EDGE] /* |
| 428 | 1273 Specifier for the gutter at the left edge of the frame. |
| 1274 Use `set-specifier' to change this. | |
| 1275 See `default-gutter' for a description of a valid gutter instantiator. | |
| 1276 | |
| 1277 Note that, unless the `default-gutter-position' is `left', by | |
| 1278 default the height of the left gutter (controlled by | |
| 1279 `left-gutter-width') is 0; thus, a left gutter will not be | |
| 1280 displayed even if you provide a value for `left-gutter'. | |
| 1281 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1282 Vgutter[LEFT_EDGE] = Fmake_specifier (Qgutter); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1283 set_specifier_caching (Vgutter[LEFT_EDGE], |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1284 offsetof (struct window, gutter[LEFT_EDGE]), |
| 442 | 1285 left_gutter_specs_changed, |
| 444 | 1286 0, 0, 1); |
| 428 | 1287 |
| 1288 DEFVAR_SPECIFIER ("right-gutter", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1289 &Vgutter[RIGHT_EDGE] /* |
| 428 | 1290 Specifier for the gutter at the right edge of the frame. |
| 1291 Use `set-specifier' to change this. | |
| 1292 See `default-gutter' for a description of a valid gutter instantiator. | |
| 1293 | |
| 1294 Note that, unless the `default-gutter-position' is `right', by | |
| 1295 default the height of the right gutter (controlled by | |
| 1296 `right-gutter-width') is 0; thus, a right gutter will not be | |
| 1297 displayed even if you provide a value for `right-gutter'. | |
| 1298 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1299 Vgutter[RIGHT_EDGE] = Fmake_specifier (Qgutter); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1300 set_specifier_caching (Vgutter[RIGHT_EDGE], |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1301 offsetof (struct window, gutter[RIGHT_EDGE]), |
| 442 | 1302 right_gutter_specs_changed, |
| 444 | 1303 0, 0, 1); |
| 428 | 1304 |
| 1305 /* initially, top inherits from default; this can be | |
| 1306 changed with `set-default-gutter-position'. */ | |
| 1307 fb = list1 (Fcons (Qnil, Qnil)); | |
| 1308 set_specifier_fallback (Vdefault_gutter, fb); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1309 set_specifier_fallback (Vgutter[TOP_EDGE], Vdefault_gutter); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1310 set_specifier_fallback (Vgutter[BOTTOM_EDGE], fb); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1311 set_specifier_fallback (Vgutter[LEFT_EDGE], fb); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1312 set_specifier_fallback (Vgutter[RIGHT_EDGE], fb); |
| 428 | 1313 |
| 1314 DEFVAR_SPECIFIER ("default-gutter-height", &Vdefault_gutter_height /* | |
| 1315 *Height of the default gutter, if it's oriented horizontally. | |
| 1316 This is a specifier; use `set-specifier' to change it. | |
| 1317 | |
| 1318 The position of the default gutter is specified by the function | |
| 1319 `set-default-gutter-position'. If the corresponding position-specific | |
| 1320 gutter thickness specifier (e.g. `top-gutter-height' if | |
| 3025 | 1321 `default-gutter-position' is `top') does not specify a thickness in a |
| 428 | 1322 particular domain (a window or a frame), then the value of |
| 1323 `default-gutter-height' or `default-gutter-width' (depending on the | |
| 1324 gutter orientation) in that domain, if any, will be used instead. | |
| 1325 | |
| 1326 Note that `default-gutter-height' is only used when | |
| 3025 | 1327 `default-gutter-position' is `top' or `bottom', and `default-gutter-width' |
| 1328 is only used when `default-gutter-position' is `left' or `right'. | |
| 428 | 1329 |
| 1330 Note that all of the position-specific gutter thickness specifiers | |
| 1331 have a fallback value of zero when they do not correspond to the | |
| 1332 default gutter. Therefore, you will have to set a non-zero thickness | |
| 1333 value if you want a position-specific gutter to be displayed. | |
| 1334 | |
| 3025 | 1335 If you set the height to `autodetect' the size of the gutter will be |
| 428 | 1336 calculated to be large enough to hold the contents of the gutter. This |
| 1337 is the default. | |
| 1338 */ ); | |
| 1339 Vdefault_gutter_height = Fmake_specifier (Qgutter_size); | |
| 1340 set_specifier_caching (Vdefault_gutter_height, | |
| 438 | 1341 offsetof (struct window, default_gutter_height), |
| 428 | 1342 default_gutter_size_changed_in_window, |
| 444 | 1343 0, 0, 1); |
| 428 | 1344 |
| 1345 DEFVAR_SPECIFIER ("default-gutter-width", &Vdefault_gutter_width /* | |
| 1346 *Width of the default gutter, if it's oriented vertically. | |
| 1347 This is a specifier; use `set-specifier' to change it. | |
| 1348 | |
| 1349 See `default-gutter-height' for more information. | |
| 1350 */ ); | |
| 444 | 1351 Vdefault_gutter_width = Fmake_specifier (Qgutter_size); |
| 428 | 1352 set_specifier_caching (Vdefault_gutter_width, |
| 438 | 1353 offsetof (struct window, default_gutter_width), |
| 428 | 1354 default_gutter_size_changed_in_window, |
| 444 | 1355 0, 0, 1); |
| 428 | 1356 |
| 1357 DEFVAR_SPECIFIER ("top-gutter-height", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1358 &Vgutter_size[TOP_EDGE] /* |
| 428 | 1359 *Height of the top gutter. |
| 1360 This is a specifier; use `set-specifier' to change it. | |
| 1361 | |
| 1362 See `default-gutter-height' for more information. | |
| 1363 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1364 Vgutter_size[TOP_EDGE] = Fmake_specifier (Qgutter_size); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1365 set_specifier_caching (Vgutter_size[TOP_EDGE], |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1366 offsetof (struct window, gutter_size[TOP_EDGE]), |
| 444 | 1367 gutter_geometry_changed_in_window, 0, 0, 1); |
| 428 | 1368 |
| 1369 DEFVAR_SPECIFIER ("bottom-gutter-height", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1370 &Vgutter_size[BOTTOM_EDGE] /* |
| 428 | 1371 *Height of the bottom gutter. |
| 1372 This is a specifier; use `set-specifier' to change it. | |
| 1373 | |
| 1374 See `default-gutter-height' for more information. | |
| 1375 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1376 Vgutter_size[BOTTOM_EDGE] = Fmake_specifier (Qgutter_size); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1377 set_specifier_caching (Vgutter_size[BOTTOM_EDGE], |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1378 offsetof (struct window, gutter_size[BOTTOM_EDGE]), |
| 444 | 1379 gutter_geometry_changed_in_window, 0, 0, 1); |
| 428 | 1380 |
| 1381 DEFVAR_SPECIFIER ("left-gutter-width", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1382 &Vgutter_size[LEFT_EDGE] /* |
| 428 | 1383 *Width of left gutter. |
| 1384 This is a specifier; use `set-specifier' to change it. | |
| 1385 | |
| 1386 See `default-gutter-height' for more information. | |
| 1387 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1388 Vgutter_size[LEFT_EDGE] = Fmake_specifier (Qgutter_size); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1389 set_specifier_caching (Vgutter_size[LEFT_EDGE], |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1390 offsetof (struct window, gutter_size[LEFT_EDGE]), |
| 444 | 1391 gutter_geometry_changed_in_window, 0, 0, 1); |
| 428 | 1392 |
| 1393 DEFVAR_SPECIFIER ("right-gutter-width", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1394 &Vgutter_size[RIGHT_EDGE] /* |
| 428 | 1395 *Width of right gutter. |
| 1396 This is a specifier; use `set-specifier' to change it. | |
| 1397 | |
| 1398 See `default-gutter-height' for more information. | |
| 1399 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1400 Vgutter_size[RIGHT_EDGE] = Fmake_specifier (Qgutter_size); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1401 set_specifier_caching (Vgutter_size[RIGHT_EDGE], |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1402 offsetof (struct window, gutter_size[RIGHT_EDGE]), |
| 444 | 1403 gutter_geometry_changed_in_window, 0, 0, 1); |
| 428 | 1404 |
| 1405 fb = Qnil; | |
| 1406 #ifdef HAVE_TTY | |
| 1407 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); | |
| 1408 #endif | |
| 462 | 1409 #ifdef HAVE_GTK |
| 1410 fb = Fcons (Fcons (list1 (Qgtk), Qautodetect), fb); | |
| 1411 #endif | |
| 428 | 1412 #ifdef HAVE_X_WINDOWS |
| 1413 fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb); | |
| 1414 #endif | |
| 1415 #ifdef HAVE_MS_WINDOWS | |
| 440 | 1416 fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb); |
| 428 | 1417 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb); |
| 1418 #endif | |
| 1419 if (!NILP (fb)) | |
| 1420 set_specifier_fallback (Vdefault_gutter_height, fb); | |
| 1421 | |
| 1422 fb = Qnil; | |
| 1423 #ifdef HAVE_TTY | |
| 444 | 1424 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); |
| 428 | 1425 #endif |
| 1426 #ifdef HAVE_X_WINDOWS | |
| 444 | 1427 fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb); |
| 428 | 1428 #endif |
| 462 | 1429 #ifdef HAVE_GTK |
| 1430 fb = Fcons (Fcons (list1 (Qgtk), Qautodetect), fb); | |
| 1431 #endif | |
| 428 | 1432 #ifdef HAVE_MS_WINDOWS |
| 444 | 1433 fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb); |
| 1434 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb); | |
| 428 | 1435 #endif |
| 1436 if (!NILP (fb)) | |
| 1437 set_specifier_fallback (Vdefault_gutter_width, fb); | |
| 1438 | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1439 set_specifier_fallback (Vgutter_size[TOP_EDGE], Vdefault_gutter_height); |
| 428 | 1440 fb = list1 (Fcons (Qnil, Qzero)); |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1441 set_specifier_fallback (Vgutter_size[BOTTOM_EDGE], fb); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1442 set_specifier_fallback (Vgutter_size[LEFT_EDGE], fb); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1443 set_specifier_fallback (Vgutter_size[RIGHT_EDGE], fb); |
| 428 | 1444 |
| 1445 DEFVAR_SPECIFIER ("default-gutter-border-width", | |
| 1446 &Vdefault_gutter_border_width /* | |
| 1447 *Width of the border around the default gutter. | |
| 1448 This is a specifier; use `set-specifier' to change it. | |
| 1449 | |
| 1450 The position of the default gutter is specified by the function | |
| 1451 `set-default-gutter-position'. If the corresponding position-specific | |
| 1452 gutter border width specifier (e.g. `top-gutter-border-width' if | |
| 3025 | 1453 `default-gutter-position' is `top') does not specify a border width in a |
| 428 | 1454 particular domain (a window or a frame), then the value of |
| 1455 `default-gutter-border-width' in that domain, if any, will be used | |
| 1456 instead. | |
| 1457 | |
| 1458 */ ); | |
| 1459 Vdefault_gutter_border_width = Fmake_specifier (Qnatnum); | |
| 1460 set_specifier_caching (Vdefault_gutter_border_width, | |
| 438 | 1461 offsetof (struct window, default_gutter_border_width), |
| 428 | 1462 default_gutter_border_width_changed_in_window, |
| 444 | 1463 0, 0, 0); |
| 428 | 1464 |
| 1465 DEFVAR_SPECIFIER ("top-gutter-border-width", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1466 &Vgutter_border_width[TOP_EDGE] /* |
| 428 | 1467 *Border width of the top gutter. |
| 1468 This is a specifier; use `set-specifier' to change it. | |
| 1469 | |
| 1470 See `default-gutter-height' for more information. | |
| 1471 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1472 Vgutter_border_width[TOP_EDGE] = Fmake_specifier (Qnatnum); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1473 set_specifier_caching (Vgutter_border_width[TOP_EDGE], |
| 438 | 1474 offsetof (struct window, |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1475 gutter_border_width[TOP_EDGE]), |
| 444 | 1476 gutter_geometry_changed_in_window, 0, 0, 0); |
| 428 | 1477 |
| 1478 DEFVAR_SPECIFIER ("bottom-gutter-border-width", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1479 &Vgutter_border_width[BOTTOM_EDGE] /* |
| 428 | 1480 *Border width of the bottom gutter. |
| 1481 This is a specifier; use `set-specifier' to change it. | |
| 1482 | |
| 1483 See `default-gutter-height' for more information. | |
| 1484 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1485 Vgutter_border_width[BOTTOM_EDGE] = Fmake_specifier (Qnatnum); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1486 set_specifier_caching (Vgutter_border_width[BOTTOM_EDGE], |
| 438 | 1487 offsetof (struct window, |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1488 gutter_border_width[BOTTOM_EDGE]), |
| 444 | 1489 gutter_geometry_changed_in_window, 0, 0, 0); |
| 428 | 1490 |
| 1491 DEFVAR_SPECIFIER ("left-gutter-border-width", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1492 &Vgutter_border_width[LEFT_EDGE] /* |
| 428 | 1493 *Border width of left gutter. |
| 1494 This is a specifier; use `set-specifier' to change it. | |
| 1495 | |
| 1496 See `default-gutter-height' for more information. | |
| 1497 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1498 Vgutter_border_width[LEFT_EDGE] = Fmake_specifier (Qnatnum); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1499 set_specifier_caching (Vgutter_border_width[LEFT_EDGE], |
| 438 | 1500 offsetof (struct window, |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1501 gutter_border_width[LEFT_EDGE]), |
| 444 | 1502 gutter_geometry_changed_in_window, 0, 0, 0); |
| 428 | 1503 |
| 1504 DEFVAR_SPECIFIER ("right-gutter-border-width", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1505 &Vgutter_border_width[RIGHT_EDGE] /* |
| 428 | 1506 *Border width of right gutter. |
| 1507 This is a specifier; use `set-specifier' to change it. | |
| 1508 | |
| 1509 See `default-gutter-height' for more information. | |
| 1510 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1511 Vgutter_border_width[RIGHT_EDGE] = Fmake_specifier (Qnatnum); |
|
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1512 set_specifier_caching (Vgutter_border_width[RIGHT_EDGE], |
| 438 | 1513 offsetof (struct window, |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1514 gutter_border_width[RIGHT_EDGE]), |
| 444 | 1515 gutter_geometry_changed_in_window, 0, 0, 0); |
| 428 | 1516 |
| 1517 fb = Qnil; | |
| 1518 #ifdef HAVE_TTY | |
| 1519 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); | |
| 1520 #endif | |
| 1521 #ifdef HAVE_X_WINDOWS | |
| 1522 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb); | |
| 1523 #endif | |
| 1524 #ifdef HAVE_MS_WINDOWS | |
| 440 | 1525 fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb); |
| 428 | 1526 fb = Fcons (Fcons (list1 (Qmswindows), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb); |
| 1527 #endif | |
| 1528 if (!NILP (fb)) | |
| 1529 set_specifier_fallback (Vdefault_gutter_border_width, fb); | |
| 1530 | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1531 set_specifier_fallback (Vgutter_border_width[TOP_EDGE], Vdefault_gutter_border_width); |
| 428 | 1532 fb = list1 (Fcons (Qnil, Qzero)); |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1533 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
|
1534 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
|
1535 set_specifier_fallback (Vgutter_border_width[RIGHT_EDGE], fb); |
| 428 | 1536 |
| 1537 DEFVAR_SPECIFIER ("default-gutter-visible-p", &Vdefault_gutter_visible_p /* | |
| 1538 *Whether the default gutter is visible. | |
| 1539 This is a specifier; use `set-specifier' to change it. | |
| 1540 | |
| 1541 The position of the default gutter is specified by the function | |
| 1542 `set-default-gutter-position'. If the corresponding position-specific | |
| 1543 gutter visibility specifier (e.g. `top-gutter-visible-p' if | |
| 3025 | 1544 `default-gutter-position' is `top') does not specify a visible-p value |
| 428 | 1545 in a particular domain (a window or a frame), then the value of |
| 1546 `default-gutter-visible-p' in that domain, if any, will be used | |
| 1547 instead. | |
| 1548 | |
| 1549 `default-gutter-visible-p' and all of the position-specific gutter | |
| 1550 visibility specifiers have a fallback value of true. | |
| 1551 */ ); | |
| 442 | 1552 Vdefault_gutter_visible_p = Fmake_specifier (Qgutter_visible); |
| 428 | 1553 set_specifier_caching (Vdefault_gutter_visible_p, |
| 438 | 1554 offsetof (struct window, |
| 1555 default_gutter_visible_p), | |
| 428 | 1556 default_gutter_visible_p_changed_in_window, |
| 444 | 1557 0, 0, 0); |
| 428 | 1558 |
| 1559 DEFVAR_SPECIFIER ("top-gutter-visible-p", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1560 &Vgutter_visible_p[TOP_EDGE] /* |
| 428 | 1561 *Whether the top gutter is visible. |
| 1562 This is a specifier; use `set-specifier' to change it. | |
| 1563 | |
| 1564 See `default-gutter-visible-p' for more information. | |
| 1565 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1566 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
|
1567 set_specifier_caching (Vgutter_visible_p[TOP_EDGE], |
| 438 | 1568 offsetof (struct window, |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1569 gutter_visible_p[TOP_EDGE]), |
| 444 | 1570 top_gutter_specs_changed, 0, 0, 0); |
| 428 | 1571 |
| 1572 DEFVAR_SPECIFIER ("bottom-gutter-visible-p", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1573 &Vgutter_visible_p[BOTTOM_EDGE] /* |
| 428 | 1574 *Whether the bottom gutter is visible. |
| 1575 This is a specifier; use `set-specifier' to change it. | |
| 1576 | |
| 1577 See `default-gutter-visible-p' for more information. | |
| 1578 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1579 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
|
1580 set_specifier_caching (Vgutter_visible_p[BOTTOM_EDGE], |
| 438 | 1581 offsetof (struct window, |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1582 gutter_visible_p[BOTTOM_EDGE]), |
| 444 | 1583 bottom_gutter_specs_changed, 0, 0, 0); |
| 428 | 1584 |
| 1585 DEFVAR_SPECIFIER ("left-gutter-visible-p", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1586 &Vgutter_visible_p[LEFT_EDGE] /* |
| 428 | 1587 *Whether the left gutter is visible. |
| 1588 This is a specifier; use `set-specifier' to change it. | |
| 1589 | |
| 1590 See `default-gutter-visible-p' for more information. | |
| 1591 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1592 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
|
1593 set_specifier_caching (Vgutter_visible_p[LEFT_EDGE], |
| 438 | 1594 offsetof (struct window, |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1595 gutter_visible_p[LEFT_EDGE]), |
| 444 | 1596 left_gutter_specs_changed, 0, 0, 0); |
| 428 | 1597 |
| 1598 DEFVAR_SPECIFIER ("right-gutter-visible-p", | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1599 &Vgutter_visible_p[RIGHT_EDGE] /* |
| 428 | 1600 *Whether the right gutter is visible. |
| 1601 This is a specifier; use `set-specifier' to change it. | |
| 1602 | |
| 1603 See `default-gutter-visible-p' for more information. | |
| 1604 */ ); | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1605 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
|
1606 set_specifier_caching (Vgutter_visible_p[RIGHT_EDGE], |
| 438 | 1607 offsetof (struct window, |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1608 gutter_visible_p[RIGHT_EDGE]), |
| 444 | 1609 right_gutter_specs_changed, 0, 0, 0); |
| 428 | 1610 |
| 1611 /* initially, top inherits from default; this can be | |
| 1612 changed with `set-default-gutter-position'. */ | |
| 1613 fb = list1 (Fcons (Qnil, Qt)); | |
| 1614 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
|
1615 set_specifier_fallback (Vgutter_visible_p[TOP_EDGE], |
| 428 | 1616 Vdefault_gutter_visible_p); |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
5049
diff
changeset
|
1617 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
|
1618 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
|
1619 set_specifier_fallback (Vgutter_visible_p[RIGHT_EDGE], fb); |
| 428 | 1620 } |
