Subversion Repositories Kolibri OS

Rev

Rev 7870 | Rev 7938 | 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.         cmp     byte [sz_param], 0 ;no need to set skin it was not specified
  41.         je      @f
  42.         ;mcall   63, 1, '0' ;debug
  43.     mcall   48, 8, sz_param          
  44. @@:
  45.     mcall   -1
  46.  
  47. proc RunProgram stdcall, app_path:dword, app_param:dword
  48.     m2m     dword [InfoStructure+8],  [app_param] ; pointer to the parametrs          
  49.     m2m     dword [InfoStructure+21], [app_path] ; pointer to the file name          
  50.     mcall   70, InfoStructure          
  51.     ret          
  52. endp      
  53.  
  54.        
  55. importTable:          
  56. library                                                 \          
  57.         libini, 'libini.obj'          
  58.          
  59. import  libini, \          
  60.         ini_get_str  ,'ini_get_str', \          
  61.         ini_get_int  ,'ini_get_int'      
  62.          
  63. InfoStructure:
  64.         dd      7     ; subfunction number          
  65.         dd      0     ; position in the file in bytes          
  66.         dd      ?     ; upper part of the position address          
  67.         dd      0     ; number of bytes to read          
  68.         dd      0     ; pointer to the buffer to write data          
  69.         db      0          
  70.         dd      ?     ; pointer to the filename          
  71.  
  72.          
  73. aIni          db  '/sys/settings/system.ini',0          
  74. aSection      db  'style',0
  75.  
  76. aBgProgram    db  'bg_program',0
  77. aBgParam      db  'bg_param',0          
  78. aButtonStyle  db  'buttons_gradient',0
  79. aSkinPath     db  'skin',0
  80.  
  81. sz_buffer:
  82.     rb        PATH_MAX
  83. sz_param:          
  84.     rb        PATH_MAX
  85.          
  86. I_END:                ; End of application code and data marker          
  87.        
  88.