Subversion Repositories Kolibri OS

Rev

Rev 9632 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9632 Rev 9641
Line 95... Line 95...
95
  .w = frame_2.w + frame_2.x + frame_2.x + 9
95
  .w = frame_2.w + frame_2.x + frame_2.x + 9
96
  .h = frame_2.y + frame_2.height + 10
96
  .h = frame_2.y + frame_2.height + 10
97
;---------------------------------------------------------------------
97
;---------------------------------------------------------------------
98
START:		; start of execution
98
START:		; start of execution
99
;---------------------------------------------------------------------
99
;---------------------------------------------------------------------
100
	mcall	68,11
100
	mcall	SF_SYS_MISC,SSF_HEAP_INIT
Line 101... Line 101...
101
	
101
	
102
	test	eax,eax
102
	test	eax,eax
Line 103... Line 103...
103
	jz	close	
103
	jz	close	
Line 116... Line 116...
116
;---------------------------------------------------------------------
116
;---------------------------------------------------------------------
117
; check app param
117
; check app param
118
	stdcall string.length, app_param
118
	stdcall string.length, app_param
119
	add eax, app_param
119
	add eax, app_param
120
	mov ecx, [eax-4]
120
	mov ecx, [eax-4]
-
 
121
	or ecx, 0x20202000 ;letters to lowercase
121
	cmp ecx, '.skn'
122
	cmp ecx, '.skn'
122
	je  load_skin_from_param
123
	je  load_skin_from_param
123
	cmp ecx, '.SKN'
-
 
124
	je  load_skin_from_param
-
 
125
	cmp ecx, '.dtp'
124
	cmp ecx, '.dtp'
126
	je load_dtp_from_param
125
	je load_dtp_from_param
127
	cmp ecx, '.DTP'
-
 
128
	je load_dtp_from_param
-
 
129
	jmp no_param
126
	jmp no_param
Line 130... Line 127...
130
	
127
	
131
load_dtp_from_param:
128
load_dtp_from_param:
132
	stdcall string.copy, app_param, dtp_name
129
	stdcall string.copy, app_param, dtp_name
Line 137... Line 134...
137
	stdcall string.copy, app_param, skin_info
134
	stdcall string.copy, app_param, skin_info
138
	call    load_skin_file.2
135
	call    load_skin_file.2
139
	jmp     skin_path_ready
136
	jmp     skin_path_ready
Line 140... Line 137...
140
 
137
 
141
no_param:
138
no_param:
142
	mcall	48,3,color_table,4*10	; get current colors
139
	mcall	SF_STYLE_SETTINGS,SSF_GET_COLORS,color_table,4*10	; get current colors
Line 143... Line 140...
143
	call	load_skin_file.2
140
	call	load_skin_file.2
144
	
141
	
145
skin_path_ready:	
142
skin_path_ready:	
Line 164... Line 161...
164
;---------------------------------------------------------------------	
161
;---------------------------------------------------------------------	
165
red:
162
red:
166
	call	draw_window		; at first, draw the window
163
	call	draw_window		; at first, draw the window
167
;---------------------------------------------------------------------	
164
;---------------------------------------------------------------------	
168
still:
165
still:
169
	mcall	10	; wait here for event
166
	mcall	SF_WAIT_EVENT
Line 170... Line 167...
170
 
167
 
171
	dec	eax	; redraw request ?
168
	dec	eax	; redraw request ?
Line 172... Line 169...
172
	jz	red
169
	jz	red
Line 178... Line 175...
178
	jz	button
175
	jz	button
Line 179... Line 176...
179
 
176
 
180
	jmp	still
177
	jmp	still
181
;---------------------------------------------------------------------
178
;---------------------------------------------------------------------
182
key:		; key
179
key:		; key
183
	mcall	2	; just read it and ignore
180
	mcall	SF_GET_KEY
184
	jmp	still
181
	jmp	still
185
;---------------------------------------------------------------------
182
;---------------------------------------------------------------------
186
button:		; button
183
button:		; button
Line 187... Line 184...
187
	mcall	17	; get id
184
	mcall	SF_GET_BUTTON
188
 
185
 
Line 189... Line 186...
189
 	cmp	ah,12	; load file
186
 	cmp	ah,12	; load file
Line 202... Line 199...
202
;--------------------------------------
199
;--------------------------------------
203
no_save:
200
no_save:
204
 	cmp	ah,14	; set 3d buttons
201
 	cmp	ah,14	; set 3d buttons
205
 	jne	no_3d
202
 	jne	no_3d
Line 206... Line 203...
206
 
203
 
207
	mcall	48,1,1
204
	mcall	SF_STYLE_SETTINGS,SSF_SET_BUTTON_STYLE,1
208
	invoke  ini_set_int, aIni, aSectionSkn, aButtonStyle, 1
205
	invoke  ini_set_int, aIni, aSectionSkn, aButtonStyle, 1
209
 	jmp	doapply
206
 	jmp	doapply
210
;--------------------------------------
207
;--------------------------------------
211
no_3d:
208
no_3d:
212
 	cmp	ah,15	; set flat buttons
209
 	cmp	ah,15	; set flat buttons
Line 213... Line 210...
213
 	jne	no_flat
210
 	jne	no_flat
214
 
211
 
215
	invoke  ini_set_int, aIni, aSectionSkn, aButtonStyle, 0
212
	invoke  ini_set_int, aIni, aSectionSkn, aButtonStyle, 0
216
	mcall	48, 1, 0
213
	mcall	SF_STYLE_SETTINGS,SSF_SET_BUTTON_STYLE, 0
217
;--------------------------------------
214
;--------------------------------------
218
doapply:
215
doapply:
219
	mcall	48, 0, 0
216
	mcall	SF_STYLE_SETTINGS,SSF_APPLY, 0
220
 	jmp	still
217
 	jmp	still
221
;--------------------------------------
218
;--------------------------------------
222
no_flat:
219
no_flat:
223
 	cmp	ah,16	; apply
220
 	cmp	ah,16	; apply
224
 	jne	no_apply
221
 	jne	no_apply
225
;--------------------------------------
222
;--------------------------------------
226
apply_direct:
223
apply_direct:
227
	mcall	48,2,color_table,10*4
224
	mcall	SF_STYLE_SETTINGS,SSF_SET_COLORS,color_table,10*4
228
 	jmp	doapply
225
 	jmp	doapply
229
;--------------------------------------
226
;--------------------------------------
230
 no_apply:
227
 no_apply:
Line 240... Line 237...
240
 	jne	no_apply_skin
237
 	jne	no_apply_skin
Line 241... Line 238...
241
 
238
 
242
 	cmp	[skin_info],0
239
 	cmp	[skin_info],0
Line 243... Line 240...
243
 	je	no_apply_skin
240
 	je	no_apply_skin
244
 
241
 
245
	mcall	48,8,skin_info
242
	mcall	SF_STYLE_SETTINGS,SSF_SET_SKIN,skin_info
246
	call	draw_window
243
	call	draw_window
247
 	jmp	still
244
 	jmp	still
248
;--------------------------------------
245
;--------------------------------------
Line 315... Line 312...
315
	mov	dword [ebx], eax	; subfunction: read
312
	mov	dword [ebx], eax	; subfunction: read
316
	mov	dword [ebx+4], eax	; offset (low dword)
313
	mov	dword [ebx+4], eax	; offset (low dword)
317
	mov	dword [ebx+8], eax	; offset (high dword)
314
	mov	dword [ebx+8], eax	; offset (high dword)
318
	mov	dword [ebx+12], 40     ; read colors file: 4*10 bytes
315
	mov	dword [ebx+12], 40     ; read colors file: 4*10 bytes
319
	mov	dword [ebx+16], color_table ; address
316
	mov	dword [ebx+16], color_table ; address
320
	mcall	70
317
	mcall	SF_FILE
321
	ret
318
	ret
322
;---------------------------------------------------------------------
319
;---------------------------------------------------------------------
323
load_skin_file:
320
load_skin_file:
324
;---------------------------------------------------------------------
321
;---------------------------------------------------------------------
325
; invoke OpenDialog
322
; invoke OpenDialog
Line 341... Line 338...
341
	mov	dword [ebx], eax	; subfunction: read
338
	mov	dword [ebx], eax	; subfunction: read
342
	mov	dword [ebx+4], eax	; offset (low dword)
339
	mov	dword [ebx+4], eax	; offset (low dword)
