~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to xgcl-2/dispatch-events.lsp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(in-package :XLIB)
 
2
; dispatch-events.lsp         Hiep Huu Nguyen                      27 Aug 92
 
3
 
 
4
; Copyright (c) 1994 Hiep Huu Nguyen and The University of Texas at Austin.
 
5
 
 
6
; See the files gnu.license and dec.copyright .
 
7
 
 
8
; This program is free software; you can redistribute it and/or modify
 
9
; it under the terms of the GNU General Public License as published by
 
10
; the Free Software Foundation; either version 1, or (at your option)
 
11
; any later version.
 
12
 
 
13
; This program is distributed in the hope that it will be useful,
 
14
; but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
; GNU General Public License for more details.
 
17
 
 
18
; You should have received a copy of the GNU General Public License
 
19
; along with this program; if not, write to the Free Software
 
20
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
21
 
 
22
; Some of the files that interface to the Xlib are adapted from DEC/MIT files.
 
23
; See the file dec.copyright for details.
 
24
 
 
25
 
 
26
;;have to make each type have it's own eventlist
 
27
;;and eventmask
 
28
(defun dispatch-events ()
 
29
  (setq *exit* nil)
 
30
  (mapcar #'(lambda (x)
 
31
              (Xsync x 1))
 
32
           *display-list*)
 
33
  (do ((window nil)
 
34
       (call-back-fn nil)
 
35
       (type nil))
 
36
    (*exit*)
 
37
    (dolist (a-display *display-list*)
 
38
      (unless  (= (XPending a-display) 0)
 
39
        (XNextEvent a-display *default-event*)
 
40
        (setq type (XAnyEvent-type  *default-event*))
 
41
        (setq window
 
42
              (gethash (XAnyEvent-window  *default-event*)
 
43
                       *window-table*))
 
44
        (setq call-back-fns 
 
45
              (rest (assoc type (slot-value window 'eventlist))))
 
46
        (if call-back-fns
 
47
            (dolist (call-back-fn call-back-fns)
 
48
              (eval `(,call-back-fn ',window))))))))
 
49
              
 
50