Subversion Repositories Kolibri OS

Rev

Rev 2434 | Rev 2465 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2434 Rev 2439
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2007. 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: 2434 $
8
$Revision: 2439 $
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
read_skin_file:
16
read_skin_file:
16
        stdcall load_file, ebx
17
        stdcall load_file, ebx
17
        test    eax, eax
18
        test    eax, eax
18
        jz      .notfound
19
        jz      .notfound
19
        cmp     dword [eax], 'SKIN'
20
        cmp     dword [eax], 'SKIN'
20
        jnz     .noskin
21
        jnz     .noskin
21
        cmp     ebx, 32*1024
22
        cmp     ebx, 32*1024
22
        jb      @f
23
        jb      @f
23
        mov     ebx, 32*1024
24
        mov     ebx, 32*1024
-
 
25
;--------------------------------------
-
 
26
align 4
24
@@:
27
@@:
25
        lea     ecx, [ebx+3]
28
        lea     ecx, [ebx+3]
26
        shr     ecx, 2
29
        shr     ecx, 2
27
        mov     esi, eax
30
        mov     esi, eax
28
        mov     edi, skin_data
31
        mov     edi, skin_data
29
        rep movsd
32
        rep movsd
30
        stdcall kernel_free, eax
33
        stdcall kernel_free, eax
31
 
34
 
32
        call    parse_skin_data
35
        call    parse_skin_data
33
        xor     eax, eax
36
        xor     eax, eax
34
        ret
37
        ret
-
 
38
;--------------------------------------
-
 
39
align 4
35
.notfound:
40
.notfound:
36
        xor     eax, eax
41
        xor     eax, eax
37
        inc     eax
42
        inc     eax
38
        ret
43
        ret
-
 
44
;--------------------------------------
-
 
45
align 4
39
.noskin:
46
.noskin:
40
        stdcall kernel_free, eax
47
        stdcall kernel_free, eax
41
        push    2
48
        push    2
42
        pop     eax
49
        pop     eax
43
        ret
50
        ret
44
 
-
 
-
 
51
;------------------------------------------------------------------------------
45
struct  SKIN_HEADER
52
struct  SKIN_HEADER
46
        ident           dd ?
53
        ident           dd ?
47
        version         dd ?
54
        version         dd ?
48
        params          dd ?
55
        params          dd ?
49
        buttons         dd ?
56
        buttons         dd ?
50
        bitmaps         dd ?
57
        bitmaps         dd ?
51
ends
58
ends
52
 
59
 
53
struct  SKIN_PARAMS
60
struct  SKIN_PARAMS
54
        skin_height     dd ?
61
        skin_height     dd ?
55
        margin.right    dw ?
62
        margin.right    dw ?
56
        margin.left     dw ?
63
        margin.left     dw ?
57
        margin.bottom   dw ?
64
        margin.bottom   dw ?
58
        margin.top      dw ?
65
        margin.top      dw ?
59
        colors.inner    dd ?
66
        colors.inner    dd ?
60
        colors.outer    dd ?
67
        colors.outer    dd ?
61
        colors.frame    dd ?
68
        colors.frame    dd ?
62
        colors_1.inner  dd ?
69
        colors_1.inner  dd ?
63
        colors_1.outer  dd ?
70
        colors_1.outer  dd ?
64
        colors_1.frame  dd ?
71
        colors_1.frame  dd ?
65
        dtp.size        dd ?
72
        dtp.size        dd ?
66
        dtp.data        rb 40
73
        dtp.data        rb 40
67
ends
74
ends
68
 
75
 
69
struct  SKIN_BUTTONS
76
struct  SKIN_BUTTONS
70
        type    dd ?
77
        type    dd ?
71
; position
78
; position
72
        left    dw ?
79
        left    dw ?
73
        top     dw ?
80
        top     dw ?
74
; size
81
; size
75
        width   dw ?
82
        width   dw ?
76
        height  dw ?
83
        height  dw ?
77
ends
84
ends
78
 
85
 
79
struct  SKIN_BITMAPS
86
struct  SKIN_BITMAPS
80
        kind    dw ?
87
        kind    dw ?
81
        type    dw ?
88
        type    dw ?
82
        data    dd ?
89
        data    dd ?
83
ends
90
ends
-
 
91
;------------------------------------------------------------------------------
84
 
92
align 4
85
load_default_skin:
93
load_default_skin:
86
        mov     [_skinh], 22
94
        mov     [_skinh], 22
87
        mov     ebx, _skin_file_default
95
        mov     ebx, _skin_file_default
88
        call    read_skin_file
96
        call    read_skin_file
89
        ret
97
        ret
-
 
98
;------------------------------------------------------------------------------
90
 
99
align 4
91
parse_skin_data:
100
parse_skin_data:
92
        mov     ebp, skin_data
101
        mov     ebp, skin_data
93
        cmp     [ebp+SKIN_HEADER.ident], 'SKIN'
102
        cmp     [ebp+SKIN_HEADER.ident], 'SKIN'
94
        jne     .exit
103
        jne     .exit
95
 
104
 
96
        mov     edi, skin_udata
105
        mov     edi, skin_udata
97
        mov     ecx, (skin_udata.end-skin_udata)/4
106
        mov     ecx, (skin_udata.end-skin_udata)/4
98
        xor     eax, eax
107
        xor     eax, eax
99
        cld
108
        cld
100
        rep stosd
109
        rep stosd
101
 
110
 
102
        mov     ebx, [ebp+SKIN_HEADER.params]
111
        mov     ebx, [ebp+SKIN_HEADER.params]
103
        add     ebx, skin_data
112
        add     ebx, skin_data
104
        mov     eax, [ebx+SKIN_PARAMS.skin_height]
113
        mov     eax, [ebx+SKIN_PARAMS.skin_height]
105
        mov     [_skinh], eax
114
        mov     [_skinh], eax
106
        mov     eax, [ebx+SKIN_PARAMS.colors.inner]
115
        mov     eax, [ebx+SKIN_PARAMS.colors.inner]
107
        mov     [skin_active.colors.inner], eax
116
        mov     [skin_active.colors.inner], eax
108
        mov     eax, [ebx+SKIN_PARAMS.colors.outer]
117
        mov     eax, [ebx+SKIN_PARAMS.colors.outer]
109
        mov     [skin_active.colors.outer], eax
118
        mov     [skin_active.colors.outer], eax
110
        mov     eax, [ebx+SKIN_PARAMS.colors.frame]
119
        mov     eax, [ebx+SKIN_PARAMS.colors.frame]
111
        mov     [skin_active.colors.frame], eax
120
        mov     [skin_active.colors.frame], eax
112
        mov     eax, [ebx+SKIN_PARAMS.colors_1.inner]
121
        mov     eax, [ebx+SKIN_PARAMS.colors_1.inner]
113
        mov     [skin_inactive.colors.inner], eax
122
        mov     [skin_inactive.colors.inner], eax
114
        mov     eax, [ebx+SKIN_PARAMS.colors_1.outer]
123
        mov     eax, [ebx+SKIN_PARAMS.colors_1.outer]
115
        mov     [skin_inactive.colors.outer], eax
124
        mov     [skin_inactive.colors.outer], eax
116
        mov     eax, [ebx+SKIN_PARAMS.colors_1.frame]
125
        mov     eax, [ebx+SKIN_PARAMS.colors_1.frame]
117
        mov     [skin_inactive.colors.frame], eax
126
        mov     [skin_inactive.colors.frame], eax
118
        lea     esi, [ebx+SKIN_PARAMS.dtp.data]
127
        lea     esi, [ebx+SKIN_PARAMS.dtp.data]
119
        mov     edi, common_colours
128
        mov     edi, common_colours
120
        mov     ecx, [ebx+SKIN_PARAMS.dtp.size]
129
        mov     ecx, [ebx+SKIN_PARAMS.dtp.size]
121
        and     ecx, 127
130
        and     ecx, 127
122
        rep movsb
131
        rep movsb
123
        mov     eax, dword[ebx+SKIN_PARAMS.margin.right]
132
        mov     eax, dword[ebx+SKIN_PARAMS.margin.right]
124
        mov     dword[_skinmargins+0], eax
133
        mov     dword[_skinmargins+0], eax
125
        mov     eax, dword[ebx+SKIN_PARAMS.margin.bottom]
134
        mov     eax, dword[ebx+SKIN_PARAMS.margin.bottom]
126
        mov     dword[_skinmargins+4], eax
135
        mov     dword[_skinmargins+4], eax
127
 
136
 
128
        mov     ebx, [ebp+SKIN_HEADER.bitmaps]
137
        mov     ebx, [ebp+SKIN_HEADER.bitmaps]
129
        add     ebx, skin_data
138
        add     ebx, skin_data
-
 
139
;--------------------------------------
-
 
140
align 4
130
  .lp1:
141
.lp1:
131
        cmp     dword[ebx], 0
142
        cmp     dword[ebx], 0
132
        je      .end_bitmaps
143
        je      .end_bitmaps
133
        movzx   eax, [ebx+SKIN_BITMAPS.kind]
144
        movzx   eax, [ebx+SKIN_BITMAPS.kind]
134
        movzx   ecx, [ebx+SKIN_BITMAPS.type]
145
        movzx   ecx, [ebx+SKIN_BITMAPS.type]
135
        dec     eax
146
        dec     eax
136
        jnz     .not_left
147
        jnz     .not_left
137
        xor     eax, eax
148
        xor     eax, eax
138
        mov     edx, skin_active.left.data
149
        mov     edx, skin_active.left.data
139
        or      ecx, ecx
150
        or      ecx, ecx
140
        jnz     @f
151
        jnz     @f
141
        mov     edx, skin_inactive.left.data
152
        mov     edx, skin_inactive.left.data
-
 
153
;--------------------------------------
-
 
154
align 4
142
    @@:
155
@@:
143
        jmp     .next_bitmap
156
        jmp     .next_bitmap
-
 
157
;--------------------------------------
-
 
158
align 4
144
  .not_left:
159
.not_left:
145
        dec     eax
160
        dec     eax
146
        jnz     .not_oper
161
        jnz     .not_oper
147
        mov     esi, [ebx+SKIN_BITMAPS.data]
162
        mov     esi, [ebx+SKIN_BITMAPS.data]
148
        add     esi, skin_data
163
        add     esi, skin_data
149
        mov     eax, [esi+0]
164
        mov     eax, [esi+0]
150
        neg     eax
165
        neg     eax
151
        mov     edx, skin_active.oper.data
166
        mov     edx, skin_active.oper.data
152
        or      ecx, ecx
167
        or      ecx, ecx
153
        jnz     @f
168
        jnz     @f
154
        mov     edx, skin_inactive.oper.data
169
        mov     edx, skin_inactive.oper.data
-
 
170
;--------------------------------------
-
 
171
align 4
155
    @@:
172
@@:
156
        jmp     .next_bitmap
173
        jmp     .next_bitmap
-
 
174
;--------------------------------------
-
 
175
align 4
157
  .not_oper:
176
.not_oper:
158
        dec     eax
177
        dec     eax
159
        jnz     .not_base
178
        jnz     .not_base
160
        mov     eax, [skin_active.left.width]
179
        mov     eax, [skin_active.left.width]
161
        mov     edx, skin_active.base.data
180
        mov     edx, skin_active.base.data
162
        or      ecx, ecx
181
        or      ecx, ecx
163
        jnz     @f
182
        jnz     @f
164
        mov     eax, [skin_inactive.left.width]
183
        mov     eax, [skin_inactive.left.width]
165
        mov     edx, skin_inactive.base.data
184
        mov     edx, skin_inactive.base.data
-
 
185
;--------------------------------------
-
 
186
align 4
166
    @@:
187
@@:
167
        jmp     .next_bitmap
188
        jmp     .next_bitmap
-
 
189
;--------------------------------------
-
 
190
align 4
168
  .not_base:
191
.not_base:
169
        add     ebx, 8
192
        add     ebx, 8
170
        jmp     .lp1
193
        jmp     .lp1
-
 
194
;--------------------------------------
-
 
195
align 4
171
  .next_bitmap:
196
.next_bitmap:
172
        mov     ecx, [ebx+SKIN_BITMAPS.data]
197
        mov     ecx, [ebx+SKIN_BITMAPS.data]
173
        add     ecx, skin_data
198
        add     ecx, skin_data
174
        mov     [edx+4], eax
199
        mov     [edx+4], eax
175
        mov     eax, [ecx+0]
200
        mov     eax, [ecx+0]
176
        mov     [edx+8], eax
201
        mov     [edx+8], eax
177
        add     ecx, 8
202
        add     ecx, 8
178
        mov     [edx+0], ecx
203
        mov     [edx+0], ecx
179
        add     ebx, 8
204
        add     ebx, 8
180
        jmp     .lp1
205
        jmp     .lp1
-
 
206
;--------------------------------------
-
 
207
align 4
181
  .end_bitmaps:
208
.end_bitmaps:
182
 
-
 
183
        mov     ebx, [ebp+SKIN_HEADER.buttons]
209
        mov     ebx, [ebp+SKIN_HEADER.buttons]
184
        add     ebx, skin_data
210
        add     ebx, skin_data
-
 
211
;--------------------------------------
-
 
212
align 4
185
  .lp2:
213
.lp2:
186
        cmp     dword[ebx], 0
214
        cmp     dword[ebx], 0
187
        je      .end_buttons
215
        je      .end_buttons
188
        mov     eax, [ebx+SKIN_BUTTONS.type]
216
        mov     eax, [ebx+SKIN_BUTTONS.type]
189
        dec     eax
217
        dec     eax
190
        jnz     .not_close
218
        jnz     .not_close
191
        mov     edx, skin_btn_close
219
        mov     edx, skin_btn_close
192
        jmp     .next_button
220
        jmp     .next_button
-
 
221
;--------------------------------------
-
 
222
align 4
193
  .not_close:
223
.not_close:
194
        dec     eax
224
        dec     eax
195
        jnz     .not_minimize
225
        jnz     .not_minimize
196
        mov     edx, skin_btn_minimize
226
        mov     edx, skin_btn_minimize
197
        jmp     .next_button
227
        jmp     .next_button
-
 
228
;--------------------------------------
-
 
229
align 4
198
  .not_minimize:
230
.not_minimize:
199
        add     ebx, 12
231
        add     ebx, 12
200
        jmp     .lp2
232
        jmp     .lp2
-
 
233
;--------------------------------------
-
 
234
align 4
201
  .next_button:
235
.next_button:
202
        movsx   eax, [ebx+SKIN_BUTTONS.left]
236
        movsx   eax, [ebx+SKIN_BUTTONS.left]
203
        mov     [edx+SKIN_BUTTON.left], eax
237
        mov     [edx+SKIN_BUTTON.left], eax
204
        movsx   eax, [ebx+SKIN_BUTTONS.top]
238
        movsx   eax, [ebx+SKIN_BUTTONS.top]
205
        mov     [edx+SKIN_BUTTON.top], eax
239
        mov     [edx+SKIN_BUTTON.top], eax
206
        movsx   eax, [ebx+SKIN_BUTTONS.width]
240
        movsx   eax, [ebx+SKIN_BUTTONS.width]
207
        mov     [edx+SKIN_BUTTON.width], eax
241
        mov     [edx+SKIN_BUTTON.width], eax
208
        movsx   eax, [ebx+SKIN_BUTTONS.height]
242
        movsx   eax, [ebx+SKIN_BUTTONS.height]
209
        mov     [edx+SKIN_BUTTON.height], eax
243
        mov     [edx+SKIN_BUTTON.height], eax
210
        add     ebx, 12
244
        add     ebx, 12
211
        jmp     .lp2
245
        jmp     .lp2
-
 
246
;--------------------------------------
-
 
247
align 4
212
  .end_buttons:
248
.end_buttons:
213
 
-
 
214
  .exit:
249
.exit:
215
        ret
250
        ret
216
 
-
 
217
sys_putimage_with_check:
-
 
218
        or      ebx, ebx
-
 
219
        jz      @f
-
 
220
        call    sys_putimage.forced
251
;------------------------------------------------------------------------------
221
    @@:
252
align 4
222
        ret
-
 
223
 
-
 
224
drawwindow_IV_caption:
253
drawwindow_IV_caption:
225
 
254
 
226
        mov     ebp, skin_active
255
        mov     ebp, skin_active
227
        or      al, al
256
        or      al, al
228
        jnz     @f
257
        jnz     @f
229
        mov     ebp, skin_inactive
258
        mov     ebp, skin_inactive
-
 
259
;--------------------------------------
-
 
260
align 4
230
    @@:
261
@@:
231
 
-
 
232
        mov     esi, [esp+4]
262
        mov     esi, [esp+4]
233
        mov     eax, [esi+WDATA.box.width]   ; window width
263
        mov     eax, [esi+WDATA.box.width]   ; window width
234
        mov     edx, [ebp+SKIN_DATA.left.left]
264
        mov     edx, [ebp+SKIN_DATA.left.left]
235
        shl     edx, 16
265
        shl     edx, 16
236
        mov     ecx, [ebp+SKIN_DATA.left.width]
266
        mov     ecx, [ebp+SKIN_DATA.left.width]
237
        shl     ecx, 16
267
        shl     ecx, 16
238
        add     ecx, [_skinh]
268
        add     ecx, [_skinh]
239
 
269
 
240
        mov     ebx, [ebp+SKIN_DATA.left.data]
270
        mov     ebx, [ebp+SKIN_DATA.left.data]
-
 
271
        or      ebx, ebx
-
 
272
        jz      @f
241
        call    sys_putimage_with_check
273
        call    sys_putimage.forced
-
 
274
;--------------------------------------
-
 
275
align 4
242
 
276
@@:
243
        mov     esi, [esp+4]
277
        mov     esi, [esp+4]
244
        mov     eax, [esi+WDATA.box.width]
278
        mov     eax, [esi+WDATA.box.width]
245
        sub     eax, [ebp+SKIN_DATA.left.width]
279
        sub     eax, [ebp+SKIN_DATA.left.width]
246
        sub     eax, [ebp+SKIN_DATA.oper.width]
280
        sub     eax, [ebp+SKIN_DATA.oper.width]
247
        cmp     eax, [ebp+SKIN_DATA.base.left]
281
        cmp     eax, [ebp+SKIN_DATA.base.left]
248
        jng     .non_base
282
        jng     .non_base
249
        xor     edx, edx
283
        xor     edx, edx
250
        mov     ecx, [ebp+SKIN_DATA.base.width]
284
        mov     ecx, [ebp+SKIN_DATA.base.width]
251
        jecxz   .non_base
285
        jecxz   .non_base
252
        div     ecx
286
        div     ecx
253
 
287
 
254
        inc     eax
288
        inc     eax
255
 
289
 
256
        mov     ebx, [ebp+SKIN_DATA.base.data]
290
        mov     ebx, [ebp+SKIN_DATA.base.data]
257
        mov     ecx, [ebp+SKIN_DATA.base.width]
291
        mov     ecx, [ebp+SKIN_DATA.base.width]
258
        shl     ecx, 16
292
        shl     ecx, 16
259
        add     ecx, [_skinh]
293
        add     ecx, [_skinh]
260
        mov     edx, [ebp+SKIN_DATA.base.left]
294
        mov     edx, [ebp+SKIN_DATA.base.left]
261
        sub     edx, [ebp+SKIN_DATA.base.width]
295
        sub     edx, [ebp+SKIN_DATA.base.width]
262
        shl     edx, 16
296
        shl     edx, 16
-
 
297
;--------------------------------------
-
 
298
align 4
263
  .baseskinloop:
299
.baseskinloop:
264
        shr     edx, 16
300
        shr     edx, 16
265
        add     edx, [ebp+SKIN_DATA.base.width]
301
        add     edx, [ebp+SKIN_DATA.base.width]
266
        shl     edx, 16
302
        shl     edx, 16
267
 
303
 
268
        push    eax ebx ecx edx
304
        push    eax ebx ecx edx
-
 
305
 
-
 
306
        or      ebx, ebx
-
 
307
        jz      @f
269
        call    sys_putimage_with_check
308
        call    sys_putimage.forced
-
 
309
;--------------------------------------
-
 
310
align 4
-
 
311
@@:
270
        pop     edx ecx ebx eax
312
        pop     edx ecx ebx eax
271
 
313
 
272
        dec     eax
314
        dec     eax
273
        jnz     .baseskinloop
315
        jnz     .baseskinloop
-
 
316
;--------------------------------------
-
 
317
align 4
274
  .non_base:
318
.non_base:
275
 
319
 
276
        mov     esi, [esp+4]
320
        mov     esi, [esp+4]
277
        mov     edx, [esi+WDATA.box.width]
321
        mov     edx, [esi+WDATA.box.width]
278
        sub     edx, [ebp+SKIN_DATA.oper.width]
322
        sub     edx, [ebp+SKIN_DATA.oper.width]
279
        inc     edx
323
        inc     edx
280
        shl     edx, 16
324
        shl     edx, 16
281
        mov     ebx, [ebp+SKIN_DATA.oper.data]
325
        mov     ebx, [ebp+SKIN_DATA.oper.data]
282
 
326
 
283
        mov     ecx, [ebp+SKIN_DATA.oper.width]
327
        mov     ecx, [ebp+SKIN_DATA.oper.width]
284
        shl     ecx, 16
328
        shl     ecx, 16
285
        add     ecx, [_skinh]
329
        add     ecx, [_skinh]
286
        call    sys_putimage_with_check
-
 
-
 
330
 
-
 
331
        or      ebx, ebx
-
 
332
        jz      @f
-
 
333
        call    sys_putimage.forced
-
 
334
;--------------------------------------
-
 
335
align 4
287
 
336
@@:
288
        ret
-
 
289
 
337
        ret
290
;//mike.dld, 2006-08-02 ]
-
 
291
 
338
;------------------------------------------------------------------------------
292
 
339
align 4
293
drawwindow_IV:
340
drawwindow_IV:
294
;param1 - aw_yes
-
 
295
 
341
;param1 - aw_yes
296
        pusha
342
        pusha
297
 
343
 
298
        push    edx
344
        push    edx
299
 
345
 
300
        mov     edi, edx
346
        mov     edi, edx
301
 
347
 
302
        mov     ebp, skin_active
348
        mov     ebp, skin_active
303
        cmp     byte [esp+32+4+4], 0
349
        cmp     byte [esp+32+4+4], 0
304
        jne     @f
350
        jne     @f
305
        mov     ebp, skin_inactive
351
        mov     ebp, skin_inactive
-
 
352
;--------------------------------------
-
 
353
align 4
306
     @@:
354
@@:
307
 
-
 
308
        mov     eax, [edi+WDATA.box.left]
355
        mov     eax, [edi+WDATA.box.left]
309
        shl     eax, 16
356
        shl     eax, 16
310
        mov     ax, word [edi+WDATA.box.left]
357
        mov     ax, word [edi+WDATA.box.left]
311
        add     ax, word [edi+WDATA.box.width]
358
        add     ax, word [edi+WDATA.box.width]
312
        mov     ebx, [edi+WDATA.box.top]
359
        mov     ebx, [edi+WDATA.box.top]
313
        shl     ebx, 16
360
        shl     ebx, 16
314
        mov     bx, word [edi+WDATA.box.top]
361
        mov     bx, word [edi+WDATA.box.top]
315
        add     bx, word [edi+WDATA.box.height]
362
        add     bx, word [edi+WDATA.box.height]
316
;        mov   esi,[edi+24]
-
 
317
;        shr   esi,1
-
 
318
;        and   esi,0x007f7f7f
-
 
319
        mov     esi, [ebp+SKIN_DATA.colors.outer]
363
        mov     esi, [ebp+SKIN_DATA.colors.outer]
320
        or      esi, 1 shl 25 ; 0x02000000 used for draw_rectangle without top line
364
        or      esi, 1 shl 25 ; 0x02000000 used for draw_rectangle without top line
321
        ror     ebx, 16
365
        ror     ebx, 16
322
        add     ebx, [_skinh]
366
        add     ebx, [_skinh]
323
        sub     bx, 1
367
        sub     bx, 1
324
        rol     ebx, 16
368
        rol     ebx, 16
325
        call    draw_rectangle
369
        call    draw_rectangle
326
        mov     ecx, 3
370
        mov     ecx, 3
-
 
371
;--------------------------------------
-
 
372
align 4
327
      _dw3l:
373
_dw3l:
328
        add     eax, 1*65536-1
374
        add     eax, 1*65536-1
329
        add     ebx, 0*65536-1
375
        add     ebx, 0*65536-1
330
        test    ax, ax
376
        test    ax, ax
331
        js      no_skin_add_button
377
        js      no_skin_add_button
332
        test    bx, bx
378
        test    bx, bx
333
        js      no_skin_add_button
379
        js      no_skin_add_button
334
        mov     esi, [ebp+SKIN_DATA.colors.frame];[edi+24]
380
        mov     esi, [ebp+SKIN_DATA.colors.frame];[edi+24]
335
        or      esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
381
        or      esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
336
        call    draw_rectangle
382
        call    draw_rectangle
337
        dec     ecx
383
        dec     ecx
338
        jnz     _dw3l
384
        jnz     _dw3l
339
        mov     esi, [ebp+SKIN_DATA.colors.inner]
385
        mov     esi, [ebp+SKIN_DATA.colors.inner]
340
        or      esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
386
        or      esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
341
        add     eax, 1*65536-1
387
        add     eax, 1*65536-1
342
        add     ebx, 0*65536-1
388
        add     ebx, 0*65536-1
343
        test    ax, ax
389
        test    ax, ax
344
        js      no_skin_add_button
390
        js      no_skin_add_button
345
        test    bx, bx
391
        test    bx, bx
346
        js      no_skin_add_button
392
        js      no_skin_add_button
347
        call    draw_rectangle
393
        call    draw_rectangle
348
 
394
 
349
        cmp     dword[skin_data], 'SKIN'
395
        cmp     dword[skin_data], 'SKIN'
350
        je      @f
396
        je      @f
351
        xor     eax, eax
397
        xor     eax, eax
352
        xor     ebx, ebx
398
        xor     ebx, ebx
353
        mov     esi, [esp]
399
        mov     esi, [esp]
354
        mov     ecx, [esi+WDATA.box.width]
400
        mov     ecx, [esi+WDATA.box.width]
355
        inc     ecx
401
        inc     ecx
356
        mov     edx, [_skinh]
402
        mov     edx, [_skinh]
357
        mov     edi, [common_colours+4]; standard grab color
403
        mov     edi, [common_colours+4]; standard grab color
358
        call    [drawbar]
404
        call    [drawbar]
359
        jmp     draw_clientbar
405
        jmp     draw_clientbar
-
 
406
;--------------------------------------
-
 
407
align 4
360
    @@:
408
@@:
361
 
-
 
362
        mov     al, [esp+32+4+4]
409
        mov     al, [esp+32+4+4]
363
        call    drawwindow_IV_caption
410
        call    drawwindow_IV_caption
-
 
411
;--------------------------------------
364
 
412
align 4
365
    draw_clientbar:
413
draw_clientbar:
366
 
-
 
367
        mov     esi, [esp]
414
        mov     esi, [esp]
368
 
415
 
369
        mov     edx, [esi+WDATA.box.top]                    ; WORK AREA
416
        mov     edx, [esi+WDATA.box.top]                    ; WORK AREA
370
        add     edx, 21+5
417
        add     edx, 21+5
371
        mov     ebx, [esi+WDATA.box.top]
418
        mov     ebx, [esi+WDATA.box.top]
372
        add     ebx, [esi+WDATA.box.height]
419
        add     ebx, [esi+WDATA.box.height]
373
        cmp     edx, ebx
420
        cmp     edx, ebx
374
        jg      _noinside2
421
        jg      _noinside2
375
        mov     eax, 5
422
        mov     eax, 5
376
        mov     ebx, [_skinh]
423
        mov     ebx, [_skinh]
377
        mov     ecx, [esi+WDATA.box.width]
424
        mov     ecx, [esi+WDATA.box.width]
378
        mov     edx, [esi+WDATA.box.height]
425
        mov     edx, [esi+WDATA.box.height]
379
        sub     ecx, 4
426
        sub     ecx, 4
380
        sub     edx, 4
427
        sub     edx, 4
381
        mov     edi, [esi+WDATA.cl_workarea]
428
        mov     edi, [esi+WDATA.cl_workarea]
382
        test    edi, 0x40000000
429
        test    edi, 0x40000000
383
        jnz     _noinside2
430
        jnz     _noinside2
384
        call    [drawbar]
431
        call    [drawbar]
-
 
432
;--------------------------------------
-
 
433
align 4
385
      _noinside2:
434
_noinside2:
386
 
-
 
387
        cmp     dword[skin_data], 'SKIN'
435
        cmp     dword[skin_data], 'SKIN'
388
        jne     no_skin_add_button
436
        jne     no_skin_add_button
389
 
-
 
390
;* close button
437
;* close button
391
        mov     edi, [BTN_ADDR]
438
        mov     edi, [BTN_ADDR]
392
        movzx   eax, word [edi]
439
        movzx   eax, word [edi]
393
        cmp     eax, 1000
440
        cmp     eax, 1000
394
        jge     no_skin_add_button
441
        jge     no_skin_add_button
395
        inc     eax
442
        inc     eax
396
        mov     [edi], ax
443
        mov     [edi], ax
397
 
444
 
398
        shl     eax, 4
445
        shl     eax, 4
399
        add     eax, edi
446
        add     eax, edi
400
 
447
 
401
        mov     bx, [CURRENT_TASK]
448
        mov     bx, [CURRENT_TASK]
402
        mov     [eax], bx
449
        mov     [eax], bx
403
 
450
 
404
        add     eax, 2      ; save button id number
451
        add     eax, 2      ; save button id number
405
        mov     bx, 1
452
        mov     bx, 1
406
        mov     [eax], bx
453
        mov     [eax], bx
407
        add     eax, 2      ; x start
454
        add     eax, 2      ; x start
408
        xor     ebx, ebx
455
        xor     ebx, ebx
409
        cmp     [skin_btn_close.left], 0
456
        cmp     [skin_btn_close.left], 0
410
        jge     _bCx_at_right
457
        jge     _bCx_at_right
411
        mov     ebx, [esp]
458
        mov     ebx, [esp]
412
        mov     ebx, [ebx+WDATA.box.width]
459
        mov     ebx, [ebx+WDATA.box.width]
413
        inc     ebx
460
        inc     ebx
-
 
461
;--------------------------------------
-
 
462
align 4
414
      _bCx_at_right:
463
_bCx_at_right:
415
        add     ebx, [skin_btn_close.left]
464
        add     ebx, [skin_btn_close.left]
416
        mov     [eax], bx
465
        mov     [eax], bx
417
        add     eax, 2      ; x size
466
        add     eax, 2      ; x size
418
        mov     ebx, [skin_btn_close.width]
467
        mov     ebx, [skin_btn_close.width]
419
        dec     ebx
468
        dec     ebx
420
        mov     [eax], bx
469
        mov     [eax], bx
421
        add     eax, 2      ; y start
470
        add     eax, 2      ; y start
422
        mov     ebx, [skin_btn_close.top]
471
        mov     ebx, [skin_btn_close.top]
423
        mov     [eax], bx
472
        mov     [eax], bx
424
        add     eax, 2      ; y size
473
        add     eax, 2      ; y size
425
        mov     ebx, [skin_btn_close.height]
474
        mov     ebx, [skin_btn_close.height]
426
        dec     ebx
475
        dec     ebx
427
        mov     [eax], bx
476
        mov     [eax], bx
428
 
-
 
429
;* minimize button
477
;* minimize button
430
        mov     edi, [BTN_ADDR]
478
        mov     edi, [BTN_ADDR]
431
        movzx   eax, word [edi]
479
        movzx   eax, word [edi]
432
        cmp     eax, 1000
480
        cmp     eax, 1000
433
        jge     no_skin_add_button
481
        jge     no_skin_add_button
434
        inc     eax
482
        inc     eax
435
        mov     [edi], ax
483
        mov     [edi], ax
436
 
484
 
437
        shl     eax, 4
485
        shl     eax, 4
438
        add     eax, edi
486
        add     eax, edi
439
 
487
 
440
        mov     bx, [CURRENT_TASK]
488
        mov     bx, [CURRENT_TASK]
441
        mov     [eax], bx
489
        mov     [eax], bx
442
 
490
 
443
        add     eax, 2      ; save button id number
491
        add     eax, 2      ; save button id number
444
        mov     bx, 65535;999
492
        mov     bx, 65535;999
445
        mov     [eax], bx
493
        mov     [eax], bx
446
        add     eax, 2      ; x start
494
        add     eax, 2      ; x start
447
        xor     ebx, ebx
495
        xor     ebx, ebx
448
        cmp     [skin_btn_minimize.left], 0
496
        cmp     [skin_btn_minimize.left], 0
449
        jge     _bMx_at_right
497
        jge     _bMx_at_right
450
        mov     ebx, [esp]
498
        mov     ebx, [esp]
451
        mov     ebx, [ebx+WDATA.box.width]
499
        mov     ebx, [ebx+WDATA.box.width]
452
        inc     ebx
500
        inc     ebx
-
 
501
;--------------------------------------
-
 
502
align 4
453
      _bMx_at_right:
503
_bMx_at_right:
454
        add     ebx, [skin_btn_minimize.left]
504
        add     ebx, [skin_btn_minimize.left]
455
        mov     [eax], bx
505
        mov     [eax], bx
456
        add     eax, 2      ; x size
506
        add     eax, 2      ; x size
457
        mov     ebx, [skin_btn_minimize.width]
507
        mov     ebx, [skin_btn_minimize.width]
458
        dec     ebx
508
        dec     ebx
459
        mov     [eax], bx
509
        mov     [eax], bx
460
        add     eax, 2      ; y start
510
        add     eax, 2      ; y start
461
        mov     ebx, [skin_btn_minimize.top]
511
        mov     ebx, [skin_btn_minimize.top]
462
        mov     [eax], bx
512
        mov     [eax], bx
463
        add     eax, 2      ; y size
513
        add     eax, 2      ; y size
464
        mov     ebx, [skin_btn_minimize.height]
514
        mov     ebx, [skin_btn_minimize.height]
465
        dec     ebx
515
        dec     ebx
466
        mov     [eax], bx
516
        mov     [eax], bx
-
 
517
;--------------------------------------
467
 
518
align 4
468
      no_skin_add_button:
519
no_skin_add_button:
469
        pop     edi
520
        pop     edi
470
        popa
521
        popa
471
 
-
 
472
        ret     4
522
        ret     4
473
-
 
-
 
523
;------------------------------------------------------------------------------