Subversion Repositories Kolibri OS

Rev

Rev 35 | Rev 52 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35 Rev 49
Line 1... Line -...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 
2
;;                                          ;;
-
 
3
;;   WINDOW SKIN for MenuetOS               ;;
-
 
4
;;                                          ;;
-
 
5
;;   entryway@bkg.lt                        ;;
-
 
6
;;                                          ;;
-
 
7
;;   Bugfixes & upgrades by                 ;;
-
 
8
;;             Samuel Rodriguez Perez       ;;
-
 
9
;;             Xeoda@ciberirmandade.org     ;;
-
 
10
;;                                          ;;
-
 
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 
12
 
-
 
13
 
-
 
14
 
-
 
15
include "skindata.inc"
-
 
16
 
1
include "skindata.inc"
Line 17... Line -...
17
virtual at 0
-
 
18
  bmp_header:
-
 
19
    .type       rw  1  ; "BM" signature
-
 
20
    .filesize   rd  1  ; size of the file
-
 
21
    .reserved   rd  1  ; zero
-
 
22
    .offbits    rd  1  ; pointer to image data
-
 
23
    ;----------------
-
 
24
    .headsize   rd  1  ; usually 40 bytes for image header
-
 
25
    .width      rd  1
-
 
26
    .height     rd  1
-
 
27
    .planes     rw  1  ; usually 1
-
 
28
    .bitcount   rw  1  ; currently 24 bits/pixel (0x18)
-
 
29
    .compress   rd  1  ; zero
-
 
30
    .sizeimage  rd  1  ; x*y*(bitcount/8)
-
 
31
    .unused     rd  4  ; these bits aren't used by MeOS
-
 
32
  bmp_data:
-
 
33
end virtual
-
 
34
 
-
 
35
virtual at 0x778000
2
 
36
  _bmp_bpl dd ?        ; bytes per line
-
 
37
  _bmp_dpl dd ?        ; dwords per line
-
 
38
  _bmp_zb  dd ?        ; bytes filled by zeroes at the end of a scanline
-
 
39
 align 32
-
 
40
  raw_data:
-
 
41
end virtual
-
 
42
 
-
 
43
bmp2raw:
-
 
44
; esi = to bmp data (source)
-
 
45
; edi = to raw data (destination)
-
 
46
    cmp   [esi+bmp_header.type],'BM'     ; check if bmp file is really loaded
-
 
47
    jne   .finish
-
 
48
    mov   edx,esi
-
 
49
 
-
 
50
    mov   eax,[edx+bmp_header.width]
-
 
51
    imul  eax,3
-
 
52
    push  eax
-
 
53
    test  eax,11b
-
 
54
    jz    @f
-
 
55
    add   eax,4
-
 
56
  @@:
-
 
57
    shr   eax,2
-
 
58
    mov   [_bmp_dpl],eax
-
 
59
    shl   eax,2
-
 
60
    mov   [_bmp_bpl],eax
-
 
61
    pop   ebx
-
 
62
    sub   eax,ebx
-
 
63
    mov   [_bmp_zb],eax
-
 
64
 
-
 
65
    add   esi,bmp_data
-
 
66
    mov   eax,[_bmp_bpl]
-
 
67
    imul  eax,[edx+bmp_header.height]
-
 
68
    add   esi,eax
-
 
69
    mov   ebx,[edx+bmp_header.height]    ; ebx = y
-
 
70
    cld
-
 
71
    .y_begin:
-
 
72
       sub   esi,[_bmp_bpl]
-
 
73
       push  esi
-
 
74
       mov   ecx,[_bmp_dpl]
-
 
75
       rep   movsd
-
 
76
       pop   esi
-
 
77
       sub   edi,[_bmp_zb]
-
 
78
    dec   ebx
-
 
79
    jne   .y_begin
-
 
Line 80... Line -...
80
 
-
 
81
.finish:
-
 
82
    ret
-
 
83
 
-
 
84
 
-
 
85
; BMP support by Ivan Poddubny
-
 
86
; 1) load LEFT.BMP
-
 
87
;   a) _skinleftw = bmp_width
3
skin_data = 0x00778000
88
;   b) _skinleft = 0
-
 
89
;   c) _refleft = 0x778000
-
 
90
;   d) convert
-
 
91
; 2) load BASE.BMP
-
 
92
;   a) _skinbasew = bmp_width
-
 
93
;   b) _skinbase = _skinleftw
-
 
94
;   c) _refbase = _refleft+sizeof(left_raw_converted)
-
 
95
;   d) convert
-
 
96
; 3) load OPER.BMP
-
 
97
;   a) _skinoper = minus width from bmp file
-
 
98
;   b) _skinoperw = width from bmp file
-
 
99
;   c) _refoper = _refbase+sizeof(oper_raw_converted)
-
 
100
;   d) convert
4
 
101
; 4) set height
-
 
102
 
-
 
103
load_bmp_file:
5
load_skin_file:
104
; eax = pointer to filename
6
; eax = filename
105
    mov   ebx, 1
7
; edx = destination
106
    or    ecx, -1
-
 
107
    mov   edx, 0x90000
8
    mov   ebx,1
108
    mov   esi, 12
9
    or    ecx,-1
109
    call  fileread
10
    mov   esi,12
Line -... Line 11...
-
 
11
    call  fileread
-
 
12
    ret
-
 
13
 
-
 
14
struct SKIN_HEADER
-
 
15
  .ident   dd ?
-
 
16
  .version dd ?
-
 
17
  .params  dd ?
-
 
18
  .buttons dd ?
-
 
19
  .bitmaps dd ?
-
 
20
ends
-
 
21
 
-
 
22
struct SKIN_PARAMS
-
 
23
  .skin_height    dd ?
-
 
24
  .margin.right   dw ?
-
 
25
  .margin.left    dw ?
-
 
26
  .margin.bottom  dw ?
-
 
27
  .margin.top     dw ?
-
 
28
  .colors.inner   dd ?
-
 
29
  .colors.outer   dd ?
-
 
30
  .colors.frame   dd ?
-
 
31
  .colors_1.inner dd ?
-
 
32
  .colors_1.outer dd ?
-
 
33
  .colors_1.frame dd ?
-
 
34
  .dtp.size       dd ?
-
 
35
  .dtp.data       db 40 dup (?)
-
 
36
ends
-
 
37
 
-
 
38
struct SKIN_BUTTONS
-
 
39
  .type     dd ?
-
 
40
  .pos:
-
 
41
    .left   dw ?
-
 
42
    .top    dw ?
-
 
43
  .size:
-
 
44
    .width  dw ?
-
 
45
    .height dw ?
-
 
46
ends
-
 
47
 
-
 
48
struct SKIN_BITMAPS
-
 
49
  .kind  dw ?
Line 110... Line 50...
110
    ret
50
  .type  dw ?
111
 
51
  .data  dd ?
112
 
52
ends
113
load_default_skin:
-
 
114
    pushad
-
 
115
    mov   eax, _fileleft
-
 
116
    call  load_bmp_file
-
 
117
    mov   eax, [0x90000+bmp_header.width]
53
 
118
    mov   [_skinleftw], eax
-
 
119
    mov   [_skinleft], 0
-
 
120
    mov   edi, raw_data
-
 
121
    mov   [_refleft], edi
-
 
122
    mov   esi, 0x90000
-
 
123
    call  bmp2raw
-
 
124
    mov   eax, [_bmp_bpl]
-
 
125
    imul  eax, [0x90000+bmp_header.height]
-
 
126
    push  eax
54
load_skin:
127
 
-
 
128
    mov   eax, _filebase
-
 
129
    call  load_bmp_file
55
        pushad
130
    mov   eax, [0x90000+bmp_header.width]
-
 
131
    mov   [_skinbasew], eax
-
 
132
    mov   eax, [_skinleftw]
-
 
133
    mov   [_skinbase], eax
-
 
134
    pop   eax
-
 
135
    add   eax, [_refleft]
-
 
136
    ; align to 32-byte boundary
-
 
137
    test  eax, 11111b
-
 
138
    jz    @f
-
 
139
    shr   eax, 5
-
 
140
    inc   eax
-
 
141
    shl   eax, 5
-
 
142
  @@:
-
 
143
    ; save base address
-
 
144
    mov   [_refbase], eax
-
 
145
    ; convert
-
 
146
    mov   edi, eax
-
 
147
    mov   esi, 0x90000
-
 
148
    call  bmp2raw
-
 
149
    mov   eax, [_bmp_bpl]
-
 
150
    imul  eax, [0x90000+bmp_header.height]
-
 
151
    push  eax
-
 
152
 
-
 
153
    mov   eax, _fileoper
-
 
154
    call  load_bmp_file
-
 
155
    mov   eax, [0x90000+bmp_header.width]
-
 
156
    mov   [_skinoperw], eax
-
 
157
    neg   eax
-
 
158
    mov   [_skinoper], eax
-
 
159
    pop   eax
-
 
160
    add   eax, [_refbase]
-
 
161
    ; align to 32-byte boundary
-
 
162
    test  eax, 11111b
-
 
163
    jz    @f
-
 
164
    shr   eax, 5
-
 
165
    inc   eax
-
 
166
    shl   eax, 5
-
 
167
  @@:
-
 
168
    mov   [_refoper], eax
-
 
169
    mov   edi, eax
-
 
170
    mov   esi, 0x90000
-
 
171
    call  bmp2raw
56
        mov     eax,_skin_file
172
    mov   eax, [0x90000+bmp_header.height]
-
 
173
    mov   [_skinh], eax
57
        mov     edx,skin_data
Line 174... Line 58...
174
    popad
58
        call    load_skin_file
175
 
-
 
176
    ret
-
 
177
 
-
 
178
load_default_skin_1:          
-
 
179
    pushad
-
 
180
    mov   eax, _fileleft_1
-
 
181
    call  load_bmp_file
59
        call    parse_skin_data
182
    mov   eax, [0x90000+bmp_header.width]
-
 
183
    mov   [_skinleftw], eax
-
 
184
    mov   [_skinleft_1], 0
-
 
185
    mov   edi, raw_data+1000h
-
 
186
    mov   [_refleft_1], edi
-
 
187
    mov   esi, 0x90000
-
 
188
    call  bmp2raw
-
 
189
    mov   eax, [_bmp_bpl]
-
 
190
    imul  eax, [0x90000+bmp_header.height]
-
 
191
    push  eax
60
        popad
192
 
-
 
193
    mov   eax, _filebase_1
-
 
194
    call  load_bmp_file
-
 
195
    mov   eax, [0x90000+bmp_header.width]
-
 
196
    mov   [_skinbasew], eax
-
 
197
    mov   eax, [_skinleftw]
-
 
198
    mov   [_skinbase], eax
-
 
199
    pop   eax
-
 
200
    add   eax, [_refleft_1]
-
 
201
    ; align to 32-byte boundary
-
 
202
    test  eax, 11111b
-
 
203
    jz    @f
-
 
204
    shr   eax, 5
-
 
205
    inc   eax
-
 
206
    shl   eax, 5
-
 
207
  @@:
61
        ret
208
    ; save base address
-
 
209
    mov   [_refbase_1], eax
-
 
210
    ; convert
-
 
211
    mov   edi, eax
-
 
212
    mov   esi, 0x90000
-
 
213
    call  bmp2raw
62
 
214
    mov   eax, [_bmp_bpl]
-
 
215
    imul  eax, [0x90000+bmp_header.height]
-
 
216
    push  eax
63
parse_skin_data:
217
 
-
 
218
    mov   eax, _fileoper_1
-
 
219
    call  load_bmp_file
-
 
220
    mov   eax, [0x90000+bmp_header.width]
-
 
221
    mov   [_skinoperw], eax
64
        mov     ebp,skin_data
222
    neg   eax
-
 
223
    mov   [_skinoper], eax
-
 
224
    pop   eax
-
 
225
    add   eax, [_refbase_1]
-
 
226
    ; align to 32-byte boundary
-
 
227
    test  eax, 11111b
-
 
228
    jz    @f
-
 
229
    shr   eax, 5
-
 
230
    inc   eax
-
 
231
    shl   eax, 5
-
 
232
  @@:
-
 
233
    mov   [_refoper_1], eax
65
        cmp     [ebp+SKIN_HEADER.ident],'SKIN'
234
    mov   edi, eax
66
        jne     .exit
-
 
67
 
-
 
68
        mov     ebx,[ebp+SKIN_HEADER.params]
-
 
69
        add     ebx,skin_data
-
 
70
        mov     eax,[ebx+SKIN_PARAMS.skin_height]
-
 
71
        mov     [_skinh],eax
-
 
72
        mov     eax,[ebx+SKIN_PARAMS.colors.inner]
-
 
73
        mov     [skin_active.colors.inner],eax
-
 
74
        mov     eax,[ebx+SKIN_PARAMS.colors.outer]
-
 
75
        mov     [skin_active.colors.outer],eax
-
 
76
        mov     eax,[ebx+SKIN_PARAMS.colors.frame]
-
 
77
        mov     [skin_active.colors.frame],eax
-
 
78
        mov     eax,[ebx+SKIN_PARAMS.colors_1.inner]
-
 
79
        mov     [skin_inactive.colors.inner],eax
-
 
80
        mov     eax,[ebx+SKIN_PARAMS.colors_1.outer]
-
 
81
        mov     [skin_inactive.colors.outer],eax
-
 
82
        mov     eax,[ebx+SKIN_PARAMS.colors_1.frame]
235
    mov   esi, 0x90000
83
        mov     [skin_inactive.colors.frame],eax
-
 
84
        lea     esi,[ebx+SKIN_PARAMS.dtp.data]
-
 
85
        mov     edi,common_colours
-
 
86
        mov     ecx,[ebx+SKIN_PARAMS.dtp.size]
-
 
87
        and     ecx,127
-
 
88
        cld
-
 
89
        rep     movsb
-
 
90
        mov     eax,dword[ebx+SKIN_PARAMS.margin.left]
-
 
91
        mov     dword[_skinmargins+0],eax
-
 
92
        mov     eax,dword[ebx+SKIN_PARAMS.margin.top]
-
 
93
        mov     dword[_skinmargins+4],eax
-
 
94
 
-
 
95
        mov     ebx,[ebp+SKIN_HEADER.bitmaps]
-
 
96
        add     ebx,skin_data
-
 
97
  .lp1: cmp     dword[ebx],0
-
 
98
        je      .end_bitmaps
-
 
99
        movzx   eax,[ebx+SKIN_BITMAPS.kind]
-
 
100
        movzx   ecx,[ebx+SKIN_BITMAPS.type]
-
 
101
        dec     eax
-
 
102
        jnz     .not_left
-
 
103
        xor     eax,eax
-
 
104
        mov     edx,skin_active.left.data
-
 
105
        or      ecx,ecx
-
 
106
        jnz     @f
-
 
107
        mov     edx,skin_inactive.left.data
-
 
108
    @@: jmp     .next_bitmap
-
 
109
  .not_left:
-
 
110
        dec     eax
-
 
111
        jnz     .not_oper
-
 
112
        mov     esi,[ebx+SKIN_BITMAPS.data]
-
 
113
        add     esi,skin_data
-
 
114
        mov     eax,[esi+0]
-
 
115
        neg     eax
-
 
116
        mov     edx,skin_active.oper.data
-
 
117
        or      ecx,ecx
-
 
118
        jnz     @f
-
 
119
        mov     edx,skin_inactive.oper.data
-
 
120
    @@: jmp     .next_bitmap
-
 
121
  .not_oper:
-
 
122
        dec     eax
-
 
123
        jnz     .not_base
-
 
124
        mov     eax,[skin_active.left.width]
-
 
125
        mov     edx,skin_active.base.data
-
 
126
        or      ecx,ecx
-
 
127
        jnz     @f
-
 
128
        mov     eax,[skin_inactive.left.width]
-
 
129
        mov     edx,skin_inactive.base.data
-
 
130
    @@: jmp     .next_bitmap
-
 
131
  .not_base:
-
 
132
        add     ebx,8
-
 
133
        jmp     .lp1
-
 
134
  .next_bitmap:
-
 
135
        mov     ecx,[ebx+SKIN_BITMAPS.data]
-
 
136
        add     ecx,skin_data
-
 
137
        mov     [edx+4],eax
-
 
138
        mov     eax,[ecx+0]
-
 
139
        mov     [edx+8],eax
-
 
140
        add     ecx,8
-
 
141
        mov     [edx+0],ecx
-
 
142
        add     ebx,8
-
 
143
        jmp     .lp1
-
 
144
  .end_bitmaps:
-
 
145
 
-
 
146
        mov     ebx,[ebp+SKIN_HEADER.buttons]
-
 
147
        add     ebx,skin_data
-
 
148
  .lp2: cmp     dword[ebx],0
-
 
149
        je      .end_buttons
-
 
150
        mov     eax,[ebx+SKIN_BUTTONS.type]
-
 
151
        dec     eax
-
 
152
        jnz     .not_close
-
 
153
        mov     edx,skin_btn_close
-
 
154
        jmp     .next_button
-
 
155
  .not_close:
-
 
156
        dec     eax
-
 
157
        jnz     .not_minimize
-
 
158
        mov     edx,skin_btn_minimize
-
 
159
        jmp     .next_button
-
 
160
  .not_minimize:
-
 
161
        add     ebx,12
-
 
162
        jmp     .lp2
-
 
163
  .next_button:
-
 
164
        movsx   eax,[ebx+SKIN_BUTTONS.left]
-
 
165
        mov     [edx+SKIN_BUTTON.left],eax
-
 
166
        movsx   eax,[ebx+SKIN_BUTTONS.top]
-
 
167
        mov     [edx+SKIN_BUTTON.top],eax
-
 
168
        movsx   eax,[ebx+SKIN_BUTTONS.width]
-
 
169
        mov     [edx+SKIN_BUTTON.width],eax
-
 
170
        movsx   eax,[ebx+SKIN_BUTTONS.height]
-
 
171
        mov     [edx+SKIN_BUTTON.height],eax
236
    call  bmp2raw
172
        add     ebx,12
Line 237... Line 173...
237
    mov   eax, [0x90000+bmp_header.height]
173
        jmp     .lp2
238
    mov   [_skinh], eax
174
  .end_buttons:
Line 247... Line 183...
247
        push  edx
183
 
Line 248... Line 184...
248
 
184
        push  edx
Line -... Line 185...
-
 
185
 
-
 
186
        mov   edi,[esp]                              ; RECTANGLE
-
 
187
 
-
 
188
        mov     ebp,skin_active
-
 
189
        cmp     byte [esp+32+4+4],0
-
 
190
        jne     @f
249
        mov   edi,[esp]                              ; RECTANGLE
191
        mov     ebp,skin_inactive
250
 
192
     @@:
251
        mov   eax,[edi+0]
193
 
252
        shl   eax,16
194
        mov   eax,[edi+0]
253
        mov   ax,[edi+0]
195
        shl   eax,16
Line 258... Line 200...
258
        add   bx,[edi+12]
200
        mov   bx,[edi+4]
259
;        mov   esi,[edi+24]
201
        add   bx,[edi+12]
260
;        shr   esi,1
202
;        mov   esi,[edi+24]
261
;        and   esi,0x007f7f7f
203
;        shr   esi,1
262
        mov   esi,[_coloroutborder]
204
;        and   esi,0x007f7f7f
263
        call  draw_rectangle
205
        mov   esi,[ebp+SKIN_DATA.colors.outer]
264
        mov   ecx,3
206
        call  draw_rectangle
265
      _dw3l:
207
        mov   ecx,3
266
        add   eax,1*65536-1
208
      _dw3l:
267
        add   ebx,1*65536-1
209
        add   eax,1*65536-1
268
        test  ax,ax
210
        add   ebx,1*65536-1
269
        js    no_skin_add_button
211
        test  ax,ax
270
        test  bx,bx
212
        js    no_skin_add_button
271
        js    no_skin_add_button
213
        test  bx,bx
272
        mov   esi,[_colorframe] ;[edi+24]
214
        js    no_skin_add_button
273
        call  draw_rectangle
215
        mov   esi,[ebp+SKIN_DATA.colors.frame] ;[edi+24]
274
        dec   ecx
216
        call  draw_rectangle
275
        jnz   _dw3l
217
        dec   ecx
276
        mov   esi,[_colorborder]
218
        jnz   _dw3l
277
        add   eax,1*65536-1
219
        mov   esi,[ebp+SKIN_DATA.colors.inner]
278
        add   ebx,1*65536-1
220
        add   eax,1*65536-1
279
        test  ax,ax
221
        add   ebx,1*65536-1
280
        js    no_skin_add_button
222
        test  ax,ax
281
        test  bx,bx
223
        js    no_skin_add_button
282
        js    no_skin_add_button
224
        test  bx,bx
283
        call  draw_rectangle
225
        js    no_skin_add_button
284
 
226
        call  draw_rectangle
Line 285... Line 227...
285
        mov   esi,[esp]
227
 
286
        mov   eax,[esi+8]    ; window width
228
        mov   esi,[esp]
287
        mov   edx,[_skinleft]
229
        mov   eax,[esi+8]    ; window width
288
        shl   edx,16
230
        mov   edx,[ebp+SKIN_DATA.left.left]
289
        mov   ecx,[_skinleftw]
231
        shl   edx,16
290
        shl   ecx,16
232
        mov   ecx,[ebp+SKIN_DATA.left.width]
291
        add   ecx,[_skinh]
233
        shl   ecx,16
Line 292... Line -...
292
 
-
 
293
        cmp   byte [esp+32+4+4],1
234
        add   ecx,[_skinh]
294
        mov   ebx, [_refleft_1]
-
 
295
        jne   @f
-
 
296
        mov   ebx,[_refleft]
-
 
297
     @@:
235
 
Line 298... Line 236...
298
        call  sys_putimage
236
        mov   ebx, [ebp+SKIN_DATA.left.data]
299
 
237
        call  sys_putimage
300
        mov   esi,[esp]
238
 
301
        mov   eax,[esi+8]
239
        mov   esi,[esp]
302
        sub   eax,[_skinleftw]
240
        mov   eax,[esi+8]
303
        sub   eax,[_skinoperw]
241
        sub   eax,[ebp+SKIN_DATA.left.width]
304
        cmp   eax,[_skinbase]
242
        sub   eax,[ebp+SKIN_DATA.oper.width]
305
        jng   non_base
243
        cmp   eax,[ebp+SKIN_DATA.base.left]
306
        xor   edx,edx
244
        jng   non_base
Line 307... Line 245...
307
        mov   ebx,[_skinbasew]
245
        xor   edx,edx
Line 308... Line -...
308
        div   ebx
-
 
309
 
246
        mov   ebx,[ebp+SKIN_DATA.base.width]
310
        inc   eax
-
 
311
 
-
 
312
        cmp   byte [esp+32+4+4], 1
-
 
313
        mov   ebx,[_refbase_1]
-
 
314
        jne   @f
247
        div   ebx
315
        mov   ebx,[_refbase]
248
 
316
     @@:
249
        inc   eax
317
 
250
 
318
        mov   ecx,[_skinbasew]
251
        mov   ebx,[ebp+SKIN_DATA.base.data]
319
        shl   ecx,16
252
        mov   ecx,[ebp+SKIN_DATA.base.width]
320
        add   ecx,[_skinh]
253
        shl   ecx,16
321
        mov   edx,[_skinbase]
254
        add   ecx,[_skinh]
322
        sub   edx,[_skinbasew]
255
        mov   edx,[ebp+SKIN_DATA.base.left]
323
        shl   edx,16
256
        sub   edx,[ebp+SKIN_DATA.base.width]
Line 324... Line 257...
324
      baseskinloop:
257
        shl   edx,16
325
        shr   edx,16
258
      baseskinloop:
326
        add   edx,[_skinbasew]
259
        shr   edx,16
Line 335... Line 268...
335
      non_base:
268
        jnz   baseskinloop
336
 
269
      non_base:
Line 337... Line 270...
337
        mov   esi,[esp]
270
 
338
        mov   edx,[esi+8]
271
        mov   esi,[esp]
339
        sub   edx,[_skinoperw]
272
        mov   edx,[esi+8]
340
        inc   edx
273
        sub   edx,[ebp+SKIN_DATA.oper.width]
341
        shl   edx,16
274
        inc   edx
342
        cmp   byte [esp+32+4+4], 1
-
 
343
        mov   ebx,[_refoper_1]
275
        shl   edx,16
344
        jne   @f
-
 
345
        mov   ebx,[_refoper]
-
 
346
     @@:
-
 
Line 347... Line 276...
347
 
276
        mov   ebx,[ebp+SKIN_DATA.oper.data]
348
        mov   ecx,[_skinoperw]
277
 
349
        shl   ecx,16
278
        mov   ecx,[ebp+SKIN_DATA.oper.width]
350
        add   ecx,[_skinh]
279
        shl   ecx,16
Line 351... Line 280...
351
        call  sys_putimage
280
        add   ecx,[_skinh]
Line 367... Line 296...
367
        mov   edi,[esi+16]
296
        sub   edx,4
368
        call  [drawbar]
297
        mov   edi,[esi+16]
369
      _noinside2:
298
        call  [drawbar]
370
 
299
      _noinside2:
Line -... Line 300...
-
 
300
 
371
        mov   edi,[0xfe88]
301
;* close button
372
        movzx eax,word [edi]
302
        mov   edi,[0xfe88]
373
        cmp   eax,1000
303
        movzx eax,word [edi]
374
        jge   no_skin_add_button
304
        cmp   eax,1000
375
        inc   eax
305
        jge   no_skin_add_button
Line 384... Line 314...
384
        add   eax,2         ; save button id number
314
 
385
        mov   bx,1
315
        add   eax,2         ; save button id number
386
        mov   [eax],bx
316
        mov   bx,1
387
        add   eax,2         ; x start
317
        mov   [eax],bx
-
 
318
        add   eax,2         ; x start
-
 
319
        xor   ebx,ebx
-
 
320
        cmp   [skin_btn_close.left],0
388
        mov   ebx,[esp]
321
        jge   _bCx_at_right
389
        mov   ebx,[ebx+8]
322
        mov   ebx,[esp]
390
        cmp   [_buttonCx],0
-
 
391
        jg    _bCx_at_right
323
        mov   ebx,[ebx+8]
392
        mov   ebx,[_buttonCw]    ; ebx will be 0 in next instruction
-
 
393
      _bCx_at_right:
324
        inc   ebx
394
        sub   ebx,[_buttonCw]
-
 
395
        sub   ebx,[_buttonCx]
325
      _bCx_at_right:
396
        mov   [eax],bx
326
        add   ebx,[skin_btn_close.left]
397
        add   eax,2         ; x size
327
        mov   [eax],bx
398
        mov   ebx,[_buttonCw]
328
        add   eax,2         ; x size
-
 
329
        mov   ebx,[skin_btn_close.width]
399
        mov   [eax],bx
330
        dec   ebx
400
        add   eax,2         ; y start
331
        mov   [eax],bx
401
        mov   ebx,[_buttonCy]
332
        add   eax,2         ; y start
402
        mov   [eax],bx
333
        mov   ebx,[skin_btn_close.top]
403
        add   eax,2         ; y size
334
        mov   [eax],bx
404
        mov   ebx,[_buttonCh]
335
        add   eax,2         ; y size
-
 
336
        mov   ebx,[skin_btn_close.height]
405
        mov   [eax],bx
337
        dec   ebx
Line 406... Line 338...
406
 
338
        mov   [eax],bx
407
;* minimize button
339
 
408
        mov   edi,[0xfe88]
340
;* minimize button
Line 421... Line 353...
421
        add   eax,2         ; save button id number
353
 
422
        mov   bx,65535 ;999
354
        add   eax,2         ; save button id number
423
        mov   [eax],bx
355
        mov   bx,65535 ;999
424
        add   eax,2         ; x start
356
        mov   [eax],bx
-
 
357
        add   eax,2         ; x start
-
 
358
        xor   ebx,ebx
-
 
359
        cmp   [skin_btn_minimize.left],0
425
        mov   ebx,[esp]
360
        jge   _bMx_at_right
426
        mov   ebx,[ebx+8]
361
        mov   ebx,[esp]
427
        cmp   [_buttonMx],0
-
 
428
        jg    _bMx_at_right
362
        mov   ebx,[ebx+8]
429
        mov   ebx,[_buttonMw]    ; ebx will be 0 in next instruction
-
 
430
      _bMx_at_right:
363
        inc   ebx
431
        sub   ebx,[_buttonMw]
-
 
432
        sub   ebx,[_buttonMx]
364
      _bMx_at_right:
433
        mov   [eax],bx
365
        add   ebx,[skin_btn_minimize.left]
434
        add   eax,2         ; x size
366
        mov   [eax],bx
435
        mov   ebx,[_buttonMw]
367
        add   eax,2         ; x size
-
 
368
        mov   ebx,[skin_btn_minimize.width]
436
        mov   [eax],bx
369
        dec   ebx
437
        add   eax,2         ; y start
370
        mov   [eax],bx
438
        mov   ebx,[_buttonMy]
371
        add   eax,2         ; y start
439
        mov   [eax],bx
372
        mov   ebx,[skin_btn_minimize.top]
440
        add   eax,2         ; y size
373
        mov   [eax],bx
441
        mov   ebx,[_buttonMh]
374
        add   eax,2         ; y size
-
 
375
        mov   ebx,[skin_btn_minimize.height]
442
        mov   [eax],bx
376
        dec   ebx
443
;* minimize button
-
 
Line 444... Line 377...
444
 
377
        mov   [eax],bx
Line 445... Line 378...
445
      no_skin_add_button:
378
 
446
 
379
      no_skin_add_button:
Line 447... Line 380...
447
        add   esp,4
380
 
Line 448... Line -...
448
        popa
-