annotate src/gutter.c @ 438:84b14dcb0985 r21-2-27

Import from CVS: tag r21-2-27
author cvs
date Mon, 13 Aug 2007 11:32:25 +0200
parents 3ecd8885ac67
children 8de8e3f6228a
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.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1999 Andy Piper.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 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
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 /* written by Andy Piper <andy@xemacs.org> with specifiers partially
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ripped-off from toolbar.c */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 #include "lisp.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 #include "buffer.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 #include "frame.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 #include "device.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 #include "faces.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 #include "glyphs.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 #include "redisplay.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 #include "window.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 #include "gutter.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 Lisp_Object Vgutter[4];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 Lisp_Object Vgutter_size[4];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 Lisp_Object Vgutter_visible_p[4];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 Lisp_Object Vgutter_border_width[4];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 Lisp_Object Vdefault_gutter, Vdefault_gutter_visible_p;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 Lisp_Object Vdefault_gutter_width, Vdefault_gutter_height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 Lisp_Object Vdefault_gutter_border_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 Lisp_Object Vdefault_gutter_position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 Lisp_Object Qgutter_size;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 #define SET_GUTTER_WAS_VISIBLE_FLAG(frame, pos, flag) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 switch (pos) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 case TOP_GUTTER: \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 (frame)->top_gutter_was_visible = flag; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 case BOTTOM_GUTTER: \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 (frame)->bottom_gutter_was_visible = flag; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 case LEFT_GUTTER: \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 (frame)->left_gutter_was_visible = flag; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 case RIGHT_GUTTER: \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 (frame)->right_gutter_was_visible = flag; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 default: \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 abort (); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 } while (0)
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 int gutter_was_visible (struct frame* frame, enum gutter_pos pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 switch (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 case TOP_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 return frame->top_gutter_was_visible;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 case BOTTOM_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 return frame->bottom_gutter_was_visible;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 case LEFT_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 return frame->left_gutter_was_visible;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 case RIGHT_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 return frame->right_gutter_was_visible;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 default:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 abort ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 }
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
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 frame_topmost_window (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 Lisp_Object w = FRAME_ROOT_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 do {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 while (!NILP (XWINDOW (w)->vchild))
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 w = XWINDOW (w)->vchild;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 } while (!NILP (XWINDOW (w)->hchild) && !NILP (w = XWINDOW (w)->hchild));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 return w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 }
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 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 frame_bottommost_window (struct frame *f)
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 Lisp_Object w = FRAME_ROOT_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 do {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 while (!NILP (XWINDOW (w)->vchild))
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 w = XWINDOW (w)->vchild;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 while (!NILP (XWINDOW (w)->next))
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)->next;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 }
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 } while (!NILP (XWINDOW (w)->hchild) && !NILP (w = XWINDOW (w)->hchild));
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 return w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 frame_leftmost_window (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 Lisp_Object w = FRAME_ROOT_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 do {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 while (!NILP (XWINDOW (w)->hchild))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 w = XWINDOW (w)->hchild;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 } while (!NILP (XWINDOW (w)->vchild) && !NILP (w = XWINDOW (w)->vchild));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 return w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 frame_rightmost_window (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 Lisp_Object w = FRAME_ROOT_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 do {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 while (!NILP (XWINDOW (w)->hchild))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 w = XWINDOW (w)->hchild;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 while (!NILP (XWINDOW (w)->next))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 w = XWINDOW (w)->next;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 } while (!NILP (XWINDOW (w)->vchild) && !NILP (w = XWINDOW (w)->vchild));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 return w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 /* calculate the coordinates of a gutter for the current frame and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 selected window. we have to be careful in calculating this as we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 need to use *two* windows, the currently selected window will give
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 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
162 use this for calculating the gutter positions we run into trouble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 if it is not the window nearest the gutter. Instead we predetermine
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 the nearest window and then use that.*/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 int *width, int *height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 struct window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 * top = XWINDOW (frame_topmost_window (f)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 * bot = XWINDOW (frame_bottommost_window (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 /* The top and bottom gutters take precedence over the left and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 right. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 switch (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 case TOP_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 *x = FRAME_LEFT_BORDER_END (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 *y = FRAME_TOP_BORDER_END (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 *width = FRAME_RIGHT_BORDER_START (f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 - FRAME_LEFT_BORDER_END (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 *height = FRAME_TOP_GUTTER_BOUNDS (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 case BOTTOM_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 *x = FRAME_LEFT_BORDER_END (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 *y = WINDOW_BOTTOM (bot)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 - FRAME_BOTTOM_GUTTER_BOUNDS (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 *width = FRAME_RIGHT_BORDER_START (f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 - FRAME_LEFT_BORDER_END (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 *height = FRAME_BOTTOM_GUTTER_BOUNDS (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 case LEFT_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 *x = FRAME_LEFT_BORDER_END (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 *y = WINDOW_TEXT_TOP (top);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 *width = FRAME_LEFT_GUTTER_BOUNDS (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 *height = WINDOW_BOTTOM (bot)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 - (WINDOW_TEXT_TOP (top)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 + FRAME_BOTTOM_GUTTER_BOUNDS (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 case RIGHT_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 *x = FRAME_RIGHT_BORDER_START (f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 - FRAME_RIGHT_GUTTER_BOUNDS (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 *y = WINDOW_TEXT_TOP (top);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 *width = FRAME_RIGHT_GUTTER_BOUNDS (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 *height = WINDOW_BOTTOM (bot)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 - (WINDOW_TEXT_TOP (top)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 + FRAME_BOTTOM_GUTTER_BOUNDS (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 default:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 abort ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 output_gutter (struct frame *f, enum gutter_pos pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 Lisp_Object frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 struct device *d = XDEVICE (f->device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 struct window* w = XWINDOW (window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 int x, y, width, height, ypos;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 int line;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 int border_width = FRAME_GUTTER_BORDER_WIDTH (f, pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 face_index findex = get_builtin_face_cache_index (w, Vgui_element_face);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 display_line_dynarr* ddla, *cdla;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 struct display_line *dl;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 int cdla_len;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 if (!f->current_display_lines)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 f->current_display_lines = Dynarr_new (display_line);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 if (!f->desired_display_lines)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 f->desired_display_lines = Dynarr_new (display_line);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 ddla = f->desired_display_lines;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 cdla = f->current_display_lines;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 cdla_len = Dynarr_length (cdla);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 XSETFRAME (frame, f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 get_gutter_coords (f, pos, &x, &y, &width, &height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 /* generate some display lines */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 generate_displayable_area (w, WINDOW_GUTTER (w, pos),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 x + border_width, y + border_width,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 width - 2 * border_width,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 height - 2 * border_width, ddla, 0, findex);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 /* Output each line. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 for (line = 0; line < Dynarr_length (ddla); line++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 output_display_line (w, cdla, ddla, line, -1, -1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 /* If the number of display lines has shrunk, adjust. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 if (cdla_len > Dynarr_length (ddla))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 Dynarr_length (cdla) = Dynarr_length (ddla);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 /* grab coordinates of last line and blank after it. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 ypos = dl->ypos + dl->descent - dl->clip;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 redisplay_clear_region (window, findex, x + border_width , ypos,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 width - 2 * border_width, height - (ypos - y) - border_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 /* bevel the gutter area if so desired */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 if (border_width != 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 MAYBE_DEVMETH (d, bevel_area,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 (w, findex, x, y, width, height, border_width,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 EDGE_ALL, EDGE_BEVEL_OUT));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 /* sizing gutters is a pain so we try and help the user by detemining
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 what height will accommodate all lines. This is useless on left and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 right gutters as we always have a maximal number of lines. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 calculate_gutter_size (struct window *w, enum gutter_pos pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 struct frame* f = XFRAME (WINDOW_FRAME (w));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 int ypos;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 display_line_dynarr* ddla;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 struct display_line *dl;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 /* we cannot autodetect gutter sizes for the left and right as there
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 is no reasonable metric to use */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 assert (pos == TOP_GUTTER || pos == BOTTOM_GUTTER);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 /* degenerate case */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 if (NILP (WINDOW_GUTTER (w, pos))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 ||
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 !FRAME_VISIBLE_P (f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 ||
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 NILP (w->buffer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 ddla = Dynarr_new (display_line);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 /* generate some display lines */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 generate_displayable_area (w, WINDOW_GUTTER (w, pos),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 FRAME_LEFT_BORDER_END (f),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 FRAME_RIGHT_BORDER_START (f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 - FRAME_LEFT_BORDER_END (f),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 200,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 ddla, 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 /* grab coordinates of last line */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 if (Dynarr_length (ddla))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 ypos = dl->ypos + dl->descent - dl->clip;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 free_display_lines (ddla);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 return make_int (ypos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 free_display_lines (ddla);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 clear_gutter (struct frame *f, enum gutter_pos pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 int x, y, width, height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 face_index findex = get_builtin_face_cache_index (XWINDOW (window),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 Vgui_element_face);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 get_gutter_coords (f, pos, &x, &y, &width, &height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 SET_GUTTER_WAS_VISIBLE_FLAG (f, pos, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 redisplay_clear_region (window, findex, x, y, width, height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 update_frame_gutters (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 if (f->gutter_changed || f->clear ||
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 f->glyphs_changed || f->subwindows_changed ||
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 f->windows_changed || f->windows_structure_changed ||
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 f->extents_changed || f->faces_changed)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 enum gutter_pos pos;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 /* We don't actually care about these when outputting the gutter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 so locally disable them. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 int local_clip_changed = f->clip_changed;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 int local_buffers_changed = f->buffers_changed;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 f->clip_changed = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 f->buffers_changed = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 /* and output */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 GUTTER_POS_LOOP (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 if (FRAME_GUTTER_VISIBLE (f, pos))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 output_gutter (f, pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 else if (gutter_was_visible (f, pos))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 clear_gutter (f, pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 f->clip_changed = local_clip_changed;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 f->buffers_changed = local_buffers_changed;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 f->gutter_changed = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 reset_gutter_display_lines (struct frame* f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 if (f->current_display_lines)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 Dynarr_reset (f->current_display_lines);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 redraw_exposed_gutter (struct frame *f, enum gutter_pos pos, int x, int y,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 int width, int height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 int g_x, g_y, g_width, g_height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 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
380
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 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
382 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 if (((x + width) < g_x) || (x > (g_x + g_width)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 /* #### optimize this - redrawing the whole gutter for every expose
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 is very expensive. We reset the current display lines because if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 they're being exposed they are no longer current. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 reset_gutter_display_lines (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 /* 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
392 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
393 that some portion of the gutter is in the exposed region. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 output_gutter (f, pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 redraw_exposed_gutters (struct frame *f, int x, int y, int width,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 int height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 enum gutter_pos pos;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 GUTTER_POS_LOOP (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 if (FRAME_GUTTER_VISIBLE (f, pos))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 redraw_exposed_gutter (f, pos, x, y, width, height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 free_frame_gutters (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 if (f->current_display_lines)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 free_display_lines (f->current_display_lines);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415 f->current_display_lines = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 if (f->desired_display_lines)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 free_display_lines (f->desired_display_lines);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 f->desired_display_lines = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424 static enum gutter_pos
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 decode_gutter_position (Lisp_Object position)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 if (EQ (position, Qtop)) return TOP_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 if (EQ (position, Qbottom)) return BOTTOM_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 if (EQ (position, Qleft)) return LEFT_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 if (EQ (position, Qright)) return RIGHT_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 signal_simple_error ("Invalid gutter position", position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 return TOP_GUTTER; /* not reached */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 DEFUN ("set-default-gutter-position", Fset_default_gutter_position, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 Set the position that the `default-gutter' will be displayed at.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 Valid positions are 'top, 'bottom, 'left and 'right.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 See `default-gutter-position'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 (position))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 enum gutter_pos cur = decode_gutter_position (Vdefault_gutter_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 enum gutter_pos new = decode_gutter_position (position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 if (cur != new)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 /* The following calls will automatically cause the dirty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 flags to be set; we delay frame size changes to avoid
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 lots of frame flickering. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 /* #### I think this should be GC protected. -sb */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 hold_frame_size_changes ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 set_specifier_fallback (Vgutter[cur], list1 (Fcons (Qnil, Qnil)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 set_specifier_fallback (Vgutter[new], Vdefault_gutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 set_specifier_fallback (Vgutter_size[cur], list1 (Fcons (Qnil, Qzero)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 set_specifier_fallback (Vgutter_size[new],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 new == TOP_GUTTER || new == BOTTOM_GUTTER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 ? Vdefault_gutter_height
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 : Vdefault_gutter_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 set_specifier_fallback (Vgutter_border_width[cur],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 list1 (Fcons (Qnil, Qzero)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 set_specifier_fallback (Vgutter_border_width[new],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 Vdefault_gutter_border_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 set_specifier_fallback (Vgutter_visible_p[cur],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 list1 (Fcons (Qnil, Qt)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 set_specifier_fallback (Vgutter_visible_p[new],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 Vdefault_gutter_visible_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 Vdefault_gutter_position = position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 unhold_frame_size_changes ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 return position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 DEFUN ("default-gutter-position", Fdefault_gutter_position, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 Return the position that the `default-gutter' will be displayed at.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 The `default-gutter' will only be displayed here if the corresponding
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 position-specific gutter specifier does not provide a value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 ())
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 return Vdefault_gutter_position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 DEFUN ("gutter-pixel-width", Fgutter_pixel_width, 0, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 Return the pixel width of the gutter at POS in LOCALE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 POS defaults to the default gutter position. LOCALE defaults to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 the current window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 (pos, locale))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 int x, y, width, height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 enum gutter_pos p = TOP_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 struct frame *f = decode_frame (FW_FRAME (locale));
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 if (NILP (pos))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 pos = Vdefault_gutter_position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 p = decode_gutter_position (pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 get_gutter_coords (f, p, &x, &y, &width, &height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 width -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 return make_int (width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 DEFUN ("gutter-pixel-height", Fgutter_pixel_height, 0, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 Return the pixel height of the gutter at POS in LOCALE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 POS defaults to the default gutter position. LOCALE defaults to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 the current window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 (pos, locale))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 int x, y, width, height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 enum gutter_pos p = TOP_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 struct frame *f = decode_frame (FW_FRAME (locale));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 if (NILP (pos))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518 pos = Vdefault_gutter_position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 p = decode_gutter_position (pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 get_gutter_coords (f, p, &x, &y, &width, &height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 height -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 return make_int (height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 DEFINE_SPECIFIER_TYPE (gutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 gutter_after_change (Lisp_Object specifier, Lisp_Object locale)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 MARK_GUTTER_CHANGED;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 gutter_validate (Lisp_Object instantiator)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 if (NILP (instantiator))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 if (!STRINGP (instantiator))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 signal_simple_error ("Gutter spec must be string or nil", instantiator);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 DEFUN ("gutter-specifier-p", Fgutter_specifier_p, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 Return non-nil if OBJECT is a gutter specifier.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 Gutter specifiers are used to specify the format of a gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 The values of the variables `default-gutter', `top-gutter',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 `left-gutter', `right-gutter', and `bottom-gutter' are always
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 gutter specifiers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 Valid gutter instantiators are called "gutter descriptors"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 and are lists of vectors. See `default-gutter' for a description
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 of the exact format.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556 (object))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 return GUTTER_SPECIFIERP (object) ? Qt : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563 Helper for invalidating the real specifier when default
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564 specifier caching changes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 recompute_overlaying_specifier (Lisp_Object real_one[4])
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
569 enum gutter_pos pos = decode_gutter_position (Vdefault_gutter_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570 Fset_specifier_dirty_flag (real_one[pos]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 gutter_specs_changed (Lisp_Object specifier, struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 Lisp_Object oldval)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 enum gutter_pos pos;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 GUTTER_POS_LOOP (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
580 w->real_gutter_size[pos] = w->gutter_size[pos];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 if (EQ (w->real_gutter_size[pos], Qautodetect)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 && !NILP (w->gutter_visible_p[pos]))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
583 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 w->real_gutter_size [pos] = calculate_gutter_size (w, pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 MARK_GUTTER_CHANGED;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588 MARK_WINDOWS_CHANGED (w);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592 default_gutter_specs_changed (Lisp_Object specifier, struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593 Lisp_Object oldval)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 recompute_overlaying_specifier (Vgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 gutter_geometry_changed_in_window (Lisp_Object specifier, struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600 Lisp_Object oldval)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602 enum gutter_pos pos;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 GUTTER_POS_LOOP (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 w->real_gutter_size[pos] = w->gutter_size[pos];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606 if (EQ (w->real_gutter_size[pos], Qautodetect)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 && !NILP (w->gutter_visible_p[pos]))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609 w->real_gutter_size [pos] = calculate_gutter_size (w, pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611 }
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 MARK_GUTTER_CHANGED;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 MARK_WINDOWS_CHANGED (w);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618 default_gutter_size_changed_in_window (Lisp_Object specifier, struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
619 Lisp_Object oldval)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 recompute_overlaying_specifier (Vgutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622 }
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 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625 default_gutter_border_width_changed_in_window (Lisp_Object specifier,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 Lisp_Object oldval)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 recompute_overlaying_specifier (Vgutter_border_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 default_gutter_visible_p_changed_in_window (Lisp_Object specifier,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634 struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635 Lisp_Object oldval)
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 recompute_overlaying_specifier (Vgutter_visible_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639
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 DECLARE_SPECIFIER_TYPE (gutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642 #define GUTTER_SIZE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_size)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643 DEFINE_SPECIFIER_TYPE (gutter_size);
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 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 gutter_size_validate (Lisp_Object instantiator)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648 if (NILP (instantiator))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651 if (!INTP (instantiator) && !EQ (instantiator, Qautodetect))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652 signal_simple_error ("Gutter size must be an integer or 'autodetect", instantiator);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 DEFUN ("gutter-size-specifier-p", Fgutter_size_specifier_p, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656 Return non-nil if OBJECT is a gutter-size specifier.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 (object))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 return GUTTER_SIZE_SPECIFIERP (object) ? Qt : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 DEFUN ("redisplay-gutter-area", Fredisplay_gutter_area, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664 Ensure that all gutters are correctly showing their gutter specifier.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
665 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 Lisp_Object devcons, concons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670 DEVICE_LOOP_NO_BREAK (devcons, concons)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672 struct device *d = XDEVICE (XCAR (devcons));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673 Lisp_Object frmcons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 DEVICE_FRAME_LOOP (frmcons, d)
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 struct frame *f = XFRAME (XCAR (frmcons));
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 if (FRAME_REPAINT_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681 update_frame_gutters (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685 /* We now call the output_end routine for tty frames. We delay
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 doing so in order to avoid cursor flicker. So much for 100%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687 encapsulation. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
688 if (DEVICE_TTY_P (d))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 DEVMETH (d, output_end, (d));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
690 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
696 init_frame_gutters (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698 enum gutter_pos pos;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699 struct window* w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700 /* We are here as far in frame creation so cached specifiers are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701 already recomputed, and possibly modified by resource
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 initialization. We need to recalculate autodetected gutters. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
703 GUTTER_POS_LOOP (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705 w->real_gutter_size[pos] = w->gutter_size[pos];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 if (EQ (w->gutter_size[pos], Qautodetect)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 && !NILP (w->gutter_visible_p[pos]))
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 w->real_gutter_size [pos] = calculate_gutter_size (w, pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
710 MARK_GUTTER_CHANGED;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711 MARK_WINDOWS_CHANGED (w);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
712 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
713 }
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
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
716 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
717 syms_of_gutter (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
718 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
719 DEFSUBR (Fgutter_specifier_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
720 DEFSUBR (Fgutter_size_specifier_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
721 DEFSUBR (Fset_default_gutter_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
722 DEFSUBR (Fdefault_gutter_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
723 DEFSUBR (Fgutter_pixel_height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724 DEFSUBR (Fgutter_pixel_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
725 DEFSUBR (Fredisplay_gutter_area);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
726
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
727 defsymbol (&Qgutter_size, "gutter-size");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
730 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731 vars_of_gutter (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
732 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
733 staticpro (&Vdefault_gutter_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
734 Vdefault_gutter_position = Qtop;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
735
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736 Fprovide (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
737 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740 specifier_type_create_gutter (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
742 INITIALIZE_SPECIFIER_TYPE (gutter, "gutter", "gutter-specifier-p");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744 SPECIFIER_HAS_METHOD (gutter, validate);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
745 SPECIFIER_HAS_METHOD (gutter, after_change);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747 INITIALIZE_SPECIFIER_TYPE (gutter_size, "gutter-size", "gutter-size-specifier-p");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
748
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749 SPECIFIER_HAS_METHOD (gutter_size, validate);
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
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753 reinit_specifier_type_create_gutter (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
755 REINITIALIZE_SPECIFIER_TYPE (gutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756 REINITIALIZE_SPECIFIER_TYPE (gutter_size);
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
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760 specifier_vars_of_gutter (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 Lisp_Object fb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764 DEFVAR_SPECIFIER ("default-gutter", &Vdefault_gutter /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765 Specifier for a fallback gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766 Use `set-specifier' to change this.
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 The position of this gutter is specified in the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
769 `default-gutter-position'. If the corresponding position-specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
770 gutter (e.g. `top-gutter' if `default-gutter-position' is 'top)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
771 does not specify a gutter in a particular domain (usually a window),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772 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
773 used instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
774
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
775 Note that the gutter at any particular position will not be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
776 displayed unless its visibility flag is true and its thickness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777 \(width or height, depending on orientation) is non-zero. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
778 visibility is controlled by the specifiers `top-gutter-visible-p',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 `bottom-gutter-visible-p', `left-gutter-visible-p', and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 `right-gutter-visible-p', and the thickness is controlled by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781 specifiers `top-gutter-height', `bottom-gutter-height',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782 `left-gutter-width', and `right-gutter-width'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784 Note that one of the four visibility specifiers inherits from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 `default-gutter-visibility' and one of the four thickness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786 specifiers inherits from either `default-gutter-width' or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
787 `default-gutter-height' (depending on orientation), just
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 like for the gutter description specifiers (e.g. `top-gutter')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 mentioned above.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791 Therefore, if you are setting `default-gutter', you should control
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 the visibility and thickness using `default-gutter-visible-p',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 `default-gutter-width', and `default-gutter-height', rather than
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 using position-specific specifiers. That way, you will get sane
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
795 behavior if the user changes the default gutter position.
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 The gutter value should be a string or nil. You can attach extents and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798 glyphs to the string and hence display glyphs and text in other fonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
799 in the gutter area.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
800
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 Vdefault_gutter = Fmake_specifier (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804 /* #### It would be even nicer if the specifier caching
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805 automatically knew about specifier fallbacks, so we didn't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
806 have to do it ourselves. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807 set_specifier_caching (Vdefault_gutter,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
808 offsetof (struct window, default_gutter),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
809 default_gutter_specs_changed,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
810 0, 0);
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 DEFVAR_SPECIFIER ("top-gutter",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813 &Vgutter[TOP_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
814 Specifier for the gutter at the top of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
815 Use `set-specifier' to change this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
816 See `default-gutter' for a description of a valid gutter instantiator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
817 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818 Vgutter[TOP_GUTTER] = Fmake_specifier (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819 set_specifier_caching (Vgutter[TOP_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
820 offsetof (struct window, gutter[TOP_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
821 gutter_specs_changed,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
822 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
823
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
824 DEFVAR_SPECIFIER ("bottom-gutter",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
825 &Vgutter[BOTTOM_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
826 Specifier for the gutter at the bottom of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
827 Use `set-specifier' to change this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
828 See `default-gutter' for a description of a valid gutter instantiator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
829
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
830 Note that, unless the `default-gutter-position' is `bottom', by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
831 default the height of the bottom gutter (controlled by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
832 `bottom-gutter-height') is 0; thus, a bottom gutter will not be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
833 displayed even if you provide a value for `bottom-gutter'.
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 Vgutter[BOTTOM_GUTTER] = Fmake_specifier (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
836 set_specifier_caching (Vgutter[BOTTOM_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
837 offsetof (struct window, gutter[BOTTOM_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
838 gutter_specs_changed,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
839 0, 0);
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 DEFVAR_SPECIFIER ("left-gutter",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
842 &Vgutter[LEFT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
843 Specifier for the gutter at the left edge of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
844 Use `set-specifier' to change this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
845 See `default-gutter' for a description of a valid gutter instantiator.
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 Note that, unless the `default-gutter-position' is `left', by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
848 default the height of the left gutter (controlled by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
849 `left-gutter-width') is 0; thus, a left gutter will not be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
850 displayed even if you provide a value for `left-gutter'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
851 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
852 Vgutter[LEFT_GUTTER] = Fmake_specifier (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
853 set_specifier_caching (Vgutter[LEFT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
854 offsetof (struct window, gutter[LEFT_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
855 gutter_specs_changed,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
856 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
857
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
858 DEFVAR_SPECIFIER ("right-gutter",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
859 &Vgutter[RIGHT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
860 Specifier for the gutter at the right edge of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861 Use `set-specifier' to change this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
862 See `default-gutter' for a description of a valid gutter instantiator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
863
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
864 Note that, unless the `default-gutter-position' is `right', by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
865 default the height of the right gutter (controlled by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
866 `right-gutter-width') is 0; thus, a right gutter will not be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
867 displayed even if you provide a value for `right-gutter'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
868 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 Vgutter[RIGHT_GUTTER] = Fmake_specifier (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870 set_specifier_caching (Vgutter[RIGHT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
871 offsetof (struct window, gutter[RIGHT_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872 gutter_specs_changed,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875 /* initially, top inherits from default; this can be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 changed with `set-default-gutter-position'. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
877 fb = list1 (Fcons (Qnil, Qnil));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
878 set_specifier_fallback (Vdefault_gutter, fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
879 set_specifier_fallback (Vgutter[TOP_GUTTER], Vdefault_gutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
880 set_specifier_fallback (Vgutter[BOTTOM_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
881 set_specifier_fallback (Vgutter[LEFT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
882 set_specifier_fallback (Vgutter[RIGHT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
883
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
884 DEFVAR_SPECIFIER ("default-gutter-height", &Vdefault_gutter_height /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
885 *Height of the default gutter, if it's oriented horizontally.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
886 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
887
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
888 The position of the default gutter is specified by the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
889 `set-default-gutter-position'. If the corresponding position-specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
890 gutter thickness specifier (e.g. `top-gutter-height' if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
891 `default-gutter-position' is 'top) does not specify a thickness in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
892 particular domain (a window or a frame), then the value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
893 `default-gutter-height' or `default-gutter-width' (depending on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
894 gutter orientation) in that domain, if any, will be used instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
895
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
896 Note that `default-gutter-height' is only used when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
897 `default-gutter-position' is 'top or 'bottom, and `default-gutter-width'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
898 is only used when `default-gutter-position' is 'left or 'right.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
899
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
900 Note that all of the position-specific gutter thickness specifiers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
901 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
902 default gutter. Therefore, you will have to set a non-zero thickness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
903 value if you want a position-specific gutter to be displayed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
904
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
905 If you set the height to 'autodetect the size of the gutter will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
906 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
907 is the default.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
908 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
909 Vdefault_gutter_height = Fmake_specifier (Qgutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
910 set_specifier_caching (Vdefault_gutter_height,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
911 offsetof (struct window, default_gutter_height),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
912 default_gutter_size_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
913 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
914
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
915 DEFVAR_SPECIFIER ("default-gutter-width", &Vdefault_gutter_width /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
916 *Width of the default gutter, if it's oriented vertically.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
917 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
918
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
919 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
920 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
921 Vdefault_gutter_width = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
922 set_specifier_caching (Vdefault_gutter_width,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
923 offsetof (struct window, default_gutter_width),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
924 default_gutter_size_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
925 0, 0);
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 DEFVAR_SPECIFIER ("top-gutter-height",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
928 &Vgutter_size[TOP_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
929 *Height of the top gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
930 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
931
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
932 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
933 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
934 Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
935 set_specifier_caching (Vgutter_size[TOP_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
936 offsetof (struct window, gutter_size[TOP_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
937 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
938 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
939
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
940 DEFVAR_SPECIFIER ("bottom-gutter-height",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
941 &Vgutter_size[BOTTOM_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
942 *Height of the bottom gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
943 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
944
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
945 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
946 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
947 Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
948 set_specifier_caching (Vgutter_size[BOTTOM_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
949 offsetof (struct window, gutter_size[BOTTOM_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
950 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
951 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
952
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
953 DEFVAR_SPECIFIER ("left-gutter-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
954 &Vgutter_size[LEFT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
955 *Width of left gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
956 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
957
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
958 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
960 Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961 set_specifier_caching (Vgutter_size[LEFT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
962 offsetof (struct window, gutter_size[LEFT_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
963 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
964 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
965
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
966 DEFVAR_SPECIFIER ("right-gutter-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
967 &Vgutter_size[RIGHT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
968 *Width of right gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
969 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
970
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
971 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974 set_specifier_caching (Vgutter_size[RIGHT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
975 offsetof (struct window, gutter_size[RIGHT_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
979 fb = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
980 #ifdef HAVE_TTY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
981 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
982 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
983 #ifdef HAVE_X_WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984 fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
986 #ifdef HAVE_MS_WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
987 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
988 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
989 if (!NILP (fb))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
990 set_specifier_fallback (Vdefault_gutter_height, fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
991
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
992 fb = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
993 #ifdef HAVE_TTY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
994 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
995 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
996 #ifdef HAVE_X_WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
997 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_WIDTH)), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
998 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
999 #ifdef HAVE_MS_WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1000 fb = Fcons (Fcons (list1 (Qmswindows),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1001 make_int (DEFAULT_GUTTER_WIDTH)), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1002 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1003 if (!NILP (fb))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1004 set_specifier_fallback (Vdefault_gutter_width, fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1005
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1006 set_specifier_fallback (Vgutter_size[TOP_GUTTER], Vdefault_gutter_height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1007 fb = list1 (Fcons (Qnil, Qzero));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1008 set_specifier_fallback (Vgutter_size[BOTTOM_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1009 set_specifier_fallback (Vgutter_size[LEFT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1010 set_specifier_fallback (Vgutter_size[RIGHT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1011
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1012 DEFVAR_SPECIFIER ("default-gutter-border-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1013 &Vdefault_gutter_border_width /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1014 *Width of the border around the default gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1015 This is a specifier; use `set-specifier' to change it.
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 The position of the default gutter is specified by the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1018 `set-default-gutter-position'. If the corresponding position-specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1019 gutter border width specifier (e.g. `top-gutter-border-width' if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1020 `default-gutter-position' is 'top) does not specify a border width in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1021 particular domain (a window or a frame), then the value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1022 `default-gutter-border-width' in that domain, if any, will be used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1023 instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1024
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1025 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1026 Vdefault_gutter_border_width = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1027 set_specifier_caching (Vdefault_gutter_border_width,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1028 offsetof (struct window, default_gutter_border_width),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1029 default_gutter_border_width_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1030 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1031
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1032 DEFVAR_SPECIFIER ("top-gutter-border-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1033 &Vgutter_border_width[TOP_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1034 *Border width of the top gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1035 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1036
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1037 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1038 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1039 Vgutter_border_width[TOP_GUTTER] = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1040 set_specifier_caching (Vgutter_border_width[TOP_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1041 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1042 gutter_border_width[TOP_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1043 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1044 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1045
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1046 DEFVAR_SPECIFIER ("bottom-gutter-border-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1047 &Vgutter_border_width[BOTTOM_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048 *Border width of the bottom gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1051 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1052 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053 Vgutter_border_width[BOTTOM_GUTTER] = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054 set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1055 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1056 gutter_border_width[BOTTOM_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1057 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1058 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060 DEFVAR_SPECIFIER ("left-gutter-border-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1061 &Vgutter_border_width[LEFT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1062 *Border width of left gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1063 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1064
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1065 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1066 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1067 Vgutter_border_width[LEFT_GUTTER] = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1068 set_specifier_caching (Vgutter_border_width[LEFT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1069 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1070 gutter_border_width[LEFT_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1071 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1072 0, 0);
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 DEFVAR_SPECIFIER ("right-gutter-border-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075 &Vgutter_border_width[RIGHT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1076 *Border width of right gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1077 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1079 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1081 Vgutter_border_width[RIGHT_GUTTER] = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1082 set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1083 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1084 gutter_border_width[RIGHT_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1085 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1086 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1087
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1088 fb = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089 #ifdef HAVE_TTY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1090 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1091 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092 #ifdef HAVE_X_WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1093 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1094 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1095 #ifdef HAVE_MS_WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1096 fb = Fcons (Fcons (list1 (Qmswindows), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1097 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098 if (!NILP (fb))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099 set_specifier_fallback (Vdefault_gutter_border_width, fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1100
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1101 set_specifier_fallback (Vgutter_border_width[TOP_GUTTER], Vdefault_gutter_border_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1102 fb = list1 (Fcons (Qnil, Qzero));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1103 set_specifier_fallback (Vgutter_border_width[BOTTOM_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1104 set_specifier_fallback (Vgutter_border_width[LEFT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1105 set_specifier_fallback (Vgutter_border_width[RIGHT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107 DEFVAR_SPECIFIER ("default-gutter-visible-p", &Vdefault_gutter_visible_p /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108 *Whether the default gutter is visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1110
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1111 The position of the default gutter is specified by the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1112 `set-default-gutter-position'. If the corresponding position-specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1113 gutter visibility specifier (e.g. `top-gutter-visible-p' if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114 `default-gutter-position' is 'top) does not specify a visible-p value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1115 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
1116 `default-gutter-visible-p' in that domain, if any, will be used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1117 instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1118
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1119 `default-gutter-visible-p' and all of the position-specific gutter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1120 visibility specifiers have a fallback value of true.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1121 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1122 Vdefault_gutter_visible_p = Fmake_specifier (Qboolean);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 set_specifier_caching (Vdefault_gutter_visible_p,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1124 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1125 default_gutter_visible_p),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1126 default_gutter_visible_p_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1127 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1128
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1129 DEFVAR_SPECIFIER ("top-gutter-visible-p",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1130 &Vgutter_visible_p[TOP_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1131 *Whether the top gutter is visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1132 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1133
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134 See `default-gutter-visible-p' for more information.
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 Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qboolean);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1137 set_specifier_caching (Vgutter_visible_p[TOP_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1138 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1139 gutter_visible_p[TOP_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1140 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1141 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1142
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1143 DEFVAR_SPECIFIER ("bottom-gutter-visible-p",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1144 &Vgutter_visible_p[BOTTOM_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1145 *Whether the bottom gutter is visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1146 This is a specifier; use `set-specifier' to change it.
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 See `default-gutter-visible-p' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1149 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1150 Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qboolean);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1151 set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1152 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1153 gutter_visible_p[BOTTOM_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1154 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1155 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1156
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1157 DEFVAR_SPECIFIER ("left-gutter-visible-p",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1158 &Vgutter_visible_p[LEFT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 *Whether the left gutter is visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162 See `default-gutter-visible-p' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164 Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qboolean);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1165 set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1166 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1167 gutter_visible_p[LEFT_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1169 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1171 DEFVAR_SPECIFIER ("right-gutter-visible-p",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1172 &Vgutter_visible_p[RIGHT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 *Whether the right gutter is visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1174 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1176 See `default-gutter-visible-p' for more information.
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 Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qboolean);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179 set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1180 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1181 gutter_visible_p[RIGHT_GUTTER]),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182 gutter_geometry_changed_in_window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1183 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185 /* initially, top inherits from default; this can be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 changed with `set-default-gutter-position'. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187 fb = list1 (Fcons (Qnil, Qt));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1188 set_specifier_fallback (Vdefault_gutter_visible_p, fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189 set_specifier_fallback (Vgutter_visible_p[TOP_GUTTER],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1190 Vdefault_gutter_visible_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191 set_specifier_fallback (Vgutter_visible_p[BOTTOM_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192 set_specifier_fallback (Vgutter_visible_p[LEFT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1193 set_specifier_fallback (Vgutter_visible_p[RIGHT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1194
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 }