Subversion Repositories Kolibri OS

Rev

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

Rev 112 Rev 114
Line 73... Line 73...
73
 
73
 
74
        add     edi, window_data
74
        add     edi, window_data
75
        test    [edi+WDATA.fl_wstate], WSTATE_MINIMIZED
75
        test    [edi+WDATA.fl_wstate], WSTATE_MINIMIZED
Line 76... Line 76...
76
        jnz     .not_wnd
76
        jnz     .not_wnd
77
 
77
 
78
        mov     eax, [edi+WDATA.left]
78
        mov     eax,[edi+WDATA.box.left]
79
        cmp     eax, [esp+RECT.right]
79
        cmp     eax, [esp+RECT.right]
80
        ja      .out_of_bounds
80
        ja      .out_of_bounds
81
        mov     ebx, [edi+WDATA.top]
81
        mov     ebx,[edi+WDATA.box.top]
82
        cmp     ebx, [esp+RECT.bottom]
82
        cmp     ebx, [esp+RECT.bottom]
83
        ja      .out_of_bounds
83
        ja      .out_of_bounds
84
        mov     ecx, [edi+WDATA.width]
84
        mov     ecx,[edi+WDATA.box.width]
85
        add     ecx, eax
85
        add     ecx, eax
86
        cmp     ecx, [esp+RECT.left]
86
        cmp     ecx, [esp+RECT.left]
87
        jb      .out_of_bounds
87
        jb      .out_of_bounds
88
        mov     edx, [edi+WDATA.height]
88
        mov     edx,[edi+WDATA.box.height]
89
        add     edx, ebx
89
        add     edx, ebx
Line 90... Line 90...
90
        cmp     edx, [esp+RECT.top]
90
        cmp     edx, [esp+RECT.top]
Line 237... Line 237...
237
        ;       [scale]
237
        ;       [scale]
238
        push edx ecx ; for loop - x,y size
238
        push edx ecx ; for loop - x,y size
Line 239... Line 239...
239
 
239
 
240
        mov  ecx, esi
240
        mov  ecx, esi
241
        shl  ecx, 5
241
        shl  ecx, 5
242
        mov  edx, [window_data+ecx+WDATA.top]
242
        mov  edx, [window_data+ecx+WDATA.box.top]
243
        push [window_data+ecx+WDATA.width]      ; for loop - width
243
        push [window_data+ecx+WDATA.box.width]      ; for loop - width
244
        mov  ecx, [window_data+ecx+WDATA.left]
244
        mov  ecx, [window_data+ecx+WDATA.box.left]
245
        sub  ebx, edx
245
        sub  ebx, edx
246
        sub  eax, ecx
246
        sub  eax, ecx
Line 247... Line 247...
247
        push ebx eax ; for loop - x,y
247
        push ebx eax ; for loop - x,y
Line 511... Line 511...
511
        ret
511
        ret
512
    @@: mov	[esi+WDATA.fl_redraw],1
512
    @@: mov	[esi+WDATA.fl_redraw],1
513
	test    [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED
513
	test    [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED
514
        jz      .lp2
514
        jz      .lp2
515
        mov     eax,[screen_workarea.left]
515
        mov     eax,[screen_workarea.left]
516
        mov     [esi+WDATA.left],eax
516
        mov     [esi+WDATA.box.left],eax
517
        sub     eax,[screen_workarea.right]
517
        sub     eax,[screen_workarea.right]
518
        neg     eax
518
        neg     eax
519
        mov     [esi+WDATA.width],eax
519
        mov     [esi+WDATA.box.width],eax
520
        mov     eax,[screen_workarea.top]
520
        mov     eax,[screen_workarea.top]
521
        mov     [esi+WDATA.top],eax
521
        mov     [esi+WDATA.box.top],eax
522
        test    [esi+WDATA.fl_wstate],WSTATE_ROLLEDUP
522
        test    [esi+WDATA.fl_wstate],WSTATE_ROLLEDUP
523
        jnz     .lp1
523
        jnz     .lp1
524
        sub     eax,[screen_workarea.bottom]
524
        sub     eax,[screen_workarea.bottom]
525
        neg     eax
525
        neg     eax
526
        mov     [esi+WDATA.height],eax
526
        mov     [esi+WDATA.box.height],eax
527
  .lp1: add     esi,0x20
527
  .lp1: add     esi,0x20
528
        loop    @b
528
        loop    @b
529
        ret
529
        ret
530
  .lp2: mov	eax,[esi+WDATA.left]
530
  .lp2: mov     eax,[esi+WDATA.box.left]
531
	add	eax,[esi+WDATA.width]
531
        add     eax,[esi+WDATA.box.width]
532
	mov	ebx,[0x0000fe00]
532
	mov	ebx,[0x0000fe00]
533
;	inc	ebx
533
;	inc	ebx
534
	cmp	eax,ebx
534
	cmp	eax,ebx
535
	jle	.lp4
535
	jle	.lp4
536
	mov	eax,[esi+WDATA.width]
536
        mov     eax,[esi+WDATA.box.width]
537
	sub	eax,ebx
537
	sub	eax,ebx
538
	jle	.lp3
538
	jle	.lp3
539
	mov	[esi+WDATA.width],ebx
539
        mov     [esi+WDATA.box.width],ebx
540
  .lp3: sub	ebx,[esi+WDATA.width]
540
  .lp3: sub     ebx,[esi+WDATA.box.width]
541
	mov	[esi+WDATA.left],ebx
541
        mov     [esi+WDATA.box.left],ebx
542
  .lp4: mov	eax,[esi+WDATA.top]
542
  .lp4: mov     eax,[esi+WDATA.box.top]
543
	add	eax,[esi+WDATA.height]
543
        add     eax,[esi+WDATA.box.height]
544
	mov	ebx,[0x0000fe04]
544
	mov	ebx,[0x0000fe04]
545
;	inc	ebx
545
;	inc	ebx
546
	cmp	eax,ebx
546
	cmp	eax,ebx
547
	jle	.lp6
547
	jle	.lp6
548
	mov	eax,[esi+WDATA.height]
548
        mov     eax,[esi+WDATA.box.height]
549
	sub	eax,ebx
549
	sub	eax,ebx
550
	jle	.lp5
550
	jle	.lp5
551
	mov	[esi+WDATA.height],ebx
551
        mov     [esi+WDATA.box.height],ebx
552
  .lp5: sub	ebx,[esi+WDATA.height]
552
  .lp5: sub     ebx,[esi+WDATA.box.height]
553
	mov	[esi+WDATA.top],ebx
553
        mov     [esi+WDATA.box.top],ebx
554
  .lp6: add     esi,0x20
554
  .lp6: add     esi,0x20
555
        loop    @b
555
        loop    @b
556
	ret
556
	ret
Line 557... Line 557...
557
 
557
 
Line 631... Line 631...
631
 
631
 
Line 632... Line 632...
632
    pop   eax
632
    pop   eax
Line 633... Line -...
633
 
-
 
Line 634... Line -...
634
    ret
-
 
Line 635... Line -...
635
 
-
 
636
drawwindow_I:
-
 
637
 
-
 
638
        pushad
-
 
639
 
-
 
640
        mov   esi,[edx+24]   ; rectangle
-
 
641
        mov   eax,[edx+0]
-
 
642
        shl   eax,16
-
 
643
        add   eax,[edx+0]
-
 
-
 
633
 
644
        add   eax,[edx+8]
634
    ret
Line 645... Line 635...
645
        mov   ebx,[edx+04]
635
 
646
        shl   ebx,16
636
 
647
        add   ebx,[edx+4]
637
 
648
        add   ebx,[edx+12]
638
 
649
        call  draw_rectangle
639
drawwindow_I_caption:
650
 
640
 
651
        mov   ecx,[edx+20]   ; grab bar
641
        mov   ecx,[edx+20]   ; grab bar
652
        push  ecx
642
        push  ecx
653
        mov   esi,edx
643
        mov   esi,edx
654
        mov   edx,[esi+04]
644
        mov   edx,[esi+04]
655
        add   edx,1
645
        add   edx,1
656
        mov   ebx,[esi+04]
646
        mov   ebx,[esi+04]
657
        add   ebx,25
647
        add   ebx,21
658
        mov   eax,[esi+04]
648
        mov   eax,[esi+04]
659
        add   eax,[esi+12]
649
        add   eax,[esi+12]
660
        cmp   ebx,eax
650
        cmp   ebx,eax
661
        jb    wdsizeok
651
        jb    .wdsizeok
662
        mov   ebx,eax
652
        mov   ebx,eax
663
      wdsizeok:
653
  .wdsizeok:
664
        push  ebx
654
        push  ebx
Line 675... Line 665...
675
        push  edx
665
        push  edx
676
        mov   edx,0x80000000
666
        mov   edx,0x80000000
677
        mov   ecx,[esi+20]
667
        mov   ecx,[esi+20]
678
        and   ecx,edx
668
        and   ecx,edx
679
        cmp   ecx,edx
669
        cmp   ecx,edx
680
        jnz   nofa
670
        jnz   .nofa
681
        mov   ecx,[esi+20]
671
        mov   ecx,[esi+20]
682
        sub   ecx,0x00040404
672
        sub   ecx,0x00040404
683
        mov   [esi+20],ecx
673
        mov   [esi+20],ecx
684
        and   ecx,0x00ffffff
674
        and   ecx,0x00ffffff
685
        jmp   faj
675
        jmp   .faj
686
      nofa:
676
  .nofa:
687
        mov   ecx,[esi+20]
677
        mov   ecx,[esi+20]
688
        and   ecx,0x00ffffff
678
        and   ecx,0x00ffffff
689
      faj:
679
  .faj:
690
        pop   edx
680
        pop   edx
691
        mov   edi,0
681
        mov   edi,0
692
        call  [draw_line]
682
        call  [draw_line]
693
        inc   edx
683
        inc   edx
694
        cmp   edx,[esp]
684
        cmp   edx,[esp]
695
        jb    drwi
685
        jb    .drwi
696
        add   esp,4
686
        add   esp,4
697
        pop   ecx
687
        pop   ecx
698
        mov   [esi+20],ecx
688
        mov   [esi+20],ecx
Line -... Line 689...
-
 
689
 
-
 
690
        ret
-
 
691
 
-
 
692
 
-
 
693
drawwindow_I:
-
 
694
 
-
 
695
        pushad
-
 
696
 
-
 
697
        mov   esi,[edx+24]   ; rectangle
-
 
698
        mov   eax,[edx+0]
-
 
699
        shl   eax,16
-
 
700
        add   eax,[edx+0]
-
 
701
        add   eax,[edx+8]
-
 
702
        mov   ebx,[edx+04]
-
 
703
        shl   ebx,16
-
 
704
        add   ebx,[edx+4]
-
 
705
        add   ebx,[edx+12]
-
 
706
        call  draw_rectangle
-
 
707
 
-
 
708
        call    drawwindow_I_caption
699
 
709
 
700
        mov   edx,[esi+04]      ; inside work area
710
        mov   edx,[esi+04]      ; inside work area
701
        add   edx,21+5
711
        add   edx,21+5
702
        mov   ebx,[esi+04]
712
        mov   ebx,[esi+04]
703
        add   ebx,[esi+12]
713
        add   ebx,[esi+12]
Line 757... Line 767...
757
 
767
 
758
        popad
768
        popad
Line 759... Line 769...
759
        ret
769
        ret
760
 
-
 
761
 
-
 
762
drawwindow_III:
-
 
763
 
-
 
764
        pushad
-
 
765
 
-
 
766
        mov   edi,edx                              ; RECTANGLE
-
 
767
        mov   eax,[edi+0]
-
 
768
        shl   eax,16
-
 
769
        mov   ax,[edi+0]
-
 
770
        add   ax,[edi+8]
-
 
771
        mov   ebx,[edi+4]
-
 
772
        shl   ebx,16
-
 
773
        mov   bx,[edi+4]
-
 
774
        add   bx,[edi+12]
-
 
775
        mov   esi,[edi+24]
-
 
776
        shr   esi,1
-
 
777
        and   esi,0x007f7f7f
-
 
778
        push  esi
-
 
779
        call  draw_rectangle
-
 
780
        mov   ecx,3
-
 
781
      dw3l:
-
 
782
        add   eax,1*65536-1
-
 
783
        add   ebx,1*65536-1
-
 
784
        mov   esi,[edi+24]
-
 
785
        call  draw_rectangle
-
 
786
        dec   ecx
-
 
787
        jnz   dw3l
-
 
788
        pop   esi
-
 
Line 789... Line 770...
789
        add   eax,1*65536-1
770
 
790
        add   ebx,1*65536-1
771
 
791
        call  draw_rectangle
772
drawwindow_III_caption:
792
 
773
 
Line 798... Line 779...
798
        mov   ebx,[esi+04]
779
        mov   ebx,[esi+04]
799
        add   ebx,20
780
        add   ebx,20
800
        mov   eax,[esi+04]
781
        mov   eax,[esi+04]
801
        add   eax,[esi+12]
782
        add   eax,[esi+12]
802
        cmp   ebx,eax
783
        cmp   ebx,eax
803
        jb    wdsizeok2
784
        jb    .wdsizeok
804
        mov   ebx,eax
785
        mov   ebx,eax
805
      wdsizeok2:
786
  .wdsizeok:
806
        push  ebx
787
        push  ebx
807
      drwi2:
788
  .drwi:
808
        mov   ebx,edx
789
        mov   ebx,edx
809
        shl   ebx,16
790
        shl   ebx,16
810
        add   ebx,edx
791
        add   ebx,edx
811
        mov   eax,[esi+00]
792
        mov   eax,[esi+00]
812
        shl   eax,16
793
        shl   eax,16
813
        add   eax,[esi+00]
794
        add   eax,[esi+00]
814
        add   eax,[esi+8]
795
        add   eax,[esi+8]
815
        add   eax,4*65536-4
796
        add   eax,4*65536-4
816
        mov   ecx,[esi+20]
797
        mov   ecx,[esi+20]
817
        test  ecx,0x40000000
798
        test  ecx,0x40000000
818
        jz    nofa3
799
        jz    .nofa
819
        add   ecx,0x040404
800
        add   ecx,0x040404
820
      nofa3:
801
  .nofa:
821
        test  ecx,0x80000000
802
        test  ecx,0x80000000
822
        jz    nofa2
803
        jz    .nofa2
823
        sub   ecx,0x040404
804
        sub   ecx,0x040404
824
      nofa2:
805
  .nofa2:
825
        mov   [esi+20],ecx
806
        mov   [esi+20],ecx
826
        and   ecx,0xffffff
807
        and   ecx,0xffffff
827
        xor   edi, edi
808
        xor   edi, edi
828
        call  [draw_line]
809
        call  [draw_line]
829
        inc   edx
810
        inc   edx
830
        cmp   edx,[esp]
811
        cmp   edx,[esp]
831
        jb    drwi2
812
        jb    .drwi
832
        add   esp,4
813
        add   esp,4
833
        pop   ecx
814
        pop   ecx
834
        mov   [esi+20],ecx
815
        mov   [esi+20],ecx
Line -... Line 816...
-
 
816
 
-
 
817
        ret
-
 
818
 
-
 
819
 
-
 
820
drawwindow_III:
-
 
821
 
-
 
822
        pushad
-
 
823
 
-
 
824
        mov   edi,edx                              ; RECTANGLE
-
 
825
        mov   eax,[edi+0]
-
 
826
        shl   eax,16
-
 
827
        mov   ax,[edi+0]
-
 
828
        add   ax,[edi+8]
-
 
829
        mov   ebx,[edi+4]
-
 
830
        shl   ebx,16
-
 
831
        mov   bx,[edi+4]
-
 
832
        add   bx,[edi+12]
-
 
833
        mov   esi,[edi+24]
-
 
834
        shr   esi,1
-
 
835
        and   esi,0x007f7f7f
-
 
836
        push  esi
-
 
837
        call  draw_rectangle
-
 
838
        mov   ecx,3
-
 
839
      dw3l:
-
 
840
        add   eax,1*65536-1
-
 
841
        add   ebx,1*65536-1
-
 
842
        mov   esi,[edi+24]
-
 
843
        call  draw_rectangle
-
 
844
        dec   ecx
-
 
845
        jnz   dw3l
-
 
846
        pop   esi
-
 
847
        add   eax,1*65536-1
-
 
848
        add   ebx,1*65536-1
-
 
849
        call  draw_rectangle
-
 
850
 
-
 
851
        call    drawwindow_III_caption
835
 
852
 
836
        mov   edx,[esi+04]                       ; WORK AREA
853
        mov   edx,[esi+04]                       ; WORK AREA
837
        add   edx,21+5
854
        add   edx,21+5
838
        mov   ebx,[esi+04]
855
        mov   ebx,[esi+04]
839
        add   ebx,[esi+12]
856
        add   ebx,[esi+12]
Line 1058... Line 1075...
1058
        pushfd
1075
        pushfd
1059
        cli
1076
        cli
1060
        or    [eax+WDATA.fl_wstate], WSTATE_MINIMIZED
1077
        or    [eax+WDATA.fl_wstate], WSTATE_MINIMIZED
1061
        mov   edi, eax
1078
        mov   edi, eax
1062
        ;call  calculatescreen
1079
        ;call  calculatescreen
1063
        mov   eax, [edi+WDATA.left]
1080
        mov   eax, [edi+WDATA.box.left]
1064
        mov   [dlx], eax
1081
        mov   [dlx], eax
1065
        mov   ecx, eax
1082
        mov   ecx, eax
1066
        add   ecx, [edi+WDATA.width]
1083
        add   ecx, [edi+WDATA.box.width]
1067
        mov   [dlxe], ecx
1084
        mov   [dlxe], ecx
1068
        mov   ebx, [edi+WDATA.top]
1085
        mov   ebx, [edi+WDATA.box.top]
1069
        mov   [dly], ebx
1086
        mov   [dly], ebx
1070
        mov   edx, ebx
1087
        mov   edx, ebx
1071
        add   edx, [edi+WDATA.height]
1088
        add   edx, [edi+WDATA.box.height]
1072
        mov   [dlye], edx
1089
        mov   [dlye], edx
1073
        call  calculatescreen
1090
        call  calculatescreen
1074
        xor   esi, esi
1091
        xor   esi, esi
1075
        xor   eax, eax
1092
        xor   eax, eax
1076
        call  redrawscreen
1093
        call  redrawscreen
Line 1091... Line 1108...
1091
        jz    .skip_redrawings
1108
        jz    .skip_redrawings
1092
        mov   [edi+WDATA.fl_redraw], 1
1109
        mov   [edi+WDATA.fl_redraw], 1
1093
        and   [edi+WDATA.fl_wstate], not WSTATE_MINIMIZED
1110
        and   [edi+WDATA.fl_wstate], not WSTATE_MINIMIZED
1094
        cmp   eax, [0x3004] ; the uppermost window
1111
        cmp   eax, [0x3004] ; the uppermost window
1095
        jnz   .no_uppermost
1112
        jnz   .no_uppermost
1096
        mov   eax, [edi+WDATA.left]
1113
        mov   eax, [edi+WDATA.box.left]
1097
        mov   ebx, [edi+WDATA.top]
1114
        mov   ebx, [edi+WDATA.box.top]
1098
        mov   ecx, eax
1115
        mov   ecx, eax
1099
        mov   edx, ebx
1116
        mov   edx, ebx
1100
        add   ecx, [edi+WDATA.width]
1117
        add   ecx, [edi+WDATA.box.width]
1101
        add   edx, [edi+WDATA.height]
1118
        add   edx, [edi+WDATA.box.height]
1102
        call  setscreen
1119
        call  setscreen
1103
        jmp   .done
1120
        jmp   .done
1104
.no_uppermost:
1121
.no_uppermost:
1105
        mov   eax, [edi+WDATA.left]
1122
        mov   eax, [edi+WDATA.box.left]
1106
        mov   ebx, [edi+WDATA.top]
1123
        mov   ebx, [edi+WDATA.box.top]
1107
        mov   ecx, eax
1124
        mov   ecx, eax
1108
        mov   edx, ebx
1125
        mov   edx, ebx
1109
        add   ecx, [edi+WDATA.width]
1126
        add   ecx, [edi+WDATA.box.width]
1110
        add   edx, [edi+WDATA.height]
1127
        add   edx, [edi+WDATA.box.height]
1111
        call  calculatescreen
1128
        call  calculatescreen
1112
.done:
1129
.done:
1113
        mov   [0xfff4],byte 0 ; no mouse under
1130
        mov   [0xfff4],byte 0 ; no mouse under
1114
.skip_redrawings:
1131
.skip_redrawings:
1115
        popfd
1132
        popfd
Line 1478... Line 1495...
1478
        mov     eax,[edx+0x90+BOX.height]
1495
        mov     eax,[edx+0x90+BOX.height]
1479
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1496
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1480
        jz      @f
1497
        jz      @f
1481
        mov     eax,[screen_workarea.bottom]
1498
        mov     eax,[screen_workarea.bottom]
1482
        sub     eax,[screen_workarea.top]
1499
        sub     eax,[screen_workarea.top]
1483
    @@: mov     [edi+WDATA.height],eax
1500
    @@: mov     [edi+WDATA.box.height],eax
Line 1484... Line 1501...
1484
 
1501
 
Line 1485... Line 1502...
1485
      no_window_shade:
1502
      no_window_shade:
1486
 
1503
 
Line 1491... Line 1508...
1491
        mov   [reposition],1
1508
        mov   [reposition],1
1492
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1509
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1493
        jnz     restore_from_fullscreen
1510
        jnz     restore_from_fullscreen
1494
        or      [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1511
        or      [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1495
        mov     eax,[screen_workarea.left]
1512
        mov     eax,[screen_workarea.left]
1496
        mov     [edi+WDATA.left],eax
1513
        mov     [edi+WDATA.box.left],eax
1497
        sub     eax,[screen_workarea.right]
1514
        sub     eax,[screen_workarea.right]
1498
        neg     eax
1515
        neg     eax
1499
        mov     [edi+WDATA.width],eax
1516
        mov     [edi+WDATA.box.width],eax
1500
        mov     eax,[screen_workarea.top]
1517
        mov     eax,[screen_workarea.top]
1501
        mov     [edi+WDATA.top],eax
1518
        mov     [edi+WDATA.box.top],eax
1502
        test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
1519
        test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
1503
        jnz     @f
1520
        jnz     @f
1504
        sub     eax,[screen_workarea.bottom]
1521
        sub     eax,[screen_workarea.bottom]
1505
        neg     eax
1522
        neg     eax
1506
        mov     [edi+WDATA.height],eax
1523
        mov     [edi+WDATA.box.height],eax
1507
    @@:
1524
    @@:
1508
        jmp   no_fullscreen_restore
1525
        jmp   no_fullscreen_restore
1509
      restore_from_fullscreen:
1526
      restore_from_fullscreen:
1510
        and     [edi+WDATA.fl_wstate],not WSTATE_MAXIMIZED
1527
        and     [edi+WDATA.fl_wstate],not WSTATE_MAXIMIZED
1511
        push    [edi+WDATA.height]
1528
        push    [edi+WDATA.box.height]
1512
        push  edi                         ; restore
1529
        push  edi                         ; restore
1513
        lea   esi, [edx + 0x90]
1530
        lea   esi, [edx + 0x90]
1514
        mov   ecx,4
1531
        mov   ecx,4
1515
        cld
1532
        cld
1516
        rep   movsd
1533
        rep   movsd
1517
        pop   edi
1534
        pop   edi
1518
        pop     eax
1535
        pop     eax
1519
        test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
1536
        test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
1520
        jz      @f
1537
        jz      @f
1521
        mov     [edi+WDATA.height],eax
1538
        mov     [edi+WDATA.box.height],eax
1522
    @@:
1539
    @@:
Line 1523... Line 1540...
1523
 
1540
 
Line 1524... Line 1541...
1524
      no_fullscreen_restore:
1541
      no_fullscreen_restore: