From thenriksen at common-lisp.net Tue Oct 10 19:41:35 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Tue, 10 Oct 2006 15:41:35 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim/Drei Message-ID: <20061010194135.BC78752001@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Drei In directory clnet:/tmp/cvs-serv14502/Drei Log Message: Directory /project/mcclim/cvsroot/mcclim/Drei added to the repository From thenriksen at common-lisp.net Fri Oct 13 20:15:55 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Fri, 13 Oct 2006 16:15:55 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim Message-ID: <20061013201555.2864A6911A@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim In directory clnet:/tmp/cvs-serv11366 Modified Files: stream-input.lisp Log Message: Removed strange half-definition dirt that SBCL could somehow digest, but which caused errors in CLISP. --- /project/mcclim/cvsroot/mcclim/stream-input.lisp 2006/05/05 10:24:02 1.47 +++ /project/mcclim/cvsroot/mcclim/stream-input.lisp 2006/10/13 20:15:55 1.48 @@ -712,8 +712,6 @@ (logandc2 (slot-value pointer 'button-state) (pointer-event-button event))))) -(defmethod pointer-butt) - (defmethod stream-pointer-position ((stream standard-extended-input-stream) &key (pointer (port-pointer (port stream)))) From ahefner at common-lisp.net Sat Oct 14 18:38:12 2006 From: ahefner at common-lisp.net (ahefner) Date: Sat, 14 Oct 2006 14:38:12 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim Message-ID: <20061014183812.3B33E9@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim In directory clnet:/tmp/cvs-serv15569 Modified Files: graphics.lisp Log Message: Adaptation of Luigi Panzeri's patch to fix arrow heads when scaling is in effect. --- /project/mcclim/cvsroot/mcclim/graphics.lisp 2006/06/09 21:10:33 1.53 +++ /project/mcclim/cvsroot/mcclim/graphics.lisp 2006/10/14 18:38:12 1.54 @@ -569,17 +569,25 @@ (start (sqrt (+ (expt (- x2 x1) 2) (expt (- y2 y1) 2)))) (p end) - (q start) + (q start) (medium (sheet-medium sheet)) (line-style (medium-line-style medium)) - (thickness (line-style-thickness line-style)) + ;; FIXME: I believe this thickness is in "line-style-units", + ;; which are only coincidentally the same as pixel coorindates + ;; on screen backends, using :normal units. There is no function + ;; documented for converting the units to stream coordinates. + (thickness (multiple-value-bind (dx dy) + (transform-distance (invert-transformation (medium-transformation medium)) + (line-style-thickness line-style) + 0) + (sqrt (+ (* dx dx) (* dy dy))))) (width/2 (/ head-width 2)) (a (atan (/ width/2 head-length))) (offset (if (and head-length (not (zerop head-length))) (/ thickness (* 2 (sin a ))) - 0.0)) + 0.0)) (tip-to-peak (+ head-length offset (- (* thickness 0.5 (sin a)))))) ;; okay, a guess.. (when to-head (incf p offset)) (when from-head (decf q offset)) @@ -596,7 +604,7 @@ start 0 (/ start 2) (- width)) :filled t - :line-thickness 0 )) + :line-thickness 0)) (progn (when to-head (draw-polygon* sheet From thenriksen at common-lisp.net Mon Oct 16 23:53:52 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Mon, 16 Oct 2006 19:53:52 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim Message-ID: <20061016235352.DCA35A0EF@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim In directory clnet:/tmp/cvs-serv8355 Modified Files: panes.lisp Log Message: Add some convenience to viewports. --- /project/mcclim/cvsroot/mcclim/panes.lisp 2006/07/09 06:23:22 1.170 +++ /project/mcclim/cvsroot/mcclim/panes.lisp 2006/10/16 23:53:52 1.171 @@ -27,7 +27,7 @@ ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;;; Boston, MA 02111-1307 USA. -;;; $Id: panes.lisp,v 1.170 2006/07/09 06:23:22 ahefner Exp $ +;;; $Id: panes.lisp,v 1.171 2006/10/16 23:53:52 thenriksen Exp $ (in-package :clim-internals) @@ -1849,6 +1849,29 @@ (defmethod note-input-focus-changed ((pane viewport-pane) state) (note-input-focus-changed (sheet-child pane) state)) +;; This method ensures that when the child changes size, the viewport +;; will move its focus so that it will not display a region outside of +;; `child' (if at all possible, this ideal can be circumvented by +;; creating a child sheet that is smaller than the viewport). I do not +;; believe having a viewport look at "empty" space is ever useful. +(defmethod note-space-requirements-changed ((pane viewport-pane) child) + (let ((viewport-width (bounding-rectangle-width pane)) + (viewport-height (bounding-rectangle-height pane)) + (child-width (bounding-rectangle-width child)) + (child-height (bounding-rectangle-height child))) + (destructuring-bind (horizontal-scroll vertical-scroll) + (mapcar #'- (multiple-value-list + (transform-position (sheet-transformation child) 0 0))) + (scroll-extent child + (if (> (+ horizontal-scroll viewport-width) + child-width) + (max 0 (- child-width viewport-width)) + horizontal-scroll) + (if (> (+ vertical-scroll viewport-height) + child-width) + (max 0 (- child-height viewport-height)) + vertical-scroll))))) + ;;;; ;;;; SCROLLER PANE ;;;; From thenriksen at common-lisp.net Fri Oct 27 22:50:41 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Fri, 27 Oct 2006 18:50:41 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim Message-ID: <20061027225041.1A2D15B005@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim In directory clnet:/tmp/cvs-serv7044 Modified Files: stream-input.lisp Log Message: Change policy from "gadgets eat all events" to "active gadgets eat all events". --- /project/mcclim/cvsroot/mcclim/stream-input.lisp 2006/10/13 20:15:55 1.48 +++ /project/mcclim/cvsroot/mcclim/stream-input.lisp 2006/10/27 22:50:40 1.49 @@ -170,7 +170,8 @@ (let* ((event (event-queue-peek buffer)) (sheet (event-sheet event))) (if (and event - (or (gadgetp sheet) + (or (and (gadgetp sheet) + (gadget-active-p sheet)) (not (and (typep sheet 'clim-stream-pane) (or (typep event 'key-press-event) (typep event 'pointer-button-press-event)))))) From thenriksen at common-lisp.net Sat Oct 28 15:22:25 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Sat, 28 Oct 2006 11:22:25 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim/Lisp-Dep Message-ID: <20061028152225.4BF894C3EA@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Lisp-Dep In directory clnet:/tmp/cvs-serv5598/Lisp-Dep Modified Files: fix-clisp.lisp Log Message: For CLISP, the :GRAY package needs to be unlocked at read-time, so use ugly calls to `intern' instead of direct symbols. --- /project/mcclim/cvsroot/mcclim/Lisp-Dep/fix-clisp.lisp 2004/12/20 15:51:56 1.1 +++ /project/mcclim/cvsroot/mcclim/Lisp-Dep/fix-clisp.lisp 2006/10/28 15:22:25 1.2 @@ -6,15 +6,16 @@ do (export sym :clim-mop))) ;; CLIM expects INPUT-STREAM-P to be a generic function. -(unless (typep #'input-stream-p 'generic-function) - (setf (fdefinition 'gray::original-input-stream-p) #'input-stream-p) - (fmakunbound 'input-stream-p) - (defgeneric input-stream-p (stream) - (:method ((stream stream)) (gray::original-input-stream-p stream)))) +(ext:without-package-lock ("GRAY" "COMMON-LISP") + (unless (typep #'input-stream-p 'generic-function) + (setf (fdefinition (intern "ORIGINAL-INPUT-STREAM-P" (find-package :gray))) #'input-stream-p) + (fmakunbound 'input-stream-p) + (defgeneric input-stream-p (stream) + (:method ((stream stream)) (funcall (fdefinition (intern "ORIGINAL-OUTPUT-STREAM-P" (find-package :gray))) stream)))) -;; CLIM expects OUTPUT-STREAM-P to be a generic function. -(unless (typep #'output-stream-p 'generic-function) - (setf (fdefinition 'gray::original-output-stream-p) #'output-stream-p) - (fmakunbound 'output-stream-p) - (defgeneric output-stream-p (stream) - (:method ((stream stream)) (gray::original-output-stream-p stream)))) + ;; CLIM expects OUTPUT-STREAM-P to be a generic function. + (unless (typep #'output-stream-p 'generic-function) + (setf (fdefinition (intern "ORIGINAL-OUTPUT-STREAM-P" (find-package :gray))) #'output-stream-p) + (fmakunbound 'output-stream-p) + (defgeneric output-stream-p (stream) + (:method ((stream stream)) (funcall (fdefinition (intern "ORIGINAL-OUTPUT-STREAM-P" (find-package :gray))) stream))))) From thenriksen at common-lisp.net Sat Oct 28 16:44:13 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Sat, 28 Oct 2006 12:44:13 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim Message-ID: <20061028164413.9D4DB74347@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim In directory clnet:/tmp/cvs-serv19293 Modified Files: panes.lisp Log Message: Add nasty hack and change :end-of-line-action for interactor panes. --- /project/mcclim/cvsroot/mcclim/panes.lisp 2006/10/16 23:53:52 1.171 +++ /project/mcclim/cvsroot/mcclim/panes.lisp 2006/10/28 16:44:13 1.172 @@ -27,7 +27,7 @@ ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;;; Boston, MA 02111-1307 USA. -;;; $Id: panes.lisp,v 1.171 2006/10/16 23:53:52 thenriksen Exp $ +;;; $Id: panes.lisp,v 1.172 2006/10/28 16:44:13 thenriksen Exp $ (in-package :clim-internals) @@ -1862,15 +1862,19 @@ (destructuring-bind (horizontal-scroll vertical-scroll) (mapcar #'- (multiple-value-list (transform-position (sheet-transformation child) 0 0))) - (scroll-extent child - (if (> (+ horizontal-scroll viewport-width) - child-width) - (max 0 (- child-width viewport-width)) - horizontal-scroll) - (if (> (+ vertical-scroll viewport-height) - child-width) - (max 0 (- child-height viewport-height)) - vertical-scroll))))) + ;; XXX: We cannot use `scroll-extent', because McCLIM ignores it + ;; unless the scrollee happens to be drawing. Very weird, should + ;; be fixed. + (move-sheet child + (round (- (if (> (+ horizontal-scroll viewport-width) + child-width) + (- child-width viewport-width) + horizontal-scroll))) + (round (- (if (> (+ vertical-scroll viewport-height) + child-width) + (- child-height viewport-height) + vertical-scroll)))) + (scroller-pane/update-scroll-bars (sheet-parent pane))))) ;;;; ;;;; SCROLLER PANE @@ -2607,6 +2611,7 @@ (defclass interactor-pane (clim-stream-pane) () (:default-initargs :display-time nil + :end-of-line-action :scroll :scroll-bars :vertical)) (defmethod initialize-instance :after ((pane interactor-pane) &rest args) From afuchs at common-lisp.net Sat Oct 28 17:11:30 2006 From: afuchs at common-lisp.net (afuchs) Date: Sat, 28 Oct 2006 13:11:30 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim Message-ID: <20061028171130.D6AD49@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim In directory clnet:/tmp/cvs-serv22716 Modified Files: mcclim.asd Log Message: Commit Douglas Crosher's non-symbol case fixes: * defsystem :clouseau: avoid pathname directory namestrings in file component names; reworking to be more portable. * defsystem :clim-examples: add the stopwatch example. * Update support for the Scieneer CL. --- /project/mcclim/cvsroot/mcclim/mcclim.asd 2006/07/03 04:58:41 1.23 +++ /project/mcclim/cvsroot/mcclim/mcclim.asd 2006/10/28 17:11:30 1.24 @@ -342,6 +342,7 @@ (:file "gadget-test") (:file "accepting-values") (:file "method-browser") + (:file "stopwatch") (:file "dragndrop-translator") (:file "draggable-graph") (:file "text-size-test") @@ -417,9 +418,12 @@ :depends-on (:mcclim) :serial t :components - ((:file "Apps/Inspector/package") - (:file "Apps/Inspector/disassembly") - (:file "Apps/Inspector/inspector"))) + ((:module "Apps/Inspector" + :pathname #.(make-pathname :directory '(:relative "Apps" "Inspector")) + :components + ((:file "package") + (:file "disassembly") + (:file "inspector"))))) (defmethod perform :after ((op load-op) (c (eql (find-system :clim)))) (pushnew :clim *features*) From afuchs at common-lisp.net Sat Oct 28 17:11:31 2006 From: afuchs at common-lisp.net (afuchs) Date: Sat, 28 Oct 2006 13:11:31 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim/Apps/Scigraph/dwim Message-ID: <20061028171131.2681B9@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Apps/Scigraph/dwim In directory clnet:/tmp/cvs-serv22716/Apps/Scigraph/dwim Modified Files: dwim-system.lisp extensions.lisp load-dwim.lisp macros.lisp Log Message: Commit Douglas Crosher's non-symbol case fixes: * defsystem :clouseau: avoid pathname directory namestrings in file component names; reworking to be more portable. * defsystem :clim-examples: add the stopwatch example. * Update support for the Scieneer CL. --- /project/mcclim/cvsroot/mcclim/Apps/Scigraph/dwim/dwim-system.lisp 2003/11/03 14:02:28 1.2 +++ /project/mcclim/cvsroot/mcclim/Apps/Scigraph/dwim/dwim-system.lisp 2006/10/28 17:11:30 1.3 @@ -100,6 +100,7 @@ #+(or allegro sbcl) #.(if (fboundp 'compile-file-pathname) (pathname-type (compile-file-pathname "foo")) "fasl") + #+scl (pathname-type (compile-file-pathname "foo")) #+lucid (car lcl:*load-binary-pathname-types*) #+(and (not genera) (not allegro) @@ -124,7 +125,8 @@ #+GENERA "GENERA" #+LUCID "LUCID" #+ALLEGRO "ALLEGRO" - #+SBCL "SBCL") + #+SBCL "SBCL" + #+scl "SCL") (GUI #+(and mcl (not clim)) "MAC" #+(and genera (not clim)) "DW" --- /project/mcclim/cvsroot/mcclim/Apps/Scigraph/dwim/extensions.lisp 2006/03/23 10:09:50 1.6 +++ /project/mcclim/cvsroot/mcclim/Apps/Scigraph/dwim/extensions.lisp 2006/10/28 17:11:31 1.7 @@ -105,7 +105,9 @@ (:genera (let ((symbol (intern string :scl))) (and (boundp symbol) (symbol-value symbol)))) (:openmcl (ccl::getenv string)) - (:sbcl (sb-ext:posix-getenv string)))) + (:sbcl (sb-ext:posix-getenv string)) + (:scl (cdr (assoc string ext:*environment-list* :test #'string=))) + )) #+allegro ;;>> Allegro 4.2 supports SYSTEM:GETENV. How do I set an environment variable? @@ -328,7 +330,8 @@ ((or :allegro :sbcl) #.(if (fboundp 'compile-file-pathname) (pathname-type (compile-file-pathname "foo")) - "fasl")) + "fasl")) + (:scl (pathname-type (compile-file-pathname "foo"))) (:lucid (car lcl:*load-binary-pathname-types*)) (:mcl #.(pathname-type ccl:*.fasl-pathname*)) )) --- /project/mcclim/cvsroot/mcclim/Apps/Scigraph/dwim/load-dwim.lisp 2003/11/03 14:02:28 1.3 +++ /project/mcclim/cvsroot/mcclim/Apps/Scigraph/dwim/load-dwim.lisp 2006/10/28 17:11:31 1.4 @@ -64,7 +64,8 @@ #+genera si:*default-binary-file-type* #+(or allegro sbcl) #.(if (fboundp 'compile-file-pathname) (pathname-type (compile-file-pathname "foo")) - "fasl") + "fasl") + #+scl (pathname-type (compile-file-pathname "foo")) #+lucid (car lcl:*load-binary-pathname-types*) #+(and (not genera) (not allegro) @@ -88,7 +89,8 @@ #+LUCID "LUCID" #+ALLEGRO "ALLEGRO" #+OPENMCL "OPENMCL" - #+SBCL "SBCL") + #+SBCL "SBCL" + #+scl "SCL") (GUI #+(and mcl (not clim)) "MAC" #+(and genera (not clim)) "DW" --- /project/mcclim/cvsroot/mcclim/Apps/Scigraph/dwim/macros.lisp 2004/08/08 21:11:17 1.7 +++ /project/mcclim/cvsroot/mcclim/Apps/Scigraph/dwim/macros.lisp 2006/10/28 17:11:31 1.8 @@ -82,7 +82,7 @@ (mapcar #'(lambda (v) (if (symbolp v) v (car v))) let-vars))) `(let ,forms (declare (dynamic-extent ,@(get-vars forms))) , at body))) -#-(or openmcl-native-threads sb-thread) +#-(or openmcl-native-threads sb-thread scl) (defmacro without-interrupts (&body body) #FEATURE-CASE ((:genera `(scl::without-interrupts , at body)) @@ -90,7 +90,7 @@ (:allegro `(excl:without-interrupts , at body)) (:mcl `(ccl:without-interrupts , at body)))) -#+(or openmcl-native-threads sb-thread) +#+(or openmcl-native-threads sb-thread scl) (progn (defparameter *dwim-giant-lock* (clim-sys:make-lock "dwim giant lock")) (defmacro without-interrupts (&body body) From afuchs at common-lisp.net Sat Oct 28 17:11:31 2006 From: afuchs at common-lisp.net (afuchs) Date: Sat, 28 Oct 2006 13:11:31 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim/Backends/gtkairo Message-ID: <20061028171131.67F87B@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Backends/gtkairo In directory clnet:/tmp/cvs-serv22716/Backends/gtkairo Modified Files: cairo-ffi.lisp Log Message: Commit Douglas Crosher's non-symbol case fixes: * defsystem :clouseau: avoid pathname directory namestrings in file component names; reworking to be more portable. * defsystem :clim-examples: add the stopwatch example. * Update support for the Scieneer CL. --- /project/mcclim/cvsroot/mcclim/Backends/gtkairo/cairo-ffi.lisp 2006/05/13 19:37:29 1.4 +++ /project/mcclim/cvsroot/mcclim/Backends/gtkairo/cairo-ffi.lisp 2006/10/28 17:11:31 1.5 @@ -26,7 +26,12 @@ (defmacro def-cairo-fun (name rtype &rest args) - (let* ((str (string-upcase name)) + (let* (#-scl + (str (string-upcase name)) + #+scl + (str (if (eq ext:*case-mode* :upper) + (string-upcase name) + (string-downcase name))) (actual (intern (concatenate 'string "%-" str) :clim-gtkairo)) (wrapper (intern str :clim-gtkairo)) (argnames (mapcar #'car args))) @@ -36,8 +41,12 @@ , at args) (defun ,wrapper ,argnames (multiple-value-prog1 - (,actual , at argnames) - (let ((status (cairo_status ,(car argnames)))) + #-scl (,actual , at argnames) + #+scl + (ext:with-float-traps-masked (:underflow :overflow :inexact + :divide-by-zero :invalid) + (,actual , at argnames)) + (let ((status (cairo_status ,(car argnames)))) (unless (eq status :success) (error "~A returned with status ~A" ,name status)))))))) From afuchs at common-lisp.net Sat Oct 28 17:11:31 2006 From: afuchs at common-lisp.net (afuchs) Date: Sat, 28 Oct 2006 13:11:31 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim/Experimental/freetype Message-ID: <20061028171131.9CD7C15@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Experimental/freetype In directory clnet:/tmp/cvs-serv22716/Experimental/freetype Modified Files: freetype-package.lisp Log Message: Commit Douglas Crosher's non-symbol case fixes: * defsystem :clouseau: avoid pathname directory namestrings in file component names; reworking to be more portable. * defsystem :clim-examples: add the stopwatch example. * Update support for the Scieneer CL. --- /project/mcclim/cvsroot/mcclim/Experimental/freetype/freetype-package.lisp 2005/06/05 20:50:29 1.2 +++ /project/mcclim/cvsroot/mcclim/Experimental/freetype/freetype-package.lisp 2006/10/28 17:11:31 1.3 @@ -1,6 +1,6 @@ (defpackage :mcclim-freetype (:use :climi :clim :clim-lisp) (:export :*freetype-font-path*) - (:import-from #+cmucl :alien + (:import-from #+(or cmu scl) :alien #+sbcl :sb-alien :slot :make-alien :alien :deref)) From afuchs at common-lisp.net Sat Oct 28 17:11:35 2006 From: afuchs at common-lisp.net (afuchs) Date: Sat, 28 Oct 2006 13:11:35 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim/Lisp-Dep Message-ID: <20061028171135.2065314007@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Lisp-Dep In directory clnet:/tmp/cvs-serv22716/Lisp-Dep Modified Files: fix-scl.lisp Log Message: Commit Douglas Crosher's non-symbol case fixes: * defsystem :clouseau: avoid pathname directory namestrings in file component names; reworking to be more portable. * defsystem :clim-examples: add the stopwatch example. * Update support for the Scieneer CL. --- /project/mcclim/cvsroot/mcclim/Lisp-Dep/fix-scl.lisp 2006/03/15 22:56:55 1.1 +++ /project/mcclim/cvsroot/mcclim/Lisp-Dep/fix-scl.lisp 2006/10/28 17:11:32 1.2 @@ -128,14 +128,12 @@ (defpackage :clim-mop - (:use :common-lisp :clos)) + (:use :clos)) (eval-when (:compile-toplevel :load-toplevel :execute) (loop for sym being the symbols of :clim-mop do (export sym :clim-mop))) -(in-package :clim-mop) - (eval-when (:compile-toplevel :load-toplevel :execute) (export '(clim-lisp-patch::defconstant clim-lisp-patch::defclass) From afuchs at common-lisp.net Sat Oct 28 17:49:24 2006 From: afuchs at common-lisp.net (afuchs) Date: Sat, 28 Oct 2006 13:49:24 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim/Backends/gtkairo Message-ID: <20061028174924.5FEFE100C@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Backends/gtkairo In directory clnet:/tmp/cvs-serv29741 Modified Files: cairo-ffi.lisp Log Message: Add explanation & link to floating point traps discussion for SCL. --- /project/mcclim/cvsroot/mcclim/Backends/gtkairo/cairo-ffi.lisp 2006/10/28 17:11:31 1.5 +++ /project/mcclim/cvsroot/mcclim/Backends/gtkairo/cairo-ffi.lisp 2006/10/28 17:49:24 1.6 @@ -41,6 +41,8 @@ , at args) (defun ,wrapper ,argnames (multiple-value-prog1 + ;; FIXME: This should probably go into with-cairo-floats. + ;; (see http://www.ircbrowse.com/channel/lisp/20061028?utime=3371045114#utime_requested) #-scl (,actual , at argnames) #+scl (ext:with-float-traps-masked (:underflow :overflow :inexact From ahefner at gmail.com Sat Oct 28 19:05:52 2006 From: ahefner at gmail.com (Andy Hefner) Date: Sat, 28 Oct 2006 15:05:52 -0400 Subject: [mcclim-cvs] CVS mcclim In-Reply-To: <20061028164413.9D4DB74347@common-lisp.net> References: <20061028164413.9D4DB74347@common-lisp.net> Message-ID: <31ffd3c40610281205t5d89419o1b22871eab3eac8@mail.gmail.com> What's all this about? On 10/28/06, thenriksen wrote: > Update of /project/mcclim/cvsroot/mcclim > In directory clnet:/tmp/cvs-serv19293 > > Modified Files: > panes.lisp > Log Message: > Add nasty hack and change :end-of-line-action for interactor panes. From dlichteblau at common-lisp.net Sun Oct 29 00:21:35 2006 From: dlichteblau at common-lisp.net (dlichteblau) Date: Sat, 28 Oct 2006 20:21:35 -0400 (EDT) Subject: [mcclim-cvs] CVS mcclim/Backends/Null Message-ID: <20061029002135.A36E57C021@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Backends/Null In directory clnet:/tmp/cvs-serv10722 Modified Files: port.lisp Log Message: removed bogus methods, lest they end up in yet another backend --- /project/mcclim/cvsroot/mcclim/Backends/Null/port.lisp 2006/03/24 11:45:03 1.1 +++ /project/mcclim/cvsroot/mcclim/Backends/Null/port.lisp 2006/10/29 00:21:35 1.2 @@ -69,13 +69,14 @@ (defmethod port-set-sheet-region ((port null-port) (graft graft) region) ()) -(defmethod port-set-sheet-transformation - ((port null-port) (graft graft) transformation) - ()) - -(defmethod port-set-sheet-transformation - ((port null-port) (sheet mirrored-sheet-mixin) transformation) - ()) +;; these don't exist +;;;(defmethod port-set-sheet-transformation +;;; ((port null-port) (graft graft) transformation) +;;; ()) +;;; +;;;(defmethod port-set-sheet-transformation +;;; ((port null-port) (sheet mirrored-sheet-mixin) transformation) +;;; ()) (defmethod port-set-sheet-region ((port null-port) (sheet mirrored-sheet-mixin) region) From afuchs at common-lisp.net Sun Oct 29 08:29:46 2006 From: afuchs at common-lisp.net (afuchs) Date: Sun, 29 Oct 2006 03:29:46 -0500 (EST) Subject: [mcclim-cvs] CVS mcclim Message-ID: <20061029082946.EB4CF7A008@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim In directory clnet:/tmp/cvs-serv19479 Modified Files: mcclim.asd Log Message: Commit 2 of 3 acl fixes by Willem Broekema: * package.lisp depends on patch.lisp (how did I miss this all the time?) * use xlib::*x-tcp-port* --- /project/mcclim/cvsroot/mcclim/mcclim.asd 2006/10/28 17:11:30 1.24 +++ /project/mcclim/cvsroot/mcclim/mcclim.asd 2006/10/29 08:29:46 1.25 @@ -91,7 +91,7 @@ #+openmcl "fix-openmcl" #+lispworks "fix-lispworks" #+clisp "fix-clisp"))) - (:file "package" :depends-on ("Lisp-Dep")))) + (:file "package" :depends-on ("Lisp-Dep" "patch")))) (defsystem :clim-core :depends-on (:clim-lisp :spatial-trees) From afuchs at common-lisp.net Sun Oct 29 08:29:47 2006 From: afuchs at common-lisp.net (afuchs) Date: Sun, 29 Oct 2006 03:29:47 -0500 (EST) Subject: [mcclim-cvs] CVS mcclim/Backends/CLX Message-ID: <20061029082947.346D714007@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Backends/CLX In directory clnet:/tmp/cvs-serv19479/Backends/CLX Modified Files: port.lisp Log Message: Commit 2 of 3 acl fixes by Willem Broekema: * package.lisp depends on patch.lisp (how did I miss this all the time?) * use xlib::*x-tcp-port* --- /project/mcclim/cvsroot/mcclim/Backends/CLX/port.lisp 2006/03/23 08:45:26 1.122 +++ /project/mcclim/cvsroot/mcclim/Backends/CLX/port.lisp 2006/10/29 08:29:46 1.123 @@ -1428,7 +1428,8 @@ :remote-filename (format nil "/tmp/.X11-unix/X~D" display) :format :binary) (socket:make-socket :remote-host (string host) - :remote-port (+ *x-tcp-port* display) + :remote-port (+ xlib::*x-tcp-port* + display) :format :binary)))) (if (streamp stream) stream From afuchs at common-lisp.net Sun Oct 29 08:31:06 2006 From: afuchs at common-lisp.net (afuchs) Date: Sun, 29 Oct 2006 03:31:06 -0500 (EST) Subject: [mcclim-cvs] CVS mcclim Message-ID: <20061029083106.763462D01F@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim In directory clnet:/tmp/cvs-serv19674 Modified Files: mcclim.asd Log Message: Get rid of the silly code deletion note in mcclim.asd (finally!) --- /project/mcclim/cvsroot/mcclim/mcclim.asd 2006/10/29 08:29:46 1.25 +++ /project/mcclim/cvsroot/mcclim/mcclim.asd 2006/10/29 08:31:06 1.26 @@ -100,14 +100,15 @@ (:module "Lisp-Dep" :depends-on ("decls") :components - ((:file #.(or - #+(and :cmu :mp (not :pthread)) "mp-cmu" - #+scl "mp-scl" - #+sb-thread "mp-sbcl" - #+excl "mp-acl" - #+openmcl "mp-openmcl" - #+lispworks "mp-lw" - #| fall back |# "mp-nil")))) + ((:file #.(first + (list + #+(and :cmu :mp (not :pthread)) "mp-cmu" + #+scl "mp-scl" + #+sb-thread "mp-sbcl" + #+excl "mp-acl" + #+openmcl "mp-openmcl" + #+lispworks "mp-lw" + #| fall back |# "mp-nil"))))) (:file "utils" :depends-on ("decls" "Lisp-Dep")) (:file "design" :depends-on ("decls" "protocol-classes" "Lisp-Dep" "utils")) (:file "X11-colors" :depends-on ("decls" "protocol-classes" "Lisp-Dep" "design")) From thenriksen at common-lisp.net Sun Oct 29 11:58:58 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Sun, 29 Oct 2006 06:58:58 -0500 (EST) Subject: [mcclim-cvs] CVS mcclim Message-ID: <20061029115858.C98AA7C034@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim In directory clnet:/tmp/cvs-serv10070 Modified Files: utils.lisp Log Message: Added working `with-system-redefinition-allowed' for CLISP. --- /project/mcclim/cvsroot/mcclim/utils.lisp 2006/03/15 22:56:54 1.45 +++ /project/mcclim/cvsroot/mcclim/utils.lisp 2006/10/29 11:58:58 1.46 @@ -41,6 +41,11 @@ (eval-when (:compile-toplevel :load-toplevel :execute) (setf (excl:package-definition-lock (find-package :common-lisp)) t)))) +#+clisp +(defmacro with-system-redefinition-allowed (&body body) + `(ext:without-package-lock ("COMMON-LISP") + , at body)) + #+openmcl (defmacro with-system-redefinition-allowed (&body body) `(progn @@ -90,7 +95,7 @@ `(progn , at body)) -#-(or excl openmcl cmu sbcl) +#-(or excl openmcl cmu sbcl clisp) (defmacro with-system-redefinition-allowed (&body body) `(progn , at body)) From crhodes at common-lisp.net Sun Oct 29 12:56:13 2006 From: crhodes at common-lisp.net (crhodes) Date: Sun, 29 Oct 2006 07:56:13 -0500 (EST) Subject: [mcclim-cvs] CVS mcclim Message-ID: <20061029125613.3D83647001@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim In directory clnet:/tmp/cvs-serv21147 Modified Files: protocol-classes.lisp Log Message: Whitespace change --- /project/mcclim/cvsroot/mcclim/protocol-classes.lisp 2006/05/05 10:24:02 1.3 +++ /project/mcclim/cvsroot/mcclim/protocol-classes.lisp 2006/10/29 12:56:13 1.4 @@ -180,7 +180,7 @@ ()) ;;; 28.2 Application Frames -(define-protocol-class application-frame () +(define-protocol-class application-frame () ()) ;;; 28.5 Frame Managers From rstrandh at common-lisp.net Sun Oct 29 15:27:31 2006 From: rstrandh at common-lisp.net (rstrandh) Date: Sun, 29 Oct 2006 10:27:31 -0500 (EST) Subject: [mcclim-cvs] CVS mcclim/Examples Message-ID: <20061029152731.2BEDB17042@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Examples In directory clnet:/tmp/cvs-serv17986 Added Files: views.lisp Log Message: An example showing the use of CLIM views. --- /project/mcclim/cvsroot/mcclim/Examples/views.lisp 2006/10/29 15:27:31 NONE +++ /project/mcclim/cvsroot/mcclim/Examples/views.lisp 2006/10/29 15:27:31 1.1 ;;; ;;; This example shows how to use CLIM view objects. We imagine a small ;;; database of members in some organization, and we sometimes want to ;;; see a list of all the members, with one member per line, and sometimes ;;; a detailed view of a single member, perhaps in order to check the ;;; payment record, or to modify some information such as the address. ;;; Copyright (c) 2006 by Robert Strandh ;;; 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. (defpackage :views-example (:use :clim-lisp :clim) (:export #:views-example)) (in-package :views-example) ;;; part of application "business logic" (defclass person () ((%last-name :initarg :last-name :accessor last-name) (%first-name :initarg :first-name :accessor first-name) (%address :initarg :address :accessor address) (%membership-number :initarg :membership-number :reader membership-number))) ;;; constructor for the PERSON class. Not strictly necessary. (defun make-person (last-name first-name address membership-number) (make-instance 'person :last-name last-name :first-name first-name :address address :membership-number membership-number)) ;;; initial list of members of the organization we imagine for this example (defparameter *members* (list (make-person "Doe" "Jane" "123, Glencoe Terrace" 12345) (make-person "Dupont" "Jean" "111, Rue de la Republique" 54321) (make-person "Smith" "Eliza" "22, Trafalgar Square" 121212) (make-person "Nilsson" "Sven" "Uppsalagatan 33" 98765))) ;;; the CLIM view class that corresponds to a list of members, one member ;;; per line of text in a CLIM application pane. (defclass members-view (view) ()) ;;; since this view does not take any parameters in our simple example, ;;; we need only a single instance of it. (defparameter *members-view* (make-instance 'members-view)) ;;; the application frame. It contains instance-specific data ;;; such as the members of our organization. (define-application-frame views () ((%members :initform *members* :accessor members)) (:panes (main-pane :application :height 500 :width 500 :display-function 'display-main-pane ;; notice the initialization of the default view of ;; the application pane. :default-view *members-view*) (interactor :interactor :height 100 :width 500)) (:layouts (default (vertically () main-pane interactor)))) ;;; the trick here is to define a generic display function ;;; that is called on the frame, the pane AND the view, ;;; whereas the standard CLIM display functions are called ;;; only on the frame and the pane. (defgeneric display-pane-with-view (frame pane view)) ;;; this is the display function that is called in each iteration ;;; of the CLIM command loop. We simply call our own, more elaborate ;;; display function with the default view of the pane. (defun display-main-pane (frame pane) (display-pane-with-view frame pane (stream-default-view pane))) ;;; now we can start writing methods on our own display function ;;; for different views. This one displays the data each member ;;; on a line of its own. (defmethod display-pane-with-view (frame pane (view members-view)) (loop for member in (members frame) do (with-output-as-presentation (pane member 'person) (format pane "~a, ~a, ~a, ~a~%" (membership-number member) (last-name member) (first-name member) (address member))))) ;;; this CLIM view is used to display the information about ;;; a single person. It has a slot that indicates what person ;;; we want to view. (defclass person-view (view) ((%person :initarg :person :reader person))) ;;; this method on our own display function shows the detailed ;;; information of a single member. (defmethod display-pane-with-view (frame pane (view person-view)) (let ((person (person view))) (format pane "Last name: ~a~%First Name: ~a~%Address: ~a~%Membership Number: ~a~%" (last-name person) (first-name person) (address person) (membership-number person)))) ;;; entry point to start our applciation (defun views-example () (run-frame-top-level (make-application-frame 'views))) ;;; command to quit the application (define-views-command (com-quit :name t) () (frame-exit *application-frame*)) ;;; command to switch the default view of the application pane ;;; (which is the value of *standard-output*) to the one that ;;; shows a member per line. (define-views-command (com-show-all :name t) () (setf (stream-default-view *standard-output*) *members-view*)) ;;; command to switch to a view that displays a single member. ;;; this command takes as an argument the person to display. ;;; In this application, the only way to satisfy the demand for ;;; the argument is to click on a line of the members view. In ;;; more elaborate application, you might be able to type a ;;; textual representation (using completion) of the person. (define-views-command (com-show-person :name t) ((person 'person)) (setf (stream-default-view *standard-output*) (make-instance 'person-view :person person))) From thenriksen at common-lisp.net Sun Oct 29 23:13:48 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Sun, 29 Oct 2006 18:13:48 -0500 (EST) Subject: [mcclim-cvs] CVS mcclim/Examples Message-ID: <20061029231348.7E11547001@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Examples In directory clnet:/tmp/cvs-serv3353/Examples Modified Files: views.lisp Log Message: Added a present and accept method so the parameters to command won't look quite as ugly. --- /project/mcclim/cvsroot/mcclim/Examples/views.lisp 2006/10/29 15:27:31 1.1 +++ /project/mcclim/cvsroot/mcclim/Examples/views.lisp 2006/10/29 23:13:48 1.2 @@ -50,6 +50,31 @@ (make-person "Smith" "Eliza" "22, Trafalgar Square" 121212) (make-person "Nilsson" "Sven" "Uppsalagatan 33" 98765))) +;;; we define a present method that is called when CLIM is told to +;;; display a person object to the user. +(define-presentation-method present ((object person) (type person) + stream view &key) + (declare (ignore view)) + (format stream "~A ~A" (first-name object) (last-name object))) + +;; we also define an accept method that CLIM uses to convert text +;; input to a person. Note that the text generated by the present +;; method is acceptable input for the accept method. +(define-presentation-method accept ((type person) stream view &key) + ;; this means we can have spaces in the input. + (with-delimiter-gestures (nil :override t) + ;; we just ask for a string and complain if it isn't a known + ;; name. We also do not want to show another input prompt, hence + ;; the :prompt and :prompt-mode parameters. + (let ((name (accept 'string :stream stream :view view + :prompt "" :prompt-mode :raw))) + (or (find name *members* + :test #'string= + :key #'(lambda (person) + (format nil "~A ~A" (first-name person) + (last-name person)))) + (simple-parse-error "~A is not a known person" name))))) + ;;; the CLIM view class that corresponds to a list of members, one member ;;; per line of text in a CLIM application pane. (defclass members-view (view) ()) From rstrandh at common-lisp.net Mon Oct 30 06:26:53 2006 From: rstrandh at common-lisp.net (rstrandh) Date: Mon, 30 Oct 2006 01:26:53 -0500 (EST) Subject: [mcclim-cvs] CVS mcclim/Doc Message-ID: <20061030062653.8752736009@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Doc In directory clnet:/tmp/cvs-serv12406 Modified Files: manual.tex Added Files: views.lisp Log Message: Added a new part (User manual) to the manual, and a first chapter (Using views) to that part. --- /project/mcclim/cvsroot/mcclim/Doc/manual.tex 2005/08/22 02:49:05 1.31 +++ /project/mcclim/cvsroot/mcclim/Doc/manual.tex 2006/10/30 06:26:53 1.32 @@ -607,6 +607,78 @@ What is finally displayed (in the interactor pane, which is the standard input of the frame), is ``the 15 of The third month''. +\part{User Manual} + +\chapter{Using views} + +The CLIM specification mentions a concept called a \emph{view}, and +also lists a number of predefined views to be used in various +different contexts. + +In this chapter we show how the \emph{view} concept can be used in +some concrete programming examples. In particular, we show how to use +a single pane to show different views of the application data +structure at different times. To switch between the different views, +we supply a set of commands that alter the +\texttt{stream-default-view} feature of all CLIM extended output +streams. + +The example shown here has been stripped to a bare minimum in order to +illustrate the important concepts. A more complete version can be +found in \texttt{Examples/views.lisp} in the McCLIM source tree. + +Here is the example: + +\verbatimtabinput{views.lisp} + +The example shows a stripped-down example of a simple database of +members of some organization. + +The main trick used in this example is the \texttt{display-main-pane} +function that is declared to be the display function of the main pane +in the application frame. The \texttt{display-main-pane} function +trampolines to a generic function called +\texttt{display-pane-with-view}, and which takes an additional +argument compared to the display functions of CLIM panes. This +additional argument is of type \texttt{view} which allows us to +dispatch not only on the type of frame and the type of pane, but also +on the type of the current default view. In this example the view +argument is simply taken from the default view of the pane. + +A possibility that is not obvious from reading the CLIM specification +is to have views that contain additional slots. Our example defines +two subclasses of the CLIM \texttt{view} class, namely +\texttt{members-view} and \texttt{person-view}. + +The first one of these does not contain any additional slots, and is +used when a global view of the members of our organization is wanted. +Since no instance-specific data is required in this view, we follow +the idea of the examples of the CLIM specification to instantiate a +singleton of this class and store that singleton in the +\texttt{stream-default-view} of our main pane whenever a global view +of our organization is required. + +The \texttt{person-view} class, on the other hand, is used when we +want a closer view of a single member of the organization. This class +therefore contains an additional slot which holds the particular +person instance we are interested in. The method on +\texttt{display-pane-with-view} that specializes on +\texttt{person-view} displays the data of the particular person that +is contained in the view. + +To switch between the views, we provide two commands. The command +\texttt{com-show-all} simply changes the default view of the main pane +to be the singleton instance of the \texttt{members-view} class. The +command \texttt{com-show-person} is more complicated. It takes an +argument of type person, creates an instance of the +\texttt{person-view} class initialized with the person that was passed +as an argument, and stores the instance as the default view of the +main pane. + +\chapter{Using command tables} + +(to be filled in) + \part{Reference Manual} \chapter{Concepts} --- /project/mcclim/cvsroot/mcclim/Doc/views.lisp 2006/10/30 06:26:53 NONE +++ /project/mcclim/cvsroot/mcclim/Doc/views.lisp 2006/10/30 06:26:53 1.1 ;;; part of application "business logic" (defclass person () ((%last-name :initarg :last-name :accessor last-name) (%first-name :initarg :first-name :accessor first-name) (%address :initarg :address :accessor address) (%membership-number :initarg :membership-number :reader membership-number))) ;;; constructor for the PERSON class. Not strictly necessary. (defun make-person (last-name first-name address membership-number) (make-instance 'person :last-name last-name :first-name first-name :address address :membership-number membership-number)) ;;; initial list of members of the organization we imagine for this example (defparameter *members* (list (make-person "Doe" "Jane" "123, Glencoe Terrace" 12345) (make-person "Dupont" "Jean" "111, Rue de la Republique" 54321) (make-person "Smith" "Eliza" "22, Trafalgar Square" 121212) (make-person "Nilsson" "Sven" "Uppsalagatan 33" 98765))) ;;; the CLIM view class that corresponds to a list of members, one member ;;; per line of text in a CLIM application pane. (defclass members-view (view) ()) ;;; since this view does not take any parameters in our simple example, ;;; we need only a single instance of it. (defparameter *members-view* (make-instance 'members-view)) ;;; the application frame. It contains instance-specific data ;;; such as the members of our organization. (define-application-frame views () ((%members :initform *members* :accessor members)) (:panes (main-pane :application :height 500 :width 500 :display-function 'display-main-pane ;; notice the initialization of the default view of ;; the application pane. :default-view *members-view*) (interactor :interactor :height 100 :width 500)) (:layouts (default (vertically () main-pane interactor)))) ;;; the trick here is to define a generic display function ;;; that is called on the frame, the pane AND the view, ;;; whereas the standard CLIM display functions are called ;;; only on the frame and the pane. (defgeneric display-pane-with-view (frame pane view)) ;;; this is the display function that is called in each iteration ;;; of the CLIM command loop. We simply call our own, more elaborate ;;; display function with the default view of the pane. (defun display-main-pane (frame pane) (display-pane-with-view frame pane (stream-default-view pane))) ;;; now we can start writing methods on our own display function ;;; for different views. This one displays the data each member ;;; on a line of its own. (defmethod display-pane-with-view (frame pane (view members-view)) (loop for member in (members frame) do (with-output-as-presentation (pane member 'person) (format pane "~a, ~a, ~a, ~a~%" (membership-number member) (last-name member) (first-name member) (address member))))) ;;; this CLIM view is used to display the information about ;;; a single person. It has a slot that indicates what person ;;; we want to view. (defclass person-view (view) ((%person :initarg :person :reader person))) ;;; this method on our own display function shows the detailed ;;; information of a single member. (defmethod display-pane-with-view (frame pane (view person-view)) (let ((person (person view))) (format pane "Last name: ~a~%First Name: ~a~%Address: ~a~%Membership Number: ~a~%" (last-name person) (first-name person) (address person) (membership-number person)))) ;;; entry point to start our applciation (defun views-example () (run-frame-top-level (make-application-frame 'views))) ;;; command to quit the application (define-views-command (com-quit :name t) () (frame-exit *application-frame*)) ;;; command to switch the default view of the application pane ;;; (which is the value of *standard-output*) to the one that ;;; shows a member per line. (define-views-command (com-show-all :name t) () (setf (stream-default-view *standard-output*) *members-view*)) ;;; command to switch to a view that displays a single member. ;;; this command takes as an argument the person to display. ;;; In this application, the only way to satisfy the demand for ;;; the argument is to click on a line of the members view. In ;;; more elaborate application, you might be able to type a ;;; textual representation (using completion) of the person. (define-views-command (com-show-person :name t) ((person 'person)) (setf (stream-default-view *standard-output*) (make-instance 'person-view :person person))) From rstrandh at common-lisp.net Mon Oct 30 08:21:01 2006 From: rstrandh at common-lisp.net (rstrandh) Date: Mon, 30 Oct 2006 03:21:01 -0500 (EST) Subject: [mcclim-cvs] CVS mcclim/Doc Message-ID: <20061030082101.832A73E002@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Doc In directory clnet:/tmp/cvs-serv27169 Modified Files: manual.tex Log Message: Section on how CLIM is different from traditional GUI toolkits. --- /project/mcclim/cvsroot/mcclim/Doc/manual.tex 2006/10/30 06:26:53 1.32 +++ /project/mcclim/cvsroot/mcclim/Doc/manual.tex 2006/10/30 08:21:01 1.33 @@ -95,6 +95,78 @@ and not well described. It will be noted here when they are partially implemented in McCLIM or not implemented at all. +\section{How CLIM is different} + +Many new users of CLIM have a hard time trying to understand how it +works and how to use it. A large part of the problem is that many +such users are used to more traditional GUI toolkits, and they try to +fit CLIM into their mental model of how GUI toolkits should work. + +But CLIM is much more than just a GUI toolkit, as suggested by its +name, it is an \emph{interface manager}, i.e. it is a complete +mediator between application ``business logic'' and the way the user +interacts with objects of the application. In fact, CLIM doesn't have +to be used with graphics output at all, as it contains a large +collection of functionality to manage text. + +Traditional GUI toolkits have an \emph{event loop}. Events are +delivered to GUI elements called \emph{gadgets} (or \emph{widgets}), +and the programmer attaches \emph{event handlers} to those gadgets in +order to invoke the functionality of the application logic. While +this way of structuring code is sometimes presented as a virtue +(``Event-driven programming''), it has an unfortunate side effect, +namely that event handlers are executed in a null context, so that it +becomes hard to even remember two consecutive events. The effect of +event-driven programming is that applications written that way have +very rudimentary interaction policies. + +At the lowest level, CLIM also has an event loop, but most application +programmers never have any reason to program at that level with CLIM. +Instead, CLIM has a \emph{command loop} at a much higher level than +the event loop. At each iteration of the command loop: + +\begin{itemize} +\item A command is acquired. You might satisfy this demand by + clicking on a menu item, by typing the name of a command, by hitting + some kind of keystroke, by pressing a button, or by pressing some + visible object with a command associated with it; +\item Arguments that are required by the command are acquired. Each + argument is often associated with a \emph{presentation type}, and + visible objects of the right presentation type can be clicked on + to satisfy this demand. You can also type a textual + representation of the argument, using completion, or you can use a + context menu; +\item The command is called on the arguments, usually resulting in + some significant modification of the data structure representing + your application logic; +\item A \emph{display routine} is called to update the views of the + application logic. The display routine may use features such as + incremental redisplay. +\end{itemize} + +Instead of attaching event handlers to gadgets, writing a CLIM +application therefore consists of: + +\begin{itemize} +\item writing CLIM commands that modify the application data + structures independently of how those commands are invoked, and + which may take application objects as arguments; +\item writing display routines that turn the application data + structures (and possibly some "view" object) into a collection of + visible representations (having presentation types) of application + objects; +\item writing completion routines that allow you to type in + application objects (of a certain presentation type) using + completions; +\item independently deciding how commands are to be invoked (menus, + buttons, presentations, textual commands, etc). +\end{itemize} + +By using CLIM as a mediator of command invocation and argument +acquisition, you can obtain some very modular code. Application logic +is completely separate from interaction policies, and the two can +evolve separately and independently. + \part{Getting Started} \chapter{CLIM Demos and Applications} From afuchs at common-lisp.net Mon Oct 30 22:20:33 2006 From: afuchs at common-lisp.net (afuchs) Date: Mon, 30 Oct 2006 17:20:33 -0500 (EST) Subject: [mcclim-cvs] CVS mcclim/Webpage Message-ID: <20061030222033.0451A33002@common-lisp.net> Update of /project/mcclim/cvsroot/mcclim/Webpage In directory clnet:/tmp/cvs-serv15760/Webpage Modified Files: index.html Log Message: Clarify the text linking to the nightly cvs snapshot. --- /project/mcclim/cvsroot/mcclim/Webpage/index.html 2006/03/30 10:06:08 1.13 +++ /project/mcclim/cvsroot/mcclim/Webpage/index.html 2006/10/30 22:20:33 1.14 @@ -53,10 +53,11 @@ >mcclim-cvs: CVS commit messages

Releases

- A compressed tar file of the sources is made nightly.

The most recent release of McCLIM is 0.9.2, in March 2006, available here: mcclim-0.9.2.tar.gz. It is also available via ASDF-INSTALL.

+

A snapshot of the CVS repository is made nightly.

+

Recent News

2006-03-30: Highly-experimental binaries of McCLIM 0.9.2, set @@ -115,7 +116,7 @@


-$Date: 2006/03/30 10:06:08 $ +$Date: 2006/10/30 22:20:33 $