Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9641 → Rev 9632

/programs/system/skincfg/trunk/skincfg.asm
97,7 → 97,7
;---------------------------------------------------------------------
START: ; start of execution
;---------------------------------------------------------------------
mcall SF_SYS_MISC,SSF_HEAP_INIT
mcall 68,11
test eax,eax
jz close
118,11 → 118,14
stdcall string.length, app_param
add eax, app_param
mov ecx, [eax-4]
or ecx, 0x20202000 ;letters to lowercase
cmp ecx, '.skn'
je load_skin_from_param
cmp ecx, '.SKN'
je load_skin_from_param
cmp ecx, '.dtp'
je load_dtp_from_param
cmp ecx, '.DTP'
je load_dtp_from_param
jmp no_param
load_dtp_from_param:
136,7 → 139,7
jmp skin_path_ready
 
no_param:
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,color_table,4*10 ; get current colors
mcall 48,3,color_table,4*10 ; get current colors
call load_skin_file.2
skin_path_ready:
163,7 → 166,7
call draw_window ; at first, draw the window
;---------------------------------------------------------------------
still:
mcall SF_WAIT_EVENT
mcall 10 ; wait here for event
 
dec eax ; redraw request ?
jz red
177,11 → 180,11
jmp still
;---------------------------------------------------------------------
key: ; key
mcall SF_GET_KEY
mcall 2 ; just read it and ignore
jmp still
;---------------------------------------------------------------------
button: ; button
mcall SF_GET_BUTTON
mcall 17 ; get id
 
cmp ah,12 ; load file
jne no_load
201,7 → 204,7
cmp ah,14 ; set 3d buttons
jne no_3d
 
mcall SF_STYLE_SETTINGS,SSF_SET_BUTTON_STYLE,1
mcall 48,1,1
invoke ini_set_int, aIni, aSectionSkn, aButtonStyle, 1
jmp doapply
;--------------------------------------
210,10 → 213,10
jne no_flat
 
invoke ini_set_int, aIni, aSectionSkn, aButtonStyle, 0
mcall SF_STYLE_SETTINGS,SSF_SET_BUTTON_STYLE, 0
mcall 48, 1, 0
;--------------------------------------
doapply:
mcall SF_STYLE_SETTINGS,SSF_APPLY, 0
mcall 48, 0, 0
jmp still
;--------------------------------------
no_flat:
221,7 → 224,7
jne no_apply
;--------------------------------------
apply_direct:
mcall SF_STYLE_SETTINGS,SSF_SET_COLORS,color_table,10*4
mcall 48,2,color_table,10*4
jmp doapply
;--------------------------------------
no_apply:
239,7 → 242,7
cmp [skin_info],0
je no_apply_skin
 
mcall SF_STYLE_SETTINGS,SSF_SET_SKIN,skin_info
mcall 48,8,skin_info
call draw_window
jmp still
;--------------------------------------
314,7 → 317,7
mov dword [ebx+8], eax ; offset (high dword)
mov dword [ebx+12], 40 ; read colors file: 4*10 bytes
mov dword [ebx+16], color_table ; address
mcall SF_FILE
mcall 70
ret
;---------------------------------------------------------------------
load_skin_file:
340,7 → 343,7
mov dword [ebx+8], eax ; offset (high dword)
mov dword [ebx+12], 32*1024 ; read: max 32 KBytes
mov dword [ebx+16], file_load_area ; address
mcall SF_FILE
mcall 70
 
mov esi, file_load_area
 
397,7 → 400,7
and [ebx+8],eax ; (reserved)
mov [ebx+12],dword 10*4 ; bytes to write
mov [ebx+16],dword color_table ; address
mcall SF_FILE
mcall 70
ret
;---------------------------------------------------------------------
draw_button_row:
467,8 → 470,8
;----------------------------------------------------------------------
draw_PathShow:
pusha
mcall SF_DRAW_RECT,<frame_1.x+10,frame_1.w-25>,<frame_1.y+16,15>,0xffffff
mcall SF_DRAW_RECT,<frame_2.x+10,frame_2.w-25>,<frame_2.y+16,15>,0xffffff
mcall 13,<frame_1.x+10,frame_1.w-25>,<frame_1.y+16,15>,0xffffff
mcall 13,<frame_2.x+10,frame_2.w-25>,<frame_2.y+16,15>,0xffffff
; draw for PathShow
push dword PathShow_data_1
call [PathShow_draw]
482,10 → 485,10
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
mcall SF_REDRAW,SSF_BEGIN_DRAW
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,app_colours,10*4
mcall SF_GET_SCREEN_SIZE
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
mcall 12,1
mcall 48,3,app_colours,10*4
mcall 14
mcall 48,4
mov [current_skin_high],eax
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
496,7 → 499,7
add ecx,[current_skin_high]
mcall ,<110, win.w>,,,,title
 
mcall SF_THREAD_INFO,procinfo,-1
mcall 9,procinfo,-1
mov eax,[procinfo+70] ;status of window
test eax,100b
516,7 → 519,7
;-----------------------------------
; select color DTP frame
; LOAD BUTTON ; button 12
mcall SF_DEFINE_BUTTON,<frame_1.x+10,load_w>,<frame_1.y+38,18>,12,[w_work_button]
mcall 8,<frame_1.x+10,load_w>,<frame_1.y+38,18>,12,[w_work_button]
; SAVE BUTTON
add ebx,(load_w+2)*65536-load_w+save_w
inc edx
523,13 → 526,13
mcall ; button 13
; APPLY BUTTON
mov ebx,(frame_1.x + frame_1.w - apply_w - 15)*65536+apply_w
mcall SF_DEFINE_BUTTON,,,16 ; button 17
mcall 8,,,16 ; button 17
; select color DTP button text
mcall SF_DRAW_TEXT,<frame_1.x+16,frame_1.y+44>,[w_work_button_text],t1,t1.size
mcall 4,<frame_1.x+16,frame_1.y+44>,[w_work_button_text],t1,t1.size
;-----------------------------------
; select skin frame
; LOAD SKIN BUTTON ; button 17
mcall SF_DEFINE_BUTTON,<frame_2.x+10,load_w>,<frame_2.y+38,18>,17,[w_work_button]
mcall 8,<frame_2.x+10,load_w>,<frame_2.y+38,18>,17,[w_work_button]
; 3D
mov ebx,(frame_2.x+155)*65536+34
mcall ,,,14 ; button 14
541,7 → 544,7
mov ebx,(frame_2.x + frame_2.w - apply_w -15)*65536+apply_w
mcall ,,,18 ; button 18
; select skin button text
mcall SF_DRAW_TEXT,<frame_2.x+16,frame_2.y+44>,[w_work_button_text],t2,t2.size
mcall 4,<frame_2.x+16,frame_2.y+44>,[w_work_button_text],t2,t2.size
;-----------------------------------
call draw_button_row
call draw_button_row_of_texts
573,7 → 576,7
call draw_skin
@@:
.end:
mcall SF_REDRAW,SSF_END_DRAW
mcall 12,2
ret
;-----------------------------------------------------------------------------
include 'drawskin.inc'