Update of /project/mcclim/cvsroot/mcclim In directory common-lisp.net:/tmp/cvs-serv6115
Modified Files: frames.lisp panes.lisp Log Message: Implemented double buffering for CLIM stream panes that want it. Use the `:double-buffering t' initarg to obtain it.
Date: Thu Oct 27 03:21:34 2005 Author: rstrandh
Index: mcclim/frames.lisp diff -u mcclim/frames.lisp:1.108 mcclim/frames.lisp:1.109 --- mcclim/frames.lisp:1.108 Thu Aug 18 05:17:21 2005 +++ mcclim/frames.lisp Thu Oct 27 03:21:33 2005 @@ -427,6 +427,23 @@ (declare (ignore pane force-p)) nil)
+(defgeneric medium-invoke-with-possible-double-buffering (frame pane medium continuation)) + +(defmethod medium-invoke-with-possible-double-buffering (frame pane medium continuation) + (funcall continuation)) + +(defgeneric invoke-with-possible-double-buffering (frame pane continuation)) + +(defmethod invoke-with-possible-double-buffering (frame pane continuation) + (declare (ignore frame pane)) + (funcall continuation)) + +(defmethod invoke-with-possible-double-buffering (frame (pane sheet-with-medium-mixin) continuation) + (medium-invoke-with-possible-double-buffering frame pane (sheet-medium pane) continuation)) + +(defmacro with-possible-double-buffering ((frame pane) &body body) + `(invoke-with-possible-double-buffering ,frame ,pane (lambda () ,@body))) + (defmethod redisplay-frame-pane :around ((frame application-frame) pane &key force-p) (multiple-value-bind (redisplayp clearp) @@ -439,9 +456,10 @@ (when hilited (highlight-presentation-1 (car hilited) (cdr hilited) :unhighlight) (setf (frame-hilited-presentation frame) nil))) - (when clearp - (window-clear pane)) - (call-next-method) + (with-possible-double-buffering (frame pane) + (when clearp + (window-clear pane)) + (call-next-method)) (unless (or (eq redisplayp :command-loop) (eq redisplayp :no-clear)) (setf (pane-needs-redisplay pane) nil)))))
Index: mcclim/panes.lisp diff -u mcclim/panes.lisp:1.155 mcclim/panes.lisp:1.156 --- mcclim/panes.lisp:1.155 Tue Aug 30 00:39:31 2005 +++ mcclim/panes.lisp Thu Oct 27 03:21:33 2005 @@ -27,7 +27,7 @@ ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;;; Boston, MA 02111-1307 USA.
-;;; $Id: panes.lisp,v 1.155 2005/08/29 22:39:31 mretzlaff Exp $ +;;; $Id: panes.lisp,v 1.156 2005/10/27 01:21:33 rstrandh Exp $
(in-package :clim-internals)
@@ -2219,6 +2219,12 @@ (declare (ignore force-p)) (invoke-display-function frame pane))
+(defgeneric pane-double-buffering (pane)) + +(defmethod pane-double-buffering (pane) + (declare (ignore pane)) + nil) + (defclass clim-stream-pane (updating-output-stream-mixin pane-display-mixin permanent-medium-sheet-output-mixin @@ -2252,6 +2258,9 @@ (end-of-page-action :initform :scroll :initarg :end-of-line-action :reader pane-end-of-page-action) + (double-buffering :initform nil + :initarg :double-buffering + :reader pane-double-buffering) ;; Slots of space-requirement-options-mixin defined with accessors for our ;; convenience (user-width :accessor pane-user-width)