Rev 709 | Rev 768 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 709 | Rev 753 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 709 $ |
8 | $Revision: 753 $ |
9 | 9 | ||
10 | 10 | ||
Line 177... | Line 177... | ||
177 | sub edx, ebx |
177 | sub edx, ebx |
178 | inc ecx |
178 | inc ecx |
179 | inc edx |
179 | inc edx |
Line 180... | Line 180... | ||
180 | 180 | ||
181 | ; get WinMap start |
181 | ; get WinMap start |
182 | mov edi, [ScreenWidth] ; screen_sx |
182 | mov edi, [Screen_Max_X] ; screen_sx |
183 | inc edi |
183 | inc edi |
184 | imul edi, ebx |
184 | imul edi, ebx |
185 | add edi, eax |
185 | add edi, eax |
Line 197... | Line 197... | ||
197 | dec ecx |
197 | dec ecx |
198 | jnz .new_x |
198 | jnz .new_x |
Line 199... | Line 199... | ||
199 | 199 | ||
200 | pop edx |
200 | pop edx |
201 | pop ecx |
201 | pop ecx |
202 | add edi, [ScreenWidth] |
202 | add edi, [Screen_Max_X] |
203 | inc edi |
203 | inc edi |
204 | sub edi, ecx |
204 | sub edi, ecx |
205 | dec edx |
205 | dec edx |
206 | jnz .new_y |
206 | jnz .new_y |
Line 238... | Line 238... | ||
238 | 238 | ||
Line 239... | Line 239... | ||
239 | push dword [edi+APPDATA.wnd_shape_scale] ; push scale first -> for loop |
239 | push dword [edi+APPDATA.wnd_shape_scale] ; push scale first -> for loop |
240 | 240 | ||
241 | ; get WinMap start -> ebp |
241 | ; get WinMap start -> ebp |
242 | push eax |
242 | push eax |
243 | mov eax, [ScreenWidth] ; screen_sx |
243 | mov eax, [Screen_Max_X] ; screen_sx |
244 | inc eax |
244 | inc eax |
245 | imul eax, ebx |
245 | imul eax, ebx |
246 | add eax, [esp] |
246 | add eax, [esp] |
Line 300... | Line 300... | ||
300 | inc edx |
300 | inc edx |
301 | cmp edx, [ff_xsz] |
301 | cmp edx, [ff_xsz] |
302 | jb .ff_new_x |
302 | jb .ff_new_x |
303 | sub ebp, [ff_xsz] |
303 | sub ebp, [ff_xsz] |
304 | add ebp, [ff_x] |
304 | add ebp, [ff_x] |
305 | add ebp, [ScreenWidth] ; screen.x |
305 | add ebp, [Screen_Max_X] ; screen.x |
306 | inc ebp |
306 | inc ebp |
307 | inc ebx |
307 | inc ebx |
308 | cmp ebx, [ff_ysz] |
308 | cmp ebx, [ff_ysz] |
309 | jb .ff_new_y |
309 | jb .ff_new_y |
Line 357... | Line 357... | ||
357 | jne dspl00 |
357 | jne dspl00 |
358 | mov [windowtypechanged],dword 0 |
358 | mov [windowtypechanged],dword 0 |
359 | redraw_screen_direct: |
359 | redraw_screen_direct: |
360 | mov [dlx],dword 0 |
360 | mov [dlx],dword 0 |
361 | mov [dly],dword 0 |
361 | mov [dly],dword 0 |
362 | mov eax,[ScreenWidth] |
362 | mov eax,[Screen_Max_X] |
363 | mov [dlxe],eax |
363 | mov [dlxe],eax |
364 | mov eax,[ScreenHeight] |
364 | mov eax,[Screen_Max_Y] |
365 | mov [dlye],eax |
365 | mov [dlye],eax |
366 | mov eax,window_data |
366 | mov eax,window_data |
367 | call redrawscreen |
367 | call redrawscreen |
368 | dspl00: |
368 | dspl00: |
369 | popad |
369 | popad |
Line 435... | Line 435... | ||
435 | jne no_set_workarea |
435 | jne no_set_workarea |
436 | movsx eax,word[esp+16+2] |
436 | movsx eax,word[esp+16+2] |
437 | movsx ebx,word[esp+16] |
437 | movsx ebx,word[esp+16] |
438 | cmp eax,ebx |
438 | cmp eax,ebx |
439 | jge .lp1 |
439 | jge .lp1 |
440 | or eax,eax;[ScreenWidth] |
440 | or eax,eax;[Screen_Max_X] |
441 | jl @f |
441 | jl @f |
442 | mov [screen_workarea.left],eax |
442 | mov [screen_workarea.left],eax |
443 | @@: cmp ebx,[ScreenWidth] |
443 | @@: cmp ebx,[Screen_Max_X] |
444 | jg .lp1 |
444 | jg .lp1 |
445 | mov [screen_workarea.right],ebx |
445 | mov [screen_workarea.right],ebx |
446 | .lp1: movsx eax,word[esp+24+2] |
446 | .lp1: movsx eax,word[esp+24+2] |
447 | movsx ebx,word[esp+24] |
447 | movsx ebx,word[esp+24] |
448 | cmp eax,ebx |
448 | cmp eax,ebx |
449 | jge .lp2 |
449 | jge .lp2 |
450 | or eax,eax;[0xFE04] |
450 | or eax,eax;[0xFE04] |
451 | jl @f |
451 | jl @f |
452 | mov [screen_workarea.top],eax |
452 | mov [screen_workarea.top],eax |
453 | @@: cmp ebx,[ScreenHeight] |
453 | @@: cmp ebx,[Screen_Max_Y] |
454 | jg .lp2 |
454 | jg .lp2 |
455 | mov [screen_workarea.bottom],ebx |
455 | mov [screen_workarea.bottom],ebx |
456 | .lp2: call repos_windows |
456 | .lp2: call repos_windows |
457 | mov eax, 0 |
457 | mov eax, 0 |
458 | mov ebx, 0 |
458 | mov ebx, 0 |
459 | mov ecx, [ScreenWidth] |
459 | mov ecx, [Screen_Max_X] |
460 | mov edx, [ScreenHeight] |
460 | mov edx, [Screen_Max_Y] |
461 | call calculatescreen |
461 | call calculatescreen |
462 | ; jmp redraw_screen_direct |
462 | ; jmp redraw_screen_direct |
463 | .exit: |
463 | .exit: |
464 | popad |
464 | popad |
465 | ret |
465 | ret |
Line 481... | Line 481... | ||
481 | mov [esp+32+36], eax |
481 | mov [esp+32+36], eax |
482 | test eax, eax |
482 | test eax, eax |
483 | jnz .ret |
483 | jnz .ret |
484 | xor eax, eax |
484 | xor eax, eax |
485 | xor ebx, ebx |
485 | xor ebx, ebx |
486 | mov ecx, [ScreenWidth] |
486 | mov ecx, [Screen_Max_X] |
487 | mov edx, [ScreenHeight] |
487 | mov edx, [Screen_Max_Y] |
488 | call calculatescreen |
488 | call calculatescreen |
489 | jmp redraw_screen_direct |
489 | jmp redraw_screen_direct |
490 | .ret: |
490 | .ret: |
491 | popad |
491 | popad |
492 | ret |
492 | ret |
Line 524... | Line 524... | ||
524 | add edi,0x20 |
524 | add edi,0x20 |
525 | loop @b |
525 | loop @b |
526 | ret |
526 | ret |
527 | .lp2: mov eax,[edi+WDATA.box.left] |
527 | .lp2: mov eax,[edi+WDATA.box.left] |
528 | add eax,[edi+WDATA.box.width] |
528 | add eax,[edi+WDATA.box.width] |
529 | mov ebx,[ScreenWidth] |
529 | mov ebx,[Screen_Max_X] |
530 | ; inc ebx |
530 | ; inc ebx |
531 | cmp eax,ebx |
531 | cmp eax,ebx |
532 | jle .lp4 |
532 | jle .lp4 |
533 | mov eax,[edi+WDATA.box.width] |
533 | mov eax,[edi+WDATA.box.width] |
534 | sub eax,ebx |
534 | sub eax,ebx |
Line 536... | Line 536... | ||
536 | mov [edi+WDATA.box.width],ebx |
536 | mov [edi+WDATA.box.width],ebx |
537 | .lp3: sub ebx,[edi+WDATA.box.width] |
537 | .lp3: sub ebx,[edi+WDATA.box.width] |
538 | mov [edi+WDATA.box.left],ebx |
538 | mov [edi+WDATA.box.left],ebx |
539 | .lp4: mov eax,[edi+WDATA.box.top] |
539 | .lp4: mov eax,[edi+WDATA.box.top] |
540 | add eax,[edi+WDATA.box.height] |
540 | add eax,[edi+WDATA.box.height] |
541 | mov ebx,[ScreenHeight] |
541 | mov ebx,[Screen_Max_Y] |
542 | ; inc ebx |
542 | ; inc ebx |
543 | cmp eax,ebx |
543 | cmp eax,ebx |
544 | jle .lp6 |
544 | jle .lp6 |
545 | mov eax,[edi+WDATA.box.height] |
545 | mov eax,[edi+WDATA.box.height] |
546 | sub eax,ebx |
546 | sub eax,ebx |
Line 567... | Line 567... | ||
567 | movzx ecx,word [edi+WDATA.box.width] |
567 | movzx ecx,word [edi+WDATA.box.width] |
568 | movzx edx,word [edi+WDATA.box.height] |
568 | movzx edx,word [edi+WDATA.box.height] |
Line 569... | Line 569... | ||
569 | 569 | ||
570 | mov esi,ecx ; check x pos |
570 | mov esi,ecx ; check x pos |
571 | add esi,eax |
571 | add esi,eax |
572 | cmp esi,[ScreenWidth] |
572 | cmp esi,[Screen_Max_X] |
573 | jbe x_pos_ok |
573 | jbe x_pos_ok |
574 | mov [edi+WDATA.box.left],dword 0 |
574 | mov [edi+WDATA.box.left],dword 0 |
575 | xor eax, eax |
575 | xor eax, eax |
Line 576... | Line 576... | ||
576 | x_pos_ok: |
576 | x_pos_ok: |
577 | 577 | ||
578 | mov esi,edx ; check y pos |
578 | mov esi,edx ; check y pos |
579 | add esi,ebx |
579 | add esi,ebx |
580 | cmp esi,[ScreenHeight] |
580 | cmp esi,[Screen_Max_Y] |
581 | jbe y_pos_ok |
581 | jbe y_pos_ok |
582 | mov [edi+WDATA.box.top],dword 0 |
582 | mov [edi+WDATA.box.top],dword 0 |
Line 583... | Line 583... | ||
583 | mov ebx,0 |
583 | mov ebx,0 |
584 | y_pos_ok: |
584 | y_pos_ok: |
585 | 585 | ||
586 | mov esi,ecx ; check x size |
586 | mov esi,ecx ; check x size |
587 | add esi,eax |
587 | add esi,eax |
588 | cmp esi,[ScreenWidth] |
588 | cmp esi,[Screen_Max_X] |
589 | jbe x_size_ok |
589 | jbe x_size_ok |
Line 590... | Line 590... | ||
590 | mov ecx,[ScreenWidth] |
590 | mov ecx,[Screen_Max_X] |
591 | mov [edi+WDATA.box.width],ecx |
591 | mov [edi+WDATA.box.width],ecx |
592 | x_size_ok: |
592 | x_size_ok: |
593 | 593 | ||
594 | mov esi,edx ; check y size |
594 | mov esi,edx ; check y size |
595 | add esi,ebx |
595 | add esi,ebx |
596 | cmp esi,[ScreenHeight] |
596 | cmp esi,[Screen_Max_Y] |
Line 597... | Line 597... | ||
597 | jbe y_size_ok |
597 | jbe y_size_ok |
Line 1389... | Line 1389... | ||
1389 | push ax |
1389 | push ax |
1390 | push bx |
1390 | push bx |
Line 1391... | Line 1391... | ||
1391 | 1391 | ||
Line 1392... | Line 1392... | ||
1392 | call drawwindowframes |
1392 | call drawwindowframes |
1393 | 1393 | ||
Line 1394... | Line 1394... | ||
1394 | mov ax,[ScreenWidth] |
1394 | mov ax,[Screen_Max_X] |
1395 | mov bx,[ScreenHeight] |
1395 | mov bx,[Screen_Max_Y] |
Line 1396... | Line 1396... | ||
1396 | 1396 | ||
Line 1543... | Line 1543... | ||
1543 | jz @f |
1543 | jz @f |
1544 | mov eax,[screen_workarea.bottom] |
1544 | mov eax,[screen_workarea.bottom] |
1545 | sub eax,[screen_workarea.top] |
1545 | sub eax,[screen_workarea.top] |
1546 | @@: mov [edi+WDATA.box.height],eax |
1546 | @@: mov [edi+WDATA.box.height],eax |
1547 | add eax, [edi+WDATA.box.top] |
1547 | add eax, [edi+WDATA.box.top] |
1548 | cmp eax, [ScreenHeight] |
1548 | cmp eax, [Screen_Max_Y] |
1549 | jbe @f |
1549 | jbe @f |
1550 | mov eax, [ScreenHeight] |
1550 | mov eax, [Screen_Max_Y] |
1551 | sub eax, [edi+WDATA.box.height] |
1551 | sub eax, [edi+WDATA.box.height] |
1552 | mov [edi+WDATA.box.top], eax |
1552 | mov [edi+WDATA.box.top], eax |
1553 | @@: call check_window_position |
1553 | @@: call check_window_position |
1554 | call set_window_clientbox |
1554 | call set_window_clientbox |
Line 1603... | Line 1603... | ||
1603 | 1603 | ||
Line 1604... | Line 1604... | ||
1604 | no_fullscreen_restore: |
1604 | no_fullscreen_restore: |
1605 | 1605 | ||
1606 | mov eax,[edi+WDATA.box.top] ; check Y inside screen |
1606 | mov eax,[edi+WDATA.box.top] ; check Y inside screen |
1607 | add eax,[edi+WDATA.box.height] |
1607 | add eax,[edi+WDATA.box.height] |
1608 | cmp eax,[ScreenHeight] |
1608 | cmp eax,[Screen_Max_Y] |
1609 | jbe no_window_sizing |
1609 | jbe no_window_sizing |
1610 | mov eax,[edi+WDATA.box.left] ; check X inside screen |
1610 | mov eax,[edi+WDATA.box.left] ; check X inside screen |
1611 | add eax,[edi+WDATA.box.width] |
1611 | add eax,[edi+WDATA.box.width] |
1612 | cmp eax,[ScreenWidth] |
1612 | cmp eax,[Screen_Max_X] |
1613 | jbe no_window_sizing |
1613 | jbe no_window_sizing |
1614 | mov eax,[ScreenWidth] |
1614 | mov eax,[Screen_Max_X] |
1615 | sub eax,[edi+WDATA.box.width] |
1615 | sub eax,[edi+WDATA.box.width] |
1616 | mov [edi+WDATA.box.left],eax |
1616 | mov [edi+WDATA.box.left],eax |
1617 | mov eax,[ScreenHeight] |
1617 | mov eax,[Screen_Max_Y] |
1618 | sub eax,[edi+WDATA.box.height] |
1618 | sub eax,[edi+WDATA.box.height] |
1619 | mov [edi+WDATA.box.top],eax |
1619 | mov [edi+WDATA.box.top],eax |