Subversion Repositories Kolibri OS

Rev

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

Rev 4157 Rev 4195
Line 28... Line 28...
28
 
28
 
29
; ==== Load libs ====
29
; ==== Load libs ====
Line 30... Line 30...
30
    load_libraries load_lib_start, load_lib_end
30
    load_libraries load_lib_start, load_lib_end
31
 
31
 
32
; ==== Config LibINI ====
32
; ==== Config LibINI ====
Line -... Line 33...
-
 
33
    invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.location_name, 1
-
 
34
    mov     [dock_items.location], eax
-
 
35
 
33
    invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.location_name, -1
36
    invoke  ini.sections, ini_data.file_name, sections_callback
34
    mov     [dock_items.location], eax
37
 
35
 
38
; ==== Load colors ====
36
    mcall   48, 3, color
39
    mcall   48, 3, color
Line 37... Line -...
37
    or	    dword[color.bg],	0x10000000
-
 
38
    or	    dword[color.frame], 0x10000000
-
 
39
    or	    dword[color.text],	0x80000000
40
    or	    dword[color.bg],	0x10000000
40
 
41
    or	    dword[color.frame], 0x10000000
41
    invoke  ini.sections, ini_data.file_name, sections_callback
42
    or	    dword[color.text],	0x80000000
42
 
43
 
Line 65... Line 66...
65
 
66
 
66
    stdcall dword[img.decode], dword[img_data.rgb_object], ebx, 0
67
    stdcall dword[img.decode], dword[img_data.rgb_object], ebx, 0
Line 67... Line 68...
67
    mov     dword[img_data.object], eax
68
    mov     dword[img_data.object], eax
68
 
69
 
-
 
70
  ; === ALPHA ===
-
 
71
    mov     edi, eax
-
 
72
    add     edi, 8
-
 
73
    mov     edi, [edi]
-
 
74
    imul    edi, 128
69
  ; === ALPHA ===
75
    sub     edi, 4
70
    mov     edi, 0
76
 
71
    add     eax, 24
77
    add     eax, 24
72
    mov     eax, [eax]
78
    mov     eax, [eax]
73
 .setalpha:
79
 .setalpha:
Line 77... Line 83...
77
    jne     .nonalpha
83
    jne     .nonalpha
Line 78... Line 84...
78
 
84
 
79
    mov     ecx, [color.bg]
85
    mov     ecx, [color.bg]
80
    mov     [eax + edi], ecx
86
    mov     [eax + edi], ecx
81
 .nonalpha:
87
 .nonalpha:
82
    add     edi, 4
88
    sub     edi, 4
83
    cmp     edi, ICONS_SIZE_RGB
89
    cmp     edi, 0
Line 84... Line 90...
84
    jne     .setalpha
90
    jne     .setalpha
85
 
91
 
86
  ; === CONVERTING TO BGR
92
  ; === CONVERTING TO BGR
Line 130... Line 136...
130
 
136
 
131
 .setleft:
137
 .setleft:
132
    call    .VERT_X_LEFT
138
    call    .VERT_X_LEFT
Line -... Line 139...
-
 
139
    jmp     .SETDEF
133
    jmp     .SETDEF
140
 
134
 
141
;-------------------------------------------------------------------------------
135
 .HORZ_WIDTH:
142
 .HORZ_WIDTH:
136
    mov     eax, BUTTON_SIZE
143
    mov     eax, BUTTON_SIZE
137
    mov     ebx, [dock_items.count]
144
    mov     ebx, [dock_items.count]
Line 141... Line 148...
141
    mov     [win.width_opn], eax
148
    mov     [win.width_opn], eax
142
    mov     [win.width_hdn], eax
149
    mov     [win.width_hdn], eax
Line 143... Line 150...
143
 
150
 
Line -... Line 151...
-
 
151
    ret
144
    ret
152
 
145
 
153
;-------------------------------------------------------------------------------
146
 .HORZ_X:
154
 .HORZ_X:
147
    mcall   14
-
 
148
    shr     eax, 16
-
 
149
    mov     ebx, 2
-
 
150
    mov     edx, 0
-
 
151
    div     ebx
-
 
152
    mov     edx, 0
-
 
153
    mov     ecx, eax
155
    mcall   14
154
 
156
    shr     eax, 17
155
    mov     eax, [win.width_opn]
157
    mov     ecx, [win.width_opn]
156
    div     ebx
158
    shr     ecx, 1
157
    sub     ecx, eax
159
    sub     eax, ecx
Line 158... Line 160...
158
    mov     [win.x_opn], ecx
160
    mov     [win.x_opn], eax
Line -... Line 161...
-
 
161
    mov     [win.x_hdn], eax
159
    mov     [win.x_hdn], ecx
162
 
160
 
-
 
161
    ret
163
    ret
-
 
164
 
Line 162... Line 165...
162
 
165
;-------------------------------------------------------------------------------
Line -... Line 166...
-
 
