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) \
--eval "(asdf:load-system '$(PACKAGE))" \
--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
$(CONF_PATH_FILE):
grep "^;" $(CONF_PATH_FILE_IN) > $(CONF_PATH_FILE)

View File

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

View File

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

View File

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

View File

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

View File

@ -505,10 +505,8 @@ will fire the `callback' function (with the selected field from `all-fields'
(draw high-level-window)
(win-box high-level-window)
(print-text high-level-window title 2 0)))
(setf (background low-level-window)
(tui:make-win-background bg))
(setf (fgcolor low-level-window)
fg)
(setf (c:background low-level-window) (tui:make-win-background bg))
(setf (c:fgcolor low-level-window) fg)
(win-resize high-level-window window-width window-height)
(win-move high-level-window window-x window-y)
(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)
(draw)
(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")
do
(cond

View File

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

View File

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

View File

@ -77,10 +77,9 @@
(defun force-error-colors (window)
(with-croatoan-window (croatoan-window window)
(setf (background croatoan-window)
(tui:make-win-background :red))
(setf (bgcolor croatoan-window) :red)
(setf (fgcolor croatoan-window) :yellow))
(setf (c:background croatoan-window) (tui:make-win-background :red))
(setf (c:bgcolor croatoan-window) :red)
(setf (c:fgcolor croatoan-window) :yellow))
window)
(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)
(/ win-h 2)))
0)))
(setf (background croatoan-window)
(tui:make-win-background bg))
(setf (bgcolor croatoan-window) bg)
(setf (fgcolor croatoan-window) fg)
(setf (c:background croatoan-window) (tui:make-win-background bg))
(setf (c:bgcolor croatoan-window) bg)
(setf (c:fgcolor croatoan-window) fg)
(setf selected-line-fg selected-fg)
(setf selected-line-bg selected-bg)
(setf unselected-line-fg unselected-fg)

View File

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

View File

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

View File

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

View File

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

View File

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