*Real* fix for VRR problem

Fixes to workarea management code
Removed check_window_move_request from osloop, now windows are moved immediately
New skins format - all skin data in in separate file now (*.skn)
  Changed skinned window drawing accordingly


git-svn-id: svn://kolibrios.org@49 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Mihail Semenyako (mike.dld) 2006-02-18 10:41:47 +00:00
parent 39feda9fd3
commit 876c1844a4
7 changed files with 419 additions and 471 deletions

View File

@ -1,244 +1,180 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; WINDOW SKIN for MenuetOS ;;
;; ;;
;; entryway@bkg.lt ;;
;; ;;
;; Bugfixes & upgrades by ;;
;; Samuel Rodriguez Perez ;;
;; Xeoda@ciberirmandade.org ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include "skindata.inc" include "skindata.inc"
virtual at 0 skin_data = 0x00778000
bmp_header:
.type rw 1 ; "BM" signature
.filesize rd 1 ; size of the file
.reserved rd 1 ; zero
.offbits rd 1 ; pointer to image data
;----------------
.headsize rd 1 ; usually 40 bytes for image header
.width rd 1
.height rd 1
.planes rw 1 ; usually 1
.bitcount rw 1 ; currently 24 bits/pixel (0x18)
.compress rd 1 ; zero
.sizeimage rd 1 ; x*y*(bitcount/8)
.unused rd 4 ; these bits aren't used by MeOS
bmp_data:
end virtual
virtual at 0x778000 load_skin_file:
_bmp_bpl dd ? ; bytes per line ; eax = filename
_bmp_dpl dd ? ; dwords per line ; edx = destination
_bmp_zb dd ? ; bytes filled by zeroes at the end of a scanline mov ebx,1
align 32 or ecx,-1
raw_data: mov esi,12
end virtual
bmp2raw:
; esi = to bmp data (source)
; edi = to raw data (destination)
cmp [esi+bmp_header.type],'BM' ; check if bmp file is really loaded
jne .finish
mov edx,esi
mov eax,[edx+bmp_header.width]
imul eax,3
push eax
test eax,11b
jz @f
add eax,4
@@:
shr eax,2
mov [_bmp_dpl],eax
shl eax,2
mov [_bmp_bpl],eax
pop ebx
sub eax,ebx
mov [_bmp_zb],eax
add esi,bmp_data
mov eax,[_bmp_bpl]
imul eax,[edx+bmp_header.height]
add esi,eax
mov ebx,[edx+bmp_header.height] ; ebx = y
cld
.y_begin:
sub esi,[_bmp_bpl]
push esi
mov ecx,[_bmp_dpl]
rep movsd
pop esi
sub edi,[_bmp_zb]
dec ebx
jne .y_begin
.finish:
ret
; BMP support by Ivan Poddubny
; 1) load LEFT.BMP
; a) _skinleftw = bmp_width
; b) _skinleft = 0
; c) _refleft = 0x778000
; d) convert
; 2) load BASE.BMP
; a) _skinbasew = bmp_width
; b) _skinbase = _skinleftw
; c) _refbase = _refleft+sizeof(left_raw_converted)
; d) convert
; 3) load OPER.BMP
; a) _skinoper = minus width from bmp file
; b) _skinoperw = width from bmp file
; c) _refoper = _refbase+sizeof(oper_raw_converted)
; d) convert
; 4) set height
load_bmp_file:
; eax = pointer to filename
mov ebx, 1
or ecx, -1
mov edx, 0x90000
mov esi, 12
call fileread call fileread
ret ret
struct SKIN_HEADER
.ident dd ?
.version dd ?
.params dd ?
.buttons dd ?
.bitmaps dd ?
ends
load_default_skin: struct SKIN_PARAMS
pushad .skin_height dd ?
mov eax, _fileleft .margin.right dw ?
call load_bmp_file .margin.left dw ?
mov eax, [0x90000+bmp_header.width] .margin.bottom dw ?
mov [_skinleftw], eax .margin.top dw ?
mov [_skinleft], 0 .colors.inner dd ?
mov edi, raw_data .colors.outer dd ?
mov [_refleft], edi .colors.frame dd ?
mov esi, 0x90000 .colors_1.inner dd ?
call bmp2raw .colors_1.outer dd ?
mov eax, [_bmp_bpl] .colors_1.frame dd ?
imul eax, [0x90000+bmp_header.height] .dtp.size dd ?
push eax .dtp.data db 40 dup (?)
ends
mov eax, _filebase struct SKIN_BUTTONS
call load_bmp_file .type dd ?
mov eax, [0x90000+bmp_header.width] .pos:
mov [_skinbasew], eax .left dw ?
mov eax, [_skinleftw] .top dw ?
mov [_skinbase], eax .size:
pop eax .width dw ?
add eax, [_refleft] .height dw ?
; align to 32-byte boundary ends
test eax, 11111b
jz @f
shr eax, 5
inc eax
shl eax, 5
@@:
; save base address
mov [_refbase], eax
; convert
mov edi, eax
mov esi, 0x90000
call bmp2raw
mov eax, [_bmp_bpl]
imul eax, [0x90000+bmp_header.height]
push eax
mov eax, _fileoper struct SKIN_BITMAPS
call load_bmp_file .kind dw ?
mov eax, [0x90000+bmp_header.width] .type dw ?
mov [_skinoperw], eax .data dd ?
neg eax ends
mov [_skinoper], eax
pop eax
add eax, [_refbase]
; align to 32-byte boundary
test eax, 11111b
jz @f
shr eax, 5
inc eax
shl eax, 5
@@:
mov [_refoper], eax
mov edi, eax
mov esi, 0x90000
call bmp2raw
mov eax, [0x90000+bmp_header.height]
mov [_skinh], eax
popad
ret load_skin:
pushad
mov eax,_skin_file
mov edx,skin_data
call load_skin_file
call parse_skin_data
popad
ret
load_default_skin_1: parse_skin_data:
pushad mov ebp,skin_data
mov eax, _fileleft_1 cmp [ebp+SKIN_HEADER.ident],'SKIN'
call load_bmp_file jne .exit
mov eax, [0x90000+bmp_header.width]
mov [_skinleftw], eax
mov [_skinleft_1], 0
mov edi, raw_data+1000h
mov [_refleft_1], edi
mov esi, 0x90000
call bmp2raw
mov eax, [_bmp_bpl]
imul eax, [0x90000+bmp_header.height]
push eax
mov eax, _filebase_1 mov ebx,[ebp+SKIN_HEADER.params]
call load_bmp_file add ebx,skin_data
mov eax, [0x90000+bmp_header.width] mov eax,[ebx+SKIN_PARAMS.skin_height]
mov [_skinbasew], eax mov [_skinh],eax
mov eax, [_skinleftw] mov eax,[ebx+SKIN_PARAMS.colors.inner]
mov [_skinbase], eax mov [skin_active.colors.inner],eax
pop eax mov eax,[ebx+SKIN_PARAMS.colors.outer]
add eax, [_refleft_1] mov [skin_active.colors.outer],eax
; align to 32-byte boundary mov eax,[ebx+SKIN_PARAMS.colors.frame]
test eax, 11111b mov [skin_active.colors.frame],eax
jz @f mov eax,[ebx+SKIN_PARAMS.colors_1.inner]
shr eax, 5 mov [skin_inactive.colors.inner],eax
inc eax mov eax,[ebx+SKIN_PARAMS.colors_1.outer]
shl eax, 5 mov [skin_inactive.colors.outer],eax
@@: mov eax,[ebx+SKIN_PARAMS.colors_1.frame]
; save base address mov [skin_inactive.colors.frame],eax
mov [_refbase_1], eax lea esi,[ebx+SKIN_PARAMS.dtp.data]
; convert mov edi,common_colours
mov edi, eax mov ecx,[ebx+SKIN_PARAMS.dtp.size]
mov esi, 0x90000 and ecx,127
call bmp2raw cld
mov eax, [_bmp_bpl] rep movsb
imul eax, [0x90000+bmp_header.height] mov eax,dword[ebx+SKIN_PARAMS.margin.left]
push eax mov dword[_skinmargins+0],eax
mov eax,dword[ebx+SKIN_PARAMS.margin.top]
mov dword[_skinmargins+4],eax
mov eax, _fileoper_1 mov ebx,[ebp+SKIN_HEADER.bitmaps]
call load_bmp_file add ebx,skin_data
mov eax, [0x90000+bmp_header.width] .lp1: cmp dword[ebx],0
mov [_skinoperw], eax je .end_bitmaps
neg eax movzx eax,[ebx+SKIN_BITMAPS.kind]
mov [_skinoper], eax movzx ecx,[ebx+SKIN_BITMAPS.type]
pop eax dec eax
add eax, [_refbase_1] jnz .not_left
; align to 32-byte boundary xor eax,eax
test eax, 11111b mov edx,skin_active.left.data
jz @f or ecx,ecx
shr eax, 5 jnz @f
inc eax mov edx,skin_inactive.left.data
shl eax, 5 @@: jmp .next_bitmap
@@: .not_left:
mov [_refoper_1], eax dec eax
mov edi, eax jnz .not_oper
mov esi, 0x90000 mov esi,[ebx+SKIN_BITMAPS.data]
call bmp2raw add esi,skin_data
mov eax, [0x90000+bmp_header.height] mov eax,[esi+0]
mov [_skinh], eax neg eax
popad mov edx,skin_active.oper.data
ret or ecx,ecx
jnz @f
mov edx,skin_inactive.oper.data
@@: jmp .next_bitmap
.not_oper:
dec eax
jnz .not_base
mov eax,[skin_active.left.width]
mov edx,skin_active.base.data
or ecx,ecx
jnz @f
mov eax,[skin_inactive.left.width]
mov edx,skin_inactive.base.data
@@: jmp .next_bitmap
.not_base:
add ebx,8
jmp .lp1
.next_bitmap:
mov ecx,[ebx+SKIN_BITMAPS.data]
add ecx,skin_data
mov [edx+4],eax
mov eax,[ecx+0]
mov [edx+8],eax
add ecx,8
mov [edx+0],ecx
add ebx,8
jmp .lp1
.end_bitmaps:
mov ebx,[ebp+SKIN_HEADER.buttons]
add ebx,skin_data
.lp2: cmp dword[ebx],0
je .end_buttons
mov eax,[ebx+SKIN_BUTTONS.type]
dec eax
jnz .not_close
mov edx,skin_btn_close
jmp .next_button
.not_close:
dec eax
jnz .not_minimize
mov edx,skin_btn_minimize
jmp .next_button
.not_minimize:
add ebx,12
jmp .lp2
.next_button:
movsx eax,[ebx+SKIN_BUTTONS.left]
mov [edx+SKIN_BUTTON.left],eax
movsx eax,[ebx+SKIN_BUTTONS.top]
mov [edx+SKIN_BUTTON.top],eax
movsx eax,[ebx+SKIN_BUTTONS.width]
mov [edx+SKIN_BUTTON.width],eax
movsx eax,[ebx+SKIN_BUTTONS.height]
mov [edx+SKIN_BUTTON.height],eax
add ebx,12
jmp .lp2
.end_buttons:
.exit:
ret
drawwindow_IV: drawwindow_IV:
;param1 - aw_yes ;param1 - aw_yes
@ -249,6 +185,12 @@ drawwindow_IV:
mov edi,[esp] ; RECTANGLE mov edi,[esp] ; RECTANGLE
mov ebp,skin_active
cmp byte [esp+32+4+4],0
jne @f
mov ebp,skin_inactive
@@:
mov eax,[edi+0] mov eax,[edi+0]
shl eax,16 shl eax,16
mov ax,[edi+0] mov ax,[edi+0]
@ -260,7 +202,7 @@ drawwindow_IV:
; mov esi,[edi+24] ; mov esi,[edi+24]
; shr esi,1 ; shr esi,1
; and esi,0x007f7f7f ; and esi,0x007f7f7f
mov esi,[_coloroutborder] mov esi,[ebp+SKIN_DATA.colors.outer]
call draw_rectangle call draw_rectangle
mov ecx,3 mov ecx,3
_dw3l: _dw3l:
@ -270,11 +212,11 @@ drawwindow_IV:
js no_skin_add_button js no_skin_add_button
test bx,bx test bx,bx
js no_skin_add_button js no_skin_add_button
mov esi,[_colorframe] ;[edi+24] mov esi,[ebp+SKIN_DATA.colors.frame] ;[edi+24]
call draw_rectangle call draw_rectangle
dec ecx dec ecx
jnz _dw3l jnz _dw3l
mov esi,[_colorborder] mov esi,[ebp+SKIN_DATA.colors.inner]
add eax,1*65536-1 add eax,1*65536-1
add ebx,1*65536-1 add ebx,1*65536-1
test ax,ax test ax,ax
@ -285,46 +227,37 @@ drawwindow_IV:
mov esi,[esp] mov esi,[esp]
mov eax,[esi+8] ; window width mov eax,[esi+8] ; window width
mov edx,[_skinleft] mov edx,[ebp+SKIN_DATA.left.left]
shl edx,16 shl edx,16
mov ecx,[_skinleftw] mov ecx,[ebp+SKIN_DATA.left.width]
shl ecx,16 shl ecx,16
add ecx,[_skinh] add ecx,[_skinh]
cmp byte [esp+32+4+4],1 mov ebx, [ebp+SKIN_DATA.left.data]
mov ebx, [_refleft_1]
jne @f
mov ebx,[_refleft]
@@:
call sys_putimage call sys_putimage
mov esi,[esp] mov esi,[esp]
mov eax,[esi+8] mov eax,[esi+8]
sub eax,[_skinleftw] sub eax,[ebp+SKIN_DATA.left.width]
sub eax,[_skinoperw] sub eax,[ebp+SKIN_DATA.oper.width]
cmp eax,[_skinbase] cmp eax,[ebp+SKIN_DATA.base.left]
jng non_base jng non_base
xor edx,edx xor edx,edx
mov ebx,[_skinbasew] mov ebx,[ebp+SKIN_DATA.base.width]
div ebx div ebx
inc eax inc eax
cmp byte [esp+32+4+4], 1 mov ebx,[ebp+SKIN_DATA.base.data]
mov ebx,[_refbase_1] mov ecx,[ebp+SKIN_DATA.base.width]
jne @f
mov ebx,[_refbase]
@@:
mov ecx,[_skinbasew]
shl ecx,16 shl ecx,16
add ecx,[_skinh] add ecx,[_skinh]
mov edx,[_skinbase] mov edx,[ebp+SKIN_DATA.base.left]
sub edx,[_skinbasew] sub edx,[ebp+SKIN_DATA.base.width]
shl edx,16 shl edx,16
baseskinloop: baseskinloop:
shr edx,16 shr edx,16
add edx,[_skinbasew] add edx,[ebp+SKIN_DATA.base.width]
shl edx,16 shl edx,16
push eax ebx ecx edx push eax ebx ecx edx
@ -337,16 +270,12 @@ drawwindow_IV:
mov esi,[esp] mov esi,[esp]
mov edx,[esi+8] mov edx,[esi+8]
sub edx,[_skinoperw] sub edx,[ebp+SKIN_DATA.oper.width]
inc edx inc edx
shl edx,16 shl edx,16
cmp byte [esp+32+4+4], 1 mov ebx,[ebp+SKIN_DATA.oper.data]
mov ebx,[_refoper_1]
jne @f
mov ebx,[_refoper]
@@:
mov ecx,[_skinoperw] mov ecx,[ebp+SKIN_DATA.oper.width]
shl ecx,16 shl ecx,16
add ecx,[_skinh] add ecx,[_skinh]
call sys_putimage call sys_putimage
@ -369,6 +298,7 @@ drawwindow_IV:
call [drawbar] call [drawbar]
_noinside2: _noinside2:
;* close button
mov edi,[0xfe88] mov edi,[0xfe88]
movzx eax,word [edi] movzx eax,word [edi]
cmp eax,1000 cmp eax,1000
@ -386,23 +316,25 @@ drawwindow_IV:
mov bx,1 mov bx,1
mov [eax],bx mov [eax],bx
add eax,2 ; x start add eax,2 ; x start
xor ebx,ebx
cmp [skin_btn_close.left],0
jge _bCx_at_right
mov ebx,[esp] mov ebx,[esp]
mov ebx,[ebx+8] mov ebx,[ebx+8]
cmp [_buttonCx],0 inc ebx
jg _bCx_at_right
mov ebx,[_buttonCw] ; ebx will be 0 in next instruction
_bCx_at_right: _bCx_at_right:
sub ebx,[_buttonCw] add ebx,[skin_btn_close.left]
sub ebx,[_buttonCx]
mov [eax],bx mov [eax],bx
add eax,2 ; x size add eax,2 ; x size
mov ebx,[_buttonCw] mov ebx,[skin_btn_close.width]
dec ebx
mov [eax],bx mov [eax],bx
add eax,2 ; y start add eax,2 ; y start
mov ebx,[_buttonCy] mov ebx,[skin_btn_close.top]
mov [eax],bx mov [eax],bx
add eax,2 ; y size add eax,2 ; y size
mov ebx,[_buttonCh] mov ebx,[skin_btn_close.height]
dec ebx
mov [eax],bx mov [eax],bx
;* minimize button ;* minimize button
@ -423,25 +355,26 @@ drawwindow_IV:
mov bx,65535 ;999 mov bx,65535 ;999
mov [eax],bx mov [eax],bx
add eax,2 ; x start add eax,2 ; x start
xor ebx,ebx
cmp [skin_btn_minimize.left],0
jge _bMx_at_right
mov ebx,[esp] mov ebx,[esp]
mov ebx,[ebx+8] mov ebx,[ebx+8]
cmp [_buttonMx],0 inc ebx
jg _bMx_at_right
mov ebx,[_buttonMw] ; ebx will be 0 in next instruction
_bMx_at_right: _bMx_at_right:
sub ebx,[_buttonMw] add ebx,[skin_btn_minimize.left]
sub ebx,[_buttonMx]
mov [eax],bx mov [eax],bx
add eax,2 ; x size add eax,2 ; x size
mov ebx,[_buttonMw] mov ebx,[skin_btn_minimize.width]
dec ebx
mov [eax],bx mov [eax],bx
add eax,2 ; y start add eax,2 ; y start
mov ebx,[_buttonMy] mov ebx,[skin_btn_minimize.top]
mov [eax],bx mov [eax],bx
add eax,2 ; y size add eax,2 ; y size
mov ebx,[_buttonMh] mov ebx,[skin_btn_minimize.height]
dec ebx
mov [eax],bx mov [eax],bx
;* minimize button
no_skin_add_button: no_skin_add_button:
@ -450,4 +383,3 @@ drawwindow_IV:
ret 4 ret 4

View File

@ -1,51 +1,47 @@
; ;
; WINDOW SKIN for MenuetOS ; WINDOW SKIN DATA
; ivan-yar@bk.ru
; ;
iglobal iglobal
_skinh dd 22 _skin_file_default db 'DEFAULT SKN',0
_skinleftw dd 10
_skinbase dd 10
_skinbasew dd 8
_skinoper dd -39 ;-21
_skinoperw dd 39 ;21
_buttonCx dd 5 ; close
_buttonCy dd 2
_buttonCw dd 15
_buttonCh dd 17
_buttonMx dd 23 ; minimize
_buttonMy dd 2
_buttonMw dd 15
_buttonMh dd 17
_colorframe dd 0x3a6cb6 ;0x586E93
_colorborder dd 0x00081D
_coloroutborder dd 0x00081D
_fileleft db 'LEFT.BMP '
_filebase db 'BASE.BMP '
_fileoper db 'OPER.BMP '
_fileleft_1 db 'LEFT_1.BMP '
_filebase_1 db 'BASE_1.BMP '
_fileoper_1 db 'OPER_1.BMP '
endg endg
struct SKIN_DATA
.colors.inner dd ?
.colors.outer dd ?
.colors.frame dd ?
.left.data dd ?
.left.left dd ?
.left.width dd ?
.oper.data dd ?
.oper.left dd ?
.oper.width dd ?
.base.data dd ?
.base.left dd ?
.base.width dd ?
ends
struct SKIN_BUTTON
.left dd ?
.top dd ?
.width dd ?
.height dd ?
ends
uglobal uglobal
_refoper dd 0
_refbase dd 0
_refleft dd 0
_skinleft dd 0
; _skinwinw dd 0
_refoper_1 dd 0
_refbase_1 dd 0
_refleft_1 dd 0
_skinleft_1 dd 0
endg
align 4
_skinh dd ?
_skinmargins rw 4
skin_btn_close SKIN_BUTTON
skin_btn_minimize SKIN_BUTTON
skin_active SKIN_DATA
skin_inactive SKIN_DATA
_skin_file rb 256
endg

View File

@ -345,12 +345,6 @@ display_settings:
cmp eax,5 ; get screen workarea cmp eax,5 ; get screen workarea
jne no_get_workarea jne no_get_workarea
popad popad
mov eax,[0xfe00]
mov [screen_workarea.right],eax
mov eax,[0xfe04]
mov [screen_workarea.bottom],eax
mov eax,[screen_workarea.left-2] mov eax,[screen_workarea.left-2]
mov ax,word[screen_workarea.right] mov ax,word[screen_workarea.right]
mov [esp+36],eax mov [esp+36],eax
@ -362,32 +356,48 @@ display_settings:
cmp eax,6 ; set screen workarea cmp eax,6 ; set screen workarea
jne no_set_workarea jne no_set_workarea
movzx eax,word[esp+16+2] movsx eax,word[esp+16+2]
movzx ebx,word[esp+16] movsx ebx,word[esp+16]
cmp eax,[0xFE00]
jae .exit
cmp ebx,[0xFE00]
ja .exit
cmp eax,ebx cmp eax,ebx
jae .exit jge .lp1
or eax,eax;[0xFE00]
jl @f
mov [screen_workarea.left],eax mov [screen_workarea.left],eax
@@: cmp ebx,[0xFE00]
jg .lp1
mov [screen_workarea.right],ebx mov [screen_workarea.right],ebx
movzx eax,word[esp+24+2] .lp1: movsx eax,word[esp+24+2]
movzx ebx,word[esp+24] movsx ebx,word[esp+24]
cmp eax,[0xFE04]
jae .exit
cmp ebx,[0xFE04]
ja .exit
cmp eax,ebx cmp eax,ebx
jae .exit jge .lp2
or eax,eax;[0xFE04]
jl @f
mov [screen_workarea.top],eax mov [screen_workarea.top],eax
@@: cmp ebx,[0xFE04]
jg .lp2
mov [screen_workarea.bottom],ebx mov [screen_workarea.bottom],ebx
.lp2: call repos_windows
call calculatescreen
; jmp redraw_screen_direct
.exit:
popad
ret
no_set_workarea:
popad
ret
repos_windows:
mov ecx,[0x3004] mov ecx,[0x3004]
mov esi,0x20*2 mov esi,0x20*2
mov byte[0x0000fff0],1
dec ecx dec ecx
@@: test [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED jge @f
jz .lp1 ret
@@: mov [esi+WDATA.fl_redraw],1
test [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED
jz .lp2
mov eax,[screen_workarea.left] mov eax,[screen_workarea.left]
mov [esi+WDATA.left],eax mov [esi+WDATA.left],eax
sub eax,[screen_workarea.right] sub eax,[screen_workarea.right]
@ -402,127 +412,40 @@ display_settings:
mov [esi+WDATA.height],eax mov [esi+WDATA.height],eax
.lp1: add esi,0x20 .lp1: add esi,0x20
loop @b loop @b
call calculatescreen
jmp redraw_screen_direct
.exit:
popad
ret ret
no_set_workarea: .lp2: mov eax,[esi+WDATA.left]
add eax,[esi+WDATA.width]
popad mov ebx,[0x0000fe00]
ret ; inc ebx
cmp eax,ebx
jle .lp4
mov eax,[esi+WDATA.width]
sub eax,ebx
jle .lp3
mov [esi+WDATA.width],ebx
.lp3: sub ebx,[esi+WDATA.width]
mov [esi+WDATA.left],ebx
.lp4: mov eax,[esi+WDATA.top]
add eax,[esi+WDATA.height]
mov ebx,[0x0000fe04]
; inc ebx
cmp eax,ebx
jle .lp6
mov eax,[esi+WDATA.height]
sub eax,ebx
jle .lp5
mov [esi+WDATA.height],ebx
.lp5: sub ebx,[esi+WDATA.height]
mov [esi+WDATA.top],ebx
.lp6: add esi,0x20
loop @b
ret
uglobal uglobal
common_colours: common_colours:
times 128 db 0x0 times 128 db 0x0
endg endg
check_window_move_request:
pushad
mov edi,[window_move_pr] ; requestor process base
cmp edi,0
je window_move_return
shl edi,5
add edi,window_data
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
jnz window_move_return
push dword [edi+0] ; save old coordinates
push dword [edi+4]
push dword [edi+8]
push dword [edi+12]
mov eax,[window_move_eax]
mov ebx,[window_move_ebx]
mov ecx,[window_move_ecx]
mov edx,[window_move_edx]
cmp eax,-1 ; set new position and size
je no_x_reposition
mov [edi+0],eax
no_x_reposition:
cmp ebx,-1
je no_y_reposition
mov [edi+4],ebx
no_y_reposition:
test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
jnz no_y_resizing
cmp ecx,-1
je no_x_resizing
mov [edi+8],ecx
no_x_resizing:
cmp edx,-1
je no_y_resizing
mov [edi+12],edx
no_y_resizing:
call check_window_position
pushad ; save for window fullscreen/resize
mov esi,edi
sub edi,window_data
shr edi,5
shl edi,8
add edi,0x80000+0x90
mov ecx,4
cld
rep movsd
popad
pushad ; calculcate screen at new position
mov eax,[edi+00]
mov ebx,[edi+04]
mov ecx,[edi+8]
mov edx,[edi+12]
add ecx,eax
add edx,ebx
call calculatescreen
popad
pop edx ; calculcate screen at old position
pop ecx
pop ebx
pop eax
add ecx,eax
add edx,ebx
mov [dlx],eax ; save for drawlimits
mov [dly],ebx
mov [dlxe],ecx
mov [dlye],edx
call calculatescreen
mov [edi+31],byte 1 ; flag the process as redraw
mov eax,edi ; redraw screen at old position
xor esi,esi
call redrawscreen
mov [0xfff5],byte 0 ; mouse pointer
mov [0xfff4],byte 0 ; no mouse under
mov [0xfb44],byte 0 ; react to mouse up/down
mov ecx,10 ; wait 1/10 second
wmrl3:
call [draw_pointer]
mov eax,1
call delay_hs
loop wmrl3
mov [window_move_pr],0
window_move_return:
popad
ret

View File

@ -700,8 +700,12 @@ finit ;reset the registers, contents which are still equal RM
; LOAD DEFAULT SKIN ; LOAD DEFAULT SKIN
call load_default_skin mov esi,_skin_file_default
call load_default_skin_1 mov edi,_skin_file
movsd
movsd
movsd
call load_skin
; MTRR'S ; MTRR'S
@ -814,7 +818,7 @@ osloop:
call checkbuttons call checkbuttons
call main_loop_sys_getkey call main_loop_sys_getkey
call checkwindows call checkwindows
call check_window_move_request ; call check_window_move_request
call checkmisc call checkmisc
call checkEgaCga call checkEgaCga
call stack_handler call stack_handler
@ -2921,24 +2925,94 @@ sys_set_window:
sys_window_move: sys_window_move:
cmp [window_move_pr],0 mov edi,[0x00003000]
je mwrl1 shl edi,5
add edi,window_data
mov [esp+36],dword 1 ; return queue error test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
jnz .window_move_return
ret push dword [edi+0] ; save old coordinates
push dword [edi+4]
push dword [edi+8]
push dword [edi+12]
mwrl1: cmp eax,-1 ; set new position and size
je .no_x_reposition
mov [edi+0],eax
.no_x_reposition:
cmp ebx,-1
je .no_y_reposition
mov [edi+4],ebx
.no_y_reposition:
mov edi,[0x3000] ; requestor process base test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
mov [window_move_pr],edi jnz .no_y_resizing
mov [window_move_eax],eax cmp ecx,-1
mov [window_move_ebx],ebx je .no_x_resizing
mov [window_move_ecx],ecx mov [edi+8],ecx
mov [window_move_edx],edx .no_x_resizing:
cmp edx,-1
je .no_y_resizing
mov [edi+12],edx
.no_y_resizing:
mov [esp+36],dword 0 ; return success call check_window_position
pushad ; save for window fullscreen/resize
mov esi,edi
sub edi,window_data
shr edi,5
shl edi,8
add edi,0x80000+0x90
mov ecx,4
cld
rep movsd
popad
pushad ; calculcate screen at new position
mov eax,[edi+00]
mov ebx,[edi+04]
mov ecx,[edi+8]
mov edx,[edi+12]
add ecx,eax
add edx,ebx
call calculatescreen
popad
pop edx ; calculcate screen at old position
pop ecx
pop ebx
pop eax
add ecx,eax
add edx,ebx
mov [dlx],eax ; save for drawlimits
mov [dly],ebx
mov [dlxe],ecx
mov [dlye],edx
call calculatescreen
mov [edi+31],byte 1 ; flag the process as redraw
mov eax,edi ; redraw screen at old position
xor esi,esi
call redrawscreen
mov [0xfff5],byte 0 ; mouse pointer
mov [0xfff4],byte 0 ; no mouse under
mov [0xfb44],byte 0 ; react to mouse up/down
mov ecx,10 ; wait 1/10 second
.wmrl3:
call [draw_pointer]
mov eax,1
call delay_hs
loop .wmrl3
mov [window_move_pr],0
.window_move_return:
ret ret

Binary file not shown.

BIN
kernel/trunk/skin_v3.7z Normal file

Binary file not shown.

View File

@ -8,13 +8,36 @@
; ;
; Include in MeOS kernel and compile with FASM ; Include in MeOS kernel and compile with FASM
; ;
uglobal
old_screen_width dd ?
old_screen_height dd ?
endg
cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS
jne .no_vmode_drv_access jne .no_vmode_drv_access
pushd [0x0000fe00] [0x0000fe04]
popd [old_screen_height] [old_screen_width]
or eax,-1 ; If driver is absent then eax does not change or eax,-1 ; If driver is absent then eax does not change
call 0x760100 ; Entry point of video driver call 0x760100 ; Entry point of video driver
mov [esp+36],eax mov [esp+36],eax
mov [esp+24],ebx mov [esp+24],ebx
mov [esp+32],ecx mov [esp+32],ecx
; mov [esp+28],edx ; mov [esp+28],edx
mov eax,[old_screen_width]
mov ebx,[old_screen_height]
sub eax,[0x0000fe00]
jnz @f
sub ebx,[0x0000fe04]
jz .resolution_wasnt_changed
jmp .lp1
@@: sub ebx,[0x0000fe04]
.lp1: sub [screen_workarea.right],eax
sub [screen_workarea.bottom],ebx
call repos_windows
call calculatescreen
.resolution_wasnt_changed:
ret ret
.no_vmode_drv_access: .no_vmode_drv_access: