Subversion Repositories Kolibri OS

Rev

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

Rev 114 Rev 115
Line 66... Line 66...
66
        align 4
66
        align 4
67
      .new_wnd:
67
      .new_wnd:
68
        movzx   edi, word [0xC400 + esi * 2]
68
        movzx   edi, word [0xC400 + esi * 2]
69
        shl     edi, 5
69
        shl     edi, 5
Line 70... Line 70...
70
 
70
 
71
        cmp     [0x3000+edi+0xa], byte 9
71
        cmp     [0x3000+edi+TASKDATA.state], byte 9
Line 72... Line 72...
72
        je      .not_wnd
72
        je      .not_wnd
73
 
73
 
74
        add     edi, window_data
74
        add     edi, window_data
Line 145... Line 145...
145
;  edx  y end
145
;  edx  y end
146
;  esi  process number
146
;  esi  process number
147
pushad
147
pushad
148
        mov edi, esi ;;;word [esi*2+0xc400]
148
        mov edi, esi ;;;word [esi*2+0xc400]
149
        shl   edi, 8
149
        shl   edi, 8
150
        add   edi, 0x80000+0x80  ; address of random shaped window area
150
        add   edi, 0x80000  ; address of random shaped window area
151
        cmp   [edi], dword 0
151
        cmp   [edi+APPDATA.wnd_shape], dword 0
152
        jne   .free_form
152
        jne   .free_form
Line 153... Line 153...
153
 
153
 
154
        ; get x&y size
154
        ; get x&y size
155
        sub   ecx, eax
155
        sub   ecx, eax
Line 212... Line 212...
212
        sub  ecx, eax
212
        sub  ecx, eax
213
        sub  edx, ebx
213
        sub  edx, ebx
214
        inc  ecx
214
        inc  ecx
215
        inc  edx
215
        inc  edx
Line 216... Line 216...
216
 
216
 
Line 217... Line 217...
217
        push  dword [edi+4]  ; push scale first -> for loop
217
        push  dword [edi+APPDATA.wnd_shape_scale]  ; push scale first -> for loop
218
 
218
 
219
        ; get WinMap start  -> ebp
219
        ; get WinMap start  -> ebp
220
        push  eax
220
        push  eax
221
        mov   eax, [0xFE00] ; screen_sx
221
        mov   eax, [0xFE00] ; screen_sx
222
        inc   eax
222
        inc   eax
223
        imul  eax, ebx
223
        imul  eax, ebx
224
        add   eax, [esp]
224
        add   eax, [esp]
Line 225... Line 225...
225
        add   eax, WinMapAddress
225
        add   eax, WinMapAddress
226
        mov   ebp, eax
226
        mov   ebp, eax
Line 227... Line 227...
227
 
227
 
228
        mov   edi, [edi]
228
        mov   edi, [edi+APPDATA.wnd_shape]
229
        pop   eax
229
        pop   eax
Line 362... Line 362...
362
 
362
 
363
     cmp  eax,2       ; set common window colours
363
     cmp  eax,2       ; set common window colours
364
     jne  no_com_colours
364
     jne  no_com_colours
365
     mov  [windowtypechanged],dword 1
365
     mov  [windowtypechanged],dword 1
366
     mov  esi,[0x3010]
366
     mov  esi,[0x3010]
367
     add  esi,0x10
367
     add  esi,TASKDATA.mem_start
368
     add  ebx,[esi]
368
     add  ebx,[esi]
369
     mov  esi,ebx
369
     mov  esi,ebx
370
     mov  edi,common_colours
370
     mov  edi,common_colours
371
     and  ecx,127
371
     and  ecx,127
Line 376... Line 376...
376
   no_com_colours:
376
   no_com_colours:
Line 377... Line 377...
377
 
377
 
378
     cmp  eax,3       ; get common window colours
378
     cmp  eax,3       ; get common window colours
379
     jne  no_get_com
379
     jne  no_get_com
380
     mov  esi,[0x3010]
380
     mov  esi,[0x3010]
381
     add  esi,0x10
381
     add  esi,TASKDATA.mem_start
382
     add  ebx,[esi]
382
     add  ebx,[esi]
383
     mov  edi,ebx
383
     mov  edi,ebx
384
     mov  esi,common_colours
384
     mov  esi,common_colours
385
     and  ecx,127
385
     and  ecx,127
Line 455... Line 455...
455
 
455
 
456
        cmp     eax,8       ; set window skin
456
        cmp     eax,8       ; set window skin
457
        jne     no_set_skin
457
        jne     no_set_skin
458
        mov     eax,ebx
458
        mov     eax,ebx
459
        mov     edi,[0x3010]
459
        mov     edi,[0x3010]
460
        add     ebx,[edi+0x10]        ; abs start of info block
460
        add     ebx,[edi+TASKDATA.mem_start]        ; abs start of info block
461
        pushd   [ebx+0] [ebx+4] [ebx+8] [ebx+12]
461
        pushd   [ebx+0] [ebx+4] [ebx+8] [ebx+12]
462
        mov     dword[ebx+0],0        ; read
462
        mov     dword[ebx+0],0        ; read
463
        mov     dword[ebx+4],0        ; from the beginning
463
        mov     dword[ebx+4],0        ; from the beginning
464
        mov     dword[ebx+8],64       ; 32 KBytes maximum
464
        mov     dword[ebx+8],64       ; 32 KBytes maximum
Line 565... Line 565...
565
 
565
 
Line 566... Line 566...
566
check_window_position:
566
check_window_position:
Line 567... Line 567...
567
 
