Subversion Repositories Kolibri OS

Rev

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

Rev 3472 Rev 6033
1
;
1
;
2
;    UNIFORM WINDOW COLOURS & SKIN
2
;    UNIFORM WINDOW COLOURS & SKIN
3
;
3
;
4
;    Compile with FASM for Menuet
4
;    Compile with FASM for Menuet
5
;
5
;
6
;    < russian edition by Ivan Poddubny >
6
;    < russian edition by Ivan Poddubny >
7
;    < skin selection by Mike Semenyako >
7
;    < skin selection by Mike Semenyako >
8
;******************************************************************************
8
;******************************************************************************
9
; last update:  01/04/2013
9
; last update:  01/04/2013
10
; written by:   Marat Zakiyanov aka Mario79, aka Mario
10
; written by:   Marat Zakiyanov aka Mario79, aka Mario
11
; changes:      select colors with ColorDialog
11
; changes:      select colors with ColorDialog
12
;               some redesign of the look of the program
12
;               some redesign of the look of the program
13
;******************************************************************************
13
;******************************************************************************
14
; last update:  10/09/2010
14
; last update:  10/09/2010
15
; written by:   Marat Zakiyanov aka Mario79, aka Mario
15
; written by:   Marat Zakiyanov aka Mario79, aka Mario
16
; changes:      select path with OpenDialog
16
; changes:      select path with OpenDialog
17
;******************************************************************************
17
;******************************************************************************
18
	use32
18
	use32
19
	org 0
19
	org 0
20
	db 'MENUET01'	; identifier
20
	db 'MENUET01'	; identifier
21
	dd 1		; header version
21
	dd 1		; header version
22
	dd START	; start address
22
	dd START	; start address
23
	dd IM_END	; file size
23
	dd IM_END	; file size
24
	dd I_END	; memory
24
	dd I_END	; memory
25
	dd stacktop	; stack pointer
25
	dd stacktop	; stack pointer
26
	dd skin_info	; parameters
26
	dd skin_info	; parameters
27
	dd cur_dir_path	; path to file
27
	dd cur_dir_path	; path to file
28
 
28
 
29
include 'lang.inc'
29
include 'lang.inc'
30
include '../../../config.inc'		;for nightbuild
30
include '../../../config.inc'		;for nightbuild
31
include '../../../macros.inc'
31
include '../../../macros.inc'
32
include 'kglobals.inc'
32
include 'kglobals.inc'
33
include 'unpacker.inc'
33
include 'unpacker.inc'
34
include '../../../develop/libraries/box_lib/load_lib.mac'
34
include '../../../develop/libraries/box_lib/load_lib.mac'
35
	@use_library
35
	@use_library
36
;******************************************************************************
36
;******************************************************************************
37
;--------------------------------------
37
;--------------------------------------
38
struct SKIN_HEADER
38
struct SKIN_HEADER
39
  ident   dd ?
39
  ident   dd ?
40
  version dd ?
40
  version dd ?
41
  params  dd ?
41
  params  dd ?
42
  buttons dd ?
42
  buttons dd ?
43
  bitmaps dd ?
43
  bitmaps dd ?
44
ends
44
ends
45
;--------------------------------------
45
;--------------------------------------
46
struct SKIN_PARAMS
46
struct SKIN_PARAMS
47
  skin_height    dd ?
47
  skin_height    dd ?
48
  margin.right   dw ?
48
  margin.right   dw ?
49
  margin.left    dw ?
49
  margin.left    dw ?
50
  margin.bottom  dw ?
50
  margin.bottom  dw ?
51
  margin.top     dw ?
51
  margin.top     dw ?
52
  colors.inner   dd ?
52
  colors.inner   dd ?
53
  colors.outer   dd ?
53
  colors.outer   dd ?
54
  colors.frame   dd ?
54
  colors.frame   dd ?
55
  colors_1.inner dd ?
55
  colors_1.inner dd ?
56
  colors_1.outer dd ?
56
  colors_1.outer dd ?
57
  colors_1.frame dd ?
57
  colors_1.frame dd ?
58
  dtp.size       dd ?
58
  dtp.size       dd ?
59
  dtp.data       db 40 dup (?)
59
  dtp.data       db 40 dup (?)
60
ends
60
ends
61
;--------------------------------------
61
;--------------------------------------
62
struct SKIN_BUTTONS
62
struct SKIN_BUTTONS
63
  type     dd ?
63
  type     dd ?
64
  pos:
64
  pos:
65
    left   dw ?
65
    left   dw ?
66
    top    dw ?
66
    top    dw ?
67
  size:
67
  size:
68
    width  dw ?
68
    width  dw ?
69
    height dw ?
69
    height dw ?
70
ends
70
ends
71
;--------------------------------------
71
;--------------------------------------
72
struct SKIN_BITMAPS
72
struct SKIN_BITMAPS
73
  kind  dw ?
73
  kind  dw ?
74
  type  dw ?
74
  type  dw ?
75
  _data  dd ?
75
  _data  dd ?
76
ends
76
ends
77
;--------------------------------------
77
;--------------------------------------
78
frame_1:
78
frame_1:
79
  .x      = 5
79
  .x      = 5
80
  .y      = 220
80
  .y      = 220
81
  .width  = 420
81
  .width  = 420
82
  .height = 50
82
  .height = 50
83
;--------------------------------------  
83
;--------------------------------------  
84
frame_2:
84
frame_2:
85
  .x      = 5
85
  .x      = 5
86
  .y      = 280
86
  .y      = 280
87
  .width  = 420
87
  .width  = 420
88
  .height = 50
88
  .height = 50
89
;---------------------------------------------------------------------
89
;---------------------------------------------------------------------
90
START:		; start of execution
90
START:		; start of execution
91
;---------------------------------------------------------------------
91
;---------------------------------------------------------------------
92
	mcall	68,11
92
	mcall	68,11
93
	
93
	
94
	test	eax,eax
94
	test	eax,eax
95
	jz	close	
95
	jz	close	
96
 
96
 
97
load_libraries l_libs_start,end_l_libs
97
load_libraries l_libs_start,end_l_libs
98
 
98
 
99
;if return code =-1 then exit, else nornary work
99
;if return code =-1 then exit, else nornary work
100
	inc	eax
100
	inc	eax
101
	test	eax,eax
101
	test	eax,eax
102
	jz	close
102
	jz	close
103
;---------------------------------------------------------------------
103
;---------------------------------------------------------------------
104
	mov	edi,filename_area
104
	mov	edi,filename_area
105
	mov	esi,start_temp_file_name
105
	mov	esi,start_temp_file_name
106
	xor	eax,eax
106
	xor	eax,eax
107
	cld
107
	cld
108
@@:
108
@@:
109
	lodsb
109
	lodsb
110
	stosb
110
	stosb
111
	test	eax,eax
111
	test	eax,eax
112
	jnz	@b
112
	jnz	@b
113
 
113
 
114
 
114
 
115
	mov	edi,fname
115
	mov	edi,fname
116
	mov	esi,default_dtp
116
	mov	esi,default_dtp
117
	xor	eax,eax
117
	xor	eax,eax
118
	cld
118
	cld
119
@@:
119
@@:
120
	lodsb
120
	lodsb
121
	stosb
121
	stosb
122
	test	eax,eax
122
	test	eax,eax
123
	jnz	@b
123
	jnz	@b
124
 
124
 
125
;---------------------------------------------------------------------
125
;---------------------------------------------------------------------
126
	mov	edi,skin_info
126
	mov	edi,skin_info
127
	cmp	byte [edi], 0
127
	cmp	byte [edi], 0
128
	jne	skin_path_ready
128
	jne	skin_path_ready
129
	mov	esi,default_skin
129
	mov	esi,default_skin
130
	xor	eax,eax
130
	xor	eax,eax
131
	cld
131
	cld
132
@@:
132
@@:
133
	lodsb
133
	lodsb
134
	stosb
134
	stosb
135
	test	eax,eax
135
	test	eax,eax
136
	jnz	@b
136
	jnz	@b
137
skin_path_ready:	
137
skin_path_ready:	
138
;---------------------------------------------------------------------
138
;---------------------------------------------------------------------
139
;OpenDialog	initialisation
139
;OpenDialog	initialisation
140
	push	dword OpenDialog_data
140
	push	dword OpenDialog_data
141
	call	[OpenDialog_Init]
141
	call	[OpenDialog_Init]
142
 
142
 
143
	push	dword OpenDialog_data2
143
	push	dword OpenDialog_data2
144
	call	[OpenDialog_Init]
144
	call	[OpenDialog_Init]
145
;--------------------------------------------------------------------
145
;--------------------------------------------------------------------
146
;init_ColorDialog	ColorDialog_data
146
;init_ColorDialog	ColorDialog_data
147
	push    dword ColorDialog_data
147
	push    dword ColorDialog_data
148
	call    [ColorDialog_Init]
148
	call    [ColorDialog_Init]
149
;--------------------------------------------------------------------
149
;--------------------------------------------------------------------
150
; prepare for PathShow
150
; prepare for PathShow
151
	push	dword PathShow_data_1
151
	push	dword PathShow_data_1
152
	call	[PathShow_prepare]
152
	call	[PathShow_prepare]
153
	
153
	
154
	push	dword PathShow_data_2
154
	push	dword PathShow_data_2
155
	call	[PathShow_prepare]
155
	call	[PathShow_prepare]
156
;---------------------------------------------------------------------	
156
;---------------------------------------------------------------------	
157
	mcall	48,3,color_table,4*10	; get current colors
157
	mcall	48,3,color_table,4*10	; get current colors
158
	call	load_skin_file.2
158
	call	load_skin_file.2
159
;---------------------------------------------------------------------	
159
;---------------------------------------------------------------------	
160
red:
160
red:
161
	call	draw_window		; at first, draw the window
161
	call	draw_window		; at first, draw the window
162
;---------------------------------------------------------------------	
162
;---------------------------------------------------------------------	
163
still:
163
still:
164
	mcall	10	; wait here for event
164
	mcall	10	; wait here for event
165
 
165
 
166
	dec	eax	; redraw request ?
166
	dec	eax	; redraw request ?
167
	jz	red
167
	jz	red
168
 
168
 
169
	dec	eax	; key in buffer ?
169
	dec	eax	; key in buffer ?
170
	jz	key
170
	jz	key
171
 
171
 
172
	dec	eax	; button in buffer ?
172
	dec	eax	; button in buffer ?
173
	jz	button
173
	jz	button
174
 
174
 
175
	jmp	still
175
	jmp	still
176
;---------------------------------------------------------------------
176
;---------------------------------------------------------------------
177
key:		; key
177
key:		; key
178
	mcall	2	; just read it and ignore
178
	mcall	2	; just read it and ignore
179
	jmp	still
179
	jmp	still
180
;---------------------------------------------------------------------
180
;---------------------------------------------------------------------
181
button:		; button
181
button:		; button
182
	mcall	17	; get id
182
	mcall	17	; get id
183
 
183
 
184
 	cmp	ah,12	; load file
184
 	cmp	ah,12	; load file
185
 	jne	no_load
185
 	jne	no_load
186
 
186
 
187
	call	load_file
187
	call	load_file
188
	call	draw_window
188
	call	draw_window
189
 	jmp	still
189
 	jmp	still
190
;--------------------------------------
190
;--------------------------------------
191
no_load:
191
no_load:
192
 	cmp	ah,13	; save file
192
 	cmp	ah,13	; save file
193
 	jne	no_save
193
 	jne	no_save
194
 
194
 
195
	call	save_file
195
	call	save_file
196
 	jmp	still
196
 	jmp	still
197
;--------------------------------------
197
;--------------------------------------
198
no_save:
198
no_save:
199
 	cmp	ah,14	; set 3d buttons
199
 	cmp	ah,14	; set 3d buttons
200
 	jne	no_3d
200
 	jne	no_3d
201
 
201
 
202
	mcall	48,1,1
202
	mcall	48,1,1
203
 	jmp	doapply
203
 	jmp	doapply
204
;--------------------------------------
204
;--------------------------------------
205
no_3d:
205
no_3d:
206
 	cmp	ah,15	; set flat buttons
206
 	cmp	ah,15	; set flat buttons
207
 	jne	no_flat
207
 	jne	no_flat
208
 
208
 
209
	mcall	48, 1, 0
209
	mcall	48, 1, 0
210
;--------------------------------------
210
;--------------------------------------
211
doapply:
211
doapply:
212
	mcall	48, 0, 0
212
	mcall	48, 0, 0
213
 	jmp	still
213
 	jmp	still
214
;--------------------------------------
214
;--------------------------------------
215
no_flat:
215
no_flat:
216
 	cmp	ah,16	; apply
216
 	cmp	ah,16	; apply
217
 	jne	no_apply
217
 	jne	no_apply
218
;--------------------------------------
218
;--------------------------------------
219
apply_direct:
219
apply_direct:
220
	mcall	48,2,color_table,10*4
220
	mcall	48,2,color_table,10*4
221
 	jmp	doapply
221
 	jmp	doapply
222
;--------------------------------------
222
;--------------------------------------
223
 no_apply:
223
 no_apply:
224
 	cmp	ah,17	; load skin file
224
 	cmp	ah,17	; load skin file
225
 	jne	no_load_skin
225
 	jne	no_load_skin
226
 
226
 
227
	call	load_skin_file
227
	call	load_skin_file
228
	call	draw_window
228
	call	draw_window
229
 	jmp	still
229
 	jmp	still
230
;--------------------------------------
230
;--------------------------------------
231
no_load_skin:
231
no_load_skin:
232
 	cmp	ah,18	; apply skin
232
 	cmp	ah,18	; apply skin
233
 	jne	no_apply_skin
233
 	jne	no_apply_skin
234
 
234
 
235
 	cmp	[skin_info],0
235
 	cmp	[skin_info],0
236
 	je	no_apply_skin
236
 	je	no_apply_skin
237
 
237
 
238
	mcall	48,8,skin_info
238
	mcall	48,8,skin_info
239
	call	draw_window
239
	call	draw_window
240
 	jmp	still
240
 	jmp	still
241
;--------------------------------------
241
;--------------------------------------
242
no_apply_skin:
242
no_apply_skin:
243
	cmp	ah,31
243
	cmp	ah,31
244
	jb	no_new_colour
244
	jb	no_new_colour
245
 
245
 
246
	cmp	ah,41
246
	cmp	ah,41
247
	jg	no_new_colour
247
	jg	no_new_colour
248
	
248
	
249
;---------------------------------------------------------------------	
249
;---------------------------------------------------------------------	
250
.start_ColorDialog:
250
.start_ColorDialog:
251
	push    dword ColorDialog_data
251
	push    dword ColorDialog_data
252
	call    [ColorDialog_Start]
252
	call    [ColorDialog_Start]
253
; 2 - use another method/not found program
253
; 2 - use another method/not found program
254
	cmp	[ColorDialog_data.status],2
254
	cmp	[ColorDialog_data.status],2
255
	je	still
255
	je	still
256
; 1 - OK, color selected	
256
; 1 - OK, color selected	
257
	cmp	[ColorDialog_data.status],1
257
	cmp	[ColorDialog_data.status],1
258
	jne	still
258
	jne	still
259
;---------------------------------------------------------------------	
259
;---------------------------------------------------------------------	
260
	
260
	
261
	shr	eax,8
261
	shr	eax,8
262
	sub	eax,31
262
	sub	eax,31
263
	shl	eax,2
263
	shl	eax,2
264
	mov	ebx,[ColorDialog_data.color]
264
	mov	ebx,[ColorDialog_data.color]
265
	and	ebx,0xffffff	; temporary for ColorDialog!!!!!!!!!!
265
	and	ebx,0xffffff	; temporary for ColorDialog!!!!!!!!!!
266
	mov	[eax+color_table],ebx
266
	mov	[eax+color_table],ebx
267
 	cmp	dword[not_packed_area+SKIN_HEADER.ident],'SKIN'
267
 	cmp	dword[not_packed_area+SKIN_HEADER.ident],'SKIN'
268
 	jne	@f
268
 	jne	@f
269
 
269
 
270
	mov	edi,[not_packed_area+SKIN_HEADER.params]
270
	mov	edi,[not_packed_area+SKIN_HEADER.params]
271
	mov	dword[edi+not_packed_area+SKIN_PARAMS.dtp.data+eax],ebx
271
	mov	dword[edi+not_packed_area+SKIN_PARAMS.dtp.data+eax],ebx
272
	call	draw_skin
272
	call	draw_skin
273
;--------------------------------------
273
;--------------------------------------
274
@@:
274
@@:
275
	call	draw_colours
275
	call	draw_colours
276
 	jmp	still
276
 	jmp	still
277
;--------------------------------------
277
;--------------------------------------
278
no_new_colour:
278
no_new_colour:
279
	cmp	ah,1	; terminate
279
	cmp	ah,1	; terminate
280
	jnz	noid1
280
	jnz	noid1
281
;--------------------------------------
281
;--------------------------------------
282
close:
282
close:
283
	or	eax,-1
283
	or	eax,-1
284
	mcall
284
	mcall
285
;--------------------------------------
285
;--------------------------------------
286
noid1:
286
noid1:
287
 	jmp	still
287
 	jmp	still
288
;---------------------------------------------------------------------
288
;---------------------------------------------------------------------
289
load_file:
289
load_file:
290
;---------------------------------------------------------------------
290
;---------------------------------------------------------------------
291
; invoke OpenDialog
291
; invoke OpenDialog
292
	mov	[OpenDialog_data.type],dword 0
292
	mov	[OpenDialog_data.type],dword 0
293
	push	dword OpenDialog_data
293
	push	dword OpenDialog_data
294
	call	[OpenDialog_Start]
294
	call	[OpenDialog_Start]
295
	cmp	[OpenDialog_data.status],1
295
	cmp	[OpenDialog_data.status],1
296
	je	.1
296
	je	.1
297
	ret
297
	ret
298
.1:
298
.1:
299
; prepare for PathShow
299
; prepare for PathShow
300
	push	dword PathShow_data_1
300
	push	dword PathShow_data_1
301
	call	[PathShow_prepare]
301
	call	[PathShow_prepare]
302
 
302
 
303
	call	draw_PathShow
303
	call	draw_PathShow
304
;---------------------------------------------------------------------
304
;---------------------------------------------------------------------
305
	xor	eax, eax
305
	xor	eax, eax
306
	mov	ebx, read_info
306
	mov	ebx, read_info
307
	mov	dword [ebx], eax	; subfunction: read
307
	mov	dword [ebx], eax	; subfunction: read
308
	mov	dword [ebx+4], eax	; offset (low dword)
308
	mov	dword [ebx+4], eax	; offset (low dword)
309
	mov	dword [ebx+8], eax	; offset (high dword)
309
	mov	dword [ebx+8], eax	; offset (high dword)
310
	mov	dword [ebx+12], 40     ; read colors file: 4*10 bytes
310
	mov	dword [ebx+12], 40     ; read colors file: 4*10 bytes
311
	mov	dword [ebx+16], color_table ; address
311
	mov	dword [ebx+16], color_table ; address
312
	mcall	70
312
	mcall	70
313
	ret
313
	ret
314
;---------------------------------------------------------------------
314
;---------------------------------------------------------------------
315
load_skin_file:
315
load_skin_file:
316
;---------------------------------------------------------------------
316
;---------------------------------------------------------------------
317
; invoke OpenDialog
317
; invoke OpenDialog
318
	push	dword OpenDialog_data2
318
	push	dword OpenDialog_data2
319
	call	[OpenDialog_Start]
319
	call	[OpenDialog_Start]
320
	cmp	[OpenDialog_data2.status],1
320
	cmp	[OpenDialog_data2.status],1
321
	je	.1
321
	je	.1
322
	ret
322
	ret
323
.1:
323
.1:
324
; prepare for PathShow
324
; prepare for PathShow
325
	push	dword PathShow_data_2
325
	push	dword PathShow_data_2
326
	call	[PathShow_prepare]
326
	call	[PathShow_prepare]
327
 
327
 
328
	call	draw_PathShow
328
	call	draw_PathShow
329
;---------------------------------------------------------------------
329
;---------------------------------------------------------------------
330
.2:
330
.2:
331
	xor	eax,eax
331
	xor	eax,eax
332
	mov	ebx,read_info2
332
	mov	ebx,read_info2
333
	mov	dword [ebx], eax	; subfunction: read
333
	mov	dword [ebx], eax	; subfunction: read
334
	mov	dword [ebx+4], eax	; offset (low dword)
334
	mov	dword [ebx+4], eax	; offset (low dword)
335
	mov	dword [ebx+8], eax	; offset (high dword)
335
	mov	dword [ebx+8], eax	; offset (high dword)
336
	mov	dword [ebx+12], 32*1024 ; read: max 32 KBytes
336
	mov	dword [ebx+12], 32*1024 ; read: max 32 KBytes
337
	mov	dword [ebx+16], file_load_area ; address
337
	mov	dword [ebx+16], file_load_area ; address
338
	mcall	70
338
	mcall	70
339
 
339
 
340
	mov	esi, file_load_area
340
	mov	esi, file_load_area
341
 
341
 
342
	cmp	dword [esi], 'KPCK'
342
	cmp	dword [esi], 'KPCK'
343
	jnz	notpacked
343
	jnz	notpacked
344
 
344
 
345
	cmp	dword [esi+4], 32*1024 ; max 32 KBytes
345
	cmp	dword [esi+4], 32*1024 ; max 32 KBytes
346
	ja	doret
346
	ja	doret
347
 
347
 
348
	push	unpack_area
348
	push	unpack_area
349
	push	esi
349
	push	esi
350
	call	unpack
350
	call	unpack
351
	mov	esi,unpack_area
351
	mov	esi,unpack_area
352
;--------------------------------------
352
;--------------------------------------
353
notpacked:
353
notpacked:
354
 	cmp	[esi+SKIN_HEADER.ident],dword 'SKIN'
354
 	cmp	[esi+SKIN_HEADER.ident],dword 'SKIN'
355
 	jne	doret
355
 	jne	doret
356
 
356
 
357
	mov	edi,not_packed_area
357
	mov	edi,not_packed_area
358
	mov	ecx,0x8000/4
358
	mov	ecx,0x8000/4
359
	rep	movsd
359
	rep	movsd
360
 
360
 
361
	mov	ebp,not_packed_area
361
	mov	ebp,not_packed_area
362
	mov	esi,[ebp+SKIN_HEADER.params]
362
	mov	esi,[ebp+SKIN_HEADER.params]
363
	add	esi,ebp
363
	add	esi,ebp
364
	lea	esi,[esi+SKIN_PARAMS.dtp.data]
364
	lea	esi,[esi+SKIN_PARAMS.dtp.data]
365
	mov	edi,color_table
365
	mov	edi,color_table
366
	mov	ecx,10
366
	mov	ecx,10
367
	rep	movsd
367
	rep	movsd
368
;--------------------------------------
368
;--------------------------------------
369
doret:
369
doret:
370
	ret
370
	ret
371
;---------------------------------------------------------------------
371
;---------------------------------------------------------------------
372
save_file:
372
save_file:
373
;---------------------------------------------------------------------
373
;---------------------------------------------------------------------
374
; invoke OpenDialog
374
; invoke OpenDialog
375
	mov	[OpenDialog_data.type],dword 1
375
	mov	[OpenDialog_data.type],dword 1
376
	push	dword OpenDialog_data
376
	push	dword OpenDialog_data
377
	call	[OpenDialog_Start]
377
	call	[OpenDialog_Start]
378
	cmp	[OpenDialog_data.status],1
378
	cmp	[OpenDialog_data.status],1
379
	je	.1
379
	je	.1
380
	ret
380
	ret
381
.1:
381
.1:
382
; prepare for PathShow
382
; prepare for PathShow
383
	push	dword PathShow_data_1
383
	push	dword PathShow_data_1
384
	call	[PathShow_prepare]
384
	call	[PathShow_prepare]
385
 
385
 
386
	call	draw_PathShow
386
	call	draw_PathShow
387
;---------------------------------------------------------------------
387
;---------------------------------------------------------------------
388
	xor	eax,eax
388
	xor	eax,eax
389
	mov	ebx,write_info
389
	mov	ebx,write_info
390
	mov	[ebx],dword 2			; subfunction: write
390
	mov	[ebx],dword 2			; subfunction: write
391
	and	[ebx+4],eax			; (reserved)
391
	and	[ebx+4],eax			; (reserved)
392
	and	[ebx+8],eax			; (reserved)
392
	and	[ebx+8],eax			; (reserved)
393
	mov	[ebx+12],dword 10*4		; bytes to write
393
	mov	[ebx+12],dword 10*4		; bytes to write
394
	mov	[ebx+16],dword color_table	; address
394
	mov	[ebx+16],dword color_table	; address
395
	mcall	70
395
	mcall	70
396
	ret
396
	ret
397
;---------------------------------------------------------------------
397
;---------------------------------------------------------------------
398
draw_button_row:
398
draw_button_row:
399
	mov	edx,0x60000000 + 31		; BUTTON ROW
399
	mov	edx,0x60000000 + 31		; BUTTON ROW
400
	mov	ebx,220*65536+14
400
	mov	ebx,220*65536+14
401
	mov	ecx,10*65536+14
401
	mov	ecx,10*65536+14
402
	mov	eax,8
402
	mov	eax,8
403
;-----------------------------------
403
;-----------------------------------
404
.newb:
404
.newb:
405
	mcall
405
	mcall
406
	add	ecx,20*65536
406
	add	ecx,20*65536
407
	inc	edx
407
	inc	edx
408
	cmp	edx,0x60000000 + 40
408
	cmp	edx,0x60000000 + 40
409
	jbe	.newb
409
	jbe	.newb
410
	ret
410
	ret
411
;---------------------------------------------------------------------
411
;---------------------------------------------------------------------
412
draw_button_row_of_texts:
412
draw_button_row_of_texts:
413
	mov	ebx,240*65536+13	; ROW OF TEXTS
413
	mov	ebx,240*65536+13	; ROW OF TEXTS
414
	mov	ecx,[w_work_text]
414
	mov	ecx,[w_work_text]
415
	mov	edx,text
415
	mov	edx,text
416
	mov	esi,32
416
	mov	esi,32
417
	mov	eax,4
417
	mov	eax,4
418
;-----------------------------------
418
;-----------------------------------
419
.newline:
419
.newline:
420
	mcall
420
	mcall
421
	add	ebx,20
421
	add	ebx,20
422
	add	edx,32
422
	add	edx,32
423
	cmp	[edx],byte 'x'
423
	cmp	[edx],byte 'x'
424
	jne	.newline
424
	jne	.newline
425
	ret
425
	ret
426
;---------------------------------------------------------------------
426
;---------------------------------------------------------------------
427
draw_colours:
427
draw_colours:
428
	pusha
428
	pusha
429
	mov	esi,color_table
429
	mov	esi,color_table
430
	mov	ebx,220*65536+14
430
	mov	ebx,220*65536+14
431
	mov	ecx,10*65536+14
431
	mov	ecx,10*65536+14
432
	mov	eax,13
432
	mov	eax,13
433
	mov	[frame_data.draw_text_flag],dword 0
433
	mov	[frame_data.draw_text_flag],dword 0
434
;--------------------------------------
434
;--------------------------------------
435
newcol:
435
newcol:
436
	mov	edx,[esi]
436
	mov	edx,[esi]
437
	mcall
437
	mcall
438
 
438
 
439
	push	ebx ecx
439
	push	ebx ecx
440
 
440
 
441
	sub	ebx,2 shl 16
441
	sub	ebx,2 shl 16
442
	add	bx,4
442
	add	bx,4
443
	sub	ecx,2 shl 16
443
	sub	ecx,2 shl 16
444
	add	cx,4
444
	add	cx,4
445
	
445
	
446
	mov	[frame_data.x],ebx
446
	mov	[frame_data.x],ebx
447
	mov	[frame_data.y],ecx	
447
	mov	[frame_data.y],ecx	
448
 
448
 
449
	push	dword frame_data
449
	push	dword frame_data
450
	call	[Frame_draw]
450
	call	[Frame_draw]
451
 
451
 
452
	pop	ecx ebx
452
	pop	ecx ebx
453
 
453
 
454
	add	ecx,20*65536
454
	add	ecx,20*65536
455
	add	esi,4
455
	add	esi,4
456
	cmp	esi,color_table+4*9
456
	cmp	esi,color_table+4*9
457
	jbe	newcol
457
	jbe	newcol
458
 
458
 
459
	popa
459
	popa
460
	ret
460
	ret
461
;----------------------------------------------------------------------
461
;----------------------------------------------------------------------
462
draw_PathShow:
462
draw_PathShow:
463
	pusha
463
	pusha
464
	mcall	13,,,0xffffff
464
	mcall	13,,,0xffffff
465
	mcall	13,,,0xffffff
465
	mcall	13,,,0xffffff
466
; draw for PathShow
466
; draw for PathShow
467
	push	dword PathShow_data_1
467
	push	dword PathShow_data_1
468
	call	[PathShow_draw]
468
	call	[PathShow_draw]
469
	
469
	
470
	push	dword PathShow_data_2
470
	push	dword PathShow_data_2
471
	call	[PathShow_draw]
471
	call	[PathShow_draw]
472
	popa
472
	popa
473
	ret
473
	ret
474
;---------------------------------------------------------------------
474
;---------------------------------------------------------------------
475
;   *********************************************
475
;   *********************************************
476
;   *******  WINDOW DEFINITIONS AND DRAW ********
476
;   *******  WINDOW DEFINITIONS AND DRAW ********
477
;   *********************************************
477
;   *********************************************
478
draw_window:
478
draw_window:
479
	mcall	12,1
479
	mcall	12,1
480
	mcall	48,3,app_colours,10*4
480
	mcall	48,3,app_colours,10*4
481
	mcall	14
481
	mcall	14
482
	mcall	48,4
482
	mcall	48,4
483
	mov	[current_skin_high],eax
483
	mov	[current_skin_high],eax
484
; DRAW WINDOW
484
; DRAW WINDOW
485
	xor	eax,eax		; function 0 : define and draw window
485
	xor	eax,eax		; function 0 : define and draw window
486
	xor	esi,esi
486
	xor	esi,esi
487
	mov	edx,[w_work]	; color of work area RRGGBB,8->color
487
	mov	edx,[w_work]	; color of work area RRGGBB,8->color
488
	or	edx,0x34000000
488
	or	edx,0x34000000
489
	mov	ecx,50 shl 16 + 346
489
	mov	ecx,50 shl 16 + 346
490
	add	ecx,[current_skin_high]
490
	add	ecx,[current_skin_high]
491
	mcall	,<110,440>,,,,title
491
	mcall	,<110,440>,,,,title
492
 
492
 
493
	mcall	9,procinfo,-1
493
	mcall	9,procinfo,-1
494
	
494
	
495
	mov	eax,[procinfo+70] ;status of window
495
	mov	eax,[procinfo+70] ;status of window
496
	test	eax,100b
496
	test	eax,100b
497
	jne	.end
497
	jne	.end
498
 
498
 
499
;if lang eq ru
499
;if lang eq ru
500
  load_w  = (5*2+6*9)
500
  load_w  = (5*2+6*9)
501
  save_w  = (5*2+6*9)
501
  save_w  = (5*2+6*9)
502
  flat_w  = (5*2+6*7)
502
  flat_w  = (5*2+6*7)
503
  apply_w = (5*2+6*9)
503
  apply_w = (5*2+6*9)
504
;else
504
;else
505
;  load_w  = (5*2+6*6)
505
;  load_w  = (5*2+6*6)
506
;  save_w  = (5*2+6*8)
506
;  save_w  = (5*2+6*8)
507
;  flat_w  = (5*2+6*4)
507
;  flat_w  = (5*2+6*4)
508
;  apply_w = (5*2+6*7)
508
;  apply_w = (5*2+6*7)
509
;end if
509
;end if
510
;-----------------------------------
510
;-----------------------------------
511
; select color DTP frame
511
; select color DTP frame
512
; LOAD BUTTON	; button 12
512
; LOAD BUTTON	; button 12
513
	mcall	8,,,12,[w_work_button]
513
	mcall	8,,,12,[w_work_button]
514
; SAVE BUTTON
514
; SAVE BUTTON
515
	add	ebx,(load_w+2)*65536-load_w+save_w
515
	add	ebx,(load_w+2)*65536-load_w+save_w
516
	inc	edx
516
	inc	edx
517
	mcall		; button 13
517
	mcall		; button 13
518
; APPLY BUTTON
518
; APPLY BUTTON
519
	mov	ebx,(frame_1.x + frame_1.width - apply_w - 15)*65536+apply_w
519
	mov	ebx,(frame_1.x + frame_1.width - apply_w - 15)*65536+apply_w
520
	mcall	8,,,16	; button 17
520
	mcall	8,,,16	; button 17
521
; select color DTP button text
521
; select color DTP button text
522
	mcall	4,,[w_work_button_text],t1,t1.size
522
	mcall	4,,[w_work_button_text],t1,t1.size
523
;-----------------------------------	
523
;-----------------------------------	
524
; select skin frame	
524
; select skin frame	
525
; LOAD SKIN BUTTON	; button 17
525
; LOAD SKIN BUTTON	; button 17
526
	mcall	8,,,17,[w_work_button]
526
	mcall	8,,,17,[w_work_button]
527
; 3D
527
; 3D
528
	mov	ebx,(frame_2.x+155)*65536+34
528
	mov	ebx,(frame_2.x+155)*65536+34
529
	mcall	,,,14	; button 14
529
	mcall	,,,14	; button 14
530
; FLAT
530
; FLAT
531
	add	ebx,36*65536-34+flat_w
531
	add	ebx,36*65536-34+flat_w
532
	inc	edx
532
	inc	edx
533
	mcall		; button 15
533
	mcall		; button 15
534
; APPLY SKIN BUTTON
534
; APPLY SKIN BUTTON
535
	mov	ebx,(frame_2.x + frame_2.width - apply_w -15)*65536+apply_w
535
	mov	ebx,(frame_2.x + frame_2.width - apply_w -15)*65536+apply_w
536
	mcall	,,,18		; button 18
536
	mcall	,,,18		; button 18
537
; select skin button text
537
; select skin button text
538
	mcall	4,,[w_work_button_text],t2,t2.size
538
	mcall	4,,[w_work_button_text],t2,t2.size
539
;-----------------------------------		
539
;-----------------------------------		
540
	call	draw_button_row
540
	call	draw_button_row
541
	call	draw_button_row_of_texts
541
	call	draw_button_row_of_texts
542
	call	draw_colours
542
	call	draw_colours
543
;-----------------------------------
543
;-----------------------------------
544
	mov	[frame_data.x],dword frame_1.x shl 16+frame_1.width
544
	mov	[frame_data.x],dword frame_1.x shl 16+frame_1.width
545
	mov	[frame_data.y],dword frame_1.y shl 16+frame_1.height
545
	mov	[frame_data.y],dword frame_1.y shl 16+frame_1.height
546
	mov	[frame_data.text_pointer],dword select_dtp_text
546
	mov	[frame_data.text_pointer],dword select_dtp_text
547
	mov	eax,[w_work]
547
	mov	eax,[w_work]
548
	mov	[frame_data.font_backgr_color],eax
548
	mov	[frame_data.font_backgr_color],eax
549
	mov	eax,[w_work_text]
549
	mov	eax,[w_work_text]
550
	mov	[frame_data.font_color],eax
550
	mov	[frame_data.font_color],eax
551
	mov	[frame_data.draw_text_flag],dword 1
551
	mov	[frame_data.draw_text_flag],dword 1
552
	
552
	
553
	push	dword frame_data
553
	push	dword frame_data
554
	call	[Frame_draw]
554
	call	[Frame_draw]
555
;-----------------------------------
555
;-----------------------------------
556
	mov	[frame_data.x],dword frame_2.x shl 16+frame_2.width
556
	mov	[frame_data.x],dword frame_2.x shl 16+frame_2.width
557
	mov	[frame_data.y],dword frame_2.y shl 16+frame_2.height
557
	mov	[frame_data.y],dword frame_2.y shl 16+frame_2.height
558
	mov	[frame_data.text_pointer],dword select_skin_text
558
	mov	[frame_data.text_pointer],dword select_skin_text
559
 
559
 
560
	push	dword frame_data
560
	push	dword frame_data
561
	call	[Frame_draw]
561
	call	[Frame_draw]
562
;-----------------------------------
562
;-----------------------------------
563
	call	draw_PathShow
563
	call	draw_PathShow
564
;-----------------------------------
564
;-----------------------------------
565
	cmp	dword[not_packed_area+SKIN_HEADER.ident],'SKIN'
565
	cmp	dword[not_packed_area+SKIN_HEADER.ident],'SKIN'
566
	jne	@f
566
	jne	@f
567
	call	draw_skin
567
	call	draw_skin
568
@@:
568
@@:
569
.end:
569
.end:
570
	mcall	12,2
570
	mcall	12,2
571
	ret
571
	ret
572
;-----------------------------------------------------------------------------
572
;-----------------------------------------------------------------------------
573
include 'drawskin.inc'
573
include 'drawskin.inc'
574
;-----------------------------------------------------------------------------
574
;-----------------------------------------------------------------------------
575
; DATA AREA
575
; DATA AREA
576
;-----------------------------------------------------------------------------
576
;-----------------------------------------------------------------------------
577
include 'idata.inc'
577
include 'idata.inc'
578
;-----------------------------------------------------------------------------
578
;-----------------------------------------------------------------------------
579
IM_END:
579
IM_END:
580
;-----------------------------------------------------------------------------
580
;-----------------------------------------------------------------------------
581
include 'udata.inc'
581
include 'udata.inc'
582
;-----------------------------------------------------------------------------
582
;-----------------------------------------------------------------------------
583
I_END:
583
I_END:
584
;-----------------------------------------------------------------------------
584
;-----------------------------------------------------------------------------