Subversion Repositories Kolibri OS

Rev

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

  1.  
  2. ; END
  3. ; KolibriOS Team 2005-2015
  4.  
  5. fade equ 0
  6.  
  7. use32        ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
  8. org 0x0      ;  ¤à¥á æ¨ï á ­ã«ï
  9.  
  10. db 'MENUET01'    ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
  11. dd 0x01          ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
  12. dd START         ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
  13. dd IM_END        ; à §¬¥à ¯à®£à ¬¬ë
  14. dd I_END         ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
  15. dd stacktop      ;  ¤à¥á ¢¥à設ë á⥪ 
  16. dd 0x0           ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢
  17. dd cur_dir_path
  18.  
  19. include 'lang.inc'
  20. include '../../../macros.inc'
  21. include '../../../proc32.inc'
  22. include '../../../dll.inc'
  23. include '../../../develop/libraries/box_lib/load_lib.mac'
  24. include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
  25. include '../../../gui_patterns.inc'
  26.  
  27. @use_library
  28.  
  29.        
  30. align 4
  31. START:
  32.  
  33.  
  34. load_libraries l_libs_start,end_l_libs
  35.         inc     eax
  36.         test    eax,eax
  37.         jz      close
  38.  
  39. push    dword check1
  40. call    [init_checkbox2]
  41.  
  42. stdcall dll.Init,[init_lib]
  43.  
  44. invoke  ini_get_int,ini_file,asettings,aautosave,0
  45.         mov   [autosave],eax
  46.         dec   eax
  47.         jnz   @f
  48.         bts   dword [check1.flags],1
  49. @@:
  50.         mcall   40,0x80000027
  51. redraw:
  52.     call draw_window
  53. still:
  54.     mov  al,10
  55.     mcall                                    ;wait here for event
  56.     dec  eax
  57.     jz   redraw
  58.     dec  eax
  59.     jz   key
  60.     dec  eax
  61.     jz   button
  62.  
  63.     push dword check1
  64.     call [check_box_mouse2]
  65.     bt   dword [check1.flags],1
  66.     jnc  @f
  67.     mov  [autosave],1
  68.     jmp  still
  69. @@:
  70.     mov  [autosave],0
  71.     jmp  still
  72.  
  73. key:
  74.     mov  al,2
  75.     mcall                                    ;eax=2 - get key code
  76.     mov  al,ah
  77.      cmp  al,13
  78.      je   restart
  79.      cmp  al,19
  80.      je   checkbox
  81.      cmp  al,180
  82.      je   restart_kernel
  83.      cmp  al,181
  84.      je   power_off
  85.      cmp  al,27
  86.      jne   still
  87.  
  88. close:
  89.     mcall -1
  90.  
  91. button:
  92.     mcall 17                                 ;eax=17 - get pressed button id
  93.     xchg al,ah
  94.     dec  eax
  95.     jz   close
  96.     dec  eax
  97.     jz   restart_kernel
  98.     dec  eax
  99.     jz   restart
  100.     dec  eax
  101.     jnz  checkbox
  102.  
  103. power_off:
  104.     push 2
  105.     jmp  mcall_and_close
  106.  
  107. restart:
  108.     push 3
  109.     jmp  mcall_and_close
  110.  
  111. restart_kernel:
  112.     push 4
  113.  
  114. mcall_and_close:
  115. if fade=1
  116.  ; === FADE IN ===
  117.     mov eax, color1
  118.   @@:
  119.     mov ebx, [eax + 32]
  120.     mov [eax], ebx
  121.     add eax, 4
  122.     cmp eax, color21
  123.     jne @b
  124.  
  125.     call    draw_window
  126. end if
  127.  
  128.     invoke  ini_set_int,ini_file,asettings,aautosave,[autosave]
  129.     cmp  [autosave],1
  130.     jne   no_save
  131.  
  132. if fade=0
  133.     mov   al,4
  134.     mcall   ,<50,120> ,0x800000cc,label7        ;eax=4 - write text
  135. end if
  136.  
  137.     mcall 70,rdsave
  138.     test  eax,eax
  139.     js    no_save
  140.     mov   ecx,eax
  141.     mcall 18,21
  142.     mov   ecx,eax
  143. @@:
  144.     push ecx
  145.     mcall 23,100
  146.     dec   eax
  147.     jnz   no_red
  148.     call draw_window
  149. no_red:
  150.     pop   ecx
  151.     mcall 9,proc_info
  152.     cmp   [proc_info+50],9
  153.     je    no_save
  154.     jmp   @b
  155. no_save:
  156.     pop  ecx
  157.   mcall 18,9
  158. ret
  159.  
  160. checkbox:
  161.     btc   dword [check1.flags],1
  162.     jc    .1
  163.     mov   [autosave],1
  164.     jmp   .draw
  165. .1:
  166.     mov   [autosave],0
  167. .draw:
  168.     push  dword check1
  169.     call  [check_box_draw2]
  170.     jmp    still
  171.  
  172. draw_window:
  173.     mcall 12,1
  174.  
  175.     mov   al,14
  176.     mcall                                    ;eax=14 - get screen max x & max y
  177.     movzx ecx,ax
  178.     shr   eax,17
  179.     shl   eax,16
  180.     lea   ebx,[eax-165 shl 16+332]
  181.     shr   ecx,1
  182.     shl   ecx,16
  183.     lea   ecx,[ecx-70 shl 16+132]
  184.  
  185.     xor   eax,eax
  186.         mov edx, 0x01000000
  187.         mcall ;define and draw window  
  188.  
  189.         DrawRectangle 0,0,332,132,[color1]
  190.     mov   al,13
  191.     mcall   ,<1,331>,<1,1>,[color2]
  192.         mcall   ,<1,1>,<1,131>
  193.     mcall   ,<2,330>,<2,130>, [color3]
  194.  
  195.     mov   al,8
  196.     mcall   ,<16,144> ,<16,36>,4,[color4]     ;eax=8 - draw buttons
  197.     mcall   ,<170,144>,       ,2,[color5]
  198.     mcall   ,         ,<62,36>,1,[color6]
  199.     mcall   ,<16,144> ,       ,3,[color7]
  200.  
  201.     mov   al,4
  202.     mcall   ,<28,19> ,[color8],label2        ;eax=4 - write text
  203.     mcall   ,<28,65> ,        ,label3
  204.     mcall   ,<64,40> ,[color9],label5
  205.     mcall   ,<64,86> ,       ,label6
  206.  
  207.     push  dword check1
  208.     call  [check_box_draw2]
  209.  
  210.     mov   al,12
  211.     mcall   ,2
  212.     ret
  213. ;---------------------------------------------------------------------
  214. ;data
  215. include 'data.inc'
  216. ;---------------------------------------------------------------------
  217. IM_END:
  218. ;---------------------------------------------------------------------
  219. align 4
  220.  
  221. proc_info  rb 1024
  222.  
  223. autosave rd 1
  224. ;---------------------------------------------------------------------
  225. cur_dir_path:
  226.         rb 4096
  227. ;---------------------------------------------------------------------
  228. library_path:
  229.         rb 4096
  230. ;---------------------------------------------------------------------
  231. align 32
  232.         rb 4096
  233. stacktop:
  234. I_END:  ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë