Subversion Repositories Kolibri OS

Rev

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

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