forked from KolibriOS/kolibrios
1d3e5422e8
git-svn-id: svn://kolibrios.org@7870 a494cfbc-eb01-0410-851d-a64ba20cac60
1 line
2.8 KiB
NASM
1 line
2.8 KiB
NASM
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
|
|
; Import libraries
|
|
stdcall dll.Load,importTable
|
|
|
|
; Set button style: flat or gradient (3D)
|
|
invoke ini_get_int, aIni, aSection, aButtonStyle, 0
|
|
mov ecx, eax
|
|
mcall 48, 1
|
|
|
|
set_bg:
|
|
invoke ini_get_str, aIni, aSection, aBgProgram, sz_buffer, PATH_MAX, 0
|
|
invoke ini_get_str, aIni, aSection, aBgParam, sz_param, PATH_MAX, 0
|
|
m2m dword [InfoStructure+8], sz_param ; pointer to the parametrs
|
|
m2m dword [InfoStructure+21], sz_buffer ; pointer to the file name
|
|
mcall 70, InfoStructure
|
|
|
|
set_skin:
|
|
invoke ini_get_str, aIni, aSection, aSkinPath, sz_param, PATH_MAX, 0
|
|
mcall 48, 8, sz_param
|
|
|
|
mcall -1
|
|
|
|
proc RunProgram stdcall, app_path:dword, app_param:dword
|
|
m2m dword [InfoStructure+8], [app_param] ; pointer to the parametrs
|
|
m2m dword [InfoStructure+21], [app_path] ; pointer to the file name
|
|
mcall 70, InfoStructure
|
|
ret
|
|
endp
|
|
|
|
|
|
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/system.ini',0
|
|
aSection db 'style',0
|
|
|
|
aBgProgram db 'bg_program',0
|
|
aBgParam db 'bg_param',0
|
|
aButtonStyle db 'buttons_gradient',0
|
|
aSkinPath db 'skin',0
|
|
|
|
sz_buffer:
|
|
rb PATH_MAX
|
|
sz_param:
|
|
rb PATH_MAX
|
|
|
|
I_END: ; End of application code and data marker
|
|
|