166
 .HORZ_HEIGHT:
163
 .HORZ_HEIGHT:
167
    mov     dword[win.height_hdn], 3
164
    mov     dword[win.height_opn], BUTTON_SIZE
168
    mov     dword[win.height_opn], BUTTON_SIZE
165
    mov     dword[win.height_hdn], 3
169
 
166
 
170
    ret
167
    ret
171
 
Line 180... Line 184...
180
    mov     dword[win.y_opn], 0
184
    mov     dword[win.y_opn], 0
181
    mov     dword[win.y_hdn], 0
185
    mov     dword[win.y_hdn], 0
Line 182... Line 186...
182
 
186
 
Line -... Line 187...
-
 
187
    ret
183
    ret
188
 
184
 
189
;-------------------------------------------------------------------------------
185
 .VERT_WIDTH:
190
 .VERT_WIDTH:
Line 186... Line 191...
186
    mov     dword[win.width_opn], BUTTON_SIZE
191
    mov     dword[win.width_opn], BUTTON_SIZE
Line -... Line 192...
-
 
192
    mov     dword[win.width_hdn], 3
187
    mov     dword[win.width_hdn], 3
193
 
188
 
-
 
189
    ret
194
    ret
190
 
195
 
Line 191... Line 196...
191
 .VERT_X_LEFT:
196
;-------------------------------------------------------------------------------
Line 203... Line 208...
203
    sub     eax, BUTTON_SIZE
208
    sub     eax, BUTTON_SIZE
204
    mov     [win.x_opn], eax
209
    mov     [win.x_opn], eax
Line 205... Line 210...
205
 
210
 
Line -... Line 211...
-
 
211
    ret
206
    ret
212
 
207
 
213
;-------------------------------------------------------------------------------
208
 .VERT_HEIGHT:
214
 .VERT_HEIGHT:
209
    mov     eax, BUTTON_SIZE
215
    mov     eax, BUTTON_SIZE
210
    mov     ebx, [dock_items.count]
216
    mov     ebx, [dock_items.count]
-
 
217
    imul    eax, ebx
211
    imul    eax, ebx
218
    dec     eax
212
    dec     eax
219
    add     eax, 12
Line 213... Line 220...
213
    mov     [win.height_opn], eax
220
    mov     [win.height_opn], eax
Line -... Line 221...
-
 
221
    mov     [win.height_hdn], eax
214
    mov     [win.height_hdn], eax
222
 
215
 
223
    ret
216
    ret
224
 
217
 
-
 
218
 .VERT_Y:
225
;-------------------------------------------------------------------------------
219
    mcall   14
-
 
220
    and     eax, 0xFFFF
-
 
Line 221... Line 226...
221
    mov     edx, 0
226
 .VERT_Y:
222
    mov     ebx, 2
227
    mcall   14
223
    div     ebx
-
 
224
    mov     esi, eax
-
 
225
 
228
    and     eax, 0xFFFF
Line 226... Line 229...
226
    mov     eax, [win.height_opn]
229
    shr     eax, 1
227
    mov     edx, 0
230
 
Line 228... Line 231...
228
    mov     ebx, 2
231
    mov     esi, [win.height_opn]
Line -... Line 232...
-
 
232
    shr     esi, 1
229
    div     ebx
233
    sub     eax, esi
230
    sub     esi, eax
234
 
231
 
235
    mov     [win.y_hdn], eax
Line 232... Line 236...
232
    mov     [win.y_hdn], esi
236
    mov     [win.y_opn], eax
Line 245... Line 249...
245
    mov     [win.height], eax
249
    mov     [win.height], eax
Line 246... Line 250...
246
 
250
 
247
    mov     eax, [win.y_hdn]
251
    mov     eax, [win.y_hdn]
Line -... Line 252...
-
 
252
    mov     [win.y], eax
248
    mov     [win.y], eax
253
 
249
 
254
;-------------------------------------------------------------------------------
250
; ==== START ====
255
; ==== START ====
251
    mcall   9, win.procinfo, -1
256
    mcall   9, win.procinfo, -1
252
    mov     ecx, [win.procinfo + 30]
257
    mov     ecx, [win.procinfo + 30]
Line 259... Line 264...
259
exit:
264
exit:
260
    stdcall mem.Free, [img_data.rgb_object]
265
    stdcall mem.Free, [img_data.rgb_object]
261
    mcall   18, 2, [nwin.sid]
266
    mcall   18, 2, [nwin.sid]
262
    mcall   -1
267
    mcall   -1
263
;-------------------------------------------------------------------------------
268
;-------------------------------------------------------------------------------
264
proc main_loop
269
main_loop:
265
    mcall   10
270
    mcall   10
Line 266... Line 271...
266
 
271
 
267
    cmp     eax, EV_REDRAW
272
    cmp     eax, EV_REDRAW
Line 272... Line 277...
272
 
277
 
273
    cmp     eax, EV_MOUSE
278
    cmp     eax, EV_MOUSE
Line 274... Line 279...
274
    je	    event_mouse
279
    je	    event_mouse
275
 
-
 
276
    jmp     main_loop
-
 
277
 
-
 
278
 .end:
-
 
279
    ret
280
 
280
endp
281
    jmp     main_loop
281
;-------------------------------------------------------------------------------
282
;-------------------------------------------------------------------------------
Line -... Line 283...
-
 
283
event_redraw:
-
 
284
    mcall   12, 1
282
event_redraw:
285
 
Line 283... Line 286...
283
    mcall   12, 1
286
    mov     esi, [color.bg]
284
 
287
    or	    esi, 0x01000000
285
    mcall   0, <[win.x], [win.width]>, <[win.y], [win.height]>, [color.bg], [color.bg], [color.frame]
288
    mcall   0, <[win.x], [win.width]>, <[win.y], [win.height]>, [color.bg], , [color.frame]
286
 
289
 
Line 359... Line 362...
359
 
362
 
360
    inc     edi
363
    inc     edi
361
    jmp     @b
364
    jmp     @b
Line -... Line 365...
-
 
365
  @@:
-
 
366
 
-
 
367
 ; ==== DRAW SETTINGS ====
-
 
368
    cmp     byte[win.isvert], 1
-
 
369
    je	    .cfg_vert
-
 
370
 
-
 
371
    mov     ebx, [win.width]
-
 
372
    sub     ebx, 10
-
 
373
    shl     ebx, 16
-
 
374
    add     ebx, 8
-
 
375
    mcall   8, , <2, BUTTON_SIZE - 4>, 0x60000003
-
 
376
    jmp     @f
-
 
377
 
-
 
378
 .cfg_vert:
-
 
379
    mov     ecx, [win.height]
-
 
380
    sub     ecx, 10
-
 
381
    shl     ecx, 16
-
 
382
    add     ecx, 8
-
 
383
    mcall   8, <2, BUTTON_SIZE - 4>, , 0x60000003
-
 
384
  @@:
-
 
385
 
-
 
386
 ; ==== cfg image ====
-
 
387
    mov     edi, 0
-
 
388
  @@:
-
 
389
    cmp     byte[set_img + edi], 0
-
 
390
    je	    .notdraw
-
 
391
 
-
 
392
    mov     eax, edi
-
 
393
    mov     edx, 0
-
 
394
    mov     ebx, 6
-
 
395
    div     ebx
-
 
396
    mov     ebx, edx
-
 
397
    mov     ecx, eax
-
 
398
 
-
 
399
    add     ebx, [win.width]
-
 
400
    cmp     byte[win.isvert], 0
-
 
401
    je	    .cfg_hoz
-
 
402
    sub     ebx, [win.width]
-
 
403
    add     ebx, [win.height]
-
 
404
 .cfg_hoz:
-
 
405
    sub     ebx, 10
-
 
406
    add     ecx, 18
-
 
407
 
-
 
408
    cmp     byte[win.isvert], 0
-
 
409
    je	    .cfg_draw
-
 
410
 
-
 
411
    xchg    ebx, ecx
-
 
412
 
-
 
413
  .cfg_draw:
-
 
414
    mcall   1, , , [color.frame]
-
 
415
 
-
 
416
 .notdraw:
-
 
417
    inc     edi
-
 
418
    cmp     edi, 36
362
  @@:
419
    jne     @b
Line 363... Line 420...
363
 
420
 
364
    mcall   12, 2
421
    mcall   12, 2
365
 
422
 
Line 372... Line 429...
372
    je	    .button_close
429
    je	    .button_close
Line 373... Line 430...
373
 
430
 
374
    cmp     ah, 2
431
    cmp     ah, 2
Line -... Line 432...
-
 
432
    je	    .button_dock
-
 
433
 
-
 
434
    cmp     ah, 3
375
    je	    .button_dock
435
    je	    .button_cfg
Line 376... Line 436...
376
 
436
 
377
    jmp     @f
437
    jmp     @f
Line 396... Line 456...
396
    mcall   70, fi
456
    mcall   70, fi
Line 397... Line 457...
397
 
457
 
398
    mov     ecx, eax
458
    mov     ecx, eax
399
    mcall   18, 21
459
    mcall   18, 21
-
 
460
    and     eax, 0xFFFF
-
 
461
    mov     [win.psid], eax
-
 
462
 
-
 
463
    jmp     wnd_hide
-
 
464
 
-
 
465
 .button_cfg:
-
 
466
    mov     dword[fi.p00], 7
-
 
467
    mov     dword[fi.p21], cfg_app
-
 
468
    mcall   70, fi
-
 
469
 
-
 
470
    mov     ecx, eax
-
 
471
    mcall   18, 21
400
    and     eax, 0xFFFF
472
    and     eax, 0xFFFF
Line 401... Line 473...
401
    mov     [win.psid], eax
473
    mov     [win.psid], eax
Line 402... Line 474...
402
 
474