Subversion Repositories Kolibri OS

Rev

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