comparison lisp/term/sup-mouse.el @ 772:d682c0f82a71

[xemacs-hg @ 2002-03-13 10:00:06 by ben] a few bytecomp warning fixes, run autoconf just in case
author ben
date Wed, 13 Mar 2002 10:00:09 +0000
parents 376386a54a3c
children 85bd42a1e544 308d34e9f07d
comparison
equal deleted inserted replaced
771:943eaba38521 772:d682c0f82a71
43 (defconst mouse-3left 8) 43 (defconst mouse-3left 8)
44 (defconst mouse-3center 9) 44 (defconst mouse-3center 9)
45 (defconst mouse-3right 10) 45 (defconst mouse-3right 10)
46 46
47 ;;; Defuns: 47 ;;; Defuns:
48
49 (defun sup-window-edges (&optional win)
50 (error "not implemented")
51 (window-pixel-edges win))
48 52
49 (defun sup-mouse-report () 53 (defun sup-mouse-report ()
50 "This function is called directly by the mouse, it parses and 54 "This function is called directly by the mouse, it parses and
51 executes the mouse commands. 55 executes the mouse commands.
52 56
69 ;; expect a string of <esc>:<buttons>;<x-pos>;<y-pos>c 73 ;; expect a string of <esc>:<buttons>;<x-pos>;<y-pos>c
70 ((buttons (sup-get-tty-num ?\;)) 74 ((buttons (sup-get-tty-num ?\;))
71 (x (sup-get-tty-num ?\;)) 75 (x (sup-get-tty-num ?\;))
72 (y (sup-get-tty-num ?c)) 76 (y (sup-get-tty-num ?c))
73 (window (sup-pos-to-window x y)) 77 (window (sup-pos-to-window x y))
74 (edges (window-edges window)) 78 (edges (sup-window-edges window))
75 (old-window (selected-window)) 79 (old-window (selected-window))
76 (in-minibuf-p (eq y (1- (frame-height)))) 80 (in-minibuf-p (eq y (1- (frame-height))))
77 (same-window-p (and (not in-minibuf-p) (eq window old-window))) 81 (same-window-p (and (not in-minibuf-p) (eq window old-window)))
78 (in-modeline-p (eq y (1- (nth 3 edges)))) 82 (in-modeline-p (eq y (1- (nth 3 edges))))
79 (in-scrollbar-p (>= x (1- (nth 2 edges))))) 83 (in-scrollbar-p (>= x (1- (nth 2 edges)))))
188 ) 192 )
189 193
190 (defun sup-pos-to-window (x y) 194 (defun sup-pos-to-window (x y)
191 "Find window corresponding to frame coordinates. 195 "Find window corresponding to frame coordinates.
192 X and Y are 0-based character positions on the frame." 196 X and Y are 0-based character positions on the frame."
193 (let ((edges (window-edges)) 197 (let ((edges (sup-window-edges))
194 (window nil)) 198 (window nil))
195 (while (and (not (eq window (selected-window))) 199 (while (and (not (eq window (selected-window)))
196 (or (< y (nth 1 edges)) 200 (or (< y (nth 1 edges))
197 (>= y (nth 3 edges)) 201 (>= y (nth 3 edges))
198 (< x (nth 0 edges)) 202 (< x (nth 0 edges))
199 (>= x (nth 2 edges)))) 203 (>= x (nth 2 edges))))
200 (setq window (next-window window)) 204 (setq window (next-window window))
201 (setq edges (window-edges window)) 205 (setq edges (sup-window-edges window))
202 ) 206 )
203 (or window (selected-window)) 207 (or window (selected-window))
204 ) 208 )
205 ) 209 )
206 210