Subversion Repositories Kolibri OS

Rev

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

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