567
 
568
    pushad                           ; window inside screen ?
568
    pushad                           ; window inside screen ?
569
 
569
 
570
    movzx eax,word [edi+0]
570
    movzx eax,word [edi+WDATA.box.left]
Line 571... Line 571...
571
    movzx ebx,word [edi+4]
571
    movzx ebx,word [edi+WDATA.box.top]
572
    movzx ecx,word [edi+8]
572
    movzx ecx,word [edi+WDATA.box.width]
573
    movzx edx,word [edi+12]
573
    movzx edx,word [edi+WDATA.box.height]
574
 
574
 
575
    mov   esi,ecx             ; check x pos
575
    mov   esi,ecx             ; check x pos
576
    add   esi,eax
576
    add   esi,eax
577
    cmp   esi,[0xfe00]
577
    cmp   esi,[0xfe00]
Line 578... Line 578...
578
    jbe   x_pos_ok
578
    jbe   x_pos_ok
579
    mov   [edi+0],dword 0
579
    mov   [edi+WDATA.box.left],dword 0
580
    xor   eax, eax
580
    xor   eax, eax
581
  x_pos_ok:
581
  x_pos_ok:
582
 
582
 
583
    mov   esi,edx             ; check y pos
583
    mov   esi,edx             ; check y pos
584
    add   esi,ebx
584
    add   esi,ebx
Line 585... Line 585...
585
    cmp   esi,[0xfe04]
585
    cmp   esi,[0xfe04]
586
    jbe   y_pos_ok
586
    jbe   y_pos_ok
587
    mov   [edi+4],dword 0
587
    mov   [edi+WDATA.box.top],dword 0
588
    mov   ebx,0
588
    mov   ebx,0
589
  y_pos_ok:
589
  y_pos_ok:
590
 
590
 
591
    mov   esi,ecx             ; check x size
591
    mov   esi,ecx             ; check x size
Line 592... Line 592...
592
    add   esi,eax
592
    add   esi,eax
593
    cmp   esi,[0xfe00]
593
    cmp   esi,[0xfe00]
594
    jbe   x_size_ok
594
    jbe   x_size_ok
595
    mov   ecx,[0xfe00]
595
    mov   ecx,[0xfe00]
596
    mov   [edi+8],ecx
596
    mov   [edi+WDATA.box.width],ecx
597
  x_size_ok:
597
  x_size_ok:
598
 
598
 
Line 599... Line 599...
599
    mov   esi,edx             ; check y size
599
    mov   esi,edx             ; check y size
Line 600... Line 600...
600
    add   esi,ebx
600
    add   esi,ebx
Line 616... Line 616...
616
 
616
 
Line 617... Line 617...
617
sys_window_mouse:
617
sys_window_mouse:
Line 618... Line 618...
618
 
618
 
619
    push  eax
619
    push  eax
620
 
620
 
Line 621... Line 621...
621
    mov   eax,[timer_ticks] ;[0xfdf0]
621
    mov   eax,[timer_ticks]
622
    cmp   [new_window_starting],eax
622
    cmp   [new_window_starting],eax
Line 636... Line 636...
636
 
636
 
Line 637... Line 637...
637
 
637
 
638
 
638
 
639
drawwindow_I_caption:
639
drawwindow_I_caption:
640
 
640
 
641
        mov   ecx,[edx+20]   ; grab bar
641
        mov   ecx,[edx+WDATA.cl_titlebar]   ; grab bar
642
        push  ecx
642
        push  ecx
643
        mov   esi,edx
643
        mov   esi,edx
644
        mov   edx,[esi+04]
644
        mov   edx,[esi+WDATA.box.top]
645
        add   edx,1
645
        add   edx,1
646
        mov   ebx,[esi+04]
646
        mov   ebx,[esi+WDATA.box.top]
647
        add   ebx,21
647
        add   ebx,21
648
        mov   eax,[esi+04]
648
        mov   eax,[esi+WDATA.box.top]
649
        add   eax,[esi+12]
649
        add   eax,[esi+WDATA.box.height]
650
        cmp   ebx,eax
650
        cmp   ebx,eax
651
        jb    .wdsizeok
651
        jb    .wdsizeok
652
        mov   ebx,eax
652
        mov   ebx,eax
653
  .wdsizeok:
653
  .wdsizeok:
654
        push  ebx
654
        push  ebx
655
  .drwi:
655
  .drwi:
656
        mov   ebx,edx
656
        mov   ebx,edx
657
        shl   ebx,16
657
        shl   ebx,16
658
        add   ebx,edx
658
        add   ebx,edx
659
        mov   eax,[esi+00]
659
        mov   eax,[esi+WDATA.box.left]
660
        inc   eax
660
        inc   eax
661
        shl   eax,16
661
        shl   eax,16
662
        add   eax,[esi+00]
662
        add   eax,[esi+WDATA.box.left]
663
        add   eax,[esi+8]
663
        add   eax,[esi+WDATA.box.width]
664
        sub   eax,1
664
        sub   eax,1
665
        push  edx
665
        push  edx
666
        mov   edx,0x80000000
666
        mov   edx,0x80000000
667
        mov   ecx,[esi+20]
667
        mov   ecx,[esi+WDATA.cl_titlebar]
668
        and   ecx,edx
668
        and   ecx,edx
669
        cmp   ecx,edx
669
        cmp   ecx,edx
670
        jnz   .nofa
670
        jnz   .nofa
671
        mov   ecx,[esi+20]
