skincfg: save button style

git-svn-id: svn://kolibrios.org@7639 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2019-04-24 12:52:10 +00:00
parent e3ae69008a
commit bf5320cbe8
6 changed files with 23 additions and 10 deletions

View File

@ -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

View File

@ -337,7 +337,6 @@ enum
:unsigned char size[25];
:dword ConvertSizeToKb(unsigned int bytes)
{
unsigned int kb;
dword kb_line;
if (bytes >= 1024)

View File

@ -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"

View File

@ -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 _CHARS equ 255 or eax,eax _CHARS equ 255 jz close_app _CHARS equ 255 ;Import libraries set_program: _CHARS equ 255 invoke ini_get_str, aIni, aMain, aParam, sz_param, PATH_MAX_CHARS, 0 stdcall RunProgram, sz_buffer, sz_param jmp set_skin set_bg: jz close_app ;Import libraries stdcall dll.Load,importTable STARTAPP: STARTAPP: _CHARS equ 255 STARTAPP: STARTAPP: STARTAPP: cmp byte [sz_param + edi], 0 jne @b mov byte [sz_buffer + edi + 4], 0 stdcall RunProgram, sz_buffer, aKiv set_skin: STARTAPP: stdcall dll.Load,importTable 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 or eax,eax stdcall dll.Load,importTable aMain db 'main',0 aBg db 'bg',0 aButton db '3d',0 jz close_app STARTAPP: jz close_app ; Initialize memory jz close_app mcall 68, 11 jz close_app or eax,eax sz_buffer: rb PATH_MAX_CHARS sz_param: ;Import libraries ;Import libraries _CHARS equ 255 ; End of application code and data marker
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 ;Import libraries STARTAPP: ; Initialize memory mcall 68, 11 or eax,eax jz close_app ;Import libraries STARTAPP: 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 ;Import libraries or eax,eax ;Import libraries jz close_app ;Import libraries ;Import libraries _CHARS equ 255 jz close_app ;Import libraries stdcall dll.Load,importTable or eax,eax stdcall dll.Load,importTable stdcall dll.Load,importTable _CHARS equ 255 STARTAPP: mcall 68, 11 set_skin: stdcall dll.Load,importTable 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 _CHARS equ 255 stdcall dll.Load,importTable stdcall dll.Load,importTable STARTAPP: stdcall dll.Load,importTable ; Initialize memory stdcall dll.Load,importTable mcall 68, 11 stdcall dll.Load,importTable or eax,eax aSectionSkn db 'skin',0 aButtonStyle db '3d',0 aSkinPath db 'file',0 sz_buffer: rb PATH_MAX sz_param: test eax, eax test eax, eax _CHARS equ 255 ; End of application code and data marker

View File

@ -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

View File

@ -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: