Subversion Repositories Kolibri OS

Rev

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

Rev 9925 Rev 9926
Line 75... Line 75...
75
format binary as "mnt"
75
format binary as "mnt"
Line 76... Line 76...
76
 
76
 
77
include 'macros.inc'
77
include 'macros.inc'
Line 78... Line 78...
78
include 'struct.inc'
78
include 'struct.inc'
Line 79... Line 79...
79
 
79
 
80
$Revision: 9925 $
80
$Revision: 9926 $
Line 549... Line 549...
549
; set clipboard
549
; set clipboard
Line 550... Line 550...
550
 
550
 
551
        xor     eax, eax
551
        xor     eax, eax
552
        mov     [clipboard_slots], eax
552
        mov     [clipboard_slots], eax
553
        mov     [clipboard_write_lock], eax
553
        mov     [clipboard_write_lock], eax
554
        stdcall kernel_alloc, 4096
554
        stdcall kernel_alloc, PAGE_SIZE
555
        test    eax, eax
555
        test    eax, eax
Line 556... Line 556...
556
        jnz     @f
556
        jnz     @f
557
 
557
 
Line 1552... Line 1552...
1552
        sub     edx, eax
1552
        sub     edx, eax
1553
        add     edx, esp
1553
        add     edx, esp
1554
        mov     ebx, [esp+64+32-8+4]
1554
        mov     ebx, [esp+64+32-8+4]
1555
; add window start x & y
1555
; add window start x & y
Line 1556... Line 1556...
1556
 
1556
 
1557
        mov     edi, [current_slot_idx]
-
 
1558
        mov     ecx, edi
-
 
1559
        shl     edi, BSF sizeof.APPDATA
1557
        mov     ecx, [current_slot_idx]
Line 1560... Line 1558...
1560
        shl     ecx, BSF sizeof.WDATA
1558
        shl     ecx, BSF sizeof.WDATA
1561
 
1559
 
1562
        mov     eax, [window_data + ecx + WDATA.box.left]
1560
        mov     eax, [window_data + ecx + WDATA.box.left]
1563
        add     eax, [SLOT_BASE + edi + APPDATA.wnd_clientbox.left]
1561
        add     eax, [window_data + ecx + WDATA.clientbox.left]
1564
        shl     eax, 16
1562
        shl     eax, 16
1565
        add     eax, [window_data + ecx + WDATA.box.top]
1563
        add     eax, [window_data + ecx + WDATA.box.top]
1566
        add     eax, [SLOT_BASE + edi + APPDATA.wnd_clientbox.top]
1564
        add     eax, [window_data + ecx + WDATA.clientbox.top]
1567
        add     ebx, eax
1565
        add     ebx, eax
1568
        mov     ecx, [esp+64+32-12+4]
1566
        mov     ecx, [esp+64+32-12+4]
1569
        mov     eax, [esp+64+8]         ; background color (if given)
1567
        mov     eax, [esp+64+8]         ; background color (if given)
Line 2107... Line 2105...
2107
        movzx   esi, word [WIN_STACK + ecx*2]
2105
        movzx   esi, word [WIN_STACK + ecx*2]
2108
        cmp     esi, 1
2106
        cmp     esi, 1
2109
        je      .nowindowdeactivate ; already deactive
2107
        je      .nowindowdeactivate ; already deactive
Line 2110... Line 2108...
2110
 
2108
 
2111
        mov     edi, ecx
2109
        mov     edi, ecx
2112
        shl     edi, 5
2110
        shl     edi, BSF sizeof.WDATA
2113
        add     edi, window_data
2111
        add     edi, window_data
2114
        movzx   esi, word [WIN_STACK + ecx * 2]
2112
        movzx   esi, word [WIN_STACK + ecx * 2]
2115
        lea     esi, [WIN_POS + esi * 2]
2113
        lea     esi, [WIN_POS + esi * 2]
2116
        call    window._.window_deactivate
2114
        call    window._.window_deactivate
Line 2172... Line 2170...
2172
        je      .fail
2170
        je      .fail
Line 2173... Line 2171...
2173
 
2171
 
2174
        mov     eax, edx
2172
        mov     eax, edx
Line 2175... Line 2173...
2175
        shl     edx, BSF sizeof.WDATA
2173
        shl     edx, BSF sizeof.WDATA
2176
 
2174
 
Line 2177... Line 2175...
2177
        cmp     [edx*8 + SLOT_BASE + APPDATA.state], TSTATE_FREE
2175
        cmp     [edx*(sizeof.APPDATA/sizeof.WDATA) + SLOT_BASE + APPDATA.state], TSTATE_FREE
2178
        je      .fail
2176
        je      .fail
Line 2531... Line 2529...
2531
        add     ebx, 10
2529
        add     ebx, 10
2532
        mov     ecx, 11
2530
        mov     ecx, 11
2533
        call    memmove
2531
        call    memmove
2534
        pop     ecx
2532
        pop     ecx
Line 2535... Line 2533...
2535
 
2533
 
2536
        shr     ecx, 3
2534
        shr     ecx, (BSF sizeof.APPDATA - BSF sizeof.WDATA)
2537
; +22: address of the process in memory
2535
; +22: address of the process in memory
2538
; +26: size of used memory - 1
2536
; +26: size of used memory - 1
2539
        push    edi
2537
        push    edi
2540
        lea     edi, [ebx+12]
2538
        lea     edi, [ebx+12]
2541
        xor     eax, eax
2539
        xor     eax, eax
2542
        mov     edx, 0x100000*16
2540
        mov     edx, 0x100000*16
2543
        cmp     ecx, 1 shl 5
2541
        cmp     ecx, 1 shl BSF sizeof.WDATA
2544
        je      .os_mem
2542
        je      .os_mem
2545
        mov     edx, [SLOT_BASE + ecx*8 + APPDATA.process]
2543
        mov     edx, [SLOT_BASE + ecx*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.process]
2546
        mov     edx, [edx + PROC.mem_used]
2544
        mov     edx, [edx + PROC.mem_used]
2547
        mov     eax, std_application_base_address
2545
        mov     eax, std_application_base_address
2548
.os_mem:
2546
.os_mem:
2549
        stosd
2547
        stosd
2550
        lea     eax, [edx-1]
2548
        lea     eax, [edx-1]
Line 2551... Line 2549...
2551
        stosd
2549
        stosd
2552
 
2550
 
2553
; +30: PID/TID
2551
; +30: PID/TID
Line 2554... Line 2552...
2554
        mov     eax, [SLOT_BASE + ecx*8 + APPDATA.tid]
2552
        mov     eax, [SLOT_BASE + ecx*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.tid]
2555
        stosd
2553
        stosd
2556
 
2554
 
Line 2561... Line 2559...
2561
        movsd
2559
        movsd
2562
        movsd
2560
        movsd
2563
        movsd
2561
        movsd
Line 2564... Line 2562...
2564
 
2562
 
2565
    ; Process state (+50)
2563
    ; Process state (+50)
2566
        movzx   eax, byte [SLOT_BASE + ecx*8 + APPDATA.state]
2564
        movzx   eax, byte [SLOT_BASE + ecx*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.state]
Line 2567... Line 2565...
2567
        stosd
2565
        stosd
2568
 
2566
 
2569
    ; Window client area box
2567
    ; Window client area box
2570
        lea     esi, [SLOT_BASE + ecx*8 + APPDATA.wnd_clientbox]
2568
        lea     esi, [window_data + ecx + WDATA.clientbox]
2571
        movsd
2569
        movsd
2572
        movsd
2570
        movsd
Line 2573... Line 2571...
2573
        movsd
2571
        movsd
2574
        movsd
2572
        movsd
2575
 
2573
 
Line 2576... Line 2574...
2576
    ; Window state
2574
    ; Window state
2577
        mov     al, [window_data + ecx + WDATA.fl_wstate]
2575
        mov     al, [window_data + ecx + WDATA.fl_wstate]
2578
        stosb
2576
        stosb
Line 2579... Line 2577...
2579
 