671
        mov   ecx,[esi+WDATA.cl_titlebar]
672
        sub   ecx,0x00040404
672
        sub   ecx,0x00040404
673
        mov   [esi+20],ecx
673
        mov   [esi+WDATA.cl_titlebar],ecx
674
        and   ecx,0x00ffffff
674
        and   ecx,0x00ffffff
675
        jmp   .faj
675
        jmp   .faj
676
  .nofa:
676
  .nofa:
677
        mov   ecx,[esi+20]
677
        mov   ecx,[esi+WDATA.cl_titlebar]
678
        and   ecx,0x00ffffff
678
        and   ecx,0x00ffffff
679
  .faj:
679
  .faj:
680
        pop   edx
680
        pop   edx
681
        mov   edi,0
681
        mov   edi,0
682
        call  [draw_line]
682
        call  [draw_line]
683
        inc   edx
683
        inc   edx
684
        cmp   edx,[esp]
684
        cmp   edx,[esp]
Line 685... Line 685...
685
        jb    .drwi
685
        jb    .drwi
Line 686... Line 686...
686
        add   esp,4
686
        add   esp,4
Line 687... Line 687...
687
        pop   ecx
687
        pop   ecx
Line 688... Line 688...
688
        mov   [esi+20],ecx
688
        mov   [esi+WDATA.cl_titlebar],ecx
689
 
689
 
690
        ret
690
        ret
691
 
691
 
692
 
692
 
693
drawwindow_I:
693
drawwindow_I:
694
 
694
 
695
        pushad
695
        pushad
696
 
696
 
697
        mov   esi,[edx+24]   ; rectangle
697
        mov   esi,[edx+WDATA.cl_frames]   ; rectangle
Line 698... Line 698...
698
        mov   eax,[edx+0]
698
        mov   eax,[edx+WDATA.box.left]
Line 699... Line 699...
699
        shl   eax,16
699
        shl   eax,16
700
        add   eax,[edx+0]
700
        add   eax,[edx+WDATA.box.left]
701
        add   eax,[edx+8]
701
        add   eax,[edx+WDATA.box.width]
702
        mov   ebx,[edx+04]
702
        mov   ebx,[edx+WDATA.box.top]
703
        shl   ebx,16
703
        shl   ebx,16
704
        add   ebx,[edx+4]
704
        add   ebx,[edx+WDATA.box.top]
705
        add   ebx,[edx+12]
705
        add   ebx,[edx+WDATA.box.height]
706
        call  draw_rectangle
706
        call  draw_rectangle
707
 
707
 
708
        call    drawwindow_I_caption
708
        call    drawwindow_I_caption
709
 
709
 
710
        mov   edx,[esi+04]      ; inside work area
710
        mov   edx,[esi+WDATA.box.top]      ; inside work area
711
        add   edx,21+5
711
        add   edx,21+5
Line 712... Line 712...
712
        mov   ebx,[esi+04]
712
        mov   ebx,[esi+WDATA.box.top]
Line 769... Line 769...
769
        ret
769
        ret
Line 770... Line 770...
770
 
770
 
Line 771... Line 771...
771
 
771
 
772
drawwindow_III_caption:
772
drawwindow_III_caption:
773
 
773
 
774
        mov   ecx,[edx+20]                       ; GRAB BAR
774
        mov   ecx,[edx+WDATA.cl_titlebar]                       ; GRAB BAR
775
        push  ecx
775
        push  ecx
776
        mov   esi,edx
776
        mov   esi,edx
777
        mov   edx,[esi+04]
777
        mov   edx,[esi+WDATA.box.top]
778
        add   edx,4
778
        add   edx,4
779
        mov   ebx,[esi+04]
779
        mov   ebx,[esi+WDATA.box.top]
780
        add   ebx,20
780
        add   ebx,20
781
        mov   eax,[esi+04]
781
        mov   eax,[esi+WDATA.box.top]
782
        add   eax,[esi+12]
782
        add   eax,[esi+WDATA.box.height]
783
        cmp   ebx,eax
783
        cmp   ebx,eax
784
        jb    .wdsizeok
784
        jb    .wdsizeok
785
        mov   ebx,eax
785
        mov   ebx,eax
786
  .wdsizeok:
786
  .wdsizeok:
787
        push  ebx
787
        push  ebx
788
  .drwi:
788
  .drwi:
789
        mov   ebx,edx
789
        mov   ebx,edx
790
        shl   ebx,16
790
        shl   ebx,16
791
        add   ebx,edx
791
        add   ebx,edx
792
        mov   eax,[esi+00]
792
        mov   eax,[esi+WDATA.box.left]
793
        shl   eax,16
793
        shl   eax,16
794
        add   eax,[esi+00]
794
        add   eax,[esi+WDATA.box.left]
795
        add   eax,[esi+8]
795
        add   eax,[esi+WDATA.box.width]
796
        add   eax,4*65536-4
796
        add   eax,4*65536-4
797
        mov   ecx,[esi+20]
797
        mov   ecx,[esi+WDATA.cl_titlebar]
798
        test  ecx,0x40000000
798
        test  ecx,0x40000000
799
        jz    .nofa
799
        jz    .nofa
800
        add   ecx,0x040404
800
        add   ecx,0x040404
801
  .nofa:
801
  .nofa:
802
        test  ecx,0x80000000
802
        test  ecx,0x80000000
803
        jz    .nofa2
803
        jz    .nofa2
804
        sub   ecx,0x040404
804
        sub   ecx,0x040404
805
  .nofa2:
805
  .nofa2:
