2007-03-26 14:18:08 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2009-01-02 09:59:23 +01:00
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;;
|
2007-03-26 14:18:08 +02:00
|
|
|
|
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
|
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
2009-01-02 09:59:23 +01:00
|
|
|
|
;; ;;
|
2007-03-26 14:18:08 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
2007-07-27 15:52:03 +02:00
|
|
|
|
$Revision$
|
|
|
|
|
|
|
|
|
|
|
2006-02-01 07:07:36 +01:00
|
|
|
|
get_titlebar_height: ; edi = window draw_data pointer
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov al,[edi+WDATA.fl_wstyle]
|
|
|
|
|
and al,0x0F
|
|
|
|
|
cmp al,0x03
|
|
|
|
|
jne @f
|
|
|
|
|
mov eax,[_skinh]
|
|
|
|
|
ret
|
|
|
|
|
@@: mov eax,21
|
|
|
|
|
ret
|
2006-02-01 07:07:36 +01:00
|
|
|
|
|
|
|
|
|
get_rolledup_height: ; edi = window draw_data pointer
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov al,[edi+WDATA.fl_wstyle]
|
|
|
|
|
and al,0x0F
|
|
|
|
|
cmp al,0x03
|
2008-12-14 21:31:20 +01:00
|
|
|
|
jb @f
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,[_skinh]
|
|
|
|
|
add eax,3
|
|
|
|
|
ret
|
|
|
|
|
@@: or al,al
|
|
|
|
|
jnz @f
|
|
|
|
|
mov eax,21
|
|
|
|
|
ret
|
|
|
|
|
@@: mov eax,21+2
|
|
|
|
|
ret
|
2006-02-01 07:07:36 +01:00
|
|
|
|
|
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
setwindowdefaults:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
xor eax,eax
|
|
|
|
|
mov ecx,WIN_STACK
|
2005-10-06 19:56:22 +02:00
|
|
|
|
@@:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
inc eax
|
|
|
|
|
add ecx,2
|
|
|
|
|
mov [ecx+0x000],ax ; process no
|
|
|
|
|
mov [ecx+0x400],ax ; positions in stack
|
|
|
|
|
cmp ecx,WIN_POS-2 ; the more high, the more surface
|
|
|
|
|
jnz @b
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; eax = cx
|
|
|
|
|
; ebx = cy
|
|
|
|
|
; ecx = ex
|
|
|
|
|
; edx = ey
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
2006-08-01 16:09:42 +02:00
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> setscreen
|
2005-10-06 19:56:22 +02:00
|
|
|
|
align 4
|
|
|
|
|
calculatescreen:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
|
|
|
|
pushfd
|
|
|
|
|
cli
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push edx ecx ebx eax
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov esi, 1
|
|
|
|
|
call setscreen
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ebp, [TASK_COUNT] ; number of processes
|
|
|
|
|
cmp ebp, 1
|
|
|
|
|
jbe .finish
|
|
|
|
|
align 4
|
2005-10-06 19:56:22 +02:00
|
|
|
|
.new_wnd:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
movzx edi, word [WIN_POS + esi * 2]
|
|
|
|
|
shl edi, 5
|
|
|
|
|
|
|
|
|
|
cmp [CURRENT_TASK+edi+TASKDATA.state], byte 9
|
|
|
|
|
je .not_wnd
|
|
|
|
|
|
|
|
|
|
add edi, window_data
|
|
|
|
|
test [edi+WDATA.fl_wstate], WSTATE_MINIMIZED
|
|
|
|
|
jnz .not_wnd
|
|
|
|
|
|
|
|
|
|
mov eax,[edi+WDATA.box.left]
|
|
|
|
|
cmp eax, [esp+RECT.right]
|
|
|
|
|
ja .out_of_bounds
|
|
|
|
|
mov ebx,[edi+WDATA.box.top]
|
|
|
|
|
cmp ebx, [esp+RECT.bottom]
|
|
|
|
|
ja .out_of_bounds
|
|
|
|
|
mov ecx,[edi+WDATA.box.width]
|
|
|
|
|
add ecx, eax
|
|
|
|
|
cmp ecx, [esp+RECT.left]
|
|
|
|
|
jb .out_of_bounds
|
|
|
|
|
mov edx,[edi+WDATA.box.height]
|
|
|
|
|
add edx, ebx
|
|
|
|
|
cmp edx, [esp+RECT.top]
|
|
|
|
|
jb .out_of_bounds
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2006-08-10 20:18:33 +02:00
|
|
|
|
cmp eax, [esp+RECT.left]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jae @f
|
|
|
|
|
mov eax, [esp+RECT.left]
|
2006-08-01 16:09:42 +02:00
|
|
|
|
@@:
|
2006-08-10 20:18:33 +02:00
|
|
|
|
cmp ebx, [esp+RECT.top]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jae @f
|
|
|
|
|
mov ebx, [esp+RECT.top]
|
2006-08-01 16:09:42 +02:00
|
|
|
|
@@:
|
2006-08-10 20:18:33 +02:00
|
|
|
|
cmp ecx, [esp+RECT.right]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jbe @f
|
|
|
|
|
mov ecx, [esp+RECT.right]
|
2006-08-01 16:09:42 +02:00
|
|
|
|
@@:
|
2006-08-10 20:18:33 +02:00
|
|
|
|
cmp edx, [esp+RECT.bottom]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jbe @f
|
|
|
|
|
mov edx, [esp+RECT.bottom]
|
2006-08-01 16:09:42 +02:00
|
|
|
|
@@:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push esi
|
|
|
|
|
movzx esi, word [WIN_POS + esi * 2]
|
|
|
|
|
call setscreen
|
|
|
|
|
pop esi
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
.not_wnd:
|
2006-08-01 16:09:42 +02:00
|
|
|
|
.out_of_bounds:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
inc esi
|
|
|
|
|
dec ebp
|
|
|
|
|
jnz .new_wnd
|
2005-10-06 19:56:22 +02:00
|
|
|
|
.finish:
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2006-08-10 20:18:33 +02:00
|
|
|
|
pop eax ebx ecx edx
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popfd
|
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual at esp
|
2007-03-12 22:54:24 +01:00
|
|
|
|
ff_x dd ?
|
|
|
|
|
ff_y dd ?
|
2006-08-01 16:09:42 +02:00
|
|
|
|
ff_width dd ?
|
2005-10-06 19:56:22 +02:00
|
|
|
|
ff_xsz dd ?
|
|
|
|
|
ff_ysz dd ?
|
|
|
|
|
ff_scale dd ?
|
|
|
|
|
end virtual
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
setscreen:
|
|
|
|
|
; eax x start
|
|
|
|
|
; ebx y start
|
|
|
|
|
; ecx x end
|
|
|
|
|
; edx y end
|
|
|
|
|
; esi process number
|
|
|
|
|
pushad
|
2006-08-29 14:52:52 +02:00
|
|
|
|
; \begin{diamond}[29.08.2006]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp esi, 1
|
|
|
|
|
jz @f
|
|
|
|
|
mov edi, esi
|
|
|
|
|
shl edi, 5
|
|
|
|
|
cmp [edi+window_data+WDATA.box.width], 0
|
|
|
|
|
jnz @f
|
|
|
|
|
cmp [edi+window_data+WDATA.box.height], 0
|
|
|
|
|
jz .ret
|
2006-08-29 14:52:52 +02:00
|
|
|
|
@@:
|
|
|
|
|
; \end{diamond}[29.08.2006]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov edi, esi ;;;word [esi*2+WIN_POS]
|
|
|
|
|
shl edi, 8
|
|
|
|
|
add edi, SLOT_BASE ; address of random shaped window area
|
|
|
|
|
cmp [edi+APPDATA.wnd_shape], dword 0
|
|
|
|
|
jne .free_form
|
|
|
|
|
|
|
|
|
|
; get x&y size
|
|
|
|
|
sub ecx, eax
|
|
|
|
|
sub edx, ebx
|
|
|
|
|
inc ecx
|
|
|
|
|
inc edx
|
|
|
|
|
|
|
|
|
|
; get WinMap start
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov edi, [Screen_Max_X] ; screen_sx
|
2007-03-12 22:54:24 +01:00
|
|
|
|
inc edi
|
|
|
|
|
imul edi, ebx
|
|
|
|
|
add edi, eax
|
2009-12-01 14:32:57 +01:00
|
|
|
|
add edi, [_WinMapAddress]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
.new_y:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push ecx ; sx
|
|
|
|
|
push edx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov edx, esi
|
|
|
|
|
align 4
|
2005-10-06 19:56:22 +02:00
|
|
|
|
.new_x:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov byte [edi], dl
|
|
|
|
|
inc edi
|
|
|
|
|
dec ecx
|
|
|
|
|
jnz .new_x
|
|
|
|
|
|
|
|
|
|
pop edx
|
|
|
|
|
pop ecx
|
2008-02-22 13:38:59 +01:00
|
|
|
|
add edi, [Screen_Max_X]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
inc edi
|
|
|
|
|
sub edi, ecx
|
|
|
|
|
dec edx
|
|
|
|
|
jnz .new_y
|
2006-08-29 14:52:52 +02:00
|
|
|
|
.ret:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
.read_byte:
|
|
|
|
|
;eax - address
|
|
|
|
|
;esi - slot
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push eax
|
|
|
|
|
push ebx
|
|
|
|
|
push ecx
|
|
|
|
|
push edx
|
|
|
|
|
mov edx,eax
|
|
|
|
|
mov eax,esi
|
|
|
|
|
lea ebx,[esp+12]
|
|
|
|
|
mov ecx,1
|
|
|
|
|
call read_process_memory
|
|
|
|
|
pop edx
|
|
|
|
|
pop ecx
|
|
|
|
|
pop ebx
|
|
|
|
|
pop eax
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
.free_form:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; for (y=0; y <= x_size; y++)
|
|
|
|
|
; for (x=0; x <= x_size; x++)
|
|
|
|
|
; if (shape[coord(x,y,scale)]==1)
|
|
|
|
|
; set_pixel(x, y, process_number);
|
|
|
|
|
|
|
|
|
|
sub ecx, eax
|
|
|
|
|
sub edx, ebx
|
|
|
|
|
inc ecx
|
|
|
|
|
inc edx
|
|
|
|
|
|
|
|
|
|
push dword [edi+APPDATA.wnd_shape_scale] ; push scale first -> for loop
|
|
|
|
|
|
|
|
|
|
; get WinMap start -> ebp
|
|
|
|
|
push eax
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov eax, [Screen_Max_X] ; screen_sx
|
2007-03-12 22:54:24 +01:00
|
|
|
|
inc eax
|
|
|
|
|
imul eax, ebx
|
|
|
|
|
add eax, [esp]
|
2009-12-01 14:32:57 +01:00
|
|
|
|
add eax, [_WinMapAddress]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ebp, eax
|
|
|
|
|
|
|
|
|
|
mov edi, [edi+APPDATA.wnd_shape]
|
|
|
|
|
pop eax
|
|
|
|
|
|
|
|
|
|
; eax = x_start
|
|
|
|
|
; ebx = y_start
|
|
|
|
|
; ecx = x_size
|
|
|
|
|
; edx = y_size
|
|
|
|
|
; esi = process_number
|
|
|
|
|
; edi = &shape
|
|
|
|
|
; [scale]
|
|
|
|
|
push edx ecx ; for loop - x,y size
|
|
|
|
|
|
|
|
|
|
mov ecx, esi
|
|
|
|
|
shl ecx, 5
|
|
|
|
|
mov edx, [window_data+ecx+WDATA.box.top]
|
|
|
|
|
push [window_data+ecx+WDATA.box.width] ; for loop - width
|
|
|
|
|
mov ecx, [window_data+ecx+WDATA.box.left]
|
|
|
|
|
sub ebx, edx
|
|
|
|
|
sub eax, ecx
|
|
|
|
|
push ebx eax ; for loop - x,y
|
|
|
|
|
|
|
|
|
|
add [ff_xsz], eax
|
|
|
|
|
add [ff_ysz], ebx
|
|
|
|
|
|
|
|
|
|
mov ebx, [ff_y]
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
.ff_new_y:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov edx, [ff_x]
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
.ff_new_x:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; -- body --
|
|
|
|
|
mov ecx, [ff_scale]
|
|
|
|
|
mov eax, [ff_width]
|
|
|
|
|
inc eax
|
|
|
|
|
shr eax, cl
|
|
|
|
|
push ebx edx
|
|
|
|
|
shr ebx, cl
|
|
|
|
|
shr edx, cl
|
|
|
|
|
imul eax, ebx
|
|
|
|
|
add eax, edx
|
|
|
|
|
pop edx ebx
|
|
|
|
|
add eax, edi
|
|
|
|
|
call .read_byte
|
|
|
|
|
test al,al
|
|
|
|
|
jz @f
|
|
|
|
|
mov eax, esi
|
|
|
|
|
mov [ebp], al
|
2005-10-06 19:56:22 +02:00
|
|
|
|
@@:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; -- end body --
|
|
|
|
|
inc ebp
|
|
|
|
|
inc edx
|
|
|
|
|
cmp edx, [ff_xsz]
|
|
|
|
|
jb .ff_new_x
|
|
|
|
|
sub ebp, [ff_xsz]
|
|
|
|
|
add ebp, [ff_x]
|
2008-02-22 13:38:59 +01:00
|
|
|
|
add ebp, [Screen_Max_X] ; screen.x
|
2007-03-12 22:54:24 +01:00
|
|
|
|
inc ebp
|
|
|
|
|
inc ebx
|
|
|
|
|
cmp ebx, [ff_ysz]
|
|
|
|
|
jb .ff_new_y
|
|
|
|
|
|
|
|
|
|
add esp, 24
|
2005-10-06 19:56:22 +02:00
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
2009-12-16 16:19:40 +01:00
|
|
|
|
iglobal
|
|
|
|
|
align 4
|
|
|
|
|
f48call:
|
|
|
|
|
dd display_settings.00
|
|
|
|
|
dd display_settings.01
|
|
|
|
|
dd display_settings.02
|
|
|
|
|
dd display_settings.03
|
|
|
|
|
dd display_settings.04
|
|
|
|
|
dd display_settings.05
|
|
|
|
|
dd display_settings.06
|
|
|
|
|
dd display_settings.07
|
|
|
|
|
dd display_settings.08
|
|
|
|
|
endg
|
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
display_settings:
|
|
|
|
|
|
2009-12-16 16:19:40 +01:00
|
|
|
|
; ebx = 0 ; DISPLAY redraw
|
2005-10-06 19:56:22 +02:00
|
|
|
|
; ebx = 0 ; all
|
|
|
|
|
;
|
2009-12-16 16:19:40 +01:00
|
|
|
|
; ebx = 1 ; BUTTON type
|
2005-10-06 19:56:22 +02:00
|
|
|
|
; ebx = 0 ; flat
|
|
|
|
|
; ebx = 1 ; 3D
|
2009-12-16 16:19:40 +01:00
|
|
|
|
; ebx = 2 ; set WINDOW colours
|
2005-10-06 19:56:22 +02:00
|
|
|
|
; ebx = pointer to table
|
|
|
|
|
; ecx = number of bytes define
|
2009-12-16 16:19:40 +01:00
|
|
|
|
; ebx = 3 ; get WINDOW colours
|
2005-10-06 19:56:22 +02:00
|
|
|
|
; ebx = pointer to table
|
|
|
|
|
; ecx = number of bytes wanted
|
2009-12-16 16:19:40 +01:00
|
|
|
|
; ebx = 4 ; get skin height
|
2005-10-06 19:56:22 +02:00
|
|
|
|
; input : nothing
|
|
|
|
|
; output : eax = skin height in pixel
|
2009-12-16 16:19:40 +01:00
|
|
|
|
; ebx = 5 ; get screen workarea
|
2006-02-01 07:07:36 +01:00
|
|
|
|
; input : nothing
|
|
|
|
|
; output : eax = [left]*65536+[right]
|
|
|
|
|
; ebx = [top]*65536+[bottom]
|
2009-12-16 16:19:40 +01:00
|
|
|
|
; ebx = 6 ; set screen workarea
|
2006-02-01 07:07:36 +01:00
|
|
|
|
; input : ecx = [left]*65536+[right]
|
|
|
|
|
; edx = [top]*65536+[bottom]
|
|
|
|
|
; output : nothing
|
2009-12-16 16:19:40 +01:00
|
|
|
|
; ebx = 7 ; get skin margins
|
2006-03-04 12:58:09 +01:00
|
|
|
|
; input : nothing
|
|
|
|
|
; output : eax = [left]*65536+[right]
|
|
|
|
|
; ebx = [top]*65536+[bottom]
|
2009-12-16 16:19:40 +01:00
|
|
|
|
; ebx = 8 ; set window skin
|
2006-03-04 12:58:09 +01:00
|
|
|
|
; input : ecx = pointer to file info block
|
|
|
|
|
; output : eax = FS error code
|
2009-12-16 16:19:40 +01:00
|
|
|
|
cmp ebx,8
|
|
|
|
|
ja .fail
|
|
|
|
|
jmp dword [f48call+ebx*4]
|
|
|
|
|
.00:
|
|
|
|
|
|
|
|
|
|
; redraw display
|
2009-12-17 18:21:48 +01:00
|
|
|
|
xor eax,eax
|
|
|
|
|
inc ebx
|
|
|
|
|
cmp [windowtypechanged],dword ebx ;ebx=1
|
2009-12-16 16:19:40 +01:00
|
|
|
|
jne .fail
|
2009-12-17 18:21:48 +01:00
|
|
|
|
mov [windowtypechanged],dword eax ;eax=0
|
2009-12-16 16:19:40 +01:00
|
|
|
|
.redraw_screen_direct:
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov [dlx],dword eax
|
|
|
|
|
mov [dly],dword eax
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov eax,[Screen_Max_X]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov [dlxe],eax
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov eax,[Screen_Max_Y]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov [dlye],eax
|
|
|
|
|
mov eax,window_data
|
2009-12-16 16:19:40 +01:00
|
|
|
|
jmp redrawscreen
|
|
|
|
|
.fail:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
ret
|
2009-12-16 16:19:40 +01:00
|
|
|
|
.01:
|
|
|
|
|
; button type
|
|
|
|
|
and ecx,1
|
|
|
|
|
cmp ecx,[buttontype]
|
|
|
|
|
je .01_ex
|
|
|
|
|
mov [buttontype],ecx
|
|
|
|
|
mov [windowtypechanged],dword ebx ;eax=1
|
|
|
|
|
.01_ex:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
ret
|
|
|
|
|
|
2009-12-16 16:19:40 +01:00
|
|
|
|
.02:
|
|
|
|
|
; set common window colours
|
|
|
|
|
dec ebx
|
|
|
|
|
mov [windowtypechanged],dword ebx ;eax=1
|
|
|
|
|
mov esi,ecx
|
|
|
|
|
and edx,127
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov edi,common_colours
|
2009-12-16 16:19:40 +01:00
|
|
|
|
mov ecx,edx
|
|
|
|
|
; cld not need because cld is set previous call
|
2005-10-06 19:56:22 +02:00
|
|
|
|
rep movsb
|
|
|
|
|
ret
|
|
|
|
|
|
2009-12-16 16:19:40 +01:00
|
|
|
|
.03:
|
|
|
|
|
; get common window colours
|
|
|
|
|
mov edi,ecx
|
|
|
|
|
and edx,127
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov esi,common_colours
|
2009-12-16 16:19:40 +01:00
|
|
|
|
mov ecx,edx
|
|
|
|
|
; cld not need because cld is set previous call
|
2005-10-06 19:56:22 +02:00
|
|
|
|
rep movsb
|
|
|
|
|
ret
|
|
|
|
|
|
2009-12-16 16:19:40 +01:00
|
|
|
|
.04:
|
|
|
|
|
; get skin height
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov eax,[_skinh]
|
2009-12-16 16:19:40 +01:00
|
|
|
|
mov [esp+32],eax
|
2005-10-06 19:56:22 +02:00
|
|
|
|
ret
|
|
|
|
|
|
2009-12-16 16:19:40 +01:00
|
|
|
|
.05:
|
|
|
|
|
; get screen workarea
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,[screen_workarea.left-2]
|
|
|
|
|
mov ax,word[screen_workarea.right]
|
2009-12-16 16:19:40 +01:00
|
|
|
|
mov [esp+32],eax
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,[screen_workarea.top-2]
|
|
|
|
|
mov ax,word[screen_workarea.bottom]
|
2009-12-16 16:19:40 +01:00
|
|
|
|
mov [esp+20],eax
|
2007-03-12 22:54:24 +01:00
|
|
|
|
ret
|
2006-02-01 07:07:36 +01:00
|
|
|
|
|
2009-12-16 16:19:40 +01:00
|
|
|
|
.06:
|
|
|
|
|
; set screen workarea
|
2009-12-17 18:21:48 +01:00
|
|
|
|
mov edi,dword[Screen_Max_X]
|
|
|
|
|
movsx eax,word[esp+28+2] ;ecx in the stack
|
|
|
|
|
movsx ebx,word[esp+28]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp eax,ebx
|
|
|
|
|
jge .lp1
|
2008-02-22 13:38:59 +01:00
|
|
|
|
or eax,eax;[Screen_Max_X]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jl @f
|
|
|
|
|
mov [screen_workarea.left],eax
|
2009-12-17 18:21:48 +01:00
|
|
|
|
@@: cmp ebx,edi ;[Screen_Max_X]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jg .lp1
|
|
|
|
|
mov [screen_workarea.right],ebx
|
2009-12-17 18:21:48 +01:00
|
|
|
|
.lp1: movsx eax,word[esp+24+2] ;edx in the stack
|
2007-03-12 22:54:24 +01:00
|
|
|
|
movsx ebx,word[esp+24]
|
|
|
|
|
cmp eax,ebx
|
|
|
|
|
jge .lp2
|
|
|
|
|
or eax,eax;[0xFE04]
|
|
|
|
|
jl @f
|
|
|
|
|
mov [screen_workarea.top],eax
|
2009-12-17 18:21:48 +01:00
|
|
|
|
@@: cmp ebx,edi ;[Screen_Max_Y]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jg .lp2
|
|
|
|
|
mov [screen_workarea.bottom],ebx
|
|
|
|
|
.lp2: call repos_windows
|
2009-12-16 16:19:40 +01:00
|
|
|
|
xor eax, eax
|
|
|
|
|
xor ebx, ebx
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov ecx, [Screen_Max_X]
|
|
|
|
|
mov edx, [Screen_Max_Y]
|
2009-12-16 16:19:40 +01:00
|
|
|
|
jmp calculatescreen
|
2006-02-18 11:41:47 +01:00
|
|
|
|
|
2009-12-16 16:19:40 +01:00
|
|
|
|
.07:
|
|
|
|
|
; get skin margins
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,dword[_skinmargins+0]
|
2009-12-16 16:19:40 +01:00
|
|
|
|
mov [esp+32],eax
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,dword[_skinmargins+4]
|
2009-12-16 16:19:40 +01:00
|
|
|
|
mov [esp+20],eax
|
2007-03-12 22:54:24 +01:00
|
|
|
|
ret
|
2006-03-04 12:58:09 +01:00
|
|
|
|
|
2009-12-16 16:19:40 +01:00
|
|
|
|
.08:
|
|
|
|
|
; set window skin
|
|
|
|
|
mov ebx, ecx
|
2007-05-25 11:37:08 +02:00
|
|
|
|
call read_skin_file
|
2009-12-16 16:19:40 +01:00
|
|
|
|
|
|
|
|
|
mov [esp+32], eax
|
2007-05-25 11:37:08 +02:00
|
|
|
|
test eax, eax
|
|
|
|
|
jnz .ret
|
|
|
|
|
xor eax, eax
|
|
|
|
|
xor ebx, ebx
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov ecx, [Screen_Max_X]
|
|
|
|
|
mov edx, [Screen_Max_Y]
|
2007-05-25 11:37:08 +02:00
|
|
|
|
call calculatescreen
|
2009-12-16 16:19:40 +01:00
|
|
|
|
jmp .redraw_screen_direct
|
2007-05-25 11:37:08 +02:00
|
|
|
|
.ret:
|
|
|
|
|
ret
|
2006-02-18 11:41:47 +01:00
|
|
|
|
|
2006-02-01 07:07:36 +01:00
|
|
|
|
|
2006-02-18 11:41:47 +01:00
|
|
|
|
repos_windows:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ecx,[TASK_COUNT]
|
2009-10-22 19:46:36 +02:00
|
|
|
|
mov edi, window_data+0x20*2
|
2008-02-04 16:31:59 +01:00
|
|
|
|
call force_redraw_background
|
2007-03-12 22:54:24 +01:00
|
|
|
|
dec ecx
|
|
|
|
|
jge @f
|
|
|
|
|
ret
|
|
|
|
|
@@: mov [edi+WDATA.fl_redraw],1
|
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
|
|
|
|
|
jz .lp2
|
|
|
|
|
mov eax,[screen_workarea.left]
|
|
|
|
|
mov [edi+WDATA.box.left],eax
|
|
|
|
|
sub eax,[screen_workarea.right]
|
|
|
|
|
neg eax
|
|
|
|
|
mov [edi+WDATA.box.width],eax
|
|
|
|
|
mov eax,[screen_workarea.top]
|
|
|
|
|
mov [edi+WDATA.box.top],eax
|
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
|
|
|
|
|
jnz .lp1
|
|
|
|
|
sub eax,[screen_workarea.bottom]
|
|
|
|
|
neg eax
|
|
|
|
|
mov [edi+WDATA.box.height],eax
|
2006-09-18 14:23:52 +02:00
|
|
|
|
.lp1:
|
2007-03-05 22:37:28 +01:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call set_window_clientbox
|
|
|
|
|
add edi,0x20
|
|
|
|
|
loop @b
|
|
|
|
|
ret
|
|
|
|
|
.lp2: mov eax,[edi+WDATA.box.left]
|
|
|
|
|
add eax,[edi+WDATA.box.width]
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov ebx,[Screen_Max_X]
|
2006-08-10 20:18:33 +02:00
|
|
|
|
; inc ebx
|
|
|
|
|
cmp eax,ebx
|
|
|
|
|
jle .lp4
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,[edi+WDATA.box.width]
|
2006-08-10 20:18:33 +02:00
|
|
|
|
sub eax,ebx
|
|
|
|
|
jle .lp3
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [edi+WDATA.box.width],ebx
|
|
|
|
|
.lp3: sub ebx,[edi+WDATA.box.width]
|
|
|
|
|
mov [edi+WDATA.box.left],ebx
|
|
|
|
|
.lp4: mov eax,[edi+WDATA.box.top]
|
|
|
|
|
add eax,[edi+WDATA.box.height]
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov ebx,[Screen_Max_Y]
|
2006-08-10 20:18:33 +02:00
|
|
|
|
; inc ebx
|
|
|
|
|
cmp eax,ebx
|
|
|
|
|
jle .lp6
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,[edi+WDATA.box.height]
|
2006-08-10 20:18:33 +02:00
|
|
|
|
sub eax,ebx
|
|
|
|
|
jle .lp5
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [edi+WDATA.box.height],ebx
|
|
|
|
|
.lp5: sub ebx,[edi+WDATA.box.height]
|
|
|
|
|
mov [edi+WDATA.box.top],ebx
|
|
|
|
|
.lp6: jmp .lp1
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
uglobal
|
|
|
|
|
common_colours:
|
|
|
|
|
times 128 db 0x0
|
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
check_window_position:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad ; window inside screen ?
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2008-08-25 18:37:47 +02:00
|
|
|
|
mov eax, [edi+WDATA.box.left]
|
|
|
|
|
mov ebx, [edi+WDATA.box.top]
|
|
|
|
|
mov ecx, [edi+WDATA.box.width]
|
|
|
|
|
mov edx, [edi+WDATA.box.height]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2008-03-07 12:56:20 +01:00
|
|
|
|
cmp ecx,[Screen_Max_X] ; check x size
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jbe x_size_ok
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov ecx,[Screen_Max_X]
|
2006-08-06 12:29:45 +02:00
|
|
|
|
mov [edi+WDATA.box.width],ecx
|
2008-03-07 12:56:20 +01:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
x_size_ok:
|
|
|
|
|
|
2008-03-07 12:56:20 +01:00
|
|
|
|
cmp edx,[Screen_Max_Y] ; check y size
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jbe y_size_ok
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov edx,[Screen_Max_Y]
|
2006-08-06 12:29:45 +02:00
|
|
|
|
mov [edi+WDATA.box.height],edx
|
2008-03-07 12:56:20 +01:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
y_size_ok:
|
|
|
|
|
|
2008-03-07 12:56:20 +01:00
|
|
|
|
cmp eax,0 ; check x pos
|
|
|
|
|
jnle @f
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov [edi+WDATA.box.left],eax
|
|
|
|
|
jmp x_pos_ok
|
|
|
|
|
@@:
|
|
|
|
|
add eax,ecx
|
|
|
|
|
cmp eax,[Screen_Max_X]
|
|
|
|
|
jbe x_pos_ok
|
|
|
|
|
mov eax,[Screen_Max_X]
|
|
|
|
|
sub eax,ecx
|
|
|
|
|
mov [edi+WDATA.box.left],eax
|
|
|
|
|
|
|
|
|
|
x_pos_ok:
|
|
|
|
|
|
|
|
|
|
cmp ebx,0 ; check x pos
|
|
|
|
|
jnle @f
|
|
|
|
|
xor ebx,ebx
|
|
|
|
|
mov [edi+WDATA.box.top],ebx
|
|
|
|
|
jmp y_pos_ok
|
|
|
|
|
@@:
|
|
|
|
|
add ebx,edx
|
|
|
|
|
cmp ebx,[Screen_Max_Y]
|
|
|
|
|
jbe y_pos_ok
|
|
|
|
|
mov ebx,[Screen_Max_Y]
|
|
|
|
|
sub ebx,edx
|
|
|
|
|
mov [edi+WDATA.box.top],ebx
|
|
|
|
|
|
|
|
|
|
y_pos_ok:
|
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
popad
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uglobal
|
|
|
|
|
new_window_starting dd 0
|
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sys_window_mouse:
|
|
|
|
|
|
|
|
|
|
push eax
|
|
|
|
|
|
2006-08-06 12:29:45 +02:00
|
|
|
|
mov eax,[timer_ticks]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
cmp [new_window_starting],eax
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jb swml1
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-01 21:32:19 +01:00
|
|
|
|
mov [MOUSE_BACKGROUND],byte 0 ; no mouse background
|
|
|
|
|
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
mov [new_window_starting],eax
|
|
|
|
|
|
|
|
|
|
swml1:
|
|
|
|
|
|
|
|
|
|
pop eax
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
|
|
drawwindow_I_caption:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ecx,[edx+WDATA.cl_titlebar] ; grab bar
|
|
|
|
|
push ecx
|
|
|
|
|
mov esi,edx
|
|
|
|
|
mov edx,[esi+WDATA.box.top]
|
|
|
|
|
add edx,1
|
|
|
|
|
mov ebx,[esi+WDATA.box.top]
|
|
|
|
|
add ebx,21
|
|
|
|
|
mov eax,[esi+WDATA.box.top]
|
|
|
|
|
add eax,[esi+WDATA.box.height]
|
|
|
|
|
cmp ebx,eax
|
|
|
|
|
jb .wdsizeok
|
|
|
|
|
mov ebx,eax
|
2006-08-03 21:30:32 +02:00
|
|
|
|
.wdsizeok:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push ebx
|
2006-08-03 21:30:32 +02:00
|
|
|
|
.drwi:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ebx,edx
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,edx
|
|
|
|
|
mov eax,[esi+WDATA.box.left]
|
|
|
|
|
inc eax
|
|
|
|
|
shl eax,16
|
|
|
|
|
add eax,[esi+WDATA.box.left]
|
|
|
|
|
add eax,[esi+WDATA.box.width]
|
|
|
|
|
sub eax,1
|
|
|
|
|
push edx
|
|
|
|
|
mov edx,0x80000000
|
|
|
|
|
mov ecx,[esi+WDATA.cl_titlebar]
|
|
|
|
|
and ecx,edx
|
|
|
|
|
cmp ecx,edx
|
|
|
|
|
jnz .nofa
|
|
|
|
|
mov ecx,[esi+WDATA.cl_titlebar]
|
|
|
|
|
sub ecx,0x00040404
|
|
|
|
|
mov [esi+WDATA.cl_titlebar],ecx
|
|
|
|
|
and ecx,0x00ffffff
|
|
|
|
|
jmp .faj
|
2006-08-03 21:30:32 +02:00
|
|
|
|
.nofa:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ecx,[esi+WDATA.cl_titlebar]
|
|
|
|
|
and ecx,0x00ffffff
|
2006-08-03 21:30:32 +02:00
|
|
|
|
.faj:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pop edx
|
|
|
|
|
mov edi,0
|
|
|
|
|
call [draw_line]
|
|
|
|
|
inc edx
|
|
|
|
|
cmp edx,[esp]
|
|
|
|
|
jb .drwi
|
|
|
|
|
add esp,4
|
|
|
|
|
pop ecx
|
|
|
|
|
mov [esi+WDATA.cl_titlebar],ecx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
ret
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drawwindow_I:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
|
|
|
|
or [edx+WDATA.fl_wdrawn], 4
|
|
|
|
|
|
|
|
|
|
mov esi,[edx+WDATA.cl_frames] ; rectangle
|
|
|
|
|
mov eax,[edx+WDATA.box.left]
|
|
|
|
|
shl eax,16
|
|
|
|
|
add eax,[edx+WDATA.box.left]
|
|
|
|
|
add eax,[edx+WDATA.box.width]
|
|
|
|
|
mov ebx,[edx+WDATA.box.top]
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,[edx+WDATA.box.top]
|
|
|
|
|
add ebx,[edx+WDATA.box.height]
|
|
|
|
|
call draw_rectangle
|
|
|
|
|
|
|
|
|
|
and [edx+WDATA.fl_wdrawn], not 4
|
|
|
|
|
test [edx+WDATA.fl_wdrawn], 2
|
|
|
|
|
jz @f
|
|
|
|
|
call drawwindowframes2
|
2006-10-18 13:29:50 +02:00
|
|
|
|
@@:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call drawwindow_I_caption
|
|
|
|
|
|
|
|
|
|
mov edx,[esi+WDATA.box.top] ; inside work area
|
|
|
|
|
add edx,21+5
|
|
|
|
|
mov ebx,[esi+WDATA.box.top]
|
|
|
|
|
add ebx,[esi+WDATA.box.height]
|
|
|
|
|
cmp edx,ebx
|
|
|
|
|
jg noinside
|
|
|
|
|
mov eax,1
|
|
|
|
|
mov ebx,21
|
|
|
|
|
mov ecx,[esi+WDATA.box.width]
|
|
|
|
|
mov edx,[esi+WDATA.box.height]
|
|
|
|
|
mov edi,[esi+WDATA.cl_workarea]
|
2007-01-30 22:54:34 +01:00
|
|
|
|
test edi,0x40000000
|
|
|
|
|
jnz noinside
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call [drawbar]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
noinside:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_rectangle:
|
|
|
|
|
|
|
|
|
|
r_eax equ [esp+28] ; x start
|
|
|
|
|
r_ax equ [esp+30] ; x end
|
|
|
|
|
r_ebx equ [esp+16] ; y start
|
|
|
|
|
r_bx equ [esp+18] ; y end
|
|
|
|
|
;esi ; color
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
|
|
|
|
|
|
|
|
|
mov ecx,esi ; yb,xb -> yb,xe
|
|
|
|
|
mov eax, r_eax
|
|
|
|
|
rol eax, 16
|
|
|
|
|
mov ebx,r_ebx
|
|
|
|
|
shl ebx,16
|
|
|
|
|
mov bx,r_ebx
|
|
|
|
|
xor edi, edi
|
|
|
|
|
call [draw_line]
|
|
|
|
|
|
|
|
|
|
mov ebx,r_bx ; ye,xb -> ye,xe
|
|
|
|
|
shl ebx,16
|
|
|
|
|
mov bx,r_bx
|
|
|
|
|
call [draw_line]
|
|
|
|
|
|
|
|
|
|
mov ecx,esi ; ya,xa -> ye,xa
|
|
|
|
|
mov eax,r_eax
|
|
|
|
|
shl eax,16
|
|
|
|
|
mov ax,r_eax
|
|
|
|
|
mov ebx,r_ebx
|
|
|
|
|
shl ebx,16
|
|
|
|
|
mov bx,r_bx
|
|
|
|
|
mov edi,0
|
|
|
|
|
call [draw_line]
|
|
|
|
|
|
|
|
|
|
mov eax,r_ax ; ya,xe -> ye,xe
|
|
|
|
|
shl eax,16
|
|
|
|
|
mov ax,r_ax
|
|
|
|
|
call [draw_line]
|
|
|
|
|
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
|
drawwindow_III_caption:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ecx,[edx+WDATA.cl_titlebar] ; GRAB BAR
|
|
|
|
|
push ecx
|
|
|
|
|
mov esi,edx
|
|
|
|
|
mov edx,[esi+WDATA.box.top]
|
|
|
|
|
add edx,4
|
|
|
|
|
mov ebx,[esi+WDATA.box.top]
|
|
|
|
|
add ebx,20
|
|
|
|
|
mov eax,[esi+WDATA.box.top]
|
|
|
|
|
add eax,[esi+WDATA.box.height]
|
|
|
|
|
cmp ebx,eax
|
|
|
|
|
jb .wdsizeok
|
|
|
|
|
mov ebx,eax
|
2006-08-03 21:30:32 +02:00
|
|
|
|
.wdsizeok:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push ebx
|
2006-08-03 21:30:32 +02:00
|
|
|
|
.drwi:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ebx,edx
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,edx
|
|
|
|
|
mov eax,[esi+WDATA.box.left]
|
|
|
|
|
shl eax,16
|
|
|
|
|
add eax,[esi+WDATA.box.left]
|
|
|
|
|
add eax,[esi+WDATA.box.width]
|
|
|
|
|
add eax,4*65536-4
|
|
|
|
|
mov ecx,[esi+WDATA.cl_titlebar]
|
|
|
|
|
test ecx,0x40000000
|
|
|
|
|
jz .nofa
|
|
|
|
|
add ecx,0x040404
|
2006-08-03 21:30:32 +02:00
|
|
|
|
.nofa:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
test ecx,0x80000000
|
|
|
|
|
jz .nofa2
|
|
|
|
|
sub ecx,0x040404
|
2006-08-03 21:30:32 +02:00
|
|
|
|
.nofa2:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [esi+WDATA.cl_titlebar],ecx
|
|
|
|
|
and ecx,0xffffff
|
|
|
|
|
xor edi, edi
|
|
|
|
|
call [draw_line]
|
|
|
|
|
inc edx
|
|
|
|
|
cmp edx,[esp]
|
|
|
|
|
jb .drwi
|
|
|
|
|
add esp,4
|
|
|
|
|
pop ecx
|
|
|
|
|
mov [esi+WDATA.cl_titlebar],ecx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
ret
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drawwindow_III:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov edi,edx ; RECTANGLE
|
|
|
|
|
mov eax,[edi+WDATA.box.left]
|
|
|
|
|
shl eax,16
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov ax, word [edi+WDATA.box.left]
|
|
|
|
|
add ax, word [edi+WDATA.box.width]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ebx,[edi+WDATA.box.top]
|
|
|
|
|
shl ebx,16
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov bx, word [edi+WDATA.box.top]
|
|
|
|
|
add bx, word [edi+WDATA.box.height]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov esi,[edi+WDATA.cl_frames]
|
|
|
|
|
shr esi,1
|
|
|
|
|
and esi,0x007f7f7f
|
|
|
|
|
push esi
|
|
|
|
|
or [edi+WDATA.fl_wdrawn], 4
|
|
|
|
|
call draw_rectangle
|
|
|
|
|
and [edi+WDATA.fl_wdrawn], not 4
|
|
|
|
|
test [edi+WDATA.fl_wdrawn], 2
|
|
|
|
|
jz @f
|
|
|
|
|
call drawwindowframes2
|
2006-10-18 13:29:50 +02:00
|
|
|
|
@@:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ecx,3
|
2006-08-03 21:30:32 +02:00
|
|
|
|
dw3l:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
add eax,1*65536-1
|
|
|
|
|
add ebx,1*65536-1
|
|
|
|
|
mov esi,[edi+WDATA.cl_frames]
|
|
|
|
|
call draw_rectangle
|
|
|
|
|
dec ecx
|
|
|
|
|
jnz dw3l
|
|
|
|
|
pop esi
|
|
|
|
|
add eax,1*65536-1
|
|
|
|
|
add ebx,1*65536-1
|
|
|
|
|
call draw_rectangle
|
|
|
|
|
|
|
|
|
|
call drawwindow_III_caption
|
|
|
|
|
|
|
|
|
|
mov edx,[esi+WDATA.box.top] ; WORK AREA
|
|
|
|
|
add edx,21+5
|
|
|
|
|
mov ebx,[esi+WDATA.box.top]
|
|
|
|
|
add ebx,[esi+WDATA.box.height]
|
|
|
|
|
cmp edx,ebx
|
|
|
|
|
jg noinside2
|
|
|
|
|
mov eax,5
|
|
|
|
|
mov ebx,20
|
|
|
|
|
mov ecx,[esi+WDATA.box.width]
|
|
|
|
|
mov edx,[esi+WDATA.box.height]
|
|
|
|
|
sub ecx,4
|
|
|
|
|
sub edx,4
|
|
|
|
|
mov edi,[esi+WDATA.cl_workarea]
|
2007-01-30 22:54:34 +01:00
|
|
|
|
test edi,0x40000000
|
|
|
|
|
jnz noinside2
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call [drawbar]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
noinside2:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; activate window
|
|
|
|
|
align 4
|
|
|
|
|
windowactivate:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; esi = abs mem position in stack 0xC400+
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
2006-07-23 16:47:32 +02:00
|
|
|
|
|
|
|
|
|
; if type of current active window is 3,
|
|
|
|
|
; it must be redrawn
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax, [TASK_COUNT]
|
|
|
|
|
movzx eax, word [WIN_POS + eax*2]
|
|
|
|
|
shl eax, 5
|
|
|
|
|
add eax, window_data
|
|
|
|
|
mov ebx, [eax + WDATA.cl_workarea]
|
|
|
|
|
and ebx, 0x0f000000
|
|
|
|
|
cmp ebx, 0x03000000
|
2007-06-22 02:17:28 +02:00
|
|
|
|
je .set_WDATA_fl_redraw ; for 3 and 4 style
|
|
|
|
|
cmp ebx, 0x04000000
|
|
|
|
|
je .set_WDATA_fl_redraw
|
|
|
|
|
jmp @f
|
|
|
|
|
.set_WDATA_fl_redraw:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [eax + WDATA.fl_redraw], byte 1
|
2006-07-23 16:47:32 +02:00
|
|
|
|
@@:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push esi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
movzx eax, word [esi] ; ax <- process no
|
2007-02-28 11:51:05 +01:00
|
|
|
|
movzx eax, word [WIN_STACK+eax*2] ; ax <- position in window stack
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
xor esi, esi ; drop others
|
2005-10-06 19:56:22 +02:00
|
|
|
|
waloop:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp esi, dword [TASK_COUNT]
|
|
|
|
|
jae wacont
|
|
|
|
|
inc esi
|
|
|
|
|
lea edi, [WIN_STACK + esi*2]
|
|
|
|
|
mov bx, [edi] ; position of the current process
|
|
|
|
|
cmp bx, ax
|
|
|
|
|
jbe @f
|
|
|
|
|
dec bx ; upper? => drop!
|
|
|
|
|
mov [edi], bx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
@@:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jmp waloop
|
2005-10-06 19:56:22 +02:00
|
|
|
|
wacont:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; set to no 1
|
|
|
|
|
pop esi ; esi = pointer at 0xC400
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
movzx eax, word [esi]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov bx, [TASK_COUNT] ; number of processes
|
|
|
|
|
mov [WIN_STACK+eax*2], bx ; this is the last (and the upper)
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; update on screen -window stack
|
|
|
|
|
xor esi, esi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
waloop2:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov edi, [TASK_COUNT]
|
|
|
|
|
cmp esi, edi
|
|
|
|
|
jae wacont2
|
|
|
|
|
inc esi
|
|
|
|
|
movzx ebx, word [esi*2 + WIN_STACK]
|
|
|
|
|
mov [ebx*2 + WIN_POS], si
|
|
|
|
|
jmp waloop2
|
2005-10-06 19:56:22 +02:00
|
|
|
|
wacont2:
|
2007-05-08 13:32:58 +02:00
|
|
|
|
mov [KEY_COUNT], byte 0 ; empty keyboard buffer
|
|
|
|
|
mov [BTN_COUNT], byte 0 ; empty button buffer
|
|
|
|
|
mov [MOUSE_SCROLL_H], word 0 ; zero mouse z-index
|
|
|
|
|
mov [MOUSE_SCROLL_V], word 0 ; zero mouse z-index
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; check if window is necessary to draw
|
|
|
|
|
|
|
|
|
|
checkwindowdraw:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; edi = position in window_data+
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax, [edi + WDATA.cl_workarea]
|
|
|
|
|
and eax, 0x0f000000
|
|
|
|
|
cmp eax, 0x03000000
|
|
|
|
|
je .return_yes ; window type 3
|
2007-06-22 02:17:28 +02:00
|
|
|
|
cmp eax, 0x04000000
|
|
|
|
|
je .return_yes ; window type 4
|
2006-07-23 16:47:32 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov esi, edi
|
|
|
|
|
sub esi, window_data
|
|
|
|
|
shr esi, 5
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; esi = process number
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
movzx eax, word [WIN_STACK + esi * 2] ; get value of the curr process
|
|
|
|
|
lea esi, [WIN_POS + eax * 2] ; get address of this process at 0xC400
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push esi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
.new_check:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pop esi
|
|
|
|
|
add esi, 2
|
|
|
|
|
push esi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax, [TASK_COUNT]
|
|
|
|
|
lea eax, word [WIN_POS + eax * 2] ; number of the upper window
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp esi, eax
|
|
|
|
|
ja .all_wnds_to_top
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
movzx eax, word [esi]
|
|
|
|
|
shl eax, 5
|
|
|
|
|
cmp [CURRENT_TASK + eax + TASKDATA.state], byte 9
|
|
|
|
|
je .new_check ; skip dead windows
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
lea esi, [eax+window_data]
|
2006-07-23 16:47:32 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ebx, [edi+WDATA.box.top] ; y0
|
|
|
|
|
mov edx, [edi+WDATA.box.height]
|
|
|
|
|
add edx, ebx ; y0e
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ecx, [esi+WDATA.box.top] ; y ; y check
|
|
|
|
|
cmp ecx, edx
|
|
|
|
|
jae .new_check ; y < y0e
|
|
|
|
|
mov eax, [esi+WDATA.box.height]
|
|
|
|
|
add ecx, eax ; ye
|
|
|
|
|
cmp ebx, ecx ; y0 >= ye
|
|
|
|
|
ja .new_check
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax, [edi+WDATA.box.left] ; x0
|
|
|
|
|
mov ecx, [edi+WDATA.box.width]
|
|
|
|
|
add ecx, eax ; x0e
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov edx, [esi+WDATA.box.left] ; x ; x check
|
|
|
|
|
cmp edx, ecx
|
|
|
|
|
jae .new_check ; x < x0e
|
|
|
|
|
mov ecx, [esi+WDATA.box.width]
|
|
|
|
|
add edx, ecx
|
|
|
|
|
cmp eax, edx
|
|
|
|
|
ja .new_check
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pop esi
|
2006-07-23 16:47:32 +02:00
|
|
|
|
.return_yes:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ecx,1 ; overlap some window
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
.all_wnds_to_top:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pop esi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
xor ecx, ecx ; passed all windows to top
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
waredraw: ; if redraw necessary at activate
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call checkwindowdraw ; draw window on activation ?
|
|
|
|
|
test ecx, ecx
|
|
|
|
|
jz .do_not_draw
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
|
|
|
|
mov [MOUSE_DOWN], byte 1 ; do draw mouse
|
|
|
|
|
call windowactivate
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; update screen info
|
|
|
|
|
pushad
|
|
|
|
|
mov edi, [TASK_COUNT] ; the last process (number)
|
|
|
|
|
movzx esi, word [WIN_POS + edi * 2]
|
|
|
|
|
shl esi, 5
|
|
|
|
|
add esi, window_data
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; coordinates of the upper window
|
|
|
|
|
mov eax, [esi + WDATA.box.left] ; cx
|
|
|
|
|
mov ebx, [esi + WDATA.box.top] ; cy
|
|
|
|
|
mov ecx, [esi + WDATA.box.width] ; sx
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov edx, [esi + WDATA.box.height] ; sy
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
add ecx, eax ; ecx = x_end
|
|
|
|
|
add edx, ebx ; edx = y_end
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov edi, [TASK_COUNT]
|
|
|
|
|
movzx esi, word [WIN_POS + edi * 2]
|
|
|
|
|
call setscreen
|
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov [edi + WDATA.fl_redraw], 1 ; redraw flag for app
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [MOUSE_DOWN],byte 0 ; mouse down checks
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
.do_not_draw:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call windowactivate
|
|
|
|
|
mov [MOUSE_DOWN],byte 0 ; mouse down checks
|
|
|
|
|
mov [MOUSE_BACKGROUND],byte 0 ; no mouse background
|
|
|
|
|
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
2006-07-25 12:48:35 +02:00
|
|
|
|
; eax = window number on screen
|
|
|
|
|
; corrupts registers and [dl*]
|
|
|
|
|
minimize_window:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
movzx eax, word [WIN_POS+eax*2]
|
|
|
|
|
shl eax, 5
|
|
|
|
|
add eax, window_data
|
|
|
|
|
test [eax+WDATA.fl_wstate], WSTATE_MINIMIZED
|
|
|
|
|
jnz .skip_redrawings
|
|
|
|
|
pushfd
|
|
|
|
|
cli
|
|
|
|
|
or [eax+WDATA.fl_wstate], WSTATE_MINIMIZED
|
|
|
|
|
mov edi, eax
|
|
|
|
|
;call calculatescreen
|
|
|
|
|
mov eax, [edi+WDATA.box.left]
|
|
|
|
|
mov [dlx], eax
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
add ecx, [edi+WDATA.box.width]
|
|
|
|
|
mov [dlxe], ecx
|
|
|
|
|
mov ebx, [edi+WDATA.box.top]
|
|
|
|
|
mov [dly], ebx
|
|
|
|
|
mov edx, ebx
|
|
|
|
|
add edx, [edi+WDATA.box.height]
|
|
|
|
|
mov [dlye], edx
|
|
|
|
|
call calculatescreen
|
|
|
|
|
xor esi, esi
|
|
|
|
|
xor eax, eax
|
|
|
|
|
call redrawscreen
|
|
|
|
|
popfd
|
2006-07-25 12:48:35 +02:00
|
|
|
|
.skip_redrawings:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
ret
|
2006-07-25 12:48:35 +02:00
|
|
|
|
|
|
|
|
|
; eax = window number on screen
|
|
|
|
|
; corrupts registers and [dl*]
|
|
|
|
|
restore_minimized_window:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushfd
|
|
|
|
|
cli
|
|
|
|
|
movzx esi, word [WIN_POS+eax*2]
|
|
|
|
|
mov edi, esi
|
|
|
|
|
shl edi, 5
|
|
|
|
|
add edi, window_data
|
|
|
|
|
test [edi+WDATA.fl_wstate], WSTATE_MINIMIZED
|
|
|
|
|
jz .skip_redrawings
|
|
|
|
|
mov [edi+WDATA.fl_redraw], 1
|
|
|
|
|
and [edi+WDATA.fl_wstate], not WSTATE_MINIMIZED
|
|
|
|
|
cmp eax, [TASK_COUNT] ; the uppermost window
|
|
|
|
|
jnz .no_uppermost
|
|
|
|
|
mov eax, [edi+WDATA.box.left]
|
|
|
|
|
mov ebx, [edi+WDATA.box.top]
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
mov edx, ebx
|
|
|
|
|
add ecx, [edi+WDATA.box.width]
|
|
|
|
|
add edx, [edi+WDATA.box.height]
|
|
|
|
|
call setscreen
|
|
|
|
|
jmp .done
|
2006-07-25 12:48:35 +02:00
|
|
|
|
.no_uppermost:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax, [edi+WDATA.box.left]
|
|
|
|
|
mov ebx, [edi+WDATA.box.top]
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
mov edx, ebx
|
|
|
|
|
add ecx, [edi+WDATA.box.width]
|
|
|
|
|
add edx, [edi+WDATA.box.height]
|
|
|
|
|
call calculatescreen
|
2006-07-25 12:48:35 +02:00
|
|
|
|
.done:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [MOUSE_BACKGROUND],byte 0 ; no mouse under
|
2006-07-25 12:48:35 +02:00
|
|
|
|
.skip_redrawings:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popfd
|
|
|
|
|
ret
|
2006-07-25 12:48:35 +02:00
|
|
|
|
|
|
|
|
|
|
2009-02-20 13:01:31 +01:00
|
|
|
|
;iglobal
|
|
|
|
|
; window_moving db 'K : Window - move/resize',13,10,0
|
|
|
|
|
; window_moved db 'K : Window - done',13,10,0
|
|
|
|
|
;endg
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
; check window touch
|
|
|
|
|
align 4
|
|
|
|
|
checkwindows:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
|
|
|
|
|
|
|
|
|
cmp [window_minimize], 0
|
|
|
|
|
je .no_minimizing
|
|
|
|
|
mov eax, [TASK_COUNT] ; the uppermost window
|
|
|
|
|
mov bl, 0
|
|
|
|
|
xchg [window_minimize], bl
|
|
|
|
|
cmp bl, 1
|
|
|
|
|
jne .restore
|
|
|
|
|
call minimize_window
|
|
|
|
|
jmp .continue
|
2006-07-25 12:48:35 +02:00
|
|
|
|
.restore:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call restore_minimized_window
|
2006-07-25 12:48:35 +02:00
|
|
|
|
.continue:
|
|
|
|
|
.no_minimizing:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp [BTN_DOWN],byte 0 ; mouse buttons pressed ?
|
|
|
|
|
jne .mouse_buttons_pressed
|
|
|
|
|
;..................................... start 1/4 : modified by vhanla .................
|
|
|
|
|
mov [bPressedMouseXY_W],0
|
|
|
|
|
;..................................... end 1/4 : modified by vhanla ...................
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
.mouse_buttons_pressed:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
;..................................... start 2/4 : modified by vhanla .................
|
2008-12-17 13:38:37 +01:00
|
|
|
|
uglobal
|
2007-03-12 22:54:24 +01:00
|
|
|
|
bPressedMouseXY_W db 0x0
|
2008-12-17 13:38:37 +01:00
|
|
|
|
endg
|
2007-03-12 22:54:24 +01:00
|
|
|
|
;..................................... end 2/4 : modified by vhanla ...................
|
|
|
|
|
mov esi,[TASK_COUNT]
|
|
|
|
|
inc esi
|
|
|
|
|
|
|
|
|
|
;..................................... start 3/4 : modified by vhanla .................
|
2008-12-29 18:34:06 +01:00
|
|
|
|
cmp [bPressedMouseXY_W],1
|
|
|
|
|
ja @f
|
|
|
|
|
inc [bPressedMouseXY_W]
|
2009-01-02 09:59:23 +01:00
|
|
|
|
jnc @f
|
|
|
|
|
;mov ax,[MOUSE_X]
|
|
|
|
|
;mov [mx],ax
|
|
|
|
|
;mov ax,[MOUSE_Y]
|
|
|
|
|
;mov [my],ax
|
|
|
|
|
mov eax,dword[MOUSE_X]
|
|
|
|
|
mov dword[mx],eax
|
|
|
|
|
@@:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
;..................................... end 3/4 : modified by vhanla ...................
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
cwloop:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp esi,2
|
|
|
|
|
jb .exit
|
2006-07-25 12:48:35 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
dec esi
|
|
|
|
|
movzx edi, word [WIN_POS + esi * 2] ; ebx
|
|
|
|
|
shl edi, 5
|
|
|
|
|
add edi, window_data
|
2005-10-06 19:56:22 +02:00
|
|
|
|
; mov edi, ebx
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov ecx, [edi + WDATA.box.left]
|
|
|
|
|
mov edx, [edi + WDATA.box.top]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,ecx
|
|
|
|
|
mov ebx,edx
|
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_MINIMIZED
|
|
|
|
|
jnz cwloop
|
|
|
|
|
|
|
|
|
|
;..................................... start 4/4 : modified by vhanla .................
|
|
|
|
|
movzx eax, word [mx]; movzx eax,word[MOUSE_X]
|
|
|
|
|
movzx ebx, word [my]; movzx ebx,word[MOUSE_Y]
|
|
|
|
|
;..................................... endt 4/4 : modified by vhanla ..................
|
|
|
|
|
cmp ecx, eax
|
|
|
|
|
jae cwloop
|
|
|
|
|
cmp edx, ebx
|
|
|
|
|
jae cwloop
|
2006-08-10 20:18:33 +02:00
|
|
|
|
add ecx, [edi + WDATA.box.width]
|
|
|
|
|
add edx, [edi + WDATA.box.height]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp eax, ecx
|
|
|
|
|
jae cwloop
|
|
|
|
|
cmp ebx, edx
|
|
|
|
|
jae cwloop
|
|
|
|
|
|
|
|
|
|
pushad
|
|
|
|
|
mov eax, esi
|
|
|
|
|
mov ebx, [TASK_COUNT]
|
|
|
|
|
cmp eax, ebx ; is this window active?
|
|
|
|
|
jz .move_resize_window
|
|
|
|
|
|
2008-12-29 18:34:06 +01:00
|
|
|
|
cmp [bPressedMouseXY_W], 1
|
2009-01-02 09:59:23 +01:00
|
|
|
|
ja .exit_popa
|
2008-12-29 18:34:06 +01:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; eax = position in windowing stack
|
|
|
|
|
; redraw must ?
|
|
|
|
|
lea esi, [WIN_POS + esi * 2]
|
|
|
|
|
call waredraw
|
2009-01-02 09:59:23 +01:00
|
|
|
|
.exit_popa:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
add esp, 32
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
.exit:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
.move_resize_window: ; MOVE OR RESIZE WINDOW
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; Check for user enabled fixed window
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov edx, [edi + WDATA.cl_titlebar]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
and edx, 0x0f000000
|
|
|
|
|
cmp edx, 0x01000000
|
|
|
|
|
jne .window_move_enabled_for_user
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
.window_move_enabled_for_user:
|
|
|
|
|
|
2006-08-10 20:18:33 +02:00
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jnz .no_resize_2
|
2006-02-01 07:07:36 +01:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [do_resize_from_corner],byte 0 ; resize for skinned window
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov edx, [edi + WDATA.cl_workarea]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
and edx, 0x0f000000
|
2007-06-22 02:17:28 +02:00
|
|
|
|
cmp edx, 0x00000000 ;{test for resized}
|
|
|
|
|
je .no_resize_2
|
|
|
|
|
cmp edx, 0x01000000 ;{test for resized}
|
|
|
|
|
je .no_resize_2
|
2008-02-22 13:38:59 +01:00
|
|
|
|
cmp edx, 0x04000000 ;{test for resized}
|
2007-06-22 02:17:28 +02:00
|
|
|
|
je .no_resize_2
|
|
|
|
|
; jb .no_resize_2 ; not type 2 wnd
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov edx, [edi + WDATA.box.top]
|
|
|
|
|
add edx, [edi + WDATA.box.height]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
sub edx, 6 ; edx = y_end - 6
|
|
|
|
|
cmp ebx, edx ; ebx = mouse_y
|
|
|
|
|
jb .no_resize_2
|
|
|
|
|
mov [do_resize_from_corner],byte 1
|
|
|
|
|
jmp .continue
|
2005-10-06 19:56:22 +02:00
|
|
|
|
.no_resize_2:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push eax
|
|
|
|
|
call get_titlebar_height
|
2006-08-10 20:18:33 +02:00
|
|
|
|
add eax,[edi + WDATA.box.top]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp ebx,eax
|
|
|
|
|
pop eax
|
|
|
|
|
jae .exit
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
.continue:
|
|
|
|
|
|
2009-02-20 13:01:31 +01:00
|
|
|
|
; push esi
|
|
|
|
|
; mov esi, window_moving
|
|
|
|
|
; call sys_msg_board_str
|
|
|
|
|
; pop esi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ecx, [timer_ticks] ; double-click ?
|
|
|
|
|
mov edx, ecx
|
|
|
|
|
sub edx, [latest_window_touch]
|
|
|
|
|
mov [latest_window_touch], ecx
|
|
|
|
|
mov [latest_window_touch_delta], edx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov cl, [BTN_DOWN] ; save for shade check
|
|
|
|
|
mov [do_resize], cl
|
2005-10-06 19:56:22 +02:00
|
|
|
|
no_emulation_righ_button:
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov ecx, [edi + WDATA.box.left]
|
|
|
|
|
mov edx, [edi + WDATA.box.top]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push eax ecx edx
|
|
|
|
|
mov [dlx], ecx ; save for drawlimits
|
|
|
|
|
mov [dly], edx
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov eax, [edi + WDATA.box.width]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
add ecx, eax
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov eax, [edi + WDATA.box.height]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
add edx, eax
|
|
|
|
|
mov [dlxe], ecx
|
|
|
|
|
mov [dlye], edx
|
|
|
|
|
pop edx ecx eax
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
sub eax, ecx
|
|
|
|
|
sub ebx, edx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov esi, [MOUSE_X]
|
|
|
|
|
mov [WIN_TEMP_XY], esi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad ; wait for putimages to finish
|
2007-12-17 12:04:07 +01:00
|
|
|
|
; mov ebx,5
|
2005-10-06 19:56:22 +02:00
|
|
|
|
; call delay_hs
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov eax,[edi + WDATA.box.left]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [npx],eax
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov eax,[edi + WDATA.box.top]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [npy],eax
|
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push eax ; save old coordinates
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov ax, word [edi + WDATA.box.left]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov word [oldc+BOX.left],ax
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov ax, word [edi + WDATA.box.top]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov word [oldc+BOX.top],ax
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov ax, word [edi + WDATA.box.width]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov word [oldc+BOX.width],ax
|
|
|
|
|
mov word [npxe],ax
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov ax, word [edi + WDATA.box.height]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov word [oldc+BOX.height],ax
|
|
|
|
|
mov word [npye],ax
|
|
|
|
|
pop eax
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call drawwindowframes
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [reposition],0
|
|
|
|
|
mov [MOUSE_DOWN],byte 1 ; no reaction to mouse up/down
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
; move window
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
newchm:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [DONT_DRAW_MOUSE],byte 1
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call checkidle
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call checkVga_N13
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [MOUSE_BACKGROUND],byte 0
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call [draw_pointer]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
|
|
|
|
call stack_handler
|
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov esi,[WIN_TEMP_XY]
|
|
|
|
|
cmp esi,[MOUSE_X]
|
|
|
|
|
je cwb
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov cx,[MOUSE_X]
|
|
|
|
|
mov dx,[MOUSE_Y]
|
|
|
|
|
sub cx,ax
|
|
|
|
|
sub dx,bx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push ax
|
|
|
|
|
push bx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call drawwindowframes
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov ax,[Screen_Max_X]
|
|
|
|
|
mov bx,[Screen_Max_Y]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp [do_resize_from_corner],1
|
|
|
|
|
je no_new_position
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov word [npx],word 0 ; x repos ?
|
|
|
|
|
cmp ax,cx
|
|
|
|
|
jb noreposx
|
|
|
|
|
mov [reposition],1
|
|
|
|
|
sub ax,word [npxe]
|
|
|
|
|
mov word [npx],ax
|
|
|
|
|
cmp ax,cx
|
|
|
|
|
jb noreposx
|
|
|
|
|
mov word [npx],cx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
noreposx:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov word [npy],word 0 ; y repos ?
|
|
|
|
|
cmp bx,dx
|
|
|
|
|
jb noreposy
|
|
|
|
|
mov [reposition],1
|
|
|
|
|
sub bx,word [npye]
|
|
|
|
|
mov word [npy],bx
|
|
|
|
|
cmp bx,dx
|
|
|
|
|
jb noreposy
|
|
|
|
|
mov word [npy],dx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
noreposy:
|
|
|
|
|
|
|
|
|
|
no_new_position:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp [do_resize_from_corner],0 ; resize from right corner
|
|
|
|
|
je norepos_size
|
|
|
|
|
pushad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov edx,edi
|
|
|
|
|
sub edx,window_data
|
|
|
|
|
;shr edx,5
|
|
|
|
|
;shl edx,8
|
|
|
|
|
;add edx,0x80000 ; process base at 0x80000+
|
2007-02-28 11:51:05 +01:00
|
|
|
|
lea edx, [SLOT_BASE + edx*8]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
movzx eax,word [MOUSE_X]
|
2006-08-10 20:18:33 +02:00
|
|
|
|
cmp eax,[edi + WDATA.box.left]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jb nnepx
|
2006-08-10 20:18:33 +02:00
|
|
|
|
sub eax,[edi + WDATA.box.left]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp eax,32 ; [edx+0x90+8]
|
|
|
|
|
jge nnepx2
|
|
|
|
|
mov eax,32 ; [edx+0x90+8]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
nnepx2:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [npxe],eax
|
2005-10-06 19:56:22 +02:00
|
|
|
|
nnepx:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call get_rolledup_height
|
|
|
|
|
mov ebx,eax
|
|
|
|
|
movzx eax,word [MOUSE_Y]
|
2006-08-10 20:18:33 +02:00
|
|
|
|
cmp eax,[edi + WDATA.box.top]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jb nnepy
|
2006-08-10 20:18:33 +02:00
|
|
|
|
sub eax,[edi + WDATA.box.top]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp eax,ebx ; [edx+0x90+12]
|
|
|
|
|
jge nnepy2
|
|
|
|
|
mov eax,ebx ; [edx+0x90+12]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
nnepy2:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [npye],eax
|
2005-10-06 19:56:22 +02:00
|
|
|
|
nnepy:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [reposition],1
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
norepos_size:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pop bx
|
|
|
|
|
pop ax
|
|
|
|
|
call drawwindowframes
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov esi,[MOUSE_X]
|
|
|
|
|
mov [WIN_TEMP_XY],esi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
cwb:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp [BTN_DOWN],byte 0
|
|
|
|
|
jne newchm
|
|
|
|
|
; new position done
|
|
|
|
|
mov [DONT_DRAW_MOUSE],byte 1
|
|
|
|
|
mov cl,0
|
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
|
|
|
|
|
jnz @f
|
|
|
|
|
mov cl,[reposition]
|
|
|
|
|
call drawwindowframes
|
|
|
|
|
|
|
|
|
|
mov eax,[npx]
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov [edi + WDATA.box.left],eax
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,[npy]
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov [edi + WDATA.box.top],eax
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,[npxe]
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov [edi + WDATA.box.width],eax
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,[npye]
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov [edi + WDATA.box.height],eax
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call set_window_clientbox
|
|
|
|
|
|
|
|
|
|
@@: mov [reposition],cl
|
|
|
|
|
|
|
|
|
|
cmp [reposition],1 ; save new position and size
|
|
|
|
|
jne no_bounds_save
|
|
|
|
|
push esi edi ecx
|
|
|
|
|
mov esi,edi
|
|
|
|
|
mov ecx,2
|
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP or WSTATE_MAXIMIZED
|
|
|
|
|
jnz @f
|
|
|
|
|
add ecx,2
|
2006-03-11 02:15:32 +01:00
|
|
|
|
@@: sub edi,window_data
|
2007-03-12 22:54:24 +01:00
|
|
|
|
shr edi,5
|
|
|
|
|
shl edi,8
|
|
|
|
|
add edi,SLOT_BASE+APPDATA.saved_box
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
pop ecx edi esi
|
2006-03-04 12:58:09 +01:00
|
|
|
|
no_bounds_save:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad ; WINDOW SHADE/FULLSCREEN
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-06-22 02:17:28 +02:00
|
|
|
|
;{doule click not worked for 4 type window}
|
|
|
|
|
mov edx, [edi + WDATA.cl_workarea]
|
|
|
|
|
and edx, 0x0f000000
|
|
|
|
|
cmp edx, 0x00000000
|
|
|
|
|
je no_fullscreen_restore
|
|
|
|
|
cmp edx, 0x01000000
|
|
|
|
|
je no_fullscreen_restore
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp [reposition],1
|
|
|
|
|
je no_window_sizing
|
|
|
|
|
mov edx,edi
|
|
|
|
|
sub edx,window_data
|
|
|
|
|
shr edx,5
|
|
|
|
|
shl edx,8
|
|
|
|
|
add edx,SLOT_BASE ; process base at 0x80000+
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp [do_resize],2 ; window shade ?
|
|
|
|
|
jne no_window_shade
|
|
|
|
|
mov [reposition],1
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
|
|
|
|
|
jnz wnd_rolldown
|
2006-02-01 07:07:36 +01:00
|
|
|
|
wnd_rollup:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
or [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
|
|
|
|
|
call get_rolledup_height
|
|
|
|
|
jmp @f
|
2006-02-01 07:07:36 +01:00
|
|
|
|
wnd_rolldown:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
and [edi+WDATA.fl_wstate],not WSTATE_ROLLEDUP
|
2006-08-10 20:18:33 +02:00
|
|
|
|
mov eax,[edx + APPDATA.saved_box.height] ; 0x90+BOX.height
|
2007-03-12 22:54:24 +01:00
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
|
|
|
|
|
jz @f
|
|
|
|
|
mov eax,[screen_workarea.bottom]
|
|
|
|
|
sub eax,[screen_workarea.top]
|
|
|
|
|
@@: mov [edi+WDATA.box.height],eax
|
2007-12-08 20:46:57 +01:00
|
|
|
|
add eax, [edi+WDATA.box.top]
|
2008-02-22 13:38:59 +01:00
|
|
|
|
cmp eax, [Screen_Max_Y]
|
2007-12-08 20:46:57 +01:00
|
|
|
|
jbe @f
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov eax, [Screen_Max_Y]
|
2007-12-08 20:46:57 +01:00
|
|
|
|
sub eax, [edi+WDATA.box.height]
|
|
|
|
|
mov [edi+WDATA.box.top], eax
|
|
|
|
|
@@: call check_window_position
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call set_window_clientbox
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
no_window_shade:
|
|
|
|
|
|
2007-08-01 04:00:19 +02:00
|
|
|
|
push edx
|
|
|
|
|
mov edx, [edi + WDATA.cl_workarea]
|
|
|
|
|
and edx, 0x0f000000
|
|
|
|
|
cmp edx, 0x04000000
|
|
|
|
|
pop edx
|
|
|
|
|
je no_fullscreen_restore
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp [do_resize],1 ; fullscreen/restore ?
|
|
|
|
|
jne no_fullscreen_restore
|
|
|
|
|
cmp [latest_window_touch_delta],dword 50
|
|
|
|
|
jg no_fullscreen_restore
|
|
|
|
|
mov [reposition],1
|
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
|
|
|
|
|
jnz restore_from_fullscreen
|
|
|
|
|
or [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
|
|
|
|
|
mov eax,[screen_workarea.left]
|
|
|
|
|
mov [edi+WDATA.box.left],eax
|
|
|
|
|
sub eax,[screen_workarea.right]
|
|
|
|
|
neg eax
|
|
|
|
|
mov [edi+WDATA.box.width],eax
|
|
|
|
|
mov eax,[screen_workarea.top]
|
|
|
|
|
mov [edi+WDATA.box.top],eax
|
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
|
|
|
|
|
jnz @f
|
|
|
|
|
sub eax,[screen_workarea.bottom]
|
|
|
|
|
neg eax
|
|
|
|
|
mov [edi+WDATA.box.height],eax
|
2006-02-01 07:07:36 +01:00
|
|
|
|
@@:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jmp restore_from_fullscreen.clientbox
|
2005-10-06 19:56:22 +02:00
|
|
|
|
restore_from_fullscreen:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
and [edi+WDATA.fl_wstate],not WSTATE_MAXIMIZED
|
|
|
|
|
push [edi+WDATA.box.height]
|
|
|
|
|
push edi ; restore
|
|
|
|
|
lea esi, [edx + APPDATA.saved_box]
|
|
|
|
|
mov ecx,4
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
pop edi
|
|
|
|
|
pop eax
|
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
|
|
|
|
|
jz @f
|
|
|
|
|
mov [edi+WDATA.box.height],eax
|
2006-02-01 07:07:36 +01:00
|
|
|
|
@@:
|
2006-09-18 14:23:52 +02:00
|
|
|
|
.clientbox:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
call set_window_clientbox
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
no_fullscreen_restore:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,[edi+WDATA.box.top] ; check Y inside screen
|
|
|
|
|
add eax,[edi+WDATA.box.height]
|
2008-02-22 13:38:59 +01:00
|
|
|
|
cmp eax,[Screen_Max_Y]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jbe no_window_sizing
|
|
|
|
|
mov eax,[edi+WDATA.box.left] ; check X inside screen
|
|
|
|
|
add eax,[edi+WDATA.box.width]
|
2008-02-22 13:38:59 +01:00
|
|
|
|
cmp eax,[Screen_Max_X]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
jbe no_window_sizing
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov eax,[Screen_Max_X]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
sub eax,[edi+WDATA.box.width]
|
|
|
|
|
mov [edi+WDATA.box.left],eax
|
2008-02-22 13:38:59 +01:00
|
|
|
|
mov eax,[Screen_Max_Y]
|
2007-03-12 22:54:24 +01:00
|
|
|
|
sub eax,[edi+WDATA.box.height]
|
|
|
|
|
mov [edi+WDATA.box.top],eax
|
|
|
|
|
call set_window_clientbox
|
2005-10-06 19:56:22 +02:00
|
|
|
|
no_window_sizing:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
cmp [reposition],0
|
|
|
|
|
je retwm
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [DONT_DRAW_MOUSE],byte 1 ; no mouse
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
push eax ebx ecx edx
|
|
|
|
|
mov eax,[edi+WDATA.box.left]
|
|
|
|
|
mov ebx,[edi+WDATA.box.top]
|
|
|
|
|
mov ecx,[edi+WDATA.box.width]
|
|
|
|
|
mov edx,[edi+WDATA.box.height]
|
|
|
|
|
add ecx,eax
|
|
|
|
|
add edx,ebx
|
|
|
|
|
call calculatescreen
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,[oldc+BOX.left]
|
|
|
|
|
mov ebx,[oldc+BOX.top]
|
|
|
|
|
mov ecx,[oldc+BOX.width]
|
|
|
|
|
mov edx,[oldc+BOX.height]
|
|
|
|
|
add ecx,eax
|
|
|
|
|
add edx,ebx
|
|
|
|
|
call calculatescreen
|
|
|
|
|
pop edx ecx ebx eax
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov eax,edi
|
|
|
|
|
call redrawscreen
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [edi+WDATA.fl_redraw],1
|
2006-08-01 16:09:42 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov ecx,100 ; wait to avoid mouse residuals
|
2005-10-06 19:56:22 +02:00
|
|
|
|
waitre2:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [DONT_DRAW_MOUSE],byte 1
|
|
|
|
|
call checkidle
|
|
|
|
|
cmp [edi+WDATA.fl_redraw],0
|
|
|
|
|
jz retwm
|
|
|
|
|
loop waitre2
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
retwm:
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov [DONT_DRAW_MOUSE],byte 0 ; mouse pointer
|
|
|
|
|
mov [MOUSE_BACKGROUND],byte 0 ; no mouse under
|
|
|
|
|
mov [MOUSE_DOWN],byte 0 ; react to mouse up/down
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2009-02-20 13:01:31 +01:00
|
|
|
|
; mov esi,window_moved
|
|
|
|
|
; call sys_msg_board_str
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
popad
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uglobal
|
2007-03-12 22:54:24 +01:00
|
|
|
|
add_window_data dd 0
|
2005-10-06 19:56:22 +02:00
|
|
|
|
do_resize_from_corner db 0x0
|
2007-03-12 22:54:24 +01:00
|
|
|
|
reposition db 0x0
|
|
|
|
|
latest_window_touch dd 0x0
|
2005-10-06 19:56:22 +02:00
|
|
|
|
latest_window_touch_delta dd 0x0
|
|
|
|
|
|
|
|
|
|
do_resize db 0x0
|
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
oldc dd 0x0,0x0,0x0,0x0
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
dlx dd 0x0
|
|
|
|
|
dly dd 0x0
|
|
|
|
|
dlxe dd 0x0
|
|
|
|
|
dlye dd 0x0
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
npx dd 0x0
|
|
|
|
|
npy dd 0x0
|
|
|
|
|
npxe dd 0x0
|
|
|
|
|
npye dd 0x0
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mpx dd 0x0
|
|
|
|
|
mpy dd 0x0
|
2005-10-06 19:56:22 +02:00
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; draw negative window frames
|
2006-10-18 13:29:50 +02:00
|
|
|
|
drawwindowframes2:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
|
|
|
|
cli
|
|
|
|
|
jmp drawwindowframes.do
|
2005-10-06 19:56:22 +02:00
|
|
|
|
drawwindowframes:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
pushad
|
|
|
|
|
cli
|
|
|
|
|
|
|
|
|
|
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
|
|
|
|
|
jnz .ret
|
|
|
|
|
mov eax, [npx]
|
|
|
|
|
cmp eax, [edi+WDATA.box.left]
|
|
|
|
|
jnz .nowndframe
|
|
|
|
|
mov eax, [npxe]
|
|
|
|
|
cmp eax, [edi+WDATA.box.width]
|
|
|
|
|
jnz .nowndframe
|
|
|
|
|
mov eax, [npy]
|
|
|
|
|
cmp eax, [edi+WDATA.box.top]
|
|
|
|
|
jnz .nowndframe
|
|
|
|
|
mov eax, [npye]
|
|
|
|
|
cmp eax, [edi+WDATA.box.height]
|
|
|
|
|
jnz .nowndframe
|
|
|
|
|
xor [edi+WDATA.fl_wdrawn], 2
|
|
|
|
|
test [edi+WDATA.fl_wdrawn], 4
|
|
|
|
|
jnz .ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-10-18 13:29:50 +02:00
|
|
|
|
.nowndframe:
|
|
|
|
|
.do:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
mov edi, 1
|
|
|
|
|
mov ecx, 0x01000000
|
|
|
|
|
mov eax,[npx]
|
|
|
|
|
shl eax,16
|
|
|
|
|
add eax,[npx]
|
|
|
|
|
add eax,[npxe]
|
|
|
|
|
add eax,65536*1-1
|
|
|
|
|
mov ebx,[npy]
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,[npy]
|
|
|
|
|
call [draw_line]
|
|
|
|
|
|
|
|
|
|
mov eax,[npx]
|
|
|
|
|
shl eax,16
|
|
|
|
|
add eax,[npx]
|
|
|
|
|
add eax,[npxe]
|
|
|
|
|
add eax,65536*1-1
|
|
|
|
|
mov ebx,[npy]
|
|
|
|
|
add ebx,[npye]
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,[npy]
|
|
|
|
|
add ebx,[npye]
|
|
|
|
|
call [draw_line]
|
|
|
|
|
|
|
|
|
|
mov eax,[npx]
|
|
|
|
|
shl eax,16
|
|
|
|
|
add eax,[npx]
|
|
|
|
|
mov ebx,[npy]
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,[npy]
|
|
|
|
|
add ebx,[npye]
|
|
|
|
|
call [draw_line]
|
|
|
|
|
|
|
|
|
|
mov eax,[npx]
|
|
|
|
|
add eax,[npxe]
|
|
|
|
|
shl eax,16
|
|
|
|
|
add eax,[npx]
|
|
|
|
|
add eax,[npxe]
|
|
|
|
|
mov ebx,[npy]
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,[npy]
|
|
|
|
|
add ebx,[npye]
|
|
|
|
|
call [draw_line]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-10-18 13:29:50 +02:00
|
|
|
|
.ret:
|
2007-03-12 22:54:24 +01:00
|
|
|
|
sti
|
|
|
|
|
popad
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
random_shaped_window:
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; eax = 0 giving address of data area
|
|
|
|
|
; ebx address
|
2006-08-06 12:29:45 +02:00
|
|
|
|
; eax = 1 shape area scale
|
2005-10-06 19:56:22 +02:00
|
|
|
|
; ebx 2^ebx scale
|
|
|
|
|
|
|
|
|
|
test eax, eax
|
|
|
|
|
jne rsw_no_address
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov eax,[current_slot]
|
|
|
|
|
mov [eax+APPDATA.wnd_shape],ebx
|
|
|
|
|
rsw_no_address:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
cmp eax,1
|
|
|
|
|
jne rsw_no_scale
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov eax,[current_slot]
|
|
|
|
|
mov byte [eax+APPDATA.wnd_shape_scale], bl
|
|
|
|
|
rsw_no_scale:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|