Subversion Repositories Kolibri OS

Rev

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

Rev 5870 Rev 5926
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: 5870 $
9
$Revision: 5926 $
10
 
10
 
11
;==============================================================================
11
;==============================================================================
Line 384... Line 384...
384
align 4
384
align 4
385
@@:
385
@@:
386
        call    window._.set_window_box
386
        call    window._.set_window_box
387
        add     esp, sizeof.BOX
387
        add     esp, sizeof.BOX
Line 388... Line -...
388
 
-
 
389
        ; NOTE: do we really need this? to be reworked
-
 
390
;       mov     byte[DONT_DRAW_MOUSE], 0 ; mouse pointer
-
 
391
;       mov     byte[MOUSE_BACKGROUND], 0 ; no mouse under
-
 
392
;       mov     byte[MOUSE_DOWN], 0 ; react to mouse up/down
-
 
393
 
-
 
394
        ; NOTE: do we really need this? to be reworked
-
 
395
;       call    [draw_pointer]
-
 
396
;--------------------------------------
-
 
397
align 4
388
 
398
.exit:
389
.exit:
399
        ret
390
        ret
400
;------------------------------------------------------------------------------
-
 
401
align 4
-
 
402
;------------------------------------------------------------------------------
391
;------------------------------------------------------------------------------
403
syscall_window_settings: ;///// system function 71 /////////////////////////////
-
 
404
;------------------------------------------------------------------------------
-
 
405
;? 
392
syscall_window_settings: ;///// system function 71 ////////////////////////////
406
;------------------------------------------------------------------------------
-
 
407
        dec     ebx     ; subfunction #1 - set window caption
-
 
408
        jnz     .exit_fail
-
 
409
 
-
 
410
        ; NOTE: only window owner thread can set its caption,
-
 
411
        ;       so there's no parameter for PID/TID
-
 
412
 
393
;------------------------------------------------------------------------------
413
        mov     edi, [CURRENT_TASK]
394
        mov     edi, [CURRENT_TASK]
414
        shl     edi, 5
-
 
415
 
395
        shl     edi, 5
416
        mov     [edi * 8 + SLOT_BASE + APPDATA.wnd_caption], ecx
396
        mov     [edi * 8 + SLOT_BASE + APPDATA.wnd_caption], ecx
417
        or      [edi + window_data + WDATA.fl_wstyle], WSTYLE_HASCAPTION
-
 
418
 
397
        or      [edi + window_data + WDATA.fl_wstyle], WSTYLE_HASCAPTION
419
        call    window._.draw_window_caption
-
 
420
 
-
 
421
        xor     eax, eax ; eax = 0 (success)
-
 
422
        ret
-
 
423
 
-
 
424
;  .get_window_caption:
-
 
425
;        dec     eax     ; subfunction #2 - get window caption
-
 
426
;        jnz     .exit_fail
-
 
427
 
-
 
428
        ; not implemented yet
-
 
429
;--------------------------------------
-
 
430
align 4
-
 
431
.exit_fail:
-
 
432
        xor     eax, eax
-
 
433
        inc     eax     ; eax = 1 (fail)
-
 
434
        ret
398
        jmp     window._.draw_window_caption
435
;------------------------------------------------------------------------------
399
;------------------------------------------------------------------------------
436
align 4
-
 
437
;------------------------------------------------------------------------------
400
align 4
438
set_window_defaults: ;/////////////////////////////////////////////////////////
401
set_window_defaults: ;/////////////////////////////////////////////////////////
439
;------------------------------------------------------------------------------
-
 
440
;? 
-
 
441
;------------------------------------------------------------------------------
402
;------------------------------------------------------------------------------
442
        mov     byte [window_data + 0x20 + WDATA.cl_titlebar + 3], 1 ; desktop is not movable
403
        mov     byte [window_data + 0x20 + WDATA.cl_titlebar + 3], 1 ; desktop is not movable
443
        push    eax ecx
404
        push    eax ecx
444
        xor     eax, eax
405
        xor     eax, eax
445
        mov     ecx, WIN_STACK
406
        mov     ecx, WIN_STACK
Line 1636... Line 1597...
1636
;< edx = pointer to WDATA struct
1597
;< edx = pointer to WDATA struct
1637
;------------------------------------------------------------------------------
1598
;------------------------------------------------------------------------------
1638
        mov     eax, [CURRENT_TASK]
1599
        mov     eax, [CURRENT_TASK]
1639
        shl     eax, 5
1600
        shl     eax, 5
1640
        add     eax, window_data
1601
        add     eax, window_data
1641
 
-
 
1642
        ; save window colors
1602
; save window colors
1643
        mov     [eax + WDATA.cl_workarea], edx
1603
        mov     [eax + WDATA.cl_workarea], edx
1644
        mov     [eax + WDATA.cl_titlebar], esi
1604
        mov     [eax + WDATA.cl_titlebar], esi
1645
        mov     [eax + WDATA.cl_frames], edi
1605
        mov     [eax + WDATA.cl_frames], edi
1646
 
-
 
1647
        mov     edi, eax
1606
        mov     edi, eax
1648
 
-
 
1649
        ; was it already defined before?
1607
; Was it already defined before?
1650
        test    [edi + WDATA.fl_wdrawn], 1
1608
        test    [edi + WDATA.fl_wdrawn], 1
1651
        jnz     .set_client_box
1609
        jnz     .set_client_box
1652
        or      [edi + WDATA.fl_wdrawn], 1
-
 
1653
; After first draw_window we need redraw mouse necessarily!
1610
; No, it wasn't. After first draw_window we need redraw mouse necessarily!
1654
; Otherwise the user can see cursor specified by f.37.5 from another window.
1611
; Otherwise the user can see cursor specified by f.37.5 from another window.
1655
; He will be really unhappy! He is terrible in rage - usually he throws stones!
1612
; He will be really unhappy! Usually, he will be enraged!
-
 
1613
        or      [edi + WDATA.fl_wdrawn], 1
1656
        mov     [redrawmouse_unconditional], 1
1614
        mov     [redrawmouse_unconditional], 1
1657
        call    wakeup_osloop
1615
        call    wakeup_osloop
1658
        ; NOTE: commented out since doesn't provide necessary functionality
-
 
1659
        ;       anyway, to be reworked
-
 
1660
;       mov     eax, [timer_ticks] ; [0xfdf0]
-
 
1661
;       add     eax, 100
-
 
1662
;       mov     [new_window_starting], eax
-
 
1663
 
-
 
1664
        ; no it wasn't, performing initial window definition
1616
; performing initial window definition
1665
        movzx   eax, bx
1617
        movzx   eax, bx
1666
        mov     [edi + WDATA.box.width], eax
1618
        mov     [edi + WDATA.box.width], eax
1667
        movzx   eax, cx
1619
        movzx   eax, cx
1668
        mov     [edi + WDATA.box.height], eax
1620
        mov     [edi + WDATA.box.height], eax
1669
        sar     ebx, 16
1621
        sar     ebx, 16
Line 2314... Line 2266...
2314
        jz      .exit
2266
        jz      .exit
2315
        mov     edx, [edi * 8 + SLOT_BASE + APPDATA.wnd_caption]
2267
        mov     edx, [edi * 8 + SLOT_BASE + APPDATA.wnd_caption]
2316
        or      edx, edx
2268
        or      edx, edx
2317
        jz      .exit
2269
        jz      .exit
Line -... Line 2270...
-
 
2270
 
-
 
2271
        mov     ebp, [edi + window_data + WDATA.box.left - 2]
2318
 
2272
        mov     bp, word[edi + window_data + WDATA.box.top]
2319
        movzx   eax, [edi + window_data + WDATA.fl_wstyle]
2273
        movzx   eax, [edi + window_data + WDATA.fl_wstyle]
2320
        and     al, 0x0F
2274
        and     al, 0x0F
2321
        cmp     al, 3
2275
        cmp     al, 3
2322
        je      .skinned
2276
        je      .skinned
Line 2325... Line 2279...
2325
 
2279
 
2326
        jmp     .not_skinned
2280
        jmp     .not_skinned
2327
;--------------------------------------
2281
;--------------------------------------
2328
align 4
2282
align 4
2329
.skinned:
-
 
2330
        mov     ebp, [edi + window_data + WDATA.box.left - 2]
-
 
2331
        mov     bp, word[edi + window_data + WDATA.box.top]
