/usr/share/common-lisp/source/mcclim/Examples/stream-test.lisp is in cl-mcclim-examples 0.9.6.dfsg.cvs20100315-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | ;;; -*- Mode: Lisp; Package: CLIM-DEMO -*-
;;; (c) copyright 2001 by
;;; Tim Moore (moore@bricoworks.com)
;;; This library is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Library General Public
;;; License as published by the Free Software Foundation; either
;;; version 2 of the License, or (at your option) any later version.
;;;
;;; This library is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;;; Library General Public License for more details.
;;;
;;; You should have received a copy of the GNU Library General Public
;;; License along with this library; if not, write to the
;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;;; Boston, MA 02111-1307 USA.
(in-package :clim-demo)
(defclass echo-interactor-pane (interactor-pane)
())
(defvar *debug-echo* t)
(defmethod handle-event :after ((stream echo-interactor-pane)
(event key-press-event))
(let* ((buffer (stream-input-buffer stream))
(fill (fill-pointer buffer)))
(when (> fill 0) ;Should always be true
(let ((gesture (aref buffer (1- fill))))
(when (characterp gesture)
(stream-write-char stream gesture))))))
(defmethod stream-read-gesture :around ((stream echo-interactor-pane)
&key &allow-other-keys)
(let* ((results (multiple-value-list (call-next-method)))
(gesture (car results)))
(when (and *debug-echo*
gesture)
(print gesture *trace-output*))
(values-list results)))
#+nil
(define-application-frame stream-test ()
()
(:pane (vertically ()
(make-pane 'echo-interactor-pane)) ))
(define-application-frame stream-test ()
()
(:panes
(tester (make-clim-stream-pane :type 'echo-interactor-pane)))
(:layouts
(default (vertically () tester))))
(defun run-test (name)
; (loop for port in climi::*all-ports*
; do (destroy-port port))
; (setq climi::*all-ports* nil)
(when name
(run-frame-top-level (make-application-frame name))))
(defun echo-stream-test ()
(run-test 'stream-test))
(define-application-frame edit-test ()
()
(:panes
(tester :interactor))
(:layouts
(default (vertically () tester))))
(defmethod read-frame-command ((frame edit-test)
&key (stream *standard-input*))
(with-input-editing (stream)
(call-next-method frame :stream stream)))
(defun input-edit-test ()
(run-test 'edit-test))
|