Subversion Repositories Kolibri OS

Rev

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

Rev 2467 Rev 3589
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2012. 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: 2467 $
8
$Revision: 3589 $
Line 9... Line 9...
9
 
9
 
Line 15... Line 15...
15
align 4
15
align 4
16
read_skin_file:
16
read_skin_file:
17
        stdcall load_file, ebx
17
        stdcall load_file, ebx
18
        test    eax, eax
18
        test    eax, eax
19
        jz      .notfound
19
        jz      .notfound
-
 
20
 
20
        cmp     dword [eax], 'SKIN'
21
        cmp     dword [eax], 'SKIN'
21
        jnz     .noskin
22
        jnz     .noskin
22
        cmp     ebx, 32*1024
-
 
23
        jb      @f
-
 
24
        mov     ebx, 32*1024
-
 
25
;--------------------------------------
-
 
26
align 4
-
 
27
@@:
-
 
28
        lea     ecx, [ebx+3]
-
 
29
        shr     ecx, 2
-
 
30
        mov     esi, eax
-
 
31
        mov     edi, skin_data
-
 
32
        rep movsd
-
 
33
        stdcall kernel_free, eax
-
 
Line -... Line 23...
-
 
23
 
-
 
24
        xchg    eax, [skin_data]
-
 
25
        test    eax, eax
-
 
26
        jz @f
-
 
27
 
-
 
28
        stdcall kernel_free, eax
34
 
29
@@:
35
        call    parse_skin_data
30
        call    parse_skin_data
36
        xor     eax, eax
31
        xor     eax, eax
37
        ret
32
        ret
38
;--------------------------------------
33
;--------------------------------------
Line 43... Line 38...
43
        ret
38
        ret
44
;--------------------------------------
39
;--------------------------------------
45
align 4
40
align 4
46
.noskin:
41
.noskin:
47
        stdcall kernel_free, eax
42
        stdcall kernel_free, eax
48
        push    2
-
 
49
        pop     eax
43
        mov     eax, 2
50
        ret
44
        ret
51
;------------------------------------------------------------------------------
45
;------------------------------------------------------------------------------
52
struct  SKIN_HEADER
46
struct  SKIN_HEADER
53
        ident           dd ?
47
        ident           dd ?
54
        version         dd ?
48
        version         dd ?
Line 96... Line 90...
96
        call    read_skin_file
90
        call    read_skin_file
97
        ret
91
        ret
98
;------------------------------------------------------------------------------
92
;------------------------------------------------------------------------------
99
align 4
93
align 4
100
parse_skin_data:
94
parse_skin_data:
101
        mov     ebp, skin_data
95
        mov     ebp, [skin_data]
102
        cmp     [ebp+SKIN_HEADER.ident], 'SKIN'
96
        cmp     [ebp+SKIN_HEADER.ident], 'SKIN'
103
        jne     .exit
97
        jne     .exit
Line 104... Line 98...
104
 
98
 
105
        mov     edi, skin_udata
99
        mov     edi, skin_udata
106
        mov     ecx, (skin_udata.end-skin_udata)/4
100
        mov     ecx, (skin_udata.end-skin_udata)/4
107
        xor     eax, eax
101
        xor     eax, eax
108
        cld
102
        cld
Line 109... Line 103...
109
        rep stosd
103
        rep stosd
110
 
104
 
111
        mov     ebx, [ebp+SKIN_HEADER.params]
105
        mov     ebx, [ebp+SKIN_HEADER.params]
112
        add     ebx, skin_data
106
        add     ebx, [skin_data]
113
        mov     eax, [ebx+SKIN_PARAMS.skin_height]
107
        mov     eax, [ebx+SKIN_PARAMS.skin_height]
114
        mov     [_skinh], eax
108
        mov     [_skinh], eax
115
        mov     eax, [ebx+SKIN_PARAMS.colors.inner]
109
        mov     eax, [ebx+SKIN_PARAMS.colors.inner]
Line 133... Line 127...
133
        mov     dword[_skinmargins+0], eax
127
        mov     dword[_skinmargins+0], eax
134
        mov     eax, dword[ebx+SKIN_PARAMS.margin.bottom]
128
        mov     eax, dword[ebx+SKIN_PARAMS.margin.bottom]
135
        mov     dword[_skinmargins+4], eax
129
        mov     dword[_skinmargins+4], eax
Line 136... Line 130...
136
 
130
 
137
        mov     ebx, [ebp+SKIN_HEADER.bitmaps]
131
        mov     ebx, [ebp+SKIN_HEADER.bitmaps]
138
        add     ebx, skin_data
132
        add     ebx, [skin_data]
139
;--------------------------------------
133
;--------------------------------------
140
align 4
134
align 4
141
.lp1:
135
.lp1:
142
        cmp     dword[ebx], 0
136
        cmp     dword[ebx], 0
Line 158... Line 152...
158
align 4
152
align 4
159
.not_left:
153
.not_left:
160
        dec     eax
154
        dec     eax
161
        jnz     .not_oper
155
        jnz     .not_oper
162
        mov     esi, [ebx+SKIN_BITMAPS.data]
156
        mov     esi, [ebx+SKIN_BITMAPS.data]
163
        add     esi, skin_data
157
        add     esi, [skin_data]
164
        mov     eax, [esi+0]
158
        mov     eax, [esi+0]
165
        neg     eax
159
        neg     eax
166
        mov     edx, skin_active.oper.data
160
        mov     edx, skin_active.oper.data
167
        or      ecx, ecx
161
        or      ecx, ecx
168
        jnz     @f
162
        jnz     @f
Line 193... Line 187...
193
        jmp     .lp1
187
        jmp     .lp1
194
;--------------------------------------
188
;--------------------------------------
195
align 4
189
align 4
196
.next_bitmap:
190
.next_bitmap:
197
        mov     ecx, [ebx+SKIN_BITMAPS.data]
191
        mov     ecx, [ebx+SKIN_BITMAPS.data]
198
        add     ecx, skin_data
192
        add     ecx, [skin_data]
199
        mov     [edx+4], eax
193
        mov     [edx+4], eax
200
        mov     eax, [ecx+0]
194
        mov     eax, [ecx+0]
201
        mov     [edx+8], eax
195
        mov     [edx+8], eax
202
        add     ecx, 8
196
        add     ecx, 8
203
        mov     [edx+0], ecx
197
        mov     [edx+0], ecx
Line 205... Line 199...
205
        jmp     .lp1
199
        jmp     .lp1
206
;--------------------------------------
200
;--------------------------------------
207
align 4
201
align 4
208
.end_bitmaps:
202
.end_bitmaps:
209
        mov     ebx, [ebp+SKIN_HEADER.buttons]
203
        mov     ebx, [ebp+SKIN_HEADER.buttons]
210
        add     ebx, skin_data
204
        add     ebx, [skin_data]
211
;--------------------------------------
205
;--------------------------------------
212
align 4
206
align 4
213
.lp2:
207
.lp2:
214
        cmp     dword[ebx], 0
208
        cmp     dword[ebx], 0
215
        je      .end_buttons
209
        je      .end_buttons
Line 394... Line 388...
394
        jnz     @f
388
        jnz     @f
395
        call    draw_rectangle
389
        call    draw_rectangle
396
;--------------------------------------
390
;--------------------------------------
397
align 4
391
align 4
398
@@:
392
@@:
-
 
393
        mov     eax, [skin_data]
399
        cmp     dword[skin_data], 'SKIN'
394
        cmp     [eax], dword 'SKIN'
400
        je      @f
395
        je      @f
401
        xor     eax, eax
396
        xor     eax, eax
402
        xor     ebx, ebx
397
        xor     ebx, ebx
403
        mov     esi, [esp]
398
        mov     esi, [esp]
404
        mov     ecx, [esi+WDATA.box.width]
399
        mov     ecx, [esi+WDATA.box.width]
Line 436... Line 431...
436
;        call    [drawbar]
431
;        call    [drawbar]
437
        call    vesa20_drawbar
432
        call    vesa20_drawbar
438
;--------------------------------------
433
;--------------------------------------
439
align 4
434
align 4
440
_noinside2:
435
_noinside2:
-
 
436
        mov     eax, [skin_data]
441
        cmp     dword[skin_data], 'SKIN'
437
        cmp     [eax], dword 'SKIN'
442
        jne     no_skin_add_button
438
        jne     no_skin_add_button
443
;* close button
439
;* close button
444
        mov     edi, [BTN_ADDR]
440
        mov     edi, [BTN_ADDR]
445
        movzx   eax, word [edi]
441
        movzx   eax, word [edi]
446
        cmp     eax, 1000
442
        cmp     eax, 1000