The mouse-event struct was already in cl-tty.input. All mouse handling logic (mouse-mixin, hit-test, selection, clipboard, link detection) was in a separate cl-tty.mouse package. Moved everything into the input package where the struct lives, eliminating one package boundary. Changes: - absorb mouse-mixin, handle-mouse-event, hit-test, selection struct, selection variables/functions, cell-link-at, open-link-at into text-input.org (tangled to input.lisp) - update cl-tty.input defpackage with mouse exports - mouse tests merged into INPUT-SUITE (appended to input-tests.lisp) - delete mouse.org, mouse-package.lisp, mouse.lisp, mouse-tests.lisp - update ASDF, run-all-tests.lisp, scripts to drop mouse references All test suites pass at 100% (INPUT-SUITE: 102 tests, +6 from mouse)
102 lines
4.5 KiB
Common Lisp
102 lines
4.5 KiB
Common Lisp
;;; cl-tty.asd — Common Lisp Terminal UI Framework
|
|
(asdf:defsystem :cl-tty
|
|
:description "Reusable Common Lisp Terminal UI Framework"
|
|
:author "Amr Gharbeia"
|
|
:version "1.0.0"
|
|
:license "GPL-3.0"
|
|
:depends-on (:sb-posix)
|
|
:components
|
|
((:module "src/backend"
|
|
:components
|
|
((:file "package")
|
|
(:file "classes" :depends-on ("package"))
|
|
(:file "simple" :depends-on ("package" "classes"))
|
|
(:file "modern" :depends-on ("package" "classes"))
|
|
(:file "detection" :depends-on ("package" "classes"))))
|
|
(:module "src/layout"
|
|
:components
|
|
((:file "layout")))
|
|
(:module "src/rendering"
|
|
:components
|
|
((:file "framebuffer")))
|
|
(:module "src/components"
|
|
:components
|
|
((:file "package")
|
|
(:file "dirty")
|
|
(:file "box" :depends-on ("package"))
|
|
(:file "text" :depends-on ("package" "box"))
|
|
(:file "render" :depends-on ("package" "box" "text"))
|
|
(:file "theme" :depends-on ("package"))
|
|
;; Input system (v0.5.0)
|
|
(:file "input-package" :depends-on ("package"))
|
|
(:file "input" :depends-on ("input-package" "dirty" "box"))
|
|
(:file "text-input" :depends-on ("input-package" "input" "box"))
|
|
(:file "textarea" :depends-on ("input-package" "input" "box"))
|
|
(:file "keybindings" :depends-on ("input-package" "input"))
|
|
;; Container components (v0.6.0)
|
|
(:file "container-package" :depends-on ("package" "input-package"))
|
|
(:file "scrollbox" :depends-on ("container-package" "dirty" "box"))
|
|
(:file "tabbar" :depends-on ("container-package" "dirty" "box"))
|
|
;; Markdown + Code + Diff rendering (v0.8.0)
|
|
(:file "markdown-package" :depends-on ("package"))
|
|
(:file "markdown" :depends-on ("markdown-package"))
|
|
;; Dialog + Toast (v0.9.0)
|
|
(:file "dialog-package" :depends-on ("package" "input-package"))
|
|
(:file "dialog" :depends-on ("dialog-package" "dirty" "text-input"))
|
|
;; Slot system (v0.11.0)
|
|
(:file "slot-package" :depends-on ("package"))
|
|
(:file "slot" :depends-on ("slot-package")))))
|
|
:in-order-to ((test-op (test-op :cl-tty/test))))
|
|
|
|
(asdf:defsystem :cl-tty/test
|
|
:description "Test suite for cl-tty"
|
|
:depends-on (:cl-tty :fiveam)
|
|
:components
|
|
((:module "src/backend"
|
|
:components
|
|
((:file "tests")
|
|
(:file "modern-tests" :depends-on ("tests"))))
|
|
(:module "src/layout"
|
|
:components
|
|
((:file "tests")))
|
|
(:module "src/components"
|
|
:components
|
|
((:file "box-tests")
|
|
(:file "dirty-tests")
|
|
(:file "render-tests")
|
|
(:file "theme-tests")
|
|
(:file "input-tests" :pathname "../../tests/input-tests")
|
|
(:file "scrollbox-tabbar-tests" :pathname "../../tests/scrollbox-tabbar-tests")
|
|
(:file "markdown-tests" :pathname "../../tests/markdown-tests")
|
|
(:file "dialog-tests" :pathname "../../tests/dialog-tests")
|
|
(:file "slot-tests" :pathname "../../tests/slot-tests")))
|
|
(:module "src/rendering"
|
|
:components
|
|
((:file "framebuffer-tests" :pathname "../../tests/framebuffer-tests"))))
|
|
:perform (test-op (o c)
|
|
(let ((run (find-symbol "RUN" :fiveam))
|
|
(explain (find-symbol "EXPLAIN!" :fiveam))
|
|
(status (find-symbol "RESULTS-STATUS" :fiveam))
|
|
(all-passed t))
|
|
(dolist (suite '((:cl-tty-backend-test "BACKEND-SUITE")
|
|
(:cl-tty-box-test "BOX-SUITE")
|
|
(:cl-tty-input-test "INPUT-SUITE")
|
|
(:cl-tty-scrollbox-test "SCROLLBOX-SUITE")
|
|
(:cl-tty-markdown-test)
|
|
(:cl-tty-dialog-test "DIALOG-SUITE")
|
|
(:cl-tty-slot-test "SLOT-SUITE")
|
|
(:cl-tty-layout-test "LAYOUT-SUITE")
|
|
(:cl-tty-modern-backend-test "MODERN-BACKEND-SUITE")
|
|
(:cl-tty-framebuffer-test "FRAMEBUFFER-SUITE")))
|
|
(let* ((pkg (find-package (first suite)))
|
|
(suite-name (second suite))
|
|
(s (cond (suite-name (find-symbol suite-name pkg))
|
|
(pkg (find-symbol (string (first suite)) :keyword))
|
|
(t nil))))
|
|
(when s
|
|
(let ((result (funcall run s)))
|
|
(funcall explain result)
|
|
(unless (funcall status result)
|
|
(setf all-passed nil))))))
|
|
(uiop:quit (if all-passed 0 1)))))
|