+ Set *time to the time the mouse was at the returned position.
+
+ This should clear mouse_moved until the next motion
+ event arrives. */
+extern void (*mouse_position_hook) P_ ((struct frame **f, int,
+ Lisp_Object *bar_window,
+ enum scroll_bar_part *part,
+ Lisp_Object *x,
+ Lisp_Object *y,
+ unsigned long *time));
+
+/* The window system handling code should set this if the mouse has
+ moved since the last call to the mouse_position_hook. Calling that
+ hook should clear this. */
+extern int mouse_moved;
+
+/* When a frame's focus redirection is changed, this hook tells the
+ window system code to re-decide where to put the highlight. Under
+ X, this means that Emacs lies about where the focus is. */
+extern void (*frame_rehighlight_hook) P_ ((struct frame *));
+
+/* If we're displaying frames using a window system that can stack
+ frames on top of each other, this hook allows you to bring a frame
+ to the front, or bury it behind all the other windows. If this
+ hook is zero, that means the device we're displaying on doesn't
+ support overlapping frames, so there's no need to raise or lower
+ anything.
+
+ If RAISE is non-zero, F is brought to the front, before all other
+ windows. If RAISE is zero, F is sent to the back, behind all other
+ windows. */
+extern void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise));
+
+\f
+/* Scroll bar hooks. */
+
+/* The representation of scroll bars is determined by the code which
+ implements them, except for one thing: they must be represented by
+ lisp objects. This allows us to place references to them in
+ Lisp_Windows without worrying about those references becoming
+ dangling references when the scroll bar is destroyed.
+
+ 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