Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
4120 eAndrew 1
use32
2
    org     0x0
3
;-------------------------------------------------------------------------------
4
    db	    "MENUET01"
5
    dd	    1, main, __dataend, __memend, __stackend, 0, sys_path
6
;-------------------------------------------------------------------------------
7
    include "../../../macros.inc"
8
    include "../../../proc32.inc"
9
    include "../../../dll.inc"
10
    include "../../../develop/libraries/box_lib/load_lib.mac"
4157 eAndrew 11
    ;include "../../../debug.inc"
4120 eAndrew 12
 
4140 eAndrew 13
    include "DATA.INC"
14
    include "NAME.INC"
15
 
4120 eAndrew 16
    @use_library_mem	 \
17
	    mem.Alloc,	 \
18
	    mem.Free,	 \
19
	    mem.ReAlloc, \
20
	    dll.Load
21
;================================================================================
4140 eAndrew 22
main:
4120 eAndrew 23
; ==== Init ====
24
    mcall   18, 7
25
    mov     [win.psid], eax
26
 
27
    mcall   40, 100101b
28
 
29
; ==== Load libs ====
30
    load_libraries load_lib_start, load_lib_end
31
 
32
; ==== Config LibINI ====
4195 eAndrew 33
    invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.location_name, 1
4120 eAndrew 34
    mov     [dock_items.location], eax
4234 eAndrew 35
    invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.fsize_name, 0
36
    mov     [dock_items.fsize], eax
5475 leency 37
    invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.ashow_name, 0
38
    mov     [dock_items.ashow], eax
4120 eAndrew 39
 
4195 eAndrew 40
    invoke  ini.sections, ini_data.file_name, sections_callback
41
 
42
; ==== Load colors ====
4140 eAndrew 43
    mcall   48, 3, color
44
    or	    dword[color.bg],	0x10000000
45
    or	    dword[color.frame], 0x10000000
46
    or	    dword[color.text],	0x80000000
4120 eAndrew 47
 
48
; ==== Config LibIMG ====
4140 eAndrew 49
    mov     dword[fi.p00], 5
50
    mov     dword[fi.p16], buf_128
51
    mov     dword[fi.p21], img_data.file_name
52
 
53
    mcall   70, fi
54
 
55
    mov     edx, [buf_128 + 32]
56
    imul    edx, 10
57
 
58
    stdcall mem.Alloc, edx
4120 eAndrew 59
    mov     [img_data.rgb_object], eax
60
 
4140 eAndrew 61
    mov     dword[fi.p00], 0
62
    mov     dword[fi.p12], edx
63
    m2m     dword[fi.p16], dword[img_data.rgb_object]
64
    mov     dword[fi.p21], img_data.file_name
4120 eAndrew 65
 
4140 eAndrew 66
    mcall   70, fi
4120 eAndrew 67
 
68
    cmp     ebx, 0xFFFFFFFF
69
    je	    @f
70
 
71
    stdcall dword[img.decode], dword[img_data.rgb_object], ebx, 0
72
    mov     dword[img_data.object], eax
73
 
74
  ; === ALPHA ===
4195 eAndrew 75
    mov     edi, eax
76
    add     edi, 8
77
    mov     edi, [edi]
78
    imul    edi, 128
79
    sub     edi, 4
80
 
4120 eAndrew 81
    add     eax, 24
82
    mov     eax, [eax]
83
 .setalpha:
84
    mov     ebx, [eax + edi]
85
    shr     ebx, 24
86
    cmp     ebx, 0
87
    jne     .nonalpha
4134 eAndrew 88
 
89
    mov     ecx, [color.bg]
4120 eAndrew 90
    mov     [eax + edi], ecx
91
 .nonalpha:
4195 eAndrew 92
    sub     edi, 4
93
    cmp     edi, 0
4120 eAndrew 94
    jne     .setalpha
95
 
96
  ; === CONVERTING TO BGR
97
    stdcall dword[img.toRGB], dword[img_data.object], dword[img_data.rgb_object]
98
    stdcall dword[img.destroy], dword[img_data.object]
99
 
100
; ==== Config window ====
101
    mov     eax, dword[dock_items.location]
102
    and     eax, 1b
103
    cmp     eax, 0
104
    je	    .vert
105
    jmp     .setshape
106
 
107
 .vert:
108
    mov     byte[win.isvert], 1
109
 
110
 .setshape:
111
    cmp     byte[win.isvert], 1
112
    je	    .vert_sp
113
 
114
 .horz_sp:
115
    call    .HORZ_WIDTH
116
    call    .HORZ_X
117
    call    .HORZ_HEIGHT
118
    cmp     dword[dock_items.location], 1
119
    je	    .settop
120
 
121
 .setbottom:
122
    call    .HORZ_Y_BOTTOM
123
    jmp     .SETDEF
124
 
125
 .settop:
126
    call    .HORZ_Y_TOP
127
    jmp     .SETDEF
128
 
129
 
130
 .vert_sp:
131
    call    .VERT_WIDTH
132
    call    .VERT_HEIGHT
133
    call    .VERT_Y
134
    cmp     dword[dock_items.location], 2
135
    je	    .setleft
136
 
137
 .setright:
138
    call    .VERT_X_RIGHT
139
    jmp     .SETDEF
140
 
141
 .setleft:
142
    call    .VERT_X_LEFT
143
    jmp     .SETDEF
144
 
4195 eAndrew 145
;-------------------------------------------------------------------------------
4120 eAndrew 146
 .HORZ_WIDTH:
4234 eAndrew 147
    cmp     [dock_items.fsize], byte 1
148
    je	    @f
4140 eAndrew 149
    mov     eax, BUTTON_SIZE
4120 eAndrew 150
    mov     ebx, [dock_items.count]
151
    imul    eax, ebx
4140 eAndrew 152
    add     eax, 24
4120 eAndrew 153
    dec     eax
4234 eAndrew 154
    jmp     .set_hw
155
  @@:
156
    mcall   14
157
    shr     eax, 16
158
 .set_hw:
4120 eAndrew 159
    mov     [win.width_opn], eax
160
    mov     [win.width_hdn], eax
161
 
162
    ret
163
 
4195 eAndrew 164
;-------------------------------------------------------------------------------
4120 eAndrew 165
 .HORZ_X:
166
    mcall   14
4195 eAndrew 167
    shr     eax, 17
168
    mov     ecx, [win.width_opn]
169
    shr     ecx, 1
170
    sub     eax, ecx
171
    mov     [win.x_opn], eax
172
    mov     [win.x_hdn], eax
4120 eAndrew 173
 
174
    ret
175
 
4195 eAndrew 176
;-------------------------------------------------------------------------------
4120 eAndrew 177
 .HORZ_HEIGHT:
4195 eAndrew 178
    mov     dword[win.height_hdn], 3
4140 eAndrew 179
    mov     dword[win.height_opn], BUTTON_SIZE
4120 eAndrew 180
 
181
    ret
182
 
4195 eAndrew 183
;-------------------------------------------------------------------------------
4120 eAndrew 184
 .HORZ_Y_BOTTOM:
185
    mcall   14
186
    and     eax, 0xFFFF
187
    dec     eax
188
    mov     [win.y_hdn], eax
4157 eAndrew 189
    sub     eax, 43
4120 eAndrew 190
    mov     [win.y_opn], eax
191
 
192
    ret
193
 
194
 .HORZ_Y_TOP:
195
    mov     dword[win.y_opn], 0
196
    mov     dword[win.y_hdn], 0
197
 
198
    ret
199
 
4195 eAndrew 200
;-------------------------------------------------------------------------------
4120 eAndrew 201
 .VERT_WIDTH:
4140 eAndrew 202
    mov     dword[win.width_opn], BUTTON_SIZE
4157 eAndrew 203
    mov     dword[win.width_hdn], 3
4120 eAndrew 204
 
205
    ret
206
 
4195 eAndrew 207
;-------------------------------------------------------------------------------
4120 eAndrew 208
 .VERT_X_LEFT:
