2013-10-31 21:04:03 +01:00
|
|
|
n_main:
|
2021-12-30 21:54:18 +01:00
|
|
|
mov dword[nwin.w], 67
|
|
|
|
mov dword[nwin.h], 16
|
2013-11-03 17:32:45 +01:00
|
|
|
|
|
|
|
mov dword[nwin.bgwidth], 66
|
|
|
|
mov dword[nwin.bgheight], 1
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
cmp dword[dock_items.location], 1
|
2021-12-30 21:54:18 +01:00
|
|
|
je .top
|
2013-10-31 21:04:03 +01:00
|
|
|
cmp dword[dock_items.location], 4
|
2021-12-30 21:54:18 +01:00
|
|
|
je .right
|
2013-10-31 21:04:03 +01:00
|
|
|
cmp dword[dock_items.location], 3
|
2021-12-30 21:54:18 +01:00
|
|
|
je .bottom
|
2013-10-31 21:04:03 +01:00
|
|
|
jmp .left
|
2013-11-03 17:32:45 +01:00
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
.top:
|
2021-12-30 21:54:18 +01:00
|
|
|
mov eax, [win.h_opn]
|
2013-10-31 21:04:03 +01:00
|
|
|
mov [nwin.y], eax
|
2013-11-03 17:32:45 +01:00
|
|
|
|
|
|
|
mov dword[nwin.bgx], 1
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
jmp @f
|
2013-11-03 17:32:45 +01:00
|
|
|
|
|
|
|
.left:
|
2021-12-30 21:54:18 +01:00
|
|
|
mov eax, [win.w_opn]
|
2013-10-31 21:04:03 +01:00
|
|
|
mov [nwin.x], eax
|
2013-11-03 17:32:45 +01:00
|
|
|
|
|
|
|
mov dword[nwin.bgy], 1
|
|
|
|
mov dword[nwin.bgwidth], 1
|
2021-12-30 21:54:18 +01:00
|
|
|
mov eax, [nwin.h]
|
2013-11-03 17:32:45 +01:00
|
|
|
dec eax
|
|
|
|
mov dword[nwin.bgheight], eax
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
jmp @f
|
2013-11-03 17:32:45 +01:00
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
.bottom:
|
|
|
|
mov eax, [win.y_opn]
|
2013-11-09 19:13:05 +01:00
|
|
|
sub eax, 17
|
2013-10-31 21:04:03 +01:00
|
|
|
mov [nwin.y], eax
|
2013-11-03 17:32:45 +01:00
|
|
|
|
|
|
|
mov dword[nwin.bgx], 1
|
2021-12-30 21:54:18 +01:00
|
|
|
mov eax, [nwin.h]
|
2013-11-09 19:13:05 +01:00
|
|
|
|
2021-12-30 21:54:18 +01:00
|
|
|
mov eax, [nwin.h]
|
2013-11-03 17:32:45 +01:00
|
|
|
mov [nwin.bgy], eax
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
jmp @f
|
2013-11-03 17:32:45 +01:00
|
|
|
|
|
|
|
.right:
|
|
|
|
mov eax, [win.x_opn]
|
2013-11-09 19:13:05 +01:00
|
|
|
sub eax, 68
|
2013-10-31 21:04:03 +01:00
|
|
|
mov [nwin.x], eax
|
2013-11-03 17:32:45 +01:00
|
|
|
|
2021-12-30 21:54:18 +01:00
|
|
|
mov eax, [nwin.w]
|
2013-11-03 17:32:45 +01:00
|
|
|
mov [nwin.bgx], eax
|
|
|
|
mov dword[nwin.bgy], 1
|
|
|
|
mov dword[nwin.bgwidth], 1
|
2021-12-30 21:54:18 +01:00
|
|
|
mov eax, [nwin.h]
|
2013-11-03 17:32:45 +01:00
|
|
|
dec eax
|
|
|
|
mov dword[nwin.bgheight], eax
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
@@:
|
|
|
|
|
|
|
|
mcall 40, 1b
|
|
|
|
|
|
|
|
mcall 9, win.procinfo, -1
|
|
|
|
mov ecx, [win.procinfo + 30]
|
|
|
|
mcall 18, 21
|
|
|
|
and eax, 0xFFFF
|
|
|
|
mov [nwin.sid], eax
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
n_main_loop:
|
|
|
|
mcall 23, 1
|
|
|
|
|
|
|
|
cmp eax, EV_IDLE
|
2021-12-30 21:54:18 +01:00
|
|
|
je n_event_idle
|
2013-10-31 21:04:03 +01:00
|
|
|
cmp eax, EV_REDRAW
|
2021-12-30 21:54:18 +01:00
|
|
|
je n_event_redraw
|
2013-10-31 21:04:03 +01:00
|
|
|
|
|
|
|
jmp n_main_loop
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
n_event_idle:
|
|
|
|
cmp byte[nwin.close], 1
|
|
|
|
jne @f
|
|
|
|
|
2021-12-30 21:54:18 +01:00
|
|
|
mcall 13, <0, [win.w]>, <[win.h], 1>, [sc.work_dark]
|
2013-11-08 19:38:06 +01:00
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
mov byte[nwin.close], 0
|
|
|
|
mcall -1
|
|
|
|
|
|
|
|
@@:
|
2021-12-30 21:54:18 +01:00
|
|
|
cmp byte[win.btn_index], 100
|
2013-10-31 21:04:03 +01:00
|
|
|
jne @f
|
|
|
|
|
|
|
|
mcall 67, 0, 0, 0, 0
|
|
|
|
jmp .end
|
|
|
|
|
|
|
|
@@:
|
2021-12-30 21:54:18 +01:00
|
|
|
cmp byte[nwin.swap_shape], 1
|
2013-10-31 21:04:03 +01:00
|
|
|
jne .end
|
|
|
|
|
2021-12-30 21:54:18 +01:00
|
|
|
mov byte[nwin.swap_shape], 0
|
|
|
|
mcall 67, [nwin.x], [nwin.y], [nwin.w], [nwin.h]
|
2013-10-31 21:04:03 +01:00
|
|
|
|
|
|
|
.end:
|
|
|
|
jmp n_main_loop
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
n_event_redraw:
|
|
|
|
mcall 12, 1
|
|
|
|
|
2021-12-30 21:54:18 +01:00
|
|
|
mcall 0, <[nwin.x], [nwin.w]>, <[nwin.y], [nwin.h]>, [sc.work], [sc.work], [sc.work_dark]
|
2013-10-31 21:04:03 +01:00
|
|
|
|
2021-12-30 21:54:18 +01:00
|
|
|
mcall 13, <[nwin.bgx], [nwin.bgwidth]>, <[nwin.bgy], [nwin.bgheight]>, [sc.work]
|
2013-10-31 21:04:03 +01:00
|
|
|
|
2021-12-30 21:54:18 +01:00
|
|
|
mov edx, [win.btn_index]
|
2013-10-31 21:04:03 +01:00
|
|
|
imul edx, 16
|
|
|
|
add edx, dock_items.name
|
|
|
|
|
|
|
|
mov eax, 0
|
|
|
|
@@:
|
|
|
|
inc eax
|
|
|
|
cmp byte[edx+eax], 0
|
|
|
|
jne @b
|
|
|
|
|
|
|
|
imul eax, 3
|
|
|
|
mov ebx, 34
|
|
|
|
sub ebx, eax
|
2013-11-03 17:32:45 +01:00
|
|
|
add ebx, 1
|
2013-10-31 21:04:03 +01:00
|
|
|
shl ebx, 16
|
2013-11-03 17:32:45 +01:00
|
|
|
add ebx, 5
|
2013-10-31 21:04:03 +01:00
|
|
|
|
2021-12-30 21:54:18 +01:00
|
|
|
mcall 4, , [sc.work_text]
|
2013-10-31 21:04:03 +01:00
|
|
|
|
|
|
|
mcall 12, 2
|
|
|
|
|
2013-11-08 19:38:06 +01:00
|
|
|
mcall 18, 3, [nwin.sid]
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
jmp n_main_loop
|