We distinguish five types of coordinate systems in relation to a sheet:
- local
- coordinates as passed to drawing functions
- sheet
- coordinates are relative to the sheet’s region[fn:3]
;;;; Experimenting with 3D rendering in McCLIM | |
(ql:quickload '(mcclim 3d-matrices 3d-vectors 3d-quaternions)) | |
(defpackage #:3d-test | |
(:use #:clim #:clime #:clim-lisp #:org.shirakumo.flare.quaternion | |
#:org.shirakumo.flare.matrix #:org.shirakumo.flare.vector)) | |
(in-package :3d-test) |
;; Written by me in 2018, recovered from https://github.com/sjl/rosalind/blob/ef6194d94c8fe85b53fd0a7811f7ba85c4809bb0/rosalind.asd#L1-L9 | |
(defclass auto-module (module) ()) | |
(defmethod component-children ((self auto-module)) | |
(mapcar (lambda (p) (make-instance 'cl-source-file :type "lisp" | |
:pathname p | |
:name (pathname-name p) | |
:parent (component-parent self))) | |
(directory-files (component-pathname self) |
Presentation types are integral part of CLIM. They are used to implement typed I/O. The concept originates from the paper Presentation Based User Interfaces (1981) and is further adapted to Common Lisp realities in the paper ~A Presentation Manager Based on
We will now take a pity on the CPU and the memory. We excessively call
adjust-array
and cons a new list for each written character. We'd
like to have arrays with a two-dimensional fill pointer instead and to
adjust the array only when it is too small.
Since we are at it, we'll make this array wrapper allow a conformal displacement. We'll sketch an implementation which introduces its own operators, but this could be an extension to Common Lisp, for instance
I had few attempts to write a complete guide for writing a McCLIM backend. This time I will try to do it in few iterations starting from a naive output-only backend, through more complete solution up to the interactive version. Some McCLIM-specific interfaces may be used.
process-next-event
is responsible for reading port-specific messages
and constructing events based on that. When CLIM event is created,
distribute-event
is called on the port and the event itself.
Then event is dispatched to a target sheet. For instance:
standard-sheet-input-mixin
immediate-sheet-input-mixin
ECL’s comipler source code may be little hard to read. It relies heavily on global variables and the code has grown over many years of fixes and improvements. These notes are meant to serve the purpose of a guide (not a reference manual or a documentation). If you notice that they are not up to date then please submit a patch with corrections.