+ The window-system-independent portion of Emacs just refers to
+ scroll bars via their windows, and never looks inside the scroll bar
+ representation; it always uses hook functions to do all the
+ scroll bar manipulation it needs.
+
+ The `vertical_scroll_bar' field of a Lisp_Window refers to that
+ window's scroll bar, or is nil if the window doesn't have a
+ scroll bar.
+
+ The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame
+ are free for use by the scroll bar implementation in any way it sees
+ fit. They are marked by the garbage collector. */
+
+
+/* Set the vertical scroll bar for WINDOW to have its upper left corner
+ at (TOP, LEFT), and be LENGTH rows high. Set its handle to
+ indicate that we are displaying PORTION characters out of a total
+ of WHOLE characters, starting at POSITION. If WINDOW doesn't yet
+ have a scroll bar, create one for it. */
+extern void (*set_vertical_scroll_bar_hook)
+ P_ ((struct window *window,
+ int portion, int whole, int position));
+
+
+/* The following three hooks are used when we're doing a thorough
+ redisplay of the frame. We don't explicitly know which scroll bars
+ are going to be deleted, because keeping track of when windows go
+ away is a real pain - can you say set-window-configuration?
+ Instead, we just assert at the beginning of redisplay that *all*
+ scroll bars are to be removed, and then save scroll bars from the
+ fiery pit when we actually redisplay their window. */
+
+/* Arrange for all scroll bars on FRAME to be removed at the next call
+ to `*judge_scroll_bars_hook'. A scroll bar may be spared if
+ `*redeem_scroll_bar_hook' is applied to its window before the judgement.
+
+ This should be applied to each frame each time its window tree is
+ redisplayed, even if it is not displaying scroll bars at the moment;
+ if the HAS_SCROLL_BARS flag has just been turned off, only calling
+ this and the judge_scroll_bars_hook will get rid of them.
+
+ If non-zero, this hook should be safe to apply to any frame,
+ whether or not it can support scroll bars, and whether or not it is
+ currently displaying them. */
+extern void (*condemn_scroll_bars_hook) P_ ((struct frame *frame));
+
+/* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
+ Note that it's okay to redeem a scroll bar that is not condemned. */
+extern void (*redeem_scroll_bar_hook) P_ ((struct window *window));
+
+/* Remove all scroll bars on FRAME that haven't been saved since the
+ last call to `*condemn_scroll_bars_hook'.
+
+ This should be applied to each frame after each time its window
+ tree is redisplayed, even if it is not displaying scroll bars at the
+ moment; if the HAS_SCROLL_BARS flag has just been turned off, only
+ calling this and condemn_scroll_bars_hook will get rid of them.
+
+ If non-zero, this hook should be safe to apply to any frame,
+ whether or not it can support scroll bars, and whether or not it is
+ currently displaying them. */
+extern void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME));
+
+\f
+/* Input queue declarations and hooks. */
+
+/* Expedient hack: only provide the below definitions to files that
+ are prepared to handle lispy things. CONSP is defined iff lisp.h
+ has been included before this file. */
+#ifdef CONSP
+
+enum event_kind
+{
+ no_event, /* nothing happened. This should never