Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commonization of graphical text buffer #1054

Merged
merged 39 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bcdc61b
split files/packages
cxxxr Aug 29, 2023
9ca21df
fix rendering process
cxxxr Sep 22, 2023
8de31e3
extract function
cxxxr Sep 22, 2023
a7a4bff
tweak method specializers
cxxxr Sep 22, 2023
4d9b30a
add v2 rendering flag
cxxxr Sep 22, 2023
c8235a1
separate folder, icon and emoji objects from text objects
cxxxr Sep 23, 2023
dfdec60
Support for display of control characters
cxxxr Sep 28, 2023
718a328
fix
cxxxr Sep 28, 2023
3e66eba
fix
cxxxr Sep 29, 2023
cad3e77
add assertion
cxxxr Sep 29, 2023
1457e7d
log:info -> log:error
cxxxr Sep 29, 2023
ff401f3
export attribute-foreground-color and attribute-background-color
cxxxr Sep 30, 2023
da78e5d
remove unused functions
cxxxr Sep 30, 2023
88dafde
export attribute-equal
cxxxr Sep 30, 2023
01cd4ec
change %render-line to lem-if:render-line
cxxxr Oct 1, 2023
40f4fd3
fix rendering cache
cxxxr Oct 1, 2023
89e8f84
refactor cursor drawing
cxxxr Oct 2, 2023
2da9ac3
explode
cxxxr Oct 2, 2023
4125298
export compute-left-display-area-content
cxxxr Oct 2, 2023
4694dd9
remove unused logical-line-equal
cxxxr Oct 3, 2023
d4e07d9
inline function
cxxxr Oct 3, 2023
f77f853
change to flet
cxxxr Oct 3, 2023
b4dab59
change file structure
cxxxr Oct 4, 2023
644427f
remove unused functions and slots
cxxxr Oct 4, 2023
38fec5c
set left-width
cxxxr Oct 4, 2023
d3403a2
remove unused slots
cxxxr Oct 4, 2023
6a1be5b
move modeline-elements in screen to window
cxxxr Oct 4, 2023
c92b575
move last-print-cursor in screen to window
cxxxr Oct 4, 2023
40c12f7
merge screen into window
cxxxr Oct 4, 2023
433ed79
export symbols
cxxxr Oct 4, 2023
daf2680
fix
cxxxr Oct 4, 2023
b96f9a2
rename overlay classes
cxxxr Oct 4, 2023
b980eab
rename object-equal to drawing-object-equal
cxxxr Oct 4, 2023
a2e7de6
remove unused class
cxxxr Oct 4, 2023
741d679
merge package
cxxxr Oct 4, 2023
8fb9a73
change redraw-display parameter to keyword
cxxxr Oct 6, 2023
0745a92
Change attempt to split string on wrap to binary search
cxxxr Oct 9, 2023
a0fcf84
fix argument
cxxxr Oct 9, 2023
675bf35
Forgive me for comment out a test that is failing
cxxxr Oct 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge screen into window
  • Loading branch information
