Subversion Repositories Kolibri OS

Rev

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

Rev 484 Rev 485
Line 17... Line 17...
17
   dd      28000h      ; memory
17
   dd      28000h      ; memory
18
   dd      10000h      ; stack pointer
18
   dd      10000h      ; stack pointer
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'
23
   include 'kglobals.inc'
23
   include 'kglobals.inc'
24
   include 'unpacker.inc'
24
   include 'unpacker.inc'
Line 25... Line 25...
25
;******************************************************************************
25
;******************************************************************************
26
 
26
 
27
 
27
 
28
struct SKIN_HEADER
28
struct SKIN_HEADER
29
  .ident   dd ?
29
  ident   dd ?
30
  .version dd ?
30
  version dd ?
31
  .params  dd ?
31
  params  dd ?
Line 32... Line 32...
32
  .buttons dd ?
32
  buttons dd ?
33
  .bitmaps dd ?
33
  bitmaps dd ?
34
ends
34
ends
35
 
35
 
36
struct SKIN_PARAMS
36
struct SKIN_PARAMS
37
  .skin_height    dd ?
37
  skin_height    dd ?
38
  .margin.right   dw ?
38
  margin.right   dw ?
39
  .margin.left    dw ?
39
  margin.left    dw ?
40
  .margin.bottom  dw ?
40
  margin.bottom  dw ?
41
  .margin.top     dw ?
41
  margin.top     dw ?
42
  .colors.inner   dd ?
42
  colors.inner   dd ?
43
  .colors.outer   dd ?
43
  colors.outer   dd ?
44
  .colors.frame   dd ?
44
  colors.frame   dd ?
45
  .colors_1.inner dd ?
45
  colors_1.inner dd ?
46
  .colors_1.outer dd ?
46
  colors_1.outer dd ?
Line 47... Line 47...
47
  .colors_1.frame dd ?
47
  colors_1.frame dd ?
48
  .dtp.size       dd ?
48
  dtp.size       dd ?
49
  .dtp.data       db 40 dup (?)
49
  dtp.data       db 40 dup (?)
50
ends
50
ends
51
 
51
 
52
struct SKIN_BUTTONS
52
struct SKIN_BUTTONS
53
  .type     dd ?
53
  type     dd ?
54
  .pos:
54
  pos:
55
    .left   dw ?
55
    left   dw ?
Line 56... Line 56...
56
    .top    dw ?
56
    top    dw ?
57
  .size:
57
  size:
58
    .width  dw ?
58
    width  dw ?
59
    .height dw ?
59
    height dw ?
60
ends
60
ends
Line 61... Line 61...
61
 
61
 
Line 62... Line 62...
62
struct SKIN_BITMAPS
62
struct SKIN_BITMAPS
63
  .kind  dw ?
63
  kind  dw ?
64
  .type  dw ?
64
  type  dw ?
65
  .data  dd ?
65
  _data  dd ?
66
ends
66
ends
Line 67... Line 67...
67
 
67
 
68
 
68
 
69
START:                          ; start of execution
69
START:                          ; start of execution
70
 
70
 
Line 93... Line 93...
93
 
93
 
Line 94... Line 94...
94
still:
94
still:
95
 
95
 
96
    mov  eax,23                 ; wait here for event
96
    mov  eax,23                 ; wait here for event
Line 97... Line 97...
97
    mov  ebx,5
97
    mov  ebx,5
98
    int  0x40
98
    mcall
99
 
99
 
100
    dec  eax                    ; redraw request ?
100
    dec  eax                    ; redraw request ?
Line 109... Line 109...
109
    jmp  still
109
    jmp  still
Line 110... Line 110...
110
 
110
 
111
 
111
 
112
  key:                          ; key
112
  key:                          ; key
113
    mov  al,2                   ; just read it and ignore
113
    mov  al,2                   ; just read it and ignore
Line 114... Line 114...
114
    int  0x40
114
    mcall
115
    jmp  still
115
    jmp  still
116
 
116
 
Line 117... Line 117...
117
  button:                       ; button
117
  button:                       ; button
118
    mov  al,17                  ; get id
118
    mov  al,17                  ; get id
119
    int  0x40
119
    mcall
120
 
120
 
Line 140... Line 140...
140
    cmp  ah,14                  ; set 3d buttons
140
    cmp  ah,14                  ; set 3d buttons
141
    jne  no_3d
141
    jne  no_3d
142
    mov  eax,48
142
    mov  eax,48
143
    mov  ebx,1
143
    mov  ebx,1
144
    mov  ecx,1
144
    mov  ecx,1
145
    int  0x40
145
    mcall
146
    jmp  doapply
146
    jmp  doapply
147
   no_3d:
147
   no_3d:
Line 148... Line 148...
148
 
148
 
149
    cmp  ah,15                  ; set flat buttons
149
    cmp  ah,15                  ; set flat buttons
Line 159... Line 159...
159
  apply_direct:
159
  apply_direct:
160
    mov  eax,48
160
    mov  eax,48
161
    mov  ebx,2
161
    mov  ebx,2
162
    mov  ecx,color_table
162
    mov  ecx,color_table
163
    mov  edx,10*4
163
    mov  edx,10*4
164
    int  0x40
164
    mcall
165
    jmp  doapply
165
    jmp  doapply
166
  no_apply:
166
  no_apply:
Line 167... Line 167...
167
 
167
 
168
    cmp  ah,17                  ; load skin file
168
    cmp  ah,17                  ; load skin file
Line 200... Line 200...
200
  no_new_colour:
200
  no_new_colour:
Line 201... Line 201...
201
 
201
 
202
    cmp  ah,1                   ; terminate
202
    cmp  ah,1                   ; terminate
203
    jnz  noid1
203
    jnz  noid1
204
    or   eax,-1
204
    or   eax,-1
205
    int  0x40
205
    mcall
Line 206... Line 206...
206
  noid1:
206
  noid1:
Line 207... Line 207...
207
 
207
 
Line 208... Line 208...
208
    jmp  still
208
    jmp  still
209
 
209
 
210
 
210
 
211
draw_cursor:
211
draw_cursor:
Line 212... Line 212...
212
 
212
 
213
    pusha
213
    pusha
214
    mov  eax,37
214
    mov  eax,37
215
    mov  ebx,2
215
    mov  ebx,2
Line 216... Line 216...
216
    int  0x40
216
    mcall
Line 217... Line 217...
217
 
217
 
218
    cmp  eax,0
218
    cmp  eax,0
219
    jne  dc1
219
    jne  dc1
Line 220... Line 220...
220
    popa
220
    popa
221
    ret
221
    ret
222
 
222
 
223
 dc1:
223
 dc1:
Line 351... Line 351...
351
 
351
 
Line 352... Line 352...
352
    mov  edi,fname
352
    mov  edi,fname
353
 
353
 
354
  f11:
354
  f11:
355
    mov  eax,10
355
    mov  eax,10
356
    int  0x40
356
    mcall
357
    cmp  eax,2
357
    cmp  eax,2
358
    jne  read_done
358
    jne  read_done
359
;    mov  eax,2
359
;    mov  eax,2
360
    int  0x40
360
    mcall
361
    shr  eax,8
361
    shr  eax,8
362
    cmp  eax,13
362
    cmp  eax,13
363
    je   read_done
363
    je   read_done
Line 413... Line 413...
413
 
413
 
414
    mov  eax,13
414
    mov  eax,13
415
    mov  ebx,266*65536+60
415
    mov  ebx,266*65536+60
416
    mov  ecx,170*65536+30
416
    mov  ecx,170*65536+30
417
    mov  edx,[color]
417
    mov  edx,[color]
Line 418... Line 418...
418
    int  0x40
418
    mcall
419
 
419
 
420
;   mov  eax,13
420
;   mov  eax,13
421
    mov  ebx,266*65536+60
421
    mov  ebx,266*65536+60
422
    mov  ecx,200*65536+10
422
    mov  ecx,200*65536+10
Line 423... Line 423...
423
    mov  edx,[w_work]
423
    mov  edx,[w_work]
424
    int  0x40
424
    mcall
425
 
425
 
426
    mov  eax,47
426
    mov  eax,47
427
    mov  ebx,0+1*256+8*65536
427
    mov  ebx,0+1*256+8*65536
428
    mov  ecx,[color]
428
    mov  ecx,[color]
Line 429... Line 429...
429
    mov  edx,272*65536+201
429
    mov  edx,272*65536+201
Line 430... Line 430...
430
    mov  esi,[w_work_text]
430
    mov  esi,[w_work_text]
Line 444... Line 444...
444
    mov  ebx,225*65536+32
444
    mov  ebx,225*65536+32
445
    mov  ecx,32*65536+12
445
    mov  ecx,32*65536+12
446
  newcol:
446
  newcol:
447
    mov  eax,13
447
    mov  eax,13
448
    mov  edx,[esi]
448
    mov  edx,[esi]
449
    int  0x40
449
    mcall
450
    add  ecx,18*65536
450
    add  ecx,18*65536
451
    add  esi,4
451
    add  esi,4
452
    cmp  esi,color_table+4*9
452
    cmp  esi,color_table+4*9
453
    jbe  newcol
453
    jbe  newcol
Line 488... Line 488...
488
        xor     ebx,ebx
488
        xor     ebx,ebx
489
  .lp1: cmp     dword[edi],0
489
  .lp1: cmp     dword[edi],0
490
        je      .lp2
490
        je      .lp2
491
        cmp     dword[edi+0],eax
491
        cmp     dword[edi+0],eax
492
        jne     @f
492
        jne     @f
493
        mov     ebx,[edi+SKIN_BITMAPS.data]
493
        mov     ebx,[edi+SKIN_BITMAPS._data]
494
        add     ebx,ebp
494
        add     ebx,ebp
495
        mov     ecx,[ebx-2]
495
        mov     ecx,[ebx-2]
496
        mov     cx,[ebx+4]
496
        mov     cx,[ebx+4]
497
        add     ebx,8
497
        add     ebx,8
498
  .lp2: ret
498
  .lp2: ret
Line 784... Line 784...
784
 
784
 
Line 785... Line 785...
785
draw_window:
785
draw_window:
786
 
786
 
787
    mov  eax,12                    ; function 12:tell os about windowdraw
787
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 788... Line 788...
788
    mov  ebx,1                     ; 1, start of draw
788
    mov  ebx,1                     ; 1, start of draw
789
    int  0x40
789
    mcall
790
 
790
 
791
    mov  eax,48
791
    mov  eax,48
792
    mov  ebx,3
792
    mov  ebx,3
Line 793... Line 793...
793
    mov  ecx,app_colours
793
    mov  ecx,app_colours
794
    mov  edx,10*4
794
    mov  edx,10*4
Line 795... Line 795...
795
    int  0x40
795
    mcall
796
 
796
 
797
    mov  eax,14
797
    mov  eax,14
798
    int  0x40
798
    mcall
799
 
799
 
800
                                      ; DRAW WINDOW
800
                                      ; DRAW WINDOW
801
    mov  eax,0                     ; function 0 : define and draw window
801
    mov  eax,0                     ; function 0 : define and draw window
802
    mov  ebx,110*65536+555         ; [x start] *65536 + [x size]
802
    mov  ebx,110*65536+555         ; [x start] *65536 + [x size]
Line 803... Line 803...
803
    mov  ecx,50*65536+255          ; [y start] *65536 + [y size]
803
    mov  ecx,50*65536+255          ; [y start] *65536 + [y size]
804
    mov  edx,[w_work]              ; color of work area RRGGBB,8->color
804
    mov  edx,[w_work]              ; color of work area RRGGBB,8->color
805
    or   edx,0x13000000
805
    or   edx,0x13000000
806
    mov  edi,header                ; WINDOW LABEL
806
    mov  edi,title                ; WINDOW LABEL
Line 821... Line 821...
821
    mov  eax,8                    ; FILENAME BUTTON
821
    mov  eax,8                    ; FILENAME BUTTON
822
    mov  ebx,5*65536+545
822
    mov  ebx,5*65536+545
823
    mov  ecx,212*65536+10
823
    mov  ecx,212*65536+10
824
    mov  edx,0x4000000B
824
    mov  edx,0x4000000B
825
    mov  esi,[w_grab_button]       ; button color RRGGBB
