annotate src/gutter.c @ 5940:c608d4b0b75e cygwin64 tip

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