Skip to content

Instantly share code, notes, and snippets.

View dkochmanski's full-sized avatar

Daniel Kochmanski dkochmanski

View GitHub Profile
(in-package #:climi)
(defclass standard-port (clim:basic-port)
((mirrored-sheet->current-pointer-cursor :initform (make-hash-table :test #'eq))
(selections :initform (make-hash-table) :reader standard-port-selections)))
(defmethod port-lookup-current-pointer-cursor ((port standard-port) sheet)
(gethash sheet (slot-value port 'mirrored-sheet->current-pointer-cursor)))
(defmethod climb:set-sheet-pointer-cursor :before ((port standard-port) sheet cursor)
diff --git a/src/logger.lisp b/src/logger.lisp
index ad781af..ae19912 100644
--- a/src/logger.lisp
+++ b/src/logger.lisp
@@ -520,7 +520,7 @@ context of the current application."
                        (is-enabled-for ,logger-symbol ,level))
                  (flet ((,log-stmt (,stream)
                           (declare (type stream ,stream))
-                          (format ,stream ,@args)))

ECL compiler

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.

process-next-event

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
event is queued
immediate-sheet-input-mixin
event is handled
@dkochmanski
dkochmanski / file.org
Last active March 31, 2020 16:52
tutorial.org

Writing CLIM backend tutorial

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.

Project skeleton

Conformal displacement sketch {#conformal-displacement-sketch}

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

Presentation types in McCLIM

Introduction

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

Extended Stream Input Facilities in McCLIM

Introduction

This writeup purpose is to summarize the specification of input streams. CLIM provides a stream-oriented input layer that is implemented on top of the sheet input architecture.

Introduction

  1. The layout protocol is triggered by LAYOUT-FRAME, which is called when a frame is adopted by a frame manager
  2. First pass :: space composition
    • Hey top-level pane, how much space do you require? Give me your space-requirement instance!