Subversion Repositories Kolibri OS

Rev

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

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