cxxxr committed Oct 4, 2023
commit 40c12f7953ef6bae01ffce31e57d77e888c96289
3 changes: 1 addition & 2 deletions frontends/ncurses/text-buffer-impl.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
(let ((string (lem-core/display/physical-line::text-object-string object))
(attribute (lem-core/display/physical-line::text-object-attribute object)))
(when (and attribute (lem-core/display/physical-line::cursor-attribute-p attribute))
(let ((screen (lem:window-screen window)))
(lem-core::set-last-print-cursor window x y)))
(lem-core::set-last-print-cursor window x y))
(lem-if:print (lem-core:implementation)
(lem-core::window-view window)
x
Expand Down
1 change: 0 additions & 1 deletion lem.asd
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
(:file "clipboard")
(:file "killring")
(:file "file")
(:file "screen")
(:file "frame")
(:file "echo")
(:file "prompt")
Expand Down
13 changes: 6 additions & 7 deletions src/display/physical-line.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@

(defun redraw-modeline (window force)
(when (lem-core:window-use-modeline-p window)
(let* ((view (lem-core:screen-view (lem-core:window-screen window)))
(let* ((view (lem-core:window-view window))
(default-attribute (if (eq window (lem-core:current-window))
'lem-core:modeline
'lem-core:modeline-inactive))
Expand Down Expand Up @@ -481,24 +481,23 @@
(defmethod lem-core:redraw-buffer :around (implementation buffer window force)
(with-display-error ()
(lem-if:redraw-view-before (lem-core:implementation)
(lem-core:screen-view (lem-core:window-screen window)))
(lem-core:window-view window))
(let ((lem-if:*background-color-of-drawing-window*
(get-background-color-of-window window)))
(call-next-method))
(when (lem-core:window-use-modeline-p window)
(redraw-modeline window
(or (lem-core::screen-modified-p (lem-core:window-screen window))
(or (lem-core::window-need-to-redraw-p window)
force)))
(lem-if:redraw-view-after (lem-core:implementation)
(lem-core:screen-view (lem-core:window-screen window)))))
(lem-core:window-view window))))

(defun clear-cache-if-screen-modified (window force)
(when (or force
(lem-core::screen-modified-p (lem-core:window-screen window)))
(when (or force (lem-core::window-need-to-redraw-p window))
(setf (drawing-cache window) '())))

(defmethod lem-core:redraw-buffer (implementation (buffer lem-core:text-buffer) window force)
(assert (eq buffer (lem-core:window-buffer window)))
(clear-cache-if-screen-modified window force)
(redraw-lines window)
(lem-core::update-screen-cache (lem-core:window-screen window) buffer))
(lem-core::finish-redraw window))
30 changes: 0 additions & 30 deletions src/screen.lisp

This file was deleted.

43 changes: 26 additions & 17 deletions src/window.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
:reader window-buffer
:writer set-window-buffer
:type buffer)
(screen
:reader window-screen
:writer set-window-screen)
(view-point
:reader window-view-point
:writer set-window-view-point
Expand Down Expand Up @@ -94,12 +91,24 @@
(last-print-cursor-y
:initform 0
:accessor window-last-print-cursor-y)
(need-to-redraw
:initform nil
:accessor window-need-to-redraw-p)
(view
:initarg :view
:accessor window-view)
(parameters
:initform nil
:accessor window-parameters)))

(defun need-to-redraw (window)
(setf (window-need-to-redraw-p window) t))

(defun finish-redraw (window)
(setf (window-need-to-redraw-p window) nil))

(defmethod set-window-buffer :before (buffer (window window))
(screen-modify (window-screen window)))
(need-to-redraw window))

(defun window-height-without-modeline (window)
(- (window-height window)
Expand All @@ -116,8 +125,7 @@

(defmethod initialize-instance :after ((window window) &rest initargs)
(declare (ignore initargs))
(set-window-screen (make-screen (make-view-from-window window))
window)
(setf (slot-value window 'view) (make-view-from-window window))
(set-window-view-point (buffer-start
(copy-point (buffer-point (window-buffer window))
:right-inserting))
Expand All @@ -139,14 +147,12 @@

(defun clear-screens-of-window-list ()
(flet ((clear-screen (window)
(screen-clear (window-screen window))))
(need-to-redraw window)
(lem-if:clear (implementation) (window-view window))))
(mapc #'clear-screen (uiop:ensure-list (frame-leftside-window (current-frame))))
(mapc #'clear-screen (window-list))
(mapc #'clear-screen (frame-floating-windows (current-frame)))))

(defun window-view (window)
(screen-view (window-screen window)))

(defmethod set-last-print-cursor ((window window) x y)
(setf (window-last-print-cursor-x window) x
(window-last-print-cursor-y window) y))
Expand Down Expand Up @@ -228,7 +234,7 @@
(defun %free-window (window)
(delete-point (window-view-point window))
(delete-point (%window-point window))
(screen-delete (window-screen window)))
(lem-if:delete-view (implementation) (window-view window)))

(defun delete-window (window)
(notify-frame-redisplay-required (current-frame))
Expand Down Expand Up @@ -537,7 +543,7 @@ next line because it is at the end of width."
(move-to-previous-virtual-line (window-view-point window) n window))

(defun window-scroll (window n)
(screen-modify (window-screen window))
(need-to-redraw window)
(prog1 (if *use-new-vertical-move-function*
(if (plusp n)
(window-scroll-down-n window n)
Expand Down Expand Up @@ -714,7 +720,8 @@ You can pass in the optional argument WINDOW-LIST to replace the default
(notify-frame-redisplay-required (current-frame))
(when (floating-window-p window)
(notify-floating-window-modified (current-frame)))
(screen-set-pos (window-screen window) x y)
(need-to-redraw window)
(lem-if:set-view-pos (implementation) (window-view window) x y)
(set-window-x x window)
(set-window-y y window))

Expand All @@ -733,10 +740,12 @@ You can pass in the optional argument WINDOW-LIST to replace the default
(notify-floating-window-modified (current-frame)))
(set-window-width width window)
(set-window-height height window)
(screen-set-size (window-screen window)
width
(- height
(if (window-use-modeline-p window) 1 0))))
(need-to-redraw window)
(lem-if:set-view-size (implementation)
(window-view window)
width
(- height
(if (window-use-modeline-p window) 1 0))))

(defun window-move (window dx dy)
(window-set-pos window
Expand Down