Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 179
Line 14... Line 14...
14
   dd      1           ; header version
14
   dd      1           ; header version
15
   dd      START       ; start address
15
   dd      START       ; start address
16
   dd      I_END       ; file size
16
   dd      I_END       ; file size
17
   dd      28000h      ; memory
17
   dd      28000h      ; memory
18
   dd      10000h      ; stack pointer (0x10000+ - work area for os)
18
   dd      10000h      ; stack pointer (0x10000+ - work area for os)
19
   dd      0;,0        ; parameters, reserved
19
   dd      0,0         ; parameters, reserved
Line 20... Line 20...
20
 
20
 
21
  include 'lang.inc'
21
   include 'lang.inc'
22
  include 'macros.inc'
22
   include 'macros.inc'
Line 23... Line 23...
23
;******************************************************************************
23
;******************************************************************************
24
 
24
 
Line 79... Line 79...
79
    rep  movsb
79
    rep  movsb
80
    mov  [skin_info.fname],0
80
    mov  [skin_info.fname],0
81
    mov  [skin_info.workarea],0x10000
81
    mov  [skin_info.workarea],0x10000
82
    call load_skin_file
82
    call load_skin_file
Line -... Line 83...
-
 
83
 
-
 
84
;    mov  esi, default_dtp
-
 
85
;    mov  edi, fname
-
 
86
;    mov  ecx, default_dtp.size
Line 83... Line 87...
83
 
87
;    rep  movsb
84
 
88
 
Line 85... Line 89...
85
red:
89
red:
Line 186... Line 190...
186
    cmp  ah,41
190
    cmp  ah,41
187
    jg   no_new_colour
191
    jg   no_new_colour
188
    shr  eax,8
192
    shr  eax,8
189
    sub  eax,31
193
    sub  eax,31
190
    shl  eax,2
194
    shl  eax,2
191
    add  eax,color_table
-
 
192
    mov  ebx,[color]
195
    mov  ebx,[color]
193
    mov  [eax],ebx
196
    mov  [eax+color_table],ebx
-
 
197
    cmp  dword[0x18000+SKIN_HEADER.ident],'SKIN'
-
 
198
    jne  @f
-
 
199
    mov  edi,[0x18000+SKIN_HEADER.params]
-
 
200
    mov  dword[edi+0x18000+SKIN_PARAMS.dtp.data+eax],ebx
-
 
201
    call draw_skin
194
    call draw_colours
202
@@: call draw_colours
195
    jmp  still
203
    jmp  still
196
  no_new_colour:
204
  no_new_colour:
Line 197... Line 205...
197
 
205
 
198
     cmp  ah,1                   ; terminate
206
     cmp  ah,1                   ; terminate
Line 274... Line 282...
274
    mov   [read_info.blocks]     ,1
282
    mov   [read_info.blocks]     ,1
275
    mov   [read_info.address]    ,color_table
283
    mov   [read_info.address]    ,color_table
276
    mov   [read_info.workarea]   ,0x10000
284
    mov   [read_info.workarea]   ,0x10000
277
    mcall 58, read_info
285
    mcall 58, read_info
Line -... Line 286...
-
 
286
 
-
 
287
;   call  draw_colours
278
 
288
 
279
    popad
289
    popad
Line 280... Line 290...
280
ret
290
ret
281
 
291
 
Line 489... Line 499...
489
        add     ebx,8
499
        add     ebx,8
490
  .lp2: ret
500
  .lp2: ret
491
    @@: add     edi,8
501
    @@: add     edi,8
492
        jmp     .lp1
502
        jmp     .lp1
Line -... Line 503...
-
 
503
 
-
 
504
dec_edx:
-
 
505
        sub     dl,4
-
 
506
        jnc     @f
-
 
507
        xor     dl,dl
-
 
508
    @@: sub     dh,4
-
 
509
        jnc     @f
-
 
510
        xor     dh,dh
-
 
511
    @@: rol     edx,16
-
 
512
        sub     dl,4
-
 
513
        jnc     @f
-
 
514
        xor     dl,dl
-
 
515
    @@: rol     edx,16
-
 
516
        ret
-
 
517
 
-
 
518
area:
-
 
519
  .x      = 345
-
 
520
  .y      = 20
-
 
521
  .width  = 206
-
 
522
  .height = 191
-
 
523
 
-
 
524
wnd1:
-
 
525
  .x      = area.x+49
-
 
526
  .y      = area.y+5
-
 
527
  .width  = 150
-
 
528
  .height = 90
-
 
529
wnd2:
-
 
530
  .x      = area.x+35
-
 
531
  .y      = area.y+35
-
 
532
  .width  = 150
-
 
533
  .height = 90
-
 
534
wnd3:
-
 
535
  .x      = area.x+21
-
 
536
  .y      = area.y+65
-
 
537
  .width  = 150
-
 
538
  .height = 90
-
 
539
wnd4:
-
 
540
  .x      = area.x+7
-
 
541
  .y      = area.y+95
-
 
542
  .width  = 150
-
 
543
  .height = 90
-
 
544
 
-
 
545
virtual at edi+SKIN_PARAMS.dtp.data
-
 
546
  dtp system_colors
-
 
547
end virtual
493
 
548
 
494
draw_skin:
549
draw_skin:
-
 
550
        mcall   13,,,0x00FFFFFF
495
        mcall   13,<345,206>,<20,191>,0x00FFFFFF
551
 
496
        mov     ebp,0x18000
552
        mov     ebp,0x18000
497
        mov     edi,[ebp+SKIN_HEADER.params]
553
        mov     edi,[ebp+SKIN_HEADER.params]
498
        add     edi,ebp
554
        add     edi,ebp
-
 
555
        mpack   ebx,wnd1.x,wnd1.width
-
 
556
        mpack   ecx,wnd1.y,wnd1.height
-
 
557
        mov     edx,[dtp.frame]
-
 
558
        call    draw_framerect
-
 
559
        mcall   13,,,dword[dtp.work]
-
 
560
 
-
 
561
        mov     eax,38
-
 
562
        mpack   ebx,wnd1.x+1,wnd1.x+wnd1.width-2
-
 
563
        mpack   ecx,wnd1.y+1,wnd1.y+1
-
 
564
        mov     edx,[dtp.grab]
-
 
565
        mov     esi,20
-
 
566
    @@: mcall
-
 
567
        call    dec_edx
-
 
568
        add     ecx,0x00010001
-
 
569
        dec     esi
-
 
570
        jnz     @b
-
 
571
 
-
 
572
        mov     edi,[ebp+SKIN_HEADER.params]
-
 
573
        add     edi,ebp
-
 
574
        mcall   4,,dword[dtp.grab_text],caption_text,caption_text.size
-
 
575
 
-
 
576
        mcall   8,,,0,[dtp.grab_button]
-
 
577
        mcall   4,,dword[dtp.grab_button_text],close_text,close_text.size
-
 
578
 
-
 
579
;----------------------------------------------------------------------
-
 
580
 
-
 
581
        mov     edi,[ebp+SKIN_HEADER.params]
-
 
582
        add     edi,ebp
-
 
583
        mpack   ebx,wnd2.x,wnd2.width
-
 
584
        mpack   ecx,wnd2.y,wnd2.height
-
 
585
        mov     edx,[dtp.frame]
-
 
586
        shr     edx,1
-
 
587
        and     edx,0x007F7F7F
-
 
588
        call    draw_framerect
-
 
589
        mpack   ebx,wnd2.x+4,wnd2.width-8
-
 
590
        mpack   ecx,wnd2.y+4,wnd2.height-8
-
 
591
        call    draw_framerect
-
 
592
        mcall   13,,,[dtp.frame]
-
 
593
        add     ecx,(wnd2.height-5)*65536
-
 
594
        mcall
-
 
595
        mcall   ,,
-
 
596
        add     ebx,(wnd2.width-5)*65536
-
 
597
        mcall
-
 
598
        mcall   ,,,dword[dtp.work]
-
 
599
 
-
 
600
        mov     eax,38
-
 
601
        mpack   ebx,wnd2.x+4,wnd2.x+wnd2.width-5
-
 
602
        mpack   ecx,wnd2.y+4,wnd2.y+4
-
 
603
        mov     edx,[dtp.grab]
-
 
604
        mov     esi,16
-
 
605
    @@: mcall
499
        mpack   ebx,345+45,150
606
        call    dec_edx
-
 
607
        add     ecx,0x00010001
-
 
608
        dec     esi
-
 
609
        jnz     @b
-
 
610
 
-
 
611
        mov     edi,[ebp+SKIN_HEADER.params]
-
 
612
        add     edi,ebp
-
 
613
        mcall   4,,dword[dtp.grab_text],caption_text,caption_text.size
-
 
614
 
-
 
615
        mcall   8,,,0,[dtp.grab_button]
-
 
616
        mcall   4,,dword[dtp.grab_button_text],close_text,close_text.size
-
 
617
 
-
 
618
;----------------------------------------------------------------------
-
 
619
 
-
 
620
        mov     edi,[ebp+SKIN_HEADER.params]
-
 
621
        add     edi,ebp
-
 
622
        mpack   ebx,wnd3.x,wnd3.width
500
        mpack   ecx,20+10,140
623
        mpack   ecx,wnd3.y,wnd3.height
501
        mov     edx,[edi+SKIN_PARAMS.colors_1.outer]
624
        mov     edx,[edi+SKIN_PARAMS.colors_1.outer]
502
        call    draw_framerect
625
        call    draw_framerect
503
        mpack   ebx,345+45+4,150-8
626
        mpack   ebx,wnd3.x+4,wnd3.width-8
504
        mpack   ecx,20+10+4,140-8
627
        mpack   ecx,wnd3.y+4,wnd3.height-8
505
        mov     edx,[edi+SKIN_PARAMS.colors_1.inner]
628
        mov     edx,[edi+SKIN_PARAMS.colors_1.inner]
506
        call    draw_framerect
629
        call    draw_framerect
507
        mcall   13,<345+45+1,148>,<20+10+1,3>,[edi+SKIN_PARAMS.colors_1.frame]
630
        mcall   13,,,[edi+SKIN_PARAMS.colors_1.frame]
508
        add     ecx,135*65536
631
        add     ecx,(wnd3.height-5)*65536
509
        mcall
632
        mcall
510
        mcall   ,<345+45+1,3>,<20+10+1,138>
633
        mcall   ,,
511
        add     ebx,145*65536
634
        add     ebx,(wnd3.width-5)*65536
512
        mcall
635
        mcall
Line 513... Line 636...
513
        mcall   ,<345+45+5,140>,<20+10+5,130>,dword[edi+SKIN_PARAMS.dtp.data+system_colors.work]
636
        mcall   ,,,dword[dtp.work]
514
 
637
 
515
        mov     eax,0x00000001 ; left, inactive
638
        mov     eax,0x00000001 ; left, inactive
Line 516... Line 639...
516
        call    find_bitmap
639
        call    find_bitmap
517
        mcall   7,,,<345+45,20+10>
640
        mcall   7,,,
518
 
641
 
519
        pushd   [ebx-8]
642
        pushd   [ebx-8]
520
        mov     eax,0x00000003 ; base, inactive
643
        mov     eax,0x00000003 ; base, inactive
521
        call    find_bitmap
644
        call    find_bitmap
522
        pop     edx
645
        pop     edx
523
        mov     esi,345+45+150-1
646
        mov     esi,wnd3.x+wnd3.width-1
524
        sub     esi,edx
647
        sub     esi,edx
525
        shl     edx,16
648
        shl     edx,16
526
        add     edx,(345+45)*65536+20+10
649
        add     edx,wnd3.x*65536+wnd3.y
527
        mcall   7
650
        mcall   7
528
    @@: rol     edx,16
651
    @@: rol     edx,16
Line 538... Line 661...
538
        call    find_bitmap
661
        call    find_bitmap
539
        mov     edx,ecx
662
        mov     edx,ecx
540
        shr     edx,16
663
        shr     edx,16
541
        neg     edx
664
        neg     edx
542
        shl     edx,16
665
        shl     edx,16
543
        add     edx,(345+45+150)*65536+20+10
666
        add     edx,(wnd3.x+wnd3.width)*65536+wnd3.y
544
        mcall   7
667
        mcall   7
Line 545... Line 668...
545
 
668
 
546
        mov     ebp,0x18000
669
        mov     ebp,0x18000
547
        mov     edi,[ebp+SKIN_HEADER.params]
670
        mov     edi,[ebp+SKIN_HEADER.params]
Line 551... Line 674...
551
        sub     ax,[edi+SKIN_PARAMS.margin.bottom]
674
        sub     ax,[edi+SKIN_PARAMS.margin.bottom]
552
        shr     ax,1
675
        shr     ax,1
553
        add     ax,[edi+SKIN_PARAMS.margin.top]
676
        add     ax,[edi+SKIN_PARAMS.margin.top]
554
        add     ax,-4
677
        add     ax,-4
555
        push    eax
678
        push    eax
556
        lea     ebx,[eax+(345+45)*65536+20+10]
679
        lea     ebx,[eax+wnd3.x*65536+wnd3.y]
557
        mcall   4,,dword[edi+SKIN_PARAMS.dtp.data+system_colors.grab_text],test_text,test_text.size
680
        mcall   4,,dword[dtp.grab_text],caption_text,caption_text.size
Line 558... Line 681...
558
 
681
 
Line 559... Line 682...
559
;---------------------------------------------------------
682
;---------------------------------------------------------
560
 
683
 
561
        mov     edi,[ebp+SKIN_HEADER.params]
684
        mov     edi,[ebp+SKIN_HEADER.params]
562
        add     edi,ebp
685
        add     edi,ebp
563
        mpack   ebx,345+10,150
686
        mpack   ebx,wnd4.x,wnd4.width
564
        mpack   ecx,20+40,140
687
        mpack   ecx,wnd4.y,wnd4.height
565
        mov     edx,[edi+SKIN_PARAMS.colors.outer]
688
        mov     edx,[edi+SKIN_PARAMS.colors.outer]
566
        call    draw_framerect
689
        call    draw_framerect
567
        mpack   ebx,345+10+4,150-8
690
        mpack   ebx,wnd4.x+4,wnd4.width-8
568
        mpack   ecx,20+40+4,140-8
691
        mpack   ecx,wnd4.y+4,wnd4.height-8
569
        mov     edx,[edi+SKIN_PARAMS.colors.inner]
692
        mov     edx,[edi+SKIN_PARAMS.colors.inner]
570
        call    draw_framerect
693
        call    draw_framerect
571
        mcall   13,<345+10+1,148>,<20+40+1,3>,[edi+SKIN_PARAMS.colors.frame]
694
        mcall   13,,,[edi+SKIN_PARAMS.colors.frame]
572
        add     ecx,135*65536
695
        add     ecx,(wnd4.height-5)*65536
573
        mcall
696
        mcall
574
        mcall   ,<345+10+1,3>,<20+40+1,138>
697
        mcall   ,,
575
        add     ebx,145*65536
698
        add     ebx,(wnd4.width-5)*65536
Line 576... Line 699...
576
        mcall
699
        mcall
577
        mcall   ,<345+10+5,140>,<20+40+5,130>,dword[edi+SKIN_PARAMS.dtp.data+system_colors.work]
700
        mcall   ,,,dword[dtp.work]
578
 
701
 
Line 579... Line 702...
579
        mov     eax,0x00010001 ; left, inactive
702
        mov     eax,0x00010001 ; left, inactive
580
        call    find_bitmap
703
        call    find_bitmap
581
        mcall   7,,,<345+10,20+40>
704
        mcall   7,,,
582
 
705
 
583
        pushd   [ebx-8]
706
        pushd   [ebx-8]
584
        mov     eax,0x00010003 ; base, inactive
707
        mov     eax,0x00010003 ; base, inactive
585
        call    find_bitmap
708
        call    find_bitmap
586
        pop     edx
709
        pop     edx
587
        mov     esi,345+10+150-1
710
        mov     esi,wnd4.x+wnd4.width-1
588
        sub     esi,edx
711
        sub     esi,edx
589
        shl     edx,16
712
        shl     edx,16
590
        add     edx,(345+10)*65536+20+40
713
        add     edx,wnd4.x*65536+wnd4.y
591
        mcall   7
714
        mcall   7
Line 602... Line 725...
602
        call    find_bitmap
725
        call    find_bitmap
603
        mov     edx,ecx
726
        mov     edx,ecx
604
        shr     edx,16
727
        shr     edx,16
605
        neg     edx
728
        neg     edx
606
        shl     edx,16
729
        shl     edx,16
607
        add     edx,(345+10+150)*65536+20+40
730
        add     edx,(wnd4.x+wnd4.width)*65536+wnd4.y
608
        mcall   7
731
        mcall   7
Line 609... Line 732...
609
 
732
 
610
        mov     ebp,0x18000
733
        mov     ebp,0x18000
611
        mov     edi,[ebp+SKIN_HEADER.params]
734
        mov     edi,[ebp+SKIN_HEADER.params]
612
        add     edi,ebp
735
        add     edi,ebp
613
        pop     eax
736
        pop     eax
614
        lea     ebx,[eax+(345+10)*65536+20+40]
737
        lea     ebx,[eax+wnd4.x*65536+wnd4.y]
Line 615... Line 738...
615
        mcall   4,,dword[edi+SKIN_PARAMS.dtp.data+system_colors.grab_text],test_text,test_text.size
738
        mcall   4,,dword[dtp.grab_text],caption_text,caption_text.size
Line 616... Line 739...
616
 
739
 
617
;----------------------------------------------------------------------
740
;----------------------------------------------------------------------
Line 622... Line 745...
622
        je      .lp2
745
        je      .lp2
623
        mov     ebx,dword[edi+SKIN_BUTTONS.left-2]
746
        mov     ebx,dword[edi+SKIN_BUTTONS.left-2]
624
        mov     bx,[edi+SKIN_BUTTONS.width]
747
        mov     bx,[edi+SKIN_BUTTONS.width]
625
        mov     ecx,dword[edi+SKIN_BUTTONS.top-2]
748
        mov     ecx,dword[edi+SKIN_BUTTONS.top-2]
626
        mov     cx,[edi+SKIN_BUTTONS.height]
749
        mov     cx,[edi+SKIN_BUTTONS.height]
627
        add     ebx,(345+10+150)*65536
750
        add     ebx,(wnd4.x+wnd4.width)*65536
628
        add     ecx,(20+40)*65536
751
        add     ecx,wnd4.y*65536
629
        dec     ebx
752
        dec     ebx
630
        dec     ecx
753
        dec     ecx
631
        mcall   8,,,0x40000000
754
        mcall   8,,,0x40000000
632
        add     edi,12
755
        add     edi,12
633
        jmp     .lp1
756
        jmp     .lp1
634
  .lp2: ret
757
  .lp2:
-
 
758
 
-
 
759
        mov     edi,[ebp+SKIN_HEADER.params]
-
 
760
        add     edi,ebp
-
 
761
        mpack   ebx,wnd4.x+10,wnd4.y+10
-
 
762
        add     bx,word[edi+SKIN_PARAMS.skin_height]
-
 
763
        mcall   4,,[dtp.work_text],window_text,window_text.size
-
 
764
 
-
 
765
        mov     ecx,[edi+SKIN_PARAMS.skin_height]
-
 
766
        shl     ecx,16
-
 
767
        add     ecx,(wnd4.y+8)*65536+10
-
 
768
        mcall   13,
-
 
769
                   (wnd4.x+window_text.size*6+20)>,,[dtp.work_graph]
-
 
770
 
-
 
771
        add     ecx,25*65536+8
-
 
772
        mcall   8,
-
 
773
                  button_text.size*6+11>,,0,[dtp.work_button]
-
 
774
 
-
 
775
        shr     ecx,16
-
 
776
        mov     bx,cx
-
 
777
        add     ebx,0x00060006
-
 
778
        mcall   4,,[dtp.work_button_text],button_text,button_text.size
-
 
779
 
-
 
780
        ret
Line 635... Line 781...
635
 
781
 
636
;   *********************************************
782
;   *********************************************
637
;   *******  WINDOW DEFINITIONS AND DRAW ********
783
;   *******  WINDOW DEFINITIONS AND DRAW ********
Line 715... Line 861...
715
    add  ebx,(load_w+2)*65536-load_w+save_w
861
    add  ebx,(load_w+2)*65536-load_w+save_w
716
    inc  edx
862
    inc  edx
717
    int  0x40
863
    int  0x40
Line 718... Line 864...
718
 
864
 
-
 
865
;   mov  eax,8                    ; 3D
-
 
866
;   mov  ebx,15*65536+35
719
;   mov  eax,8                    ; 3D
867
;   mov  ecx,(30+18*12)*65536+14
720
    mov  ebx,(340-t1.size*6-13)*65536+(5*2+6*4)
868
    mov  ebx,(340-t1.size*6-13)*65536+(5*2+6*4)
721
    inc  edx
869
    inc  edx
-
 
870
    int  0x40
722
    int  0x40
871
 
723
;   mov  eax,8                    ; FLAT
872
;   mov  eax,8                    ; FLAT
724
    add  ebx,(5*2+6*4+2)*65536-(5*2+6*4)+flat_w
873
    add  ebx,(5*2+6*4+2)*65536-(5*2+6*4)+flat_w
725
    inc  edx
874
    inc  edx
Line 750... Line 899...
750
    mov  ebx,(336+(555-335)/2-t2.size*6/2)*65536+(30+18*11+4)
899
    mov  ebx,(336+(555-335)/2-t2.size*6/2)*65536+(30+18*11+4)
751
    mov  edx,t2
900
    mov  edx,t2
752
    mov  esi,t2.size
901
    mov  esi,t2.size
753
    int  0x40
902
    int  0x40
Line -... Line 903...
-
 
903
 
-
 
904
;   mov  eax, 4
-
 
905
;    mov  ebx, 277*65536+(30+18*12+4)
-
 
906
;    mov  edx, t2
-
 
907
;    mov  esi, t2.size
Line 754... Line 908...
754
 
908
;    int  0x40
755
 
909
 
756
    mov  eax,38                    ; R G B COLOR GLIDES
910
    mov  eax,38                    ; R G B COLOR GLIDES
757
    mov  ebx,266*65536+285
911
    mov  ebx,266*65536+285
Line 864... Line 1018...
864
 
1018
 
865
lsz t2,\
1019
lsz t2,\
866
    ru,  ' ‡€ƒ“‡ˆ’œ   ˆŒ…ˆ’œ ',\
1020
    ru,  ' ‡€ƒ“‡ˆ’œ   ˆŒ…ˆ’œ ',\
Line 867... Line 1021...
867
    en,  '  LOAD     APPLY  ',\
1021
    en,  '  LOAD     APPLY  ',\
868
 
1022
 
869
lsz test_text,\
1023
lsz caption_text,\
Line -... Line 1024...
-
 
1024
    ru, '‡ £®«®¢®ª',\
-
 
1025
    en, 'Caption'
-
 
1026
 
-
 
1027
sz  close_text,'x'
-
 
1028
 
-
 
1029
lsz window_text,\
-
 
1030
    ru, '’¥ªáâ ¢ ®ª­¥',\
-
 
1031
    en, 'Window text'
-
 
1032
 
-
 
1033
lsz button_text,\
870
    ru, '‡ £®«®¢®ª',\
1034
    ru, '’¥ªáâ ­  ª­®¯ª¥',\
871
    en, 'Caption'
1035
    en, 'Button text'
872
 
1036
 
Line 873... Line 1037...
873
lsz labelt,\
1037
lsz labelt,\