1
0
Fork 0

- used package local nickname instead us :use croatoan's symbols.

This commit is contained in:
cage 2022-03-21 21:42:50 +01:00
parent 78fcdaa7cf
commit d9a8d03472
16 changed files with 153 additions and 160 deletions

View File

@ -1057,7 +1057,8 @@ $(PACKAGE): $(CONF_PATH_FILE) *.asd src/*
$(LISP_COMPILER) \ $(LISP_COMPILER) \
--eval "(asdf:load-system '$(PACKAGE))" \ --eval "(asdf:load-system '$(PACKAGE))" \
--eval "(in-package main)" \ --eval "(in-package main)" \
--eval "(asdf:make-build :tinmop :type :program :move-here #P\"./\" :epilogue-code '(main::main))"; \ --eval "(asdf:make-build :tinmop :type :program :move-here #P\"./\" :epilogue-code '(main::main))" \
--eval "(si:exit)"; \
fi fi
$(CONF_PATH_FILE): $(CONF_PATH_FILE):
grep "^;" $(CONF_PATH_FILE_IN) > $(CONF_PATH_FILE) grep "^;" $(CONF_PATH_FILE_IN) > $(CONF_PATH_FILE)

View File

@ -71,10 +71,10 @@
(setf read-message-fg fg-read) (setf read-message-fg fg-read)
(setf unread-message-bg bg-unread) (setf unread-message-bg bg-unread)
(setf unread-message-fg fg-unread) (setf unread-message-fg fg-unread)
(setf (background croatoan-window) (setf (c:background croatoan-window)
(tui:make-win-background bg)) (tui:make-win-background bg))
(setf (bgcolor croatoan-window) bg) (setf (c:bgcolor croatoan-window) bg)
(setf (fgcolor croatoan-window) fg) (setf (c:fgcolor croatoan-window) fg)
(setf selected-line-fg selected-fg) (setf selected-line-fg selected-fg)
(setf selected-line-bg selected-bg) (setf selected-line-bg selected-bg)
(win-resize object width height) (win-resize object width height)

View File

@ -149,7 +149,7 @@
(let ((height (- (win-height *main-window*) (let ((height (- (win-height *main-window*)
(win-height *message-window*))) (win-height *message-window*)))
(width (win-width *main-window*))) (width (win-width *main-window*)))
(resize croatoan-window height width))) (c:resize croatoan-window height width)))
(win-move object 0 0))) (win-move object 0 0)))
(defmethod calculate :after ((object filesystem-tree-window) dt) (defmethod calculate :after ((object filesystem-tree-window) dt)
@ -178,8 +178,8 @@
(defun treenode->selected-text (data window) (defun treenode->selected-text (data window)
(tui-string-apply-colors (treenode->text data window) (tui-string-apply-colors (treenode->text data window)
(bgcolor window) (c:bgcolor window)
(fgcolor window))) (c:fgcolor window)))
(defun query-local-filesystem-path (path what) (defun query-local-filesystem-path (path what)
(case what (case what
@ -383,7 +383,7 @@
(window-width (usable-window-width window)) (window-width (usable-window-width window))
(max-line-width nil)) (max-line-width nil))
(loop for expanded-row in expanded-rows (loop for expanded-row in expanded-rows
when (> (text-width (normal-text expanded-row)) when (> (c:text-width (normal-text expanded-row))
window-width) window-width)
do do
(setf max-line-width expanded-row)) (setf max-line-width expanded-row))

View File

@ -57,10 +57,10 @@
(/ height 2)))) (/ height 2))))
(x (truncate (- (/ (win-width screen) 2) (x (truncate (- (/ (win-width screen) 2)
(/ width 2))))) (/ width 2)))))
(setf (background croatoan-window) (setf (c:background croatoan-window)
(tui:make-win-background bg)) (tui:make-win-background bg))
(setf (bgcolor croatoan-window) bg) (setf (c:bgcolor croatoan-window) bg)
(setf (fgcolor croatoan-window) fg) (setf (c:fgcolor croatoan-window) fg)
(setf style theme-style) (setf style theme-style)
(win-resize object width height) (win-resize object width height)
(win-move object x y) (win-move object x y)
@ -77,8 +77,8 @@
(with-accessors ((style style) (with-accessors ((style style)
(header-message-lines header-message-lines)) object (header-message-lines header-message-lines)) object
(with-croatoan-window (croatoan-window object) (with-croatoan-window (croatoan-window object)
(let* ((bgcolor (bgcolor croatoan-window)) (let* ((bgcolor (c:bgcolor croatoan-window))
(fgcolor (fgcolor croatoan-window)) (fgcolor (c:fgcolor croatoan-window))
(win-width (win-width-no-border object))) (win-width (win-width-no-border object)))
(loop (loop
for y from 1 for y from 1
@ -118,8 +118,8 @@
(refresh-config *follow-requests-window*) (refresh-config *follow-requests-window*)
(line-oriented-window:update-all-rows *follow-requests-window* (line-oriented-window:update-all-rows *follow-requests-window*
(make-rows usernames-follow-requests (make-rows usernames-follow-requests
(bgcolor low-level-window) (c:bgcolor low-level-window)
(fgcolor low-level-window))) (c:fgcolor low-level-window)))
(setf (row-selected-index *follow-requests-window*) 0) (setf (row-selected-index *follow-requests-window*) 0)
*follow-requests-window*))) *follow-requests-window*)))

View File

@ -47,9 +47,9 @@
(x 0)) (x 0))
(setf selected-line-fg selected-fg) (setf selected-line-fg selected-fg)
(setf selected-line-bg selected-bg) (setf selected-line-bg selected-bg)
(setf (background croatoan-window) (tui:make-win-background bg)) (setf (c:background croatoan-window) (tui:make-win-background bg))
(setf (bgcolor croatoan-window) bg) (setf (c:bgcolor croatoan-window) bg)
(setf (fgcolor croatoan-window) fg) (setf (c:fgcolor croatoan-window) fg)
(win-resize object width height) (win-resize object width height)
(win-move object x y) (win-move object x y)
object))) object)))

View File

@ -505,10 +505,8 @@ will fire the `callback' function (with the selected field from `all-fields'
(draw high-level-window) (draw high-level-window)
(win-box high-level-window) (win-box high-level-window)
(print-text high-level-window title 2 0))) (print-text high-level-window title 2 0)))
(setf (background low-level-window) (setf (c:background low-level-window) (tui:make-win-background bg))
(tui:make-win-background bg)) (setf (c:fgcolor low-level-window) fg)
(setf (fgcolor low-level-window)
fg)
(win-resize high-level-window window-width window-height) (win-resize high-level-window window-width window-height)
(win-move high-level-window window-x window-y) (win-move high-level-window window-x window-y)
(setf (rows high-level-window) (setf (rows high-level-window)
@ -527,7 +525,7 @@ will fire the `callback' function (with the selected field from `all-fields'
(select-row high-level-window 0) (select-row high-level-window 0)
(draw) (draw)
(loop named inner (loop named inner
for c = (tui:decode-key-event (get-wide-event low-level-window)) for c = (tui:decode-key-event (c:get-wide-event low-level-window))
while (string/= c "q") while (string/= c "q")
do do
(cond (cond

View File

@ -34,32 +34,32 @@
the event that is fired when no input from user (key pressed mouse the event that is fired when no input from user (key pressed mouse
etc.) happened" etc.) happened"
(windows:with-croatoan-window (croatoan-window specials:*main-window*) (windows:with-croatoan-window (croatoan-window specials:*main-window*)
(bind croatoan-window (c:bind croatoan-window
:resize :resize
(lambda (w event) (lambda (w event)
(declare (ignore w event)) (declare (ignore w event))
(windows:refresh-config-all) (windows:refresh-config-all)
(windows:draw-all))) (windows:draw-all)))
(bind croatoan-window (c:bind croatoan-window
t t
(lambda (w event) (lambda (w event)
(declare (ignore w)) (declare (ignore w))
(incf-dt) (incf-dt)
(handler-bind ((conditions:command-not-found (handler-bind ((conditions:command-not-found
(lambda (e) (lambda (e)
(invoke-restart 'command-window:print-error e)))) (invoke-restart 'command-window:print-error e))))
(command-window:manage-event event)))) (command-window:manage-event event))))
;; this is the main thread ;; this is the main thread
(bind croatoan-window (c:bind croatoan-window
nil nil
(lambda (w e) (lambda (w e)
(declare (ignore w e)) (declare (ignore w e))
(incf-dt) (incf-dt)
(incf-ticks) (incf-ticks)
(scheduled-events:run-scheduled-events *ticks*) (scheduled-events:run-scheduled-events *ticks*)
(when (not (program-events:stop-event-dispatching-p)) (when (not (program-events:stop-event-dispatching-p))
(program-events:dispatch-program-events)) (program-events:dispatch-program-events))
(windows:calculate-all +dt+))))) (windows:calculate-all +dt+)))))
(defun init-i18n () (defun init-i18n ()
"Initialize i18n machinery" "Initialize i18n machinery"
@ -187,15 +187,15 @@ etc.) happened"
(defun run (draw-welcome-string) (defun run (draw-welcome-string)
(windows:with-croatoan-window (croatoan-window specials:*main-window*) (windows:with-croatoan-window (croatoan-window specials:*main-window*)
(setf (frame-rate croatoan-window) +fps+) (setf (c:frame-rate croatoan-window) +fps+)
(db-utils:with-ready-database (:connect nil) (db-utils:with-ready-database (:connect nil)
(unwind-protect (unwind-protect
(progn (progn
(when draw-welcome-string (when draw-welcome-string
(ui:show-welcome-window)) (ui:show-welcome-window))
(hooks:run-hooks 'hooks:*before-main-loop*) (hooks:run-hooks 'hooks:*before-main-loop*)
(run-event-loop croatoan-window)) (c:run-event-loop croatoan-window))
(end-screen))))) (c:end-screen)))))
(defun load-script-file () (defun load-script-file ()
"Load (execute) a lisp file used in requests of a command line switch" "Load (execute) a lisp file used in requests of a command line switch"
@ -220,7 +220,7 @@ etc.) happened"
(t (t
(let ((croatoan::*debugger-hook* #'(lambda (c h) (let ((croatoan::*debugger-hook* #'(lambda (c h)
(declare (ignore h)) (declare (ignore h))
(end-screen) (c:end-screen)
(print c)))) (print c))))
(init) (init)
(run first-time-starting)))))) (run first-time-starting))))))

View File

@ -303,7 +303,7 @@
(defun make-invisible-row (original-object &optional (text "")) (defun make-invisible-row (original-object &optional (text ""))
(let ((res (make-instance 'line (let ((res (make-instance 'line
:fields (list +row-invisible-field-key+ t) :fields (list +row-invisible-field-key+ t)
:normal-text (if (typep text 'croatoan:complex-string) :normal-text (if (typep text 'c:complex-string)
text text
(make-tui-string text))))) (make-tui-string text)))))
(row-add-original-object res original-object) (row-add-original-object res original-object)
@ -420,7 +420,7 @@
collect collect
(text->rendered-lines-rows window i)))) (text->rendered-lines-rows window i))))
(defmethod text->rendered-lines-rows (window (text complex-string)) (defmethod text->rendered-lines-rows (window (text c:complex-string))
text) text)
(defgeneric collect-lines-from-ir (object window &key &allow-other-keys)) (defgeneric collect-lines-from-ir (object window &key &allow-other-keys))
@ -519,7 +519,7 @@
(defmethod colorize-lines ((object line)) (defmethod colorize-lines ((object line))
object) object)
(defmethod colorize-lines ((object complex-string)) (defmethod colorize-lines ((object c:complex-string))
(make-instance 'line :normal-text object)) (make-instance 'line :normal-text object))
(defmethod colorize-lines ((object string)) (defmethod colorize-lines ((object string))

View File

@ -77,10 +77,9 @@
(defun force-error-colors (window) (defun force-error-colors (window)
(with-croatoan-window (croatoan-window window) (with-croatoan-window (croatoan-window window)
(setf (background croatoan-window) (setf (c:background croatoan-window) (tui:make-win-background :red))
(tui:make-win-background :red)) (setf (c:bgcolor croatoan-window) :red)
(setf (bgcolor croatoan-window) :red) (setf (c:fgcolor croatoan-window) :yellow))
(setf (fgcolor croatoan-window) :yellow))
window) window)
(defun make-notification-window (message life &key (pending 0) (hidep nil) (notify-error nil)) (defun make-notification-window (message life &key (pending 0) (hidep nil) (notify-error nil))

View File

@ -68,10 +68,9 @@
(truncate (- (/ (win-height *main-window*) 2) (truncate (- (/ (win-height *main-window*) 2)
(/ win-h 2))) (/ win-h 2)))
0))) 0)))
(setf (background croatoan-window) (setf (c:background croatoan-window) (tui:make-win-background bg))
(tui:make-win-background bg)) (setf (c:bgcolor croatoan-window) bg)
(setf (bgcolor croatoan-window) bg) (setf (c:fgcolor croatoan-window) fg)
(setf (fgcolor croatoan-window) fg)
(setf selected-line-fg selected-fg) (setf selected-line-fg selected-fg)
(setf selected-line-bg selected-bg) (setf selected-line-bg selected-bg)
(setf unselected-line-fg unselected-fg) (setf unselected-line-fg unselected-fg)

View File

@ -169,8 +169,8 @@
(print-text object (print-text object
(format nil "[~a] ~a" index (gemini-parser:name link)) (format nil "[~a] ~a" index (gemini-parser:name link))
1 y 1 y
:bgcolor (bgcolor croatoan-window) :bgcolor (c:bgcolor croatoan-window)
:fgcolor (fgcolor croatoan-window))))))) :fgcolor (c:fgcolor croatoan-window)))))))
(defmethod search-row ((object open-gemini-document-link-window) regex &key (redraw t)) (defmethod search-row ((object open-gemini-document-link-window) regex &key (redraw t))
(handler-case (handler-case

View File

@ -1744,7 +1744,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:stack :stack
@ -1756,6 +1755,7 @@
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:shadowing-import-from :stack :stack :stack-push :stack-pop :stack-empty-p) (:shadowing-import-from :stack :stack :stack-push :stack-pop :stack-empty-p)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:local-nicknames (:c :croatoan))
(:export (:export
:key-config-holder :key-config-holder
:key-config :key-config
@ -1838,7 +1838,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -1849,6 +1848,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:local-nicknames (:c :croatoan))
(:export (:export
:notify-window :notify-window
:pending :pending
@ -1861,7 +1861,6 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -1871,6 +1870,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:local-nicknames (:c :croatoan))
(:export (:export
:suggestions-window :suggestions-window
:paginated-info :paginated-info
@ -1883,7 +1883,6 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -1894,6 +1893,7 @@
:suggestions-window) :suggestions-window)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:+starting-item-index+ :+starting-item-index+
:complete-window :complete-window
@ -1907,7 +1907,6 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -1920,6 +1919,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:keybindings-window :keybindings-window
:keybindings-tree :keybindings-tree
@ -1979,7 +1979,6 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -1993,6 +1992,7 @@
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:import-from :keybindings-window :update-keybindings-tree) (:import-from :keybindings-window :update-keybindings-tree)
(:local-nicknames (:c :croatoan))
(:export (:export
:line :line
:selected-fg :selected-fg
@ -2061,7 +2061,6 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2074,6 +2073,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:+octect-type+ :+octect-type+
:make-temporary-file-from-node :make-temporary-file-from-node
@ -2136,7 +2136,6 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2152,6 +2151,7 @@
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:import-from :keybindings-window :update-keybindings-tree) (:import-from :keybindings-window :update-keybindings-tree)
(:local-nicknames (:c :croatoan))
(:export (:export
:message-line :message-line
:thread-window :thread-window
@ -2182,7 +2182,6 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2196,6 +2195,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:message-window :message-window
:metadata :metadata
@ -2252,7 +2252,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2264,6 +2263,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:open-attach-window :open-attach-window
:status-id :status-id
@ -2278,7 +2278,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2290,6 +2289,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:open-message-link :open-message-link
:init :init
@ -2305,7 +2305,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2317,6 +2316,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:open-gemini-certificates-window)) :open-gemini-certificates-window))
@ -2326,7 +2326,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2338,6 +2337,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:open-gemini-subscription-window)) :open-gemini-subscription-window))
@ -2347,7 +2347,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2359,6 +2358,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:highlight-current-section :highlight-current-section
:open-toc-window)) :open-toc-window))
@ -2368,7 +2368,6 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2382,6 +2381,7 @@
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:import-from :keybindings-window :update-keybindings-tree) (:import-from :keybindings-window :update-keybindings-tree)
(:local-nicknames (:c :croatoan))
(:export (:export
:print-error :print-error
:command-window :command-window
@ -2403,7 +2403,6 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2417,6 +2416,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:message-ready-to-send :message-ready-to-send
:subject :subject
@ -2435,7 +2435,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2447,6 +2446,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:follow-requests-window :follow-requests-window
:init :init
@ -2458,7 +2458,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2470,6 +2469,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:tags-window :tags-window
:resync-rows-db :resync-rows-db
@ -2481,7 +2481,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2493,6 +2492,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:conversations-window :conversations-window
:resync-rows-db :resync-rows-db
@ -2504,7 +2504,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2516,6 +2515,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:chats-list-window :chats-list-window
:chat->text :chat->text
@ -2527,7 +2527,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2538,6 +2537,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:push-db-stream :push-db-stream
:remove-db-stream :remove-db-stream
@ -2611,7 +2611,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2622,6 +2621,7 @@
:tui-utils) :tui-utils)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:focused-window :focused-window
:focused-keybindings :focused-keybindings
@ -2635,7 +2635,6 @@
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:access :access
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
@ -2648,7 +2647,8 @@
(:nicknames :ui) (:nicknames :ui)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:fstree :filesystem-tree-window)) (:local-nicknames (:fstree :filesystem-tree-window)
(:c :croatoan))
(:export (:export
:delete-message-status-marked-to-delete :delete-message-status-marked-to-delete
:open-manual :open-manual
@ -2897,7 +2897,6 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:misc-utils :misc-utils
@ -2905,6 +2904,7 @@
:specials) :specials)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:shadowing-import-from :misc :random-elt :shuffle) (:shadowing-import-from :misc :random-elt :shuffle)
(:local-nicknames (:c :croatoan))
(:export (:export
:refresh-refresh-all-chats-data :refresh-refresh-all-chats-data
:refresh-refresh-all-chats-messages :refresh-refresh-all-chats-messages
@ -2949,10 +2949,10 @@
:cl :cl
:alexandria :alexandria
:cl-ppcre :cl-ppcre
:croatoan
:config :config
:constants :constants
:text-utils :text-utils
:command-line) :command-line)
(:shadowing-import-from :text-utils :split-lines) (:shadowing-import-from :text-utils :split-lines)
(:local-nicknames (:c :croatoan))
(:export)) (:export))

View File

@ -322,7 +322,7 @@
(defmethod process-event ((object change-window-title-event)) (defmethod process-event ((object change-window-title-event))
(with-accessors ((title payload) (with-accessors ((title payload)
(window window)) object (window window)) object
(setf (message-window::title window) title))) (setf (windows::title window) title)))
(define-constant +max-recover-count+ 3) (define-constant +max-recover-count+ 3)

View File

@ -90,10 +90,9 @@
(x (truncate (- (/ (win-width screen) 2) (x (truncate (- (/ (win-width screen) 2)
(/ width 2)))) (/ width 2))))
(attach-y-start +header-send-window-height+)) (attach-y-start +header-send-window-height+))
(setf (background croatoan-window) (setf (c:background croatoan-window) (tui:make-win-background bg))
(tui:make-win-background bg)) (setf (c:bgcolor croatoan-window) bg)
(setf (bgcolor croatoan-window) bg) (setf (c:fgcolor croatoan-window) fg)
(setf (fgcolor croatoan-window) fg)
(setf style theme-style) (setf style theme-style)
(win-resize object width height) (win-resize object width height)
(win-move object x y) (win-move object x y)
@ -110,8 +109,8 @@
(mentions mentions) (mentions mentions)
(visibility visibility)) message-data (visibility visibility)) message-data
(with-croatoan-window (croatoan-window object) (with-croatoan-window (croatoan-window object)
(let* ((bgcolor (bgcolor croatoan-window)) (let* ((bgcolor (c:bgcolor croatoan-window))
(fgcolor (fgcolor croatoan-window)) (fgcolor (c:fgcolor croatoan-window))
(input-bg (swconf:input-background style)) (input-bg (swconf:input-background style))
(input-fg (swconf:input-foreground style)) (input-fg (swconf:input-foreground style))
(user (if reply-to (user (if reply-to
@ -202,7 +201,7 @@
(refresh-config *send-message-window*) (refresh-config *send-message-window*)
(line-oriented-window:update-all-rows *send-message-window* (line-oriented-window:update-all-rows *send-message-window*
(make-rows (attachments message-data) (make-rows (attachments message-data)
(bgcolor low-level-window) (c:bgcolor low-level-window)
(fgcolor low-level-window))) (c:fgcolor low-level-window)))
(setf (row-selected-index *send-message-window*) 0) (setf (row-selected-index *send-message-window*) 0)
*send-message-window*))) *send-message-window*)))

View File

@ -51,10 +51,9 @@
(setf selected-line-bg selected-bg) (setf selected-line-bg selected-bg)
(setf new-messages-mark new-message-value) (setf new-messages-mark new-message-value)
(setf histogram-fg (swconf:tags-histogram-foreground)) (setf histogram-fg (swconf:tags-histogram-foreground))
(setf (background croatoan-window) (setf (c:background croatoan-window) (tui:make-win-background bg))
(tui:make-win-background bg)) (setf (c:bgcolor croatoan-window) bg)
(setf (bgcolor croatoan-window) bg) (setf (c:fgcolor croatoan-window) fg)
(setf (fgcolor croatoan-window) fg)
(win-resize object width height) (win-resize object width height)
(win-move object x y) (win-move object x y)
object))) object)))
@ -83,11 +82,11 @@
(print-text object (print-text object
histogram histogram
1 y 1 y
:bgcolor (bgcolor croatoan-window) :bgcolor (c:bgcolor croatoan-window)
:fgcolor histogram-fg) :fgcolor histogram-fg)
(when got-new-messages-p (when got-new-messages-p
(print-text object new-messages-mark nil nil (print-text object new-messages-mark nil nil
:bgcolor (bgcolor croatoan-window) :bgcolor (c:bgcolor croatoan-window)
:fgcolor histogram-fg))))))))) :fgcolor histogram-fg)))))))))
(defmethod resync-rows-db ((object tags-window) &key (redraw t) (suggested-message-index nil)) (defmethod resync-rows-db ((object tags-window) &key (redraw t) (suggested-message-index nil))

View File

@ -128,7 +128,7 @@
(defun win-clear (window &key (redraw nil)) (defun win-clear (window &key (redraw nil))
"Clear window content" "Clear window content"
(clear (croatoan-window window) :target :window :redraw redraw)) (c:clear (croatoan-window window) :target :window :redraw redraw))
(defmacro gen-simple-win->croatoan-specialized-wrapper (fn-name &optional (prefix nil)) (defmacro gen-simple-win->croatoan-specialized-wrapper (fn-name &optional (prefix nil))
"Generate micro wrapper for simple curses library function (window "Generate micro wrapper for simple curses library function (window
@ -136,7 +136,7 @@ height, position and so on)"
(with-gensyms (window inner) (with-gensyms (window inner)
`(defun ,(format-fn-symbol t "~@[~a-~]~a" prefix fn-name) (,window) `(defun ,(format-fn-symbol t "~@[~a-~]~a" prefix fn-name) (,window)
(with-croatoan-window (,inner ,window) (with-croatoan-window (,inner ,window)
(,fn-name ,inner))))) (,(format-fn-symbol 'c "~a" fn-name) ,inner)))))
(gen-simple-win->croatoan-specialized-wrapper width win) (gen-simple-win->croatoan-specialized-wrapper width win)
@ -155,12 +155,12 @@ height, position and so on)"
(defun menu-select (window) (defun menu-select (window)
(with-croatoan-window (croatoan-window window) (with-croatoan-window (croatoan-window window)
(prog1 (prog1
(select croatoan-window) (c:select croatoan-window)
(win-close window)))) (win-close window))))
(defun win-visible-p (win) (defun win-visible-p (win)
(with-croatoan-window (croatoan-window win) (with-croatoan-window (croatoan-window win)
(visiblep croatoan-window))) (c:visiblep croatoan-window)))
(defun win-close (window) (defun win-close (window)
(with-croatoan-window (croatoan-window window) (with-croatoan-window (croatoan-window window)
@ -180,11 +180,11 @@ height, position and so on)"
(defun win-x (win) (defun win-x (win)
(with-croatoan-window (inner-window win) (with-croatoan-window (inner-window win)
(second (widget-position inner-window)))) (second (c:widget-position inner-window))))
(defun win-y (win) (defun win-y (win)
(with-croatoan-window (inner-window win) (with-croatoan-window (inner-window win)
(first (widget-position inner-window)))) (first (c:widget-position inner-window))))
(defmacro with-window-width ((win w) &body body) (defmacro with-window-width ((win w) &body body)
`(let ((,w (win-width ,win))) `(let ((,w (win-width ,win)))
@ -214,44 +214,44 @@ height, position and so on)"
(defun win-move-cursor (window x y &key relative) (defun win-move-cursor (window x y &key relative)
"Wrapper of croatoan:move-window" "Wrapper of croatoan:move-window"
(with-croatoan-window (inner window) (with-croatoan-window (inner window)
(move inner y x :relative relative))) (c:move inner y x :relative relative)))
(defun win-move-cursor-direction (window direction &optional (n 1)) (defun win-move-cursor-direction (window direction &optional (n 1))
"Wrapper for croatoan:move-direction" "Wrapper for croatoan:move-direction"
(with-croatoan-window (inner window) (with-croatoan-window (inner window)
(move-direction inner direction n))) (c:move-direction inner direction n)))
(defun win-move (window x y &key relative) (defun win-move (window x y &key relative)
"Wrapper for croatoan:move-window" "Wrapper for croatoan:move-window"
(with-croatoan-window (inner window) (with-croatoan-window (inner window)
(move-window inner y x :relative relative))) (c:move-window inner y x :relative relative)))
(defun win-resize (window width height) (defun win-resize (window width height)
"Wrapper for croatoan:resize" "Wrapper for croatoan:resize"
(with-croatoan-window (inner window) (with-croatoan-window (inner window)
(resize inner height width))) (c:resize inner height width)))
(defun win-show (window) (defun win-show (window)
"Show a window (must be stacked, see croatoan)" "Show a window (must be stacked, see croatoan)"
(with-croatoan-window (inner window) (with-croatoan-window (inner window)
(setf (visiblep inner) t))) (setf (c:visiblep inner) t)))
(defun win-hide (window) (defun win-hide (window)
"Hide a window (must be stacked, see croatoan)" "Hide a window (must be stacked, see croatoan)"
(with-croatoan-window (inner window) (with-croatoan-window (inner window)
(setf (visiblep inner) nil))) (setf (c:visiblep inner) nil)))
(defun win-shown-p (window) (defun win-shown-p (window)
"Show a window (must be stacked, see croatoan)" "Show a window (must be stacked, see croatoan)"
(with-croatoan-window (inner window) (with-croatoan-window (inner window)
(visiblep inner))) (c:visiblep inner)))
(defun win-set-background (window bg) (defun win-set-background (window bg)
"Set window background "Set window background
- window an instance of 'wrapper-window'; - window an instance of 'wrapper-window';
- bg the returns value of 'tui-utils:make-win-background'" - bg the returns value of 'tui-utils:make-win-background'"
(with-croatoan-window (inner window) (with-croatoan-window (inner window)
(setf (background inner) bg))) (setf (c:background inner) bg)))
(defgeneric print-text (object text x y &key &allow-other-keys) (defgeneric print-text (object text x y &key &allow-other-keys)
(:documentation "Print text on object (usually a window)")) (:documentation "Print text on object (usually a window)"))
@ -287,9 +287,9 @@ height, position and so on)"
:bgcolor bgcolor) :bgcolor bgcolor)
x y)) x y))
(defmethod print-text ((object wrapper-window) (text complex-string) x y (defmethod print-text ((object wrapper-window) (text c:complex-string) x y
&key &allow-other-keys) &key &allow-other-keys)
(add (croatoan-window object) text :x x :y y)) (c:add (croatoan-window object) text :x x :y y))
(defmethod print-text ((object wrapper-window) (text character) x y (defmethod print-text ((object wrapper-window) (text character) x y
&key &key
@ -297,22 +297,22 @@ height, position and so on)"
(fgcolor nil) (fgcolor nil)
(bgcolor nil) (bgcolor nil)
&allow-other-keys) &allow-other-keys)
(add (croatoan-window object) (c:add (croatoan-window object)
(string text) (string text)
:x x :x x
:y y :y y
:attributes attributes :attributes attributes
:bgcolor bgcolor :bgcolor bgcolor
:fgcolor fgcolor)) :fgcolor fgcolor))
(defmethod print-text ((object wrapper-window) (text list) x y &key &allow-other-keys) (defmethod print-text ((object wrapper-window) (text list) x y &key &allow-other-keys)
(loop (loop
for block in text for block in text
with current-x = x do with current-x = x do
(add (croatoan-window object) (c:add (croatoan-window object)
block block
:x current-x :x current-x
:y y) :y y)
(incf current-x (text-length block))) (incf current-x (text-length block)))
object) object)
@ -375,9 +375,9 @@ height, position and so on)"
(do-stack-element (window *window-stack*) (do-stack-element (window *window-stack*)
(when (win-visible-p window) (when (win-visible-p window)
(win-touch window) (win-touch window)
(mark-for-refresh (croatoan-window window))) (c:mark-for-refresh (croatoan-window window)))
(calculate window dt)) (calculate window dt))
(refresh-marked)) (c:refresh-marked))
(defun draw-all (&key (clear t)) (defun draw-all (&key (clear t))
(let ((to-be-drawn (remove-intersecting-window))) (let ((to-be-drawn (remove-intersecting-window)))
@ -411,28 +411,27 @@ height, position and so on)"
(refresh-config *gemini-toc-window*)))) (refresh-config *gemini-toc-window*))))
(defun cursor-show () (defun cursor-show ()
(setf (cursor-visible-p (croatoan-window *main-window*)) t)) (setf (c:cursor-visible-p (croatoan-window *main-window*)) t))
(defun cursor-hide () (defun cursor-hide ()
(setf (cursor-visible-p (croatoan-window *main-window*)) nil)) (setf (c:cursor-visible-p (croatoan-window *main-window*)) nil))
(defun refresh-config-colors (window conf-key) (defun refresh-config-colors (window conf-key)
(let ((bg (swconf:win-bg conf-key)) (let ((bg (swconf:win-bg conf-key))
(fg (swconf:win-fg conf-key))) (fg (swconf:win-fg conf-key)))
(with-croatoan-window (croatoan-window window) (with-croatoan-window (croatoan-window window)
(setf (background croatoan-window) (setf (c:background croatoan-window) (tui:make-win-background bg))
(tui:make-win-background bg)) (setf (c:bgcolor croatoan-window) bg)
(setf (bgcolor croatoan-window) bg) (setf (c:fgcolor croatoan-window) fg))
(setf (fgcolor croatoan-window) fg))
window)) window))
(defun refresh-config-sizes (window conf-key) (defun refresh-config-sizes (window conf-key)
(let ((raw-height (swconf:win-height conf-key)) (let ((raw-height (swconf:win-height conf-key))
(raw-width (swconf:win-width conf-key))) (raw-width (swconf:win-width conf-key)))
(with-croatoan-window (croatoan-window window) (with-croatoan-window (croatoan-window window)
(resize croatoan-window (c:resize croatoan-window
(main-window:parse-subwin-h raw-height) (main-window:parse-subwin-h raw-height)
(main-window:parse-subwin-w raw-width)) (main-window:parse-subwin-w raw-width))
window))) window)))
(defun add-flush-left-text (window message y-start (defun add-flush-left-text (window message y-start
@ -499,10 +498,9 @@ list of strings (the text lines)."
(/ win-w 2)))) (/ win-w 2))))
(y (truncate (- (/ (win-height screen) 2) (y (truncate (- (/ (win-height screen) 2)
(/ win-h 2))))) (/ win-h 2)))))
(setf (background low-level-window) (setf (c:background low-level-window) (tui:make-win-background bg))
(tui:make-win-background bg)) (setf (c:bgcolor low-level-window) bg)
(setf (bgcolor low-level-window) bg) (setf (c:fgcolor low-level-window) fg)
(setf (fgcolor low-level-window) fg)
(win-resize window win-w win-h) (win-resize window win-w win-h)
(win-move window x y) (win-move window x y)
(win-box window) (win-box window)
@ -512,7 +510,7 @@ list of strings (the text lines)."
for y from 1 do for y from 1 do
(print-text window line 1 y)) (print-text window line 1 y))
(win-refresh window) (win-refresh window)
(get-char low-level-window) (c:get-char low-level-window)
(win-close window))) (win-close window)))
(defun make-dialog (parent title message color-pair (defun make-dialog (parent title message color-pair
@ -638,14 +636,14 @@ insetred by the user"
(win-set-background window (make-win-background bg :color-fg fg)) (win-set-background window (make-win-background bg :color-fg fg))
(add-flush-left-text window message 2 :has-border-p t) (add-flush-left-text window message 2 :has-border-p t)
(win-refresh window) (win-refresh window)
(setf (callback button-accept) 'accept) (setf (c:callback button-accept) 'accept)
(setf (callback button-cancel) 'cancel) (setf (c:callback button-cancel) 'cancel)
(setf (cursor-visible-p screen-low-level) t) (setf (c:cursor-visible-p screen-low-level) t)
(let ((res (croatoan:edit low-level-window))) (let ((res (croatoan:edit low-level-window)))
(setf (cursor-visible-p screen-low-level) nil) (setf (c:cursor-visible-p screen-low-level) nil)
(win-close window) (win-close window)
(and res (and res
(value field)))))) (c:value field))))))
(defun make-checklist-dialog (screen parent title options) (defun make-checklist-dialog (screen parent title options)
(with-croatoan-window (screen-low-level screen) (with-croatoan-window (screen-low-level screen)
@ -686,15 +684,15 @@ insetred by the user"
:croatoan-window low-level-window))) :croatoan-window low-level-window)))
(win-set-background window (make-win-background bg :color-fg fg)) (win-set-background window (make-win-background bg :color-fg fg))
(win-refresh window) (win-refresh window)
(setf (callback button-accept) 'accept) (setf (c:callback button-accept) 'accept)
(setf (callback button-cancel) 'cancel) (setf (c:callback button-cancel) 'cancel)
(setf (cursor-visible-p screen-low-level) t) (setf (c:cursor-visible-p screen-low-level) t)
(let ((results (select low-level-window))) (let ((results (c:select low-level-window)))
(win-close window) (win-close window)
(win-clear screen) (win-clear screen)
(draw-all) (draw-all)
(and results (and results
(mapcar #'value results)))))) (mapcar #'c:value results))))))
(defclass focus-marked-window () (defclass focus-marked-window ()
((in-focus ((in-focus
@ -811,5 +809,5 @@ insetred by the user"
(width (- (win-width *main-window*) (width (- (win-width *main-window*)
(win-width reference-window))) (win-width reference-window)))
(x (win-width reference-window))) (x (win-width reference-window)))
(resize croatoan-window (win-height window) width) (c:resize croatoan-window (win-height window) width)
(win-move window x (win-y window)))))) (win-move window x (win-y window))))))