Subversion Repositories Kolibri OS

Rev

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

Rev 2465 Rev 2987
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: 2465 $
9
$Revision: 2987 $
10
 
10
 
11
;==============================================================================
11
;==============================================================================
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 1349... Line 1414...
1349
;------------------------------------------------------------------------------
1414
;------------------------------------------------------------------------------
1350
        push    eax ebx
1415
        push    eax ebx
Line 1351... Line 1416...
1351
 
1416
 
1352
        ; TODO: do we really need `draw_limits`?
1417
        ; TODO: do we really need `draw_limits`?
-
 
1418
        ; Yes, they are used by background drawing code.
1353
        ; Yes, they are used by background drawing code.
1419
 
1354
        mov     ecx, [eax + BOX.left]
1420
; we need only to restore the background windows at the old place!
1355
        mov     edx, [ebx + BOX.left]
-
 
1356
        cmp     ecx, edx
-
 
1357
        jle     @f
-
 
1358
        mov     ecx, edx
-
 
1359
;--------------------------------------
-
 
1360
align 4
-
 
1361
@@:
1421
        mov     ecx, [ebx + BOX.left]
1362
        mov     [draw_limits.left], ecx
-
 
1363
        mov     ecx, [eax + BOX.left]
1422
        mov     [draw_limits.left], ecx
1364
        add     ecx, [eax + BOX.width]
-
 
1365
        add     edx, [ebx + BOX.width]
-
 
1366
        cmp     ecx, edx
-
 
1367
        jae     @f
-
 
1368
        mov     ecx, edx
-
 
1369
;--------------------------------------
-
 
1370
align 4
-
 
1371
@@:
1423
        add     ecx, [ebx + BOX.width]
1372
        mov     [draw_limits.right], ecx
-
 
1373
        mov     ecx, [eax + BOX.top]
1424
        mov     [draw_limits.right], ecx
1374
        mov     edx, [ebx + BOX.top]
-
 
1375
        cmp     ecx, edx
-
 
1376
        jle     @f
-
 
1377
        mov     ecx, edx
-
 
1378
;--------------------------------------
-
 
1379
align 4
-
 
1380
@@:
1425
        mov     ecx, [ebx + BOX.top]
1381
        mov     [draw_limits.top], ecx
-
 
1382
        mov     ecx, [eax + BOX.top]
1426
        mov     [draw_limits.top], ecx
1383
        add     ecx, [eax + BOX.height]
-
 
1384
        add     edx, [ebx + BOX.height]
-
 
1385
        cmp     ecx, edx
-
 
1386
        jae     @f
-
 
1387
        mov     ecx, edx
-
 
1388
;--------------------------------------
-
 
1389
align 4
-
 
1390
@@:
1427
        add     ecx, [ebx + BOX.height]
1391
        mov     [draw_limits.bottom], ecx
1428
        mov     [draw_limits.bottom], ecx
1392
        ; recalculate screen buffer at old position
1429
; recalculate screen buffer at old position
1393
        push    ebx
1430
        push    ebx
1394
        mov     edx, [eax + BOX.height]
1431
        mov     edx, [eax + BOX.height]
Line 1576... Line 1613...
1576
 
1613
 
1577
        ; was it already defined before?
1614
        ; was it already defined before?
1578
        test    [edi + WDATA.fl_wdrawn], 1
1615
        test    [edi + WDATA.fl_wdrawn], 1
1579
        jnz     .set_client_box
1616
        jnz     .set_client_box
1580
        or      [edi + WDATA.fl_wdrawn], 1
-
 
-
 
1617
        or      [edi + WDATA.fl_wdrawn], 1
-
 
1618
; After first draw_window we need redraw mouse necessarily!
-
 
1619
; Otherwise the user can see cursor specified by f.37.5 from another window.
-
 
1620
; He will be really unhappy! He is terrible in rage - usually he throws stones!
1581
 
1621
        mov     [redrawmouse_unconditional], 1
1582
        ; NOTE: commented out since doesn't provide necessary functionality
1622
        ; NOTE: commented out since doesn't provide necessary functionality
1583
        ;       anyway, to be reworked
1623
        ;       anyway, to be reworked
1584
;       mov     eax, [timer_ticks] ; [0xfdf0]
1624
;       mov     eax, [timer_ticks] ; [0xfdf0]
1585
;       add     eax, 100
1625
;       add     eax, 100
Line 2342... Line 2382...
2342
        add     bx, word[edi + BOX.height]
2382
        add     bx, word[edi + BOX.height]
2343
        call    draw_rectangle.forced
2383
        call    draw_rectangle.forced
2344
        pop     esi ebx eax
2384
        pop     esi ebx eax
2345
        ret
2385
        ret
2346
;------------------------------------------------------------------------------
2386
;------------------------------------------------------------------------------
2347
align 4
2387
;align 4
2348
;------------------------------------------------------------------------------
2388
;------------------------------------------------------------------------------
2349
window._.end_moving__box: ;//////////////////////////////////////////////////
2389
;window._.end_moving__box: ;//////////////////////////////////////////////////
2350
;------------------------------------------------------------------------------
2390
;------------------------------------------------------------------------------
2351
;? Draw positive box
2391
;? Draw positive box
2352
;------------------------------------------------------------------------------
2392
;------------------------------------------------------------------------------
2353
;> edi = pointer to BOX struct
2393
;> edi = pointer to BOX struct
2354
;------------------------------------------------------------------------------
2394
;------------------------------------------------------------------------------
2355
        push    eax ebx esi
2395
;        push    eax ebx esi
2356
        xor     esi, esi
2396
;        xor     esi, esi
2357
        jmp     window._.draw_negative_box.1
2397
;        jmp     window._.draw_negative_box.1
2358
;------------------------------------------------------------------------------
2398
;------------------------------------------------------------------------------
2359
align 4
2399
align 4
2360
;------------------------------------------------------------------------------
2400
;------------------------------------------------------------------------------
2361
window._.get_rect: ;/////////////////////////////////////////////////////
2401
window._.get_rect: ;/////////////////////////////////////////////////////
2362
;------------------------------------------------------------------------------
2402
;------------------------------------------------------------------------------