anchor.diff:    (point-in-rectangle-p x y
   			(pop region) (pop region)
   			(pop region) (pop region)))
  -
  -#+unused
  -(defun ANY-POINT-IN-CLIP-RECTANGLE-P (xy-pairs &optional (region *clip-rectangle*))
  -  (do ((xy xy-pairs (cddr xy)))
  -      ((null xy) nil)
  -    (when (point-in-clip-rectangle-p (first xy) (second xy) region)
  -      (return t))))
   
   (defun RECTANGLES-OVERLAP-P (l1 r1 b1 t1 l2 r2 b2 t2)
     ;; clim does this sort of thing already
  
positive.code: ;;; are (stream x1 y1 x2 y2).  Here we put all our smarts about how to draw lines
  ;;; as fast as possible.
  
  #+clim-0.9
  (defun make-optimized-line-displayer (alu thickness record-output-history)
    (declare (ignore record-output-history))
    #'(lambda (stream from-x from-y to-x to-y)
        (with-drawing-options
  	  (stream :line-thickness thickness :ink alu)
  	(w::draw-line*-internal stream from-x from-y to-x to-y))))
  	
  #-clim-0.9
  (defun make-optimized-line-displayer (alu thickness record-output-history)
    (let (#+clim
  	(line-style nil))
      (cond (record-output-history
  	   #'(lambda (stream from-x from-y to-x to-y)
  	       #FEATURE-CASE
  	       (((not clim)
  		 (scl:send stream :draw-line from-x from-y to-x to-y alu))
  		(clim-1.0
  		 (progn
  		   ;; 152 bytes
  		   (unless line-style
  		     (setq line-style 
  		       (make-line-style :thickness thickness)))
  		   (clim::draw-line-internal
  		    stream 0 0 from-x from-y to-x to-y alu line-style)))
  		(clim-2
  		 (progn
  		   ;; 192 bytes
  		   (unless line-style
  		     (setq line-style 
  		       (make-line-style :thickness thickness)))
  		   (with-drawing-options (stream :ink alu 
  						      :line-style line-style)
  		     (medium-draw-line* 
  		      stream from-x from-y to-x to-y)))))))
  	  (t
  	   #FEATURE-CASE
  	   ((:clim-2
  	     #'(lambda (stream from-x from-y to-x to-y)
  		 (unless line-style
  		   (setq line-style (make-line-style :thickness thickness)))
  		 (clim-internals::draw-line-internal
  		  stream 0 0 from-x from-y to-x to-y alu line-style)))
  	    ((AND :CLIM-0.9 :XLIB (NOT :GENERA))
  	     (let (drawable gcontext device-transformation xoff yoff)
  	       #'(lambda (stream from-x from-y to-x to-y)
  		   (unless drawable
  		     (multiple-value-setq (drawable gcontext device-transformation)
  		       (get-drawing-guts (sheet-medium stream)))
  		     (SETF (XLIB:GCONTEXT-LINE-WIDTH GCONTEXT) (max 0 thickness))
  		     (multiple-value-setq (xoff yoff)
  		       (transformation-offsets device-transformation)))
  		   (xlib:draw-line drawable gcontext
  				   (+ xoff from-x)  (+ yoff from-y)
  				   (+ xoff to-x) (+ yoff to-y)
  				   nil))))
  	    ((AND :CLIM-1.0 :XLIB (NOT :GENERA))
  	     (let (drawable gcontext gc device-transformation (xoff 0) (yoff 0))
  	       #'(lambda (stream from-x from-y to-x to-y)
  		   (unless drawable
  		     (clim::adjust-for-viewport-and-margins stream xoff yoff)
  		     (multiple-value-setq (drawable gcontext device-transformation)
  		       (get-drawing-guts  stream))
  		     (setf gc (xlib:create-gcontext :drawable drawable))
  		     (xlib:copy-gcontext gcontext gc)
  		     (SETF (XLIB:GCONTEXT-LINE-WIDTH GCONTEXT) (max 0 thickness))
  		     (setf (xlib:gcontext-foreground gc)
  		       (clim::clx-decode-color stream alu)))
  		   (xlib:draw-line drawable gc
  				   (+ xoff from-x)  (+ yoff from-y)
  				   (+ xoff to-x) (+ yoff to-y)
  				   nil))))
  	    ((not :CLIM)
  	     (let (screen carefully x-offset y-offset)
  	       #'(lambda (stream x1 y1 x2 y2)
  		   (unless (or screen carefully)
  		     (cond ((setq carefully
  			      (typep stream 'dw::encapsulating-output-stream)))
  			   (t
  			    (multiple-value-bind (left top)
  				(scl:send stream :visible-cursorpos-limits)
  			      (declare (ignore left))
  			      (setq screen (scl:send stream :screen)
  				    x-offset (tv:sheet-inside-left stream)
  				    y-offset (- (tv:sheet-inside-top stream) top))))))
  		   (if carefully
  		       (scl:send stream :draw-line x1 y1 x2 y2 alu t)
  		     (tv:prepare-sheet (stream)
  				       (scl:send screen :%draw-line
  						 (+ x1 x-offset) (+ y1 y-offset)
  						 (+ x2 x-offset) (+ y2 y-offset)
  						 alu t stream)))))))))))
  
  
  
negative.code: (defmacro clip-line-to-clip-rectangle (x1 y1 x2 y2)
    `(apply #'%clip-line ,x1 ,y1 ,x2 ,y2 *clip-rectangle*))
  
  
  ;;; "PORTABLE" GRAPHICS DEVICE INTERFACE FOR GRAPHS.
  