Subversion Repositories Kolibri OS

Rev

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

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