Subversion Repositories Kolibri OS

Rev

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

Rev 4134 Rev 4140
Line 6... Line 6...
6
;-------------------------------------------------------------------------------
6
;-------------------------------------------------------------------------------
7
    include "../../../macros.inc"
7
    include "../../../macros.inc"
8
    include "../../../proc32.inc"
8
    include "../../../proc32.inc"
9
    include "../../../dll.inc"
9
    include "../../../dll.inc"
10
    include "../../../develop/libraries/box_lib/load_lib.mac"
10
    include "../../../develop/libraries/box_lib/load_lib.mac"
-
 
11
 
-
 
12
    include "DATA.INC"
11
   ;include "../../../debug.inc"
13
    include "NAME.INC"
Line 12... Line 14...
12
 
14
 
13
    @use_library_mem	 \
15
    @use_library_mem	 \
14
	    mem.Alloc,	 \
16
	    mem.Alloc,	 \
15
	    mem.Free,	 \
17
	    mem.Free,	 \
16
	    mem.ReAlloc, \
18
	    mem.ReAlloc, \
17
	    dll.Load
-
 
18
;-------------------------------------------------------------------------------
-
 
19
ICON_SIZE	 equ  32 * 32 * 3
-
 
20
IMAGE_FILE_SIZE  equ  ICON_SIZE   * 29
-
 
21
IMAGE_DATA_SIZE  equ  32 * 32 * 4 * 29
19
	    dll.Load
22
;================================================================================
20
;================================================================================
23
proc main
21
main:
24
; ==== Init ====
22
; ==== Init ====
25
    mcall   18, 7
23
    mcall   18, 7
Line 26... Line 24...
26
    mov     [win.psid], eax
24
    mov     [win.psid], eax
Line 27... Line -...
27
 
-
 
28
    mcall   40, 100101b
-
 
29
 
25
 
30
    mov     dword[file_exec.proc], 7
26
    mcall   40, 100101b
Line 31... Line 27...
31
 
27
 
32
; ==== Load libs ====
28
; ==== Load libs ====
33
    load_libraries load_lib_start, load_lib_end
29
    load_libraries load_lib_start, load_lib_end
Line 34... Line -...
34
 
-
 
35
; ==== Config LibINI ====
30
 
36
    invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.location_name, -1
-
 
37
    mov     [dock_items.location], eax
31
; ==== Config LibINI ====
38
 
-
 
39
    invoke  ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_bg, 0x0
32
    invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.location_name, -1
40
    mov     [color.bg], eax
-
 
41
    invoke  ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_bg_line, 0x080808
-
 
42
    mov     [color.bg_line], eax
-
 
43
    invoke  ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_frame, 0xFFFFFF
33
    mov     [dock_items.location], eax
44
    mov     [color.frame], eax
-
 
Line 45... Line 34...
45
    invoke  ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_framein, 0x888888
34
 
Line 46... Line 35...
46
    mov     [color.framein], eax
35
    mcall   48, 3, color
-
 
36
    or	    dword[color.bg],	0x10000000
-
 
37
    or	    dword[color.frame], 0x10000000
-
 
38
    or	    dword[color.text],	0x80000000
-
 
39
 
-
 
40
    invoke  ini.sections, ini_data.file_name, sections_callback
-
 
41
 
-
 
42
; ==== Config LibIMG ====
-
 
43
    mov     dword[fi.p00], 5
-
 
44
    mov     dword[fi.p16], buf_128
47
    invoke  ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_text, 0xFFFFFF
45
    mov     dword[fi.p21], img_data.file_name
48
    or	    eax, 0x80000000
46
 
Line 49... Line 47...
49
    mov     [color.text], eax
47
    mcall   70, fi
50
 
48
 
51
    invoke  ini.sections, ini_data.file_name, sections_callback
-
 
52
 
49
    mov     edx, [buf_128 + 32]
53
; ==== Config LibIMG ====
-
 
54
    stdcall mem.Alloc, dword IMAGE_FILE_SIZE
50
    imul    edx, 10
Line 55... Line 51...
55
    mov     [img_data.rgb_object], eax
51
 
Line 56... Line 52...
56
 
52
    stdcall mem.Alloc, edx
57
    mov     dword[img_data.file.proc], 0
53
    mov     [img_data.rgb_object], eax
Line 58... Line 54...
58
    mov     dword[img_data.file.position], 0
54
 
Line 77... Line 73...
77
    mov     ebx, [eax + edi]
73
    mov     ebx, [eax + edi]
78
    shr     ebx, 24
74
    shr     ebx, 24
79
    cmp     ebx, 0
75
    cmp     ebx, 0
80
    jne     .nonalpha
76
    jne     .nonalpha
Line 81... Line -...
81
 
-
 
82
    pushad
-
 
83
    mov     eax, edi
-
 
84
    mov     edx, 0
-
 
85
    mov     ebx, 128
-
 
86
    div     ebx
-
 
87
 
-
 
88
    mov     edx, 0
