Subversion Repositories Kolibri OS

Rev

Rev 5665 | Rev 5844 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5665 Rev 5836
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: 5665 $
9
$Revision: 5836 $
10
 
10
 
11
;==============================================================================
11
;==============================================================================
Line 484... Line 484...
484
        cmp     ecx, WIN_POS - 2
484
        cmp     ecx, WIN_POS - 2
485
        jne     @b
485
        jne     @b
486
        pop     ecx eax
486
        pop     ecx eax
487
        ret
487
        ret
488
;------------------------------------------------------------------------------
488
;------------------------------------------------------------------------------
-
 
489
iglobal
-
 
490
win_zmodi db ZPOS_DESKTOP,\
-
 
491
             ZPOS_ALWAYS_BACK,\
-
 
492
             ZPOS_NORMAL,\
-
 
493
             ZPOS_ALWAYS_TOP
-
 
494
endg
489
align 4
495
align 4
490
;------------------------------------------------------------------------------
496
;------------------------------------------------------------------------------
491
calculatescreen: ;/////////////////////////////////////////////////////////////
497
calculatescreen: ;/////////////////////////////////////////////////////////////
492
;------------------------------------------------------------------------------
498
;------------------------------------------------------------------------------
493
;? Scan all windows from bottom to top, calling `setscreen` for each one
499
;? Scan all windows from bottom to top, calling `setscreen` for each one
Line 509... Line 515...
509
 
515
 
510
        mov     ebp, [TASK_COUNT]
516
        mov     ebp, [TASK_COUNT]
511
        cmp     ebp, 1
517
        cmp     ebp, 1
Line -... Line 518...
-
 
518
        jbe     .exit
-
 
519
 
512
        jbe     .exit
520
        push    eax ;for num layout
-
 
521
 
-
 
522
        push    edx ecx ebx eax
-
 
523
 
-
 
524
        mov     dword[esp+14], 0
-
 
525
;--------------------------------------
-
 
526
align 4
-
 
527
.layout:
513
 
528
        mov     esi, 1          ; = num in window stack
514
        push    edx ecx ebx eax
529
        mov     ebp, [TASK_COUNT]
515
;--------------------------------------
530
;--------------------------------------
516
align 4
531
align 4
517
.next_window:
532
.next_window:
Line 518... Line 533...
518
        movzx   edi, word[WIN_POS + esi * 2]
533
        movzx   edi, word[WIN_POS + esi * 2]
519
        shl     edi, 5
534
        shl     edi, 5                  ;size of TASKDATA and WDATA = 32 bytes
Line 520... Line 535...
520
 
535
 
521
        cmp     [CURRENT_TASK + edi + TASKDATA.state], TSTATE_FREE
536
        cmp     [CURRENT_TASK + edi + TASKDATA.state], TSTATE_FREE
522
        je      .skip_window
537
        je      .skip_window
Line -... Line 538...
-
 
538
 
-
 
539
        add     edi, window_data
-
 
540
        test    [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
-
 
541
        jnz     .skip_window
-
 
542
 
523
 
543
        mov     eax, [esp+14]
524
        add     edi, window_data
544
        mov     al, [eax+win_zmodi]
525
        test    [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
545
        cmp     [edi + WDATA.z_modif], al
526
        jnz     .skip_window
546
        jne     .skip_window
527
 
547
 
Line 572... Line 592...
572
align 4
592
align 4
573
.skip_window:
593
.skip_window:
574
        inc     esi
594
        inc     esi
575
        dec     ebp
595
        dec     ebp
576
        jnz     .next_window
596
        jnz     .next_window
-
 
597
;---------------------------------------------
-
 
598
        inc     dword[esp+14]
-
 
599
        cmp     dword[esp+14], ZPOS_ALWAYS_TOP
-
 
600
        jbe     .layout
-
 
601
;---------------------------------------------
-
 
602
        mov     esi, [TASK_COUNT]
-
 
603
        movzx   edi, word[WIN_POS + esi * 2]
-
 
604
        shl     edi, 5
-
 
605
        add     edi, window_data
Line 577... Line 606...
577
 
606
 
-
 
607
        pop     eax ebx ecx edx
578
        pop     eax ebx ecx edx
608
        pop     ebp     ;del num layout
579
;--------------------------------------
609
;--------------------------------------
580
align 4
610
align 4
581
.exit:
611
.exit:
582
        pop     ebp
612
        pop     ebp
Line 1026... Line 1056...
1026
        add     edx, ebx
1056
        add     edx, ebx
Line 1027... Line 1057...
1027
 
1057
 
1028
        mov     edi, [TASK_COUNT]
1058
        mov     edi, [TASK_COUNT]
1029
        movzx   esi, word[WIN_POS + edi * 2]
1059
        movzx   esi, word[WIN_POS + edi * 2]
-
 
1060
        call    window._.set_screen
-
 
1061
 
-
 
1062
        call    window._.set_top_wnd    ;Fantomer
1030
        call    window._.set_screen
1063
 
1031
        inc     [_display.mask_seqno]
1064
        inc     [_display.mask_seqno]
Line 1032... Line 1065...
1032
        popad
1065
        popad
1033
 
1066
 
Line 1195... Line 1228...
1195
        mov     ecx, [edi + WDATA.box.width]
1228
        mov     ecx, [edi + WDATA.box.width]
1196
        mov     edx, [edi + WDATA.box.height]
1229
        mov     edx, [edi + WDATA.box.height]
1197
        add     ecx, eax
1230
        add     ecx, eax
1198
        add     edx, ebx
1231
        add     edx, ebx
1199
        call    ebp
1232
        call    ebp
-
 
1233
 
-
 
1234
        cmp     ebp, window._.set_screen
-
 
1235
        jne     @f
-
 
1236
        call    window._.set_top_wnd
-
 
1237
    @@:
1200
        inc     [_display.mask_seqno]
1238
        inc     [_display.mask_seqno]
1201
;--------------------------------------
1239
;--------------------------------------
1202
align 4
1240
align 4
1203
.exit:
1241
.exit:
1204
        popfd
1242
        popfd
Line 1377... Line 1415...
1377
;> esi = process slot
1415
;> esi = process slot
1378
;------------------------------------------------------------------------------
1416
;------------------------------------------------------------------------------
1379
;        mov     edi, ebx
1417
;        mov     edi, ebx
1380
;        call    window._.end_moving__box
1418
;        call    window._.end_moving__box
Line -... Line 1419...
-
 
1419
 
-
 
1420
        mov     edi, ebx
-
 
1421
        call    window._.draw_negative_box
1381
 
1422
 
1382
        mov     edi, esi
1423
        mov     edi, esi
1383
        shl     edi, 5
1424
        shl     edi, 5
Line 1384... Line 1425...
1384
        add     edi, window_data
1425
        add     edi, window_data
Line 2433... Line 2474...
2433
 
2474
 
2434
        add     edx, [eax-twdw + WDATA.box.height]
2475
        add     edx, [eax-twdw + WDATA.box.height]
2435
        mov     [ecx+RECT.bottom], edx
2476
        mov     [ecx+RECT.bottom], edx
2436
        ret
2477
        ret
-
 
2478
;------------------------------------------------------------------------------
-
 
2479
align 4
-
 
2480
;------------------------------------------------------------------------------
-
 
2481
window._.set_top_wnd: ;////////////////////////////////////////////////////////
-
 
2482
;------------------------------------------------------------------------------
-
 
2483
;? updates all windows one above the window
-
 
2484
;------------------------------------------------------------------------------
-
 
2485
;> eax = left
-
 
2486
;> ebx = top
-
 
2487
;> ecx = right
-
 
2488
;> edx = bottom
-
 
2489
;> esi = process number
-
 
2490
;! corrupted edi
-
 
2491
;------------------------------------------------------------------------------
-
 
2492
        movzx   edi, word[WIN_POS + esi * 2]
-
 
2493
        shl     edi, 5
-
 
2494
        cmp     [edi + window_data + WDATA.z_modif], ZPOS_ALWAYS_TOP
-
 
2495
        jne     @f
-
 
2496
        ret
-
 
2497
      @@:
-
 
2498
 
-
 
2499
        push    esi
-
 
2500
        pushfd
-
 
2501
        cli
-
 
2502
 
-
 
2503
        push    ebp
-
 
2504
        mov     ebp, [TASK_COUNT]
-
 
2505
        cmp     ebp, 1
-
 
2506
        jbe     .exit
-
 
2507
 
-
 
2508
        push    eax ;for num layout
-
 
2509
        push    edx ecx ebx eax
-
 
2510
 
-
 
2511
        movzx   eax, byte [edi + window_data + WDATA.z_modif]
-
 
2512
        inc     eax
-
 
2513
        mov     dword[esp+14], eax
-
 
2514
;--------------------------------------
-
 
2515
align 4
-
 
2516
.layout:
-
 
2517
        mov     esi, 1        ; = num in window stack
-
 
2518
        mov     ebp, [TASK_COUNT]
-
 
2519
;--------------------------------------
-
 
2520
align 4
-
 
2521
.next_window:
-
 
2522
        movzx   edi, word[WIN_POS + esi * 2]
-
 
2523
        shl     edi, 5                  ;size of TASKDATA and WDATA = 32 bytes
-
 
2524
 
-
 
2525
        cmp     [CURRENT_TASK + edi + TASKDATA.state], TSTATE_FREE
-
 
2526
        je      .skip_window
-
 
2527
 
-
 
2528
        add     edi, window_data
-
 
2529
        test    [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
-
 
2530
        jnz     .skip_window
-
 
2531
 
-
 
2532
        mov     eax, [esp+14]
-
 
2533
        mov     al, [eax+win_zmodi]
-
 
2534
        cmp     [edi + WDATA.z_modif], al
-
 
2535
        jne     .skip_window
-
 
2536
 
-
 
2537
        mov     eax, [edi + WDATA.box.left]
-
 
2538
        cmp     eax, [esp + RECT.right]
-
 
2539
        jg      .skip_window
-
 
2540
        mov     ebx, [edi + WDATA.box.top]
-
 
2541
        cmp     ebx, [esp + RECT.bottom]
-
 
2542
        jg      .skip_window
-
 
2543
        mov     ecx, [edi + WDATA.box.width]
-
 
2544
        add     ecx, eax
-
 
2545
        cmp     ecx, [esp + RECT.left]
-
 
2546
        jl      .skip_window
-
 
2547
        mov     edx, [edi + WDATA.box.height]
-
 
2548
        add     edx, ebx
-
 
2549
        cmp     edx, [esp + RECT.top]
-
 
2550
        jl      .skip_window
-
 
2551
 
-
 
2552
        cmp     eax, [esp + RECT.left]
-
 
2553
        jae     @f
-
 
2554
        mov     eax, [esp + RECT.left]
-
 
2555
;--------------------------------------
-
 
2556
align 4
-
 
2557
@@:
-
 
2558
        cmp     ebx, [esp + RECT.top]
-
 
2559
        jae     @f
-
 
2560
        mov     ebx, [esp + RECT.top]
-
 
2561
;--------------------------------------
-
 
2562
align 4
-
 
2563
@@:
-
 
2564
        cmp     ecx, [esp + RECT.right]
-
 
2565
        jbe     @f
-
 
2566
        mov     ecx, [esp + RECT.right]
-
 
2567
;--------------------------------------
-
 
2568
align 4
-
 
2569
@@:
-
 
2570
        cmp     edx, [esp + RECT.bottom]
-
 
2571
        jbe     @f
-
 
2572
        mov     edx, [esp + RECT.bottom]
-
 
2573
;--------------------------------------
-
 
2574
align 4
-
 
2575
@@:
-
 
2576
        push    esi
-
 
2577
        movzx   esi, word[WIN_POS + esi * 2]
-
 
2578
        call    window._.set_screen
-
 
2579
        pop     esi
-
 
2580
 
-
 
2581
        mov     [edi + WDATA.fl_redraw], 1      ;set redraw flag
-
 
2582
;--------------------------------------
-
 
2583
align 4
-
 
2584
.skip_window:
-
 
2585
        inc     esi
-
 
2586
        dec     ebp
-
 
2587
        jnz     .next_window
-
 
2588
;--------------------------------------
-
 
2589
        inc     dword[esp+14]
-
 
2590
        cmp     dword[esp+14], ZPOS_ALWAYS_TOP
-
 
2591
        jbe     .layout
-
 
2592
;-------------------------------------
-
 
2593
 
-
 
2594
        pop     eax ebx ecx edx
-
 
2595
        pop     ebp     ;del num layout
-
 
2596
;-------------------------------------
-
 
2597
align 4
-
 
2598
.exit:
-
 
2599
 
-
 
2600
        pop     ebp
-
 
2601
        popfd
-
 
2602
        pop     esi
-
 
2603
 
-
 
2604
        ret
-
 
2605
-
 
2606