Commit cfc1c4b9 authored by Alastair Bridgewater's avatar Alastair Bridgewater
Browse files

sheet/: Initial rough-in for mirrored sheets.

  * This is CLIM II 9.4 and a goodly chunk of 9.4.1.

  * Some parts of this are very rough, as they depend on the PORT
concept, which we do not yet have.

  * Some parts of this are incomplete, simply because they
interact with a per-backend component that is yet to be written.

  * Some parts of this are commented-out because the specification
is rather strange where they are concerned, and they are not
immediately required.
parent 33ba1e4e
......@@ -39,6 +39,8 @@
(load (compile-file file)))
;;; nq-clim/sheet/mirror-functions
;;; CLIM II 9.4.1.
(cl:defpackage :nq-clim/sheet/mirror-functions
(:use :cl
(cl:in-package :nq-clim/sheet/mirror-functions)
(defgeneric sheet-direct-mirror (sheet)
(:method ((sheet sheet))
(defgeneric sheet-mirrored-ancestor (sheet)
(:method ((sheet sheet))
(if (sheet-direct-mirror sheet)
(sheet-mirrored-ancestor (sheet-parent sheet)))))
(defgeneric sheet-mirror (sheet)
(:method ((sheet sheet))
(or (sheet-direct-mirror sheet)
(sheet-mirror (sheet-parent sheet)))))
(defgeneric realize-mirror (port mirrored-sheet))
(defgeneric destroy-mirror (port mirrored-sheet))
;; These two functions are oddly-specified, with no useful behavior
;; associated with the oddity. Ignoring them for now.
;; (defgeneric raise-mirror (port sheet))
;; (defgeneric bury-mirror (port sheet))
#+(or) ;; PORT generic function yet to be defined.
(defmethod port ((sheet sheet))
;;; EOF
;;; nq-clim/sheet/mirrored-sheet-mixin
;;; CLIM II 9.4.
(cl:defpackage :nq-clim/sheet/mirrored-sheet-mixin
(:use :cl
(cl:in-package :nq-clim/sheet/mirrored-sheet-mixin)
(defclass mirrored-sheet-mixin ()
((port :reader port :initform nil)
(mirror :reader sheet-direct-mirror :initform nil)))
(defmethod realize-mirror :around (port (mirrored-sheet mirrored-sheet-mixin))
(let ((mirror (call-next-method)))
(setf (slot-value mirrored-sheet 'port) port)
(setf (slot-value mirrored-sheet 'mirror) mirror)
(defmethod destroy-mirror :after (port (mirrored-sheet mirrored-sheet-mixin))
(setf (slot-value mirrored-sheet 'port) nil)
(setf (slot-value mirrored-sheet 'mirror) nil))
;;; EOF
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment