Subversion Repositories Kolibri OS

Rev

Rev 5664 | Rev 8869 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5664 Rev 6044
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
7
 
8
$Revision: 5664 $
8
$Revision: 6044 $
9
 
9
 
10
 
10
 
11
include "skindata.inc"
11
include "skindata.inc"
12
 
12
 
13
;skin_data = 0x00778000
13
;skin_data = 0x00778000
14
;-----------------------------------------------------------------
14
;-----------------------------------------------------------------
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
 
21
        cmp     dword [eax], 'SKIN'
21
        cmp     dword [eax], 'SKIN'
22
        jnz     .noskin
22
        jnz     .noskin
23
 
23
 
24
        xchg    eax, [skin_data]
24
        xchg    eax, [skin_data]
25
        test    eax, eax
25
        test    eax, eax
26
        jz      @f
26
        jz      @f
27
 
27
 
28
        stdcall kernel_free, eax
28
        stdcall kernel_free, eax
29
@@:
29
@@:
30
        call    parse_skin_data
30
        call    parse_skin_data
31
        xor     eax, eax
31
        xor     eax, eax
32
        ret
32
        ret
33
;--------------------------------------
33
;--------------------------------------
34
align 4
34
align 4
35
.notfound:
35
.notfound:
36
        xor     eax, eax
36
        xor     eax, eax
37
        inc     eax
37
        inc     eax
38
        ret
38
        ret
39
;--------------------------------------
39
;--------------------------------------
40
align 4
40
align 4
41
.noskin:
41
.noskin:
42
        stdcall kernel_free, eax
42
        stdcall kernel_free, eax
43
        mov     eax, 2
43
        mov     eax, 2
44
        ret
44
        ret
45
;------------------------------------------------------------------------------
45
;------------------------------------------------------------------------------
46
struct  SKIN_HEADER
46
struct  SKIN_HEADER
47
        ident           dd ?
47
        ident           dd ?
48
        version         dd ?
48
        version         dd ?
49
        params          dd ?
49
        params          dd ?
50
        buttons         dd ?
50
        buttons         dd ?
51
        bitmaps         dd ?
51
        bitmaps         dd ?
52
ends
52
ends
53
 
53
 
54
struct  SKIN_PARAMS
54
struct  SKIN_PARAMS
55
        skin_height     dd ?
55
        skin_height     dd ?
56
        margin.right    dw ?
56
        margin.right    dw ?
57
        margin.left     dw ?
57
        margin.left     dw ?
58
        margin.bottom   dw ?
58
        margin.bottom   dw ?
59
        margin.top      dw ?
59
        margin.top      dw ?
60
        colors.inner    dd ?
60
        colors.inner    dd ?
61
        colors.outer    dd ?
61
        colors.outer    dd ?
62
        colors.frame    dd ?
62
        colors.frame    dd ?
63
        colors_1.inner  dd ?
63
        colors_1.inner  dd ?
64
        colors_1.outer  dd ?
64
        colors_1.outer  dd ?
65
        colors_1.frame  dd ?
65
        colors_1.frame  dd ?
66
        dtp.size        dd ?
66
        dtp.size        dd ?
67
        dtp.data        rb 40
67
        dtp.data        rb 40
68
ends
68
ends
69
 
69
 
70
struct  SKIN_BUTTONS
70
struct  SKIN_BUTTONS
71
        type    dd ?
71
        type    dd ?
72
; position
72
; position
73
        left    dw ?
73
        left    dw ?
74
        top     dw ?
74
        top     dw ?
75
; size
75
; size
76
        width   dw ?
76
        width   dw ?
77
        height  dw ?
77
        height  dw ?
78
ends
78
ends
79
 
79
 
80
struct  SKIN_BITMAPS
80
struct  SKIN_BITMAPS
81
        kind    dw ?
81
        kind    dw ?
82
        type    dw ?
82
        type    dw ?
83
        data    dd ?
83
        data    dd ?
84
ends
84
ends
85
;------------------------------------------------------------------------------
85
;------------------------------------------------------------------------------
86
align 4
86
align 4
87
load_default_skin:
87
load_default_skin:
88
        mov     [_skinh], 22
88
        mov     [_skinh], 22
89
        mov     ebx, _skin_file_default
89
        mov     ebx, _skin_file_default
90
        call    read_skin_file
90
        call    read_skin_file
91
        ret
91
        ret
92
;------------------------------------------------------------------------------
92
;------------------------------------------------------------------------------
93
align 4
93
align 4
94
parse_skin_data:
94
parse_skin_data:
95
        mov     ebp, [skin_data]
95
        mov     ebp, [skin_data]
96
        cmp     [ebp+SKIN_HEADER.ident], 'SKIN'
96
        cmp     [ebp+SKIN_HEADER.ident], 'SKIN'
97
        jne     .exit
97
        jne     .exit
98
 
98
 
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]
110
        mov     [skin_active.colors.inner], eax
109
        mov     [skin_active.colors.inner], eax
111
        mov     eax, [ebx+SKIN_PARAMS.colors.outer]
110
        mov     eax, [ebx+SKIN_PARAMS.colors.outer]
112
        mov     [skin_active.colors.outer], eax
111
        mov     [skin_active.colors.outer], eax
113
        mov     eax, [ebx+SKIN_PARAMS.colors.frame]
112
        mov     eax, [ebx+SKIN_PARAMS.colors.frame]
114
        mov     [skin_active.colors.frame], eax
113
        mov     [skin_active.colors.frame], eax
115
        mov     eax, [ebx+SKIN_PARAMS.colors_1.inner]
114
        mov     eax, [ebx+SKIN_PARAMS.colors_1.inner]
116
        mov     [skin_inactive.colors.inner], eax
115
        mov     [skin_inactive.colors.inner], eax
117
        mov     eax, [ebx+SKIN_PARAMS.colors_1.outer]
116
        mov     eax, [ebx+SKIN_PARAMS.colors_1.outer]
118
        mov     [skin_inactive.colors.outer], eax
117
        mov     [skin_inactive.colors.outer], eax
119
        mov     eax, [ebx+SKIN_PARAMS.colors_1.frame]
118
        mov     eax, [ebx+SKIN_PARAMS.colors_1.frame]
120
        mov     [skin_inactive.colors.frame], eax
119
        mov     [skin_inactive.colors.frame], eax
121
        lea     esi, [ebx+SKIN_PARAMS.dtp.data]
120
        lea     esi, [ebx+SKIN_PARAMS.dtp.data]
122
        mov     edi, common_colours
121
        mov     edi, common_colours
123
        mov     ecx, [ebx+SKIN_PARAMS.dtp.size]
122
        mov     ecx, [ebx+SKIN_PARAMS.dtp.size]
124
        and     ecx, 255
123
        and     ecx, 255
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
155
        jnz     .not_oper
148
        jnz     .not_oper
156
        mov     esi, [ebx+SKIN_BITMAPS.data]
149
        mov     esi, [ebx+SKIN_BITMAPS.data]
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
187
        jmp     .lp1
174
        jmp     .lp1
188
;--------------------------------------
175
;--------------------------------------
189
align 4
176
align 4
190
.next_bitmap:
177
.next_bitmap:
191
        mov     ecx, [ebx+SKIN_BITMAPS.data]
178
        mov     ecx, [ebx+SKIN_BITMAPS.data]
192
        add     ecx, [skin_data]
179
        add     ecx, [skin_data]
193
        mov     [edx+4], eax
180
        mov     [edx+4], eax
194
        mov     eax, [ecx+0]
181
        mov     eax, [ecx+0]
195
        mov     [edx+8], eax
182
        mov     [edx+8], eax
196
        add     ecx, 8
183
        add     ecx, 8
197
        mov     [edx+0], ecx
184
        mov     [edx+0], ecx
198
        add     ebx, 8
185
        add     ebx, 8
199
        jmp     .lp1
186
        jmp     .lp1
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
212
        jnz     .not_close
197
        jnz     .not_close
213
        mov     edx, skin_btn_close
198
        mov     edx, skin_btn_close
214
        jmp     .next_button
199
        jmp     .next_button
215
;--------------------------------------
200
;--------------------------------------
216
align 4
201
align 4
217
.not_close:
202
.not_close:
218
        dec     eax
203
        dec     eax
219
        jnz     .not_minimize
204
        jnz     .not_minimize
220
        mov     edx, skin_btn_minimize
205
        mov     edx, skin_btn_minimize
221
        jmp     .next_button
206
        jmp     .next_button
222
;--------------------------------------
207
;--------------------------------------
223
align 4
208
align 4
224
.not_minimize:
209
.not_minimize:
225
        add     ebx, 12
210
        add     ebx, 12
226
        jmp     .lp2
211
        jmp     .lp2
227
;--------------------------------------
212
;--------------------------------------
228
align 4
213
align 4
229
.next_button:
214
.next_button:
230
        movsx   eax, [ebx+SKIN_BUTTONS.left]
215
        movsx   eax, [ebx+SKIN_BUTTONS.left]
231
        mov     [edx+SKIN_BUTTON.left], eax
216
        mov     [edx+SKIN_BUTTON.left], eax
232
        movsx   eax, [ebx+SKIN_BUTTONS.top]
217
        movsx   eax, [ebx+SKIN_BUTTONS.top]
233
        mov     [edx+SKIN_BUTTON.top], eax
218
        mov     [edx+SKIN_BUTTON.top], eax
234
        movsx   eax, [ebx+SKIN_BUTTONS.width]
219
        movsx   eax, [ebx+SKIN_BUTTONS.width]
235
        mov     [edx+SKIN_BUTTON.width], eax
220
        mov     [edx+SKIN_BUTTON.width], eax
236
        movsx   eax, [ebx+SKIN_BUTTONS.height]
221
        movsx   eax, [ebx+SKIN_BUTTONS.height]
237
        mov     [edx+SKIN_BUTTON.height], eax
222
        mov     [edx+SKIN_BUTTON.height], eax
238
        add     ebx, 12
223
        add     ebx, 12
239
        jmp     .lp2
224
        jmp     .lp2
240
;--------------------------------------
225
;--------------------------------------
241
align 4
226
align 4
242
.end_buttons:
227
.end_buttons:
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]
275
        cmp     eax, [ebp+SKIN_DATA.base.left]
254
        cmp     eax, [ebp+SKIN_DATA.base.left]
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
297
 
272
 
298
        push    eax ebx ecx edx
273
        push    eax ebx ecx edx
299
 
-
 
300
        or      ebx, ebx
274
        or      ebx, ebx
301
        jz      @f
275
        jz      @f
302
        call    sys_putimage.forced
276
        call    sys_putimage.forced
303
;--------------------------------------
-
 
304
align 4
-
 
305
@@:
277
@@:
306
        pop     edx ecx ebx eax
278
        pop     edx ecx ebx eax
307
 
279
 
308
        dec     eax
280
        dec     eax
309
        jnz     .baseskinloop
281
        jnz     .baseskinloop
310
;--------------------------------------
-
 
311
align 4
-
 
312
.non_base:
282
.non_base:
313
 
-
 
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
287
        shl     edx, 16
319
        mov     ebx, [ebp+SKIN_DATA.oper.data]
288
        mov     ebx, [ebp+SKIN_DATA.oper.data]
320
 
-
 
321
        mov     ecx, [ebp+SKIN_DATA.oper.width]
289
        mov     ecx, [ebp+SKIN_DATA.oper.width]
322
        shl     ecx, 16
290
        shl     ecx, 16
323
        add     ecx, [_skinh]
291
        add     ecx, [_skinh]
324
 
-
 
325
        or      ebx, ebx
292
        or      ebx, ebx
326
        jz      @f
293
        jz      @f
327
        call    sys_putimage.forced
294
        call    sys_putimage.forced
328
;--------------------------------------
-
 
329
align 4
-
 
330
@@:
295
@@:
331
        ret
296
        ret
332
;------------------------------------------------------------------------------
297
;------------------------------------------------------------------------------
333
align 4
298
align 4
334
drawwindow_IV:
299
drawwindow_IV:
335
;param1 - aw_yes
300
;param1 - aw_yes
336
        pusha
301
        pusha
337
 
-
 
338
        push    edx
302
        push    edx
339
 
-
 
340
        mov     edi, edx
303
        mov     edi, edx
341
 
-
 
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
306
        jne     @f
345
        mov     ebp, skin_inactive
307
        mov     ebp, skin_inactive
346
;--------------------------------------
-
 
347
align 4
-
 
348
@@:
308
@@:
349
        mov     eax, [edi+WDATA.box.left]
309
        mov     eax, [edi+WDATA.box.left]
350
        shl     eax, 16
310
        shl     eax, 16
351
        mov     ax, word [edi+WDATA.box.left]
311
        mov     ax, word [edi+WDATA.box.left]
352
        add     ax, word [edi+WDATA.box.width]
312
        add     ax, word [edi+WDATA.box.width]
353
        mov     ebx, [edi+WDATA.box.top]
313
        mov     ebx, [edi+WDATA.box.top]
354
        shl     ebx, 16
314
        shl     ebx, 16
355
        mov     bx, word [edi+WDATA.box.top]
315
        mov     bx, word [edi+WDATA.box.top]
356
        add     bx, word [edi+WDATA.box.height]
316
        add     bx, word [edi+WDATA.box.height]
357
        mov     esi, [ebp+SKIN_DATA.colors.outer]
317
        mov     esi, [ebp+SKIN_DATA.colors.outer]
358
        or      esi, 1 shl 25 ; 0x02000000 used for draw_rectangle without top line
318
        or      esi, 1 shl 25 ; 0x02000000 used for draw_rectangle without top line
359
        ror     ebx, 16
319
        ror     ebx, 16
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
372
        test    bx, bx
330
        test    bx, bx
373
        js      no_skin_add_button
331
        js      no_skin_add_button
374
        mov     esi, [ebp+SKIN_DATA.colors.frame];[edi+24]
332
        mov     esi, [ebp+SKIN_DATA.colors.frame];[edi+24]
375
        or      esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
333
        or      esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
376
        call    draw_rectangle
334
        call    draw_rectangle
377
        dec     ecx
335
        dec     ecx
378
        jnz     _dw3l
336
        jnz     _dw3l
379
        mov     esi, [ebp+SKIN_DATA.colors.inner]
337
        mov     esi, [ebp+SKIN_DATA.colors.inner]
380
        or      esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
338
        or      esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
381
        add     eax, 1*65536-1
339
        add     eax, 1*65536-1
382
        add     ebx, 0*65536-1
340
        add     ebx, 0*65536-1
383
        test    ax, ax
341
        test    ax, ax
384
        js      no_skin_add_button
342
        js      no_skin_add_button
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
397
        xor     ebx, ebx
353
        xor     ebx, ebx
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
421
        jg      _noinside2
373
        jg      _noinside2
422
        mov     eax, 5
374
        mov     eax, 5
423
        mov     ebx, [_skinh]
375
        mov     ebx, [_skinh]
424
        mov     ecx, [esi+WDATA.box.width]
376
        mov     ecx, [esi+WDATA.box.width]
425
        mov     edx, [esi+WDATA.box.height]
377
        mov     edx, [esi+WDATA.box.height]
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
440
        mov     edi, [BTN_ADDR]
389
        mov     edi, [BTN_ADDR]
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
449
 
397
 
450
        mov     bx, [CURRENT_TASK]
398
        mov     bx, [CURRENT_TASK]
451
        mov     [eax], bx
399
        mov     [eax], bx
452
 
-
 
453
        add     eax, 2      ; save button id number
-
 
454
        mov     bx, 1
-
 
455
        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
406
        inc     ebx
463
;--------------------------------------
-
 
464
align 4
407
@@:
465
_bCx_at_right:
-
 
466
        add     ebx, [skin_btn_close.left]
408
        add     ebx, [skin_btn_close.left]
467
        mov     [eax], bx
-
 
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
411
        dec     ebx
471
        mov     [eax], bx
-
 
472
        add     eax, 2      ; y start
412
        mov     word [eax+6], bx    ; x size
473
        mov     ebx, [skin_btn_close.top]
413
        mov     ebx, [skin_btn_close.top]
474
        mov     [eax], bx
-
 
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]
477
        dec     ebx
416
        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
425
        mov     [edi], ax
486
 
-
 
487
        shl     eax, 4
426
        shl     eax, 4
488
        add     eax, edi
427
        add     eax, edi
489
 
428
 
490
        mov     bx, [CURRENT_TASK]
429
        mov     bx, [CURRENT_TASK]
491
        mov     [eax], bx
430
        mov     [eax], bx
492
 
-
 
493
        add     eax, 2      ; save button id number
-
 
494
        mov     bx, 65535;999
-
 
495
        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]
436
        mov     ebx, [ebx+WDATA.box.width]
502
        inc     ebx
437
        inc     ebx
503
;--------------------------------------
-
 
504
align 4
438
@@:
505
_bMx_at_right:
-
 
506
        add     ebx, [skin_btn_minimize.left]
439
        add     ebx, [skin_btn_minimize.left]
507
        mov     [eax], bx
-
 
508
        add     eax, 2      ; x size
440
        mov     word [eax+4], bx    ; x start
509
        mov     ebx, [skin_btn_minimize.width]
441
        mov     ebx, [skin_btn_minimize.width]
510
        dec     ebx
442
        dec     ebx
511
        mov     [eax], bx
-
 
512
        add     eax, 2      ; y start
443
        mov     word [eax+6], bx    ; x size
513
        mov     ebx, [skin_btn_minimize.top]
444
        mov     ebx, [skin_btn_minimize.top]
514
        mov     [eax], bx
-
 
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
448
        mov     word [eax+10], bx   ; y size
519
;--------------------------------------
449
        bts     word [eax+12], 14
520
align 4
-
 
521
no_skin_add_button:
450
no_skin_add_button:
522
        pop     edi
451
        pop     edi
523
        popa
452
        popa
524
        ret     4
453
        ret     4
525
;------------------------------------------------------------------------------
-