Subversion Repositories Kolibri OS

Rev

Rev 7640 | Rev 7872 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  use32          
  2.         org     0x0          
  3.          
  4.         db      'MENUET01'      ; 8 byte id          
  5.         dd      38              ; required os          
  6.         dd      STARTAPP        ; program start          
  7.         dd      I_END           ; program image size          
  8.         dd      0x1000000       ; required amount of memory          
  9.         dd      0x1000000       ; stack heap          
  10.         dd      0x0
  11.         dd      0x0          
  12.                    
  13. include '../../../proc32.inc'          
  14. include '../../../macros.inc'          
  15. include '../../../dll.inc'          
  16.  
  17.          
  18. PATH_MAX equ 255          
  19.  
  20. STARTAPP:          
  21.     ; Initialize memory          
  22.     mcall   68, 11        
  23.     ; Import libraries          
  24.     stdcall dll.Load,importTable       
  25.    
  26.         ; Set button style: flat or gradient (3D)
  27.     invoke  ini_get_int, aIni, aSection, aButtonStyle, 0
  28.     mov ecx, eax
  29.     mcall 48, 1
  30.  
  31. set_bg:
  32.     invoke  ini_get_str, aIni, aSection, aBgProgram, sz_buffer, PATH_MAX, 0
  33.     invoke  ini_get_str, aIni, aSection, aBgParam, sz_param, PATH_MAX, 0
  34.     m2m     dword [InfoStructure+8],  sz_param ; pointer to the parametrs          
  35.     m2m     dword [InfoStructure+21], sz_buffer ; pointer to the file name          
  36.     mcall   70, InfoStructure    
  37.            
  38. set_skin:                  
  39.     invoke  ini_get_str, aIni, aSection, aSkinPath, sz_param, PATH_MAX, 0
  40.     mcall   48, 8, sz_param          
  41.  
  42.     mcall   -1
  43.  
  44. proc RunProgram stdcall, app_path:dword, app_param:dword
  45.     m2m     dword [InfoStructure+8],  [app_param] ; pointer to the parametrs          
  46.     m2m     dword [InfoStructure+21], [app_path] ; pointer to the file name          
  47.     mcall   70, InfoStructure          
  48.     ret          
  49. endp          
  50.  
  51.        
  52. importTable:          
  53. library                                                 \          
  54.         libini, 'libini.obj'          
  55.          
  56. import  libini, \          
  57.         ini_get_str  ,'ini_get_str', \          
  58.         ini_get_int  ,'ini_get_int'      
  59.          
  60. InfoStructure:
  61.         dd      7     ; subfunction number          
  62.         dd      0     ; position in the file in bytes          
  63.         dd      ?     ; upper part of the position address          
  64.         dd      0     ; number of bytes to read          
  65.         dd      0     ; pointer to the buffer to write data          
  66.         db      0          
  67.         dd      ?     ; pointer to the filename          
  68.  
  69.          
  70. aIni          db  '/sys/settings/system.ini',0          
  71. aSection      db  'style',0
  72.  
  73. aBgProgram    db  'bg_program',0
  74. aBgParam      db  'bg_param',0          
  75. aButtonStyle  db  'buttons_gradient',0
  76. aSkinPath     db  'skin',0
  77.  
  78. sz_buffer:
  79.     rb        PATH_MAX
  80. sz_param:          
  81.     rb        PATH_MAX
  82.          
  83. I_END:                ; End of application code and data marker          
  84.        
  85.