1
0
Fork 0

- readded some functions (synctatic sugar to manipulate croatoan's 'complex-*' object).

This commit is contained in:
cage 2020-08-16 11:26:00 +02:00
parent dd1e4f6066
commit f4ef9ff9e8
2 changed files with 31 additions and 2 deletions

View File

@ -1044,8 +1044,8 @@
:find-max-line-width
:ncat-complex-string
:cat-complex-string
:complex-char->char
:cat-tui-string
:tui-char->char
:tui-string->chars-string
:text-ellipsis
:right-pad-text
@ -1062,7 +1062,9 @@
:colorize-line
:colorized-line->tui-string
:standard-error-notify-life
:with-notify-errors))
:with-notify-errors
:make-tui-char
:make-tui-string))
(defpackage :command-line
(:use

View File

@ -163,6 +163,9 @@ as argument `complex-string'."
(defalias cat-tui-string #'cat-complex-string)
(defun tui-char->char (complex-char)
(simple-char complex-char))
(defun tui-string->chars-string (tui-string)
"Convert a `tui-string' to a `string'."
(croatoan:complex-string->chars-string tui-string))
@ -381,3 +384,27 @@ latter has a length equals to `total-size'"))
(ui:notify (format nil (_ "Error: ~a") e)
:life (* (swconf:config-notification-life) 5)
:as-error t))))
(defun make-tui-char (char
&key
(attributes nil)
(fgcolor nil)
(bgcolor nil))
"Make a `complex-char'"
(make-instance 'complex-char
:simple-char char
:attributes attributes
:fgcolor fgcolor
:bgcolor bgcolor))
(defun make-tui-string (string
&key
(attributes nil)
(fgcolor nil)
(bgcolor nil))
"Make a `complex-string' using `string' for text contents"
(make-instance 'complex-string
:string string
:attributes attributes
:fgcolor fgcolor
:bgcolor bgcolor))