2577
 
2580
    ; Event mask (+71)
2578
    ; Event mask (+71)
2581
        mov     EAX, dword [SLOT_BASE + ecx*8 + APPDATA.event_mask]
2579
        mov     EAX, dword [SLOT_BASE + ecx*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.event_mask]
Line 2582... Line 2580...
2582
        stosd
2580
        stosd
2583
 
2581
 
Line 3592... Line 3590...
3592
.exit:
3590
.exit:
3593
        ret
3591
        ret
3594
;--------------------------------------
3592
;--------------------------------------
3595
align 4
3593
align 4
3596
@@:
3594
@@:
3597
        mov     edi, [current_slot]
3595
        mov     edi, [current_slot_idx]
-
 
3596
        shl     edi, BSF sizeof.WDATA
3598
        add     dx, word[edi + APPDATA.wnd_clientbox.top]
3597
        add     dx, word[window_data + edi + WDATA.clientbox.top]
3599
        rol     edx, 16
3598
        rol     edx, 16
3600
        add     dx, word[edi + APPDATA.wnd_clientbox.left]
3599
        add     dx, word[window_data + edi + WDATA.clientbox.left]
3601
        rol     edx, 16
3600
        rol     edx, 16
3602
;--------------------------------------
3601
;--------------------------------------
3603
align 4
3602
align 4
3604
.forced:
3603
.forced:
3605
        push    ebp esi 0
3604
        push    ebp esi 0
Line 3630... Line 3629...
3630
;        shr     eax, 3
3629
;        shr     eax, 3
3631
        stdcall is_region_userspace, ebx, eax
3630
        stdcall is_region_userspace, ebx, eax
3632
        pop     esi ecx
3631
        pop     esi ecx
3633
        jnz     sys_putimage.exit
3632
        jnz     sys_putimage.exit
Line 3634... Line 3633...
3634
 
3633
 
-
 
3634
        mov     eax, [current_slot_idx]
3635
        mov     eax, [current_slot]
3635
        shl     eax, BSF sizeof.WDATA
3636
        add     dx, word [eax + APPDATA.wnd_clientbox.top]
3636
        add     dx, word [window_data + eax + WDATA.clientbox.top]
3637
        rol     edx, 16
3637
        rol     edx, 16
3638
        add     dx, word [eax + APPDATA.wnd_clientbox.left]
3638
        add     dx, word [window_data + eax + WDATA.clientbox.left]
3639
        rol     edx, 16
3639
        rol     edx, 16
3640
;--------------------------------------
3640
;--------------------------------------
3641
align 4
3641
align 4
3642
.forced:
3642
.forced:
Line 3942... Line 3942...
3942
; ebx y beginning
3942
; ebx y beginning
3943
; ecx x end
3943
; ecx x end
3944
        ; edx y end
3944
        ; edx y end
3945
; edi color
3945
; edi color
3946
;__sys_drawbar:
3946
;__sys_drawbar:
3947
;        mov     esi, [current_slot]
3947
;        mov     esi, [current_slot_idx]
-
 
3948
;        shl     esi, BSF sizeof.WDATA
3948
;        add     eax, [esi+APPDATA.wnd_clientbox.left]
3949
;        add     eax, [window_data+esi+WDATA.clientbox.left]
3949
;        add     ecx, [esi+APPDATA.wnd_clientbox.left]
3950
;        add     ecx, [window_data+esi+WDATA.clientbox.left]
3950
;        add     ebx, [esi+APPDATA.wnd_clientbox.top]
3951
;        add     ebx, [window_data+esi+WDATA.clientbox.top]
3951
;        add     edx, [esi+APPDATA.wnd_clientbox.top]
3952
;        add     edx, [window_data+esi+WDATA.clientbox.top]
3952
;--------------------------------------
3953
;--------------------------------------
3953
;align 4
3954
;align 4
3954
;.forced:
3955
;.forced:
3955
;        call    vesa20_drawbar
3956
;        call    vesa20_drawbar
3956
;        call    [draw_pointer]
3957
;        call    [draw_pointer]