aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-03-02 08:22:42 +0000
committerJim Blandy1993-03-02 08:22:42 +0000
commita3c87d4e63e999a3ed18efe60d6b36da3a48a314 (patch)
treed50ead7aaf06c70c637c1136cc042b9c95a8ec60
parentab6482702d926eb46472bbdb4de59d4ad8265316 (diff)
downloademacs-a3c87d4e63e999a3ed18efe60d6b36da3a48a314.tar.gz
emacs-a3c87d4e63e999a3ed18efe60d6b36da3a48a314.zip
Use the term `scroll bar', instead of `scrollbar'.
* alloc.c, frame.c, frame.h, indent.c, keyboard.c, keyboard.h, lisp.h, term.c, termhooks.h, window.c, window.h, xdisp.c, xfns.c, xterm.c, xterm.h: Terminology changed.
-rw-r--r--src/alloc.c4
-rw-r--r--src/frame.h54
-rw-r--r--src/indent.c10
-rw-r--r--src/term.c60
-rw-r--r--src/termhooks.h92
-rw-r--r--src/window.c18
-rw-r--r--src/window.h10
-rw-r--r--src/xfns.c54
-rw-r--r--src/xterm.h114
9 files changed, 208 insertions, 208 deletions
diff --git a/src/alloc.c b/src/alloc.c
index ef8850270d3..0aa7fc3f805 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1534,8 +1534,8 @@ mark_object (objptr)
1534 mark_object (&ptr->selected_window); 1534 mark_object (&ptr->selected_window);
1535 mark_object (&ptr->minibuffer_window); 1535 mark_object (&ptr->minibuffer_window);
1536 mark_object (&ptr->param_alist); 1536 mark_object (&ptr->param_alist);
1537 mark_object (&ptr->scrollbars); 1537 mark_object (&ptr->scroll_bars);
1538 mark_object (&ptr->condemned_scrollbars); 1538 mark_object (&ptr->condemned_scroll_bars);
1539 } 1539 }
1540 break; 1540 break;
1541#endif /* not MULTI_FRAME */ 1541#endif /* not MULTI_FRAME */
diff --git a/src/frame.h b/src/frame.h
index 194b62147da..4c60e880799 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -122,15 +122,15 @@ struct frame
122 or modified with modify-frame-parameters. */ 122 or modified with modify-frame-parameters. */
123 Lisp_Object param_alist; 123 Lisp_Object param_alist;
124 124
125 /* List of scrollbars on this frame. 125 /* List of scroll bars on this frame.
126 Actually, we don't specify exactly what is stored here at all; the 126 Actually, we don't specify exactly what is stored here at all; the
127 scrollbar implementation code can use it to store anything it likes. 127 scroll bar implementation code can use it to store anything it likes.
128 This field is marked by the garbage collector. It is here 128 This field is marked by the garbage collector. It is here
129 instead of in the `display' structure so that the garbage 129 instead of in the `display' structure so that the garbage
130 collector doesn't need to look inside the window-system-dependent 130 collector doesn't need to look inside the window-system-dependent
131 structure. */ 131 structure. */
132 Lisp_Object scrollbars; 132 Lisp_Object scroll_bars;
133 Lisp_Object condemned_scrollbars; 133 Lisp_Object condemned_scroll_bars;
134 134
135 /* The output method says how the contents of this frame 135 /* The output method says how the contents of this frame
136 are displayed. It could be using termcap, or using an X window. */ 136 are displayed. It could be using termcap, or using an X window. */
@@ -189,12 +189,12 @@ struct frame
189 char wants_modeline; 189 char wants_modeline;
190 190
191 /* Non-zero if the hardware device this frame is displaying on can 191 /* Non-zero if the hardware device this frame is displaying on can
192 support scrollbars. */ 192 support scroll bars. */
193 char can_have_scrollbars; 193 char can_have_scroll_bars;
194 194
195 /* If can_have_scrollbars is non-zero, this is non-zero if we should 195 /* If can_have_scroll_bars is non-zero, this is non-zero if we should
196 actually display them on this frame. */ 196 actually display them on this frame. */
197 char has_vertical_scrollbars; 197 char has_vertical_scroll_bars;
198 198
199 /* Non-0 means raise this frame to the top of the heap when selected. */ 199 /* Non-0 means raise this frame to the top of the heap when selected. */
200 char auto_raise; 200 char auto_raise;
@@ -263,10 +263,10 @@ typedef struct frame *FRAME_PTR;
263#define FRAME_MESSAGE_BUF(f) (f)->message_buf 263#define FRAME_MESSAGE_BUF(f) (f)->message_buf
264#define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos 264#define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos
265#define FRAME_FOCUS_FRAME(f) (f)->focus_frame 265#define FRAME_FOCUS_FRAME(f) (f)->focus_frame
266#define FRAME_CAN_HAVE_SCROLLBARS(f) ((f)->can_have_scrollbars) 266#define FRAME_CAN_HAVE_SCROLL_BARS(f) ((f)->can_have_scroll_bars)
267#define FRAME_HAS_VERTICAL_SCROLLBARS(f) ((f)->has_vertical_scrollbars) 267#define FRAME_HAS_VERTICAL_SCROLL_BARS(f) ((f)->has_vertical_scroll_bars)
268#define FRAME_SCROLLBARS(f) ((f)->scrollbars) 268#define FRAME_SCROLL_BARS(f) ((f)->scroll_bars)
269#define FRAME_CONDEMNED_SCROLLBARS(f) ((f)->condemned_scrollbars) 269#define FRAME_CONDEMNED_SCROLL_BARS(f) ((f)->condemned_scroll_bars)
270 270
271/* Emacs's redisplay code could become confused if a frame's 271/* Emacs's redisplay code could become confused if a frame's
272 visibility changes at arbitrary times. For example, if a frame is 272 visibility changes at arbitrary times. For example, if a frame is
@@ -391,11 +391,11 @@ extern int last_nonminibuf_frame;
391#define FRAME_MESSAGE_BUF(f) (the_only_frame.message_buf) 391#define FRAME_MESSAGE_BUF(f) (the_only_frame.message_buf)
392#define FRAME_SCROLL_BOTTOM_VPOS(f) (the_only_frame.scroll_bottom_vpos) 392#define FRAME_SCROLL_BOTTOM_VPOS(f) (the_only_frame.scroll_bottom_vpos)
393#define FRAME_FOCUS_FRAME(f) (Qnil) 393#define FRAME_FOCUS_FRAME(f) (Qnil)
394#define FRAME_CAN_HAVE_SCROLLBARS(f) (the_only_frame.can_have_scrollbars) 394#define FRAME_CAN_HAVE_SCROLL_BARS(f) (the_only_frame.can_have_scroll_bars)
395#define FRAME_HAS_VERTICAL_SCROLLBARS(f) \ 395#define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
396 (the_only_frame.has_vertical_scrollbars) 396 (the_only_frame.has_vertical_scroll_bars)
397#define FRAME_SCROLLBARS(f) (the_only_frame.scrollbars) 397#define FRAME_SCROLL_BARS(f) (the_only_frame.scroll_bars)
398#define FRAME_CONDEMNED_SCROLLBARS(f) (the_only_frame.condemned_scrollbars) 398#define FRAME_CONDEMNED_SCROLL_BARS(f) (the_only_frame.condemned_scroll_bars)
399 399
400/* See comments in definition above. */ 400/* See comments in definition above. */
401#define FRAME_SAMPLE_VISIBILITY(f) (0) 401#define FRAME_SAMPLE_VISIBILITY(f) (0)
@@ -419,22 +419,22 @@ extern int last_nonminibuf_frame;
419#endif /* not MULTI_FRAME */ 419#endif /* not MULTI_FRAME */
420 420
421 421
422/* Device- and MULTI_FRAME-independent scrollbar stuff. */ 422/* Device- and MULTI_FRAME-independent scroll bar stuff. */
423 423
424/* The number of columns a vertical scrollbar occupies. */ 424/* The number of columns a vertical scroll bar occupies. */
425#define VERTICAL_SCROLLBAR_WIDTH (2) 425#define VERTICAL_SCROLL_BAR_WIDTH (2)
426 426
427/* Return the starting column (zero-based) of the vertical scrollbar 427/* Return the starting column (zero-based) of the vertical scroll bar
428 for window W. The column before this one is the last column we can 428 for window W. The column before this one is the last column we can
429 use for text. If the window touches the right edge of the frame, 429 use for text. If the window touches the right edge of the frame,
430 we have extra space allocated for it. Otherwise, the scrollbar 430 we have extra space allocated for it. Otherwise, the scroll bar
431 takes over the window's rightmost columns. */ 431 takes over the window's rightmost columns. */
432#define WINDOW_VERTICAL_SCROLLBAR_COLUMN(w) \ 432#define WINDOW_VERTICAL_SCROLL_BAR_COLUMN(w) \
433 (((XINT ((w)->left) + XINT ((w)->width)) \ 433 (((XINT ((w)->left) + XINT ((w)->width)) \
434 < FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \ 434 < FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \
435 ? XINT ((w)->left) + XINT ((w)->width) - VERTICAL_SCROLLBAR_WIDTH \ 435 ? XINT ((w)->left) + XINT ((w)->width) - VERTICAL_SCROLL_BAR_WIDTH \
436 : FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) 436 : FRAME_WIDTH (XFRAME (WINDOW_FRAME (w))))
437 437
438/* Return the height in lines of the vertical scrollbar in w. If the 438/* Return the height in lines of the vertical scroll bar in w. If the
439 window has a mode line, don't make the scrollbar extend that far. */ 439 window has a mode line, don't make the scroll bar extend that far. */
440#define WINDOW_VERTICAL_SCROLLBAR_HEIGHT(w) (window_internal_height (w)) 440#define WINDOW_VERTICAL_SCROLL_BAR_HEIGHT(w) (window_internal_height (w))
diff --git a/src/indent.c b/src/indent.c
index bcb3fe6169a..f991c56ef25 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -396,15 +396,15 @@ struct position val_compute_motion;
396 When displaying in window w, a typical formula for WIDTH is: 396 When displaying in window w, a typical formula for WIDTH is:
397 397
398 window_width - 1 398 window_width - 1
399 - (has_vertical_scrollbars 399 - (has_vertical_scroll_bars
400 ? VERTICAL_SCROLLBAR_WIDTH 400 ? VERTICAL_SCROLL_BAR_WIDTH
401 : (window_width + window_left != frame_width)) 401 : (window_width + window_left != frame_width))
402 402
403 where 403 where
404 window_width is XFASTINT (w->width), 404 window_width is XFASTINT (w->width),
405 window_left is XFASTINT (w->left), 405 window_left is XFASTINT (w->left),
406 has_vertical_scrollbars is 406 has_vertical_scroll_bars is
407 FRAME_HAS_VERTICAL_SCROLLBARS (XFRAME (WINDOW_FRAME (window))) 407 FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WINDOW_FRAME (window)))
408 and frame_width = FRAME_WIDTH (XFRAME (window->frame)) 408 and frame_width = FRAME_WIDTH (XFRAME (window->frame))
409 409
410 Or, 410 Or,
@@ -412,7 +412,7 @@ struct position val_compute_motion;
412 412
413 The `-1' accounts for the continuation-line backslashes; the rest 413 The `-1' accounts for the continuation-line backslashes; the rest
414 accounts for window borders if the window is split vertically, and 414 accounts for window borders if the window is split vertically, and
415 the scrollbars if the frame supports them. */ 415 the scroll bars if the frame supports them. */
416 416
417struct position * 417struct position *
418compute_motion (from, fromvpos, fromhpos, to, tovpos, tohpos, width, hscroll, tab_offset) 418compute_motion (from, fromvpos, fromhpos, to, tovpos, tohpos, width, hscroll, tab_offset)
diff --git a/src/term.c b/src/term.c
index cd9e5a84a44..3019d63f22b 100644
--- a/src/term.c
+++ b/src/term.c
@@ -99,10 +99,10 @@ int (*read_socket_hook) ();
99 Emacs frame. If it is set to zero, all the other arguments are 99 Emacs frame. If it is set to zero, all the other arguments are
100 garbage. 100 garbage.
101 101
102 If the motion started in a scrollbar, set *bar_window to the 102 If the motion started in a scroll bar, set *bar_window to the
103 scrollbar's window, *part to the part the mouse is currently over, 103 scroll bar's window, *part to the part the mouse is currently over,
104 *x to the position of the mouse along the scrollbar, and *y to the 104 *x to the position of the mouse along the scroll bar, and *y to the
105 overall length of the scrollbar. 105 overall length of the scroll bar.
106 106
107 Otherwise, set *bar_window to Qnil, and *x and *y to the column and 107 Otherwise, set *bar_window to Qnil, and *x and *y to the column and
108 row of the character cell the mouse is over. 108 row of the character cell the mouse is over.
@@ -113,7 +113,7 @@ int (*read_socket_hook) ();
113 event arrives. */ 113 event arrives. */
114void (*mouse_position_hook) ( /* FRAME_PTR *f, 114void (*mouse_position_hook) ( /* FRAME_PTR *f,
115 Lisp_Object *bar_window, 115 Lisp_Object *bar_window,
116 enum scrollbar_part *part, 116 enum scroll_bar_part *part,
117 Lisp_Object *x, 117 Lisp_Object *x,
118 Lisp_Object *y, 118 Lisp_Object *y,
119 unsigned long *time */ ); 119 unsigned long *time */ );
@@ -137,54 +137,54 @@ void (*frame_rehighlight_hook) ( /* FRAME_PTR f */ );
137 windows. */ 137 windows. */
138void (*frame_raise_lower_hook) ( /* FRAME_PTR f, int raise */ ); 138void (*frame_raise_lower_hook) ( /* FRAME_PTR f, int raise */ );
139 139
140/* Set the vertical scrollbar for WINDOW to have its upper left corner 140/* Set the vertical scroll bar for WINDOW to have its upper left corner
141 at (TOP, LEFT), and be LENGTH rows high. Set its handle to 141 at (TOP, LEFT), and be LENGTH rows high. Set its handle to
142 indicate that we are displaying PORTION characters out of a total 142 indicate that we are displaying PORTION characters out of a total
143 of WHOLE characters, starting at POSITION. If WINDOW doesn't yet 143 of WHOLE characters, starting at POSITION. If WINDOW doesn't yet
144 have a scrollbar, create one for it. */ 144 have a scroll bar, create one for it. */
145void (*set_vertical_scrollbar_hook) 145void (*set_vertical_scroll_bar_hook)
146 ( /* struct window *window, 146 ( /* struct window *window,
147 int portion, int whole, int position */ ); 147 int portion, int whole, int position */ );
148 148
149 149
150/* The following three hooks are used when we're doing a thorough 150/* The following three hooks are used when we're doing a thorough
151 redisplay of the frame. We don't explicitly know which scrollbars 151 redisplay of the frame. We don't explicitly know which scroll bars
152 are going to be deleted, because keeping track of when windows go 152 are going to be deleted, because keeping track of when windows go
153 away is a real pain - can you say set-window-configuration? 153 away is a real pain - can you say set-window-configuration?
154 Instead, we just assert at the beginning of redisplay that *all* 154 Instead, we just assert at the beginning of redisplay that *all*
155 scrollbars are to be removed, and then save scrollbars from the 155 scroll bars are to be removed, and then save scroll bars from the
156 firey pit when we actually redisplay their window. */ 156 firey pit when we actually redisplay their window. */
157 157
158/* Arrange for all scrollbars on FRAME to be removed at the next call 158/* Arrange for all scroll bars on FRAME to be removed at the next call
159 to `*judge_scrollbars_hook'. A scrollbar may be spared if 159 to `*judge_scroll_bars_hook'. A scroll bar may be spared if
160 `*redeem_scrollbar_hook' is applied to its window before the judgement. 160 `*redeem_scroll_bar_hook' is applied to its window before the judgement.
161 161
162 This should be applied to each frame each time its window tree is 162 This should be applied to each frame each time its window tree is
163 redisplayed, even if it is not displaying scrollbars at the moment; 163 redisplayed, even if it is not displaying scroll bars at the moment;
164 if the HAS_SCROLLBARS flag has just been turned off, only calling 164 if the HAS_SCROLL_BARS flag has just been turned off, only calling
165 this and the judge_scrollbars_hook will get rid of them. 165 this and the judge_scroll_bars_hook will get rid of them.
166 166
167 If non-zero, this hook should be safe to apply to any frame, 167 If non-zero, this hook should be safe to apply to any frame,
168 whether or not it can support scrollbars, and whether or not it is 168 whether or not it can support scroll bars, and whether or not it is
169 currently displaying them. */ 169 currently displaying them. */
170void (*condemn_scrollbars_hook)( /* FRAME_PTR *frame */ ); 170void (*condemn_scroll_bars_hook)( /* FRAME_PTR *frame */ );
171 171
172/* Unmark WINDOW's scrollbar for deletion in this judgement cycle. 172/* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
173 Note that it's okay to redeem a scrollbar that is not condemned. */ 173 Note that it's okay to redeem a scroll bar that is not condemned. */
174void (*redeem_scrollbar_hook)( /* struct window *window */ ); 174void (*redeem_scroll_bar_hook)( /* struct window *window */ );
175 175
176/* Remove all scrollbars on FRAME that haven't been saved since the 176/* Remove all scroll bars on FRAME that haven't been saved since the
177 last call to `*condemn_scrollbars_hook'. 177 last call to `*condemn_scroll_bars_hook'.
178 178
179 This should be applied to each frame after each time its window 179 This should be applied to each frame after each time its window
180 tree is redisplayed, even if it is not displaying scrollbars at the 180 tree is redisplayed, even if it is not displaying scroll bars at the
181 moment; if the HAS_SCROLLBARS flag has just been turned off, only 181 moment; if the HAS_SCROLL_BARS flag has just been turned off, only
182 calling this and condemn_scrollbars_hook will get rid of them. 182 calling this and condemn_scroll_bars_hook will get rid of them.
183 183
184 If non-zero, this hook should be safe to apply to any frame, 184 If non-zero, this hook should be safe to apply to any frame,
185 whether or not it can support scrollbars, and whether or not it is 185 whether or not it can support scroll bars, and whether or not it is
186 currently displaying them. */ 186 currently displaying them. */
187void (*judge_scrollbars_hook)( /* FRAME_PTR *FRAME */ ); 187void (*judge_scroll_bars_hook)( /* FRAME_PTR *FRAME */ );
188 188
189 189
190/* Strings, numbers and flags taken from the termcap entry. */ 190/* Strings, numbers and flags taken from the termcap entry. */
@@ -1495,8 +1495,8 @@ It may be necessary to do `unsetenv TERMCAP' as well.\n",
1495 /* meaningless in this case */ 1495 /* meaningless in this case */
1496 baud_rate = 9600; 1496 baud_rate = 9600;
1497 1497
1498 FRAME_CAN_HAVE_SCROLLBARS (selected_frame) = 0; 1498 FRAME_CAN_HAVE_SCROLL_BARS (selected_frame) = 0;
1499 FRAME_HAS_VERTICAL_SCROLLBARS (selected_frame) = 0; 1499 FRAME_HAS_VERTICAL_SCROLL_BARS (selected_frame) = 0;
1500} 1500}
1501 1501
1502/* VARARGS 1 */ 1502/* VARARGS 1 */
diff --git a/src/termhooks.h b/src/termhooks.h
index ce9e2ed3d45..9a96b046e4c 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -55,10 +55,10 @@ extern int (*set_terminal_window_hook) ();
55 55
56/* Multi-frame and mouse support hooks. */ 56/* Multi-frame and mouse support hooks. */
57 57
58enum scrollbar_part { 58enum scroll_bar_part {
59 scrollbar_above_handle, 59 scroll_bar_above_handle,
60 scrollbar_handle, 60 scroll_bar_handle,
61 scrollbar_below_handle 61 scroll_bar_below_handle
62}; 62};
63 63
64/* Return the current position of the mouse. 64/* Return the current position of the mouse.
@@ -67,10 +67,10 @@ enum scrollbar_part {
67 Emacs frame. If it is set to zero, all the other arguments are 67 Emacs frame. If it is set to zero, all the other arguments are
68 garbage. 68 garbage.
69 69
70 If the motion started in a scrollbar, set *bar_window to the 70 If the motion started in a scroll bar, set *bar_window to the
71 scrollbar's window, *part to the part the mouse is currently over, 71 scroll bar's window, *part to the part the mouse is currently over,
72 *x to the position of the mouse along the scrollbar, and *y to the 72 *x to the position of the mouse along the scroll bar, and *y to the
73 overall length of the scrollbar. 73 overall length of the scroll bar.
74 74
75 Otherwise, set *bar_window to Qnil, and *x and *y to the column and 75 Otherwise, set *bar_window to Qnil, and *x and *y to the column and
76 row of the character cell the mouse is over. 76 row of the character cell the mouse is over.
@@ -81,7 +81,7 @@ enum scrollbar_part {
81 event arrives. */ 81 event arrives. */
82extern void (*mouse_position_hook) ( /* FRAME_PTR *f, 82extern void (*mouse_position_hook) ( /* FRAME_PTR *f,
83 Lisp_Object *bar_window, 83 Lisp_Object *bar_window,
84 enum scrollbar_part *part, 84 enum scroll_bar_part *part,
85 Lisp_Object *x, 85 Lisp_Object *x,
86 Lisp_Object *y, 86 Lisp_Object *y,
87 unsigned long *time */ ); 87 unsigned long *time */ );
@@ -109,76 +109,76 @@ extern void (*frame_rehighlight_hook) ( /* void */ );
109extern void (*frame_raise_lower_hook) ( /* FRAME_PTR f, int raise */ ); 109extern void (*frame_raise_lower_hook) ( /* FRAME_PTR f, int raise */ );
110 110
111 111
112/* Scrollbar hooks. */ 112/* Scroll bar hooks. */
113 113
114/* The representation of scrollbars is determined by the code which 114/* The representation of scroll bars is determined by the code which
115 implements them, except for one thing: they must be represented by 115 implements them, except for one thing: they must be represented by
116 lisp objects. This allows us to place references to them in 116 lisp objects. This allows us to place references to them in
117 Lisp_Windows without worrying about those references becoming 117 Lisp_Windows without worrying about those references becoming
118 dangling references when the scrollbar is destroyed. 118 dangling references when the scroll bar is destroyed.
119 119
120 The window-system-independent portion of Emacs just refers to 120 The window-system-independent portion of Emacs just refers to
121 scrollbars via their windows, and never looks inside the scrollbar 121 scroll bars via their windows, and never looks inside the scroll bar
122 representation; it always uses hook functions to do all the 122 representation; it always uses hook functions to do all the
123 scrollbar manipulation it needs. 123 scroll bar manipulation it needs.
124 124
125 The `vertical_scrollbar' field of a Lisp_Window refers to that 125 The `vertical_scroll_bar' field of a Lisp_Window refers to that
126 window's scrollbar, or is nil if the window doesn't have a 126 window's scroll bar, or is nil if the window doesn't have a
127 scrollbar. 127 scroll bar.
128 128
129 The `scrollbars' and `condemned_scrollbars' fields of a Lisp_Frame 129 The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame
130 are free for use by the scrollbar implementation in any way it sees 130 are free for use by the scroll bar implementation in any way it sees
131 fit. They are marked by the garbage collector. */ 131 fit. They are marked by the garbage collector. */
132 132
133 133
134/* Set the vertical scrollbar for WINDOW to have its upper left corner 134/* Set the vertical scroll bar for WINDOW to have its upper left corner
135 at (TOP, LEFT), and be LENGTH rows high. Set its handle to 135 at (TOP, LEFT), and be LENGTH rows high. Set its handle to
136 indicate that we are displaying PORTION characters out of a total 136 indicate that we are displaying PORTION characters out of a total
137 of WHOLE characters, starting at POSITION. If WINDOW doesn't yet 137 of WHOLE characters, starting at POSITION. If WINDOW doesn't yet
138 have a scrollbar, create one for it. */ 138 have a scroll bar, create one for it. */
139extern void (*set_vertical_scrollbar_hook) 139extern void (*set_vertical_scroll_bar_hook)
140 ( /* struct window *window, 140 ( /* struct window *window,
141 int portion, int whole, int position */ ); 141 int portion, int whole, int position */ );
142 142
143 143
144/* The following three hooks are used when we're doing a thorough 144/* The following three hooks are used when we're doing a thorough
145 redisplay of the frame. We don't explicitly know which scrollbars 145 redisplay of the frame. We don't explicitly know which scroll bars
146 are going to be deleted, because keeping track of when windows go 146 are going to be deleted, because keeping track of when windows go
147 away is a real pain - can you say set-window-configuration? 147 away is a real pain - can you say set-window-configuration?
148 Instead, we just assert at the beginning of redisplay that *all* 148 Instead, we just assert at the beginning of redisplay that *all*
149 scrollbars are to be removed, and then save scrollbars from the 149 scroll bars are to be removed, and then save scroll bars from the
150 firey pit when we actually redisplay their window. */ 150 firey pit when we actually redisplay their window. */
151 151
152/* Arrange for all scrollbars on FRAME to be removed at the next call 152/* Arrange for all scroll bars on FRAME to be removed at the next call
153 to `*judge_scrollbars_hook'. A scrollbar may be spared if 153 to `*judge_scroll_bars_hook'. A scroll bar may be spared if
154 `*redeem_scrollbar_hook' is applied to its window before the judgement. 154 `*redeem_scroll_bar_hook' is applied to its window before the judgement.
155 155
156 This should be applied to each frame each time its window tree is 156 This should be applied to each frame each time its window tree is
157 redisplayed, even if it is not displaying scrollbars at the moment; 157 redisplayed, even if it is not displaying scroll bars at the moment;
158 if the HAS_SCROLLBARS flag has just been turned off, only calling 158 if the HAS_SCROLL_BARS flag has just been turned off, only calling
159 this and the judge_scrollbars_hook will get rid of them. 159 this and the judge_scroll_bars_hook will get rid of them.
160 160
161 If non-zero, this hook should be safe to apply to any frame, 161 If non-zero, this hook should be safe to apply to any frame,
162 whether or not it can support scrollbars, and whether or not it is 162 whether or not it can support scroll bars, and whether or not it is
163 currently displaying them. */ 163 currently displaying them. */
164extern void (*condemn_scrollbars_hook)( /* FRAME_PTR *frame */ ); 164extern void (*condemn_scroll_bars_hook)( /* FRAME_PTR *frame */ );
165 165
166/* Unmark WINDOW's scrollbar for deletion in this judgement cycle. 166/* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
167 Note that it's okay to redeem a scrollbar that is not condemned. */ 167 Note that it's okay to redeem a scroll bar that is not condemned. */
168extern void (*redeem_scrollbar_hook)( /* struct window *window */ ); 168extern void (*redeem_scroll_bar_hook)( /* struct window *window */ );
169 169
170/* Remove all scrollbars on FRAME that haven't been saved since the 170/* Remove all scroll bars on FRAME that haven't been saved since the
171 last call to `*condemn_scrollbars_hook'. 171 last call to `*condemn_scroll_bars_hook'.
172 172
173 This should be applied to each frame after each time its window 173 This should be applied to each frame after each time its window
174 tree is redisplayed, even if it is not displaying scrollbars at the 174 tree is redisplayed, even if it is not displaying scroll bars at the
175 moment; if the HAS_SCROLLBARS flag has just been turned off, only 175 moment; if the HAS_SCROLL_BARS flag has just been turned off, only
176 calling this and condemn_scrollbars_hook will get rid of them. 176 calling this and condemn_scroll_bars_hook will get rid of them.
177 177
178 If non-zero, this hook should be safe to apply to any frame, 178 If non-zero, this hook should be safe to apply to any frame,
179 whether or not it can support scrollbars, and whether or not it is 179 whether or not it can support scroll bars, and whether or not it is
180 currently displaying them. */ 180 currently displaying them. */
181extern void (*judge_scrollbars_hook)( /* FRAME_PTR *FRAME */ ); 181extern void (*judge_scroll_bars_hook)( /* FRAME_PTR *FRAME */ );
182 182
183 183
184/* Input queue declarations and hooks. */ 184/* Input queue declarations and hooks. */
@@ -232,23 +232,23 @@ struct input_event {
232 the mouse click occurred in. 232 the mouse click occurred in.
233 .timestamp gives a timestamp (in 233 .timestamp gives a timestamp (in
234 milliseconds) for the click. */ 234 milliseconds) for the click. */
235 scrollbar_click, /* .code gives the number of the mouse button 235 scroll_bar_click, /* .code gives the number of the mouse button
236 that was clicked. 236 that was clicked.
237 .modifiers holds the state of the modifier 237 .modifiers holds the state of the modifier
238 keys. 238 keys.
239 .part is a lisp symbol indicating which 239 .part is a lisp symbol indicating which
240 part of the scrollbar got clicked. 240 part of the scroll bar got clicked.
241 .x gives the distance from the start of the 241 .x gives the distance from the start of the
242 scroll bar of the click; .y gives the total 242 scroll bar of the click; .y gives the total
243 length of the scroll bar. 243 length of the scroll bar.
244 .frame_or_window gives the window 244 .frame_or_window gives the window
245 whose scrollbar was clicked in. 245 whose scroll bar was clicked in.
246 .timestamp gives a timestamp (in 246 .timestamp gives a timestamp (in
247 milliseconds) for the click. */ 247 milliseconds) for the click. */
248 } kind; 248 } kind;
249 249
250 Lisp_Object code; 250 Lisp_Object code;
251 enum scrollbar_part part; 251 enum scroll_bar_part part;
252 252
253 /* This field is copied into a vector while the event is in the queue, 253 /* This field is copied into a vector while the event is in the queue,
254 so that garbage collections won't kill it. */ 254 so that garbage collections won't kill it. */
diff --git a/src/window.c b/src/window.c
index 82e39545a23..ab81e806aba 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2038,7 +2038,7 @@ window_internal_height (w)
2038 2038
2039 2039
2040/* Return the number of columns in W. 2040/* Return the number of columns in W.
2041 Don't count columns occupied by scrollbars or the vertical bar 2041 Don't count columns occupied by scroll bars or the vertical bar
2042 separating W from the sibling to its right. */ 2042 separating W from the sibling to its right. */
2043int 2043int
2044window_internal_width (w) 2044window_internal_width (w)
@@ -2056,9 +2056,9 @@ window_internal_width (w)
2056 /* If we are not flush right, then our rightmost columns are 2056 /* If we are not flush right, then our rightmost columns are
2057 occupied by some sort of separator. */ 2057 occupied by some sort of separator. */
2058 2058
2059 /* Scrollbars occupy a few columns. */ 2059 /* Scroll bars occupy a few columns. */
2060 if (FRAME_HAS_VERTICAL_SCROLLBARS (f)) 2060 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f))
2061 return width - VERTICAL_SCROLLBAR_WIDTH; 2061 return width - VERTICAL_SCROLL_BAR_WIDTH;
2062 2062
2063 /* The column of `|' characters separating side-by-side windows 2063 /* The column of `|' characters separating side-by-side windows
2064 occupies one column only. */ 2064 occupies one column only. */
@@ -2899,13 +2899,13 @@ work using this function.");
2899 ((X-POS Y-POS) WINDOW FRAME-PART KEYSEQ).\n\ 2899 ((X-POS Y-POS) WINDOW FRAME-PART KEYSEQ).\n\
2900KEYSEQ is a string, the key sequence to be looked up in the mouse maps.\n\ 2900KEYSEQ is a string, the key sequence to be looked up in the mouse maps.\n\
2901WINDOW is the window that the click applies do.\n\ 2901WINDOW is the window that the click applies do.\n\
2902If FRAME-PART is non-nil, the event was on a scrollbar;\n\ 2902If FRAME-PART is non-nil, the event was on a scroll bar;\n\
2903then Y-POS is really the total length of the scrollbar, while X-POS is\n\ 2903then Y-POS is really the total length of the scroll bar, while X-POS is\n\
2904the relative position of the scrollbar's value within that total length.\n\ 2904the relative position of the scroll bar's value within that total length.\n\
2905FRAME-PART is one of the following symbols:\n\ 2905FRAME-PART is one of the following symbols:\n\
2906 `vertical-scrollbar', `vertical-slider',\n\ 2906 `vertical-scroll-bar', `vertical-slider',\n\
2907 `vertical-thumbup', `vertical-thumbdown',\n\ 2907 `vertical-thumbup', `vertical-thumbdown',\n\
2908 `horizontal-scrollbar', `horizontal-slider',\n\ 2908 `horizontal-scroll-bar', `horizontal-slider',\n\
2909 `horizontal-thumbleft', `horizontal-thumbright'"); 2909 `horizontal-thumbleft', `horizontal-thumbright'");
2910 Vmouse_event = Qnil; 2910 Vmouse_event = Qnil;
2911 2911
diff --git a/src/window.h b/src/window.h
index 000afe3466b..cf43f508845 100644
--- a/src/window.h
+++ b/src/window.h
@@ -123,12 +123,12 @@ struct window
123 Lisp_Object last_modified; 123 Lisp_Object last_modified;
124 /* Value of point at that time */ 124 /* Value of point at that time */
125 Lisp_Object last_point; 125 Lisp_Object last_point;
126 /* This window's vertical scrollbar. This field is only for use 126 /* This window's vertical scroll bar. This field is only for use
127 by the window-system-dependent code which implements the 127 by the window-system-dependent code which implements the
128 scrollbars; it can store anything it likes here. If this 128 scroll bars; it can store anything it likes here. If this
129 window is newly created and we haven't displayed a scrollbar in 129 window is newly created and we haven't displayed a scroll bar in
130 it yet, or if the frame doesn't have any scrollbars, this is nil. */ 130 it yet, or if the frame doesn't have any scroll bars, this is nil. */
131 Lisp_Object vertical_scrollbar; 131 Lisp_Object vertical_scroll_bar;
132 132
133/* The rest are currently not used or only half used */ 133/* The rest are currently not used or only half used */
134 /* Frame coords of point at that time */ 134 /* Frame coords of point at that time */
diff --git a/src/xfns.c b/src/xfns.c
index 458f2e45529..54594e3f200 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -245,7 +245,7 @@ Lisp_Object Qsuppress_icon;
245Lisp_Object Qsuppress_initial_map; 245Lisp_Object Qsuppress_initial_map;
246Lisp_Object Qtop; 246Lisp_Object Qtop;
247Lisp_Object Qundefined_color; 247Lisp_Object Qundefined_color;
248Lisp_Object Qvertical_scrollbars; 248Lisp_Object Qvertical_scroll_bars;
249Lisp_Object Qwindow_id; 249Lisp_Object Qwindow_id;
250Lisp_Object Qx_frame_parameter; 250Lisp_Object Qx_frame_parameter;
251 251
@@ -306,7 +306,7 @@ enum x_frame_parm
306 X_PARM_NAME, 306 X_PARM_NAME,
307 X_PARM_AUTORAISE, 307 X_PARM_AUTORAISE,
308 X_PARM_AUTOLOWER, 308 X_PARM_AUTOLOWER,
309 X_PARM_VERT_SCROLLBAR, 309 X_PARM_VERT_SCROLL_BAR,
310}; 310};
311 311
312 312
@@ -329,7 +329,7 @@ void x_set_internal_border_width ();
329void x_explicitly_set_name (); 329void x_explicitly_set_name ();
330void x_set_autoraise (); 330void x_set_autoraise ();
331void x_set_autolower (); 331void x_set_autolower ();
332void x_set_vertical_scrollbars (); 332void x_set_vertical_scroll_bars ();
333 333
334static struct x_frame_parm_table x_frame_parms[] = 334static struct x_frame_parm_table x_frame_parms[] =
335{ 335{
@@ -346,7 +346,7 @@ static struct x_frame_parm_table x_frame_parms[] =
346 "name", x_explicitly_set_name, 346 "name", x_explicitly_set_name,
347 "auto-raise", x_set_autoraise, 347 "auto-raise", x_set_autoraise,
348 "auto-lower", x_set_autolower, 348 "auto-lower", x_set_autolower,
349 "vertical-scrollbars", x_set_vertical_scrollbars, 349 "vertical-scroll-bars", x_set_vertical_scroll_bars,
350}; 350};
351 351
352/* Attach the `x-frame-parameter' properties to 352/* Attach the `x-frame-parameter' properties to
@@ -1043,13 +1043,13 @@ x_set_autolower (f, arg, oldval)
1043} 1043}
1044 1044
1045void 1045void
1046x_set_vertical_scrollbars (f, arg, oldval) 1046x_set_vertical_scroll_bars (f, arg, oldval)
1047 struct frame *f; 1047 struct frame *f;
1048 Lisp_Object arg, oldval; 1048 Lisp_Object arg, oldval;
1049{ 1049{
1050 if (NILP (arg) != ! FRAME_HAS_VERTICAL_SCROLLBARS (f)) 1050 if (NILP (arg) != ! FRAME_HAS_VERTICAL_SCROLL_BARS (f))
1051 { 1051 {
1052 FRAME_HAS_VERTICAL_SCROLLBARS (f) = ! NILP (arg); 1052 FRAME_HAS_VERTICAL_SCROLL_BARS (f) = ! NILP (arg);
1053 1053
1054 /* We set this parameter before creating the X window for the 1054 /* We set this parameter before creating the X window for the
1055 frame, so we can get the geometry right from the start. 1055 frame, so we can get the geometry right from the start.
@@ -1594,9 +1594,9 @@ x_figure_window_size (f, parms)
1594 else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) 1594 else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
1595 error ("Must specify *both* height and width"); 1595 error ("Must specify *both* height and width");
1596 1596
1597 f->display.x->vertical_scrollbar_extra = 1597 f->display.x->vertical_scroll_bar_extra =
1598 (FRAME_HAS_VERTICAL_SCROLLBARS (f) 1598 (FRAME_HAS_VERTICAL_SCROLL_BARS (f)
1599 ? VERTICAL_SCROLLBAR_PIXEL_WIDTH (f) 1599 ? VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f)
1600 : 0); 1600 : 0);
1601 f->display.x->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width); 1601 f->display.x->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
1602 f->display.x->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height); 1602 f->display.x->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
@@ -1859,8 +1859,8 @@ be shared by the new frame.")
1859 else 1859 else
1860 f = make_frame (1); 1860 f = make_frame (1);
1861 1861
1862 /* Note that X Windows does support scrollbars. */ 1862 /* Note that X Windows does support scroll bars. */
1863 FRAME_CAN_HAVE_SCROLLBARS (f) = 1; 1863 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
1864 1864
1865 /* Set the name; the functions to which we pass f expect the name to 1865 /* Set the name; the functions to which we pass f expect the name to
1866 be set. */ 1866 be set. */
@@ -1892,8 +1892,8 @@ be shared by the new frame.")
1892 /* This defaults to 2 in order to match xterm. */ 1892 /* This defaults to 2 in order to match xterm. */
1893 x_default_parameter (f, parms, Qinternal_border_width, make_number (2), 1893 x_default_parameter (f, parms, Qinternal_border_width, make_number (2),
1894 "internalBorderWidth", "BorderWidth", number); 1894 "internalBorderWidth", "BorderWidth", number);
1895 x_default_parameter (f, parms, Qvertical_scrollbars, Qt, 1895 x_default_parameter (f, parms, Qvertical_scroll_bars, Qt,
1896 "verticalScrollbars", "Scrollbars", boolean); 1896 "verticalScrollBars", "ScrollBars", boolean);
1897 1897
1898 /* Also do the stuff which must be set before the window exists. */ 1898 /* Also do the stuff which must be set before the window exists. */
1899 x_default_parameter (f, parms, Qforeground_color, build_string ("black"), 1899 x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
@@ -3103,7 +3103,7 @@ DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 1, 1, "e",
3103 BLOCK_INPUT; 3103 BLOCK_INPUT;
3104 } 3104 }
3105 while (XTYPE (obj) == Lisp_Cons /* Mouse event */ 3105 while (XTYPE (obj) == Lisp_Cons /* Mouse event */
3106 && EQ (Fcar (Fcdr (Fcdr (obj))), Qnil) /* Not scrollbar */ 3106 && EQ (Fcar (Fcdr (Fcdr (obj))), Qnil) /* Not scroll bar */
3107 && EQ (Vmouse_depressed, Qnil) /* Only motion events */ 3107 && EQ (Vmouse_depressed, Qnil) /* Only motion events */
3108 && EQ (Vmouse_window, selected_window) /* In this window */ 3108 && EQ (Vmouse_window, selected_window) /* In this window */
3109 && x_mouse_frame); 3109 && x_mouse_frame);
@@ -3207,14 +3207,14 @@ otherwise, wait for an event. Returns a four-part list:\n\
3207Normally X-POS and Y-POS are the position of the click on the frame\n\ 3207Normally X-POS and Y-POS are the position of the click on the frame\n\
3208 (measured in characters and lines), and WINDOW is the window clicked in.\n\ 3208 (measured in characters and lines), and WINDOW is the window clicked in.\n\
3209KEYSEQ is a string, the key sequence to be looked up in the mouse maps.\n\ 3209KEYSEQ is a string, the key sequence to be looked up in the mouse maps.\n\
3210If FRAME-PART is non-nil, the event was on a scrollbar;\n\ 3210If FRAME-PART is non-nil, the event was on a scroll bar;\n\
3211then Y-POS is really the total length of the scrollbar, while X-POS is\n\ 3211then Y-POS is really the total length of the scroll bar, while X-POS is\n\
3212the relative position of the scrollbar's value within that total length,\n\ 3212the relative position of the scroll bar's value within that total length,\n\
3213and a third element OFFSET appears in that list: the height of the thumb-up\n\ 3213and a third element OFFSET appears in that list: the height of the thumb-up\n\
3214area at the top of the scroll bar.\n\ 3214area at the top of the scroll bar.\n\
3215FRAME-PART is one of the following symbols:\n\ 3215FRAME-PART is one of the following symbols:\n\
3216 `vertical-scrollbar', `vertical-thumbup', `vertical-thumbdown',\n\ 3216 `vertical-scroll-bar', `vertical-thumbup', `vertical-thumbdown',\n\
3217 `horizontal-scrollbar', `horizontal-thumbleft', `horizontal-thumbright'.\n\ 3217 `horizontal-scroll-bar', `horizontal-thumbleft', `horizontal-thumbright'.\n\
3218TIMESTAMP is the lower 23 bits of the X-server's timestamp for\n\ 3218TIMESTAMP is the lower 23 bits of the X-server's timestamp for\n\
3219the mouse event.") 3219the mouse event.")
3220 (arg) 3220 (arg)
@@ -3275,7 +3275,7 @@ the mouse event.")
3275 Fcons (timestamp, Qnil))))); 3275 Fcons (timestamp, Qnil)))));
3276 return Vmouse_event; 3276 return Vmouse_event;
3277 } 3277 }
3278 else if ((f = x_window_to_scrollbar (xrep.MouseWindow, &part, &prefix)) != 0) 3278 else if ((f = x_window_to_scroll_bar (xrep.MouseWindow, &part, &prefix)) != 0)
3279 { 3279 {
3280 int pos, len; 3280 int pos, len;
3281 Lisp_Object keyseq; 3281 Lisp_Object keyseq;
@@ -3284,17 +3284,17 @@ the mouse event.")
3284 keyseq = concat2 (Fchar_to_string (make_number (prefix)), 3284 keyseq = concat2 (Fchar_to_string (make_number (prefix)),
3285 Fchar_to_string (make_number (com_letter))); 3285 Fchar_to_string (make_number (com_letter)));
3286 3286
3287 pos = xrep.MouseY - (f->display.x->v_scrollbar_width - 2); 3287 pos = xrep.MouseY - (f->display.x->v_scroll_bar_width - 2);
3288 XSET (tempx, Lisp_Int, pos); 3288 XSET (tempx, Lisp_Int, pos);
3289 len = ((FONT_HEIGHT (f->display.x->font) * f->height) 3289 len = ((FONT_HEIGHT (f->display.x->font) * f->height)
3290 + f->display.x->internal_border_width 3290 + f->display.x->internal_border_width
3291 - (2 * (f->display.x->v_scrollbar_width - 2))); 3291 - (2 * (f->display.x->v_scroll_bar_width - 2)));
3292 XSET (tempy, Lisp_Int, len); 3292 XSET (tempy, Lisp_Int, len);
3293 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff)); 3293 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff));
3294 Vmouse_window = f->selected_window; 3294 Vmouse_window = f->selected_window;
3295 Vmouse_event 3295 Vmouse_event
3296 = Fcons (Fcons (tempx, Fcons (tempy, 3296 = Fcons (Fcons (tempx, Fcons (tempy,
3297 Fcons (make_number (f->display.x->v_scrollbar_width - 2), 3297 Fcons (make_number (f->display.x->v_scroll_bar_width - 2),
3298 Qnil))), 3298 Qnil))),
3299 Fcons (Vmouse_window, 3299 Fcons (Vmouse_window,
3300 Fcons (intern (part), 3300 Fcons (intern (part),
@@ -3344,7 +3344,7 @@ the mouse event.")
3344 default: 3344 default:
3345 if (f = x_window_to_frame (xrep.MouseWindow)) 3345 if (f = x_window_to_frame (xrep.MouseWindow))
3346 Vmouse_window = f->selected_window; 3346 Vmouse_window = f->selected_window;
3347 else if (f = x_window_to_scrollbar (xrep.MouseWindow, &part, &prefix)) 3347 else if (f = x_window_to_scroll_bar (xrep.MouseWindow, &part, &prefix))
3348 Vmouse_window = f->selected_window; 3348 Vmouse_window = f->selected_window;
3349 return Vmouse_event = Qnil; 3349 return Vmouse_event = Qnil;
3350 } 3350 }
@@ -3823,8 +3823,8 @@ syms_of_xfns ()
3823 staticpro (&Qtop); 3823 staticpro (&Qtop);
3824 Qundefined_color = intern ("undefined-color"); 3824 Qundefined_color = intern ("undefined-color");
3825 staticpro (&Qundefined_color); 3825 staticpro (&Qundefined_color);
3826 Qvertical_scrollbars = intern ("vertical-scrollbars"); 3826 Qvertical_scroll_bars = intern ("vertical-scroll-bars");
3827 staticpro (&Qvertical_scrollbars); 3827 staticpro (&Qvertical_scroll_bars);
3828 Qwindow_id = intern ("window-id"); 3828 Qwindow_id = intern ("window-id");
3829 staticpro (&Qwindow_id); 3829 staticpro (&Qwindow_id);
3830 Qx_frame_parameter = intern ("x-frame-parameter"); 3830 Qx_frame_parameter = intern ("x-frame-parameter");
diff --git a/src/xterm.h b/src/xterm.h
index 025e277a22f..b0744a0cfe2 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -335,8 +335,8 @@ struct x_display
335 XWMHints wm_hints; 335 XWMHints wm_hints;
336 336
337 /* The size of the extra width currently allotted for vertical 337 /* The size of the extra width currently allotted for vertical
338 scrollbars, in pixels. */ 338 scroll bars, in pixels. */
339 int vertical_scrollbar_extra; 339 int vertical_scroll_bar_extra;
340}; 340};
341 341
342/* Return the window associated with the frame F. */ 342/* Return the window associated with the frame F. */
@@ -377,130 +377,130 @@ struct face
377extern struct face *x_face_table[]; 377extern struct face *x_face_table[];
378 378
379 379
380/* X-specific scrollbar stuff. */ 380/* X-specific scroll bar stuff. */
381 381
382/* We represent scrollbars as lisp vectors. This allows us to place 382/* We represent scroll bars as lisp vectors. This allows us to place
383 references to them in windows without worrying about whether we'll 383 references to them in windows without worrying about whether we'll
384 end up with windows referring to dead scrollbars; the garbage 384 end up with windows referring to dead scroll bars; the garbage
385 collector will free it when its time comes. 385 collector will free it when its time comes.
386 386
387 We use struct scrollbar as a template for accessing fields of the 387 We use struct scroll_bar as a template for accessing fields of the
388 vector. */ 388 vector. */
389 389
390struct scrollbar { 390struct scroll_bar {
391 391
392 /* These fields are shared by all vectors. */ 392 /* These fields are shared by all vectors. */
393 int size_from_Lisp_Vector_struct; 393 int size_from_Lisp_Vector_struct;
394 struct Lisp_Vector *next_from_Lisp_Vector_struct; 394 struct Lisp_Vector *next_from_Lisp_Vector_struct;
395 395
396 /* The window we're a scrollbar for. */ 396 /* The window we're a scroll bar for. */
397 Lisp_Object window; 397 Lisp_Object window;
398 398
399 /* The next and previous in the chain of scrollbars in this frame. */ 399 /* The next and previous in the chain of scroll bars in this frame. */
400 Lisp_Object next, prev; 400 Lisp_Object next, prev;
401 401
402 /* The X window representing this scrollbar. Since this is a full 402 /* The X window representing this scroll bar. Since this is a full
403 32-bit quantity, we store it split into two 32-bit values. */ 403 32-bit quantity, we store it split into two 32-bit values. */
404 Lisp_Object x_window_low, x_window_high; 404 Lisp_Object x_window_low, x_window_high;
405 405
406 /* The position and size of the scrollbar in pixels, relative to the 406 /* The position and size of the scroll bar in pixels, relative to the
407 frame. */ 407 frame. */
408 Lisp_Object top, left, width, height; 408 Lisp_Object top, left, width, height;
409 409
410 /* The starting and ending positions of the handle, relative to the 410 /* The starting and ending positions of the handle, relative to the
411 handle area (i.e. zero is the top position, not 411 handle area (i.e. zero is the top position, not
412 SCROLLBAR_TOP_BORDER). If they're equal, that means the handle 412 SCROLL_BAR_TOP_BORDER). If they're equal, that means the handle
413 hasn't been drawn yet. 413 hasn't been drawn yet.
414 414
415 These are not actually the locations where the beginning and end 415 These are not actually the locations where the beginning and end
416 are drawn; in order to keep handles from becoming invisible when 416 are drawn; in order to keep handles from becoming invisible when
417 editing large files, we establish a minimum height by always 417 editing large files, we establish a minimum height by always
418 drawing handle bottoms VERTICAL_SCROLLBAR_MIN_HANDLE pixels below 418 drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below
419 where they would be normally; the bottom and top are in a 419 where they would be normally; the bottom and top are in a
420 different co-ordinate system. */ 420 different co-ordinate system. */
421 Lisp_Object start, end; 421 Lisp_Object start, end;
422 422
423 /* If the scrollbar handle is currently being dragged by the user, 423 /* If the scroll bar handle is currently being dragged by the user,
424 this is the number of pixels from the top of the handle to the 424 this is the number of pixels from the top of the handle to the
425 place where the user grabbed it. If the handle isn't currently 425 place where the user grabbed it. If the handle isn't currently
426 being dragged, this is Qnil. */ 426 being dragged, this is Qnil. */
427 Lisp_Object dragging; 427 Lisp_Object dragging;
428}; 428};
429 429
430/* The number of elements a vector holding a struct scrollbar needs. */ 430/* The number of elements a vector holding a struct scroll_bar needs. */
431#define SCROLLBAR_VEC_SIZE \ 431#define SCROLL_BAR_VEC_SIZE \
432 ((sizeof (struct scrollbar) - sizeof (int) - sizeof (struct Lisp_Vector *)) \ 432 ((sizeof (struct scroll_bar) - sizeof (int) - sizeof (struct Lisp_Vector *)) \
433 / sizeof (Lisp_Object)) 433 / sizeof (Lisp_Object))
434 434
435/* Turning a lisp vector value into a pointer to a struct scrollbar. */ 435/* Turning a lisp vector value into a pointer to a struct scroll_bar. */
436#define XSCROLLBAR(vec) ((struct scrollbar *) XPNTR (vec)) 436#define XSCROLL_BAR(vec) ((struct scroll_bar *) XPNTR (vec))
437 437
438 438
439/* Building a 32-bit C integer from two 16-bit lisp integers. */ 439/* Building a 32-bit C integer from two 16-bit lisp integers. */
440#define SCROLLBAR_PACK(low, high) (XINT (high) << 16 | XINT (low)) 440#define SCROLL_BAR_PACK(low, high) (XINT (high) << 16 | XINT (low))
441 441
442/* Setting two lisp integers to the low and high words of a 32-bit C int. */ 442/* Setting two lisp integers to the low and high words of a 32-bit C int. */
443#define SCROLLBAR_UNPACK(low, high, int32) \ 443#define SCROLL_BAR_UNPACK(low, high, int32) \
444 (XSET ((low), Lisp_Int, (int32) & 0xffff), \ 444 (XSET ((low), Lisp_Int, (int32) & 0xffff), \
445 XSET ((high), Lisp_Int, ((int32) >> 16) & 0xffff)) 445 XSET ((high), Lisp_Int, ((int32) >> 16) & 0xffff))
446 446
447 447
448/* Extract the X window id of the scrollbar from a struct scrollbar. */ 448/* Extract the X window id of the scroll bar from a struct scroll_bar. */
449#define SCROLLBAR_X_WINDOW(ptr) \ 449#define SCROLL_BAR_X_WINDOW(ptr) \
450 ((Window) SCROLLBAR_PACK ((ptr)->x_window_low, (ptr)->x_window_high)) 450 ((Window) SCROLL_BAR_PACK ((ptr)->x_window_low, (ptr)->x_window_high))
451 451
452/* Store a window id in a struct scrollbar. */ 452/* Store a window id in a struct scroll_bar. */
453#define SET_SCROLLBAR_X_WINDOW(ptr, id) \ 453#define SET_SCROLL_BAR_X_WINDOW(ptr, id) \
454 (SCROLLBAR_UNPACK ((ptr)->x_window_low, (ptr)->x_window_high, (int) id)) 454 (SCROLL_BAR_UNPACK ((ptr)->x_window_low, (ptr)->x_window_high, (int) id))
455 455
456 456
457/* Return the outside pixel width for a vertical scrollbar on frame F. */ 457/* Return the outside pixel width for a vertical scroll bar on frame F. */
458#define VERTICAL_SCROLLBAR_PIXEL_WIDTH(f) (2*FONT_WIDTH ((f)->display.x->font)) 458#define VERTICAL_SCROLL_BAR_PIXEL_WIDTH(f) (2*FONT_WIDTH ((f)->display.x->font))
459 459
460/* Return the outside pixel height for a vertical scrollbar HEIGHT 460/* Return the outside pixel height for a vertical scroll bar HEIGHT
461 rows high on frame F. */ 461 rows high on frame F. */
462#define VERTICAL_SCROLLBAR_PIXEL_HEIGHT(f, height) \ 462#define VERTICAL_SCROLL_BAR_PIXEL_HEIGHT(f, height) \
463 ((height) * FONT_HEIGHT ((f)->display.x->font)) 463 ((height) * FONT_HEIGHT ((f)->display.x->font))
464 464
465/* Return the inside width of a vertical scrollbar, given the outside 465/* Return the inside width of a vertical scroll bar, given the outside
466 width. */ 466 width. */
467#define VERTICAL_SCROLLBAR_INSIDE_WIDTH(width) \ 467#define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(width) \
468 ((width) - VERTICAL_SCROLLBAR_LEFT_BORDER - VERTICAL_SCROLLBAR_RIGHT_BORDER) 468 ((width) - VERTICAL_SCROLL_BAR_LEFT_BORDER - VERTICAL_SCROLL_BAR_RIGHT_BORDER)
469 469
470/* Return the length of the rectangle within which the top of the 470/* Return the length of the rectangle within which the top of the
471 handle must stay. This isn't equivalent to the inside height, 471 handle must stay. This isn't equivalent to the inside height,
472 because the scrollbar handle has a minimum height. 472 because the scroll bar handle has a minimum height.
473 473
474 This is the real range of motion for the scrollbar, so when we're 474 This is the real range of motion for the scroll bar, so when we're
475 scaling buffer positions to scrollbar positions, we use this, not 475 scaling buffer positions to scroll bar positions, we use this, not
476 VERTICAL_SCROLLBAR_INSIDE_HEIGHT. */ 476 VERTICAL_SCROLL_BAR_INSIDE_HEIGHT. */
477#define VERTICAL_SCROLLBAR_TOP_RANGE(height) \ 477#define VERTICAL_SCROLL_BAR_TOP_RANGE(height) \
478 (VERTICAL_SCROLLBAR_INSIDE_HEIGHT (height) - VERTICAL_SCROLLBAR_MIN_HANDLE) 478 (VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (height) - VERTICAL_SCROLL_BAR_MIN_HANDLE)
479 479
480/* Return the inside height of vertical scrollbar, given the outside 480/* Return the inside height of vertical scroll bar, given the outside
481 height. See VERTICAL_SCROLLBAR_TOP_RANGE too. */ 481 height. See VERTICAL_SCROLL_BAR_TOP_RANGE too. */
482#define VERTICAL_SCROLLBAR_INSIDE_HEIGHT(height) \ 482#define VERTICAL_SCROLL_BAR_INSIDE_HEIGHT(height) \
483 ((height) - VERTICAL_SCROLLBAR_TOP_BORDER - VERTICAL_SCROLLBAR_BOTTOM_BORDER) 483 ((height) - VERTICAL_SCROLL_BAR_TOP_BORDER - VERTICAL_SCROLL_BAR_BOTTOM_BORDER)
484 484
485 485
486/* Border widths for scrollbars. 486/* Border widths for scroll bars.
487 487
488 Scrollbar windows don't have any X borders; their border width is 488 Scroll bar windows don't have any X borders; their border width is
489 set to zero, and we redraw borders ourselves. This makes the code 489 set to zero, and we redraw borders ourselves. This makes the code
490 a bit cleaner, since we don't have to convert between outside width 490 a bit cleaner, since we don't have to convert between outside width
491 (used when relating to the rest of the screen) and inside width 491 (used when relating to the rest of the screen) and inside width
492 (used when sizing and drawing the scrollbar window itself). 492 (used when sizing and drawing the scroll bar window itself).
493 493
494 The handle moves up and down/back and forth in a rectange inset 494 The handle moves up and down/back and forth in a rectange inset
495 from the edges of the scrollbar. These are widths by which we 495 from the edges of the scroll bar. These are widths by which we
496 inset the handle boundaries from the scrollbar edges. */ 496 inset the handle boundaries from the scroll bar edges. */
497#define VERTICAL_SCROLLBAR_LEFT_BORDER (2) 497#define VERTICAL_SCROLL_BAR_LEFT_BORDER (2)
498#define VERTICAL_SCROLLBAR_RIGHT_BORDER (3) 498#define VERTICAL_SCROLL_BAR_RIGHT_BORDER (3)
499#define VERTICAL_SCROLLBAR_TOP_BORDER (2) 499#define VERTICAL_SCROLL_BAR_TOP_BORDER (2)
500#define VERTICAL_SCROLLBAR_BOTTOM_BORDER (2) 500#define VERTICAL_SCROLL_BAR_BOTTOM_BORDER (2)
501 501
502/* Minimum lengths for scrollbar handles, in pixels. */ 502/* Minimum lengths for scroll bar handles, in pixels. */
503#define VERTICAL_SCROLLBAR_MIN_HANDLE (5) 503#define VERTICAL_SCROLL_BAR_MIN_HANDLE (5)
504 504
505 505
506/* Manipulating pixel sizes and character sizes. 506/* Manipulating pixel sizes and character sizes.
@@ -520,7 +520,7 @@ struct scrollbar {
520 WIDTH columns/HEIGHT rows. */ 520 WIDTH columns/HEIGHT rows. */
521#define CHAR_TO_PIXEL_WIDTH(f, width) \ 521#define CHAR_TO_PIXEL_WIDTH(f, width) \
522 (CHAR_TO_PIXEL_COL (f, width) \ 522 (CHAR_TO_PIXEL_COL (f, width) \
523 + (f)->display.x->vertical_scrollbar_extra \ 523 + (f)->display.x->vertical_scroll_bar_extra \
524 + (f)->display.x->internal_border_width) 524 + (f)->display.x->internal_border_width)
525#define CHAR_TO_PIXEL_HEIGHT(f, height) \ 525#define CHAR_TO_PIXEL_HEIGHT(f, height) \
526 (CHAR_TO_PIXEL_ROW (f, height) \ 526 (CHAR_TO_PIXEL_ROW (f, height) \
@@ -541,7 +541,7 @@ struct scrollbar {
541#define PIXEL_TO_CHAR_WIDTH(f, width) \ 541#define PIXEL_TO_CHAR_WIDTH(f, width) \
542 (PIXEL_TO_CHAR_COL (f, ((width) \ 542 (PIXEL_TO_CHAR_COL (f, ((width) \
543 - (f)->display.x->internal_border_width \ 543 - (f)->display.x->internal_border_width \
544 - (f)->display.x->vertical_scrollbar_extra))) 544 - (f)->display.x->vertical_scroll_bar_extra)))
545#define PIXEL_TO_CHAR_HEIGHT(f, height) \ 545#define PIXEL_TO_CHAR_HEIGHT(f, height) \
546 (PIXEL_TO_CHAR_ROW (f, ((height) \ 546 (PIXEL_TO_CHAR_ROW (f, ((height) \
547 - (f)->display.x->internal_border_width))) 547 - (f)->display.x->internal_border_width)))