Subversion Repositories Kolibri OS

Rev

Rev 7421 | Rev 8568 | 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
 
7613 leency 27
    mcall   40, EVM_REDRAW+EVM_BUTTON+EVM_MOUSE ;+EVM_DEKSTOP to update colors on skin change
4120 eAndrew 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
 
7421 leency 413
	;; it must not be possible to close dock
414
    ;cmp     ah, 1
415
    ;je	    .button_close
4120 eAndrew 416
 
417
    cmp     ah, 2
418
    je	    .button_dock
419
 
420
    jmp     @f
421
 
7421 leency 422
 ;.button_close:
423
 ;   jmp     exit
4120 eAndrew 424
 
425
 .button_dock:
426
    mov     edi, [win.button_index]
427
    imul    edi, 256
428
 
4140 eAndrew 429
    mov     dword[fi.p00], 7
430
 
4120 eAndrew 431
    mov     esi, edi
432
    add     esi, dock_items.path
4140 eAndrew 433
    mov     dword[fi.p21], esi
4120 eAndrew 434
 
435
    mov     esi, edi
436
    add     esi, dock_items.param
4140 eAndrew 437
    mov     dword[fi.p08], esi
4120 eAndrew 438
 
4140 eAndrew 439
    mcall   70, fi
4120 eAndrew 440
 
4134 eAndrew 441
    mov     ecx, eax
442
    mcall   18, 21
443
    and     eax, 0xFFFF
444
    mov     [win.psid], eax
445
 
4140 eAndrew 446
    jmp     wnd_hide
447
 
4120 eAndrew 448
  @@:
449
    jmp     main_loop
450
;-------------------------------------------------------------------------------
4140 eAndrew 451
event_mouse:
4198 eAndrew 452
  ; ==== IS MOUSE INNER ====
4120 eAndrew 453
    mcall   37, 1
454
    mov     edi, eax
455
    mov     esi, eax
456
    shr     edi, 16
457
    and     esi, 0xFFFF
458
 
459
    cmp     edi, 0
4140 eAndrew 460
    jl	    wnd_hide
4120 eAndrew 461
    dec     edi
462
    cmp     edi, [win.width]
4140 eAndrew 463
    jg	    wnd_hide
4120 eAndrew 464
    cmp     esi, 0
4140 eAndrew 465
    jl	    wnd_hide
4120 eAndrew 466
    dec     esi
467
    cmp     esi, [win.height]
4140 eAndrew 468
    jg	    wnd_hide
4120 eAndrew 469
 
4198 eAndrew 470
  ; ==== COUNT INDEX ====
471
 
4120 eAndrew 472
    mov     eax, [dock_items.location]
473
    and     eax, 1b
474
    cmp     eax, 1
475
    jne     .vert
476
    mov     eax, edi
477
    jmp     .nxt
478
 
479
 .vert:
480
    mov     eax, esi
4157 eAndrew 481
    add     eax, 12
4120 eAndrew 482
 
483
 .nxt:
4140 eAndrew 484
    sub     eax, 12
4120 eAndrew 485
    mov     edx, 0
4140 eAndrew 486
    mov     ebx, BUTTON_SIZE
4120 eAndrew 487
    div     ebx
488
 
489
    cmp     eax, [dock_items.count]
490
    jge     .set0
491
    jmp     .nxtcmp
492
 
493
 .set0:
494
    mov     eax, 100
495
 
496
 .nxtcmp:
497
    cmp     [win.button_index], eax
498
    je	    .nxt2
499
 
4198 eAndrew 500
    push    dword[win.button_index]
501
    pop     dword[win.prev_index]
502
 
4120 eAndrew 503
    mov     [win.button_index], eax
504
 
4198 eAndrew 505
 ; ==== DRAW SELECTION ====
506
    call    DRAW_SELECTION
507
 
4120 eAndrew 508
 .nxt2:
509
    mov     eax, [win.button_index]
4140 eAndrew 510
    imul    eax, BUTTON_SIZE
4120 eAndrew 511
    cmp     byte[win.isvert], 1
512
    je	    .vert_name
513
    add     eax, [win.x]
514
    mov     [nwin.x], eax
4157 eAndrew 515
    mov     byte[nwin.change_shape], 1
516
    mcall   13, <0, [win.width]>, <[win.height], 1>, [color.frame]
4120 eAndrew 517
    jmp     .vert_end
518
 .vert_name:
519
    add     eax, [win.y]
4157 eAndrew 520
    add     eax, 14
4120 eAndrew 521
    mov     [nwin.y], eax
4157 eAndrew 522
    mov     byte[nwin.change_shape], 1
523
    mcall   13, <[win.width], 1>, <0, [win.height]>, [color.frame]
4120 eAndrew 524
 .vert_end:
525
 
4198 eAndrew 526
 ; ==== OPEN/CLOSE WINDOW ====
4120 eAndrew 527
    cmp     byte[win.state], 1
4140 eAndrew 528
    je	    main_loop
4120 eAndrew 529
 
530
    mov     edx, esp
531
    add     edx, 512
532
    mcall   51, 1, n_main
533
 
4124 eAndrew 534
    mov     eax, 18
535
 
536
    mcall   , 7
4120 eAndrew 537
    mov     [win.psid], eax
538
 
4129 eAndrew 539
    mcall   18, 3, [win.sid]
4120 eAndrew 540
 
541
    mov     byte[win.state], 1
542
 
543
    mov     eax, [win.width_opn]
544
    mov     [win.width], eax
545
 
546
    mov     eax, [win.x_opn]
547
    mov     [win.x], eax
548
 
549
    mov     eax, [win.height_opn]
550
    mov     [win.height], eax
551
 
552
    mov     eax, [win.y_opn]
553
    mov     [win.y], eax
554
 
5475 leency 555
 
556
    cmp     byte[dock_items.ashow],1
557
    je	   .change_nothing
4120 eAndrew 558
    mcall   67, [win.x], [win.y], [win.width], [win.height]
559
 
5475 leency 560
  .change_nothing:
4198 eAndrew 561
    call    DRAW_WINDOW
562
    call    DRAW_SELECTION
563
    jmp     main_loop
4120 eAndrew 564
 
4140 eAndrew 565
;-------------------------------------------------------------------------------
566
wnd_hide:
4120 eAndrew 567
    cmp     byte[win.state], 0
4140 eAndrew 568
    je	    main_loop
4120 eAndrew 569
 
570
    mov     byte[nwin.close], 1
571
 
572
    mcall   18, 3, [win.psid]
573
 
574
    mov     byte[win.state], 0
575
    mov     byte[win.button_index], -1
576
 
5475 leency 577
    cmp     byte[dock_items.ashow],1
578
    je	   .do_no_hide
579
 
4120 eAndrew 580
    mov     eax, [win.width_hdn]
581
    mov     [win.width], eax
582
 
583
    mov     eax, [win.x_hdn]
584
    mov     [win.x], eax
585
 
586
    mov     eax, [win.height_hdn]
587
    mov     [win.height], eax
588
 
589
    mov     eax, [win.y_hdn]
590
    mov     [win.y], eax
591
 
592
    mcall   67, [win.x], [win.y], [win.width], [win.height]
593
 
5475 leency 594
  .do_no_hide:
4198 eAndrew 595
    call    DRAW_WINDOW
596
    jmp     main_loop
4120 eAndrew 597
;-------------------------------------------------------------------------------
4198 eAndrew 598
DRAW_SELECTION:
599
    mov     ebx, [win.prev_index]
600
    imul    ebx, BUTTON_SIZE
601
    add     ebx, 14
602
    shl     ebx, 16
603
    add     ebx, 40
604
    mov     ecx, 0x00020028
605
 
606
    cmp     byte[win.isvert], 1
607
    jne     @f
608
    xchg    ebx, ecx
609
    sub     ecx, 0x000C0000
610
  @@:
611
 
612
    mcall   13, , , [color.bg]
613
 
614
    mov     edx, ebx
615
    shr     ecx, 16
616
    mov     dx, cx
617
    add     edx, 0x00040004
618
 
619
    mov     ebx, [win.prev_index]
620
    imul    ebx, 4
621
    add     ebx, dock_items.icon
622
    mov     ebx, [ebx]
623
    imul    ebx, ICON_SIZE_BGR
624
    add     ebx, [img_data.rgb_object]
625
 
626
    mcall   7, , <32, 32>
627
 
628
    mov     ebx, [win.button_index]
629
    imul    ebx, BUTTON_SIZE
630
    add     ebx, 14
631
    shl     ebx, 16
632
    add     ebx, 40
633
    mov     ecx, 0x00020028
634
 
635
    cmp     byte[win.isvert], 1
636
    jne     @f
637
    xchg    ebx, ecx
638
    sub     ecx, 0x000C0000
639
  @@:
640
 
641
    mcall   13, , , [color.bt]
642
 
643
    mov     edx, ebx
644
    shr     ecx, 16
645
    mov     dx, cx
646
    add     edx, 0x00040004
647
 
648
    mov     ecx, [win.button_index]
649
    imul    ecx, 4
650
    add     ecx, dock_items.icon
651
    mov     ecx, [ecx]
652
    imul    ecx, ICON_SIZE_BGR
653
    add     ecx, [img_data.rgb_object]
654
 
655
    mov     ebx, sel_img
656
 
657
    mov     edi, 0
658
  @@:
659
    mov     al, byte[ecx + 2]
660
    shl     eax, 8
661
    mov     al, byte[ecx + 1]
662
    shl     eax, 8
663
    mov     al, byte[ecx + 0]
664
 
665
    or	    eax, 0x10000000
666
    cmp     eax, [color.bg]
667
    jne     .notbg
668
    mov     eax, [color.bt]
669
 .notbg:
670
 
671
    mov     byte[ebx + 0], al
672
    shr     eax, 8
673
    mov     byte[ebx + 1], al
674
    shr     eax, 8
675
    mov     byte[ebx + 2], al
676
 
677
    add     ebx, 3
678
    add     ecx, 3
679
 
680
    add     edi, 3
681
 
682
    cmp     edi, 1024 * 3
683
    jne     @b
684
 
685
    mcall   7, sel_img, <32, 32>
686
 
687
    ret
688
;-------------------------------------------------------------------------------
4120 eAndrew 689
proc sections_callback, _file_name, _section_name
690
    mov     eax, [_section_name]
691
    cmp     byte[eax], '@'
692
    jne     @f
693
 
694
    dec     dword[dock_items.count]
695
    jmp     .endproc
696
 
697
  @@:
698
    ; ==== GET NAME ====
699
    mov     ebx, [dock_items.count]
700
    imul    ebx, 16
701
    add     ebx, dock_items.name
702
 
703
    mov     eax, [_section_name]
704
 
705
    mov     edi, 0
706
  @@:
707
    mov     cl, byte[eax]
708
    mov     byte[ebx + edi], cl
709
 
710
    inc     eax
711
    inc     edi
712
    cmp     edi, 10
713
    jne     @b
714
 
715
  ; ==== GET PATH ====
716
    mov     ebx, [dock_items.count]
717
    imul    ebx, 256
718
    add     ebx, dock_items.path
719
 
720
    invoke  ini.get_str, [_file_name], [_section_name], ini_data.path_name, ebx, 256, 0
721
 
722
  ; === GET  PARAM ===
723
    mov     ebx, [dock_items.count]
724
    imul    ebx, 256
725
    add     ebx, dock_items.param
726
 
727
    invoke  ini.get_str, [_file_name], [_section_name], ini_data.param_name, ebx, 256, 0
728
 
729
  ; ==== GET ICON ====
730
    invoke  ini.get_int, [_file_name], [_section_name], ini_data.icon_name, 0
731
 
732
    mov     ebx, [dock_items.count]
733
    imul    ebx, 4
734
    mov     [dock_items.icon + ebx], eax
735
 
736
  ; ==== GET SEPARATOR ====
737
    invoke  ini.get_int, [_file_name], [_section_name], ini_data.separator_name, 0
738
 
739
    mov     ebx, [dock_items.count]
740
    mov     byte[dock_items.separator + ebx], al
741
 
742
  ; ====== END =======
743
 .endproc:
744
    mov     eax, 1
745
    inc     dword[dock_items.count]
746
    ret
747
endp
748
;-------------------------------------------------------------------------------
4140 eAndrew 749
    include "MEMORY.INC"