Subversion Repositories Kolibri OS

Rev

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

Rev 2540 Rev 3187
Line 1024... Line 1024...
1024
        inc     eax
1024
        inc     eax
1025
        ret
1025
        ret
1026
;------------------------------------------------------------------------------
1026
;------------------------------------------------------------------------------
1027
align 4
1027
align 4
1028
;------------------------------------------------------------------------------
1028
;------------------------------------------------------------------------------
-
 
1029
minimize_all_window:
-
 
1030
        push    ebx ecx edx esi edi
-
 
1031
        pushfd
-
 
1032
        cli
-
 
1033
        xor     edx, edx
-
 
1034
        mov     eax, 2  ; we do not minimize the kernel thread N1
-
 
1035
        mov     ebx, [TASK_COUNT]
-
 
1036
;--------------------------------------
-
 
1037
align 4
-
 
1038
.loop:
-
 
1039
        movzx   edi, word[WIN_POS + eax * 2]
-
 
1040
        shl     edi, 5
-
 
1041
; it is a unused slot?
-
 
1042
        cmp     dword [edi+CURRENT_TASK+TASKDATA.state], 9
-
 
1043
        je      @f
-
 
1044
; it is a hidden thread?
-
 
1045
        lea     esi, [edi*8+SLOT_BASE+APPDATA.app_name]
-
 
1046
        cmp     [esi], byte '@'
-
 
1047
        je      @f
-
 
1048
; is it already minimized?
-
 
