Subversion Repositories Kolibri OS

Rev

Rev 51 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
31 halyavin 1
;
51 mikedld 2
;    UNIFORM WINDOW COLOURS & SKIN
31 halyavin 3
;
4
;    Compile with FASM for Menuet
5
;
6
;    < russian edition by Ivan Poddubny >
51 mikedld 7
;    < skin selection by Mike Semenyako >
31 halyavin 8
;
9
 
10
;******************************************************************************
11
   use32
12
   org     0
13
   db      'MENUET01'  ; identifier
14
   dd      1           ; header version
15
   dd      START       ; start address
16
   dd      I_END       ; file size
51 mikedld 17
   dd      28000h      ; memory
31 halyavin 18
   dd      10000h      ; stack pointer (0x10000+ - work area for os)
19
   dd      0;,0        ; parameters, reserved
20
 
51 mikedld 21
  include 'lang.inc'
31 halyavin 22
  include 'macros.inc'
23
;******************************************************************************
24
 
25
 
51 mikedld 26
struct SKIN_HEADER
27
  .ident   dd ?
28
  .version dd ?
29
  .params  dd ?
30
  .buttons dd ?
31
  .bitmaps dd ?
32
ends
31 halyavin 33
 
51 mikedld 34
struct SKIN_PARAMS
35
  .skin_height    dd ?
36
  .margin.right   dw ?
37
  .margin.left    dw ?
38
  .margin.bottom  dw ?
39
  .margin.top     dw ?
40
  .colors.inner   dd ?
41
  .colors.outer   dd ?
42
  .colors.frame   dd ?
43
  .colors_1.inner dd ?
44
  .colors_1.outer dd ?
45
  .colors_1.frame dd ?
46
  .dtp.size       dd ?
47
  .dtp.data       db 40 dup (?)
48
ends
49
 
50
struct SKIN_BUTTONS
51
  .type     dd ?
52
  .pos:
53
    .left   dw ?
54
    .top    dw ?
55
  .size:
56
    .width  dw ?
57
    .height dw ?
58
ends
59
 
60
struct SKIN_BITMAPS
61
  .kind  dw ?
62
  .type  dw ?
63
  .data  dd ?
64
ends
65
 
66
 
31 halyavin 67
START:                          ; start of execution
68
 
69
    mov  eax,48                 ; get current colors
70
    mov  ebx,3
71
    mov  ecx,color_table
72
    mov  edx,4*10
73
    int  0x40
74
 
75
    cld
51 mikedld 76
    mov  esi,default_skn
77
    mov  edi,fname
78
    mov  ecx,default_skn.size
31 halyavin 79
    rep  movsb
51 mikedld 80
    mov  [skin_info.fname],0
81
    mov  [skin_info.workarea],0x10000
82
    call load_skin_file
31 halyavin 83
 
84
 
85
red:
86
    call draw_window            ; at first, draw the window
87
 
88
still:
89
 
90
    mov  eax,23                 ; wait here for event
91
    mov  ebx,5
92
    int  0x40
93
 
94
    dec  eax                    ; redraw request ?
95
    jz   red
96
    dec  eax                    ; key in buffer ?
97
    jz   key
98
    dec  eax                    ; button in buffer ?
99
    jz   button
100
 
101
    call draw_cursor
102
 
103
    jmp  still
104
 
105
 
106
  key:                          ; key
107
    mov  eax,2                  ; just read it and ignore
108
    int  0x40
109
    jmp  still
110
 
111
  button:                       ; button
112
    mov  eax,17                 ; get id
113
    int  0x40
114
 
51 mikedld 115
    cmp  ah,11                  ; read string
116
    jne  no_string
117
    call read_string
118
    jmp  still
119
  no_string:
120
 
121
    cmp  ah,12                  ; load file
122
    jne  no_load
123
    call load_file
124
    call draw_window
125
    jmp  still
126
  no_load:
127
 
128
    cmp  ah,13                  ; save file
129
    jne  no_save
130
    call save_file
131
    jmp  still
132
  no_save:
133
 
31 halyavin 134
    cmp  ah,14                  ; set 3d buttons
135
    jne  no_3d
136
    mov  eax,48
137
    mov  ebx,1
138
    mov  ecx,1
139
    int  0x40
140
    mov  eax,48
141
    mov  ebx,0
142
    mov  ecx,0
143
    int  0x40
144
    jmp  still
145
   no_3d:
146
 
147
    cmp  ah,15                  ; set flat buttons
148
    jne  no_flat
149
    mcall 48, 1, 0
150
    mcall 48, 0, 0
151
    jmp  still
152
  no_flat:
153
 
51 mikedld 154
    cmp  ah,16                  ; apply
31 halyavin 155
    jne  no_apply
51 mikedld 156
  apply_direct:
31 halyavin 157
    mov  eax,48
158
    mov  ebx,2
159
    mov  ecx,color_table
160
    mov  edx,10*4
161
    int  0x40
162
    mov  eax,48
163
    mov  ebx,0
164
    mov  ecx,0
165
    int  0x40
166
  no_apply:
167
 
51 mikedld 168
    cmp  ah,17                  ; load skin file
169
    jne  no_load_skin
170
    call load_skin_file
171
    call draw_window
172
    jmp  still
173
  no_load_skin:
174
 
175
    cmp   ah,18                 ; apply skin
176
    jne   no_apply_skin
177
    cmp   [skin_info.fname],0
178
    je    no_apply_skin
179
    mcall 48,8,skin_info
180
    call  draw_window
181
    jmp   still
182
  no_apply_skin:
183
 
31 halyavin 184
    cmp  ah,31
185
    jb   no_new_colour
186
    cmp  ah,41
187
    jg   no_new_colour
188
    shr  eax,8
189
    sub  eax,31
190
    shl  eax,2
191
    add  eax,color_table
192
    mov  ebx,[color]
193
    mov  [eax],ebx
194
    call draw_colours
195
    jmp  still
196
  no_new_colour:
197
 
198
     cmp  ah,1                   ; terminate
199
     jnz  noid1
200
    mov  eax,-1
201
    int  0x40
202
  noid1:
203
 
204
    jmp  still
205
 
206
 
207
draw_cursor:
208
 
209
    pusha
210
    mov  eax,37
211
    mov  ebx,2
212
    int  0x40
213
 
214
    cmp  eax,0
215
    jne  dc1
216
    popa
217
    ret
218
 
219
 dc1:
220
 
221
    mov  eax,37
222
    mov  ebx,1
223
    int  0x40
224
 
225
    mov  ebx,eax
226
    shr  ebx,16
227
    mov  ecx,eax
228
    and  ecx,0xffff
229
 
230
    cmp  ecx,32
231
    jbe  no_color
232
    cmp  ebx,32
233
    jbe  no_color
234
 
51 mikedld 235
    cmp  ebx,266           ; CHANGE COLOR
31 halyavin 236
    jb   no_color
51 mikedld 237
    cmp  ebx,266+20*3
31 halyavin 238
    jg   no_color
239
 
240
    cmp  ecx,30+128
241
    jge  no_color
242
    cmp  ecx,30
243
    jb   no_color
244
 
51 mikedld 245
    sub  ebx,266
31 halyavin 246
    mov  eax,ebx
247
    cdq
248
    mov  ebx,20
249
    div  ebx
250
    mov  ebx,2
251
    sub  ebx,eax
252
 
253
    add  ecx,-30
254
    not  ecx
255
    shl  ecx,1
256
 
257
    mov  byte [ebx+color],cl
258
    call draw_color
259
 
260
    popa
261
    ret
262
 
263
  no_color:
264
 
265
    popa
266
    ret
267
 
268
 
269
load_file:
270
    pushad
271
 
51 mikedld 272
    mov   [read_info.mode]       ,0
273
    mov   [read_info.start_block],0
274
    mov   [read_info.blocks]     ,1
275
    mov   [read_info.address]    ,color_table
276
    mov   [read_info.workarea]   ,0x10000
31 halyavin 277
    mcall 58, read_info
278
 
51 mikedld 279
    popad
280
ret
31 halyavin 281
 
51 mikedld 282
load_skin_file:
283
    pushad
284
 
285
    mov   [read_info.mode]       ,0
286
    mov   [read_info.start_block],0
287
    mov   [read_info.blocks]     ,64
288
    mov   [read_info.address]    ,0x20000
289
    mov   [read_info.workarea]   ,0x10000
290
    mcall 58, read_info
291
 
292
    cmp   dword[0x20000+SKIN_HEADER.ident],'SKIN'
293
    jne   @f
294
 
295
    mov   esi,fname
296
    mov   edi,skin_info.fname
297
    mov   ecx,257
298
    rep   movsb
299
 
300
    mov   esi,0x20000
301
    mov   edi,0x18000
302
    mov   ecx,0x8000/4
303
    rep   movsd
304
 
305
    mov   ebp,0x18000
306
    mov   esi,[ebp+SKIN_HEADER.params]
307
    add   esi,ebp
308
    lea   esi,[esi+SKIN_PARAMS.dtp.data]
309
    mov   edi,color_table
310
    mov   ecx,10
311
    rep   movsd
312
  @@:
313
 
31 halyavin 314
    popad
315
ret
316
 
317
 
318
save_file:
319
    pushad
320
 
51 mikedld 321
    mov   [write_info.mode]       ,1
322
    mov   [write_info.bytes2write],10*4
323
    mov   [write_info.address]    ,color_table
324
    mov   [write_info.workarea]   ,0x10000
31 halyavin 325
    mcall 58, write_info
326
 
327
    popad
328
ret
329
 
330
 
331
read_string:
332
 
333
    pusha
334
 
335
    mov  edi,fname
336
    mov  al,'_'
51 mikedld 337
    mov  ecx,87
31 halyavin 338
    cld
339
    rep  stosb
340
 
341
    call print_text
342
 
343
    mov  edi,fname
344
 
345
  f11:
346
    mov  eax,10
347
    int  0x40
348
    cmp  eax,2
349
    jne  read_done
350
    mov  eax,2
351
    int  0x40
352
    shr  eax,8
353
    cmp  eax,13
354
    je   read_done
355
    cmp  eax,8
356
    jne  nobsl
357
    cmp  edi,fname
358
    je   f11
359
    dec  edi
360
    mov  [edi],byte '_'
361
    call print_text
362
    jmp  f11
363
   nobsl:
364
    mov  [edi],al
365
 
366
    call print_text
367
 
368
    inc  edi
51 mikedld 369
    cmp  edi, fname+87
31 halyavin 370
    jne  f11
371
 
372
  read_done:
373
 
374
    mov  ecx, fname
51 mikedld 375
    add  ecx, 88
31 halyavin 376
    sub  ecx, edi
377
    mov  eax, 0
378
    cld
379
    rep  stosb
380
 
381
    call print_text
382
 
383
    popa
384
 
385
    ret
386
 
387
 
388
print_text:
389
    pushad
390
 
51 mikedld 391
    mpack ebx,15,6*87+4
392
    mpack ecx,(30+18*10+2),11
393
    mcall 13,,,[w_work]
31 halyavin 394
 
51 mikedld 395
    mpack ebx,17,(30+18*10+4)
396
    mcall 4,,[w_work_text],fname,87
31 halyavin 397
 
398
    popad
399
ret
400
 
401
 
402
draw_color:
403
 
404
    pusha
405
 
406
    mov  eax,13
51 mikedld 407
    mov  ebx,266*65536+60
31 halyavin 408
    mov  ecx,170*65536+30
409
    mov  edx,[color]
410
    int  0x40
411
 
412
;   mov  eax,13
51 mikedld 413
    mov  ebx,266*65536+60
31 halyavin 414
    mov  ecx,200*65536+10
415
    mov  edx,[w_work]
416
    int  0x40
417
 
418
    mov  eax,47
419
    mov  ebx,0+1*256+8*65536
420
    mov  ecx,[color]
51 mikedld 421
    mov  edx,272*65536+201
31 halyavin 422
    mov  esi,[w_work_text]
423
    int  0x40
424
 
425
    popa
426
 
427
    ret
428
 
429
 
430
draw_colours:
431
 
432
    pusha
433
 
434
    mov  esi,color_table
435
 
436
    mov  ebx,225*65536+32
51 mikedld 437
    mov  ecx,32*65536+12
31 halyavin 438
  newcol:
439
    mov  eax,13
440
    mov  edx,[esi]
441
    int  0x40
51 mikedld 442
    add  ecx,18*65536
31 halyavin 443
    add  esi,4
444
    cmp  esi,color_table+4*9
445
    jbe  newcol
446
 
447
    popa
448
 
449
    ret
450
 
451
 
51 mikedld 452
draw_framerect: ; ebx,ecx
453
        push    ebx ecx
454
        add     bx,[esp+6]
455
        mov     cx,[esp+2]
456
        dec     ebx
457
        mcall   38
458
        add     cx,[esp]
459
        rol     ecx,16
460
        add     cx,[esp]
461
        sub     ecx,0x00010001
462
        mcall
463
        mov     ebx,[esp+4]
464
        mov     ecx,[esp]
465
        mov     bx,[esp+6]
466
        add     cx,[esp+2]
467
        dec     ecx
468
        mcall
469
        add     bx,[esp+4]
470
        rol     ebx,16
471
        add     bx,[esp+4]
472
        sub     ebx,0x00010001
473
        mcall
474
        add     esp,8
475
        ret
31 halyavin 476
 
51 mikedld 477
find_bitmap:
478
        mov     edi,[ebp+SKIN_HEADER.bitmaps]
479
        add     edi,ebp
480
        xor     ebx,ebx
481
  .lp1: cmp     dword[edi],0
482
        je      .lp2
483
        cmp     dword[edi+0],eax
484
        jne     @f
485
        mov     ebx,[edi+SKIN_BITMAPS.data]
486
        add     ebx,ebp
487
        mov     ecx,[ebx-2]
488
        mov     cx,[ebx+4]
489
        add     ebx,8
490
  .lp2: ret
491
    @@: add     edi,8
492
        jmp     .lp1
493
 
494
draw_skin:
495
        mcall   13,<345,206>,<20,191>,0x00FFFFFF
496
        mov     ebp,0x18000
497
        mov     edi,[ebp+SKIN_HEADER.params]
498
        add     edi,ebp
499
        mpack   ebx,345+45,150
500
        mpack   ecx,20+10,140
501
        mov     edx,[edi+SKIN_PARAMS.colors_1.outer]
502
        call    draw_framerect
503
        mpack   ebx,345+45+4,150-8
504
        mpack   ecx,20+10+4,140-8
505
        mov     edx,[edi+SKIN_PARAMS.colors_1.inner]
506
        call    draw_framerect
507
        mcall   13,<345+45+1,148>,<20+10+1,3>,[edi+SKIN_PARAMS.colors_1.frame]
508
        add     ecx,135*65536
509
        mcall
510
        mcall   ,<345+45+1,3>,<20+10+1,138>
511
        add     ebx,145*65536
512
        mcall
513
        mcall   ,<345+45+5,140>,<20+10+5,130>,dword[edi+SKIN_PARAMS.dtp.data+system_colors.work]
514
 
515
        mov     eax,0x00000001 ; left, inactive
516
        call    find_bitmap
517
        mcall   7,,,<345+45,20+10>
518
 
519
        pushd   [ebx-8]
520
        mov     eax,0x00000003 ; base, inactive
521
        call    find_bitmap
522
        pop     edx
523
        mov     esi,345+45+150-1
524
        sub     esi,edx
525
        shl     edx,16
526
        add     edx,(345+45)*65536+20+10
527
        mcall   7
528
    @@: rol     edx,16
529
        add     dx,[ebx-8]
530
        cmp     dx,si
531
        ja      @f
532
        rol     edx,16
533
        mcall   7
534
        jmp     @b
535
    @@:
536
 
537
        mov     eax,0x00000002 ; oper, inactive
538
        call    find_bitmap
539
        mov     edx,ecx
540
        shr     edx,16
541
        neg     edx
542
        shl     edx,16
543
        add     edx,(345+45+150)*65536+20+10
544
        mcall   7
545
 
546
        mov     ebp,0x18000
547
        mov     edi,[ebp+SKIN_HEADER.params]
548
        add     edi,ebp
549
        mov     eax,dword[edi+SKIN_PARAMS.margin.left-2]
550
        mov     ax,word[edi+SKIN_PARAMS.skin_height]
551
        sub     ax,[edi+SKIN_PARAMS.margin.bottom]
552
        shr     ax,1
553
        add     ax,[edi+SKIN_PARAMS.margin.top]
554
        add     ax,-4
555
        push    eax
556
        lea     ebx,[eax+(345+45)*65536+20+10]
557
        mcall   4,,dword[edi+SKIN_PARAMS.dtp.data+system_colors.grab_text],test_text,test_text.size
558
 
559
;---------------------------------------------------------
560
 
561
        mov     edi,[ebp+SKIN_HEADER.params]
562
        add     edi,ebp
563
        mpack   ebx,345+10,150
564
        mpack   ecx,20+40,140
565
        mov     edx,[edi+SKIN_PARAMS.colors.outer]
566
        call    draw_framerect
567
        mpack   ebx,345+10+4,150-8
568
        mpack   ecx,20+40+4,140-8
569
        mov     edx,[edi+SKIN_PARAMS.colors.inner]
570
        call    draw_framerect
571
        mcall   13,<345+10+1,148>,<20+40+1,3>,[edi+SKIN_PARAMS.colors.frame]
572
        add     ecx,135*65536
573
        mcall
574
        mcall   ,<345+10+1,3>,<20+40+1,138>
575
        add     ebx,145*65536
576
        mcall
577
        mcall   ,<345+10+5,140>,<20+40+5,130>,dword[edi+SKIN_PARAMS.dtp.data+system_colors.work]
578
 
579
        mov     eax,0x00010001 ; left, inactive
580
        call    find_bitmap
581
        mcall   7,,,<345+10,20+40>
582
 
583
        pushd   [ebx-8]
584
        mov     eax,0x00010003 ; base, inactive
585
        call    find_bitmap
586
        pop     edx
587
        mov     esi,345+10+150-1
588
        sub     esi,edx
589
        shl     edx,16
590
        add     edx,(345+10)*65536+20+40
591
        mcall   7
592
    @@: rol     edx,16
593
        add     dx,[ebx-8]
594
        cmp     dx,si
595
        ja      @f
596
        rol     edx,16
597
        mcall   7
598
        jmp     @b
599
    @@:
600
 
601
        mov     eax,0x00010002 ; oper, inactive
602
        call    find_bitmap
603
        mov     edx,ecx
604
        shr     edx,16
605
        neg     edx
606
        shl     edx,16
607
        add     edx,(345+10+150)*65536+20+40
608
        mcall   7
609
 
610
        mov     ebp,0x18000
611
        mov     edi,[ebp+SKIN_HEADER.params]
612
        add     edi,ebp
613
        pop     eax
614
        lea     ebx,[eax+(345+10)*65536+20+40]
615
        mcall   4,,dword[edi+SKIN_PARAMS.dtp.data+system_colors.grab_text],test_text,test_text.size
616
 
617
;----------------------------------------------------------------------
618
 
619
        mov     edi,[ebp+SKIN_HEADER.buttons]
620
        add     edi,ebp
621
  .lp1: cmp     dword[edi],0
622
        je      .lp2
623
        mov     ebx,dword[edi+SKIN_BUTTONS.left-2]
624
        mov     bx,[edi+SKIN_BUTTONS.width]
625
        mov     ecx,dword[edi+SKIN_BUTTONS.top-2]
626
        mov     cx,[edi+SKIN_BUTTONS.height]
627
        add     ebx,(345+10+150)*65536
628
        add     ecx,(20+40)*65536
629
        dec     ebx
630
        dec     ecx
631
        mcall   8,,,0x40000000
632
        add     edi,12
633
        jmp     .lp1
634
  .lp2: ret
635
 
31 halyavin 636
;   *********************************************
637
;   *******  WINDOW DEFINITIONS AND DRAW ********
638
;   *********************************************
639
 
640
 
641
draw_window:
642
 
643
    mov  eax,12                    ; function 12:tell os about windowdraw
644
    mov  ebx,1                     ; 1, start of draw
645
    int  0x40
646
 
647
    mov  eax,48
648
    mov  ebx,3
649
    mov  ecx,app_colours
650
    mov  edx,10*4
651
    int  0x40
652
 
653
    mov  eax,14
654
    int  0x40
655
 
656
    sub  eax,60*65536
657
    mov  ebx,eax
658
    mov  bx,40
659
 
660
                                   ; DRAW WINDOW
661
    mov  eax,0                     ; function 0 : define and draw window
51 mikedld 662
    mov  ebx,110*65536+555         ; [x start] *65536 + [x size]
663
    mov  ecx,50*65536+255          ; [y start] *65536 + [y size]
31 halyavin 664
    mov  edx,[w_work]              ; color of work area RRGGBB,8->color
665
    or   edx,0x02000000
666
    mov  esi,[w_grab]              ; color of grab bar  RRGGBB,8->color gl
667
    or   esi,0x80000000
668
    mov  edi,[w_frame]             ; color of frames    RRGGBB
669
    int  0x40
670
 
671
                                   ; WINDOW LABEL
672
    mov  eax,4                     ; function 4 : write text to window
673
    mov  ebx,8*65536+7 ;8          ; [x start] *65536 + [y start]
674
    mov  ecx,[w_grab_text]         ; color of text RRGGBB
675
if lang eq ru
676
    or   ecx,0x10000000
677
end if
678
    mov  edx,labelt                ; pointer to text beginning
679
    mov  esi,labelt.size           ; text length
680
    int  0x40
681
                                   ; CLOSE BUTTON
682
    mov  eax,8                     ; function 8 : define and draw button
51 mikedld 683
    mov  ebx,(555-19)*65536+12     ; [x start] *65536 + [x size]
31 halyavin 684
    mov  ecx,4*65536+12            ; [y start] *65536 + [y size]
685
    mov  edx,1                     ; button id
686
    mov  esi,[w_grab_button]       ; button color RRGGBB
687
    int  0x40
688
 
51 mikedld 689
if lang eq ru
690
  load_w  = (5*2+6*9)
691
  save_w  = (5*2+6*9)
692
  flat_w  = (5*2+6*7)
693
  apply_w = (5*2+6*9)
694
else
695
  load_w  = (5*2+6*6)
696
  save_w  = (5*2+6*6)
697
  flat_w  = (5*2+6*4)
698
  apply_w = (5*2+6*7)
699
end if
700
 
31 halyavin 701
;   mov  eax,8                    ; FILENAME BUTTON
51 mikedld 702
    mov  ebx,5*65536+545
703
    mov  ecx,212*65536+10
704
    mov  edx,0x4000000B
31 halyavin 705
    int  0x40
706
 
51 mikedld 707
;   mov  eax,8                    ; LOAD BUTTON
708
    mov  ebx,15*65536+load_w
709
    mov  ecx,(30+18*11)*65536+14
31 halyavin 710
    mov  edx,12
51 mikedld 711
    mov  esi,[w_work_button]
31 halyavin 712
    int  0x40
713
 
51 mikedld 714
;   mov  eax,8                    ; SAVE BUTTON
715
    add  ebx,(load_w+2)*65536-load_w+save_w
31 halyavin 716
    inc  edx
717
    int  0x40
718
 
719
;   mov  eax,8                    ; 3D
51 mikedld 720
    mov  ebx,(340-t1.size*6-13)*65536+(5*2+6*4)
31 halyavin 721
    inc  edx
722
    int  0x40
723
;   mov  eax,8                    ; FLAT
51 mikedld 724
    add  ebx,(5*2+6*4+2)*65536-(5*2+6*4)+flat_w
31 halyavin 725
    inc  edx
726
    int  0x40
727
 
51 mikedld 728
;   mov  eax,8                    ; APPLY BUTTON
729
    add  ebx,(flat_w+6+2)*65536-flat_w+apply_w
730
    inc  edx
731
    int  0x40
31 halyavin 732
 
51 mikedld 733
;   mov  eax,8                    ; LOAD SKIN BUTTON
734
    mov  ebx,(336+(555-335)/2-t2.size*6/2)*65536+load_w
735
    inc  edx
736
    int  0x40
737
 
738
;   mov  eax,8                    ; APPLY SKIN BUTTON
739
    add  ebx,(load_w+6+2)*65536-load_w+apply_w
740
    inc  edx
741
    int  0x40
742
 
31 halyavin 743
    mov  eax, 4
51 mikedld 744
    mov  ebx, (339-t1.size*6-12)*65536+(30+18*11+4)
31 halyavin 745
    mov  ecx, [w_work_button_text]
746
    mov  edx, t1
747
    mov  esi, t1.size
748
    int  0x40
749
 
51 mikedld 750
    mov  ebx,(336+(555-335)/2-t2.size*6/2)*65536+(30+18*11+4)
751
    mov  edx,t2
752
    mov  esi,t2.size
31 halyavin 753
    int  0x40
754
 
51 mikedld 755
 
31 halyavin 756
    mov  eax,38                    ; R G B COLOR GLIDES
51 mikedld 757
    mov  ebx,266*65536+285
31 halyavin 758
    mov  ecx,30*65536+30
759
    mov  edx,0xff0000
760
  .newl:
761
    int  0x40
762
    pusha
763
    add  ebx,20*65536+20
764
    shr  edx,8
765
    int  0x40
766
    add  ebx,20*65536+20
767
    shr  edx,8
768
    int  0x40
769
    popa
770
    sub  edx,0x020000
771
    add  ecx,0x00010001
772
    cmp  ecx,158*65536+158
773
    jnz  .newl
774
 
775
    call draw_color
776
 
777
    mov  edx,31                    ; BUTTON ROW
778
    mov  ebx,15*65536+200
51 mikedld 779
    mov  ecx,30*65536+14
31 halyavin 780
    mov  esi,[w_work_button]
781
  newb:
782
    mov  eax,8
783
    int  0x40
51 mikedld 784
    add  ecx,18*65536
31 halyavin 785
    inc  edx
786
    cmp  edx,40
787
    jbe  newb
788
 
51 mikedld 789
    mov  ebx,15*65536+34           ; ROW OF TEXTS
31 halyavin 790
    mov  ecx,[w_work_button_text]
791
    mov  edx,text
792
    mov  esi,32
793
  newline:
794
    mov  eax,4
795
    int  0x40
51 mikedld 796
    add  ebx,18
31 halyavin 797
    add  edx,32
798
    cmp  [edx],byte 'x'
799
    jne  newline
800
 
801
    call draw_colours
802
 
51 mikedld 803
    mcall 13,<5,546>,<212,11>,[w_work]
804
    mcall 13,<337,7>,<2,250>,[w_frame]
805
    shr   edx,1
806
    and   edx,0x007F7F7F
807
    mcall 38,<336,336>,<20,250>
808
    add   ebx,0x00080008
809
    mcall
810
    sub   ebx,0x00040004
811
    mcall ,,<0,255>
812
    mcall ,<5,550>,<211,211>
813
    add   ecx,0x000C000C
814
    mcall
815
 
31 halyavin 816
    call print_text
817
 
51 mikedld 818
    cmp  dword[0x18000+SKIN_HEADER.ident],'SKIN'
819
    jne  @f
820
    call draw_skin
821
  @@:
822
 
31 halyavin 823
    mov  eax,12                    ; function 12:tell os about windowdraw
824
    mov  ebx,2                     ; 2, end of draw
825
    int  0x40
826
 
827
    ret
828
 
829
 
830
; DATA AREA
831
 
832
lsz text,\
833
    ru,  '                       ',\
834
    ru,  '                 ',\
835
    ru,  '         ',\
836
    ru,  '        ',\
837
    ru,  '                 ',\
838
    ru,  '                  ',\
839
    ru,  '           ',\
840
    ru,  '                   ',\
841
    ru,  '            ',\
842
    ru,  '          ',\
843
    ru,  '                                ',\
51 mikedld 844
    ru,  '              ',\
31 halyavin 845
    ru,  'x',\
846
    en,  ' WINDOW FRAME                   ',\
847
    en,  ' WINDOW GRAB BAR                ',\
848
    en,  ' WINDOW GRAB BUTTON             ',\
849
    en,  ' WINDOW GRAB BUTTON TEXT        ',\
850
    en,  ' WINDOW GRAB TITLE              ',\
851
    en,  ' WINDOW WORK AREA               ',\
852
    en,  ' WINDOW WORK AREA BUTTON        ',\
853
    en,  ' WINDOW WORK AREA BUTTON TEXT   ',\
854
    en,  ' WINDOW WORK AREA TEXT          ',\
855
    en,  ' WINDOW WORK AREA GRAPH         ',\
856
    en,  '                                ',\
51 mikedld 857
    en,  '  LOAD    SAVE                  ',\
31 halyavin 858
    en,  'x'
859
 
860
 
51 mikedld 861
lsz t1,\
862
    ru, '  3D       ',\
863
    en, '  3D   FLAT    APPLY  '
864
 
31 halyavin 865
lsz t2,\
51 mikedld 866
    ru,  '     ',\
867
    en,  '  LOAD     APPLY  ',\
31 halyavin 868
 
51 mikedld 869
lsz test_text,\
870
    ru, '',\
871
    en, 'Caption'
31 halyavin 872
 
873
lsz labelt,\
874
    ru, ' ',\
875
    en, 'DESKTOP COLOURS - DEFINE COLOR AND CLICK ON TARGET'
876
 
51 mikedld 877
sz  default_skn, '/RD/1/DEFAULT.SKN',0
31 halyavin 878
 
879
color dd  0
880
 
881
I_END:
882
 
883
read_info:
884
  .mode         dd ?            ; read
885
  .start_block  dd ?            ; first block
886
  .blocks       dd ?            ; 512 bytes
887
  .address      dd ?
888
  .workarea     dd ?
889
fname rb 256+1            ; filename (+1 - for zero at the end)
890
 
891
virtual at read_info
892
 write_info:
893
  .mode         dd ?
894
  rd 1
895
  .bytes2write  dd ?
896
  .address      dd ?
897
  .workarea     dd ?
898
end virtual
899
 
51 mikedld 900
skin_info:
901
  .mode         dd ?
902
  .start_block  dd ?
903
  .blocks       dd ?
904
  .address      dd ?
905
  .workarea     dd ?
906
  .fname rb 256+1
907
 
31 halyavin 908
app_colours:
909
 
910
w_frame              dd ?
911
w_grab               dd ?
912
w_grab_button        dd ?
913
w_grab_button_text   dd ?
914
w_grab_text          dd ?
915
w_work               dd ?
916
w_work_button        dd ?
917
w_work_button_text   dd ?
918
w_work_text          dd ?
919
w_work_graph         dd ?
920
 
921
color_table:
922
  times 10 dd ?