Name window IDs in shell

This commit is contained in:
Juhani Krekelä 2023-03-27 11:23:59 +03:00
parent 28423d0de3
commit 71444f5ce7
1 changed files with 20 additions and 18 deletions

View File

@ -15,6 +15,9 @@ struc window
.size:
endstruc
WINDOW_ID_ICON equ 0
WINDOW_ID_FILE_WINDOW equ 1
WINDOW_MOVE equ 1
WINDOW_RESIZE equ 2
@ -58,23 +61,22 @@ initialize:
mov ax, cs
add ax, 0x000
xchg [es:GLOBAL_WINDOW_CHAIN_HEAD], ax
mov [windows + 0*window.size + window.next], ax
mov word [windows + 0*window.size + window.width], 5
mov word [windows + 0*window.size + window.height], 3
mov word [windows + 0*window.size + window.x], 1
mov word [windows + 0*window.size + window.y], 1
mov word [windows + 0*window.size + window.data], disk_icon
mov byte [windows + 0*window.size + window.icon], 1
mov byte [windows + 0*window.size + window.mouse_released_inside], 0
mov [windows + WINDOW_ID_ICON*window.size + window.next], ax
mov word [windows + WINDOW_ID_ICON*window.size + window.width], 5
mov word [windows + WINDOW_ID_ICON*window.size + window.height], 3
mov word [windows + WINDOW_ID_ICON*window.size + window.x], 1
mov word [windows + WINDOW_ID_ICON*window.size + window.y], 1
mov word [windows + WINDOW_ID_ICON*window.size + window.data], disk_icon
mov byte [windows + WINDOW_ID_ICON*window.size + window.icon], 1
; Initialize file window but don't show it
mov word [windows + 1*window.size + window.width], 40
mov word [windows + 1*window.size + window.height], 16
mov word [windows + 1*window.size + window.x], 10
mov word [windows + 1*window.size + window.y], 4
mov word [windows + 1*window.size + window.data], file_window
mov byte [windows + 1*window.size + window.icon], 0
mov byte [windows + 1*window.size + window.mouse_released_inside], 0
mov word [windows + WINDOW_ID_FILE_WINDOW*window.size + window.width], 40
mov word [windows + WINDOW_ID_FILE_WINDOW*window.size + window.height], 16
mov word [windows + WINDOW_ID_FILE_WINDOW*window.size + window.x], 10
mov word [windows + WINDOW_ID_FILE_WINDOW*window.size + window.y], 4
mov word [windows + WINDOW_ID_FILE_WINDOW*window.size + window.data], file_window
mov byte [windows + WINDOW_ID_FILE_WINDOW*window.size + window.icon], 0
mov byte [windows + WINDOW_ID_FILE_WINDOW*window.size + window.mouse_released_inside], 0
call request_redraw
@ -141,7 +143,7 @@ paint:
mov bx, [si + window.next]
call forward_event
cmp si, windows + 1*window.size
cmp si, windows + WINDOW_ID_FILE_WINDOW*window.size
jne .not_file_window
.file_window:
; See if the dirents have changed since we rendered the
@ -514,10 +516,10 @@ show_file_window:
mov ax, cs
add ax, 0x001
xchg [es:GLOBAL_WINDOW_CHAIN_HEAD], ax
mov [windows + 1*window.size + window.next], ax
mov si, windows + WINDOW_ID_FILE_WINDOW*window.size
mov [si + window.next], ax
; Populate file window contents
mov si, windows + 1*window.size
call render_file_window
pop ax