825
    mov  esi,[w_grab_button]       ; button color RRGGBB
826
    int  0x40
826
    mcall
Line 827... Line 827...
827
 
827
 
828
;   mov  eax,8                    ; LOAD BUTTON
828
;   mov  eax,8                    ; LOAD BUTTON
829
    mov  ebx,15*65536+load_w
829
    mov  ebx,15*65536+load_w
830
    mov  ecx,(30+18*11)*65536+14
830
    mov  ecx,(30+18*11)*65536+14
831
    mov  edx,12
831
    mov  edx,12
832
    mov  esi,[w_work_button]
832
    mov  esi,[w_work_button]
Line 833... Line 833...
833
    int  0x40
833
    mcall
834
 
834
 
835
;   mov  eax,8                    ; SAVE BUTTON
835
;   mov  eax,8                    ; SAVE BUTTON
836
    add  ebx,(load_w+2)*65536-load_w+save_w
836
    add  ebx,(load_w+2)*65536-load_w+save_w
Line 837... Line 837...
837
    inc  edx
837
    inc  edx
838
    int  0x40
838
    mcall
839
 
839
 
840
;   mov  eax,8                    ; 3D
840
;   mov  eax,8                    ; 3D
841
;   mov  ebx,15*65536+35
841
;   mov  ebx,15*65536+35
842
;   mov  ecx,(30+18*12)*65536+14
842
;   mov  ecx,(30+18*12)*65536+14
Line 843... Line 843...
843
    mov  ebx,(340-t1.size*6-13)*65536+(5*2+6*4)
843
    mov  ebx,(340-t1.size*6-13)*65536+(5*2+6*4)
844
    inc  edx
844
    inc  edx
845
    int  0x40
845
    mcall
846
 
846
 
Line 847... Line 847...
847
;   mov  eax,8                    ; FLAT
847
;   mov  eax,8                    ; FLAT
848
    add  ebx,(5*2+6*4+2)*65536-(5*2+6*4)+flat_w
848
    add  ebx,(5*2+6*4+2)*65536-(5*2+6*4)+flat_w
849
    inc  edx
849
    inc  edx
850
    int  0x40
850
    mcall
Line 851... Line 851...
851
 
851
 
852
;   mov  eax,8                    ; APPLY BUTTON
852
;   mov  eax,8                    ; APPLY BUTTON
853
    add  ebx,(flat_w+6+2)*65536-flat_w+apply_w
853
    add  ebx,(flat_w+6+2)*65536-flat_w+apply_w
854
    inc  edx
854
    inc  edx
Line 855... Line 855...
855
    int  0x40
855
    mcall
856
 
856
 
857
;   mov  eax,8                    ; LOAD SKIN BUTTON
857
;   mov  eax,8                    ; LOAD SKIN BUTTON
858
    mov  ebx,(336+(555-335)/2-t2.size*6/2)*65536+load_w
858
    mov  ebx,(336+(555-335)/2-t2.size*6/2)*65536+load_w
Line 859... Line 859...
859
    inc  edx
859
    inc  edx
860
    int  0x40
860
    mcall
861
 
861
 
862
;   mov  eax,8                    ; APPLY SKIN BUTTON
862
;   mov  eax,8                    ; APPLY SKIN BUTTON
863
    add  ebx,(load_w+6+2)*65536-load_w+apply_w
863
    add  ebx,(load_w+6+2)*65536-load_w+apply_w
864
    inc  edx
864
    inc  edx
Line 865... Line 865...
865
    int  0x40
865
    mcall
866
 
866
 
867
    mov  eax, 4
867
    mov  eax, 4
868
    mov  ebx, (339-t1.size*6-12)*65536+(30+18*11+4)
868
    mov  ebx, (339-t1.size*6-12)*65536+(30+18*11+4)
Line 869... Line 869...
869
    mov  ecx, [w_work_button_text]
869
    mov  ecx, [w_work_button_text]
870
    mov  edx, t1
870
    mov  edx, t1
871
    mov  esi, t1.size
871
    mov  esi, t1.size
872
    int  0x40
872
    mcall
873
 
873
 
Line 874... Line 874...
874
    mov  ebx,(336+(555-335)/2-t2.size*6/2)*65536+(30+18*11+4)
874
    mov  ebx,(336+(555-335)/2-t2.size*6/2)*65536+(30+18*11+4)
875
    mov  edx,t2
875
    mov  edx,t2
876
    mov  esi,t2.size
876
    mov  esi,t2.size
877
    int  0x40
877
    mcall
878
 
878
 
879
;   mov  eax, 4
879
;   mov  eax, 4
880
;    mov  ebx, 277*65536+(30+18*12+4)
880
;    mov  ebx, 277*65536+(30+18*12+4)
881
;    mov  edx, t2
881
;    mov  edx, t2
882
;    mov  esi, t2.size
882
;    mov  esi, t2.size
883
;    int  0x40
883
;    mcall
884
 
884
 
885
    mov  eax,38                    ; R G B COLOR GLIDES
885
    mov  eax,38                    ; R G B COLOR GLIDES
886
    mov  ebx,266*65536+285
886
    mov  ebx,266*65536+285
887
    mov  ecx,30*65536+30
887
    mov  ecx,30*65536+30
888
    mov  edx,0xff0000
888
    mov  edx,0xff0000
889
  .newl:
889
  .newl:
890
    int  0x40
890
    mcall
891
    pusha
891
    pusha
Line 907... Line 907...
907
    mov  ebx,15*65536+200
907
    mov  ebx,15*65536+200
908
    mov  ecx,30*65536+14
908
    mov  ecx,30*65536+14
909
    mov  esi,[w_work_button]
909
    mov  esi,[w_work_button]
910
  newb:
910
  newb:
911
    mov  eax,8
911
    mov  eax,8
912
    int  0x40
912
    mcall
913
    add  ecx,18*65536
913
    add  ecx,18*65536
914
    inc  edx
914
    inc  edx
915
    cmp  edx,40
915
    cmp  edx,40
916
    jbe  newb
916
    jbe  newb
Line 919... Line 919...
919
    mov  ecx,[w_work_button_text]
919
    mov  ecx,[w_work_button_text]
920
    mov  edx,text
920
    mov  edx,text
921
    mov  esi,32
921
    mov  esi,32
922
  newline:
922
  newline:
923
    mov  eax,4
923
    mov  eax,4
924
    int  0x40
924
    mcall
925
    add  ebx,18
925
    add  ebx,18
926
    add  edx,32
926
    add  edx,32
927
    cmp  [edx],byte 'x'
927
    cmp  [edx],byte 'x'
928
    jne  newline
928
    jne  newline
Line 949... Line 949...
949
    call draw_skin
949
    call draw_skin
950
  @@:
950
  @@:
Line 951... Line 951...
951
 
951
 
952
    mov  eax,12                    ; function 12:tell os about windowdraw
952
    mov  eax,12                    ; function 12:tell os about windowdraw
953
    mov  ebx,2                     ; 2, end of draw
953
    mov  ebx,2                     ; 2, end of draw
Line 954... Line 954...
954
    int  0x40
954
    mcall
Line 955... Line 955...
955
 
955
 
Line 1027... Line 1027...
1027
    et, 'Nupu tekst'
1027
    et, 'Nupu tekst'
Line 1028... Line 1028...
1028
 
1028
 
Line 1029... Line 1029...
1029
sz  default_skn, '/RD/1/DEFAULT.SKN',0
1029
sz  default_skn, '/RD/1/DEFAULT.SKN',0
1030
 
1030
 
1031
if lang eq ru
1031
if lang eq ru
1032
  header db '€‘’Ž‰Š€ ŽŠŽ',0
1032
  title db '€‘’Ž‰Š€ ŽŠŽ',0
1033
else if lang eq et
1033
else if lang eq et
1034
  header db 'AKNA SEADED - VALI VÄRV JA VAJUTA OBJEKTILE',0
1034
  title db 'AKNA SEADED - VALI VÄRV JA VAJUTA OBJEKTILE',0
1035
else
1035
else
Line 1036... Line 1036...
1036
  header db 'WINDOWS SETTINGS - DEFINE COLOR AND CLICK ON TARGET',0
1036
  title db 'WINDOWS SETTINGS - DEFINE COLOR AND CLICK ON TARGET',0