Subversion Repositories Kolibri OS

Rev

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

Rev 5664 Rev 6044
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 5664 $
8
$Revision: 6044 $
Line 9... Line 9...
9
 
9
 
Line 99... Line 99...
99
        mov     edi, skin_udata
99
        mov     edi, skin_udata
100
        mov     ecx, (skin_udata.end-skin_udata)/4
100
        mov     ecx, (skin_udata.end-skin_udata)/4
101
        xor     eax, eax
101
        xor     eax, eax
102
        cld
102
        cld
103
        rep stosd
103
        rep stosd
104
 
-
 
105
        mov     ebx, [ebp+SKIN_HEADER.params]
104
        mov     ebx, [ebp+SKIN_HEADER.params]
106
        add     ebx, [skin_data]
105
        add     ebx, [skin_data]
107
        mov     eax, [ebx+SKIN_PARAMS.skin_height]
106
        mov     eax, [ebx+SKIN_PARAMS.skin_height]
108
        mov     [_skinh], eax
107
        mov     [_skinh], eax
109
        mov     eax, [ebx+SKIN_PARAMS.colors.inner]
108
        mov     eax, [ebx+SKIN_PARAMS.colors.inner]
Line 125... Line 124...
125
        rep movsb
124
        rep movsb
126
        mov     eax, dword[ebx+SKIN_PARAMS.margin.right]
125
        mov     eax, dword[ebx+SKIN_PARAMS.margin.right]
127
        mov     dword[_skinmargins+0], eax
126
        mov     dword[_skinmargins+0], eax
128
        mov     eax, dword[ebx+SKIN_PARAMS.margin.bottom]
127
        mov     eax, dword[ebx+SKIN_PARAMS.margin.bottom]
129
        mov     dword[_skinmargins+4], eax
128
        mov     dword[_skinmargins+4], eax
130
 
-
 
131
        mov     ebx, [ebp+SKIN_HEADER.bitmaps]
129
        mov     ebx, [ebp+SKIN_HEADER.bitmaps]
132
        add     ebx, [skin_data]
130
        add     ebx, [skin_data]
133
;--------------------------------------
-
 
134
align 4
-
 
135
.lp1:
131
.lp1:
136
        cmp     dword[ebx], 0
132
        cmp     dword[ebx], 0
137
        je      .end_bitmaps
133
        je      .end_bitmaps
138
        movzx   eax, [ebx+SKIN_BITMAPS.kind]
134
        movzx   eax, [ebx+SKIN_BITMAPS.kind]
139
        movzx   ecx, [ebx+SKIN_BITMAPS.type]
135
        movzx   ecx, [ebx+SKIN_BITMAPS.type]
140
        dec     eax
136
        dec     eax
141
        jnz     .not_left
137
        jnz     .not_left
142
        xor     eax, eax
138
        xor     eax, eax
143
        mov     edx, skin_active.left.data
139
        mov     edx, skin_active.left.data
144
        or      ecx, ecx
140
        or      ecx, ecx
145
        jnz     @f
141
        jnz     .next_bitmap
146
        mov     edx, skin_inactive.left.data
142
        mov     edx, skin_inactive.left.data
147
;--------------------------------------
-
 
148
align 4
-
 
149
@@:
-
 
150
        jmp     .next_bitmap
143
        jmp     .next_bitmap
151
;--------------------------------------
144
;--------------------------------------
152
align 4
145
align 4
153
.not_left:
146
.not_left:
154
        dec     eax
147
        dec     eax
Line 157... Line 150...
157
        add     esi, [skin_data]
150
        add     esi, [skin_data]
158
        mov     eax, [esi+0]
151
        mov     eax, [esi+0]
159
        neg     eax
152
        neg     eax
160
        mov     edx, skin_active.oper.data
153
        mov     edx, skin_active.oper.data
161
        or      ecx, ecx
154
        or      ecx, ecx
162
        jnz     @f
155
        jnz     .next_bitmap
163
        mov     edx, skin_inactive.oper.data
156
        mov     edx, skin_inactive.oper.data
164
;--------------------------------------
-
 
165
align 4
-
 
166
@@:
-
 
167
        jmp     .next_bitmap
157
        jmp     .next_bitmap
168
;--------------------------------------
158
;--------------------------------------
169
align 4
159
align 4
170
.not_oper:
160
.not_oper:
171
        dec     eax
161
        dec     eax
172
        jnz     .not_base
162
        jnz     .not_base
173
        mov     eax, [skin_active.left.width]
163
        mov     eax, [skin_active.left.width]
174
        mov     edx, skin_active.base.data
164
        mov     edx, skin_active.base.data
175
        or      ecx, ecx
165
        or      ecx, ecx
176
        jnz     @f
166
        jnz     .next_bitmap
177
        mov     eax, [skin_inactive.left.width]
167
        mov     eax, [skin_inactive.left.width]
178
        mov     edx, skin_inactive.base.data
168
        mov     edx, skin_inactive.base.data
179
;--------------------------------------
-
 
180
align 4
-
 
181
@@:
-
 
182
        jmp     .next_bitmap
169
        jmp     .next_bitmap
183
;--------------------------------------
170
;--------------------------------------
184
align 4
171
align 4
185
.not_base:
172
.not_base:
186
        add     ebx, 8
173
        add     ebx, 8
Line 200... Line 187...
200
;--------------------------------------
187
;--------------------------------------
201
align 4
188
align 4
202
.end_bitmaps:
189
.end_bitmaps:
203
        mov     ebx, [ebp+SKIN_HEADER.buttons]
190
        mov     ebx, [ebp+SKIN_HEADER.buttons]
204
        add     ebx, [skin_data]
191
        add     ebx, [skin_data]
205
;--------------------------------------
-
 
206
align 4
-
 
207
.lp2:
192
.lp2:
208
        cmp     dword[ebx], 0
193
        cmp     dword[ebx], 0
209
        je      .end_buttons
194
        je      .end_buttons
210
        mov     eax, [ebx+SKIN_BUTTONS.type]
195
        mov     eax, [ebx+SKIN_BUTTONS.type]
211
        dec     eax
196
        dec     eax
Line 243... Line 228...
243
.exit:
228
.exit:
244
        ret
229
        ret
245
;------------------------------------------------------------------------------
230
;------------------------------------------------------------------------------
246
align 4
231
align 4
247
drawwindow_IV_caption:
232
drawwindow_IV_caption:
248
 
-
 
249
        mov     ebp, skin_active
233
        mov     ebp, skin_active
250
        or      al, al
234
        or      al, al
251
        jnz     @f
235
        jnz     @f
252
        mov     ebp, skin_inactive
236
        mov     ebp, skin_inactive
253
;--------------------------------------
-
 
254
align 4
-
 
255
@@:
237
@@:
256
        mov     esi, [esp+4]
238
        mov     esi, [esp+4]
257
        mov     eax, [esi+WDATA.box.width]   ; window width
239
        mov     eax, [esi+WDATA.box.width]   ; window width
258
        mov     edx, [ebp+SKIN_DATA.left.left]
240
        mov     edx, [ebp+SKIN_DATA.left.left]
259
        shl     edx, 16
241
        shl     edx, 16
260
        mov     ecx, [ebp+SKIN_DATA.left.width]
242
        mov     ecx, [ebp+SKIN_DATA.left.width]
261
        shl     ecx, 16
243
        shl     ecx, 16
262
        add     ecx, [_skinh]
244
        add     ecx, [_skinh]
263
 
-
 
264
        mov     ebx, [ebp+SKIN_DATA.left.data]
245
        mov     ebx, [ebp+SKIN_DATA.left.data]
265
        or      ebx, ebx
246
        or      ebx, ebx
266
        jz      @f
247
        jz      @f
267
        call    sys_putimage.forced
248
        call    sys_putimage.forced
268
;--------------------------------------
-
 
269
align 4
-
 
270
@@:
249
@@:
271
        mov     esi, [esp+4]
250
        mov     esi, [esp+4]
272
        mov     eax, [esi+WDATA.box.width]
251
        mov     eax, [esi+WDATA.box.width]
273
        sub     eax, [ebp+SKIN_DATA.left.width]
252
        sub     eax, [ebp+SKIN_DATA.left.width]
274
        sub     eax, [ebp+SKIN_DATA.oper.width]
253
        sub     eax, [ebp+SKIN_DATA.oper.width]
Line 276... Line 255...
276
        jng     .non_base
255
        jng     .non_base
277
        xor     edx, edx
256
        xor     edx, edx
278
        mov     ecx, [ebp+SKIN_DATA.base.width]
257
        mov     ecx, [ebp+SKIN_DATA.base.width]
279
        jecxz   .non_base
258
        jecxz   .non_base
280
        div     ecx
259
        div     ecx
281
 
-
 
282
        inc     eax
260
        inc     eax
283
 
-
 
284
        mov     ebx, [ebp+SKIN_DATA.base.data]
261
        mov     ebx, [ebp+SKIN_DATA.base.data]
285
        mov     ecx, [ebp+SKIN_DATA.base.width]
262
        mov     ecx, [ebp+SKIN_DATA.base.width]
286
        shl     ecx, 16
263
        shl     ecx, 16
287
        add     ecx, [_skinh]
264
        add     ecx, [_skinh]
288
        mov     edx, [ebp+SKIN_DATA.base.left]
265
        mov     edx, [ebp+SKIN_DATA.base.left]
289
        sub     edx, [ebp+SKIN_DATA.base.width]
266
        sub     edx, [ebp+SKIN_DATA.base.width]
290
        shl     edx, 16
267
        shl     edx, 16
291
;--------------------------------------
-
 
292
align 4
-
 
293
.baseskinloop:
268
.baseskinloop:
294
        shr     edx, 16
269
        shr     edx, 16
295
        add     edx, [ebp+SKIN_DATA.base.width]
270
        add     edx, [ebp+SKIN_DATA.base.width]
296
        shl     edx, 16
271
        shl     edx, 16
Line 297... Line 272...
297
 
272
 
298
        push    eax ebx ecx edx
-
 
299
 
273
        push    eax ebx ecx edx
300
        or      ebx, ebx
274
        or      ebx, ebx
301
        jz      @f
275
        jz      @f
302
        call    sys_putimage.forced
-
 
303
;--------------------------------------
-
 
304
align 4
276
        call    sys_putimage.forced
305
@@:
277
@@:
Line 306... Line 278...
306
        pop     edx ecx ebx eax
278
        pop     edx ecx ebx eax
307
 
279
 
308
        dec     eax
-
 
309
        jnz     .baseskinloop
-
 
310
;--------------------------------------
280
        dec     eax
311
align 4
-
 
312
.non_base:
281
        jnz     .baseskinloop
313
 
282
.non_base:
314
        mov     esi, [esp+4]
283
        mov     esi, [esp+4]
315
        mov     edx, [esi+WDATA.box.width]
284
        mov     edx, [esi+WDATA.box.width]
316
        sub     edx, [ebp+SKIN_DATA.oper.width]
285
        sub     edx, [ebp+SKIN_DATA.oper.width]
317
        inc     edx
286
        inc     edx
318
        shl     edx, 16
-
 
319
        mov     ebx, [ebp+SKIN_DATA.oper.data]
287
        shl     edx, 16
320
 
288
        mov     ebx, [ebp+SKIN_DATA.oper.data]
321
        mov     ecx, [ebp+SKIN_DATA.oper.width]
289
        mov     ecx, [ebp+SKIN_DATA.oper.width]
322
        shl     ecx, 16
-
 
323
        add     ecx, [_skinh]
290
        shl     ecx, 16
324
 
291
        add     ecx, [_skinh]
325
        or      ebx, ebx
292
        or      ebx, ebx
326
        jz      @f
-
 
327
        call    sys_putimage.forced
-
 
328
;--------------------------------------
293
        jz      @f
329
align 4
294
        call    sys_putimage.forced
330
@@:
295
@@:
331
        ret
296
        ret
332
;------------------------------------------------------------------------------
297
;------------------------------------------------------------------------------
333
align 4
298
align 4
334
drawwindow_IV:
299
drawwindow_IV:
335
;param1 - aw_yes
-
 
336
        pusha
300
;param1 - aw_yes
337
 
-
 
338
        push    edx
301
        pusha
339
 
-
 
340
        mov     edi, edx
302
        push    edx
341
 
303
        mov     edi, edx
342
        mov     ebp, skin_active
304
        mov     ebp, skin_active
343
        cmp     byte [esp+32+4+4], 0
305
        cmp     byte [esp+32+4+4], 0
344
        jne     @f
-
 
345
        mov     ebp, skin_inactive
-
 
346
;--------------------------------------
306
        jne     @f
347
align 4
307
        mov     ebp, skin_inactive
348
@@:
308
@@:
349
        mov     eax, [edi+WDATA.box.left]
309
        mov     eax, [edi+WDATA.box.left]
350
        shl     eax, 16
310
        shl     eax, 16
Line 360... Line 320...
360
        add     ebx, [_skinh]
320
        add     ebx, [_skinh]
361
        sub     bx, 1
321
        sub     bx, 1
362
        rol     ebx, 16
322
        rol     ebx, 16
363
        call    draw_rectangle
323
        call    draw_rectangle
364
        mov     ecx, 3
324
        mov     ecx, 3
365
;--------------------------------------
-
 
366
align 4
-
 
367
_dw3l:
325
_dw3l:
368
        add     eax, 1*65536-1
326
        add     eax, 1*65536-1
369
        add     ebx, 0*65536-1
327
        add     ebx, 0*65536-1
370
        test    ax, ax
328
        test    ax, ax
371
        js      no_skin_add_button
329
        js      no_skin_add_button
Line 385... Line 343...
385
        test    bx, bx
343
        test    bx, bx
386
        js      no_skin_add_button
344
        js      no_skin_add_button
387
        test    [edi + WDATA.fl_wstate], WSTATE_ROLLEDUP
345
        test    [edi + WDATA.fl_wstate], WSTATE_ROLLEDUP
388
        jnz     @f
346
        jnz     @f
389
        call    draw_rectangle
347
        call    draw_rectangle
390
;--------------------------------------
-
 
391
align 4
-
 
392
@@:
348
@@:
393
        mov     eax, [skin_data]
349
        mov     eax, [skin_data]
394
        cmp     [eax], dword 'SKIN'
350
        cmp     [eax], dword 'SKIN'
395
        je      @f
351
        je      @f
396
        xor     eax, eax
352
        xor     eax, eax
Line 398... Line 354...
398
        mov     esi, [esp]
354
        mov     esi, [esp]
399
        mov     ecx, [esi+WDATA.box.width]
355
        mov     ecx, [esi+WDATA.box.width]
400
        inc     ecx
356
        inc     ecx
401
        mov     edx, [_skinh]
357
        mov     edx, [_skinh]
402
        mov     edi, [common_colours+4]; standard grab color
358
        mov     edi, [common_colours+4]; standard grab color
403
;        call    [drawbar]
-
 
404
        call    vesa20_drawbar
359
        call    vesa20_drawbar
405
        jmp     draw_clientbar
360
        jmp     draw_clientbar
406
;--------------------------------------
361
;--------------------------------------
407
align 4
362
align 4
408
@@:
363
@@:
409
        mov     al, [esp+32+4+4]
364
        mov     al, [esp+32+4+4]
410
        call    drawwindow_IV_caption
365
        call    drawwindow_IV_caption
411
;--------------------------------------
-
 
412
align 4
-
 
413
draw_clientbar:
366
draw_clientbar:
414
        mov     esi, [esp]
367
        mov     esi, [esp]
415
 
-
 
416
        mov     edx, [esi+WDATA.box.top]                    ; WORK AREA
368
        mov     edx, [esi+WDATA.box.top]                    ; WORK AREA
417
        add     edx, 21+5
369
        add     edx, 21+5
418
        mov     ebx, [esi+WDATA.box.top]
370
        mov     ebx, [esi+WDATA.box.top]
419
        add     ebx, [esi+WDATA.box.height]
371
        add     ebx, [esi+WDATA.box.height]
420
        cmp     edx, ebx
372
        cmp     edx, ebx
Line 426... Line 378...
426
        sub     ecx, 4
378
        sub     ecx, 4
427
        sub     edx, 4
379
        sub     edx, 4
428
        mov     edi, [esi+WDATA.cl_workarea]
380
        mov     edi, [esi+WDATA.cl_workarea]
429
        test    edi, 0x40000000
381
        test    edi, 0x40000000
430
        jnz     _noinside2
382
        jnz     _noinside2
431
;        call    [drawbar]
-
 
432
        call    vesa20_drawbar
383
        call    vesa20_drawbar
433
;--------------------------------------
-
 
434
align 4
-
 
435
_noinside2:
384
_noinside2:
436
        mov     eax, [skin_data]
385
        mov     eax, [skin_data]
437
        cmp     [eax], dword 'SKIN'
386
        cmp     [eax], dword 'SKIN'
438
        jne     no_skin_add_button
387
        jne     no_skin_add_button
439
;* close button
388
;* close button
Line 441... Line 390...
441
        movzx   eax, word [edi]
390
        movzx   eax, word [edi]
442
        cmp     eax, 1000
391
        cmp     eax, 1000
443
        jge     no_skin_add_button
392
        jge     no_skin_add_button
444
        inc     eax
393
        inc     eax
445
        mov     [edi], ax
394
        mov     [edi], ax
446
 
-
 
447
        shl     eax, 4
395
        shl     eax, 4
448
        add     eax, edi
396
        add     eax, edi
Line 449... Line 397...
449
 
397
 
450
        mov     bx, [CURRENT_TASK]
398
        mov     bx, [CURRENT_TASK]
451
        mov     [eax], bx
-
 
452
 
-
 
453
        add     eax, 2      ; save button id number
-
 
454
        mov     bx, 1
-
 
455
        mov     [eax], bx
399
        mov     [eax], bx
456
        add     eax, 2      ; x start
400
        mov     word [eax+2], 1     ; button id
457
        xor     ebx, ebx
401
        xor     ebx, ebx
458
        cmp     [skin_btn_close.left], 0
402
        cmp     [skin_btn_close.left], 0
459
        jge     _bCx_at_right
403
        jge     @f
460
        mov     ebx, [esp]
404
        mov     ebx, [esp]
461
        mov     ebx, [ebx+WDATA.box.width]
405
        mov     ebx, [ebx+WDATA.box.width]
462
        inc     ebx
-
 
463
;--------------------------------------
406
        inc     ebx
464
align 4
-
 
465
_bCx_at_right:
407
@@:
466
        add     ebx, [skin_btn_close.left]
-
 
467
        mov     [eax], bx
408
        add     ebx, [skin_btn_close.left]
468
        add     eax, 2      ; x size
409
        mov     word [eax+4], bx    ; x start
469
        mov     ebx, [skin_btn_close.width]
410
        mov     ebx, [skin_btn_close.width]
470
        dec     ebx
-
 
471
        mov     [eax], bx
411
        dec     ebx
472
        add     eax, 2      ; y start
412
        mov     word [eax+6], bx    ; x size
473
        mov     ebx, [skin_btn_close.top]
-
 
474
        mov     [eax], bx
413
        mov     ebx, [skin_btn_close.top]
475
        add     eax, 2      ; y size
414
        mov     word [eax+8], bx    ; y start
476
        mov     ebx, [skin_btn_close.height]
415
        mov     ebx, [skin_btn_close.height]
-
 
416
        dec     ebx
477
        dec     ebx
417
        mov     word [eax+10], bx   ; y size
478
        mov     [eax], bx
418
        bts     word [eax+12], 14
479
;* minimize button
419
;* minimize button
480
        mov     edi, [BTN_ADDR]
420
        mov     edi, [BTN_ADDR]
481
        movzx   eax, word [edi]
421
        movzx   eax, word [edi]
482
        cmp     eax, 1000
422
        cmp     eax, 1000
483
        jge     no_skin_add_button
423
        jge     no_skin_add_button
484
        inc     eax
424
        inc     eax
485
        mov     [edi], ax
-
 
486
 
425
        mov     [edi], ax
487
        shl     eax, 4
426
        shl     eax, 4
Line 488... Line 427...
488
        add     eax, edi
427
        add     eax, edi
489
 
428
 
490
        mov     bx, [CURRENT_TASK]
-
 
491
        mov     [eax], bx
-
 
492
 
-
 
493
        add     eax, 2      ; save button id number
-
 
494
        mov     bx, 65535;999
429
        mov     bx, [CURRENT_TASK]
495
        mov     [eax], bx
430
        mov     [eax], bx
496
        add     eax, 2      ; x start
431
        mov     word [eax+2], -1    ; button id
497
        xor     ebx, ebx
432
        xor     ebx, ebx
498
        cmp     [skin_btn_minimize.left], 0
433
        cmp     [skin_btn_minimize.left], 0
499
        jge     _bMx_at_right
434
        jge     @f
500
        mov     ebx, [esp]
435
        mov     ebx, [esp]
501
        mov     ebx, [ebx+WDATA.box.width]
-
 
502
        inc     ebx
436
        mov     ebx, [ebx+WDATA.box.width]
503
;--------------------------------------
-
 
504
align 4
437
        inc     ebx
505
_bMx_at_right:
-
 
506
        add     ebx, [skin_btn_minimize.left]
438
@@:
507
        mov     [eax], bx
439
        add     ebx, [skin_btn_minimize.left]
508
        add     eax, 2      ; x size
440
        mov     word [eax+4], bx    ; x start
509
        mov     ebx, [skin_btn_minimize.width]
-
 
510
        dec     ebx
441
        mov     ebx, [skin_btn_minimize.width]
511
        mov     [eax], bx
442
        dec     ebx
512
        add     eax, 2      ; y start
-
 
513
        mov     ebx, [skin_btn_minimize.top]
443
        mov     word [eax+6], bx    ; x size
514
        mov     [eax], bx
444
        mov     ebx, [skin_btn_minimize.top]
515
        add     eax, 2      ; y size
445
        mov     word [eax+8], bx    ; y start
516
        mov     ebx, [skin_btn_minimize.height]
446
        mov     ebx, [skin_btn_minimize.height]
517
        dec     ebx
447
        dec     ebx
518
        mov     [eax], bx
-
 
519
;--------------------------------------
448
        mov     word [eax+10], bx   ; y size
520
align 4
449
        bts     word [eax+12], 14
521
no_skin_add_button:
450
no_skin_add_button:
522
        pop     edi
451
        pop     edi
523
        popa
-