1049
        test    [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED
-
 
1050
        jnz     @f
-
 
1051
; no it's not, let's do that
-
 
1052
        or      [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED
-
 
1053
        inc     edx
-
 
1054
;--------------------------------------
-
 
1055
align 4
-
 
1056
@@:
-
 
1057
        inc     eax
-
 
1058
        cmp     eax, ebx
-
 
1059
        jbe     .loop
-
 
1060
; If nothing has changed
-
 
1061
        test    edx, edx
-
 
1062
        jz      @f
-
 
1063
 
-
 
1064
        push    edx
-
 
1065
        call    syscall_display_settings._.calculate_whole_screen
-
 
1066
        call    syscall_display_settings._.redraw_whole_screen
-
 
1067
        pop     edx
-
 
1068
;--------------------------------------
-
 
1069
align 4
-
 
1070
@@:
-
 
1071
        mov     eax, edx
-
 
1072
        popfd
-
 
1073
        pop     edi esi edx ecx ebx
-
 
1074
        ret
-
 
1075
;------------------------------------------------------------------------------
-
 
1076
align 4
-
 
1077
;------------------------------------------------------------------------------
1029
minimize_window: ;/////////////////////////////////////////////////////////////
1078
minimize_window: ;/////////////////////////////////////////////////////////////
1030
;------------------------------------------------------------------------------
1079
;------------------------------------------------------------------------------
1031
;> eax = window number on screen
1080
;> eax = window number on screen
1032
;------------------------------------------------------------------------------
1081
;------------------------------------------------------------------------------
1033
;# corrupts [dl*]
1082
;# corrupts [dl*]
Line 1045... Line 1094...
1045
 
1094
 
Line 1046... Line 1095...
1046
        push    eax ebx ecx edx esi
1095
        push    eax ebx ecx edx esi
1047
 
1096
 
-
 
1097
        ; no it's not, let's do that
-
 
1098
        or      [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
-
 
1099
; If the window width is 0, then the action is not needed.
-
 
1100
        cmp     [edi + WDATA.box.width], dword 0
-
 
1101
        je      @f
-
 
1102
; If the window height is 0, then the action is not needed.
-
 
1103
        cmp     [edi + WDATA.box.height], dword 0
1048
        ; no it's not, let's do that
1104
        je      @f
1049
        or      [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
1105
 
1050
        mov     eax, [edi + WDATA.box.left]
1106
        mov     eax, [edi + WDATA.box.left]
1051
        mov     [draw_limits.left], eax
1107
        mov     [draw_limits.left], eax
1052
        mov     ecx, eax
1108
        mov     ecx, eax
1053
        add     ecx, [edi + WDATA.box.width]
1109
        add     ecx, [edi + WDATA.box.width]
1054
        mov     [draw_limits.right], ecx
1110
        mov     [draw_limits.right], ecx
1055
        mov     ebx, [edi + WDATA.box.top]
1111
        mov     ebx, [edi + WDATA.box.top]
1056
        mov     [draw_limits.top], ebx
1112
        mov     [draw_limits.top], ebx
1057
        mov     edx, ebx
1113
        mov     edx, ebx
-
 
1114
        add     edx, [edi + WDATA.box.height]
-
 
1115
        mov     [draw_limits.bottom], edx
-
 
1116
 
-
 
1117
;        DEBUGF  1, "K : minimize_window\n"
-
 
1118
;        DEBUGF  1, "K : dl_left %x\n",[draw_limits.left]
-
 
1119
;        DEBUGF  1, "K : dl_right %x\n",[draw_limits.right]
1058
        add     edx, [edi + WDATA.box.height]
1120
;        DEBUGF  1, "K : dl_top %x\n",[draw_limits.top]
1059
        mov     [draw_limits.bottom], edx
1121
;        DEBUGF  1, "K : dl_bottom %x\n",[draw_limits.bottom]
1060
        call    calculatescreen
1122
        call    calculatescreen
-
 
1123
;        xor     esi, esi
1061
        xor     esi, esi
1124
;        xor     eax, eax
-
 
1125
        mov     eax, edi
-
 
1126
        call    redrawscreen
1062
        xor     eax, eax
1127
;--------------------------------------
1063
        call    redrawscreen
1128
align 4
1064
 
1129
@@:
1065
        pop     esi edx ecx ebx eax
1130
        pop     esi edx ecx ebx eax
1066
;--------------------------------------
1131
;--------------------------------------
1067
align 4
1132
align 4
Line 1264... Line 1329...
1264
        add     esp, sizeof.BOX
1329
        add     esp, sizeof.BOX
1265
        ret
1330
        ret
1266
;------------------------------------------------------------------------------
1331
;------------------------------------------------------------------------------
1267
align 4
1332
align 4
1268
;------------------------------------------------------------------------------
1333
;------------------------------------------------------------------------------
1269
sys_window_start_moving_handler: ;/////////////////////////////////////////////
1334
;sys_window_start_moving_handler: ;/////////////////////////////////////////////
1270
;------------------------------------------------------------------------------
1335
;------------------------------------------------------------------------------
1271
;? 
1336
;? 
1272
;------------------------------------------------------------------------------
1337
;------------------------------------------------------------------------------
1273
;> eax = old (original) window box
1338
;> eax = old (original) window box
1274
;> esi = process slot
1339
;> esi = process slot
1275
;------------------------------------------------------------------------------
1340
;------------------------------------------------------------------------------
1276
        mov     edi, eax
1341
;        mov     edi, eax
1277
        call    window._.draw_negative_box
1342
;        call    window._.draw_negative_box
1278
        ret
1343
;        ret
1279
;------------------------------------------------------------------------------
1344
;------------------------------------------------------------------------------
1280
align 4
1345
align 4
1281
;------------------------------------------------------------------------------
1346
;------------------------------------------------------------------------------
1282
sys_window_end_moving_handler: ;///////////////////////////////////////////////
1347
sys_window_end_moving_handler: ;///////////////////////////////////////////////
1283
;------------------------------------------------------------------------------
1348
;------------------------------------------------------------------------------
Line 1285... Line 1350...
1285
;------------------------------------------------------------------------------
1350
;------------------------------------------------------------------------------
1286
;> eax = old (original) window box
1351
;> eax = old (original) window box
1287
;> ebx = new (final) window box
1352
;> ebx = new (final) window box
1288
;> esi = process slot
1353
;> esi = process slot
1289
;------------------------------------------------------------------------------
1354
;------------------------------------------------------------------------------
1290
        mov     edi, ebx
1355
;        mov     edi, ebx
1291
        call    window._.end_moving__box
1356
;        call    window._.end_moving__box
Line 1292... Line 1357...
1292
 
1357
 
1293
        mov     edi, esi
1358
        mov     edi, esi
1294
        shl     edi, 5
1359
        shl     edi, 5
Line 2317... Line 2382...
2317
        add     bx, word[edi + BOX.height]
2382
        add     bx, word[edi + BOX.height]
2318
        call    draw_rectangle.forced
2383
        call    draw_rectangle.forced
2319
        pop     esi ebx eax
2384
        pop     esi ebx eax
2320
        ret
2385
        ret
2321
;------------------------------------------------------------------------------
2386
;------------------------------------------------------------------------------
2322
align 4
2387
;align 4
2323
;------------------------------------------------------------------------------
2388
;------------------------------------------------------------------------------
2324
window._.end_moving__box: ;//////////////////////////////////////////////////
2389
;window._.end_moving__box: ;//////////////////////////////////////////////////
2325
;------------------------------------------------------------------------------
2390
;------------------------------------------------------------------------------
2326
;? Draw positive box
2391
;? Draw positive box
2327
;------------------------------------------------------------------------------
2392
;------------------------------------------------------------------------------
2328
;> edi = pointer to BOX struct
2393
;> edi = pointer to BOX struct
2329
;------------------------------------------------------------------------------
2394
;------------------------------------------------------------------------------
2330
        push    eax ebx esi
2395
;        push    eax ebx esi
2331
        xor     esi, esi
2396
;        xor     esi, esi
2332
        jmp     window._.draw_negative_box.1
2397
;        jmp     window._.draw_negative_box.1
2333
;------------------------------------------------------------------------------
2398
;------------------------------------------------------------------------------
2334
align 4
2399
align 4
2335
;------------------------------------------------------------------------------
2400
;------------------------------------------------------------------------------
2336
window._.get_rect: ;/////////////////////////////////////////////////////
2401
window._.get_rect: ;/////////////////////////////////////////////////////
2337
;------------------------------------------------------------------------------
2402
;------------------------------------------------------------------------------