From 876c1844a40438eb19d6cff4ee87bd37e18fabed Mon Sep 17 00:00:00 2001 From: "Mihail Semenyako (mike.dld)" Date: Sat, 18 Feb 2006 10:41:47 +0000 Subject: [PATCH] *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 --- kernel/trunk/gui/skincode.inc | 486 +++++++++++++++------------------- kernel/trunk/gui/skindata.inc | 82 +++--- kernel/trunk/gui/window.inc | 195 +++++--------- kernel/trunk/kernel.asm | 104 ++++++-- kernel/trunk/scin_v2.7z | Bin 1118 -> 0 bytes kernel/trunk/skin_v3.7z | Bin 0 -> 3402 bytes kernel/trunk/vmodeint.inc | 23 ++ 7 files changed, 419 insertions(+), 471 deletions(-) delete mode 100644 kernel/trunk/scin_v2.7z create mode 100644 kernel/trunk/skin_v3.7z diff --git a/kernel/trunk/gui/skincode.inc b/kernel/trunk/gui/skincode.inc index 50bf4be0c6..35af512096 100644 --- a/kernel/trunk/gui/skincode.inc +++ b/kernel/trunk/gui/skincode.inc @@ -1,244 +1,180 @@ - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; ;; -;; WINDOW SKIN for MenuetOS ;; -;; ;; -;; entryway@bkg.lt ;; -;; ;; -;; Bugfixes & upgrades by ;; -;; Samuel Rodriguez Perez ;; -;; Xeoda@ciberirmandade.org ;; -;; ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - - include "skindata.inc" -virtual at 0 - 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 +skin_data = 0x00778000 -virtual at 0x778000 - _bmp_bpl dd ? ; bytes per line - _bmp_dpl dd ? ; dwords per line - _bmp_zb dd ? ; bytes filled by zeroes at the end of a scanline - align 32 - raw_data: -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 +load_skin_file: +; eax = filename +; edx = destination + mov ebx,1 + or ecx,-1 + mov esi,12 call fileread ret +struct SKIN_HEADER + .ident dd ? + .version dd ? + .params dd ? + .buttons dd ? + .bitmaps dd ? +ends -load_default_skin: - pushad - mov eax, _fileleft - call load_bmp_file - mov eax, [0x90000+bmp_header.width] - mov [_skinleftw], eax - mov [_skinleft], 0 - mov edi, raw_data - mov [_refleft], edi - mov esi, 0x90000 - call bmp2raw - mov eax, [_bmp_bpl] - imul eax, [0x90000+bmp_header.height] - push eax +struct SKIN_PARAMS + .skin_height dd ? + .margin.right dw ? + .margin.left dw ? + .margin.bottom dw ? + .margin.top dw ? + .colors.inner dd ? + .colors.outer dd ? + .colors.frame dd ? + .colors_1.inner dd ? + .colors_1.outer dd ? + .colors_1.frame dd ? + .dtp.size dd ? + .dtp.data db 40 dup (?) +ends - mov eax, _filebase - call load_bmp_file - mov eax, [0x90000+bmp_header.width] - mov [_skinbasew], eax - mov eax, [_skinleftw] - mov [_skinbase], eax - pop eax - add eax, [_refleft] - ; align to 32-byte boundary - 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 +struct SKIN_BUTTONS + .type dd ? + .pos: + .left dw ? + .top dw ? + .size: + .width dw ? + .height dw ? +ends - mov eax, _fileoper - call load_bmp_file - mov eax, [0x90000+bmp_header.width] - mov [_skinoperw], eax - neg eax - 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 +struct SKIN_BITMAPS + .kind dw ? + .type dw ? + .data dd ? +ends - 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: - pushad - mov eax, _fileleft_1 - call load_bmp_file - 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 +parse_skin_data: + mov ebp,skin_data + cmp [ebp+SKIN_HEADER.ident],'SKIN' + jne .exit - mov eax, _filebase_1 - call load_bmp_file - mov eax, [0x90000+bmp_header.width] - mov [_skinbasew], eax - mov eax, [_skinleftw] - mov [_skinbase], eax - pop eax - add eax, [_refleft_1] - ; align to 32-byte boundary - test eax, 11111b - jz @f - shr eax, 5 - inc eax - shl eax, 5 - @@: - ; save base address - mov [_refbase_1], eax - ; convert - mov edi, eax - mov esi, 0x90000 - call bmp2raw - mov eax, [_bmp_bpl] - imul eax, [0x90000+bmp_header.height] - push eax + mov ebx,[ebp+SKIN_HEADER.params] + add ebx,skin_data + mov eax,[ebx+SKIN_PARAMS.skin_height] + mov [_skinh],eax + mov eax,[ebx+SKIN_PARAMS.colors.inner] + mov [skin_active.colors.inner],eax + mov eax,[ebx+SKIN_PARAMS.colors.outer] + mov [skin_active.colors.outer],eax + mov eax,[ebx+SKIN_PARAMS.colors.frame] + mov [skin_active.colors.frame],eax + mov eax,[ebx+SKIN_PARAMS.colors_1.inner] + mov [skin_inactive.colors.inner],eax + mov eax,[ebx+SKIN_PARAMS.colors_1.outer] + mov [skin_inactive.colors.outer],eax + mov eax,[ebx+SKIN_PARAMS.colors_1.frame] + mov [skin_inactive.colors.frame],eax + lea esi,[ebx+SKIN_PARAMS.dtp.data] + mov edi,common_colours + mov ecx,[ebx+SKIN_PARAMS.dtp.size] + and ecx,127 + cld + rep movsb + mov eax,dword[ebx+SKIN_PARAMS.margin.left] + mov dword[_skinmargins+0],eax + mov eax,dword[ebx+SKIN_PARAMS.margin.top] + mov dword[_skinmargins+4],eax - mov eax, _fileoper_1 - call load_bmp_file - mov eax, [0x90000+bmp_header.width] - mov [_skinoperw], eax - neg eax - mov [_skinoper], eax - pop eax - add eax, [_refbase_1] - ; align to 32-byte boundary - test eax, 11111b - jz @f - shr eax, 5 - inc eax - shl eax, 5 - @@: - mov [_refoper_1], eax - mov edi, eax - mov esi, 0x90000 - call bmp2raw - mov eax, [0x90000+bmp_header.height] - mov [_skinh], eax - popad - ret + mov ebx,[ebp+SKIN_HEADER.bitmaps] + add ebx,skin_data + .lp1: cmp dword[ebx],0 + je .end_bitmaps + movzx eax,[ebx+SKIN_BITMAPS.kind] + movzx ecx,[ebx+SKIN_BITMAPS.type] + dec eax + jnz .not_left + xor eax,eax + mov edx,skin_active.left.data + or ecx,ecx + jnz @f + mov edx,skin_inactive.left.data + @@: jmp .next_bitmap + .not_left: + dec eax + jnz .not_oper + mov esi,[ebx+SKIN_BITMAPS.data] + add esi,skin_data + mov eax,[esi+0] + neg eax + mov edx,skin_active.oper.data + 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: ;param1 - aw_yes @@ -249,6 +185,12 @@ drawwindow_IV: 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] shl eax,16 mov ax,[edi+0] @@ -260,7 +202,7 @@ drawwindow_IV: ; mov esi,[edi+24] ; shr esi,1 ; and esi,0x007f7f7f - mov esi,[_coloroutborder] + mov esi,[ebp+SKIN_DATA.colors.outer] call draw_rectangle mov ecx,3 _dw3l: @@ -270,11 +212,11 @@ drawwindow_IV: js no_skin_add_button test bx,bx js no_skin_add_button - mov esi,[_colorframe] ;[edi+24] + mov esi,[ebp+SKIN_DATA.colors.frame] ;[edi+24] call draw_rectangle dec ecx jnz _dw3l - mov esi,[_colorborder] + mov esi,[ebp+SKIN_DATA.colors.inner] add eax,1*65536-1 add ebx,1*65536-1 test ax,ax @@ -285,46 +227,37 @@ drawwindow_IV: mov esi,[esp] mov eax,[esi+8] ; window width - mov edx,[_skinleft] + mov edx,[ebp+SKIN_DATA.left.left] shl edx,16 - mov ecx,[_skinleftw] + mov ecx,[ebp+SKIN_DATA.left.width] shl ecx,16 add ecx,[_skinh] - cmp byte [esp+32+4+4],1 - mov ebx, [_refleft_1] - jne @f - mov ebx,[_refleft] - @@: + mov ebx, [ebp+SKIN_DATA.left.data] call sys_putimage mov esi,[esp] mov eax,[esi+8] - sub eax,[_skinleftw] - sub eax,[_skinoperw] - cmp eax,[_skinbase] + sub eax,[ebp+SKIN_DATA.left.width] + sub eax,[ebp+SKIN_DATA.oper.width] + cmp eax,[ebp+SKIN_DATA.base.left] jng non_base xor edx,edx - mov ebx,[_skinbasew] + mov ebx,[ebp+SKIN_DATA.base.width] div ebx inc eax - cmp byte [esp+32+4+4], 1 - mov ebx,[_refbase_1] - jne @f - mov ebx,[_refbase] - @@: - - mov ecx,[_skinbasew] + mov ebx,[ebp+SKIN_DATA.base.data] + mov ecx,[ebp+SKIN_DATA.base.width] shl ecx,16 add ecx,[_skinh] - mov edx,[_skinbase] - sub edx,[_skinbasew] + mov edx,[ebp+SKIN_DATA.base.left] + sub edx,[ebp+SKIN_DATA.base.width] shl edx,16 baseskinloop: shr edx,16 - add edx,[_skinbasew] + add edx,[ebp+SKIN_DATA.base.width] shl edx,16 push eax ebx ecx edx @@ -337,16 +270,12 @@ drawwindow_IV: mov esi,[esp] mov edx,[esi+8] - sub edx,[_skinoperw] + sub edx,[ebp+SKIN_DATA.oper.width] inc edx shl edx,16 - cmp byte [esp+32+4+4], 1 - mov ebx,[_refoper_1] - jne @f - mov ebx,[_refoper] - @@: + mov ebx,[ebp+SKIN_DATA.oper.data] - mov ecx,[_skinoperw] + mov ecx,[ebp+SKIN_DATA.oper.width] shl ecx,16 add ecx,[_skinh] call sys_putimage @@ -369,6 +298,7 @@ drawwindow_IV: call [drawbar] _noinside2: +;* close button mov edi,[0xfe88] movzx eax,word [edi] cmp eax,1000 @@ -386,23 +316,25 @@ drawwindow_IV: mov bx,1 mov [eax],bx add eax,2 ; x start + xor ebx,ebx + cmp [skin_btn_close.left],0 + jge _bCx_at_right mov ebx,[esp] mov ebx,[ebx+8] - cmp [_buttonCx],0 - jg _bCx_at_right - mov ebx,[_buttonCw] ; ebx will be 0 in next instruction + inc ebx _bCx_at_right: - sub ebx,[_buttonCw] - sub ebx,[_buttonCx] + add ebx,[skin_btn_close.left] mov [eax],bx add eax,2 ; x size - mov ebx,[_buttonCw] + mov ebx,[skin_btn_close.width] + dec ebx mov [eax],bx add eax,2 ; y start - mov ebx,[_buttonCy] + mov ebx,[skin_btn_close.top] mov [eax],bx add eax,2 ; y size - mov ebx,[_buttonCh] + mov ebx,[skin_btn_close.height] + dec ebx mov [eax],bx ;* minimize button @@ -423,25 +355,26 @@ drawwindow_IV: mov bx,65535 ;999 mov [eax],bx add eax,2 ; x start + xor ebx,ebx + cmp [skin_btn_minimize.left],0 + jge _bMx_at_right mov ebx,[esp] mov ebx,[ebx+8] - cmp [_buttonMx],0 - jg _bMx_at_right - mov ebx,[_buttonMw] ; ebx will be 0 in next instruction + inc ebx _bMx_at_right: - sub ebx,[_buttonMw] - sub ebx,[_buttonMx] + add ebx,[skin_btn_minimize.left] mov [eax],bx add eax,2 ; x size - mov ebx,[_buttonMw] + mov ebx,[skin_btn_minimize.width] + dec ebx mov [eax],bx add eax,2 ; y start - mov ebx,[_buttonMy] + mov ebx,[skin_btn_minimize.top] mov [eax],bx add eax,2 ; y size - mov ebx,[_buttonMh] + mov ebx,[skin_btn_minimize.height] + dec ebx mov [eax],bx -;* minimize button no_skin_add_button: @@ -450,4 +383,3 @@ drawwindow_IV: ret 4 - diff --git a/kernel/trunk/gui/skindata.inc b/kernel/trunk/gui/skindata.inc index 76761de8bc..3f546e1a94 100644 --- a/kernel/trunk/gui/skindata.inc +++ b/kernel/trunk/gui/skindata.inc @@ -1,51 +1,47 @@ ; -; WINDOW SKIN for MenuetOS -; ivan-yar@bk.ru +; WINDOW SKIN DATA ; iglobal - _skinh dd 22 - - _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 ' + _skin_file_default db 'DEFAULT SKN',0 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 - _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 diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index ae75484941..7db3d786f1 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -345,12 +345,6 @@ display_settings: cmp eax,5 ; get screen workarea jne no_get_workarea popad - - mov eax,[0xfe00] - mov [screen_workarea.right],eax - mov eax,[0xfe04] - mov [screen_workarea.bottom],eax - mov eax,[screen_workarea.left-2] mov ax,word[screen_workarea.right] mov [esp+36],eax @@ -362,32 +356,48 @@ display_settings: cmp eax,6 ; set screen workarea jne no_set_workarea - movzx eax,word[esp+16+2] - movzx ebx,word[esp+16] - cmp eax,[0xFE00] - jae .exit - cmp ebx,[0xFE00] - ja .exit + movsx eax,word[esp+16+2] + movsx ebx,word[esp+16] cmp eax,ebx - jae .exit + jge .lp1 + or eax,eax;[0xFE00] + jl @f mov [screen_workarea.left],eax + @@: cmp ebx,[0xFE00] + jg .lp1 mov [screen_workarea.right],ebx - movzx eax,word[esp+24+2] - movzx ebx,word[esp+24] - cmp eax,[0xFE04] - jae .exit - cmp ebx,[0xFE04] - ja .exit + .lp1: movsx eax,word[esp+24+2] + movsx ebx,word[esp+24] cmp eax,ebx - jae .exit + jge .lp2 + or eax,eax;[0xFE04] + jl @f mov [screen_workarea.top],eax + @@: cmp ebx,[0xFE04] + jg .lp2 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 esi,0x20*2 + mov byte[0x0000fff0],1 dec ecx - @@: test [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED - jz .lp1 + jge @f + ret + @@: mov [esi+WDATA.fl_redraw],1 + test [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED + jz .lp2 mov eax,[screen_workarea.left] mov [esi+WDATA.left],eax sub eax,[screen_workarea.right] @@ -402,127 +412,40 @@ display_settings: mov [esi+WDATA.height],eax .lp1: add esi,0x20 loop @b - call calculatescreen - jmp redraw_screen_direct - .exit: - popad ret - no_set_workarea: - - popad - ret + .lp2: mov eax,[esi+WDATA.left] + add eax,[esi+WDATA.width] + mov ebx,[0x0000fe00] +; 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 common_colours: times 128 db 0x0 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 - diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 1cb465c97a..1f71e3bcc4 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -700,8 +700,12 @@ finit ;reset the registers, contents which are still equal RM ; LOAD DEFAULT SKIN - call load_default_skin - call load_default_skin_1 + mov esi,_skin_file_default + mov edi,_skin_file + movsd + movsd + movsd + call load_skin ; MTRR'S @@ -814,7 +818,7 @@ osloop: call checkbuttons call main_loop_sys_getkey call checkwindows - call check_window_move_request +; call check_window_move_request call checkmisc call checkEgaCga call stack_handler @@ -2921,24 +2925,94 @@ sys_set_window: sys_window_move: - cmp [window_move_pr],0 - je mwrl1 + mov edi,[0x00003000] + 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 - mov [window_move_pr],edi + test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP + jnz .no_y_resizing - mov [window_move_eax],eax - mov [window_move_ebx],ebx - mov [window_move_ecx],ecx - mov [window_move_edx],edx + 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: - 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 diff --git a/kernel/trunk/scin_v2.7z b/kernel/trunk/scin_v2.7z deleted file mode 100644 index ff3a5dc9f0302fd8b7010724ea2051906d99d2aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1118 zcmV-k1flykdc3bE8~_4GwoEn~1ONa40000Z000000002I6|~?0ArnOwpUblstfoF5 zh}5-zf@)etV%Q?$LDFjoyJB8YhKtjWxgy=5_pe?Ge(rtbY!cNKpUbschioW@*nCha zr89^Zef<=SnXl%gB=+4w)DT)uEFT=xc8Fy1!l#L3qLfJc>#R(7|MGzq2!MbbhZVl2zb8;2O-QK>;@uHF-RGnmM61Ns%s)GtfhRp)H}032a>!O z@*}pe42MEJGZ&*jLO;>>sr?BubQt` zx?rM~NOZ?mQK{?!1&?x2 zGkGf$aAvT>A70bFGwW*xB<~c1C~8d=!=>R~0onTqnKkmcp(!GJ%OovGBE=|)5X;)Q zvv9o~9Ml#JEgV-?pDrhX)Oe`pl3?wth0d^IQKmtglf>V|j7$vO3fN@v-%)!<=AUv| z%0yRItN+WRjs@8b`?>XM{RsG4%Li7S?8~U@r$B#Onp9ncj2u4)U$#Q7M*{Cd#-hWZxjGL z#2`gYvXnt-0Z(pYAw2!6cnX2KO?Q(q26$A*F<%-)C{w?bIEkI@yy!eo zf6a7AB&O?zhy&kt+qlcCn=)qEICo^K;9FYGSMh<5!+(z)jF{DkqLYZ$s6W@ej(oyh zPjwFfJL0(hXAuAU=;9BMfK~aOoovn6cT2ml3_1_7<*CplSwRb#ln>QYC$OZdSFS~r zBHAB=Yl+r16DCfkVzu{=qu%w0X7OCD=gUS$sgc`BsjaWQi~i{(EGi_H(Z1EQAt1PY zRr+afvCfJUWx?{)7VECIB{3duf<@cNDc)}otr}%u>UJ^g>Qcu5Futwk+bh2z>ORK5 z#L7#3P~x0P=7#0TP3~kgH!)7004nA2d)p*P-==- zB-8%0elLlVzP>$6gPav098zt&`K%~VnrjYraGW8|$X9rJm6eE`51d~*grJuh&#N4H z0Cfp2>S3G92ZKm~&Ltd)yEd+0#;%#E`%Ql5;$Of}HA(_$GW(#+xC#)gdE$8U8>LHr%#7TrZ4{ximO?Jpu(2-#D@2&S98OvPVgltQxDJ@&FeG kgLMH3fTjQk3jqKDBLe{e1zi9D5C9B;6$$~gBJ{lg0O)B9LjV8( diff --git a/kernel/trunk/skin_v3.7z b/kernel/trunk/skin_v3.7z new file mode 100644 index 0000000000000000000000000000000000000000..809a5e5296983a4c5bc9563c4e3a95cd7f675e0e GIT binary patch literal 3402 zcmV-Q4Yl$&dc3bE8~_53<<9d54FCWD0000Z000000001-RqI#)G@FQx;o@Q$Zxiq} zj_gg_L6h7%5byf|I-2_jT6`tK!1;Rm_LEoUKYkVfanI?C0iwdy>SwcA9b}C4)zeNi z(+Kl_?9vg2%#;~{`(cN-y3!m$5l5%CRBU(j0aIq0N9W_^QMkr~sd~b!C4u#l`G1#$_MJa9q=7uw7BeO4hNaM8r@+j5W%V=o zms)hI;5j9MHA>h-@BNbTXSvx>;xdT0idap76JD&P@e{er$!s4troJwDvy+p++;4kB zhek0)ydL(cCR&)g9_n`@IJ5uO5*0>OqI?tZz9jC$un2-g?yMYrHk}ibqd-ftd6@PZ zpd*B!>8%PieRw3F?x#Ym!TApXFF=5)g|>Ol#GG5s)WJ~3iRD+fxz-6qhW}Jx>8-v! z0NssT(!;;deyr;ur{lPc(qjQ#fY}2VP*ZP2rME?$ASiEtD6tFmHl6PKp|SOS#eeR; zsVL24oJMlWxGHmZ!Kachm#t<#{`dips3U@gHO;inyz9eiJ4aPo0CpXo@=`Gp0qJOA zE(g<@m{|;*5vdlIoux|AEcJWThu;qzOC}R1dJP{FQw4^AI1DbQY>;)CJnk1(GjxxB zAO4ba0SR;@cNowkGKKnEpDaIbqz)`1m*n24-m2re0|+8y zM-~Vhj+1iX?f8Qbv`{5c1lrDh=rupGbq@CL_GDLU+XOcJ6L zr%N1REK*cNdt_%dbC0og`A~(RiUd0t9* zVSK~n`?lwvLry_IDvxW^lyk^F1QOu$x*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@A!DC&(j`$s||G^gN4p_fqk<4ssI-Tj0gb< gfd2po3jqKDBLe{e1zi9D5C9B;yb1wSj^?!h0EJ?H#Q*>R literal 0 HcmV?d00001 diff --git a/kernel/trunk/vmodeint.inc b/kernel/trunk/vmodeint.inc index f48b8a6c3b..fac8994785 100644 --- a/kernel/trunk/vmodeint.inc +++ b/kernel/trunk/vmodeint.inc @@ -8,13 +8,36 @@ ; ; 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 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 call 0x760100 ; Entry point of video driver mov [esp+36],eax mov [esp+24],ebx mov [esp+32],ecx ; 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 .no_vmode_drv_access: