From bf5320cbe8d5362d0b211341d62d47784f2d106a Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 24 Apr 2019 12:52:10 +0000 Subject: [PATCH] skincfg: save button style git-svn-id: svn://kolibrios.org@7639 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/common/settings/eskin.ini | 12 +++++------- programs/cmm/lib/fs.h | 1 - programs/cmm/lib/patterns/select_list.h | 1 - programs/system/eskin/trunk/eskin.asm | 2 +- programs/system/skincfg/trunk/idata.inc | 12 ++++++++++++ programs/system/skincfg/trunk/skincfg.asm | 5 +++++ 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/data/common/settings/eskin.ini b/data/common/settings/eskin.ini index 46dddbe415..8bf82043d7 100644 --- a/data/common/settings/eskin.ini +++ b/data/common/settings/eskin.ini @@ -1,6 +1,5 @@ -[main] -bg=1 - +[bg] +active=1 program=/sys/media/fillscr param=105,145,200, 105,145,200, 105,145,200, 60,60,128, 82,102,164, 60,60,128, 60,60,128, 60,60,128, 60,60,128 @@ -8,7 +7,6 @@ param=105,145,200, 105,145,200, 105,145,200, 60,60,128, 82,102,164, 60,60,128, 6 ;param=\S__/rd/1/deink.png ;T=tiled, S=stretched, C=centered -wallpaper= - -3d=0 -skin=/rd1/1/default.skn +[skin] +3d=1 +file=/rd1/1/default.skn diff --git a/programs/cmm/lib/fs.h b/programs/cmm/lib/fs.h index 193d1703e3..97a6d96385 100644 --- a/programs/cmm/lib/fs.h +++ b/programs/cmm/lib/fs.h @@ -337,7 +337,6 @@ enum :unsigned char size[25]; :dword ConvertSizeToKb(unsigned int bytes) { - unsigned int kb; dword kb_line; if (bytes >= 1024) diff --git a/programs/cmm/lib/patterns/select_list.h b/programs/cmm/lib/patterns/select_list.h index 6403687dad..cda6d877e0 100644 --- a/programs/cmm/lib/patterns/select_list.h +++ b/programs/cmm/lib/patterns/select_list.h @@ -1,6 +1,5 @@ llist select_list; scroll_bar scroll1 = { 18,200,398, 44,18,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; -dword select_list_count_offset; ?define T_SELECT_LIST_NO_DATA "No data to show" diff --git a/programs/system/eskin/trunk/eskin.asm b/programs/system/eskin/trunk/eskin.asm index 884f68b944..c16df270a1 100644 --- a/programs/system/eskin/trunk/eskin.asm +++ b/programs/system/eskin/trunk/eskin.asm @@ -1 +1 @@ - use32 org 0x0 db 'MENUET01' ; 8 byte id dd 38 ; required os dd STARTAPP ; program start dd I_END ; program image size dd 0x1000000 ; required amount of memory dd 0x1000000 ; stack heap dd 0x0 dd 0x0 include '../../../proc32.inc' include '../../../macros.inc' include '../../../dll.inc' PATH_MAX_CHARS equ 255 STARTAPP: ; Initialize memory mcall 68, 11 or eax,eax jz close_app ;Import libraries stdcall dll.Load,importTable test eax, eax jnz close_app invoke ini_get_int, aIni, aMain, aButton, 0 mov ecx, eax mcall 48, 1 invoke ini_get_int, aIni, aMain, aBg, 0 cmp eax, 1 jnz set_bg set_program: invoke ini_get_str, aIni, aMain, aProgram, sz_buffer, PATH_MAX_CHARS, 0 invoke ini_get_str, aIni, aMain, aParam, sz_param, PATH_MAX_CHARS, 0 stdcall RunProgram, sz_buffer, sz_param jmp set_skin set_bg: invoke ini_get_str, aIni, aMain, aWallpaper, sz_param, PATH_MAX_CHARS, 0 mov dword [sz_buffer], "\__S" xor edi, edi @@: mov ah, byte [sz_param + edi] mov byte [sz_buffer + edi + 4], ah inc edi cmp byte [sz_param + edi], 0 jne @b mov byte [sz_buffer + edi + 4], 0 stdcall RunProgram, sz_buffer, aKiv set_skin: invoke ini_get_str, aIni, aMain, aSkin, sz_param, PATH_MAX_CHARS, 0 mcall 48, 8, sz_param close_app: mcall -1 proc RunProgram stdcall, app_path:dword, app_param:dword push eax m2m dword [InfoStructure+8], [app_param] ; pointer to the parametrs m2m dword [InfoStructure+21], [app_path] ; pointer to the file name mcall 70, InfoStructure pop eax ret endp align 16 importTable: library \ libini, 'libini.obj' import libini, \ ini_get_str ,'ini_get_str', \ ini_get_int ,'ini_get_int' InfoStructure: dd 7 ; subfunction number dd 0 ; position in the file in bytes dd ? ; upper part of the position address dd 0 ; number of bytes to read dd 0 ; pointer to the buffer to write data db 0 dd ? ; pointer to the filename aIni db '/sys/settings/eskin.ini',0 aKiv db '/sys/media/kiv',0 aMain db 'main',0 aBg db 'bg',0 aButton db '3d',0 aSkin db 'skin',0 aWallpaper db 'wallpaper',0 aProgram db 'program',0 aParam db 'param',0 sz_buffer: rb PATH_MAX_CHARS sz_param: rb PATH_MAX_CHARS I_END: ; End of application code and data marker \ No newline at end of file + use32 org 0x0 db 'MENUET01' ; 8 byte id dd 38 ; required os dd STARTAPP ; program start dd I_END ; program image size dd 0x1000000 ; required amount of memory dd 0x1000000 ; stack heap dd 0x0 dd 0x0 include '../../../proc32.inc' include '../../../macros.inc' include '../../../dll.inc' PATH_MAX equ 255 STARTAPP: ; Initialize memory mcall 68, 11 or eax,eax jz close_app ; Import libraries stdcall dll.Load,importTable test eax, eax jnz close_app ; Set button style: flat or gradient (3D) invoke ini_get_int, aIni, aSectionSkn, aButtonStyle, 0 mov ecx, eax mcall 48, 1 ; Set bg or not? invoke ini_get_int, aIni, aSectionBg, aBgActive, 0 cmp eax, 1 jne set_skin set_bg: invoke ini_get_str, aIni, aSectionBg, aBgProgram, sz_buffer, PATH_MAX, 0 invoke ini_get_str, aIni, aSectionBg, aBgParam, sz_param, PATH_MAX, 0 stdcall RunProgram, sz_buffer, sz_param set_skin: invoke ini_get_str, aIni, aSectionSkn, aSkinPath, sz_param, PATH_MAX, 0 mcall 48, 8, sz_param close_app: mcall -1 proc RunProgram stdcall, app_path:dword, app_param:dword push eax m2m dword [InfoStructure+8], [app_param] ; pointer to the parametrs m2m dword [InfoStructure+21], [app_path] ; pointer to the file name mcall 70, InfoStructure pop eax ret endp align 16 importTable: library \ libini, 'libini.obj' import libini, \ ini_get_str ,'ini_get_str', \ ini_get_int ,'ini_get_int' InfoStructure: dd 7 ; subfunction number dd 0 ; position in the file in bytes dd ? ; upper part of the position address dd 0 ; number of bytes to read dd 0 ; pointer to the buffer to write data db 0 dd ? ; pointer to the filename aIni db '/sys/settings/eskin.ini',0 aSectionBg db 'bg',0 aBgActive db 'active',0 aBgProgram db 'program',0 aBgParam db 'param',0 aSectionSkn db 'skin',0 aButtonStyle db '3d',0 aSkinPath db 'file',0 sz_buffer: rb PATH_MAX sz_param: rb PATH_MAX I_END: ; End of application code and data marker \ No newline at end of file diff --git a/programs/system/skincfg/trunk/idata.inc b/programs/system/skincfg/trunk/idata.inc index 4409dd77c9..2e4288a535 100644 --- a/programs/system/skincfg/trunk/idata.inc +++ b/programs/system/skincfg/trunk/idata.inc @@ -108,6 +108,17 @@ else title db 'Windows settings',0 end if ;--------------------------------------------------------------------- +LibIniImportTable: +library \ + libini, 'libini.obj' + +import libini, \ + ini_set_int ,'ini_set_int' + +aIni db '/sys/settings/eskin.ini',0 +aSectionSkn db 'skin',0 +aButtonStyle db '3d',0 +;--------------------------------------------------------------------- l_libs_start: library01 l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \ @@ -132,6 +143,7 @@ err_message_import2 db 'proc_lib.obj - Wrong import!',0 ;--------------------------------------------------------------------- align 4 + ProcLib_import: OpenDialog_Init dd aOpenDialog_Init OpenDialog_Start dd aOpenDialog_Start diff --git a/programs/system/skincfg/trunk/skincfg.asm b/programs/system/skincfg/trunk/skincfg.asm index 12bac52ed8..fb0014dfdc 100644 --- a/programs/system/skincfg/trunk/skincfg.asm +++ b/programs/system/skincfg/trunk/skincfg.asm @@ -27,8 +27,10 @@ dd cur_dir_path ; path to file include 'lang.inc' +include '../../../proc32.inc' include '../../../config.inc' ;for nightbuild include '../../../macros.inc' +include '../../../dll.inc' include 'kglobals.inc' include 'unpacker.inc' include '../../../develop/libraries/box_lib/load_lib.mac' @@ -94,6 +96,7 @@ START: ; start of execution test eax,eax jz close +stdcall dll.Load,LibIniImportTable load_libraries l_libs_start,end_l_libs ;if return code =-1 then exit, else nornary work @@ -200,12 +203,14 @@ no_save: jne no_3d mcall 48,1,1 + invoke ini_set_int, aIni, aSectionSkn, aButtonStyle, 1 jmp doapply ;-------------------------------------- no_3d: cmp ah,15 ; set flat buttons jne no_flat + invoke ini_set_int, aIni, aSectionSkn, aButtonStyle, 0 mcall 48, 1, 0 ;-------------------------------------- doapply: