Subversion Repositories Kolibri OS

Rev

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

Rev 379 Rev 380
Line 26... Line 26...
26
 
26
 
27
setwindowdefaults:
27
setwindowdefaults:
Line 28... Line 28...
28
        pushad
28
        pushad
29
 
29
 
30
        xor   eax,eax
30
        xor   eax,eax
31
        mov   ecx,0xc000
31
        mov   ecx,WIN_STACK
32
       @@:
32
       @@:
33
        inc   eax
33
        inc   eax
34
        add   ecx,2
34
        add   ecx,2
35
        mov   [ecx+0x000],ax          ; process no
35
        mov   [ecx+0x000],ax          ; process no
36
        mov   [ecx+0x400],ax          ; positions in stack
36
        mov   [ecx+0x400],ax          ; positions in stack
Line 37... Line 37...
37
        cmp   ecx,0xc400-2            ; the more high, the more surface
37
        cmp   ecx,WIN_POS-2            ; the more high, the more surface
38
        jnz   @b
38
        jnz   @b
Line 63... Line 63...
63
        mov     ebp, [TASK_COUNT]        ; number of processes
63
        mov     ebp, [TASK_COUNT]        ; number of processes
64
        cmp     ebp, 1
64
        cmp     ebp, 1
65
        jbe     .finish
65
        jbe     .finish
66
        align 4
66
        align 4
67
      .new_wnd:
67
      .new_wnd:
68
        movzx   edi, word [0xC400 + esi * 2]
68
        movzx   edi, word [WIN_POS + esi * 2]
69
        shl     edi, 5
69
        shl     edi, 5
Line 70... Line 70...
70
 
70
 
71
        cmp     [CURRENT_TASK+edi+TASKDATA.state], byte 9
71
        cmp     [CURRENT_TASK+edi+TASKDATA.state], byte 9
Line 106... Line 106...
106
        jbe     @f
106
        jbe     @f
107
        mov     edx, [esp+RECT.bottom]
107
        mov     edx, [esp+RECT.bottom]
108
     @@:
108
     @@:
Line 109... Line 109...
109
 
109
 
110
        push    esi
110
        push    esi
111
        movzx   esi, word [0xC400 + esi * 2]
111
        movzx   esi, word [WIN_POS + esi * 2]
112
        call    setscreen
112
        call    setscreen
Line 113... Line 113...
113
        pop     esi
113
        pop     esi
114
 
114
 
Line 154... Line 154...
154
        jnz     @f
154
        jnz     @f
155
        cmp     [edi+window_data+WDATA.box.height], 0
155
        cmp     [edi+window_data+WDATA.box.height], 0
156
        jz      .ret
156
        jz      .ret
157
@@:
157
@@:
158
; \end{diamond}[29.08.2006]
158
; \end{diamond}[29.08.2006]
159
        mov edi, esi ;;;word [esi*2+0xc400]
159
        mov edi, esi ;;;word [esi*2+WIN_POS]
160
        shl   edi, 8
160
        shl   edi, 8
161
        add   edi, 0x80000  ; address of random shaped window area
161
        add   edi, SLOT_BASE  ; address of random shaped window area
162
        cmp   [edi+APPDATA.wnd_shape], dword 0
162
        cmp   [edi+APPDATA.wnd_shape], dword 0
163
        jne   .free_form
163
        jne   .free_form
Line 164... Line 164...
164
 
164
 
165
        ; get x&y size
165
        ; get x&y size
Line 910... Line 910...
910
        pushad
910
        pushad
Line 911... Line 911...
911
 
911
 
912
     ; if type of current active window is 3,
912
     ; if type of current active window is 3,
913
     ; it must be redrawn
913
     ; it must be redrawn
914
        mov   eax, [TASK_COUNT]
914
        mov   eax, [TASK_COUNT]
915
        movzx eax, word [0xC400 + eax*2]
915
        movzx eax, word [WIN_POS + eax*2]
916
        shl   eax, 5
916
        shl   eax, 5
917
        add   eax, window_data
917
        add   eax, window_data
918
        mov   ebx, [eax + WDATA.cl_workarea]
918
        mov   ebx, [eax + WDATA.cl_workarea]
919
        and   ebx, 0x0f000000
919
        and   ebx, 0x0f000000
Line 922... Line 922...
922
        mov   [eax + WDATA.fl_redraw], byte 1
922
        mov   [eax + WDATA.fl_redraw], byte 1
923
     @@:
923
     @@:
Line 924... Line 924...
924
 
924
 
925
        push   esi
925
        push   esi
926
      movzx   eax, word [esi] ; ax <- process no
926
      movzx   eax, word [esi] ; ax <- process no
Line 927... Line 927...
927
      movzx   eax, word [0xC000+eax*2] ; ax <- position in window stack
927
      movzx   eax, word [WIN_STACK+eax*2] ; ax <- position in window stack
928
 
928
 
929
        xor   esi, esi        ; drop others
929
        xor   esi, esi        ; drop others
930
      waloop:
930
      waloop:
931
        cmp   esi, dword [TASK_COUNT]
931
        cmp   esi, dword [TASK_COUNT]
932
        jae   wacont
932
        jae   wacont
933
        inc   esi
933
        inc   esi
934
        lea   edi, [0xC000 + esi*2]
934
        lea   edi, [WIN_STACK + esi*2]
935
        mov   bx, [edi] ; position of the current process
935
        mov   bx, [edi] ; position of the current process
936
        cmp   bx, ax
936
        cmp   bx, ax
937
        jbe   @f
937
        jbe   @f
Line 943... Line 943...
943
                            ; set to no 1
943
                            ; set to no 1
944
        pop   esi           ;   esi = pointer at 0xC400
944
        pop   esi           ;   esi = pointer at 0xC400
Line 945... Line 945...
945
 
945
 
946
      movzx   eax, word [esi]
946
      movzx   eax, word [esi]
947
        mov   bx, [TASK_COUNT]  ; number of processes
947
        mov   bx, [TASK_COUNT]  ; number of processes
Line 948... Line 948...
948
        mov   [0xC000+eax*2], bx     ; this is the last (and the upper)
948
        mov   [WIN_STACK+eax*2], bx     ; this is the last (and the upper)
949
 
949
 
950
        ; update on screen -window stack
950
        ; update on screen -window stack
951
        xor   esi, esi
951
        xor   esi, esi
952
      waloop2:
952
      waloop2:
953
        mov   edi, [TASK_COUNT]
953
        mov   edi, [TASK_COUNT]
954
        cmp   esi, edi
954
        cmp   esi, edi
955
        jae   wacont2
955
        jae   wacont2
956
        inc   esi
956
        inc   esi
957
        movzx ebx, word [esi*2 + 0xC000]
957
        movzx ebx, word [esi*2 + WIN_STACK]
958
        mov   [ebx*2 + 0xC400], si
958
        mov   [ebx*2 + WIN_POS], si
959
        jmp   waloop2
959
        jmp   waloop2
960
      wacont2:
960
      wacont2:
961
        mov   [0xf400], byte 0           ; empty keyboard buffer
961
        mov   [0xf400], byte 0           ; empty keyboard buffer
Line 979... Line 979...
979
        sub   esi, window_data
979
        sub   esi, window_data
980
        shr   esi, 5
980
        shr   esi, 5
Line 981... Line 981...
981
 
981
 
Line 982... Line 982...
982
        ; esi = process number
982
        ; esi = process number
983
 
983
 
Line 984... Line 984...
984
        movzx eax, word [0xC000 + esi * 2] ; get value of the curr process
984
        movzx eax, word [WIN_STACK + esi * 2] ; get value of the curr process
Line 985... Line 985...
985
        lea   esi, [0xC400 + eax * 2]      ; get address of this process at 0xC400
985
        lea   esi, [WIN_POS + eax * 2]      ; get address of this process at 0xC400
Line 986... Line 986...
986
 
986
 
987
        push  esi
987
        push  esi
988
 
988
 
Line 989... Line 989...
989
      .new_check:
989
      .new_check:
990
 
990
 
Line 991... Line 991...
991
        pop   esi
991
        pop   esi
992
        add   esi, 2
992
        add   esi, 2
Line 993... Line 993...
993
        push  esi
993
        push  esi
Line 1057... Line 1057...
1057
        call  windowactivate
1057
        call  windowactivate
Line 1058... Line 1058...
1058
 
1058
 
1059
        ; update screen info
1059
        ; update screen info
1060
        pushad
1060
        pushad
1061
        mov   edi, [TASK_COUNT] ; the last process (number)
1061
        mov   edi, [TASK_COUNT] ; the last process (number)
1062
        movzx esi, word [0xC400 + edi * 2]
1062
        movzx esi, word [WIN_POS + edi * 2]
1063
        shl   esi, 5
1063
        shl   esi, 5
Line 1064... Line 1064...
1064
        add   esi, window_data
1064
        add   esi, window_data
1065
 
1065
 
Line 1071... Line 1071...
1071
 
1071
 
1072
        add   ecx, eax       ; ecx = x_end
1072
        add   ecx, eax       ; ecx = x_end
Line 1073... Line 1073...
1073
        add   edx, ebx       ; edx = y_end
1073
        add   edx, ebx       ; edx = y_end
1074
 
1074
 
1075
        mov   edi, [TASK_COUNT]
1075
        mov   edi, [TASK_COUNT]
1076
        movzx esi, word [0xC400 + edi * 2]
1076
        movzx esi, word [WIN_POS + edi * 2]
Line 1077... Line 1077...
1077
        call  setscreen
1077
        call  setscreen
1078
        popad
1078
        popad
Line 1094... Line 1094...
1094
 
1094
 
1095
 
1095
 
1096
; eax = window number on screen
1096
; eax = window number on screen
1097
; corrupts registers and [dl*]
1097
; corrupts registers and [dl*]
1098
minimize_window:
1098
minimize_window:
1099
        movzx eax, word [0xC400+eax*2]
1099
        movzx eax, word [WIN_POS+eax*2]
1100
        shl   eax, 5
1100
        shl   eax, 5
1101
        add   eax, window_data
1101
        add   eax, window_data
1102
        test  [eax+WDATA.fl_wstate], WSTATE_MINIMIZED
1102
        test  [eax+WDATA.fl_wstate], WSTATE_MINIMIZED
Line 1127... Line 1127...
1127
; eax = window number on screen
1127
; eax = window number on screen
1128
; corrupts registers and [dl*]
1128
; corrupts registers and [dl*]
1129
restore_minimized_window:
1129
restore_minimized_window:
1130
        pushfd
1130
        pushfd
1131
        cli
1131
        cli
1132
        movzx esi, word [0xC400+eax*2]
1132
        movzx esi, word [WIN_POS+eax*2]
1133
        mov   edi, esi
1133
        mov   edi, esi
1134
        shl   edi, 5
1134
        shl   edi, 5
1135
        add   edi, window_data
1135
        add   edi, window_data
1136
        test  [edi+WDATA.fl_wstate], WSTATE_MINIMIZED
1136
        test  [edi+WDATA.fl_wstate], WSTATE_MINIMIZED
1137
        jz    .skip_redrawings
1137
        jz    .skip_redrawings
Line 1198... Line 1198...
1198
      cwloop:
1198
      cwloop:
1199
        cmp   esi,2
1199
        cmp   esi,2
1200
        jb   .exit
1200
        jb   .exit
Line 1201... Line 1201...
1201
 
1201
 
1202
        dec   esi
1202
        dec   esi
1203
        movzx edi, word [0xC400 + esi * 2] ; ebx
1203
        movzx edi, word [WIN_POS + esi * 2] ; ebx
1204
        shl   edi, 5
1204
        shl   edi, 5
1205
        add   edi, window_data
1205
        add   edi, window_data
1206
;        mov   edi, ebx
1206
;        mov   edi, ebx
1207
    mov   ecx, [edi + WDATA.box.left]
1207
    mov   ecx, [edi + WDATA.box.left]
Line 1232... Line 1232...
1232
        cmp   eax, ebx      ; is this window active?
1232
        cmp   eax, ebx      ; is this window active?
1233
        jz    .move_resize_window
1233
        jz    .move_resize_window
Line 1234... Line 1234...
1234
 
1234
 
1235
        ; eax = position in windowing stack
1235
        ; eax = position in windowing stack
1236
        ; redraw must ?
1236
        ; redraw must ?
1237
        lea   esi, [0xC400 + esi * 2]
1237
        lea   esi, [WIN_POS + esi * 2]
1238
        call  waredraw
1238
        call  waredraw
Line 1239... Line 1239...
1239
        add   esp, 32
1239
        add   esp, 32
1240
 
1240
 
Line 1411... Line 1411...
1411
        mov   edx,edi
1411
        mov   edx,edi
1412
        sub   edx,window_data
1412
        sub   edx,window_data
1413
        ;shr   edx,5
1413
        ;shr   edx,5
1414
        ;shl   edx,8
1414
        ;shl   edx,8
1415
        ;add   edx,0x80000                 ; process base at 0x80000+
1415
        ;add   edx,0x80000                 ; process base at 0x80000+
1416
    lea   edx, [0x80000 + edx*8]
1416
    lea   edx, [SLOT_BASE + edx*8]
Line 1417... Line 1417...
1417
 
1417
 
1418
        movzx eax,word [0xfb0a]
1418
        movzx eax,word [0xfb0a]
1419
    cmp   eax,[edi + WDATA.box.left]
1419
    cmp   eax,[edi + WDATA.box.left]
1420
        jb    nnepx
1420
        jb    nnepx
Line 1483... Line 1483...
1483
        jnz   @f
1483
        jnz   @f
1484
        add   ecx,2
1484
        add   ecx,2
1485
    @@: sub   edi,window_data
1485
    @@: sub   edi,window_data
1486
        shr   edi,5
1486
        shr   edi,5
1487
        shl   edi,8
1487
        shl   edi,8
1488
        add   edi,0x80000+APPDATA.saved_box
1488
        add   edi,SLOT_BASE+APPDATA.saved_box
1489
        cld
1489
        cld
1490
        rep   movsd
1490
        rep   movsd
1491
        pop   ecx edi esi
1491
        pop   ecx edi esi
1492
      no_bounds_save:
1492
      no_bounds_save:
Line 1497... Line 1497...
1497
        je    no_window_sizing
1497
        je    no_window_sizing
1498
        mov   edx,edi
1498
        mov   edx,edi
1499
        sub   edx,window_data
1499
        sub   edx,window_data
1500
        shr   edx,5
1500
        shr   edx,5
1501
        shl   edx,8
1501
        shl   edx,8
1502
        add   edx,0x80000                 ; process base at 0x80000+
1502
        add   edx,SLOT_BASE                 ; process base at 0x80000+
Line 1503... Line 1503...
1503
 
1503
 
1504
        cmp   [do_resize],2               ; window shade ?
1504
        cmp   [do_resize],2               ; window shade ?
1505
        jne   no_window_shade
1505
        jne   no_window_shade
Line 1752... Line 1752...
1752
     test eax, eax
1752
     test eax, eax
1753
     jne  rsw_no_address
1753
     jne  rsw_no_address
1754
     mov  eax,[CURRENT_TASK]
1754
     mov  eax,[CURRENT_TASK]
1755
     shl  eax,8
1755
     shl  eax,8
Line 1756... Line 1756...
1756
 
1756
 
1757
     mov  [eax+0x80000+APPDATA.wnd_shape],ebx
1757
     mov  [eax+SLOT_BASE+APPDATA.wnd_shape],ebx
Line 1758... Line 1758...
1758
   rsw_no_address:
1758
   rsw_no_address:
1759
 
1759
 
1760
     cmp  eax,1
1760
     cmp  eax,1
1761
     jne  rsw_no_scale
1761
     jne  rsw_no_scale
1762
     mov  eax,[CURRENT_TASK]
1762
     mov  eax,[CURRENT_TASK]
1763
     shl  eax,8
1763
     shl  eax,8
Line 1764... Line 1764...
1764
     mov  byte [eax+0x80000+APPDATA.wnd_shape_scale], bl
1764
     mov  byte [eax+SLOT_BASE+APPDATA.wnd_shape_scale], bl