806
        mov   [esi+20],ecx
806
        mov   [esi+WDATA.cl_titlebar],ecx
807
        and   ecx,0xffffff
807
        and   ecx,0xffffff
808
        xor   edi, edi
808
        xor   edi, edi
809
        call  [draw_line]
809
        call  [draw_line]
810
        inc   edx
810
        inc   edx
811
        cmp   edx,[esp]
811
        cmp   edx,[esp]
812
        jb    .drwi
812
        jb    .drwi
Line 813... Line 813...
813
        add   esp,4
813
        add   esp,4
Line 814... Line 814...
814
        pop   ecx
814
        pop   ecx
Line 815... Line 815...
815
        mov   [esi+20],ecx
815
        mov   [esi+WDATA.cl_titlebar],ecx
Line 816... Line 816...
816
 
816
 
817
        ret
817
        ret
818
 
818
 
819
 
819
 
820
drawwindow_III:
820
drawwindow_III:
821
 
821
 
822
        pushad
822
        pushad
823
 
823
 
824
        mov   edi,edx                              ; RECTANGLE
824
        mov   edi,edx                              ; RECTANGLE
825
        mov   eax,[edi+0]
825
        mov   eax,[edi+WDATA.box.left]
826
        shl   eax,16
826
        shl   eax,16
827
        mov   ax,[edi+0]
827
	mov   ax, word [edi+WDATA.box.left]
828
        add   ax,[edi+8]
828
	add   ax, word [edi+WDATA.box.width]
829
        mov   ebx,[edi+4]
829
        mov   ebx,[edi+WDATA.box.top]
830
        shl   ebx,16
830
        shl   ebx,16
831
        mov   bx,[edi+4]
831
	mov   bx, word [edi+WDATA.box.top]
832
        add   bx,[edi+12]
832
	add   bx, word [edi+WDATA.box.height]
833
        mov   esi,[edi+24]
833
        mov   esi,[edi+WDATA.cl_frames]
834
        shr   esi,1
834
        shr   esi,1
835
        and   esi,0x007f7f7f
835
        and   esi,0x007f7f7f
836
        push  esi
836
        push  esi
837
        call  draw_rectangle
837
        call  draw_rectangle
838
        mov   ecx,3
838
        mov   ecx,3
839
      dw3l:
839
      dw3l:
840
        add   eax,1*65536-1
840
        add   eax,1*65536-1
841
        add   ebx,1*65536-1
841
        add   ebx,1*65536-1
Line 842... Line 842...
842
        mov   esi,[edi+24]
842
        mov   esi,[edi+WDATA.cl_frames]
Line 843... Line 843...
843
        call  draw_rectangle
843
        call  draw_rectangle
844
        dec   ecx
844
        dec   ecx
845
        jnz   dw3l
845
        jnz   dw3l
846
        pop   esi
846
        pop   esi
847
        add   eax,1*65536-1
847
        add   eax,1*65536-1
848
        add   ebx,1*65536-1
848
        add   ebx,1*65536-1
849
        call  draw_rectangle
849
        call  draw_rectangle
850
 
850
 
851
        call    drawwindow_III_caption
851
        call    drawwindow_III_caption
852
 
852
 
853
        mov   edx,[esi+04]                       ; WORK AREA
853
        mov   edx,[esi+WDATA.box.top]                       ; WORK AREA
854
        add   edx,21+5
854
        add   edx,21+5
855
        mov   ebx,[esi+04]
855
        mov   ebx,[esi+WDATA.box.top]
856
        add   ebx,[esi+12]
856
        add   ebx,[esi+WDATA.box.height]
857
        cmp   edx,ebx
857
        cmp   edx,ebx
Line 858... Line 858...
858
        jg    noinside2
858
        jg    noinside2
Line 969... Line 969...
969
        cmp   esi, eax
969
        cmp   esi, eax
970
        ja    .all_wnds_to_top
970
        ja    .all_wnds_to_top
Line 971... Line 971...
971
 
971
 
972
        movzx eax, word [esi]
972
        movzx eax, word [esi]
973
        shl   eax, 5
973
        shl   eax, 5
974
        cmp   [0x3000 + eax + 0xa], byte 9
974
        cmp   [0x3000 + eax + TASKDATA.state], byte 9
Line 975... Line 975...
975
        je    .new_check                    ; skip dead windows
975
        je    .new_check                    ; skip dead windows
Line 976... Line 976...
976
 
976
 
977
        lea   esi, [eax+window_data]
977
        lea   esi, [eax+window_data]
978
 
978
 
Line 979... Line 979...
979
        mov   ebx, [edi+4]  ; y0
979
        mov   ebx, [edi+WDATA.box.top]  ; y0
980
        mov   edx, [edi+12]
980
        mov   edx, [edi+WDATA.box.height]
981
        add   edx, ebx      ; y0e
981
        add   edx, ebx      ; y0e
982
 
982
 
983
        mov   ecx, [esi+4]  ; y  ; y check
983
        mov   ecx, [esi+WDATA.box.top]  ; y  ; y check
984
        cmp   ecx, edx      
984
        cmp   ecx, edx      
985
        jae   .new_check     ; y < y0e
985
        jae   .new_check     ; y < y0e
Line 986... Line 986...
986
        mov   eax, [esi+12]
986
        mov   eax, [esi+WDATA.box.height]
987
        add   ecx, eax       ; ye
987
        add   ecx, eax       ; ye
988
        cmp   ebx, ecx       ; y0 >= ye
988
        cmp   ebx, ecx       ; y0 >= ye
Line 989... Line 989...
989
        ja    .new_check
989
        ja    .new_check
990
 
990
 
991
        mov   eax, [edi+0]   ; x0
991
        mov   eax, [edi+WDATA.box.left]   ; x0
992
        mov   ecx, [edi+8]
992
        mov   ecx, [edi+WDATA.box.width]
993
        add   ecx, eax       ; x0e
993
        add   ecx, eax       ; x0e
994
 
994
 
995
        mov   edx, [esi+0]   ; x ; x check
995
        mov   edx, [esi+WDATA.box.left]   ; x ; x check
Line 996... Line 996...
996
        cmp   edx, ecx
996
        cmp   edx, ecx
Line 1033... Line 1033...
1033
        movzx esi, word [0xC400 + edi * 2]
1033
        movzx esi, word [0xC400 + edi * 2]
1034
        shl   esi, 5
1034
        shl   esi, 5
1035
        add   esi, window_data
1035
        add   esi, window_data
Line 1036... Line 1036...
1036
 
1036
 
1037
        ; coordinates of the upper window
1037
        ; coordinates of the upper window
1038
        mov   eax, [esi+00] ; cx
1038
	mov   eax, [esi + WDATA.box.left]   ; cx
1039
        mov   ebx, [esi+04] ; cy
1039
	mov   ebx, [esi + WDATA.box.top]    ; cy
1040
        mov   ecx, [esi+08] ; sx
1040
	mov   ecx, [esi + WDATA.box.width]  ; sx
Line 1041... Line 1041...
1041
        mov   edx, [esi+12] ; sy
1041
	mov   edx, [esi + WDATA.box.height] ; sy
1042
 
1042
 
Line 1043... Line 1043...
1043
        add   ecx, eax       ; ecx = x_end
1043
        add   ecx, eax       ; ecx = x_end
1044
        add   edx, ebx       ; edx = y_end
1044
        add   edx, ebx       ; edx = y_end
1045
 
1045
 
1046
        mov   edi, [0x3004]
1046
        mov   edi, [0x3004]
Line 1047... Line 1047...
1047
        movzx esi, word [0xC400 + edi * 2]
1047
        movzx esi, word [0xC400 + edi * 2]
1048
        call  setscreen
1048
        call  setscreen
Line 1049... Line 1049...
1049
        popad
1049
        popad
Line 1050... Line 1050...
1050
 
1050
 
Line 1173... Line 1173...
1173
        dec   esi
1173
        dec   esi
1174
        movzx edi, word [0xC400 + esi * 2] ; ebx
1174
        movzx edi, word [0xC400 + esi * 2] ; ebx
1175
        shl   edi, 5
1175
        shl   edi, 5
1176
        add   edi, window_data
1176
        add   edi, window_data
1177
;        mov   edi, ebx
1177
;        mov   edi, ebx
1178
        mov   ecx, [edi+0]
1178
	mov   ecx, [edi + WDATA.box.left]
1179
        mov   edx, [edi+4]
1179
	mov   edx, [edi + WDATA.box.top]
Line 1180... Line 1180...
1180
 
1180
 
1181
        mov   eax,ecx
1181
        mov   eax,ecx
1182
        mov   ebx,edx
1182
        mov   ebx,edx
1183
        test    [edi+WDATA.fl_wstate],WSTATE_MINIMIZED
1183
        test    [edi+WDATA.fl_wstate],WSTATE_MINIMIZED
Line 1188... Line 1188...
1188
       
1188
       
1189
        cmp   ecx, eax
1189
        cmp   ecx, eax
1190
        jae   cwloop
1190
        jae   cwloop
1191
        cmp   edx, ebx
1191
        cmp   edx, ebx
1192
        jae   cwloop
1192
        jae   cwloop
1193
        add   ecx, [edi+8]
1193
	add   ecx, [edi + WDATA.box.width]
1194
        add   edx, [edi+12]
1194
	add   edx, [edi + WDATA.box.height]
1195
        cmp   eax, ecx
1195
        cmp   eax, ecx
1196
        jae   cwloop
1196
        jae   cwloop
1197
        cmp   ebx, edx
1197
        cmp   ebx, edx
Line 1216... Line 1216...
1216
   .move_resize_window:    ; MOVE OR RESIZE WINDOW
1216
   .move_resize_window:    ; MOVE OR RESIZE WINDOW
Line 1217... Line 1217...
1217
 
1217
 
Line 1218... Line 1218...
1218
        popad
1218
        popad
1219
 
1219
 
1220
        ; Check for user enabled fixed window
1220
        ; Check for user enabled fixed window
1221
        mov   edx, [edi+0x14]
1221
	mov   edx, [edi + WDATA.cl_titlebar]
1222
        and   edx, 0x0f000000
1222
        and   edx, 0x0f000000
1223
        cmp   edx, 0x01000000
1223
        cmp   edx, 0x01000000
1224
        jne   .window_move_enabled_for_user
1224
        jne   .window_move_enabled_for_user
Line 1228... Line 1228...
1228
 
1228
 
1229
        test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
1229
	test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
Line 1230... Line 1230...
1230
        jnz     .no_resize_2
1230
        jnz     .no_resize_2
1231
 
1231
 
1232
        mov   [do_resize_from_corner],byte 0   ; resize for skinned window
1232
        mov   [do_resize_from_corner],byte 0   ; resize for skinned window
1233
        mov   edx, [edi+0x10]
1233
	mov   edx, [edi + WDATA.cl_workarea]
1234
        and   edx, 0x0f000000
1234
        and   edx, 0x0f000000
Line 1235... Line 1235...
1235
        cmp   edx, 0x02000000
1235
        cmp   edx, 0x02000000
1236
        jb    .no_resize_2 ; not type 2 wnd
1236
        jb    .no_resize_2 ; not type 2 wnd
1237
 
1237
 
1238
        mov   edx, [edi+4]
1238
	mov   edx, [edi + WDATA.box.top]
1239
        add   edx, [edi+12]
1239
	add   edx, [edi + WDATA.box.height]
1240
        sub   edx, 6       ; edx = y_end - 6
1240
        sub   edx, 6       ; edx = y_end - 6
1241
        cmp   ebx, edx     ; ebx = mouse_y
1241
        cmp   ebx, edx     ; ebx = mouse_y
1242
        jb    .no_resize_2
1242
        jb    .no_resize_2
Line 1243... Line 1243...
1243
        mov   [do_resize_from_corner],byte 1
1243
        mov   [do_resize_from_corner],byte 1
1244
        jmp   .continue
1244
        jmp   .continue
1245
      .no_resize_2:
1245
      .no_resize_2:
1246
 
1246
 
1247
        push    eax
1247
        push    eax
1248
        call    get_titlebar_height
1248
        call    get_titlebar_height
Line 1249... Line 1249...
1249
        add     eax,[edi+4]
1249
	add     eax,[edi + WDATA.box.top]
Line 1265... Line 1265...
1265
        mov   [latest_window_touch_delta], edx
1265
        mov   [latest_window_touch_delta], edx
Line 1266... Line 1266...
1266
 
1266
 
1267
        mov   cl, [0xfb40]     ; save for shade check
1267
        mov   cl, [0xfb40]     ; save for shade check
1268
        mov   [do_resize], cl
1268
        mov   [do_resize], cl
1269
     no_emulation_righ_button:
1269
     no_emulation_righ_button:
1270
        mov   ecx, [edi+0]
1270
	mov   ecx, [edi + WDATA.box.left]
Line 1271... Line 1271...
1271
        mov   edx, [edi+4]
1271
	mov   edx, [edi + WDATA.box.top]
1272
 
1272
 
1273
        push  eax ecx edx
1273
        push  eax ecx edx
1274
        mov   [dlx], ecx      ; save for drawlimits
1274
        mov   [dlx], ecx      ; save for drawlimits
1275
        mov   [dly], edx
1275
        mov   [dly], edx
1276
        mov   eax, [edi+8]
1276
	mov   eax, [edi + WDATA.box.width]
1277
        add   ecx, eax
1277
        add   ecx, eax
1278
        mov   eax, [edi+12]
1278
	mov   eax, [edi + WDATA.box.height]
1279
        add   edx, eax
1279
        add   edx, eax
1280
        mov   [dlxe], ecx
1280
        mov   [dlxe], ecx
Line 1288... Line 1288...
1288
        mov   [0xf300], esi
1288
        mov   [0xf300], esi
Line 1289... Line 1289...
1289
 
1289
 
1290
        pushad           ; wait for putimages to finish
1290
        pushad           ; wait for putimages to finish
1291
;        mov   eax,5
1291
;        mov   eax,5
1292
;        call  delay_hs
1292
;        call  delay_hs
1293
        mov   eax,[edi+0]
1293
	mov   eax,[edi + WDATA.box.left]
1294
        mov   [npx],eax
1294
        mov   [npx],eax
1295
        mov   eax,[edi+4]
1295
	mov   eax,[edi + WDATA.box.top]
1296
        mov   [npy],eax
1296
        mov   [npy],eax
Line 1297... Line 1297...
1297
        popad
1297
        popad
1298
 
1298
 
1299
        push eax                  ; save old coordinates
1299
        push eax                  ; save old coordinates
1300
        mov   ax,[edi+00]
1300
	mov   ax, word [edi + WDATA.box.left]
1301
        mov   word [oldc+00],ax
1301
        mov   word [oldc+BOX.left],ax
1302
        mov   ax,[edi+04]
1302
	mov   ax, word [edi + WDATA.box.top]
1303
        mov   word [oldc+04],ax
1303
        mov   word [oldc+BOX.top],ax
1304
        mov   ax,[edi+8]
1304
	mov   ax, word [edi + WDATA.box.width]
1305
        mov   word [oldc+8],ax
1305
        mov   word [oldc+BOX.width],ax
1306
        mov   word [npxe],ax
1306
        mov   word [npxe],ax
1307
        mov   ax,[edi+12]
1307
	mov   ax, word [edi + WDATA.box.height]
1308
        mov   word [oldc+12],ax
1308
        mov   word [oldc+BOX.height],ax
Line 1309... Line 1309...
1309
        mov   word [npye],ax
1309
        mov   word [npye],ax
1310
        pop eax
1310
        pop eax
Line 1386... Line 1386...
1386
        je    norepos_size
1386
        je    norepos_size
1387
        pushad
1387
        pushad
Line 1388... Line 1388...
1388
 
1388
 
1389
        mov   edx,edi
1389
        mov   edx,edi
1390
        sub   edx,window_data
1390
        sub   edx,window_data
1391
        shr   edx,5
1391
        ;shr   edx,5
1392
        shl   edx,8
1392
        ;shl   edx,8
-
 
1393
        ;add   edx,0x80000                 ; process base at 0x80000+
Line 1393... Line 1394...
1393
        add   edx,0x80000                 ; process base at 0x80000+
