15,7 → 15,6 |
min_height = 8 |
max_height = 255 |
|
include '../../../KOSfuncs.inc' |
include 'lang.inc' |
include 'font.inc' |
include 'sort.inc' |
31,9 → 30,6 |
cursor_big_size = font_height |
|
start: |
mov eax,SF_SET_EVENTS_MASK |
mov ebx,(11b shl 30) or 100111b |
int 0x40 |
mov edi, identical_table |
mov ecx, 0x100 |
xor eax, eax |
112,16 → 108,16 |
stosd |
stosd |
stosb |
push SF_SYS_MISC |
push 68 |
pop eax |
push SSF_HEAP_INIT |
push 11 |
pop ebx |
int 0x40 |
call init_console |
call draw_window |
push SF_KEYBOARD |
push 66 |
pop eax |
push SSF_SET_INPUT_MODE |
push 1 |
pop ebx |
mov ecx, ebx |
int 40h ; set keyboard mode to scancodes |
396,8 → 392,6 |
jz redraw |
dec eax |
jz key |
sub eax,4 |
jz mouse |
; button - we have only one button, close |
exit: |
; close all screens |
498,7 → 492,7 |
mov ebx, [idle_interval] |
cmp ebx, -1 |
jz .infinite |
push SF_WAIT_EVENT_TIMEOUT |
push 23 |
pop eax |
int 40h |
pop ebx |
513,7 → 507,7 |
jmp get_event |
.infinite: |
pop ebx |
push SF_WAIT_EVENT |
push 10 |
pop eax |
int 40h |
.ret: |
521,8 → 515,8 |
|
redraw: |
; query kbd state from OS |
mov al, SF_KEYBOARD |
push SSF_GET_CONTROL_KEYS |
mov al, 66 |
push 3 |
pop ebx |
int 0x40 |
and eax, 0x3F |
531,7 → 525,7 |
jz @f |
call draw_keybar |
@@: |
mov al, SF_THREAD_INFO |
mov al, 9 |
mov ebx, procinfo |
or ecx, -1 |
int 40h |
541,8 → 535,8 |
sub eax, [skinh] |
cmp eax, 5 |
ja @f |
mov al, SF_REDRAW |
push SSF_BEGIN_DRAW |
mov al, 12 |
push 1 |
pop ebx |
int 0x40 |
xor eax, eax |
549,7 → 543,7 |
; ebx, ecx, edi are ignored by function 0 after first redraw |
mov edx, 0x53000000 |
int 0x40 |
mov al, SF_REDRAW |
mov al, 12 |
inc ebx |
int 0x40 |
jmp event |
614,7 → 608,7 |
test byte [ebx+70], 1 |
jnz @f |
.resize: |
push SF_CHANGE_WINDOW |
push 67 |
pop eax |
or ebx, -1 |
or ecx, -1 |
652,9 → 646,9 |
or [saved_height], -1 |
jmp redraw.resize |
@@: |
push SF_STYLE_SETTINGS |
push 48 |
pop eax |
push SSF_GET_SCREEN_AREA |
push 5 |
pop ebx |
int 0x40 |
push eax |
687,12 → 681,12 |
imul esi, font_height |
add esi, [skinh] |
add esi, 4 |
push SF_CHANGE_WINDOW |
push 67 |
pop eax |
int 0x40 |
jmp redraw.resize_draw |
key: |
mov al, SF_GET_KEY |
mov al, 2 |
int 40h |
test al, al |
jnz event |
779,42 → 773,6 |
and [ctrlstate], not 0x20 |
jmp .keybar |
|
align 16 |
mouse: |
mov eax,SF_MOUSE_GET |
mov ebx,SSF_BUTTON_EXT |
int 0x40 |
bt eax,8 |
jnc event |
|
mov eax,SF_MOUSE_GET |
mov ebx,SSF_WINDOW_POSITION |
int 0x40 |
cmp ax, word[skinh] |
jl event |
shr eax,16 |
mov ebx, [cur_width] |
imul ebx, font_width/2 |
add ebx, 5 ;window border |
cmp eax,ebx |
jg @f |
cmp [active_panel], panel1_data |
je event |
jmp .tab |
@@: |
cmp [active_panel], panel2_data |
je event |
.tab: |
xor [active_panel], panel1_data xor panel2_data |
call draw_cmdbar |
mov ebp, [active_panel] |
xor ebp, panel1_data xor panel2_data |
call draw_panel |
mov ebp, [active_panel] |
call draw_panel |
jmp event |
|
align 16 |
process_ctrl_keys: |
cmp byte [esi], 0 |
jz .done |
1854,7 → 1812,7 |
cmp esi, 256 |
ja .bigcmdline |
.cmdlinelenok: |
push SF_FILE |
push 70 |
pop eax |
int 40h |
xor esi, esi |
1880,7 → 1838,7 |
@@: |
test edx, edx |
jz @f |
push SF_SLEEP |
push 5 |
pop eax |
push 20 |
pop ebx |
2115,7 → 2073,7 |
xor ecx, ecx |
.drive_loop_e: |
mov byte [tmpname+1], 0 |
push SF_FILE |
push 70 |
pop eax |
int 40h |
mov ebx, dirinfo |
2131,7 → 2089,7 |
push [ebx+dirinfo.first-dirinfo] |
and [ebx+dirinfo.first-dirinfo], 0 |
.drive_loop_i: |
push SF_FILE |
push 70 |
pop eax |
int 40h |
mov ebx, dirinfo |
2547,7 → 2505,7 |
mov dl, [edi] |
mov byte [edi], 0 |
push eax |
push SF_FILE |
push 70 |
pop eax |
mov ebx, attrinfo |
int 0x40 |
2607,7 → 2565,7 |
cmp eax, 2 |
jbe .docopy |
mov [attrinfo.attr], 0 ; assume zero attributes if error |
push SF_FILE |
push 70 |
pop eax |
mov ebx, attrinfo |
int 0x40 |
3693,13 → 3651,13 |
ret |
|
draw_window: |
push SF_REDRAW |
push 12 |
pop eax |
push SSF_BEGIN_DRAW |
push 1 |
pop ebx |
int 40h |
mov al, SF_STYLE_SETTINGS |
mov bl, SSF_GET_SKIN_HEIGHT |
mov al, 48 |
mov bl, 4 |
int 40h |
mov [skinh], eax |
mov ebx, [cur_width] |
3712,7 → 3670,7 |
mov edx, 0x53000000 |
mov edi, header |
int 40h |
mov al, SF_DRAW_RECT |
mov al, 13 |
xor edx, edx |
cmp [fill_width], 0 |
jz @f |
3742,7 → 3700,7 |
@@: |
; xor ecx, ecx |
; call draw_image |
mov al, SF_PUT_IMAGE_EXT |
mov al, 65 |
mov ebx, [MemForImage] |
test ebx, ebx |
jz @f |
3757,14 → 3715,14 |
xor ebp, ebp |
int 0x40 |
@@: |
mov al, SF_REDRAW |
push SSF_END_DRAW |
mov al, 12 |
push 2 |
pop ebx |
int 40h |
ret |
|
draw_image.nomem: |
mov al, SF_DRAW_RECT |
mov al, 13 |
xor edx, edx |
mov ebx, [cur_width] |
imul ebx, font_width |
3773,7 → 3731,7 |
mov cx, word [cur_height] |
imul cx, font_height |
int 40h |
mov al, SF_DRAW_TEXT |
mov al, 4 |
mov ebx, 32*65536+32 |
mov ecx, 0xFFFFFF |
mov edx, nomem_draw |
3972,7 → 3930,7 |
shr ebp, 16 |
sub esi, ebp |
mov ebp, esi |
push SF_PUT_IMAGE_EXT |
push 65 |
pop eax |
mov edi, console_colors |
push 8 |
4130,7 → 4088,6 |
rep stosw |
ret |
|
align 16 |
draw_border: |
push edi |
mov al, 0xC9 |
4260,9 → 4217,6 |
mov byte [edi], 0 |
ret 10h |
|
;input: |
; ebp - pointer to panel1 or panel2 |
align 16 |
draw_panel: |
mov eax, [ebp + panel1_left - panel1_data] |
mov edx, [ebp + panel1_top - panel1_data] |
5314,7 → 5268,7 |
mov ebx, [ebx+4] |
jmp .read |
.native: |
push SF_FILE |
push 70 |
pop eax |
mov ebx, dirinfo |
int 40h |