343
	mov	dword [ebx+8], eax	; offset (high dword)
340
	mov	dword [ebx+8], eax	; offset (high dword)
344
	mov	dword [ebx+12], 32*1024 ; read: max 32 KBytes
341
	mov	dword [ebx+12], 32*1024 ; read: max 32 KBytes
345
	mov	dword [ebx+16], file_load_area ; address
342
	mov	dword [ebx+16], file_load_area ; address
346
	mcall	70
343
	mcall	SF_FILE
Line 347... Line 344...
347
 
344
 
Line 348... Line 345...
348
	mov	esi, file_load_area
345
	mov	esi, file_load_area
349
 
346
 
Line 398... Line 395...
398
	mov	[ebx],dword 2			; subfunction: write
395
	mov	[ebx],dword 2			; subfunction: write
399
	and	[ebx+4],eax			; (reserved)
396
	and	[ebx+4],eax			; (reserved)
400
	and	[ebx+8],eax			; (reserved)
397
	and	[ebx+8],eax			; (reserved)
401
	mov	[ebx+12],dword 10*4		; bytes to write
398
	mov	[ebx+12],dword 10*4		; bytes to write
402
	mov	[ebx+16],dword color_table	; address
399
	mov	[ebx+16],dword color_table	; address
403
	mcall	70
400
	mcall	SF_FILE
404
	ret
401
	ret
405
;---------------------------------------------------------------------
402
;---------------------------------------------------------------------
406
draw_button_row:
403
draw_button_row:
407
	mov	edx,0x40000000 + 31		; BUTTON ROW
404
	mov	edx,0x40000000 + 31		; BUTTON ROW
408
	mov	ebx,(area.w+18)*65536+29
405
	mov	ebx,(area.w+18)*65536+29
Line 468... Line 465...
468
	popa
465
	popa
469
	ret
466
	ret
470
;----------------------------------------------------------------------
467
;----------------------------------------------------------------------
471
draw_PathShow:
468
draw_PathShow:
472
	pusha
469
	pusha
473
	mcall	13,,,0xffffff
470
	mcall	SF_DRAW_RECT,,,0xffffff
474
	mcall	13,,,0xffffff
471
	mcall	SF_DRAW_RECT,,,0xffffff
475
; draw for PathShow
472
; draw for PathShow
476
	push	dword PathShow_data_1
473
	push	dword PathShow_data_1
477
	call	[PathShow_draw]
474
	call	[PathShow_draw]
Line 478... Line 475...
478
	
475
	
Line 483... Line 480...
483
;---------------------------------------------------------------------
480
;---------------------------------------------------------------------
484
;   *********************************************
481
;   *********************************************
485
;   *******  WINDOW DEFINITIONS AND DRAW ********
482
;   *******  WINDOW DEFINITIONS AND DRAW ********
486
;   *********************************************
483
;   *********************************************
487
draw_window:
484
draw_window:
488
	mcall	12,1
485
	mcall	SF_REDRAW,SSF_BEGIN_DRAW
489
	mcall	48,3,app_colours,10*4
486
	mcall	SF_STYLE_SETTINGS,SSF_GET_COLORS,app_colours,10*4
490
	mcall	14
487
	mcall	SF_GET_SCREEN_SIZE
491
	mcall	48,4
488
	mcall	SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
492
	mov	[current_skin_high],eax
489
	mov	[current_skin_high],eax
493
; DRAW WINDOW
490
; DRAW WINDOW
494
	xor	eax,eax		; function 0 : define and draw window
491
	xor	eax,eax		; function 0 : define and draw window
495
	xor	esi,esi
492
	xor	esi,esi
496
	mov	edx,[w_work]	; color of work area RRGGBB,8->color
493
	mov	edx,[w_work]	; color of work area RRGGBB,8->color
497
	or	edx,0x34000000
494
	or	edx,0x34000000
498
	mov	ecx,50 shl 16 + win.h
495
	mov	ecx,50 shl 16 + win.h
499
	add	ecx,[current_skin_high]
496
	add	ecx,[current_skin_high]
500
	mcall	,<110, win.w>,,,,title
497
	mcall	,<110, win.w>,,,,title
Line 501... Line 498...
501
 
498
 
Line 502... Line 499...
502
	mcall	9,procinfo,-1
499
	mcall	SF_THREAD_INFO,procinfo,-1
503
	
500
	
504
	mov	eax,[procinfo+70] ;status of window
501
	mov	eax,[procinfo+70] ;status of window
Line 517... Line 514...
517
;  apply_w = (5*2+6*7)
514
;  apply_w = (5*2+6*7)
518
;end if
515
;end if
519
;-----------------------------------
516
;-----------------------------------
520
; select color DTP frame
517
; select color DTP frame
521
; LOAD BUTTON	; button 12
518
; LOAD BUTTON	; button 12
522
	mcall	8,,,12,[w_work_button]
519
	mcall	SF_DEFINE_BUTTON,,,12,[w_work_button]
523
; SAVE BUTTON
520
; SAVE BUTTON
524
	add	ebx,(load_w+2)*65536-load_w+save_w
521
	add	ebx,(load_w+2)*65536-load_w+save_w
525
	inc	edx
522
	inc	edx
526
	mcall		; button 13
523
	mcall		; button 13
527
; APPLY BUTTON
524
; APPLY BUTTON
528
	mov	ebx,(frame_1.x + frame_1.w - apply_w - 15)*65536+apply_w
525
	mov	ebx,(frame_1.x + frame_1.w - apply_w - 15)*65536+apply_w
529
	mcall	8,,,16	; button 17
526
	mcall	SF_DEFINE_BUTTON,,,16	; button 17
530
; select color DTP button text
527
; select color DTP button text
531
	mcall	4,,[w_work_button_text],t1,t1.size
528
	mcall	SF_DRAW_TEXT,,[w_work_button_text],t1,t1.size
532
;-----------------------------------	
529
;-----------------------------------	
533
; select skin frame	
530
; select skin frame	
534
; LOAD SKIN BUTTON	; button 17
531
; LOAD SKIN BUTTON	; button 17
535
	mcall	8,,,17,[w_work_button]
532
	mcall	SF_DEFINE_BUTTON,,,17,[w_work_button]
536
; 3D
533
; 3D
537
	mov	ebx,(frame_2.x+155)*65536+34
534
	mov	ebx,(frame_2.x+155)*65536+34
538
	mcall	,,,14	; button 14
535
	mcall	,,,14	; button 14
539
; FLAT
536
; FLAT
540
	add	ebx,36*65536-34+flat_w
537
	add	ebx,36*65536-34+flat_w
Line 542... Line 539...
542
	mcall		; button 15
539
	mcall		; button 15
543
; APPLY SKIN BUTTON
540
; APPLY SKIN BUTTON
544
	mov	ebx,(frame_2.x + frame_2.w - apply_w -15)*65536+apply_w
541
	mov	ebx,(frame_2.x + frame_2.w - apply_w -15)*65536+apply_w
545
	mcall	,,,18		; button 18
542
	mcall	,,,18		; button 18
546
; select skin button text
543
; select skin button text
547
	mcall	4,,[w_work_button_text],t2,t2.size
544
	mcall	SF_DRAW_TEXT,,[w_work_button_text],t2,t2.size
548
;-----------------------------------		
545
;-----------------------------------		
549
	call	draw_button_row
546
	call	draw_button_row
550
	call	draw_button_row_of_texts
547
	call	draw_button_row_of_texts
551
	call	draw_colours
548
	call	draw_colours
552
;-----------------------------------
549
;-----------------------------------
Line 574... Line 571...
574
	cmp	dword[not_packed_area+SKIN_HEADER.ident],'SKIN'
571
	cmp	dword[not_packed_area+SKIN_HEADER.ident],'SKIN'
575
	jne	@f
572
	jne	@f
576
	call	draw_skin
573
	call	draw_skin
577
@@:
574
@@:
578
.end:
575
.end:
579
	mcall	12,2
576
	mcall	SF_REDRAW,SSF_END_DRAW
580
	ret
577
	ret
581
;-----------------------------------------------------------------------------
578
;-----------------------------------------------------------------------------
582
include 'drawskin.inc'
579
include 'drawskin.inc'
583
;-----------------------------------------------------------------------------
580
;-----------------------------------------------------------------------------
584
; DATA AREA
581
; DATA AREA