2283
.skinned:
2332
        movzx   eax, word[edi + window_data + WDATA.box.width]
2284
        movzx   eax, word[edi + window_data + WDATA.box.width]
2333
        sub     ax, [_skinmargins.left]
2285
        sub     ax, [_skinmargins.left]
2334
        sub     ax, [_skinmargins.right]
-
 
2335
        push    edx
-
 
2336
        cwde
-
 
2337
        cdq
-
 
2338
        mov     ebx, 6
-
 
2339
        idiv    ebx
-
 
2340
        pop     edx
-
 
2341
        or      eax, eax
2286
        sub     ax, [_skinmargins.right]
2342
        js      .exit
-
 
2343
 
-
 
2344
        mov     esi, eax
2287
        js      .exit
2345
        mov     ebx, dword[_skinmargins.left - 2]
2288
        mov     ebx, dword[_skinmargins.left - 2]
2346
        mov     bx, word[_skinh]
2289
        mov     bx, word[_skinh]
2347
        sub     bx, [_skinmargins.bottom]
2290
        sub     bx, [_skinmargins.bottom]
2348
        sub     bx, [_skinmargins.top]
2291
        sub     bx, [_skinmargins.top]
2349
        sar     bx, 1
-
 
2350
        adc     bx, 0
2292
        sar     bx, 1
2351
        add     bx, [_skinmargins.top]
2293
        add     bx, [_skinmargins.top]
2352
        add     bx, -3
-
 
2353
        add     ebx, ebp
2294
        sub     bx, 8
2354
        jmp     .dodraw
2295
        jmp     .dodraw
2355
;--------------------------------------
2296
;--------------------------------------
2356
align 4
2297
align 4
2357
.not_skinned:
2298
.not_skinned:
2358
        cmp     al, 1
2299
        cmp     al, 1
2359
        je      .exit
-
 
2360
 
-
 
2361
        mov     ebp, [edi + window_data + WDATA.box.left - 2]
-
 
2362
        mov     bp, word[edi + window_data + WDATA.box.top]
2300
        je      .exit
2363
        movzx   eax, word[edi + window_data + WDATA.box.width]
2301
        movzx   eax, word[edi + window_data + WDATA.box.width]
2364
        sub     eax, 16
-
 
2365
        push    edx
-
 
2366
        cwde
-
 
2367
        cdq
-
 
2368
        mov     ebx, 6
-
 
2369
        idiv    ebx
-
 
2370
        pop     edx
-
 
2371
        or      eax, eax
2302
        sub     eax, 16
-
 
2303
        js      .exit
2372
        js      .exit
2304
        mov     ebx, 80002h
-
 
2305
.dodraw:
2373
 
2306
        shr     eax, 3
2374
        mov     esi, eax
-
 
2375
        mov     ebx, 0x00080007
2307
        mov     esi, eax
2376
        add     ebx, ebp
-
 
2377
;--------------------------------------
-
 
2378
align 4
-
 
2379
.dodraw:
2308
        add     ebx, ebp
-
 
2309
        mov     ecx, [common_colours + 16]
-
 
2310
        mov     al, 1
-
 
2311
        cmp     byte [edx], 4
-
 
2312
        jnc     @f
-
 
2313
        mov     al, [edx]
-
 
2314
        test    al, al
-
 
2315
        jz      .exit
-
 
2316
        inc     edx
-
 
2317
@@:
2380
        mov     ecx, [common_colours + 16]
2318
        shl     eax, 28
2381
        or      ecx, 0x80000000
2319
        or      ecx, eax
2382
        xor     edi, edi
2320
        xor     edi, edi
2383
        call    dtext_asciiz_esi
-
 
2384
;--------------------------------------
-
 
2385
align 4
2321
        call    dtext
2386
.exit:
-
 
2387
;        call    [draw_pointer]
2322
.exit:
2388
        call    __sys_draw_pointer
-
 
2389
        ret
2323
        jmp     __sys_draw_pointer
2390
;------------------------------------------------------------------------------
2324
;------------------------------------------------------------------------------
2391
align 4
2325
align 4
2392
;------------------------------------------------------------------------------
2326
;------------------------------------------------------------------------------
2393
window._.draw_negative_box: ;//////////////////////////////////////////////////
2327
window._.draw_negative_box: ;//////////////////////////////////////////////////