209
    mov     dword[win.x_opn], 0
210
    mov     dword[win.x_hdn], 0
211
 
212
    ret
213
 
214
 .VERT_X_RIGHT:
215
    mcall   14
216
    and     eax, 0xFFFF0000
217
    shr     eax, 16
218
    mov     [win.x_hdn], eax
4140 eAndrew 219
    sub     eax, BUTTON_SIZE
4120 eAndrew 220
    mov     [win.x_opn], eax
221
 
222
    ret
223
 
4195 eAndrew 224
;-------------------------------------------------------------------------------
4120 eAndrew 225
 .VERT_HEIGHT:
4234 eAndrew 226
    cmp     [dock_items.fsize], byte 1
227
    je	    @f
4140 eAndrew 228
    mov     eax, BUTTON_SIZE
4120 eAndrew 229
    mov     ebx, [dock_items.count]
230
    imul    eax, ebx
231
    dec     eax
4234 eAndrew 232
    jmp     .set_vh
233
  @@:
234
    mcall   14
235
    and     eax, 0xFFFF
236
 .set_vh:
4120 eAndrew 237
    mov     [win.height_opn], eax
238
    mov     [win.height_hdn], eax
239
 
240
    ret
241
 
4195 eAndrew 242
;-------------------------------------------------------------------------------
4120 eAndrew 243
 .VERT_Y:
244
    mcall   14
245
    and     eax, 0xFFFF
4195 eAndrew 246
    shr     eax, 1
4120 eAndrew 247
 
4195 eAndrew 248
    mov     esi, [win.height_opn]
249
    shr     esi, 1
250
    sub     eax, esi
4120 eAndrew 251
 
4195 eAndrew 252
    mov     [win.y_hdn], eax
253
    mov     [win.y_opn], eax
4120 eAndrew 254
 
255
    ret
256
 
4195 eAndrew 257
;-------------------------------------------------------------------------------
4120 eAndrew 258
 .SETDEF:
259
    mov     eax, [win.width_hdn]
260
    mov     [win.width], eax
261
 
262
    mov     eax, [win.x_hdn]
263
    mov     [win.x], eax
264
 
265
    mov     eax, [win.height_hdn]
266
    mov     [win.height], eax
267
 
268
    mov     eax, [win.y_hdn]
269
    mov     [win.y], eax
5475 leency 270
 
271
    cmp     byte[dock_items.ashow],1
272
    jne     .not_ashow
4120 eAndrew 273
 
5475 leency 274
    mov     eax, [win.width_opn]
275
    mov     [win.width], eax
276
 
277
    mov     eax, [win.x_opn]
278
    mov     [win.x], eax
279
 
280
    mov     eax, [win.height_opn]
281
    mov     [win.height], eax
282
 
283
    mov     eax, [win.y_opn]
284
    mov     [win.y], eax
285
 
286
 .not_ashow:
287
 
288
 
4195 eAndrew 289
;-------------------------------------------------------------------------------
4120 eAndrew 290
; ==== START ====
291
    mcall   9, win.procinfo, -1
292
    mov     ecx, [win.procinfo + 30]
293
    mcall   18, 21
294
    and     eax, 0xFFFF
295
    mov     [win.sid], eax
296
 
297
    call    main_loop
4140 eAndrew 298
;-------------------------------------------------------------------------------
4120 eAndrew 299
exit:
300
    stdcall mem.Free, [img_data.rgb_object]
301
    mcall   18, 2, [nwin.sid]
302
    mcall   -1
303
;-------------------------------------------------------------------------------
4195 eAndrew 304
main_loop:
4120 eAndrew 305
    mcall   10
306
 
307
    cmp     eax, EV_REDRAW
308
    je	    event_redraw
309
 
310
    cmp     eax, EV_BUTTON
311
    je	    event_button
312
 
313
    cmp     eax, EV_MOUSE
314
    je	    event_mouse
315
 
316
    jmp     main_loop
317
;-------------------------------------------------------------------------------
4140 eAndrew 318
event_redraw:
4198 eAndrew 319
    call    DRAW_WINDOW
320
    jmp     main_loop
321
;-------------------------------------------------------------------------------
322
DRAW_WINDOW:
4120 eAndrew 323
    mcall   12, 1
324
 
4195 eAndrew 325
    mov     esi, [color.bg]
326
    or	    esi, 0x01000000
327
    mcall   0, <[win.x], [win.width]>, <[win.y], [win.height]>, [color.bg], , [color.frame]
4120 eAndrew 328
 
329
    mov     edi, 0
330
  @@:
331
    cmp     edi, [dock_items.count]
332
    je	    @f
333
 
334
    push    edi
4124 eAndrew 335
    mov     eax, 8
336
    mov     edx, 0x60000002
337
    mov     esi, [color.bg]
4140 eAndrew 338
    imul    edi, BUTTON_SIZE
339
    add     edi, 12
4124 eAndrew 340
    shl     edi, 16
4140 eAndrew 341
    add     edi, BUTTON_SIZE
4120 eAndrew 342
    cmp     byte[win.isvert], 1
343
    je	    .vert_btn
4140 eAndrew 344
    mcall   , edi, <0, BUTTON_SIZE>
4120 eAndrew 345
    jmp     .endbtn
346
 .vert_btn:
4157 eAndrew 347
    sub     edi, 12 shl 16
4140 eAndrew 348
    mcall   , <0, BUTTON_SIZE>, edi
4120 eAndrew 349
 .endbtn:
350
    pop     edi
351
 
352
    cmp     byte[dock_items.separator + edi], 1
4134 eAndrew 353
    jne     .end_separator
4120 eAndrew 354
 
355
 .draw_separator:
356
    push    ebx
357
    push    ecx
4140 eAndrew 358
 
4124 eAndrew 359
    mov     eax, 13
4120 eAndrew 360
    mov     ebx, edi
4140 eAndrew 361
    imul    ebx, BUTTON_SIZE
362
    add     ebx, BUTTON_SIZE
363
    add     ebx, 12
364
    dec     ebx
4120 eAndrew 365
    shl     ebx, 16
4198 eAndrew 366
    add     ebx, 2
4140 eAndrew 367
 
4120 eAndrew 368
    cmp     byte[win.isvert], 1
369
    je	    .vert_draw_sep
4198 eAndrew 370
    mcall   , , <4,  36>, [color.frame]
4120 eAndrew 371
    jmp     .end_inner_sep
372
 .vert_draw_sep:
4157 eAndrew 373
    sub     ebx, 12 shl 16
4120 eAndrew 374
    mov     ecx, ebx
4140 eAndrew 375
    mcall   , <4, 36>, , [color.frame]
4120 eAndrew 376
 .end_inner_sep:
377
    pop     ecx
378
    pop     ebx
379
 .end_separator:
380
 
381
    cmp     byte[win.isvert], 1
382
    je	    .vert_dig
383
    mov     edx, ebx
384
    and     edx, 0xFFFF0000
4140 eAndrew 385
    add     edx, 0x00060006
4120 eAndrew 386
    jmp     .digend
387
 .vert_dig:
388
    mov     edx, ecx
389
    and     edx, 0xFFFF0000
390
    shr     edx, 16
4140 eAndrew 391
    add     edx, 0x00060006
4120 eAndrew 392
 .digend:
393
 
394
    imul    ebx, edi, 4
395
    add     ebx, dock_items.icon
396
    mov     ebx, [ebx]
4140 eAndrew 397
    imul    ebx, ICON_SIZE_BGR
4120 eAndrew 398
    add     ebx, [img_data.rgb_object]
399
 
400
    mcall   7, , <32, 32>
401
 
402
    inc     edi
403
    jmp     @b
404
  @@:
405
 
406
    mcall   12, 2
407
 
4198 eAndrew 408
    ret
4120 eAndrew 409
;-------------------------------------------------------------------------------
4140 eAndrew 410
event_button:
4120 eAndrew 411
    mcall   17
412
 
413
    cmp     ah, 1
414
    je	    .button_close
415
 
416
    cmp     ah, 2
417
    je	    .button_dock
418
 
419
    jmp     @f
420
 
421
 .button_close:
422
    jmp     exit
423
 
424
 .button_dock:
425
    mov     edi, [win.button_index]
426
    imul    edi, 256
427
 
4140 eAndrew 428
    mov     dword[fi.p00], 7
429
 
4120 eAndrew 430
    mov     esi, edi
431
    add     esi, dock_items.path
4140 eAndrew 432
    mov     dword[fi.p21], esi
4120 eAndrew 433
 
434
    mov     esi, edi
435
    add     esi, dock_items.param
4140 eAndrew 436
    mov     dword[fi.p08], esi
4120 eAndrew 437
 
4140 eAndrew 438
    mcall   70, fi
4120 eAndrew 439
 
4134 eAndrew 440
    mov     ecx, eax
441
    mcall   18, 21
442
    and     eax, 0xFFFF
443
    mov     [win.psid], eax
444
 
4140 eAndrew 445
    jmp     wnd_hide
446
 
4120 eAndrew 447
  @@:
448
    jmp     main_loop
449
;-------------------------------------------------------------------------------
4140 eAndrew 450
event_mouse:
4198 eAndrew 451
  ; ==== IS MOUSE INNER ====
4120 eAndrew 452
    mcall   37, 1
453
    mov     edi, eax
454
    mov     esi, eax
455
    shr     edi, 16
456
    and     esi, 0xFFFF
457
 
458
    cmp     edi, 0
4140 eAndrew 459
    jl	    wnd_hide
4120 eAndrew 460
    dec     edi
461
    cmp     edi, [win.width]
4140 eAndrew 462
    jg	    wnd_hide
4120 eAndrew 463
    cmp     esi, 0
4140 eAndrew 464
    jl	    wnd_hide
4120 eAndrew 465
    dec     esi
466
    cmp     esi, [win.height]
4140 eAndrew 467
    jg	    wnd_hide
4120 eAndrew 468
 
4198 eAndrew 469
  ; ==== COUNT INDEX ====
470
 
4120 eAndrew 471
    mov     eax, [dock_items.location]
472
    and     eax, 1b
473
    cmp     eax, 1
474
    jne     .vert
475
    mov     eax, edi
476
    jmp     .nxt
477
 
478
 .vert:
479
    mov     eax, esi
4157 eAndrew 480
    add     eax, 12
4120 eAndrew 481
 
482
 .nxt:
4140 eAndrew 483
    sub     eax, 12
4120 eAndrew 484
    mov     edx, 0
4140 eAndrew 485
    mov     ebx, BUTTON_SIZE
4120 eAndrew 486
    div     ebx
487
 
488
    cmp     eax, [dock_items.count]
489
    jge     .set0
490
    jmp     .nxtcmp
491
 
492
 .set0:
493
    mov     eax, 100
494
 
495
 .nxtcmp:
496
    cmp     [win.button_index], eax
497
    je	    .nxt2
498
 
4198 eAndrew 499
    push    dword[win.button_index]
500
    pop     dword[win.prev_index]
501
 
4120 eAndrew 502
    mov     [win.button_index], eax
503
 
4198 eAndrew 504
 ; ==== DRAW SELECTION ====
505
    call    DRAW_SELECTION
506
 
4120 eAndrew 507
 .nxt2:
508
    mov     eax, [win.button_index]
4140 eAndrew 509
    imul    eax, BUTTON_SIZE
4120 eAndrew 510
    cmp     byte[win.isvert], 1
511
    je	    .vert_name
512
    add     eax, [win.x]
513
    mov     [nwin.x], eax
4157 eAndrew 514
    mov     byte[nwin.change_shape], 1
515
    mcall   13, <0, [win.width]>, <[win.height], 1>, [color.frame]
4120 eAndrew 516
    jmp     .vert_end
517
 .vert_name:
518
    add     eax, [win.y]
4157 eAndrew 519
    add     eax, 14
4120 eAndrew 520
    mov     [nwin.y], eax
4157 eAndrew 521
    mov     byte[nwin.change_shape], 1
522
    mcall   13, <[win.width], 1>, <0, [win.height]>, [color.frame]
4120 eAndrew 523
 .vert_end:
524
 
4198 eAndrew 525
 ; ==== OPEN/CLOSE WINDOW ====
4120 eAndrew 526
    cmp     byte[win.state], 1
4140 eAndrew 527
    je	    main_loop
4120 eAndrew 528
 
529
    mov     edx, esp
530
    add     edx, 512
531
    mcall   51, 1, n_main
532
 
4124 eAndrew 533
    mov     eax, 18
534
 
535
    mcall   , 7
4120 eAndrew 536
    mov     [win.psid], eax
537
 
4129 eAndrew 538
    mcall   18, 3, [win.sid]
4120 eAndrew 539
 
540
    mov     byte[win.state], 1
541
 
542
    mov     eax, [win.width_opn]
543
    mov     [win.width], eax
544
 
545
    mov     eax, [win.x_opn]
546
    mov     [win.x], eax
547
 
548
    mov     eax, [win.height_opn]
549
    mov     [win.height], eax
550
 
551
    mov     eax, [win.y_opn]
552
    mov     [win.y], eax
553
 
5475 leency 554
 
555
    cmp     byte[dock_items.ashow],1
556
    je	   .change_nothing
4120 eAndrew 557
    mcall   67, [win.x], [win.y], [win.width], [win.height]
558
 
5475 leency 559
  .change_nothing:
4198 eAndrew 560
    call    DRAW_WINDOW
561
    call    DRAW_SELECTION
562
    jmp     main_loop
4120 eAndrew 563
 
4140 eAndrew 564
;-------------------------------------------------------------------------------
565
wnd_hide:
4120 eAndrew 566
    cmp     byte[win.state], 0
4140 eAndrew 567
    je	    main_loop
4120 eAndrew 568
 
569
    mov     byte[nwin.close], 1
570
 
571
    mcall   18, 3, [win.psid]
572
 
573
    mov     byte[win.state], 0
574
    mov     byte[win.button_index], -1
575
 
5475 leency 576
    cmp     byte[dock_items.ashow],1
577
    je	   .do_no_hide
578
 
4120 eAndrew 579
    mov     eax, [win.width_hdn]
580
    mov     [win.width], eax
581
 
582
    mov     eax, [win.x_hdn]
583
    mov     [win.x], eax
584
 
585
    mov     eax, [win.height_hdn]
586
    mov     [win.height], eax
587
 
588
    mov     eax, [win.y_hdn]
589
    mov     [win.y], eax
590
 
591
    mcall   67, [win.x], [win.y], [win.width], [win.height]
592
 
5475 leency 593
  .do_no_hide:
4198 eAndrew 594
    call    DRAW_WINDOW
595
    jmp     main_loop
4120 eAndrew 596
;-------------------------------------------------------------------------------
4198 eAndrew 597
DRAW_SELECTION:
598
    mov     ebx, [win.prev_index]
599
    imul    ebx, BUTTON_SIZE
600
    add     ebx, 14
601
    shl     ebx, 16
602
    add     ebx, 40
603
    mov     ecx, 0x00020028
604
 
605
    cmp     byte[win.isvert], 1
606
    jne     @f
607
    xchg    ebx, ecx
608
    sub     ecx, 0x000C0000
609
  @@:
610
 
611
    mcall   13, , , [color.bg]
612
 
613
    mov     edx, ebx
614
    shr     ecx, 16
615
    mov     dx, cx
616
    add     edx, 0x00040004
617
 
618
    mov     ebx, [win.prev_index]
619
    imul    ebx, 4
620
    add     ebx, dock_items.icon
621
    mov     ebx, [ebx]
622
    imul    ebx, ICON_SIZE_BGR
623
    add     ebx, [img_data.rgb_object]
624
 
625
    mcall   7, , <32, 32>
626
 
627
    mov     ebx, [win.button_index]
628
    imul    ebx, BUTTON_SIZE
629
    add     ebx, 14
630
    shl     ebx, 16
631
    add     ebx, 40
632
    mov     ecx, 0x00020028
633
 
634
    cmp     byte[win.isvert], 1
635
    jne     @f
636
    xchg    ebx, ecx
637
    sub     ecx, 0x000C0000
638
  @@:
639
 
640
    mcall   13, , , [color.bt]
641
 
642
    mov     edx, ebx
643
    shr     ecx, 16
644
    mov     dx, cx
645
    add     edx, 0x00040004
646
 
647
    mov     ecx, [win.button_index]
648
    imul    ecx, 4
649
    add     ecx, dock_items.icon
650
    mov     ecx, [ecx]
651
    imul    ecx, ICON_SIZE_BGR
652
    add     ecx, [img_data.rgb_object]
653
 
654
    mov     ebx, sel_img
655
 
656
    mov     edi, 0
657
  @@:
658
    mov     al, byte[ecx + 2]
659
    shl     eax, 8
660
    mov     al, byte[ecx + 1]
661
    shl     eax, 8
662
    mov     al, byte[ecx + 0]
663
 
664
    or	    eax, 0x10000000
665
    cmp     eax, [color.bg]
666
    jne     .notbg
667
    mov     eax, [color.bt]
668
 .notbg:
669
 
670
    mov     byte[ebx + 0], al
671
    shr     eax, 8
672
    mov     byte[ebx + 1], al
673
    shr     eax, 8
674
    mov     byte[ebx + 2], al
675
 
676
    add     ebx, 3
677
    add     ecx, 3
678
 
679
    add     edi, 3
680
 
681
    cmp     edi, 1024 * 3
682
    jne     @b
683
 
684
    mcall   7, sel_img, <32, 32>
685
 
686
    ret
687
;-------------------------------------------------------------------------------
4120 eAndrew 688
proc sections_callback, _file_name, _section_name
689
    mov     eax, [_section_name]
690
    cmp     byte[eax], '@'
691
    jne     @f
692
 
693
    dec     dword[dock_items.count]
694
    jmp     .endproc
695
 
696
  @@:
697
    ; ==== GET NAME ====
698
    mov     ebx, [dock_items.count]
699
    imul    ebx, 16
700
    add     ebx, dock_items.name
701
 
702
    mov     eax, [_section_name]
703
 
704
    mov     edi, 0
705
  @@:
706
    mov     cl, byte[eax]
707
    mov     byte[ebx + edi], cl
708
 
709
    inc     eax
710
    inc     edi
711
    cmp     edi, 10
712
    jne     @b
713
 
714
  ; ==== GET PATH ====
715
    mov     ebx, [dock_items.count]
716
    imul    ebx, 256
717
    add     ebx, dock_items.path
718
 
719
    invoke  ini.get_str, [_file_name], [_section_name], ini_data.path_name, ebx, 256, 0
720
 
721
  ; === GET  PARAM ===
722
    mov     ebx, [dock_items.count]
723
    imul    ebx, 256
724
    add     ebx, dock_items.param
725
 
726
    invoke  ini.get_str, [_file_name], [_section_name], ini_data.param_name, ebx, 256, 0
727
 
728
  ; ==== GET ICON ====
729
    invoke  ini.get_int, [_file_name], [_section_name], ini_data.icon_name, 0
730
 
731
    mov     ebx, [dock_items.count]
732
    imul    ebx, 4
733
    mov     [dock_items.icon + ebx], eax
734
 
735
  ; ==== GET SEPARATOR ====
736
    invoke  ini.get_int, [_file_name], [_section_name], ini_data.separator_name, 0
737
 
738
    mov     ebx, [dock_items.count]
739
    mov     byte[dock_items.separator + ebx], al
740
 
741
  ; ====== END =======
742
 .endproc:
743
    mov     eax, 1
744
    inc     dword[dock_items.count]
745
    ret
746
endp
747
;-------------------------------------------------------------------------------
4140 eAndrew 748
    include "MEMORY.INC"