annotate src/gutter.c @ 400:a86b2b5e0111 r21-2-30

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