Subversion Repositories Kolibri OS

Rev

Rev 7639 | Rev 7870 | 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, aSectionSkn, aButtonStyle, 0
  28.     mov ecx, eax
  29.     mcall 48, 1
  30.        
  31.         ; Set bg or not?
  32.     invoke  ini_get_int, aIni, aSectionBg, aBgActive, 0
  33.     cmp eax, 1
  34.     jne set_skin
  35.  
  36. set_bg:
  37.     invoke  ini_get_str, aIni, aSectionBg, aBgProgram, sz_buffer, PATH_MAX, 0
  38.     invoke  ini_get_str, aIni, aSectionBg, aBgParam, sz_param, PATH_MAX, 0
  39.     m2m     dword [InfoStructure+8],  sz_param ; pointer to the parametrs          
  40.     m2m     dword [InfoStructure+21], sz_buffer ; pointer to the file name          
  41.     mcall   70, InfoStructure    
  42.            
  43. set_skin:                  
  44.     invoke  ini_get_str, aIni, aSectionSkn, aSkinPath, sz_param, PATH_MAX, 0
  45.     mcall   48, 8, sz_param          
  46.  
  47.     mcall   -1
  48.  
  49. proc RunProgram stdcall, app_path:dword, app_param:dword
  50.     m2m     dword [InfoStructure+8],  [app_param] ; pointer to the parametrs          
  51.     m2m     dword [InfoStructure+21], [app_path] ; pointer to the file name          
  52.     mcall   70, InfoStructure          
  53.     ret          
  54. endp          
  55.  
  56.        
  57. importTable:          
  58. library                                                 \          
  59.         libini, 'libini.obj'          
  60.          
  61. import  libini, \          
  62.         ini_get_str  ,'ini_get_str', \          
  63.         ini_get_int  ,'ini_get_int'      
  64.          
  65. InfoStructure:
  66.         dd      7     ; subfunction number          
  67.         dd      0     ; position in the file in bytes          
  68.         dd      ?     ; upper part of the position address          
  69.         dd      0     ; number of bytes to read          
  70.         dd      0     ; pointer to the buffer to write data          
  71.         db      0          
  72.         dd      ?     ; pointer to the filename          
  73.  
  74.          
  75. aIni          db  '/sys/settings/eskin.ini',0          
  76.  
  77. aSectionBg    db  'bg',0
  78. aBgActive     db  'active',0
  79. aBgProgram    db  'program',0
  80. aBgParam      db  'param',0          
  81.  
  82. aSectionSkn   db  'skin',0
  83. aButtonStyle  db  '3d',0          
  84. aSkinPath     db  'file',0
  85.  
  86.  
  87. sz_buffer:
  88.     rb        PATH_MAX
  89. sz_param:          
  90.     rb        PATH_MAX
  91.          
  92. I_END:                ; End of application code and data marker          
  93.        
  94.