1394
	lea   edx, [0x80000 + edx*8]
1394
 
1395
 
1395
        movzx eax,word [0xfb0a]
1396
        movzx eax,word [0xfb0a]
1396
        cmp   eax,[edi+0]
1397
	cmp   eax,[edi + WDATA.box.left]
1397
        jb    nnepx
1398
        jb    nnepx
1398
        sub   eax,[edi+0]
1399
	sub   eax,[edi + WDATA.box.left]
1399
        cmp   eax,32 ; [edx+0x90+8]
1400
        cmp   eax,32 ; [edx+0x90+8]
1400
        jge   nnepx2
1401
        jge   nnepx2
1401
        mov   eax,32 ; [edx+0x90+8]
1402
        mov   eax,32 ; [edx+0x90+8]
1402
      nnepx2:
1403
      nnepx2:
Line 1403... Line 1404...
1403
        mov   [npxe],eax
1404
        mov   [npxe],eax
1404
      nnepx:
1405
      nnepx:
1405
 
1406
 
1406
        call    get_rolledup_height
1407
        call    get_rolledup_height
1407
        mov     ebx,eax
1408
        mov     ebx,eax
1408
        movzx eax,word [0xfb0c]
1409
        movzx eax,word [0xfb0c]
1409
        cmp   eax,[edi+4]
1410
	cmp   eax,[edi + WDATA.box.top]
1410
        jb    nnepy
1411
        jb    nnepy
1411
        sub   eax,[edi+4]
1412
	sub   eax,[edi + WDATA.box.top]
1412
        cmp     eax,ebx ; [edx+0x90+12]
1413
        cmp     eax,ebx ; [edx+0x90+12]
1413
        jge     nnepy2
1414
        jge     nnepy2
Line 1441... Line 1442...
1441
        jnz     @f
1442
        jnz     @f
1442
        mov     cl,[reposition]
1443
        mov     cl,[reposition]
1443
        call    drawwindowframes
1444
        call    drawwindowframes
Line 1444... Line 1445...
1444
 
1445
 
1445
        mov   eax,[npx]
1446
        mov   eax,[npx]
1446
        mov   [edi+0],eax
1447
	mov   [edi + WDATA.box.left],eax
1447
        mov   eax,[npy]
1448
        mov   eax,[npy]
1448
        mov   [edi+4],eax
1449
	mov   [edi + WDATA.box.top],eax
1449
        mov   eax,[npxe]
1450
        mov   eax,[npxe]
1450
        mov   [edi+8],eax
1451
	mov   [edi + WDATA.box.width],eax
1451
        mov   eax,[npye]
1452
        mov   eax,[npye]
Line 1452... Line 1453...
1452
        mov   [edi+12],eax
1453
	mov   [edi + WDATA.box.height],eax
Line 1453... Line 1454...
1453
 
1454
 
1454
    @@: mov     [reposition],cl
1455
    @@: mov     [reposition],cl
Line 1462... Line 1463...
1462
        jnz   @f
1463
        jnz   @f
1463
        add   ecx,2
1464
        add   ecx,2
1464
    @@: sub   edi,window_data
1465
    @@: sub   edi,window_data
1465
        shr   edi,5
1466
        shr   edi,5
1466
        shl   edi,8
1467
        shl   edi,8
1467
        add   edi,0x80000+0x90
1468
        add   edi,0x80000+APPDATA.saved_box
1468
        cld
1469
        cld
1469
        rep   movsd
1470
        rep   movsd
1470
        pop   ecx edi esi
1471
        pop   ecx edi esi
1471
      no_bounds_save:
1472
      no_bounds_save:
Line 1490... Line 1491...
1490
        or      [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
1491
        or      [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
1491
        call    get_rolledup_height
1492
        call    get_rolledup_height
1492
        jmp     @f
1493
        jmp     @f
1493
  wnd_rolldown:
1494
  wnd_rolldown:
1494
        and     [edi+WDATA.fl_wstate],not WSTATE_ROLLEDUP
1495
        and     [edi+WDATA.fl_wstate],not WSTATE_ROLLEDUP
1495
        mov     eax,[edx+0x90+BOX.height]
1496
	mov     eax,[edx + APPDATA.saved_box.height] ; 0x90+BOX.height
1496
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1497
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1497
        jz      @f
1498
        jz      @f
1498
        mov     eax,[screen_workarea.bottom]
1499
        mov     eax,[screen_workarea.bottom]
1499
        sub     eax,[screen_workarea.top]
1500
        sub     eax,[screen_workarea.top]
1500
    @@: mov     [edi+WDATA.box.height],eax
1501
    @@: mov     [edi+WDATA.box.height],eax
Line 1525... Line 1526...
1525
        jmp   no_fullscreen_restore
1526
        jmp   no_fullscreen_restore
1526
      restore_from_fullscreen:
1527
      restore_from_fullscreen:
1527
        and     [edi+WDATA.fl_wstate],not WSTATE_MAXIMIZED
1528
        and     [edi+WDATA.fl_wstate],not WSTATE_MAXIMIZED
1528
        push    [edi+WDATA.box.height]
1529
        push    [edi+WDATA.box.height]
1529
        push  edi                         ; restore
1530
        push  edi                         ; restore
1530
        lea   esi, [edx + 0x90]
1531
        lea   esi, [edx + APPDATA.saved_box]
1531
        mov   ecx,4
1532
        mov   ecx,4
1532
        cld
1533
        cld
1533
        rep   movsd
1534
        rep   movsd
1534
        pop   edi
1535
        pop   edi
1535
        pop     eax
1536
        pop     eax
Line 1538... Line 1539...
1538
        mov     [edi+WDATA.box.height],eax
1539
        mov     [edi+WDATA.box.height],eax
1539
    @@:
1540
    @@:
Line 1540... Line 1541...
1540
 
1541
 
Line 1541... Line 1542...
1541
      no_fullscreen_restore:
1542
      no_fullscreen_restore:
1542
 
1543
 
1543
        mov   eax,[edi+4]                 ; check Y inside screen
1544
        mov   eax,[edi+WDATA.box.top]                 ; check Y inside screen
1544
        add   eax,[edi+12]
1545
        add   eax,[edi+WDATA.box.height]
1545
        cmp   eax,[0xfe04]
1546
        cmp   eax,[0xfe04]
1546
        jbe   no_window_sizing
1547
        jbe   no_window_sizing
1547
        mov   eax,[edi+0]                 ; check X inside screen
1548
        mov   eax,[edi+WDATA.box.left]                 ; check X inside screen
1548
        add   eax,[edi+8]
1549
        add   eax,[edi+WDATA.box.width]
1549
        cmp   eax,[0xfe00]
1550
        cmp   eax,[0xfe00]
1550
        jbe   no_window_sizing
1551
        jbe   no_window_sizing
1551
        mov   eax,[0xfe00]
1552
        mov   eax,[0xfe00]
1552
        sub   eax,[edi+8]
1553
        sub   eax,[edi+WDATA.box.width]
1553
        mov   [edi+0],eax
1554
        mov   [edi+WDATA.box.left],eax
1554
        mov   eax,[0xfe04]
1555
        mov   eax,[0xfe04]
1555
        sub   eax,[edi+12]
1556
        sub   eax,[edi+WDATA.box.height]
Line 1556... Line 1557...
1556
        mov   [edi+4],eax
1557
        mov   [edi+WDATA.box.top],eax
Line 1557... Line 1558...
1557
      no_window_sizing:
1558
      no_window_sizing:
Line 1563... Line 1564...
1563
 
1564
 
Line 1564... Line 1565...
1564
        mov   [0xfff5],byte 1 ; no mouse
1565
        mov   [0xfff5],byte 1 ; no mouse
1565
 
1566
 
1566
 
1567
 
1567
        push  eax ebx ecx edx
1568
        push  eax ebx ecx edx
1568
        mov   eax,[edi+00]
1569
        mov   eax,[edi+WDATA.box.left]
1569
        mov   ebx,[edi+04]
1570
        mov   ebx,[edi+WDATA.box.top]
1570
        mov   ecx,[edi+8]
1571
        mov   ecx,[edi+WDATA.box.width]
1571
        mov   edx,[edi+12]
1572
        mov   edx,[edi+WDATA.box.height]
Line 1572... Line 1573...
1572
        add   ecx,eax
1573
        add   ecx,eax
1573
        add   edx,ebx
1574
        add   edx,ebx
1574
        call  calculatescreen
1575
        call  calculatescreen
1575
 
1576
 
1576
        mov   eax,[oldc+00]
1577
        mov   eax,[oldc+BOX.left]
1577
        mov   ebx,[oldc+04]
1578
        mov   ebx,[oldc+BOX.top]
1578
        mov   ecx,[oldc+8]
1579
        mov   ecx,[oldc+BOX.width]
1579
        mov   edx,[oldc+12]
1580
        mov   edx,[oldc+BOX.height]
Line 1699... Line 1700...
1699
        mov   edi,1
1700
        mov   edi,1
1700
        call  [draw_line]
1701
        call  [draw_line]
1701
        mov   edi,[0x3000]
1702
        mov   edi,[0x3000]
1702
        shl   edi,5
1703
        shl   edi,5
1703
        add   edi,window_data
1704
        add   edi,window_data
1704
        mov   [edi+30],byte 1
1705
        mov   [edi+WDATA.fl_wdrawn],byte 1
1705
        pop   edi
1706
        pop   edi
Line 1706... Line 1707...
1706
 
1707
 
Line 1707... Line 1708...
1707
        popad
1708
        popad
Line 1713... Line 1714...
1713
random_shaped_window:
1714
random_shaped_window:
Line 1714... Line 1715...
1714
 
1715
 
1715
;
1716
;
1716
;  eax = 0    giving address of data area
1717
;  eax = 0    giving address of data area
1717
;      ebx    address
1718
;      ebx    address
1718
;  ebx = 1    shape area scale
1719
;  eax = 1    shape area scale
Line 1719... Line 1720...
1719
;      ebx    2^ebx scale
1720
;      ebx    2^ebx scale
1720
 
1721
 
1721
     test eax, eax
1722
     test eax, eax
1722
     jne  rsw_no_address
1723
     jne  rsw_no_address
Line 1723... Line 1724...
1723
     mov  eax,[0x3000]
1724
     mov  eax,[0x3000]
1724
     shl  eax,8
1725
     shl  eax,8
Line 1725... Line 1726...
1725
 
1726
 
1726
     mov  [eax+0x80000+0x80],ebx
1727
     mov  [eax+0x80000+APPDATA.wnd_shape],ebx
1727
   rsw_no_address:
1728
   rsw_no_address:
1728
 
1729
 
1729
     cmp  eax,1
1730
     cmp  eax,1
1730
     jne  rsw_no_scale
1731
     jne  rsw_no_scale
Line 1731... Line 1732...
1731
     mov  eax,[0x3000]
1732
     mov  eax,[0x3000]