-
 
89
    mov     ebx, 2
-
 
90
    div     ebx
-
 
91
 
-
 
92
    mov     edx, 0
-
 
93
    div     ebx
-
 
94
 
-
 
95
    cmp     edx, 1
-
 
96
    je	    .set_bg_line
-
 
97
 .set_bg:
-
 
98
    popad
77
 
99
    mov     ecx, [color.bg]
-
 
100
    jmp     .set_ecx
-
 
101
 .set_bg_line:
-
 
102
    popad
-
 
103
    mov     ecx, [color.bg_line]
-
 
104
 .set_ecx:
78
    mov     ecx, [color.bg]
105
    mov     [eax + edi], ecx
79
    mov     [eax + edi], ecx
106
 .nonalpha:
80
 .nonalpha:
107
    add     edi, 4
81
    add     edi, 4
108
    cmp     edi, IMAGE_DATA_SIZE
82
    cmp     edi, ICONS_SIZE_RGB
Line 109... Line 83...
109
    jne     .setalpha
83
    jne     .setalpha
110
 
84
 
111
  ; === CONVERTING TO BGR
85
  ; === CONVERTING TO BGR
Line 156... Line 130...
156
 .setleft:
130
 .setleft:
157
    call    .VERT_X_LEFT
131
    call    .VERT_X_LEFT
158
    jmp     .SETDEF
132
    jmp     .SETDEF
Line 159... Line 133...
159
 
133
 
160
 .HORZ_WIDTH:
134
 .HORZ_WIDTH:
161
    mov     eax, 40
135
    mov     eax, BUTTON_SIZE
162
    mov     ebx, [dock_items.count]
136
    mov     ebx, [dock_items.count]
-
 
137
    imul    eax, ebx
163
    imul    eax, ebx
138
    add     eax, 24
164
    dec     eax
139
    dec     eax
165
    mov     [win.width_opn], eax
140
    mov     [win.width_opn], eax
Line 166... Line 141...
166
    mov     [win.width_hdn], eax
141
    mov     [win.width_hdn], eax
Line 183... Line 158...
183
    mov     [win.x_hdn], ecx
158
    mov     [win.x_hdn], ecx
Line 184... Line 159...
184
 
159
 
Line 185... Line 160...
185
    ret
160
    ret
186
 
161
 
187
 .HORZ_HEIGHT:
162
 .HORZ_HEIGHT:
Line 188... Line 163...
188
    mov     dword[win.height_opn], 40
163
    mov     dword[win.height_opn], BUTTON_SIZE
Line 189... Line 164...
189
    mov     dword[win.height_hdn], 0
164
    mov     dword[win.height_hdn], 0
Line 205... Line 180...
205
    mov     dword[win.y_hdn], 0
180
    mov     dword[win.y_hdn], 0
Line 206... Line 181...
206
 
181
 
Line 207... Line 182...
207
    ret
182
    ret
208
 
183
 
209
 .VERT_WIDTH:
184
 .VERT_WIDTH:
Line 210... Line 185...
210
    mov     dword[win.width_opn], 40
185
    mov     dword[win.width_opn], BUTTON_SIZE
Line 211... Line 186...
211
    mov     dword[win.width_hdn], 0
186
    mov     dword[win.width_hdn], 0
Line 222... Line 197...
222
 .VERT_X_RIGHT:
197
 .VERT_X_RIGHT:
223
    mcall   14
198
    mcall   14
224
    and     eax, 0xFFFF0000
199
    and     eax, 0xFFFF0000
225
    shr     eax, 16
200
    shr     eax, 16
226
    mov     [win.x_hdn], eax
201
    mov     [win.x_hdn], eax
227
    sub     eax, 40
202
    sub     eax, BUTTON_SIZE
228
    mov     [win.x_opn], eax
203
    mov     [win.x_opn], eax
Line 229... Line 204...
229
 
204
 
Line 230... Line 205...
230
    ret
205
    ret
231
 
206
 
232
 .VERT_HEIGHT:
207
 .VERT_HEIGHT:
233
    mov     eax, 40
208
    mov     eax, BUTTON_SIZE
234
    mov     ebx, [dock_items.count]
209
    mov     ebx, [dock_items.count]
235
    imul    eax, ebx
210
    imul    eax, ebx
236
    dec     eax
211
    dec     eax
Line 277... Line 252...
277
    mcall   18, 21
252
    mcall   18, 21
278
    and     eax, 0xFFFF
253
    and     eax, 0xFFFF
279
    mov     [win.sid], eax
254
    mov     [win.sid], eax
Line 280... Line 255...
280
 
255
 
281
    call    main_loop
-
 
-
 
256
    call    main_loop
282
 
257
;-------------------------------------------------------------------------------
283
exit:
258
exit:
284
    stdcall mem.Free, [img_data.rgb_object]
259
    stdcall mem.Free, [img_data.rgb_object]
285
    mcall   18, 2, [nwin.sid]
260
    mcall   18, 2, [nwin.sid]
286
    mcall   -1
-
 
287
endp
261
    mcall   -1
288
;-------------------------------------------------------------------------------
262
;-------------------------------------------------------------------------------
289
proc main_loop
263
proc main_loop
Line 290... Line 264...
290
    mcall   10
264
    mcall   10
Line 302... Line 276...
302
 
276
 
303
 .end:
277
 .end:
304
    ret
278
    ret
305
endp
279
endp
306
;-------------------------------------------------------------------------------
280
;-------------------------------------------------------------------------------
307
proc event_redraw
281
event_redraw:
Line 308... Line 282...
308
    mcall   12, 1
282
    mcall   12, 1
309
 
-
 
310
    mcall   0, <[win.x], [win.width]>, <[win.y], [win.height]>, [color.frame], [color.frame], [color.frame]
-
 
311
 
-
 
312
    mov     eax, 13
-
 
313
 
-
 
314
    and     ebx, 0x0000FFFF
-
 
315
    add     ebx, 0x00010000
-
 
316
    sub     ebx, 0x00000001
-
 
317
 
-
 
318
    and     ecx, 0x0000FFFF
-
 
319
    add     ecx, 0x00010000
-
 
320
    sub     ecx, 0x00000001
-
 
321
 
-
 
322
    mcall   , , , [color.framein]
-
 
323
 
-
 
324
 
-
 
325
    add     ebx, 0x00010000
-
 
326
    sub     ebx, 0x00000002
-
 
327
 
-
 
328
    add     ecx, 0x00010000
-
 
329
    sub     ecx, 0x00000002
-
 
330
 
-
 
331
    mcall   , , , [color.bg]
-
 
332
 
-
 
333
    mov     edi, 2
-
 
334
    mov     eax, 13
-
 
335
    mov     ebx, 2 shl 16
-
 
336
    add     ebx, [win.width]
-
 
337
    sub     ebx, 3
-
 
338
    mov     ecx, 2 shl 16 + 2
-
 
339
    mov     edx, [color.bg_line]
-
 
340
  @@:
-
 
341
    mcall
-
 
342
    add     ecx, 4 shl 16
-
 
343
    add     edi, 4
-
 
Line 344... Line 283...
344
    cmp     edi, [win.height]
283
 
345
    jl	    @b
284
    mcall   0, <[win.x], [win.width]>, <[win.y], [win.height]>, [color.bg], [color.bg], [color.frame]
346
 
285
 
347
    mov     edi, 0
286
    mov     edi, 0
Line 348... Line 287...
348
  @@:
287
  @@:
349
    cmp     edi, [dock_items.count]
288
    cmp     edi, [dock_items.count]
350
    je	    @f
289
    je	    @f
351
 
290
 
-
 
291
    push    edi
352
    push    edi
292
    mov     eax, 8
353
    mov     eax, 8
293
    mov     edx, 0x60000002
354
    mov     edx, 0x60000002
294
    mov     esi, [color.bg]
355
    mov     esi, [color.bg]
295
    imul    edi, BUTTON_SIZE
356
    imul    edi, 40
296
    add     edi, 12
357
    shl     edi, 16
297
    shl     edi, 16
358
    add     edi, 39
298
    add     edi, BUTTON_SIZE
359
    cmp     byte[win.isvert], 1
299
    cmp     byte[win.isvert], 1
360
    je	    .vert_btn
300
    je	    .vert_btn
361
    mcall   , edi, <0, 40>
301
    mcall   , edi, <0, BUTTON_SIZE>
362
    jmp     .endbtn
302
    jmp     .endbtn
Line 363... Line -...
363
 .vert_btn:
-
 
364
    mcall   , <0, 40>, edi
-
 
365
 .endbtn:
-
 
366
    pop     edi
-
 
367
 
-
 
368
 .draw_Sseparator:
-
 
369
    push    ebx
-
 
370
    push    ecx
-
 
371
    mov     eax, 13
-
 
372
    mov     ebx, edi
-
 
373
    imul    ebx, 40
-
 
374
    add     ebx, 40
-
 
375
    shl     ebx, 16
-
 
376
    add     ebx, 1
-
 
377
    cmp     byte[win.isvert], 1
-
 
378
    je	    .vert_Sdraw_sep
-
 
379
    mcall   , , <6, 29>, [color.framein]
-
 
380
    jmp     .end_Sinner_sep
-
 
381
 .vert_Sdraw_sep:
-
 
382
    mov     ecx, ebx
-
 
383
    mcall   , <6, 29>, , [color.framein]
-
 
384
 .end_Sinner_sep:
303
 .vert_btn:
385
    pop     ecx
304
    mcall   , <0, BUTTON_SIZE>, edi
Line 386... Line 305...
386
    pop     ebx
305
 .endbtn:
387
 .end_Sseparator:
306
    pop     edi
388
 
307
 
-
 
308
    cmp     byte[dock_items.separator + edi], 1
389
    cmp     byte[dock_items.separator + edi], 1
309
    jne     .end_separator
390
    jne     .end_separator
310
 
391
 
311
 .draw_separator:
-
 
312
    push    ebx
392
 .draw_separator:
313
    push    ecx
-
 
314
 
393
    push    ebx
315
    mov     eax, 13
394
    push    ecx
316
    mov     ebx, edi
-
 
317
    imul    ebx, BUTTON_SIZE
395
    mov     eax, 13
318
    add     ebx, BUTTON_SIZE
396
    mov     ebx, edi
319
    add     ebx, 12
397
    imul    ebx, 40
320
    dec     ebx
398
    add     ebx, 39
-
 
399
    shl     ebx, 16
-
 
400
    add     ebx, 1
-
 
401
    cmp     byte[win.isvert], 1
-
 
402
    je	    .vert_draw_sep
-
 
403
    mcall   , , <0, 41>, [color.frame]
321
    shl     ebx, 16
404
    sub     ebx, 0x00010000
322
    add     ebx, 1
405
    mov     edx, [color.framein]
323
 
406
    mcall   , , <1, 39>
324
    cmp     byte[win.isvert], 1
407
    add     ebx, 0x00020000
-
 
408
    mcall   , , <1, 39>
-
 
409
    jmp     .end_inner_sep
-
 
410
 .vert_draw_sep:
-
 
411
    mov     ecx, ebx
-
 
412
    mcall   , <0, 41>, , [color.frame]
325
    je	    .vert_draw_sep
413
    sub     ecx, 0x00010000
326
    mcall   , , <4, 36>, [color.frame]
414
    mov     edx, [color.framein]
327
    jmp     .end_inner_sep
415
    mcall   , <1, 39>
328
 .vert_draw_sep:
Line 416... Line 329...
416
    add     ecx, 0x00020000
329
    mov     ecx, ebx
417
    mcall   , <1, 39>
330
    mcall   , <4, 36>, , [color.frame]
418
 .end_inner_sep:
331
 .end_inner_sep:
419
    pop     ecx
332
    pop     ecx
420
    pop     ebx
333
    pop     ebx
421
 .end_separator:
334
 .end_separator:
422
 
335
 
423
    cmp     byte[win.isvert], 1
336
    cmp     byte[win.isvert], 1
424
    je	    .vert_dig
337
    je	    .vert_dig
425
    mov     edx, ebx
338
    mov     edx, ebx
426
    and     edx, 0xFFFF0000
339
    and     edx, 0xFFFF0000
427
    add     edx, 0x00040004
340
    add     edx, 0x00060006
Line 428... Line 341...
428
    jmp     .digend
341
    jmp     .digend
429
 .vert_dig:
342
 .vert_dig:
430
    mov     edx, ecx
343
    mov     edx, ecx
431
    and     edx, 0xFFFF0000
344
    and     edx, 0xFFFF0000
432
    shr     edx, 16
345
    shr     edx, 16
Line 433... Line 346...
433
    add     edx, 0x00040004
346
    add     edx, 0x00060006
Line 434... Line 347...
434
 .digend:
347
 .digend:
Line 446... Line 359...
446
  @@:
359
  @@:
Line 447... Line 360...
447
 
360
 
Line 448... Line 361...
448
    mcall   12, 2
361
    mcall   12, 2
449
 
-
 
450
    jmp     main_loop
362
 
451
endp
363
    jmp     main_loop
452
;-------------------------------------------------------------------------------
364
;-------------------------------------------------------------------------------
Line 453... Line 365...
453
proc event_button
365
event_button:
454
    mcall   17
366
    mcall   17
Line 466... Line 378...
466
 
378
 
467
 .button_dock:
379
 .button_dock:
468
    mov     edi, [win.button_index]
380
    mov     edi, [win.button_index]
Line -... Line 381...
-
 
381
    imul    edi, 256
-
 
382
 
469
    imul    edi, 256
383
    mov     dword[fi.p00], 7
470
 
384
 
471
    mov     esi, edi
385
    mov     esi, edi
Line 472... Line 386...
472
    add     esi, dock_items.path
386
    add     esi, dock_items.path
473
    mov     dword[file_exec.file], esi
387
    mov     dword[fi.p21], esi
474
 
388
 
Line 475... Line 389...
475
    mov     esi, edi
389
    mov     esi, edi
Line 476... Line 390...
476
    add     esi, dock_items.param
390
    add     esi, dock_items.param
477
    mov     dword[file_exec.param], esi
391
    mov     dword[fi.p08], esi
478
 
392
 
479
    mcall   70, file_exec
393
    mcall   70, fi
Line -... Line 394...
-
 
394
 
-
 
395
    mov     ecx, eax
480
 
396
    mcall   18, 21
481
    mov     ecx, eax
397
    and     eax, 0xFFFF
482
    mcall   18, 21
-
 
483
    and     eax, 0xFFFF
398
    mov     [win.psid], eax
484
    mov     [win.psid], eax
399
 
485
 
400
    jmp     wnd_hide
486
  @@:
401
 
487
    jmp     main_loop
402
  @@:
488
endp
403
    jmp     main_loop
489
;-------------------------------------------------------------------------------
404
;-------------------------------------------------------------------------------
Line 490... Line 405...
490
proc event_mouse
405
event_mouse:
491
    mcall   37, 1
406
    mcall   37, 1
492
    mov     edi, eax
407
    mov     edi, eax
493
    mov     esi, eax
408
    mov     esi, eax
494
    shr     edi, 16
409
    shr     edi, 16
495
    and     esi, 0xFFFF
410
    and     esi, 0xFFFF
496
 
411
 
497
    cmp     edi, 0
412
    cmp     edi, 0
498
    jl	    @f
413
    jl	    wnd_hide
499
    dec     edi
414
    dec     edi
Line 500... Line 415...
500
    cmp     edi, [win.width]
415
    cmp     edi, [win.width]
501
    jg	    @f
416
    jg	    wnd_hide
502
    cmp     esi, 0
417
    cmp     esi, 0
503
    jl	    @f
418
    jl	    wnd_hide
Line 514... Line 429...
514
 
429
 
515
 .vert:
430
 .vert:
Line 516... Line 431...
516
    mov     eax, esi
431
    mov     eax, esi
-
 
432
 
517
 
433
 .nxt:
518
 .nxt:
434
    sub     eax, 12
519
    mov     edx, 0
435
    mov     edx, 0
Line 520... Line 436...
520
    mov     ebx, 40
436
    mov     ebx, BUTTON_SIZE
521
    div     ebx
437
    div     ebx
522
 
438
 
Line 533... Line 449...
533
 
449
 
Line 534... Line 450...
534
    mov     [win.button_index], eax
450
    mov     [win.button_index], eax
535
 
451
 
536
 .nxt2:
452
 .nxt2:
537
    mov     eax, [win.button_index]
453
    mov     eax, [win.button_index]
538
    imul    eax, 40
454
    imul    eax, BUTTON_SIZE
539
    cmp     byte[win.isvert], 1
-
 
540
    je	    .vert_name
455
    cmp     byte[win.isvert], 1
541
    sub     eax, 15
456
    je	    .vert_name
542
    add     eax, [win.x]
457
    add     eax, [win.x]
543
    mov     [nwin.x], eax
458
    mov     [nwin.x], eax
544
    jmp     .vert_end
-
 
545
 .vert_name:
459
    jmp     .vert_end
546
    add     eax, 12
460
 .vert_name:
547
    add     eax, [win.y]
461
    add     eax, [win.y]
548
    mov     [nwin.y], eax
462
    mov     [nwin.y], eax
-
 
463
 .vert_end:
Line 549... Line 464...
549
 .vert_end:
464
    mov     byte[nwin.change_shape], 1
550
    mov     byte[nwin.change_shape], 1
465
    mcall   13, <0, [win.width]>, <[win.height], 1>, [color.frame]
Line 551... Line 466...
551
 
466
 
552
    cmp     byte[win.state], 1
467
    cmp     byte[win.state], 1
553
    je	    .end_cmp
468
    je	    main_loop
Line 577... Line 492...
577
    mov     eax, [win.y_opn]
492
    mov     eax, [win.y_opn]
578
    mov     [win.y], eax
493
    mov     [win.y], eax
Line 579... Line 494...
579
 
494
 
Line 580... Line 495...
580
    mcall   67, [win.x], [win.y], [win.width], [win.height]
495
    mcall   67, [win.x], [win.y], [win.width], [win.height]
Line -... Line 496...
-
 
496
 
581
 
497
    jmp     event_redraw
582
    call     event_redraw
498
 
583
 
499
;-------------------------------------------------------------------------------
Line 584... Line 500...
584
  @@:
500
wnd_hide:
Line 585... Line 501...
585
    cmp     byte[win.state], 0
501
    cmp     byte[win.state], 0
Line 604... Line 520...
604
    mov     eax, [win.y_hdn]
520
    mov     eax, [win.y_hdn]
605
    mov     [win.y], eax
521
    mov     [win.y], eax
Line 606... Line 522...
606
 
522
 
Line 607... Line 523...
607
    mcall   67, [win.x], [win.y], [win.width], [win.height]
523
    mcall   67, [win.x], [win.y], [win.width], [win.height]
608
 
-
 
609
    call     event_redraw
-
 
610
 
-
 
611
  .end_cmp:
-
 
612
    jmp     main_loop
524
 
613
endp
525
    jmp     event_redraw
614
;-------------------------------------------------------------------------------
526
;-------------------------------------------------------------------------------
615
proc sections_callback, _file_name, _section_name
527
proc sections_callback, _file_name, _section_name
616
    mov     eax, [_section_name]
528
    mov     eax, [_section_name]
Line 670... Line 582...
670
    mov     eax, 1
582
    mov     eax, 1
671
    inc     dword[dock_items.count]
583
    inc     dword[dock_items.count]
672
    ret
584
    ret
673
endp
585
endp
674
;-------------------------------------------------------------------------------
586
;-------------------------------------------------------------------------------
675
n_main:
-
 
676
    cmp     dword[dock_items.location], 1
-
 
677
    je	    .top
-
 
678
    cmp     dword[dock_items.location], 4
-
 
679
    je	    .right
-
 
680
    cmp     dword[dock_items.location], 3
-
 
681
    je	    .bottom
-
 
682
    jmp     .left
-
 
683
 .top:
-
 
684
    mov     eax, [win.height_opn]
-
 
685
    add     eax, 4
-
 
686
    mov     [nwin.y], eax
-
 
687
    jmp     @f
-
 
688
 .right:
-
 
689
    mov     eax, [win.x_opn]
-
 
690
    sub     eax, 72
-
 
691
    mov     [nwin.x], eax
-
 
692
    jmp     @f
-
 
693
 .bottom:
-
 
694
    mov     eax, [win.y_opn]
-
 
695
    sub     eax, 20
-
 
696
    mov     [nwin.y], eax
-
 
697
    jmp     @f
-
 
698
 .left:
-
 
699
    mov     eax, [win.width_opn]
-
 
700
    add     eax, 4
-
 
701
    mov     [nwin.x], eax
-
 
702
  @@:
-
 
703
    mov     dword[nwin.width], 68
-
 
704
    mov     dword[nwin.height], 16
-
 
705
 
-
 
706
    mcall   40, 1b
-
 
707
 
-
 
708
    mcall   9, win.procinfo, -1
-
 
709
    mov     ecx, [win.procinfo + 30]
-
 
710
    mcall   18, 21
-
 
711
    and     eax, 0xFFFF
-
 
712
    mov     [nwin.sid], eax
-
 
713
;-------------------------------------------------------------------------------
-
 
714
n_main_loop:
-
 
715
    mcall   23, 1
-
 
716
 
-
 
717
    cmp     eax, EV_IDLE
-
 
718
    je	    n_event_idle
-
 
719
    cmp     eax, EV_REDRAW
-
 
720
    je	    n_event_redraw
-
 
721
 
-
 
722
    jmp     n_main_loop
-
 
723
;-------------------------------------------------------------------------------
-
 
724
n_event_idle:
-
 
725
    cmp     byte[nwin.close], 1
-
 
726
    jne     @f
-
 
727
 
-
 
728
    mov     byte[nwin.close], 0
-
 
729
    mcall   -1
-
 
730
 
-
 
731
  @@:
-
 
732
    cmp     byte[win.button_index], 100
-
 
733
    jne     @f
-
 
734
 
-
 
735
    mcall   67, 0, 0, 0, 0
-
 
736
    jmp     .end
-
 
737
 
-
 
738
  @@:
-
 
739
    cmp     byte[nwin.change_shape], 1
-
 
740
    jne     .end
-
 
741
 
-
 
742
    mov     byte[nwin.change_shape], 0
-
 
743
    mcall   67, [nwin.x], [nwin.y], [nwin.width], [nwin.height]
-
 
744
 
-
 
745
 .end:
-
 
746
    jmp     n_main_loop
-
 
747
;-------------------------------------------------------------------------------
-
 
748
n_event_redraw:
-
 
749
    mcall   12, 1
-
 
750
 
-
 
751
    mcall   0, <[nwin.x], [nwin.width]>, <[nwin.y], [nwin.height]>, [color.frame], [color.frame], [color.frame]
-
 
752
 
-
 
753
    mov     eax, 13
-
 
754
 
-
 
755
    and     ebx, 0x0000FFFF
-
 
756
    add     ebx, 0x00010000
-
 
757
    sub     ebx, 0x00000001
-
 
758
 
-
 
759
    and     ecx, 0x0000FFFF
-
 
760
    add     ecx, 0x00010000
-
 
761
    sub     ecx, 0x00000001
-
 
762
 
-
 
763
    mcall   , , , [color.framein]
-
 
764
 
-
 
765
 
-
 
766
    add     ebx, 0x00010000
-
 
767
    sub     ebx, 0x00000002
-
 
768
 
-
 
769
    add     ecx, 0x00010000
-
 
770
    sub     ecx, 0x00000002
-
 
771
 
-
 
772
    mcall   , , , [color.bg]
-
 
773
 
-
 
774
    mov     edi, 0
-
 
775
    mov     eax, 13
-
 
776
    mov     ebx, 2 shl 16
-
 
777
    add     ebx, [nwin.width]
-
 
778
    sub     ebx, 3
-
 
779
    mov     ecx, 2 shl 16 + 2
-
 
780
    mov     edx, [color.bg_line]
-
 
781
  @@:
-
 
782
    mcall
-
 
783
    add     ecx, 4 shl 16
-
 
784
    add     edi, 4
-
 
785
    cmp     edi, 16
-
 
786
    jne     @b
-
 
787
 
-
 
788
    mov     edx, [win.button_index]
-
 
789
    imul    edx, 16
-
 
790
    add     edx, dock_items.name
-
 
791
 
-
 
792
    mov     eax, 0
-
 
793
  @@:
-
 
794
    inc     eax
-
 
795
    cmp     byte[edx+eax], 0
-
 
796
    jne     @b
-
 
797
 
-
 
798
    imul    eax, 3
-
 
799
    mov     ebx, 34
-
 
800
    sub     ebx, eax
-
 
801
    inc     ebx
-
 
802
    shl     ebx, 16
-
 
803
    add     ebx, 5
-
 
804
 
-
 
805
    mcall   4, , [color.text]
-
 
806
 
-
 
807
    mcall   12, 2
-
 
808
 
-
 
809
    jmp     n_main_loop
-
 
810
;-------------------------------------------------------------------------------
-
 
811
img_data:
-
 
812
 .file_name:
-
 
813
    db	    "/sys/iconstrp.png", 0
-
 
814
 .cfg_text:
-
 
815
    db	    "R", 0
-
 
816
 .ext_text:
-
 
817
    db	    "X", 0
-
 
818
;-------------------------------------------------------------------------------
-
 
819
ini_data:
-
 
820
 .file_name:
-
 
821
    db	    "/sys/settings/Docky.ini", 0
-
 
822
 .path_name:
-
 
823
    db	    "path", 0
-
 
824
 .param_name:
-
 
825
    db	    "param", 0
-
 
826
 .icon_name:
-
 
827
    db	    "icon", 0
-
 
828
 .separator_name:
-
 
829
    db	    "separator", 0
-
 
830
 
-
 
831
 .settings_name:
-
 
832
    db	    "@SETTINGS", 0
-
 
833
 .location_name:
-
 
834
    db	    "location", 0
-
 
835
 .color_bg:
-
 
836
    db	    "bg", 0
-
 
837
 .color_bg_line:
-
 
838
    db	    "bg_line", 0
-
 
839
 .color_frame:
-
 
840
    db	    "frame", 0
-
 
841
 .color_framein:
-
 
842
    db	    "framein", 0
-
 
843
 .color_text:
-
 
844
    db	    "text", 0
-
 
845
;-------------------------------------------------------------------------------
-
 
846
load_lib_start:
-
 
847
    lib1    l_libs img.name,	     \
-
 
848
		   sys_path,	     \
-
 
849
		   file_name,	     \
-
 
850
		   img.dir,	     \
-
 
851
		   error,	     \
-
 
852
		   error,	     \
-
 
853
		   img, 	     \
-
 
854
		   error,	     \
-
 
855
		   error
-
 
856
 
-
 
857
    lib2    l_libs ini.name,	     \
-
 
858
		   sys_path,	     \
-
 
859
		   file_name,	     \
-
 
860
		   ini.dir,	     \
-
 
861
		   error,	     \
-
 
862
		   error,	     \
-
 
863
		   ini, 	     \
-
 
864
		   error,	     \
-
 
865
		   error
-
 
866
load_lib_end:
-
 
867
;-------------------------------------------------------------------------------
-
 
868
img:
-
 
869
 .init	   \
-
 
870
    dd	    .init_T
-
 
871
 .toRGB    \
-
 
872
    dd	    .toRGB_T
-
 
873
 .decode   \
-
 
874
    dd	    .decode_T
-
 
875
 .destroy  \
-
 
876
    dd	    .destroy_T
-
 
877
 
-
 
878
    dd	    0, 0
-
 
879
 
-
 
880
 .init_T:
-
 
881
    db	    "lib_init", 0
-
 
882
 .toRGB_T:
-
 
883
    db	    "img_to_rgb2", 0
-
 
884
 .decode_T:
-
 
885
    db	    "img_decode", 0
-
 
886
 .destroy_T:
-
 
887
    db	    "img_destroy", 0
-
 
888
 
-
 
889
 .dir:
-
 
890
    db	    "/sys/lib/"
-
 
891
 .name:
-
 
892
    db	    "libimg.obj", 0
-
 
893
;-------------------------------------------------------------------------------
-
 
894
ini:
-
 
895
 .init	   \
-
 
896
    dd	    .init_T
-
 
897
 .sections \
-
 
898
    dd	    .sections_T
-
 
899
 .get_int  \
-
 
900
    dd	    .get_int_T
-
 
901
 .get_str  \
-
 
902
    dd	    .get_str_T
-
 
903
 .get_color\
-
 
904
    dd	    .get_color_T
-
 
905
 
-
 
906
    dd	    0, 0
-
 
907
 
-
 
908
 .init_T:
-
 
909
    db	    "lib_init", 0
-
 
910
 .sections_T:
-
 
911
    db	    "ini_enum_sections", 0
-
 
912
 .get_int_T:
-
 
913
    db	    "ini_get_int", 0
-
 
914
 .get_str_T:
-
 
915
    db	    "ini_get_str", 0
-
 
916
 .get_color_T:
-
 
917
    db	    "ini_get_color", 0
-
 
918
 
-
 
919
 .dir:
-
 
920
    db	    "/sys/lib/"
-
 
921
 .name:
-
 
922
    db	    "libini.obj", 0
-
 
923
;-------------------------------------------------------------------------------
-
 
924
error:
-
 
925
    db	    0
-
 
926
;-------------------------------------------------------------------------------
-
 
927
__dataend:
-
 
928
;================================================================================
-
 
929
    rb	    1024
-
 
930
__stackend:
-
 
931
;================================================================================
-
 
932
color:
-
 
933
 .bg:
-
 
934
    rd	    1
-
 
935
 .bg_line:
-
 
936
    rd	    1
-
 
937
 .frame:
-
 
938
    rd	    1
-
 
939
 .framein:
-
 
940
    rd	    1
-
 
941
 .text:
-
 
942
    rd	    1
-
 
943
;-------------------------------------------------------------------------------
-
 
944
win:
-
 
945
 .x:
-
 
946
    rd	    1
-
 
947
 .y:
-
 
948
    rd	    1
-
 
949
 .width:
-
 
950
    rd	    1
-
 
951
 .height:
-
 
952
    rd	    1
-
 
953
 
-
 
954
 .x_hdn:
-
 
955
    rd	    1
-
 
956
 .y_hdn:
-
 
957
    rd	    1
-
 
958
 .width_hdn:
-
 
959
    rd	    1
-
 
960
 .height_hdn:
-
 
961
    rd	    1
-
 
962
 
-
 
963
 .x_opn:
-
 
964
    rd	    1
-
 
965
 .y_opn:
-
 
966
    rd	    1
-
 
967
 .width_opn:
-
 
968
    rd	    1
-
 
969
 .height_opn:
-
 
970
    rd	    1
-
 
971
 
-
 
972
 .sid:
-
 
973
    rd	    1
-
 
974
 .psid:
-
 
975
    rd	    1
-
 
976
 .procinfo:
-
 
977
    rb	    1024
-
 
978
 .state:
-
 
979
    rb	    1
-
 
980
 .button_index:
-
 
981
    rd	    1
-
 
982
 
-
 
983
 .isvert:
-
 
984
    rb	    1
-
 
985
;-------------------------------------------------------------------------------
-
 
986
nwin:
-
 
987
 .x:
-
 
988
    rd	    1
-
 
989
 .y:
-
 
990
    rd	    1
-
 
991
 .width:
-
 
992
    rd	    1
-
 
993
 .height:
-
 
994
    rd	    1
-
 
995
 
-
 
996
 .visible:
-
 
997
    rd	    1
-
 
998
 .sid:
-
 
999
    rd	    1
-
 
1000
 .change_shape:
-
 
1001
    rb	    1
-
 
1002
 .close:
-
 
1003
    rb	    1
-
 
1004
;-------------------------------------------------------------------------------
-
 
1005
img_data.object:
-
 
1006
    rd	    1
-
 
1007
img_data.rgb_object:
-
 
1008
    rd	    1
-
 
1009
img_data.file:
-
 
1010
 .proc:
-
 
1011
    rd	    1
-
 
1012
 .position:
-
 
1013
    rd	    1
-
 
1014
    rd	    1
-
 
1015
 .size:
-
 
1016
    rd	    1
-
 
1017
 .buffer:
-
 
1018
    rd	    1
-
 
1019
    rb	    1
-
 
1020
 .name:
-
 
1021
    rd	    1
-
 
1022
;-------------------------------------------------------------------------------
-
 
1023
file_exec:
-
 
1024
 .proc:
-
 
1025
    rd	    1
-
 
1026
    rd	    1
-
 
1027
 .param:
-
 
1028
    rd	    1
-
 
1029
    rd	    1
-
 
1030
    rd	    1
-
 
1031
    rb	    1
-
 
1032
 .file:
-
 
1033
    rd	    1
-
 
1034
;-------------------------------------------------------------------------------
-
 
1035
dock_items:
-
 
1036
 .count:
-
 
1037
    rd	    1
-
 
1038
 .name:
-
 
1039
    rb	    16	* 20
-
 
1040
 .path:
-
 
1041
    rb	    256 * 20
-
 
1042
 .param:
-
 
1043
    rb	    256 * 20
-
 
1044
 .icon:
-
 
1045
    rd	    1	* 20
-
 
1046
 .separator:
-
 
1047
    rb	    1	* 20
-
 
1048
 .location:
-
 
1049
    rd	    1
-
 
1050
;-------------------------------------------------------------------------------
-
 
1051
sys_path:
-
 
1052
    rb	    4096
-
 
1053
file_name:
-
 
1054
    rb	    4096
-
 
1055
;-------------------------------------------------------------------------------
-
 
1056
__memend:
-
 
1057
;================================================================================
-
 
1058
587
    include "MEMORY.INC"
-
 
588
1059
589