Subversion Repositories Kolibri OS

Rev

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

Rev 2268 Rev 2434
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: 2268 $
9
$Revision: 2434 $
10
 
10
 
11
;==============================================================================
11
;==============================================================================
Line 41... Line 41...
41
        and     al, 0x0f
41
        and     al, 0x0f
42
        cmp     al, 5
42
        cmp     al, 5
43
        jae     .exit
43
        jae     .exit
Line 44... Line 44...
44
 
44
 
45
        push    eax
-
 
46
        inc     [mouse_pause]
-
 
47
        call    [_display.disable_mouse]
45
        push    eax
48
        call    window._.sys_set_window
-
 
49
        call    [_display.disable_mouse]
46
        call    window._.sys_set_window
Line 50... Line 47...
50
        pop     eax
47
        pop     eax
51
 
48
 
Line 52... Line 49...
52
        or      al, al
49
        or      al, al
53
        jnz     @f
50
        jnz     @f
54
 
51
 
Line -... Line 52...
-
 
52
        ; type I - original style
55
        ; type I - original style
53
        call    drawwindow_I
56
        call    drawwindow_I
54
        jmp     window._.draw_window_caption.2
Line 57... Line 55...
57
        jmp     window._.draw_window_caption.2
55
 
58
 
56
    @@:
59
    @@: dec     al
-
 
60
        jnz     @f
57
        dec     al
61
 
58
        jnz     @f
Line -... Line 59...
-
 
59
 
62
        ; type II - only reserve area, no draw
60
        ; type II - only reserve area, no draw
63
        call    sys_window_mouse
61
        call    sys_window_mouse
Line 64... Line 62...
64
        dec     [mouse_pause]
62
        call    [draw_pointer]
65
        call    [draw_pointer]
63
        jmp     .exit
66
        jmp     .exit
64
 
Line 67... Line 65...
67
 
65
    @@:
-
 
66
        dec     al
68
    @@: dec     al
67
        jnz     @f
69
        jnz     @f
68
 
70
 
69
        ; type III  - new style
71
        ; type III  - new style
70
        call    drawwindow_III
72
        call    drawwindow_III
71
        jmp     window._.draw_window_caption.2
73
        jmp     window._.draw_window_caption.2
72
 
Line 131... Line 130...
131
;> eax = FS error code
130
;> eax = FS error code
132
;------------------------------------------------------------------------------
131
;------------------------------------------------------------------------------
133
        cmp     ebx, .sizeof.ftable / 4
132
        cmp     ebx, .sizeof.ftable / 4
134
        ja      @f
133
        ja      @f
135
        jmp     [.ftable + ebx * 4]
134
        jmp     [.ftable + ebx * 4]
-
 
135
    @@:
136
    @@: ret
136
        ret
Line 137... Line 137...
137
 
137
 
138
 
138
 
139
align 4
139
align 4
Line 208... Line 208...
208
        jge     .check_horizontal
208
        jge     .check_horizontal
209
        inc     esi
209
        inc     esi
210
        or      eax, eax
210
        or      eax, eax
211
        jge     @f
211
        jge     @f
212
        xor     eax, eax
212
        xor     eax, eax
-
 
213
    @@:
213
    @@: mov     [screen_workarea.left], eax
214
        mov     [screen_workarea.left], eax
214
        cmp     ebx, edi
215
        cmp     ebx, edi
215
        jle     @f
216
        jle     @f
216
        mov     ebx, edi
217
        mov     ebx, edi
-
 
218
    @@:
217
    @@: mov     [screen_workarea.right], ebx
219
        mov     [screen_workarea.right], ebx
Line 218... Line 220...
218
 
220
 
219
  .check_horizontal:
221
  .check_horizontal:
220
        mov     edi, [Screen_Max_Y]
222
        mov     edi, [Screen_Max_Y]
221
        mov     eax, edx
223
        mov     eax, edx
Line 225... Line 227...
225
        jge     .check_if_redraw_needed
227
        jge     .check_if_redraw_needed
226
        inc     esi
228
        inc     esi
227
        or      eax, eax
229
        or      eax, eax
228
        jge     @f
230
        jge     @f
229
        xor     eax, eax
231
        xor     eax, eax
-
 
232
    @@:
230
    @@: mov     [screen_workarea.top], eax
233
        mov     [screen_workarea.top], eax
231
        cmp     ebx, edi
234
        cmp     ebx, edi
232
        jle     @f
235
        jle     @f
233
        mov     ebx, edi
236
        mov     ebx, edi
-
 
237
    @@:
234
    @@: mov     [screen_workarea.bottom], ebx
238
        mov     [screen_workarea.bottom], ebx
Line 235... Line 239...
235
 
239
 
236
  .check_if_redraw_needed:
240
  .check_if_redraw_needed:
237
        or      esi, esi
241
        or      esi, esi
Line 326... Line 330...
326
        jnz     .exit
330
        jnz     .exit
Line 327... Line 331...
327
 
331
 
328
        cmp     ebx, -1
332
        cmp     ebx, -1
329
        jne     @f
333
        jne     @f
-
 
334
        mov     ebx, [edi + WDATA.box.left]
330
        mov     ebx, [edi + WDATA.box.left]
335
    @@:
331
    @@: cmp     ecx, -1
336
        cmp     ecx, -1
332
        jne     @f
337
        jne     @f
-
 
338
        mov     ecx, [edi + WDATA.box.top]
333
        mov     ecx, [edi + WDATA.box.top]
339
    @@:
334
    @@: cmp     edx, -1
340
        cmp     edx, -1
335
        jne     @f
341
        jne     @f
-
 
342
        mov     edx, [edi + WDATA.box.width]
336
        mov     edx, [edi + WDATA.box.width]
343
    @@:
337
    @@: cmp     esi, -1
344
        cmp     esi, -1
338
        jne     @f
345
        jne     @f
Line -... Line 346...
-
 
346
        mov     esi, [edi + WDATA.box.height]
339
        mov     esi, [edi + WDATA.box.height]
347
 
340
 
348
    @@:
341
    @@: push    esi edx ecx ebx
349
        push    esi edx ecx ebx
342
        mov     eax, esp
350
        mov     eax, esp
343
        mov     bl, [edi + WDATA.fl_wstate]
351
        mov     bl, [edi + WDATA.fl_wstate]
Line 344... Line 352...
344
        call    window._.set_window_box
352
        call    window._.set_window_box
345
        add     esp, BOX.sizeof
353
        add     esp, sizeof.BOX
346
 
354
 
347
        ; NOTE: do we really need this? to be reworked
355
        ; NOTE: do we really need this? to be reworked
Line 397... Line 405...
397
;------------------------------------------------------------------------------
405
;------------------------------------------------------------------------------
398
        mov     byte [window_data + 0x20 + WDATA.cl_titlebar + 3], 1 ; desktop is not movable
406
        mov     byte [window_data + 0x20 + WDATA.cl_titlebar + 3], 1 ; desktop is not movable
399
        push    eax ecx
407
        push    eax ecx
400
        xor     eax, eax
408
        xor     eax, eax
401
        mov     ecx, WIN_STACK
409
        mov     ecx, WIN_STACK
-
 
410
    @@:
402
    @@: inc     eax
411
        inc     eax
403
        add     ecx, 2
412
        add     ecx, 2
404
        ; process no
413
        ; process no
405
        mov     [ecx + 0x000], ax
414
        mov     [ecx + 0x000], ax
406
        ; positions in stack
415
        ; positions in stack
407
        mov     [ecx + 0x400], ax
416
        mov     [ecx + 0x400], ax
Line 464... Line 473...
464
        jl      .skip_window
473
        jl      .skip_window
Line 465... Line 474...
465
 
474
 
466
        cmp     eax, [esp + RECT.left]
475
        cmp     eax, [esp + RECT.left]
467
        jae     @f
476
        jae     @f
-
 
477
        mov     eax, [esp + RECT.left]
468
        mov     eax, [esp + RECT.left]
478
    @@:
469
    @@: cmp     ebx, [esp + RECT.top]
479
        cmp     ebx, [esp + RECT.top]
470
        jae     @f
480
        jae     @f
-
 
481
        mov     ebx, [esp + RECT.top]
471
        mov     ebx, [esp + RECT.top]
482
    @@:
472
    @@: cmp     ecx, [esp + RECT.right]
483
        cmp     ecx, [esp + RECT.right]
473
        jbe     @f
484
        jbe     @f
-
 
485
        mov     ecx, [esp + RECT.right]
474
        mov     ecx, [esp + RECT.right]
486
    @@:
475
    @@: cmp     edx, [esp + RECT.bottom]
487
        cmp     edx, [esp + RECT.bottom]
476
        jbe     @f
488
        jbe     @f
Line -... Line 489...
-
 
489
        mov     edx, [esp + RECT.bottom]
477
        mov     edx, [esp + RECT.bottom]
490
 
478
 
491
    @@:
479
    @@: push    esi
492
        push    esi
480
        movzx   esi, word[WIN_POS + esi * 2]
493
        movzx   esi, word[WIN_POS + esi * 2]
Line 481... Line 494...
481
        call    window._.set_screen
494
        call    window._.set_screen
Line 488... Line 501...
488
 
501
 
Line 489... Line 502...
489
        pop     eax ebx ecx edx
502
        pop     eax ebx ecx edx
490
 
503
 
-
 
504
  .exit:
491
  .exit:
505
        pop     ebp
492
        pop     ebp
506
        inc     [_display.mask_seqno]
493
        popfd
507
        popfd
Line 494... Line 508...
494
        pop     esi
508
        pop     esi
Line 499... Line 513...
499
repos_windows: ;///////////////////////////////////////////////////////////////
513
repos_windows: ;///////////////////////////////////////////////////////////////
500
;------------------------------------------------------------------------------
514
;------------------------------------------------------------------------------
501
;? 
515
;? 
502
;------------------------------------------------------------------------------
516
;------------------------------------------------------------------------------
503
        mov     ecx, [TASK_COUNT]
517
        mov     ecx, [TASK_COUNT]
504
        mov     edi, window_data + WDATA.sizeof * 2
518
        mov     edi, window_data + sizeof.WDATA * 2
505
        call    force_redraw_background
519
        call    force_redraw_background
506
        dec     ecx
520
        dec     ecx
507
        jle     .exit
521
        jle     .exit
Line 508... Line 522...
508
 
522
 
Line 518... Line 532...
518
        jle     .fix_vertical
532
        jle     .fix_vertical
519
        mov     eax, [edi + WDATA.box.width]
533
        mov     eax, [edi + WDATA.box.width]
520
        sub     eax, ebx
534
        sub     eax, ebx
521
        jle     @f
535
        jle     @f
522
        mov     [edi + WDATA.box.width], ebx
536
        mov     [edi + WDATA.box.width], ebx
-
 
537
    @@:
523
    @@: sub     ebx, [edi + WDATA.box.width]
538
        sub     ebx, [edi + WDATA.box.width]
524
        mov     [edi + WDATA.box.left], ebx
539
        mov     [edi + WDATA.box.left], ebx
Line 525... Line 540...
525
 
540
 
526
  .fix_vertical:
541
  .fix_vertical:
527
        mov     eax, [edi + WDATA.box.top]
542
        mov     eax, [edi + WDATA.box.top]
Line 531... Line 546...
531
        jle     .fix_client_box
546
        jle     .fix_client_box
532
        mov     eax, [edi + WDATA.box.height]
547
        mov     eax, [edi + WDATA.box.height]
533
        sub     eax, ebx
548
        sub     eax, ebx
534
        jle     @f
549
        jle     @f
535
        mov     [edi + WDATA.box.height], ebx
550
        mov     [edi + WDATA.box.height], ebx
-
 
551
    @@:
536
    @@: sub     ebx, [edi + WDATA.box.height]
552
        sub     ebx, [edi + WDATA.box.height]
537
        mov     [edi + WDATA.box.top], ebx
553
        mov     [edi + WDATA.box.top], ebx
538
        jmp     .fix_client_box
554
        jmp     .fix_client_box
Line 539... Line 555...
539
 
555
 
540
  .fix_maximized:
556
  .fix_maximized:
Line 552... Line 568...
552
        mov     [edi + WDATA.box.height], eax
568
        mov     [edi + WDATA.box.height], eax
Line 553... Line 569...
553
 
569
 
554
  .fix_client_box:
570
  .fix_client_box:
Line 555... Line 571...
555
        call    window._.set_window_clientbox
571
        call    window._.set_window_clientbox
556
 
572
 
Line 557... Line 573...
557
        add     edi, WDATA.sizeof
573
        add     edi, sizeof.WDATA
558
        loop    .next_window
574
        loop    .next_window
Line 588... Line 604...
588
draw_rectangle: ;//////////////////////////////////////////////////////////////
604
draw_rectangle: ;//////////////////////////////////////////////////////////////
589
;------------------------------------------------------------------------------
605
;------------------------------------------------------------------------------
590
;> eax = pack[16(left), 16(right)]
606
;> eax = pack[16(left), 16(right)]
591
;> ebx = pack[16(top), 16(bottom)]
607
;> ebx = pack[16(top), 16(bottom)]
592
;> esi = color
608
;> esi = color
-
 
609
;       ?? RR GG BB    ; 0x01000000 negation
-
 
610
;                      ; 0x02000000 used for draw_rectangle without top line
-
 
611
;                      ;           for example drawwindow_III and drawwindow_IV
593
;------------------------------------------------------------------------------
612
;------------------------------------------------------------------------------
594
        push    eax ebx ecx edi
613
        push    eax ebx ecx edi
Line 595... Line 614...
595
 
614
 
Line 596... Line 615...
596
        xor     edi, edi
615
        xor     edi, edi
597
 
616
 
Line 598... Line 617...
598
  .flags_set:
617
  .flags_set:
599
        push    ebx
618
        push    ebx
600
 
-
 
-
 
619
 
601
        ; set line color
620
        ; set line color
602
        mov     ecx, esi
621
        mov     ecx, esi
603
 
622
;        sub     esi, 1 shl 25
604
        ; draw top border
623
        ; draw top border
605
        rol     ebx, 16
624
        rol     ebx, 16
-
 
625
        push    ebx
-
 
626
        rol     ebx, 16
-
 
627
        pop     bx
606
        push    ebx
628
        test    ecx, 1 shl 25
607
        rol     ebx, 16
629
        jnz     @f
608
        pop     bx
630
        sub     ecx, 1 shl 25
609
        call    [draw_line]
631
        call    [draw_line]
610
 
632
@@:
611
        ; draw bottom border
633
        ; draw bottom border
Line 653... Line 675...
653
        add     eax, [esi + WDATA.box.height]
675
        add     eax, [esi + WDATA.box.height]
Line 654... Line 676...
654
 
676
 
655
        cmp     ebx, eax
677
        cmp     ebx, eax
656
        jbe     @f
678
        jbe     @f
-
 
679
        mov     ebx, eax
657
        mov     ebx, eax
680
    @@:
Line 658... Line 681...
658
    @@: push    ebx
681
        push    ebx
Line 659... Line 682...
659
 
682
 
660
        xor     edi, edi
683
        xor     edi, edi
Line 672... Line 695...
672
        mov     ecx, [esi + WDATA.cl_titlebar]
695
        mov     ecx, [esi + WDATA.cl_titlebar]
673
        test    ecx, 0x80000000
696
        test    ecx, 0x80000000
674
        jz      @f
697
        jz      @f
675
        sub     ecx, 0x00040404
698
        sub     ecx, 0x00040404
676
        mov     [esi + WDATA.cl_titlebar], ecx
699
        mov     [esi + WDATA.cl_titlebar], ecx
-
 
700
    @@:
677
    @@: and     ecx, 0x00ffffff
701
        and     ecx, 0x00ffffff
678
        call    [draw_line]
702
        call    [draw_line]
679
        inc     edx
703
        inc     edx
680
        cmp     edx, [esp]
704
        cmp     edx, [esp]
681
        jb      .next_line
705
        jb      .next_line
Line 751... Line 775...
751
        add     eax, [esi + WDATA.box.height]
775
        add     eax, [esi + WDATA.box.height]
Line 752... Line 776...
752
 
776
 
753
        cmp     ebx, eax
777
        cmp     ebx, eax
754
        jb      @f
778
        jb      @f
-
 
779
        mov     ebx, eax
755
        mov     ebx, eax
780
    @@:
Line 756... Line 781...
756
    @@: push    ebx
781
        push    ebx
Line 757... Line 782...
757
 
782
 
758
        xor     edi, edi
783
        xor     edi, edi
Line 768... Line 793...
768
        add     eax, 4 * 65536 - 4
793
        add     eax, 4 * 65536 - 4
769
        mov     ecx, [esi + WDATA.cl_titlebar]
794
        mov     ecx, [esi + WDATA.cl_titlebar]
770
        test    ecx, 0x40000000
795
        test    ecx, 0x40000000
771
        jz      @f
796
        jz      @f
772
        add     ecx, 0x00040404
797
        add     ecx, 0x00040404
-
 
798
    @@:
773
    @@: test    ecx, 0x80000000
799
        test    ecx, 0x80000000
774
        jz      @f
800
        jz      @f
775
        sub     ecx, 0x00040404
801
        sub     ecx, 0x00040404
-
 
802
    @@:
776
    @@: mov     [esi + WDATA.cl_titlebar], ecx
803
        mov     [esi + WDATA.cl_titlebar], ecx
777
        and     ecx, 0x00ffffff
804
        and     ecx, 0x00ffffff
778
        call    [draw_line]
805
        call    [draw_line]
779
        inc     edx
806
        inc     edx
780
        cmp     edx, [esp]
807
        cmp     edx, [esp]
781
        jb      .next_line
808
        jb      .next_line
Line 802... Line 829...
802
        add     bx, word[edx + WDATA.box.height]
829
        add     bx, word[edx + WDATA.box.height]
Line 803... Line 830...
803
 
830
 
804
        mov     esi, [edx + WDATA.cl_frames]
831
        mov     esi, [edx + WDATA.cl_frames]
805
        shr     esi, 1
832
        shr     esi, 1
-
 
833
        and     esi, 0x007f7f7f
-
 
834
        or      esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
-
 
835
        ror     ebx, 16
-
 
836
        add     ebx, [_skinh]
-
 
837
        sub     bx, 1
806
        and     esi, 0x007f7f7f
838
        rol     ebx, 16
Line 807... Line 839...
807
        call    draw_rectangle
839
        call    draw_rectangle
808
 
840
 
809
        push    esi
841
        push    esi
-
 
842
        mov     ecx, 3
Line 810... Line 843...
810
        mov     ecx, 3
843
        mov     esi, [edx + WDATA.cl_frames]
811
        mov     esi, [edx + WDATA.cl_frames]
844
        or      esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
812
 
845
 
813
  .next_frame:
846
  .next_frame:
814
        add     eax, 1 * 65536 - 1
847
        add     eax, 1 * 65536 - 1
815
        add     ebx, 1 * 65536 - 1
848
        add     ebx, 0 * 65536 - 1
Line 816... Line 849...
816
        call    draw_rectangle
849
        call    draw_rectangle
817
        dec     ecx
850
        dec     ecx
818
        jnz     .next_frame
851
        jnz     .next_frame
819
 
852
 
Line 820... Line 853...
820
        pop     esi
853
        pop     esi
Line 821... Line 854...
821
        add     eax, 1 * 65536 - 1
854
        add     eax, 1 * 65536 - 1
Line 893... Line 926...
893
        add     edx, ebx
926
        add     edx, ebx
Line 894... Line 927...
894
 
927
 
895
        mov     edi, [TASK_COUNT]
928
        mov     edi, [TASK_COUNT]
896
        movzx   esi, word[WIN_POS + edi * 2]
929
        movzx   esi, word[WIN_POS + edi * 2]
-
 
930
        call    window._.set_screen
897
        call    window._.set_screen
931
        inc     [_display.mask_seqno]
Line 898... Line 932...
898
        popad
932
        popad
899
 
933
 
900
        ; tell application to redraw itself
934
        ; tell application to redraw itself
Line 985... Line 1019...
985
        and     [edi + WDATA.fl_wstate], not WSTATE_MINIMIZED
1019
        and     [edi + WDATA.fl_wstate], not WSTATE_MINIMIZED
986
        mov     ebp, window._.set_screen
1020
        mov     ebp, window._.set_screen
987
        cmp     eax, [TASK_COUNT]
1021
        cmp     eax, [TASK_COUNT]
988
        jz      @f
1022
        jz      @f
989
        mov     ebp, calculatescreen
1023
        mov     ebp, calculatescreen
-
 
1024
    @@:
990
    @@: mov     eax, [edi + WDATA.box.left]
1025
        mov     eax, [edi + WDATA.box.left]
991
        mov     ebx, [edi + WDATA.box.top]
1026
        mov     ebx, [edi + WDATA.box.top]
992
        mov     ecx, [edi + WDATA.box.width]
1027
        mov     ecx, [edi + WDATA.box.width]
993
        mov     edx, [edi + WDATA.box.height]
1028
        mov     edx, [edi + WDATA.box.height]
994
        add     ecx, eax
1029
        add     ecx, eax
995
        add     edx, ebx
1030
        add     edx, ebx
996
        call    ebp
1031
        call    ebp
997
 
-
 
-
 
1032
        inc     [_display.mask_seqno]
998
        mov     byte[MOUSE_BACKGROUND], 0
1033
        mov     byte[MOUSE_BACKGROUND], 0
Line 999... Line 1034...
999
 
1034
 
1000
  .exit:
1035
  .exit:
1001
        popfd
1036
        popfd
Line 1020... Line 1055...
1020
        dec     bl
1055
        dec     bl
1021
        jnz     @f
1056
        jnz     @f
1022
        call    minimize_window
1057
        call    minimize_window
1023
        jmp     .exit
1058
        jmp     .exit
Line -... Line 1059...
-
 
1059
 
1024
 
1060
    @@:
Line 1025... Line 1061...
1025
    @@: call    restore_minimized_window
1061
        call    restore_minimized_window
1026
 
1062
 
Line 1027... Line 1063...
1027
  .exit:
1063
  .exit:
Line 1081... Line 1117...
1081
        xchg    eax, ecx
1117
        xchg    eax, ecx
1082
        call    window._.get_rolledup_height
1118
        call    window._.get_rolledup_height
1083
        mov     [ecx + BOX.height], eax
1119
        mov     [ecx + BOX.height], eax
1084
        xchg    eax, ecx
1120
        xchg    eax, ecx
Line -... Line 1121...
-
 
1121
 
1085
 
1122
    @@:
1086
    @@: call    window._.set_window_box
1123
        call    window._.set_window_box
Line 1087... Line 1124...
1087
        add     esp, BOX.sizeof
1124
        add     esp, sizeof.BOX
-
 
1125
 
1088
 
1126
  .exit:
Line 1089... Line 1127...
1089
  .exit:
1127
        inc     [_display.mask_seqno]
1090
        ret
1128
        ret
1091
 
1129
 
Line 1118... Line 1156...
1118
        jmp     .set_box
1156
        jmp     .set_box
Line 1119... Line 1157...
1119
 
1157
 
1120
  .restore_size:
1158
  .restore_size:
1121
        test    bl, WSTATE_MAXIMIZED
1159
        test    bl, WSTATE_MAXIMIZED
1122
        jnz     @f
1160
        jnz     @f
1123
        add     esp, -BOX.sizeof
1161
        add     esp, -sizeof.BOX
1124
        lea     eax, [edx + APPDATA.saved_box]
1162
        lea     eax, [edx + APPDATA.saved_box]
Line -... Line 1163...
-
 
1163
        jmp     .set_box
1125
        jmp     .set_box
1164
 
1126
 
1165
    @@:
1127
    @@: mov     eax, [screen_workarea.top]
1166
        mov     eax, [screen_workarea.top]
1128
        push    [screen_workarea.bottom] \
1167
        push    [screen_workarea.bottom] \
1129
                [edi + WDATA.box.width] \
1168
                [edi + WDATA.box.width] \
1130
                eax \
1169
                eax \
1131
                [edi + WDATA.box.left]
1170
                [edi + WDATA.box.left]
Line 1132... Line 1171...
1132
        sub     [esp + BOX.height], eax
1171
        sub     [esp + BOX.height], eax
1133
        mov     eax, esp
1172
        mov     eax, esp
1134
 
1173
 
Line 1135... Line 1174...
1135
  .set_box:
1174
  .set_box:
Line 1136... Line 1175...
1136
        call    window._.set_window_box
1175
        call    window._.set_window_box
1137
        add     esp, BOX.sizeof
1176
        add     esp, sizeof.BOX
Line 1230... Line 1269...
1230
        mov     ecx, [eax + BOX.left]
1269
        mov     ecx, [eax + BOX.left]
1231
        mov     edx, [ebx + BOX.left]
1270
        mov     edx, [ebx + BOX.left]
1232
        cmp     ecx, edx
1271
        cmp     ecx, edx
1233
        jle     @f
1272
        jle     @f
1234
        mov     ecx, edx
1273
        mov     ecx, edx
-
 
1274
    @@:
1235
    @@: mov     [draw_limits.left], ecx
1275
        mov     [draw_limits.left], ecx
1236
        mov     ecx, [eax + BOX.left]
1276
        mov     ecx, [eax + BOX.left]
1237
        add     ecx, [eax + BOX.width]
1277
        add     ecx, [eax + BOX.width]
1238
        add     edx, [ebx + BOX.width]
1278
        add     edx, [ebx + BOX.width]
1239
        cmp     ecx, edx
1279
        cmp     ecx, edx
1240
        jae     @f
1280
        jae     @f
1241
        mov     ecx, edx
1281
        mov     ecx, edx
-
 
1282
    @@:
1242
    @@: mov     [draw_limits.right], ecx
1283
        mov     [draw_limits.right], ecx
1243
        mov     ecx, [eax + BOX.top]
1284
        mov     ecx, [eax + BOX.top]
1244
        mov     edx, [ebx + BOX.top]
1285
        mov     edx, [ebx + BOX.top]
1245
        cmp     ecx, edx
1286
        cmp     ecx, edx
1246
        jle     @f
1287
        jle     @f
1247
        mov     ecx, edx
1288
        mov     ecx, edx
-
 
1289
    @@:
1248
    @@: mov     [draw_limits.top], ecx
1290
        mov     [draw_limits.top], ecx
1249
        mov     ecx, [eax + BOX.top]
1291
        mov     ecx, [eax + BOX.top]
1250
        add     ecx, [eax + BOX.height]
1292
        add     ecx, [eax + BOX.height]
1251
        add     edx, [ebx + BOX.height]
1293
        add     edx, [ebx + BOX.height]
1252
        cmp     ecx, edx
1294
        cmp     ecx, edx
1253
        jae     @f
1295
        jae     @f
1254
        mov     ecx, edx
1296
        mov     ecx, edx
-
 
1297
    @@:
1255
    @@: mov     [draw_limits.bottom], ecx
1298
        mov     [draw_limits.bottom], ecx
Line 1256... Line 1299...
1256
 
1299
 
1257
        ; recalculate screen buffer at old position
1300
        ; recalculate screen buffer at old position
1258
        push    ebx
1301
        push    ebx
1259
        mov     edx, [eax + BOX.height]
1302
        mov     edx, [eax + BOX.height]
Line 1307... Line 1350...
1307
	repz	cmpsd
1350
        repz cmpsd
1308
	pop	edi
1351
        pop     edi
1309
	jz	.exit
1352
        jz      .exit
1310
@@:
1353
@@:
Line 1311... Line 1354...
1311
 
1354
 
Line 1312... Line 1355...
1312
        add     esp, -BOX.sizeof
1355
        add     esp, -sizeof.BOX
1313
 
1356
 
1314
        mov     ebx, esp
1357
        mov     ebx, esp
1315
if WDATA.box
1358
if WDATA.box
1316
        lea     esi, [edi + WDATA.box]
1359
        lea     esi, [edi + WDATA.box]
1317
else
1360
else
1318
	mov	esi, edi ; optimization for WDATA.box = 0
1361
        mov     esi, edi ; optimization for WDATA.box = 0
1319
end if
1362
end if
1320
        xchg    eax, esi
1363
        xchg    eax, esi
1321
        mov     ecx, BOX.sizeof
1364
        mov     ecx, sizeof.BOX
1322
        call    memmove
1365
        call    memmove
1323
        xchg    eax, esi
1366
        xchg    eax, esi
1324
        xchg    ebx, esi
1367
        xchg    ebx, esi
Line 1328... Line 1371...
1328
 
1371
 
1329
        call    window._.check_window_position
1372
        call    window._.check_window_position
1330
        call    window._.set_window_clientbox
1373
        call    window._.set_window_clientbox
Line 1331... Line 1374...
1331
        call    window._.invalidate_screen
1374
        call    window._.invalidate_screen
Line 1332... Line 1375...
1332
 
1375
 
1333
        add     esp, BOX.sizeof
1376
        add     esp, sizeof.BOX
1334
 
1377
 
Line 1475... Line 1518...
1475
        cmp     cl, 4
1518
        cmp     cl, 4
1476
        je      @f
1519
        je      @f
Line 1477... Line 1520...
1477
 
1520
 
Line -... Line 1521...
-
 
1521
        xor     eax, eax
1478
        xor     eax, eax
1522
 
Line 1479... Line 1523...
1479
 
1523
    @@:
1480
    @@: mov     [edi + APPDATA.wnd_caption], eax
1524
        mov     [edi + APPDATA.wnd_caption], eax
1481
 
1525
 
1482
        mov     esi, [esp]
1526
        mov     esi, [esp]
Line 1599... Line 1643...
1599
        and     al, 0x0f
1643
        and     al, 0x0f
1600
        cmp     al, 0x03
1644
        cmp     al, 0x03
1601
        jne     @f
1645
        jne     @f
1602
        mov     eax, [_skinh]
1646
        mov     eax, [_skinh]
1603
        ret
1647
        ret
-
 
1648
    @@:
1604
    @@: mov     eax, 21
1649
        mov     eax, 21
1605
        ret
1650
        ret
Line 1606... Line 1651...
1606
 
1651
 
1607
align 4
1652
align 4
1608
;------------------------------------------------------------------------------
1653
;------------------------------------------------------------------------------
Line 1617... Line 1662...
1617
        cmp     al, 0x03
1662
        cmp     al, 0x03
1618
        jb      @f
1663
        jb      @f
1619
        mov     eax, [_skinh]
1664
        mov     eax, [_skinh]
1620
        add     eax, 3
1665
        add     eax, 3
1621
        ret
1666
        ret
-
 
1667
    @@:
1622
    @@: or      al, al
1668
        or      al, al
1623
        jnz     @f
1669
        jnz     @f
1624
        mov     eax, 21
1670
        mov     eax, 21
1625
        ret
1671
        ret
-
 
1672
    @@:
1626
    @@: mov     eax, 21 + 2
1673
        mov     eax, 21 + 2
1627
        ret
1674
        ret
Line 1628... Line 1675...
1628
 
1675
 
1629
align 4
1676
align 4
1630
;------------------------------------------------------------------------------
1677
;------------------------------------------------------------------------------
Line 1768... Line 1815...
1768
        test    al,al
1815
        test    al, al
1769
        jz      @f
1816
        jz      @f
1770
        mov     eax, esi
1817
        mov     eax, esi
1771
        mov     [ebp], al
1818
        mov     [ebp], al
1772
        ; -- end body --
1819
        ; -- end body --
-
 
1820
    @@:
1773
    @@: inc     ebp
1821
        inc     ebp
1774
        inc     edx
1822
        inc     edx
1775
        cmp     edx, [ff_xsz]
1823
        cmp     edx, [ff_xsz]
1776
        jb      .ff_new_x
1824
        jb      .ff_new_x
Line 1777... Line 1825...
1777
 
1825
 
Line 1785... Line 1833...
1785
 
1833
 
Line 1786... Line 1834...
1786
        add     esp, 24
1834
        add     esp, 24
1787
 
1835
 
-
 
1836
  .exit:
1788
  .exit:
1837
        popad
Line 1789... Line 1838...
1789
        popad
1838
        inc     [_display.mask_seqno]
1790
        ret
1839
        ret
1791
 
1840
 
Line 2003... Line 2052...
2003
;------------------------------------------------------------------------------
2052
;------------------------------------------------------------------------------
2004
window._.draw_window_caption: ;////////////////////////////////////////////////
2053
window._.draw_window_caption: ;////////////////////////////////////////////////
2005
;------------------------------------------------------------------------------
2054
;------------------------------------------------------------------------------
2006
;? 
2055
;? 
2007
;------------------------------------------------------------------------------
2056
;------------------------------------------------------------------------------
2008
        inc     [mouse_pause]
-
 
2009
        call    [_display.disable_mouse]
-
 
2010
 
-
 
2011
        xor     eax, eax
2057
        xor     eax, eax
2012
        mov     edx, [TASK_COUNT]
2058
        mov     edx, [TASK_COUNT]
2013
        movzx   edx, word[WIN_POS + edx * 2]
2059
        movzx   edx, word[WIN_POS + edx * 2]
2014
        cmp     edx, [CURRENT_TASK]
2060
        cmp     edx, [CURRENT_TASK]
2015
        jne     @f
2061
        jne     @f
2016
        inc     eax
2062
        inc     eax
-
 
2063
    @@:
2017
    @@: mov     edx, [CURRENT_TASK]
2064
        mov     edx, [CURRENT_TASK]
2018
        shl     edx, 5
2065
        shl     edx, 5
2019
        add     edx, window_data
2066
        add     edx, window_data
2020
        movzx   ebx, [edx + WDATA.fl_wstyle]
2067
        movzx   ebx, [edx + WDATA.fl_wstyle]
2021
        and     bl, 0x0F
2068
        and     bl, 0x0F
2022
        cmp     bl, 3
2069
        cmp     bl, 3
Line 2043... Line 2090...
2043
        cmp     bl, 0
2090
        cmp     bl, 0
2044
        jne     .2
2091
        jne     .2
Line 2045... Line 2092...
2045
 
2092
 
Line -... Line 2093...
-
 
2093
        call    drawwindow_I_caption
2046
        call    drawwindow_I_caption
2094
 
2047
 
2095
  .2:
2048
  .2:   mov     edi, [CURRENT_TASK]
2096
        mov     edi, [CURRENT_TASK]
2049
        shl     edi, 5
2097
        shl     edi, 5
2050
        test    [edi + window_data + WDATA.fl_wstyle], WSTYLE_HASCAPTION
2098
        test    [edi + window_data + WDATA.fl_wstyle], WSTYLE_HASCAPTION
2051
        jz      .exit
2099
        jz      .exit
Line 2115... Line 2163...
2115
        or      ecx, 0x80000000
2163
        or      ecx, 0x80000000
2116
        xor     edi, edi
2164
        xor     edi, edi
2117
        call    dtext_asciiz_esi
2165
        call    dtext_asciiz_esi
Line 2118... Line 2166...
2118
 
2166
 
2119
  .exit:
-
 
2120
        dec     [mouse_pause]
2167
  .exit:
2121
        call    [draw_pointer]
2168
        call    [draw_pointer]
Line 2122... Line 2169...
2122
        ret
2169
        ret
2123
 
2170
 
Line 2149... Line 2196...
2149
;> edi = pointer to BOX struct
2196
;> edi = pointer to BOX struct
2150
;------------------------------------------------------------------------------
2197
;------------------------------------------------------------------------------
2151
        push    eax ebx esi
2198
        push    eax ebx esi
2152
	xor	esi,esi
2199
        xor     esi, esi
2153
	jmp	window._.draw_negative_box.1
2200
        jmp     window._.draw_negative_box.1
2154
2201
 
-
 
2202
 
-
 
2203
;------------------------------------------------------------------------------
-
 
2204
window._.get_rect: ;/////////////////////////////////////////////////////
-
 
2205
;------------------------------------------------------------------------------
-
 
2206
;?   void __fastcall get_window_rect(struct RECT* rc);
-
 
2207
;------------------------------------------------------------------------------
-
 
2208
;> ecx = pointer to RECT
-
 
2209
;------------------------------------------------------------------------------
-
 
2210
        mov     eax, [TASK_BASE]
-
 
2211
 
-
 
2212
        mov     edx, [eax-twdw + WDATA.box.left]
-
 
2213
        mov     [ecx+RECT.left], edx
-
 
2214
 
-
 
2215
        add     edx, [eax-twdw + WDATA.box.width]
-
 
2216
        mov     [ecx+RECT.right], edx
-
 
2217
 
-
 
2218
        mov     edx, [eax-twdw + WDATA.box.top]
-
 
2219
        mov     [ecx+RECT.top], edx
-
 
2220
 
-
 
2221
        add     edx, [eax-twdw + WDATA.box.height]
-
 
2222
        mov     [ecx+RECT.bottom], edx
-
 
2223
 
-
 
2224
        ret
-
 
2225
-
 
2226