annotate lisp/hyperbole/h-skip-bytec.lsp @ 123:c77884c6318d

Added tag r20-1b14 for changeset d2f30a177268
author cvs
date Mon, 13 Aug 2007 09:26:04 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;!emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; FILE: h-skip-bytec.lsp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Functions that should not be byte-compiled.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; USAGE: GNU Emacs Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; KEYWORDS: mouse, hypermedia
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; AUTHOR: Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; ORG: Motorola, Inc., PPG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; ORIG-DATE: 8-Oct-92 at 17:17:10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; LAST-MOD: 9-May-95 at 16:18:42 by Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; This file is part of Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; Available for use and distribution under the same terms as GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; Copyright (C) 1992-1995, Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; Developed with support from Motorola Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; DON'T byte-compile this file or its functions may not work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; If we knew why they won't work, they wouldn't be in here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;; For some reason, using this in byte-compiled form causes first character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;;; after mouse key depress to be dropped from input queue when running
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; Emacs under X. The non-byte-compiled form works fine.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (defun hmouse-set-point (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 "Sets point to Smart Key press/release location given by ARGS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 Returns argument list including x and y frame coordinates in characters and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 lines."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (and (car args) (listp (car args)) (setq args (car args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (if (not hyperb:window-system)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (point-marker)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (let ((point-args (hmouse-set-point-at args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (cond (hyperb:xemacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (if (eventp current-mouse-event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (copy-event current-mouse-event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (hyperb:lemacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (cond ((and (fboundp 'mouse-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;; mouse-position returns nil coords when not over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;; existing text within a window, so we can only use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;; its coordinates when non-nil. It returns a cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;; of (device X . Y) in chars. We drop the device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;; and assume the selected frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (car (cdr (setq point-args (mouse-position)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (cdr point-args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ((and (fboundp 'read-mouse-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;; read-mouse-position returns nil coords when not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;; over existing text within a window, so we can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;; only use its coordinates when non-nil. It
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;; returns a cons of (X . Y) in chars.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (car (setq point-args (read-mouse-position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (selected-frame)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 point-args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;; We just compute X and Y from event's location.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (cons (event-x current-mouse-event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (event-y current-mouse-event)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (hyperb:epoch-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;; Modeline clicks return nil for point position so we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;; must compute it instead of using the arguments given.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (let ((x-char (/ (* mouse::x (window-width))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (window-pixwidth)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (y-char (/ (* mouse::y (window-height))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (window-pixheight))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (apply 'list x-char y-char args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ((or (equal hyperb:window-system "next")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (equal hyperb:window-system "sun"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (let ((win (car args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (list win
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (+ (nth 1 args) (nth 0 (window-edges win)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (+ (nth 2 args) (nth 1 (window-edges win))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ((equal hyperb:window-system "apollo") point-args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (t args)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (provide 'h-skip-bytec)