Subversion Repositories Kolibri OS

Rev

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

Rev 4195 Rev 4198
Line 214... Line 214...
214
 .VERT_HEIGHT:
214
 .VERT_HEIGHT:
215
    mov     eax, BUTTON_SIZE
215
    mov     eax, BUTTON_SIZE
216
    mov     ebx, [dock_items.count]
216
    mov     ebx, [dock_items.count]
217
    imul    eax, ebx
217
    imul    eax, ebx
218
    dec     eax
218
    dec     eax
219
    add     eax, 12
-
 
220
    mov     [win.height_opn], eax
219
    mov     [win.height_opn], eax
221
    mov     [win.height_hdn], eax
220
    mov     [win.height_hdn], eax
Line 222... Line 221...
222
 
221
 
Line 279... Line 278...
279
    je	    event_mouse
278
    je	    event_mouse
Line 280... Line 279...
280
 
279
 
281
    jmp     main_loop
280
    jmp     main_loop
282
;-------------------------------------------------------------------------------
281
;-------------------------------------------------------------------------------
-
 
282
event_redraw:
-
 
283
    call    DRAW_WINDOW
-
 
284
    jmp     main_loop
-
 
285
;-------------------------------------------------------------------------------
283
event_redraw:
286
DRAW_WINDOW:
Line 284... Line 287...
284
    mcall   12, 1
287
    mcall   12, 1
285
 
288
 
286
    mov     esi, [color.bg]
289
    mov     esi, [color.bg]
Line 322... Line 325...
322
    imul    ebx, BUTTON_SIZE
325
    imul    ebx, BUTTON_SIZE
323
    add     ebx, BUTTON_SIZE
326
    add     ebx, BUTTON_SIZE
324
    add     ebx, 12
327
    add     ebx, 12
325
    dec     ebx
328
    dec     ebx
326
    shl     ebx, 16
329
    shl     ebx, 16
327
    add     ebx, 1
330
    add     ebx, 2
Line 328... Line 331...
328
 
331
 
329
    cmp     byte[win.isvert], 1
332
    cmp     byte[win.isvert], 1
330
    je	    .vert_draw_sep
333
    je	    .vert_draw_sep
331
    mcall   , , <4, 36>, [color.frame]
334
    mcall   , , <4,  36>, [color.frame]
Line 362... Line 365...
362
 
365
 
363
    inc     edi
366
    inc     edi
364
    jmp     @b
367
    jmp     @b
Line 365... Line -...
365
  @@:
-
 
366
 
-
 
367
 ; ==== DRAW SETTINGS ====
-
 
368
    cmp     byte[win.isvert], 1
-
 
369
    je	    .cfg_vert
-
 
370
 
-
 
371
    mov     ebx, [win.width]
-
 
372
    sub     ebx, 10
-
 
373
    shl     ebx, 16
-
 
374
    add     ebx, 8
-
 
375
    mcall   8, , <2, BUTTON_SIZE - 4>, 0x60000003
-
 
376
    jmp     @f
-
 
377
 
-
 
378
 .cfg_vert:
-
 
379
    mov     ecx, [win.height]
-
 
380
    sub     ecx, 10
-
 
381
    shl     ecx, 16
-
 
382
    add     ecx, 8
-
 
383
    mcall   8, <2, BUTTON_SIZE - 4>, , 0x60000003
-
 
384
  @@:
-
 
385
 
-
 
386
 ; ==== cfg image ====
-
 
387
    mov     edi, 0
-
 
388
  @@:
-
 
389
    cmp     byte[set_img + edi], 0
-
 
390
    je	    .notdraw
-
 
391
 
-
 
392
    mov     eax, edi
-
 
393
    mov     edx, 0
-
 
394
    mov     ebx, 6
-
 
395
    div     ebx
-
 
396
    mov     ebx, edx
-
 
397
    mov     ecx, eax
-
 
398
 
-
 
399
    add     ebx, [win.width]
-
 
400
    cmp     byte[win.isvert], 0
-
 
401
    je	    .cfg_hoz
-
 
402
    sub     ebx, [win.width]
-
 
403
    add     ebx, [win.height]
-
 
404
 .cfg_hoz:
-
 
405
    sub     ebx, 10
-
 
406
    add     ecx, 18
-
 
407
 
-
 
408
    cmp     byte[win.isvert], 0
-
 
409
    je	    .cfg_draw
-
 
410
 
-
 
411
    xchg    ebx, ecx
-
 
412
 
-
 
413
  .cfg_draw:
-
 
414
    mcall   1, , , [color.frame]
-
 
415
 
-
 
416
 .notdraw:
-
 
417
    inc     edi
-
 
418
    cmp     edi, 36
-
 
419
    jne     @b
368
  @@:
Line 420... Line 369...
420
 
369
 
421
    mcall   12, 2
370
    mcall   12, 2
422
 
371
 
423
    jmp     main_loop
372
    ret
Line 424... Line 373...
424
;-------------------------------------------------------------------------------
373
;-------------------------------------------------------------------------------
425
event_button:
374
event_button:
Line 426... Line 375...
426
    mcall   17
375
    mcall   17
427
 
376
 
Line 428... Line -...
428
    cmp     ah, 1
-
 
429
    je	    .button_close
-
 
430
 
-
 
431
    cmp     ah, 2
377
    cmp     ah, 1
Line 432... Line 378...
432
    je	    .button_dock
378
    je	    .button_close
433
 
379
 
Line 460... Line 406...
460
    and     eax, 0xFFFF
406
    and     eax, 0xFFFF
461
    mov     [win.psid], eax
407
    mov     [win.psid], eax
Line 462... Line 408...
462
 
408
 
Line 463... Line -...
463
    jmp     wnd_hide
-
 
464
 
-
 
465
 .button_cfg:
-
 
466
    mov     dword[fi.p00], 7
-
 
467
    mov     dword[fi.p21], cfg_app
-
 
468
    mcall   70, fi
-
 
469
 
-
 
470
    mov     ecx, eax
-
 
471
    mcall   18, 21
-
 
472
    and     eax, 0xFFFF
-
 
473
    mov     [win.psid], eax
-
 
474
 
-
 
475
    jmp     wnd_hide
409
    jmp     wnd_hide
476
 
410
 
477
  @@:
411
  @@:
478
    jmp     main_loop
412
    jmp     main_loop
-
 
413
;-------------------------------------------------------------------------------
479
;-------------------------------------------------------------------------------
414
event_mouse:
480
event_mouse:
415
  ; ==== IS MOUSE INNER ====
481
    mcall   37, 1
416
    mcall   37, 1
482
    mov     edi, eax
417
    mov     edi, eax
483
    mov     esi, eax
418
    mov     esi, eax
Line 493... Line 428...
493
    jl	    wnd_hide
428
    jl	    wnd_hide
494
    dec     esi
429
    dec     esi
495
    cmp     esi, [win.height]
430
    cmp     esi, [win.height]
496
    jg	    wnd_hide
431
    jg	    wnd_hide
Line -... Line 432...
-
 
432
 
-
 
433
  ; ==== COUNT INDEX ====
497
 
434
 
498
    mov     eax, [dock_items.location]
435
    mov     eax, [dock_items.location]
499
    and     eax, 1b
436
    and     eax, 1b
500
    cmp     eax, 1
437
    cmp     eax, 1
501
    jne     .vert
438
    jne     .vert
Line 521... Line 458...
521
 
458
 
522
 .nxtcmp:
459
 .nxtcmp:
523
    cmp     [win.button_index], eax
460
    cmp     [win.button_index], eax
Line -... Line 461...
-
 
461
    je	    .nxt2
-
 
462
 
-
 
463
    push    dword[win.button_index]
524
    je	    .nxt2
464
    pop     dword[win.prev_index]
Line -... Line 465...
-
 
465
 
-
 
466
    mov     [win.button_index], eax
-
 
467
 
525
 
468
 ; ==== DRAW SELECTION ====
526
    mov     [win.button_index], eax
469
    call    DRAW_SELECTION
527
 
470
 
528
 .nxt2:
471
 .nxt2:
529
    mov     eax, [win.button_index]
472
    mov     eax, [win.button_index]
Line 541... Line 484...
541
    mov     [nwin.y], eax
484
    mov     [nwin.y], eax
542
    mov     byte[nwin.change_shape], 1
485
    mov     byte[nwin.change_shape], 1
543
    mcall   13, <[win.width], 1>, <0, [win.height]>, [color.frame]
486
    mcall   13, <[win.width], 1>, <0, [win.height]>, [color.frame]
544
 .vert_end:
487
 .vert_end:
Line -... Line 488...
-
 
488
 
545
 
489
 ; ==== OPEN/CLOSE WINDOW ====
546
    cmp     byte[win.state], 1
490
    cmp     byte[win.state], 1
Line 547... Line 491...
547
    je	    main_loop
491
    je	    main_loop
548
 
492
 
Line 571... Line 515...
571
    mov     eax, [win.y_opn]
515
    mov     eax, [win.y_opn]
572
    mov     [win.y], eax
516
    mov     [win.y], eax
Line 573... Line 517...
573
 
517
 
Line -... Line 518...
-
 
518
    mcall   67, [win.x], [win.y], [win.width], [win.height]
-
 
519
 
574
    mcall   67, [win.x], [win.y], [win.width], [win.height]
520
    call    DRAW_WINDOW
Line 575... Line 521...
575
 
521
    call    DRAW_SELECTION
576
    jmp     event_redraw
522
    jmp     main_loop
577
 
523
 
578
;-------------------------------------------------------------------------------
524
;-------------------------------------------------------------------------------
Line 599... Line 545...
599
    mov     eax, [win.y_hdn]
545
    mov     eax, [win.y_hdn]
600
    mov     [win.y], eax
546
    mov     [win.y], eax
Line 601... Line 547...
601
 
547
 
Line -... Line 548...
-
 
548
    mcall   67, [win.x], [win.y], [win.width], [win.height]
602
    mcall   67, [win.x], [win.y], [win.width], [win.height]
549
 
-
 
550
    call    DRAW_WINDOW
-
 
551
    jmp     main_loop
-
 
552
;-------------------------------------------------------------------------------
-
 
553
DRAW_SELECTION:
-
 
554
    mov     ebx, [win.prev_index]
-
 
555
    imul    ebx, BUTTON_SIZE
-
 
556
    add     ebx, 14
-
 
557
    shl     ebx, 16
-
 
558
    add     ebx, 40
-
 
559
    mov     ecx, 0x00020028
-
 
560
 
-
 
561
    cmp     byte[win.isvert], 1
-
 
562
    jne     @f
-
 
563
    xchg    ebx, ecx
-
 
564
    sub     ecx, 0x000C0000
-
 
565
  @@:
-
 
566
 
-
 
567
    mcall   13, , , [color.bg]
-
 
568
 
-
 
569
    mov     edx, ebx
-
 
570
    shr     ecx, 16
-
 
571
    mov     dx, cx
-
 
572
    add     edx, 0x00040004
-
 
573
 
-
 
574
    mov     ebx, [win.prev_index]
-
 
575
    imul    ebx, 4
-
 
576
    add     ebx, dock_items.icon
-
 
577
    mov     ebx, [ebx]
-
 
578
    imul    ebx, ICON_SIZE_BGR
-
 
579
    add     ebx, [img_data.rgb_object]
-
 
580
 
-
 
581
    mcall   7, , <32, 32>
-
 
582
 
-
 
583
    mov     ebx, [win.button_index]
-
 
584
    imul    ebx, BUTTON_SIZE
-
 
585
    add     ebx, 14
-
 
586
    shl     ebx, 16
-
 
587
    add     ebx, 40
-
 
588
    mov     ecx, 0x00020028
-
 
589
 
-
 
590
    cmp     byte[win.isvert], 1
-
 
591
    jne     @f
-
 
592
    xchg    ebx, ecx
-
 
593
    sub     ecx, 0x000C0000
-
 
594
  @@:
-
 
595
 
-
 
596
    mcall   13, , , [color.bt]
-
 
597
 
-
 
598
    mov     edx, ebx
-
 
599
    shr     ecx, 16
-
 
600
    mov     dx, cx
-
 
601
    add     edx, 0x00040004
-
 
602
 
-
 
603
    mov     ecx, [win.button_index]
-
 
604
    imul    ecx, 4
-
 
605
    add     ecx, dock_items.icon
-
 
606
    mov     ecx, [ecx]
-
 
607
    imul    ecx, ICON_SIZE_BGR
-
 
608
    add     ecx, [img_data.rgb_object]
-
 
609
 
-
 
610
    mov     ebx, sel_img
-
 
611
 
-
 
612
    mov     edi, 0
-
 
613
  @@:
-
 
614
    mov     al, byte[ecx + 2]
-
 
615
    shl     eax, 8
-
 
616
    mov     al, byte[ecx + 1]
-
 
617
    shl     eax, 8
-
 
618
    mov     al, byte[ecx + 0]
-
 
619
 
-
 
620
    or	    eax, 0x10000000
-
 
621
    cmp     eax, [color.bg]
-
 
622
    jne     .notbg
-
 
623
    mov     eax, [color.bt]
-
 
624
 .notbg:
-
 
625
 
-
 
626
    mov     byte[ebx + 0], al
-
 
627
    shr     eax, 8
-
 
628
    mov     byte[ebx + 1], al
-
 
629
    shr     eax, 8
-
 
630
    mov     byte[ebx + 2], al
-
 
631
 
-
 
632
    add     ebx, 3
-
 
633
    add     ecx, 3
-
 
634
 
-
 
635
    add     edi, 3
-
 
636
 
-
 
637
    cmp     edi, 1024 * 3
-
 
638
    jne     @b
-
 
639
 
-
 
640
    mcall   7, sel_img, <32, 32>
603
 
641
 
604
    jmp     event_redraw
642
    ret
605
;-------------------------------------------------------------------------------
643
;-------------------------------------------------------------------------------
606
proc sections_callback, _file_name, _section_name
644
proc sections_callback, _file_name, _section_name
607
    mov     eax, [_section_name]
645
    mov     eax, [_section_name]