;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:51:57 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/scroll-bar.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`scroll-bar.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(require 'mouse)
#@259 Given a scroll bar event EVENT, return the scroll bar position as a ratio.
The value is a cons cell (PORTION . WHOLE) containing two integers
whose ratio gives the event's vertical position in the scroll bar, with 0
referring to the top and 1 to the bottom.
(defalias 'scroll-bar-event-ratio #[(event) "\3018\207" [event 2] 2 (#$ . 640)])
#@372 Given a pair (NUM . DENOM) and WHOLE, return (/ (* NUM WHOLE) DENOM).
This is handy for scaling a position on a scroll bar into real units,
like buffer positions.  If SCROLL-BAR-POS is the (PORTION . WHOLE) pair
from a scroll bar event, then (scroll-bar-scale SCROLL-BAR-POS
(buffer-size)) is the position in the current buffer corresponding to
that scroll bar position.
(defalias 'scroll-bar-scale #[(num-denom whole) "\302\303@!	_A\245!\207" [num-denom whole truncate float] 3 (#$ . 987)])
(byte-code "\301B\301\207" [current-load-list scroll-bar-mode] 2)
#@125 Non-nil means `set-scroll-bar-mode' should really do something.
This is nil while loading `scroll-bar.el', and t afterward.
(defvar scroll-bar-mode-explicit nil (#$ . 1556))
(defalias 'set-scroll-bar-mode-1 #[(ignore value) "\301!\207" [value set-scroll-bar-mode] 2])
#@67 Set `scroll-bar-mode' to VALUE and put the new value into effect.
(defalias 'set-scroll-bar-mode #[(value) "\n\2056 \306\236\211:\203 \f	\241\210\202 \306	BB)\307 \211\2055 \310@\306	BC\"\210A\211\204$ \311)\207" [value scroll-bar-mode scroll-bar-mode-explicit default-frame-alist parameter frames vertical-scroll-bars frame-list modify-frame-parameters nil] 5 (#$ . 1831)])
#@337 *Specify whether to have vertical scroll bars, and on which side.
Possible values are nil (no scroll bars), `left' (scroll bars on left)
and `right' (scroll bars on right).
To set this variable in a Lisp program, use `set-scroll-bar-mode'
to make it take real effect.
Setting the variable with a customization buffer also takes effect.
(custom-declare-variable 'scroll-bar-mode '(if (eq system-type 'windows-nt) 'right 'left) '(#$ . -2225) :type '(choice (const :tag "none (nil)") (const left) (const right)) :group 'frames :set 'set-scroll-bar-mode-1)
(byte-code "\301\301\207" [scroll-bar-mode-explicit t] 1)
#@249 Toggle display of vertical scroll bars on all frames.
This command applies to all frames that exist and frames to be
created in the future.
With a numeric argument, if the argument is negative,
turn off scroll bars; otherwise, turn on scroll bars.
(defalias 'scroll-bar-mode #[(flag) "\203 \303!\304\204 	?\202( \247\203 \305Y\205( \n\306=\203' \307\202( \310!\207" [flag scroll-bar-mode system-type prefix-numeric-value set-scroll-bar-mode 0 windows-nt right left] 3 (#$ . 2844) "P"])
#@273 Toggle whether or not the selected frame has vertical scroll bars.
With arg, turn vertical scroll bars on if and only if arg is positive.
The variable `scroll-bar-mode' controls which side the scroll bars are on
when they are turned on; if it is nil, they go on the left.
(defalias 'toggle-scroll-bar #[(arg) "\204 \303\304\305 !\236A\203 \306\202 \307\202 \310!\311\305 \303\312V\2054 	\2064 \n\313=\2033 \314\2024 \315BC\"\207" [arg scroll-bar-mode system-type vertical-scroll-bars frame-parameters selected-frame -1 1 prefix-numeric-value modify-frame-parameters 0 windows-nt right left] 5 (#$ . 3346) "P"])
#@190 Toggle whether or not the selected frame has horizontal scroll bars.
With arg, turn horizontal scroll bars on if and only if arg is positive.
Horizontal scroll bars aren't implemented yet.
(defalias 'toggle-horizontal-scroll-bar #[(arg) "\300\301!\207" [error "Horizontal scroll bars aren't implemented yet"] 2 (#$ . 3973) "P"])
#@118 Set the window start according to where the scroll bar is dragged.
EVENT should be a scroll bar click or drag event.
(defalias 'scroll-bar-set-window-start #[(event) "\3048:\203 \304\202 \3058)\211@\304	8\212\306\n!q\210\212e\307deZ\"\\b\210\310 \210\311\n`\"-\207" [event end-position window portion-whole 2 1 window-buffer scroll-bar-scale beginning-of-line set-window-start] 6 (#$ . 4309) "e"])
#@44 Calculate new window start for drag event.
(defalias 'scroll-bar-drag-position #[(portion-whole) "\212e\301deZ\"\\b\210\302 \210`)\207" [portion-whole scroll-bar-scale beginning-of-line] 5 (#$ . 4723)])
#@188 Set the window start according to where the scroll bar is dragged.
Only change window start if the new start is substantially different.
EVENT should be a scroll bar click or drag event.
(defalias 'scroll-bar-maybe-set-window-start #[(event) "\3068:\203 \306\202 \3078)\211@\306	8\211@TAB\310\310\311\n!\212\312\n!q\210\313!\313\f!T]Y\204K W\203R \314\n\"\202W \314\n\".\207" [event end-position window portion-whole next-portion-whole portion-start 2 1 nil window-start window-buffer scroll-bar-drag-position set-window-start next-portion-start current-start] 4 (#$ . 4934) "e"])
(defalias 'scroll-bar-drag-1 #[(event) "\3048)\211@\305	8\212\306\n!q\210e\307deZ\"\\b\210\310 \210\311\n`\",\207" [event start-position window portion-whole 1 2 window-buffer scroll-bar-scale beginning-of-line set-window-start] 6])
#@133 Scroll the window by dragging the scroll bar slider.
If you click outside the slider, the window scrolls to bring the slider there.
(defalias 'scroll-bar-drag #[(event) "\306\307\n\310\n8:\203 \310\202 \311\n8)\211@\306r\312\f!q\210)\313 \314\216\315\f!\210\2064 `*\316\n!\210\317 \210\320\307!\210r\312\f!q\210\211.\207" [done echo-keystrokes event end-position window before-scroll nil 0 2 1 window-buffer selected-window ((byte-code "\301!\203\n \302!\210\301\207" [save-selected-window-window window-live-p select-window] 2)) select-window scroll-bar-drag-1 (lambda nil (track-mouse (byte-code "?\205& \302 \211\242\303=\203 \302 	\242\304=\203  \305	!\210\202  \306\211\202 \207" [done event read-event mouse-movement scroll-bar-movement scroll-bar-drag-1 t] 3))) sit-for point-before-scroll save-selected-window-window] 3 (#$ . 5794) "e"])
#@112 Scroll the window's top line down to the location of the scroll bar click.
EVENT should be a scroll bar click.
(defalias 'scroll-bar-scroll-down #[(event) "\3068:\203 \306\202 \3078)\211@\310r\311\n!q\210\f)\312\216\313 \314\216\306	8\315\n!\210\2065 `\316\317\320 S\"!\210)\321\322!.\207" [event end-position window before-scroll point-before-scroll save-selected-window-window 2 1 nil window-buffer ((byte-code "r\303!q\210	)\303\207" [window before-scroll point-before-scroll window-buffer] 2)) selected-window ((byte-code "\301!\203\n \302!\210\301\207" [save-selected-window-window window-live-p select-window] 2)) select-window scroll-down scroll-bar-scale window-height sit-for 0 portion-whole] 5 (#$ . 6674) "e"])
#@108 Scroll the line next to the scroll bar click to the top of the window.
EVENT should be a scroll bar click.
(defalias 'scroll-bar-scroll-up #[(event) "\3068:\203 \306\202 \3078)\211@\310r\311\n!q\210\f)\312\216\313 \314\216\306	8\315\n!\210\2065 `\316\317\320 S\"!\210)\321\322!.\207" [event end-position window before-scroll point-before-scroll save-selected-window-window 2 1 nil window-buffer ((byte-code "r\303!q\210	)\303\207" [window before-scroll point-before-scroll window-buffer] 2)) selected-window ((byte-code "\301!\203\n \302!\210\301\207" [save-selected-window-window window-live-p select-window] 2)) select-window scroll-up scroll-bar-scale window-height sit-for 0 portion-whole] 5 (#$ . 7425) "e"])
(defalias 'scroll-bar-toolkit-scroll #[(event) "\3068:\203 \306\202 \3078)\211@\310	8\311\312=\206\374 r\313\n!q\210)\314 &\315\216\316\n!\210\f\2069 `\317=\203G \320\321!\210\202\355 \322=\203T \320\311!\210\202\355 \323=\203\210 \306	8'\324'\325 S\"(\320\326(!\204u (\202\202 '@\327W\203\201 \330\202\202 \307!\210*\202\355 \331=\203\251 \212\332 b\210\330y)\327U\203\242 \320\330!\210\202\355 \333\334!\210\202\355 \335=\203\306 \212\306y)\327U\203\277 \320\307!\210\202\355 \333\336!\210\202\355 \337=\203\324 \340\ne\"\210\202\355 \341=\203\343 db\210\342 \210\202\355 \343=\203\355 \344!\210*\345\327!\210r\313\n!q\210\f\211),\207" [event end-position window part before-scroll point-before-scroll 2 1 4 nil end-scroll window-buffer selected-window ((byte-code "\301!\203\n \302!\210\301\207" [save-selected-window-window window-live-p select-window] 2)) select-window above-handle scroll-up - below-handle ratio scroll-bar-scale window-height zerop 0 -1 up window-start message "Beginning of buffer" down "End of buffer" top set-window-start bottom recenter handle scroll-bar-drag-1 sit-for save-selected-window-window portion-whole lines] 4 nil "e"])
(byte-code "\301\300!\203 \203 \302\303\304\"\210\202+ \302\305\306\"\210\302\307\306\"\210\302\310\311\"\210\302\312\313\"\210\302\314\313\"\210\315\316!\207" [x-toolkit-scroll-bars boundp global-set-key [vertical-scroll-bar mouse-1] scroll-bar-toolkit-scroll [vertical-scroll-bar mouse-1] scroll-bar-scroll-up [vertical-scroll-bar drag-mouse-1] [vertical-scroll-bar down-mouse-2] scroll-bar-drag [vertical-scroll-bar mouse-3] scroll-bar-scroll-down [vertical-scroll-bar drag-mouse-3] provide scroll-bar] 3)
