Subversion Repositories Kolibri OS

Rev

Rev 1362 | Rev 1369 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1362 Rev 1368
Line 4... Line 4...
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
;;                                                              ;;
7
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 8... Line 8...
8
 
8
 
Line 9... Line 9...
9
$Revision: 1362 $
9
$Revision: 1368 $
10
 
10
 
11
 
11
 
Line 325... Line 325...
325
        test    [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
325
        test    [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
326
        jnz     .skip_window
326
        jnz     .skip_window
Line 327... Line 327...
327
 
327
 
328
        mov     eax, [edi + WDATA.box.left]
328
        mov     eax, [edi + WDATA.box.left]
329
        cmp     eax, [esp + RECT.right]
329
        cmp     eax, [esp + RECT.right]
330
        ja      .skip_window
330
        jg      .skip_window
331
        mov     ebx, [edi + WDATA.box.top]
331
        mov     ebx, [edi + WDATA.box.top]
332
        cmp     ebx, [esp + RECT.bottom]
332
        cmp     ebx, [esp + RECT.bottom]
333
        ja      .skip_window
333
        jg      .skip_window
334
        mov     ecx, [edi + WDATA.box.width]
334
        mov     ecx, [edi + WDATA.box.width]
335
        add     ecx, eax
335
        add     ecx, eax
336
        cmp     ecx, [esp + RECT.left]
336
        cmp     ecx, [esp + RECT.left]
337
        jb      .skip_window
337
        jl      .skip_window
338
        mov     edx, [edi + WDATA.box.height]
338
        mov     edx, [edi + WDATA.box.height]
339
        add     edx, ebx
339
        add     edx, ebx
340
        cmp     edx, [esp + RECT.top]
340
        cmp     edx, [esp + RECT.top]
Line 341... Line 341...
341
        jb      .skip_window
341
        jl      .skip_window
342
 
342
 
343
        cmp     eax, [esp + RECT.left]
343
        cmp     eax, [esp + RECT.left]
344
        jae     @f
344
        jae     @f
Line 452... Line 452...
452
        mov     ecx, [edi + WDATA.box.width]
452
        mov     ecx, [edi + WDATA.box.width]
453
        mov     edx, [edi + WDATA.box.height]
453
        mov     edx, [edi + WDATA.box.height]
Line 454... Line 454...
454
 
454
 
455
        mov     esi, [Screen_Max_X]
455
        mov     esi, [Screen_Max_X]
456
        cmp     ecx, esi
456
        cmp     ecx, esi
457
        jbe     .check_left
-
 
458
        mov     ecx, esi
-
 
Line 459... Line 457...
459
        mov     [edi + WDATA.box.width], esi
457
        ja      .fix_width
460
 
458
 
461
  .check_left:
-
 
462
        or      eax, eax
-
 
463
        jg      @f
459
  .check_left:
464
        xor     eax, eax
460
        or      eax, eax
465
        jmp     .fix_left
461
        jl      .fix_left_low
466
    @@: add     eax, ecx
462
        add     eax, ecx
467
        cmp     eax, esi
-
 
468
        jle     .check_height
-
 
469
        mov     eax, esi
-
 
470
        sub     eax, ecx
-
 
471
 
-
 
Line 472... Line 463...
472
  .fix_left:
463
        cmp     eax, esi
473
        mov     [edi + WDATA.box.left], eax
464
        jg      .fix_left_high
474
 
465
 
475
  .check_height:
466
  .check_height:
476
        mov     esi, [Screen_Max_Y]
-
 
477
        cmp     edx, esi
-
 
Line 478... Line 467...
478
        jbe     .check_top
467
        mov     esi, [Screen_Max_Y]
479
        mov     edx, esi
468
        cmp     edx, esi
480
        mov     [edi + WDATA.box.height], esi
-
 
481
 
-
 
482
  .check_top:
469
        ja      .fix_height
483
        or      ebx, ebx
470
 
484
        jg      @f
471
  .check_top:
485
        xor     ebx, ebx
472
        or      ebx, ebx
486
        jmp     .fix_top
-
 
487
    @@: add     ebx, edx
-
 
488
        cmp     ebx, esi
-
 
489
        jle     .exit
-
 
490
        mov     ebx, esi
-
 
Line 491... Line 473...
491
        sub     ebx, edx
473
        jl      .fix_top_low
492
 
474
        add     ebx, edx
493
  .fix_top:
475
        cmp     ebx, esi
Line -... Line 476...
-
 
476
        jg      .fix_top_high
-
 
477
 
-
 
478
  .exit:
-
 
479
        pop     esi edx ecx ebx eax
-
 
480
        ret
-
 
481
 
-
 
482
  .fix_width:
-
 
483
        mov     ecx, esi
-
 
484
        mov     [edi + WDATA.box.width], esi
-
 
485
        jmp     .check_left
-
 
486
 
-
 
487
  .fix_left_low:
-
 
488
        xor     eax, eax
-
 
489
        mov     [edi + WDATA.box.left], eax
-
 
490
        jmp     .check_height
-
 
491
 
-
 
492
  .fix_left_high:
-
 
493
        mov     eax, esi
-
 
494
        sub     eax, ecx
-
 
495
        mov     [edi + WDATA.box.left], eax
-
 
496
        jmp     .check_height
-
 
497
 
-
 
498
  .fix_height:
-
 
499
        mov     edx, esi
-
 
500
        mov     [edi + WDATA.box.height], esi
-
 
501
        jmp     .check_top
-
 
502
 
-
 
503
  .fix_top_low:
-
 
504
        xor     ebx, ebx
-
 
505
        mov     [edi + WDATA.box.top], ebx
-
 
506
        jmp     .exit
-
 
507
 
494
        mov     [edi + WDATA.box.top], ebx
508
  .fix_top_high:
495
 
509
        mov     ebx, esi
496
  .exit:
510
        sub     ebx, edx
497
        pop     esi edx ecx ebx eax
511
        mov     [edi + WDATA.box.top], ebx
498
        ret
512
        jmp     .exit
Line 1508... Line 1522...
1508
        sub     edx, ebx
1522
        sub     edx, ebx
1509
        inc     ecx
1523
        inc     ecx
1510
        inc     edx
1524
        inc     edx
Line 1511... Line 1525...
1511
 
1525
 
-
 
1526
        ; get WinMap start
1512
        ; get WinMap start
1527
        push    esi
1513
        mov     edi, [Screen_Max_X]
1528
        mov     edi, [Screen_Max_X]
-
 
1529
        inc     edi
1514
        inc     edi
1530
        mov     esi, edi
1515
        imul    edi, ebx
1531
        imul    edi, ebx
1516
        add     edi, eax
1532
        add     edi, eax
-
 
1533
        add     edi, [_WinMapAddress]
1517
        add     edi, [_WinMapAddress]
1534
        pop     eax
-
 
1535
        mov     ah, al
-
 
1536
        push    ax
-
 
1537
        shl     eax, 16
Line 1518... Line 1538...
1518
        mov     eax, esi
1538
        pop     ax
1519
 
1539
 
-
 
1540
  .next_line:
-
 
1541
        push    ecx
-
 
1542
        shr     ecx, 2
-
 
1543
        rep     stosd
1520
  .next_line:
1544
        mov     ecx, [esp]
1521
        push    ecx
1545
        and     ecx, 3
1522
        rep     stosb
-
 
1523
        pop     ecx
1546
        rep     stosb
1524
        add     edi, [Screen_Max_X]
1547
        pop     ecx
1525
        inc     edi
1548
        add     edi, esi
1526
        sub     edi, ecx
1549
        sub     edi, ecx
Line 1527... Line 1550...
1527
        dec     edx
1550
        dec     edx
Line 1638... Line 1661...
1638
;> esi = pointer to WIN_POS+ window data
1661
;> esi = pointer to WIN_POS+ window data
1639
;------------------------------------------------------------------------------
1662
;------------------------------------------------------------------------------
1640
        push    eax ebx
1663
        push    eax ebx
Line 1641... Line 1664...
1641
 
1664
 
1642
        ; if type of current active window is 3 or 4, it must be redrawn
1665
        ; if type of current active window is 3 or 4, it must be redrawn
1643
        mov     eax, [TASK_COUNT]
1666
        mov     ebx, [TASK_COUNT]
1644
        movzx   eax, word[WIN_POS + eax * 2]
1667
        movzx   ebx, word[WIN_POS + ebx * 2]
1645
        shl     eax, 5
1668
        shl     ebx, 5
1646
        add     eax, window_data
1669
        add     eax, window_data
1647
        mov     bl, [eax + WDATA.fl_wstyle]
1670
        mov     al, [window_data + ebx + WDATA.fl_wstyle]
1648
        and     bl, 0x0f
1671
        and     al, 0x0f
1649
        cmp     bl, 0x03
-
 
1650
        je      .set_window_redraw_flag
-
 
1651
        cmp     bl, 0x04
1672
        cmp     al, 0x03
-
 
1673
        je      .set_window_redraw_flag
1652
        je      .set_window_redraw_flag
1674
        cmp     al, 0x04
Line 1653... Line 1675...
1653
        jmp     .move_others_down
1675
        jne     .move_others_down
1654
 
1676
 
Line 1655... Line 1677...
1655
  .set_window_redraw_flag:
1677
  .set_window_redraw_flag:
1656
        mov     [eax + WDATA.fl_redraw], 1
1678
        mov     [window_data + ebx + WDATA.fl_redraw], 1
1657
 
1679
 
1658
  .move_others_down:
1680
  .move_others_down:
1659
        ; ax <- process no
1681
        ; ax <- process no
Line 1660... Line 1682...
1660
        movzx   eax, word[esi]
1682
        movzx   ebx, word[esi]
1661
        ; ax <- position in window stack
1683
        ; ax <- position in window stack
Line 1662... Line 1684...
1662
        movzx   eax, word[WIN_STACK + eax * 2]
1684
        movzx   ebx, word[WIN_STACK + ebx * 2]
1663
 
1685
 
1664
        ; drop others
1686
        ; drop others
1665
        xor     ebx, ebx
1687
        xor     eax, eax
1666
 
1688
 
1667
  .next_stack_window:
1689
  .next_stack_window:
1668
        cmp     ebx, [TASK_COUNT]
1690
        cmp     eax, [TASK_COUNT]
1669
        jae     .move_self_up
1691
        jae     .move_self_up
Line 1670... Line 1692...
1670
        inc     ebx
1692
        inc     eax
1671
        cmp     [WIN_STACK + ebx * 2], ax
1693
        cmp     [WIN_STACK + eax * 2], bx
1672
        jbe     .next_stack_window
1694
        jbe     .next_stack_window
1673
        dec     word[WIN_STACK + ebx * 2]
1695
        dec     word[WIN_STACK + eax * 2]
1674
        jmp     .next_stack_window
1696
        jmp     .next_stack_window
1675
 
1697
 
Line 1676... Line 1698...
1676
  .move_self_up:
1698
  .move_self_up:
1677
        movzx   eax, word[esi]
1699
        movzx   ebx, word[esi]
Line 1678... Line 1700...
1678
        ; number of processes
1700
        ; number of processes
1679
        mov     bx, [TASK_COUNT]
1701
        mov     ax, [TASK_COUNT]
1680
        ; this is the last (and the upper)
1702
        ; this is the last (and the upper)
1681
        mov     [WIN_STACK + eax * 2], bx
1703
        mov     [WIN_STACK + ebx * 2], ax
1682
 
1704
 
1683
        ; update on screen - window stack
1705
        ; update on screen - window stack
1684
        xor     ebx, ebx
1706
        xor     eax, eax
Line 1685... Line 1707...
1685
 
1707
 
1686
  .next_window_pos:
1708
  .next_window_pos:
1687
        cmp     ebx, [TASK_COUNT]
1709
        cmp     eax, [TASK_COUNT]