Subversion Repositories Kolibri OS

Rev

Rev 2532 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;                                                   ;
  3. ;   TASK PANEL for KolibriOS  - Compile with fasm   ;
  4. ;                                                   ;
  5. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6. ;------------------------------------------------------------------------------
  7. ; version:      2.0
  8. ; last update:  17/04/2012
  9. ; changed by:   Marat Zakiyanov aka Mario79, aka Mario
  10. ; changes:      New logic of switching windows (turnoff/restore)
  11. ;               New logic of button "clear desktop".
  12. ;               Win+D (restore/clear desktop), Win+R (start RUN application).
  13. ;               Using the library LibINI to set the parameters.
  14. ;               New style of panel. Start application Menu with boot options.
  15. ;               two versions of the location of the panel -
  16. ;               the bottom of the desktop and on top of the desktop.
  17. ;------------------------------------------------------------------------------
  18. ; last update:  31/03/2012
  19. ; changed by:   Marat Zakiyanov aka Mario79, aka Mario
  20. ; changes:      The program uses only 20 Kb memory is now.
  21. ;               Code optimizing and refactoring.
  22. ;------------------------------------------------------------------------------
  23.         use32
  24.         org 0x0
  25.         db 'MENUET01'   ; 8 byte id
  26.         dd 0x01         ; header version
  27.         dd START        ; program start
  28.         dd IM_END       ; program image size
  29.         dd I_END        ; reguired amount of memory - 10 Kb
  30.         dd stack_top    ; esp
  31.         dd 0x0          ; boot parameters
  32.         dd path         ; application pach
  33. ;------------------------------------------------------------------------------
  34. include 'lang.inc'
  35. include '../../../macros.inc'
  36. include '../../../proc32.inc'
  37. ;include 'debug.inc'
  38. include 'MOI.INC'       ;à áª« ¤ª¨ ª« ¢¨ âãàë
  39. include '../../../develop/libraries/box_lib/load_lib.mac'
  40.         @use_library    ;use load lib macros
  41. ;------------------------------------------------------------------------------
  42. caps_lock_check fix 1
  43. ;------------------------------------------------------------------------------
  44. time_bgr_color = 0x66cc
  45. ;PANEL_HEIGHT = 18
  46. ML_SIZE = 10
  47. MR_SIZE = 10
  48. MENU_SIZE = 50
  49. CLD_SIZE = 20
  50. TAB_SIZE = 60
  51. TRAY_SIZE = 140
  52.  
  53. CLOCK_SIZE = 40
  54. CPU_USAGE_SIZE = 10
  55. CHLANG_SIZE = 20
  56. PAGE_LIST_SIZE = 36
  57. ;------------------------------------------------------------------------------
  58. align 4
  59. handle_key:
  60.         mcall   18,7
  61.         mov     [active_process],eax
  62.  
  63.         mcall   2
  64.        
  65. ;       dps     "panel key: "
  66. ;       dph     eax
  67. ;       newline
  68.  
  69.         cmp     al, 2
  70.         jnz     begin_1.ret
  71.  
  72.         mov     ebx, exec_fileinfo
  73.         shr     eax, 8
  74.         cmp     al, 0
  75.         je      prod
  76.  
  77.         mov     [key_r],al
  78.         sub     [key_r],2
  79.         cmp     al, 2
  80.         jz      alter
  81.  
  82.         cmp     al, 3
  83.         jz      alter
  84.  
  85.         cmp     al, 4
  86.         jz      alter
  87.  
  88.         cmp     al, 5
  89.         jz      alter
  90.  
  91.         cmp     al, 6
  92.         jz      alter
  93.  
  94.         cmp     al, 7
  95.         jz      alter
  96.  
  97.         cmp     al, 8
  98.         jz      alter
  99. ;--------------------------------------
  100. ;align 4
  101. ;prod:
  102. if caps_lock_check
  103.         cmp     al,58   ;CAPS LOCK DOWN
  104.         jne     @f
  105.  
  106.         pusha
  107.         mcall   26,2,9
  108.         mov     ebx,eax
  109.         mov     eax,2
  110. ;       call    draw_window ;;;???
  111.         mov     [draw_flag_certainly],1
  112.         call    draw_flag       ; language
  113.         popa
  114.         ret
  115. @@:
  116. end if
  117.         cmp     al, 15  ; Alt+Tab DOWN
  118.         jz      alt_tab_pressed
  119.  
  120.         cmp     al, 88  ; Ctrl+Alt+F12
  121.         jz      start_end_application
  122.  
  123.        
  124.        
  125.         cmp     al, 91  ; RWin DOWN
  126.         jz      set_win_key_flag
  127.  
  128.         cmp     al, 92  ; LWin DOWN
  129.         jz      set_win_key_flag
  130.        
  131.        
  132.         cmp     al, 219 ; RWin UP
  133.         jz      cut_win_key_flag        ;start_menu_application
  134.  
  135.         cmp     al, 220 ; LWin UP
  136.         jz      cut_win_key_flag        ;start_menu_application
  137.        
  138.  
  139.         cmp     al, 62  ; Alt+F4
  140.         jz      kill_active_application
  141.  
  142. ;       cmp     al, 71
  143. ;       jz      page_list_next
  144.  
  145. ;       cmp     al, 72
  146. ;       jz      page_list_prev
  147.  
  148.         cmp     al, 69  ; Alt+Shift+NumLock
  149.         jz      start_mousemul_application
  150.        
  151.         cmp     al, 19  ; Win+R
  152.         jz      start_run_application
  153.  
  154.         cmp     al, 32  ; Win+D
  155.         jz      minimize_all_windows
  156. ;--------------------------------------
  157. align 4
  158. prod:
  159. ;       cmp     eax,0x20000
  160. ;       je      start_menu_application
  161.        
  162. ;       cmp     eax,0x40000
  163. ;       je      start_menu_application
  164.  
  165.         cmp     [current_alt_tab_app], -1
  166.         jz      @f
  167.  
  168.         test    ah, 0x30        ; Alt+Tab UP
  169.         jz      alt_tab_released
  170. ;--------------------------------------
  171. align 4
  172. @@:
  173. ; this is hotkey Ctrl+Shift ;or LShift+RShift
  174.         jmp     karu
  175. ;       mov     ebx, setup_exec
  176. ;       test    ah, 001100b
  177. ;       jz      change_sys_lang
  178. ;------------------------------------------------------------------------------
  179. align 4
  180. set_win_key_flag:
  181.         mov     [win_key_flag],1
  182.         ret
  183. ;------------------------------------------------------------------------------
  184. align 4
  185. cut_win_key_flag:
  186.         xor     eax,eax
  187.         mov     [win_key_flag],al
  188.         xchg    [start_menu_flag],al
  189.         test    al,al
  190.         jz      start_menu_application
  191.         ret
  192. ;------------------------------------------------------------------------------
  193. align 4
  194. change_key_lang:
  195.         mov     dword [ebx+8], chlang
  196.         mcall   70
  197. ;--------------------------------------
  198. align 4
  199. begin_1:
  200.         mov     ecx,[active_process]
  201.         mcall   18, 3
  202.         mcall   5, 25
  203. ;--------------------------------------
  204. align 4
  205. .ret:
  206.         ret
  207. ;------------------------------------------------------------------------------
  208. ;align 4
  209. ;change_sys_lang:
  210. ;       mov        dword [ebx+8], syslang
  211. ;        mcall   70
  212. ;        jmp     begin_1
  213. ;------------------------------------------------------------------------------
  214. align 4
  215. start_end_application:
  216.         mov     dword [ebx+21],end_name
  217.         mcall   70
  218.         ret
  219. ;------------------------------------------------------------------------------
  220. align 4
  221. start_mousemul_application:
  222.         mov     dword [ebx+21],mousemul_name
  223.         mcall   70
  224.         ret
  225. ;------------------------------------------------------------------------------
  226. align 4
  227. kill_active_application:
  228.         mcall   72,1,3,1
  229.         jmp     begin_1.ret
  230. ;------------------------------------------------------------------------------
  231.  
  232. align 4
  233. start_menu_application:
  234.         mov     [draw_window_1], 1
  235.         call    menu_handler
  236.         jmp     begin_1.ret
  237. ;------------------------------------------------------------------------------
  238. align 4
  239. start_run_application:
  240.         cmp     [win_key_flag],1
  241.         je      @f
  242.         ret
  243. @@:
  244.         mov     [start_menu_flag],1
  245.         mov     [draw_window_1], 1
  246.         mov     dword [ebx+21], run_name
  247.         mcall   70
  248.         jmp     begin_1.ret
  249. ;------------------------------------------------------------------------------
  250. align 4
  251. minimize_all_windows:
  252.         cmp     [win_key_flag],1
  253.         je      @f
  254.         ret
  255. @@:
  256.         mov     [start_menu_flag],1
  257.         call    clean_desktop
  258.         ret
  259. ;------------------------------------------------------------------------------
  260. ;align 4
  261. ;page_list_next:
  262. ;       cmp     [page_list],15
  263. ;       je      @f
  264. ;
  265. ;       inc     [page_list]
  266. ;       mov     [draw_window_1],1
  267. ;@@:
  268. ;       jmp  begin_1.ret
  269. ;------------------------------------------------------------------------------
  270. ;align 4
  271. ;page_list_prev:
  272. ;       cmp     [page_list],0
  273. ;       je      @f
  274. ;
  275. ;       dec     [page_list]
  276. ;       mov     [draw_window_1],1
  277. ;@@:
  278. ;       jmp  begin_1.ret
  279. ;------------------------------------------------------------------------------
  280. align 4
  281. alt_tab_pressed:
  282. ; handle Alt+Tab and Alt+Shift+Tab
  283.         mov     ebp, eax
  284.         cmp     [current_alt_tab_app], -1
  285.         jnz     has_alt_tab_app
  286. ; § ¯®«­ï¥¬ â ¡«¨æ㠯ਫ®¦¥­¨©, ¯®¤«¥¦ é¨å ¯¥à¥ª«î祭¨î
  287.         xor     edx, edx
  288.         mov     ebx, procinfo_window_tabs
  289.         mov     ecx, 1
  290. .fill:
  291.         inc     ecx
  292.         mcall   9
  293.         call    need_window_tab
  294.         jz      @f
  295.  
  296.         cmp     edx, 256
  297.         jz      @f
  298.  
  299.         mov     [alt_tab_list+edx*8], ecx
  300.         movzx   esi, word [ebx+4]
  301.         mov     [alt_tab_list+edx*8+4], esi
  302.         inc     edx
  303. ;--------------------------------------
  304. align 4
  305. @@:
  306.         cmp     ecx,eax
  307.         jb      .fill
  308.  
  309.         mov     [alt_tab_list_size], edx
  310.         test    edx, edx
  311.         jz      begin_1.ret
  312.  
  313.         mcall   66,4,0,0        ; «®¢¨¬ ¬®¬¥­â ®â¯ã᪠­¨ï ¢á¥å ã¯à ¢«ïîé¨å ª« ¢¨è
  314.         test    eax, eax
  315.         jnz     begin_1.ret
  316.  
  317.         xor     edx, edx
  318.         mov     eax, [alt_tab_list+4]
  319.         xor     ecx, ecx
  320.         inc     ecx
  321. ;--------------------------------------
  322. align 4
  323. .findmax:
  324.         cmp     [alt_tab_list+ecx*8+4], eax
  325.         jb      @f
  326.  
  327.         mov     edx, ecx
  328.         mov     eax, [alt_tab_list+ecx*8+4]
  329. ;--------------------------------------
  330. align 4
  331. @@:
  332.         inc     ecx
  333.         cmp     ecx, [alt_tab_list_size]
  334.         jb      .findmax
  335.  
  336.         mov     [current_alt_tab_app], edx
  337. ;--------------------------------------
  338. align 4
  339. has_alt_tab_app:
  340.         mov     eax, [current_alt_tab_app]
  341.         mov     edx, [alt_tab_list+eax*8+4]     ; slot
  342.         xor     ecx, ecx
  343.         or      eax, -1
  344.         test    ebp, 300h
  345.         jz      .notshift
  346.  
  347.         or      esi, -1
  348. ;--------------------------------------
  349. align 4
  350. .loop1:
  351.         cmp     [alt_tab_list+ecx*8+4], edx
  352.         jbe     @f
  353.  
  354.         cmp     [alt_tab_list+ecx*8+4], esi
  355.         jae     @f
  356.  
  357.         mov     eax, ecx
  358.         mov     esi, [alt_tab_list+ecx*8+4]
  359. ;--------------------------------------
  360. align 4
  361. @@:
  362.         inc     ecx
  363.         cmp     ecx, [alt_tab_list_size]
  364.         jb      .loop1
  365.  
  366.         cmp     eax, -1
  367.         jnz     .found
  368.  
  369.         xor     edx, edx
  370.         xor     ecx, ecx
  371.         jmp     .loop1
  372. ;--------------------------------------
  373. align 4
  374. .notshift:
  375.         xor     esi, esi
  376. ;--------------------------------------
  377. align 4
  378. .loop2:
  379.         cmp     [alt_tab_list+ecx*8+4], edx
  380.         jae     @f
  381.  
  382.         cmp     [alt_tab_list+ecx*8+4], esi
  383.         jbe     @f
  384.  
  385.         mov     eax, ecx
  386.         mov     esi, [alt_tab_list+ecx*8+4]
  387. ;--------------------------------------
  388. align 4
  389. @@:
  390.         inc     ecx
  391.         cmp     ecx, [alt_tab_list_size]
  392.         jb      .loop2
  393.  
  394.         cmp     eax, -1
  395.         jnz     .found
  396.  
  397.         or      edx, -1
  398.         xor     ecx, ecx
  399.         jmp     .loop2
  400. ;--------------------------------------
  401. align 4
  402. .found:
  403.         mov     [current_alt_tab_app], eax
  404.         push    eax
  405.         xor     edx, edx
  406.         div     [max_applications]
  407.         mov     [page_list], eax
  408.         mov     [draw_window_1], 1
  409.         mov     edi, app_list
  410.         push    edi
  411.         mov     ecx, 20
  412.         or      eax, -1
  413.         rep     stosd
  414.         pop     edi
  415.         pop     ecx
  416.         sub     ecx, edx
  417. ;--------------------------------------
  418. align 4
  419. @@:
  420.         cmp     ecx, [alt_tab_list_size]
  421.         jae     redraw_window_tabs
  422.  
  423.         mov     eax, [alt_tab_list+ecx*8]
  424.         stosd
  425.         inc     ecx
  426.         jmp     @b
  427. ;--------------------------------------
  428. align 4
  429. alt_tab_released:
  430.         mcall   66,5,0,0        ; 㦥 ¯®©¬ «¨, 墠â¨â :)
  431.  
  432.         or      eax, -1
  433.         xchg    eax, [current_alt_tab_app]
  434.         mov     ecx, [alt_tab_list+eax*8]
  435.         mcall   18,3
  436.  
  437.         jmp     redraw_window_tabs
  438. ;------------------------------------------------------------------------------
  439. align 4
  440. active_process  dd 0
  441.  
  442. exit:
  443.         mcall -1
  444. ;------------------------------------------------------------------------------
  445. START:
  446.         mcall   68,11
  447.         mcall   66,1,1
  448.        
  449.         mcall   9,process_info_buffer,-1
  450.         mov     ecx,[ebx+30]    ; PID
  451.         mcall   18,21
  452.         mov     [my_active_slot],eax    ; WINDOW SLOT
  453.        
  454.        
  455. load_libraries l_libs_start,end_l_libs
  456.  
  457.         test    eax,eax
  458.         jnz     exit
  459.  
  460.         call    Get_ini
  461.  
  462.         mcall   48,1,[button_style]
  463.        
  464.         mcall   66,4,0,2        ; LShift+RShift
  465.         mcall   66,,,11h        ; Ctrl+Shift
  466.         mcall   66,,88,110h     ; Alt+Ctrl+F12
  467.         mcall   66,,91,0h       ; RWin DOWN
  468.         mcall   66,,92          ; LWin DOWN
  469.         mcall   66,,219         ; RWin UP
  470.         mcall   66,,220         ; LWin UP
  471.  
  472. ;       mcall   66,,147,0h      ; Win+R UP
  473.         mcall   66,,19,0h       ; Win+R DOWN
  474.  
  475. ;       mcall   66,,23,0h       ; Win+I DOWN
  476.  
  477.         mcall   66,,32,0h       ; Win+D DOWN
  478. ;       mcall   66,,160,0h      ; Win+D UP
  479.  
  480.  
  481. ;       mcall   66,,91,100h     ; Alt+LWin
  482. ;       mcall   66,,92          ; Alt+RWin
  483.         mcall   66,,62,100h     ; Alt+F4
  484. ;       mcall   66,,71          ; Alt+Home
  485. ;       mcall   66,,72          ; Alt+Up
  486.         mcall   66,,15          ; Alt+Tab
  487.         mcall   66,,2           ; Alt+1
  488.         mcall   66,,3           ; Alt+2
  489.         mcall   66,,4           ; Alt+3
  490.         mcall   66,,5           ; Alt+4
  491.         mcall   66,,6           ; Alt+5
  492.         mcall   66,,7           ; Alt+6
  493.         mcall   66,,8           ; Alt+7
  494.         mcall   66,,,101h       ; Alt+Shift+Tab
  495.         mcall   66,,69          ; Alt+Shift+NumLock
  496.  
  497. if caps_lock_check
  498.         xor     edx,edx
  499.         mcall   66,4,58
  500. end if
  501.         mcall   14
  502.         mov     [screen_size],eax
  503.  
  504.        
  505.         mov     ecx,eax
  506. ;eax = [xsize]*65536 + [ysize], £¤¥
  507.         shr     ecx,16
  508.         and     eax,0xFFFF
  509.        
  510.         cmp     [place_attachment],1
  511.         je      @f
  512.         ror     eax,16
  513.         add     eax,[height]
  514.         rol     eax,16
  515.         mov     edx,eax
  516.         jmp     .selected
  517. ;--------------------------------------
  518. align 4
  519. @@:
  520.         sub     eax,[height]
  521.         lea     edx,[eax-1]
  522. ;--------------------------------------
  523. align 4
  524. .selected:
  525.         mcall   48,6
  526.  
  527.         mcall   9,process_info_buffer,-1
  528.         mov     ecx,[process_info_buffer+30]
  529.         mcall   18,21
  530.         mov     [this_slot],eax
  531.         mov     [max_slot],255
  532. ;--------------------------------------
  533. align 4
  534. start_after_minimize:
  535.         call    draw_window
  536. ;       call    draw_tray
  537.         call    draw_running_applications
  538.  
  539.         mcall   23,30
  540.         call    load_ini
  541.         call    fir_lng
  542. ;------------------------------------------------------------------------------
  543. align 4
  544. still:
  545. ;       call    draw_tray
  546.         call    draw_time
  547.         call    draw_cpu_usage
  548.         call    draw_running_applications
  549.  
  550.         mcall   18,7    ; check if active window changed
  551.         cmp     eax, [last_active_window]
  552.         jz      @f
  553. ; need_window_tab:
  554. ; in: ebx->process info
  555. ; out: ZF set <=> do not draw
  556.         mov     ebx,[last_active_window]
  557.         mov     [prev_active_window], ebx
  558.         mov     [last_active_window], eax
  559.  
  560.         mov     ecx, eax
  561.         mcall   9,process_info_buffer
  562.  
  563.         call    need_window_tab
  564.         jnz     .need_repaint
  565.  
  566.         mcall   9,process_info_buffer,[prev_active_window]
  567.         call    need_window_tab
  568.         jz      @f
  569. ;--------------------------------------
  570. align 4
  571. .need_repaint:
  572.         mov     dword [active_window_changed], 1
  573. ;--------------------------------------
  574. align 4
  575. @@:
  576.         mcall   23,20
  577.        
  578.         push    eax
  579.         mcall   18,7
  580.         cmp     [my_active_slot],eax
  581.         je      @f
  582.         mov     [current_active_slot],eax
  583. @@:
  584.         pop     eax
  585.        
  586.         cmp     eax,1           ; redraw ?
  587.         jz      red
  588.  
  589.         cmp     eax,2
  590.         jnz     @f
  591.         call    handle_key
  592.         jmp     .key
  593. @@:
  594.         cmp     eax,3           ; button ?
  595.         jz      button
  596.  
  597. ;       call    handle_key
  598. .key:
  599.         cmp     dword [active_window_changed], 0
  600.         jnz     red_active
  601.  
  602.         call    draw_flag       ; language
  603.         jmp     still
  604. ;------------------------------------------------------------------------------
  605. align 4
  606. red_active:
  607. red:
  608.         mov     dword [active_window_changed], 0
  609.  
  610.         mcall   14
  611.         movzx   ecx,ax
  612.         mov     edx,eax
  613.         shr     edx,16
  614.         cmp     [screen_size.height],ax
  615.         jne     @f
  616.  
  617.         rol     eax,16
  618.         cmp     [screen_size.width],ax
  619.         je      .lp1
  620.         rol     eax,16
  621. @@:
  622.         mov     [screen_size],eax
  623.         sub     ecx,[height]
  624.         mcall   67,0,,,[height]
  625. ;--------------------------------------
  626. align 4
  627. .lp1:
  628.         call    draw_window
  629. ;       call    draw_tray
  630.         jmp     still
  631. ;------------------------------------------------------------------------------
  632. align 4
  633. button:
  634.         mcall   17
  635.         test    eax,0xfffffe00  ; is it close button? (signal from @panel)
  636.         jz      still           ; if so - wait for another event, because @panel shouldn't be closed
  637.  
  638.         cmp     al, 0
  639.         jnz     right_mouse
  640.  
  641.         cmp     ah,50
  642.         jb      no_activate
  643.         cmp     ah,70
  644.         jg      no_activate
  645.  
  646.         movzx   ecx,byte ah
  647.         sub     ecx,52
  648.         shl     ecx,2
  649.  
  650.         mov     ecx,[app_list+ecx]
  651.        
  652.         mcall   9,process_info_buffer
  653.  
  654.         test    [ebx+70],dword 10b      ; window is minimized to panel
  655.         jnz     @f
  656.  
  657.         cmp     ecx,[current_active_slot]
  658.         je      .turn_off
  659. @@:
  660.         mcall   18,3,
  661.         jmp     .task_switching
  662. ;--------------------------------------
  663. align 4
  664. .turn_off:
  665.         mov     edx,ecx
  666.         mcall   18,22,0
  667. .task_switching:
  668.         mcall   68,1
  669.         jmp     still  
  670. ;------------------------------------------------------------------------------
  671. align 4
  672. right_mouse:
  673.         cmp     ah,50
  674.         jb      still
  675.  
  676.         cmp     ah,70
  677.         jg      still
  678.  
  679.         movzx   ecx,byte ah
  680.         sub     ecx,52
  681.  
  682.         cmp     ecx, [app_tab_count]
  683.         jge     still
  684.  
  685.         shl     ecx,2
  686.         mcall   37,0
  687.         mov     ebx, eax
  688.         shr     eax, 16
  689.         mov     [x_coord], ax
  690.         and     ebx, 0xFFFF
  691.         mov     [y_coord], bx
  692.  
  693.         mov     ecx,[app_list+ecx]      ; ecx->selected app.slot
  694.         mov     [n_slot], ecx
  695.         mcall   9,procinfo_for_detect
  696.  
  697.         mcall   51,1,context_menu_start,ctx_menu_stack
  698.  
  699.         mov     [ctx_menu_PID], eax
  700.         jmp     still
  701. ;------------------------------------------------------------------------------
  702. align 4
  703. no_activate:
  704.         cmp     ah,101    ; minimize to left
  705.         je      left_button
  706.  
  707.         cmp     ah,102    ; minimize to right
  708.         je      right_button
  709.  
  710.         cmp     ah, 103
  711.         je      clean_desktop_1             ; minimize all windows
  712.  
  713. ;       cmp     ah, 104
  714. ;       je      restore_desktop     ; restore minimized windows
  715.  
  716. ;       cmp     ah, 105
  717. ;       je      swap_minimized_desktop     ; minimize normal windows, and restore minimized windows
  718.  
  719.         cmp     ah,byte 1         ; start/terminate menu
  720.         jnz     noselect
  721.  
  722.         call    menu_handler
  723.  
  724.         jmp     still
  725. ;--------------------------------------
  726. align 4
  727. clean_desktop_1:
  728.  
  729.  
  730.         call    clean_desktop  
  731.        
  732.        
  733.         jmp     still
  734. ;--------------------------------------
  735. align 4
  736. noselect:
  737.         mov     ebx, exec_fileinfo
  738.         cmp     ah,byte 2              ; start calendar
  739.         jnz     noid15  ;noclock
  740.  
  741.         mov     dword [ebx+21], calendar_name
  742.         mcall   70
  743.         jmp     still
  744. ;--------------------------------------
  745. align 4
  746. noid15:
  747.         cmp     ah,16
  748.         jne     noid16
  749.  
  750. ;       mov     ebx, setup_exec
  751. ;       mov     dword [ebx+8], chlang
  752. ;       mcall   70
  753.         call    karu
  754.         call    draw_flag       ; language
  755.         jmp     still
  756. ;--------------------------------------
  757. align 4
  758. noid16:
  759. ;       cmp     ah,17
  760. ;       jne     noid17
  761. ;
  762. ;       mov     ebx, setup_exec
  763. ;       mov     dword [ebx+8], syslang
  764. ;       mcall   70
  765. ;       jmp     still
  766. ;--------------------------------------
  767. ;align 4       
  768. ;  noid17:
  769.         cmp     ah,18
  770.         jne     noid18
  771.  
  772.         mov     dword [ebx+21], sysmeter_name
  773.         mcall   70
  774.         jmp     still
  775. ;--------------------------------------
  776. align 4
  777. noid18:
  778. ;       cmp     ah,19   ; speaker
  779. ;       jne     noid19
  780.  
  781. ;       mcall   18,8,2
  782. ;       mcall   15,3
  783. ;       jmp     red
  784. ;--------------------------------------
  785. ;align 4       
  786. ;noid19:
  787. ;       cmp     ah,20              ; start system setup
  788. ;       jnz     noid20
  789. ;
  790. ;       mov     ebx, setup_exec
  791. ;       and     dword [ebx+8], 0
  792. ;       mcall   70
  793. ;       jmp     still
  794. ;--------------------------------------
  795. ;align 4       
  796. ;noid20:
  797.         cmp     ah,21
  798.         jnz     noid21
  799.  
  800.         cmp     [page_list], 99
  801.         jnc     still
  802.         inc     [page_list]
  803.         jmp     red
  804. ;--------------------------------------
  805. align 4
  806. noid21:
  807.         cmp     ah,22
  808.         jnz     still
  809.  
  810.         cmp     [page_list],0
  811.         je      still
  812.  
  813.         dec     [page_list]
  814.         jmp     red
  815. ;------------------------------------------------------------------------------
  816. align 4
  817. restore_desktop:
  818.         mcall   9,process_info_buffer,-1
  819.         mov     [max_slot], eax
  820.         mov     ecx, 2
  821.         mov     edx, 2
  822. ;--------------------------------------
  823. align 4
  824. @@:
  825.         mcall   18, 22
  826.         inc     edx
  827.         cmp     edx, [max_slot]
  828.         jbe     @b
  829. ;       jmp     still
  830.         ret
  831. ;------------------------------------------------------------------------------
  832. ;align 4
  833. ;swap_minimized_desktop:
  834. ;       xor     esi, esi
  835. ;       inc     esi
  836. ;       jmp     min_swap_desktop
  837. ;------------------------------------------------------------------------------
  838. align 4
  839. clean_desktop:
  840.         mov     [clean_desktop_minimize],0
  841. ;       xor     esi,esi
  842. ;--------------------------------------
  843. ;align 4       
  844. ;min_swap_desktop:                 ; input esi 0 - min, <>0 swap
  845.         mov     ecx, 2             ;  ç «ì­ë© ­®¬¥à á«®â  ¯à®æ¥áá 
  846.         mov     ebx, process_info_buffer
  847. ;--------------------------------------
  848. align 4
  849. .loop1:
  850.         cmp     ecx, [this_slot]
  851.         je      .loop1xx
  852.  
  853.         mcall   9
  854.         mov     [max_slot], eax
  855.         mov     dx, word [process_info_buffer+50]
  856.         cmp     dx, 9               ; à®¢¥àª  ᢮¡®¤¥­ «¨ ¤ ­­ë© á«®â
  857.         jz      .loop1xx
  858.  
  859.         mov     edx, dword [ebx+10]
  860.         cmp     dl, '@'
  861.         je      .loop1xx
  862.  
  863.         cmp     dword [ebx+10], 'ICON'
  864.         jnz     @f
  865.  
  866.         cmp     [ebx+42], dword 51
  867.         jnz     @f
  868.  
  869.         cmp     [ebx+46], dword 51
  870.         jz      .loop1xx
  871. ;--------------------------------------
  872. align 4
  873. @@:
  874.         cmp     [ebx+10], dword '    '
  875.         jz      .loop1xx
  876.  
  877.         pusha
  878.         mov     edx, ecx
  879.         xor     ecx, ecx
  880. ;       or      esi, esi
  881. ;       jz      @f
  882.  
  883.         movzx   eax, byte [process_info_buffer+70]
  884.         and     eax, 2        ; mask minimize
  885.         jnz     @f
  886.  
  887.         mov     [clean_desktop_minimize],1
  888. ;       mov     ecx, 2        ; restore
  889.         mcall   18, 22
  890. ;--------------------------------------
  891. align 4
  892. @@:
  893.         popa
  894. ;--------------------------------------
  895. align 4
  896. .loop1xx:
  897.         inc     ecx
  898.         cmp     ecx, [max_slot]
  899.         jbe     .loop1
  900.        
  901.         cmp     [clean_desktop_minimize],1
  902.         je      @f
  903.         call    restore_desktop
  904. @@:
  905.         ret
  906. ;       jmp     still
  907. ;------------------------------------------------------------------------------
  908. align 4
  909. conversion_HEX_to_ASCII:
  910.         ror     eax,12
  911.         mov     ecx,4
  912. ;--------------------------------------
  913. align 4
  914. .loop:
  915.         mov     bl,al
  916.         rol     eax,4
  917.         and     bl,0xf
  918.         cmp     bl,0xA  ; check for ABCDEF
  919.         jae     @f
  920.  
  921.         add     bl,0x30 ; 0-9
  922.         jmp     .store
  923. ;--------------------------------------
  924. align 4
  925. @@:
  926.         add     bl,0x57 ; A-F
  927. ;--------------------------------------
  928. align 4
  929. .store:
  930. ;       dps     "param_store: "
  931.         mov     [edi],bl
  932.         inc     edi
  933.         dec     ecx
  934.         jnz     .loop
  935.         ret
  936. ;------------------------------------------------------------------------------
  937. align 4
  938. menu_handler:
  939.         mov     edi,bootparam
  940.        
  941.         mov     eax,[menu_button_x.start]
  942.         call    conversion_HEX_to_ASCII
  943.  
  944.         mov     eax,[menu_button_x.size]
  945.         call    conversion_HEX_to_ASCII
  946.        
  947.         mov     eax,[menu_button_y.start]
  948.         call    conversion_HEX_to_ASCII
  949.        
  950.         mov     eax,[menu_button_y.size]
  951.         call    conversion_HEX_to_ASCII
  952.        
  953.         mov     eax,[height]
  954.         call    conversion_HEX_to_ASCII
  955.        
  956.         mov     eax,[place_attachment]
  957.         call    conversion_HEX_to_ASCII
  958.        
  959.         xor     eax,eax ; terminator for boot parameters string
  960.         stosd
  961.        
  962.         mov     ebx, exec_fileinfo
  963.         mov     [ebx+21],dword menu_name
  964.         mov     [ebx+8],dword bootparam
  965.         mcall   70
  966.         mov     [ebx+8],dword 0
  967.         ret
  968. ;------------------------------------------------------------------------------
  969. align 4
  970. draw_small_right:
  971.         pusha
  972.         mcall   12,1
  973.  
  974.         xor     eax,eax
  975.         mov     edx,[wcolor]
  976.         mov     esi,edx
  977.         mov     edi,edx
  978.         or      edx, 0x01000000
  979.         mcall
  980.  
  981.         xor     ecx,ecx
  982.         mov     cx,[height]
  983.         mcall   8,<0,9>,,1,[wcolor]
  984.  
  985.         mov     ebx,2*65536     ;+6
  986.         mov     bx,[height]
  987.         shr     bx,1
  988.         sub     bx,3
  989.         mov     ecx,[wcolor]
  990.         add     ecx,0x303030
  991.         mcall   4,,,hidetext,1
  992.  
  993.         mcall   12,2
  994.         popa
  995.         ret
  996. ;------------------------------------------------------------------------------
  997. align 4
  998. draw_small_left:
  999.         pusha
  1000.         mcall   12,1
  1001.  
  1002.         xor     eax,eax
  1003.         mov     edx,[wcolor]
  1004.         mov     esi,edx
  1005.         mov     edi,edx
  1006.         or      edx, 0x01000000
  1007.         mcall
  1008.  
  1009.         xor     ecx,ecx
  1010.         mov     cx,[height]
  1011.         mcall   8,<0,9>,,1,[wcolor]
  1012.  
  1013.         mov     ebx,3*65536     ;+6
  1014.         mov     bx,[height]
  1015.         shr     bx,1
  1016.         sub     bx,3
  1017.         mov     ecx,[wcolor]
  1018.         add     ecx,0x303030
  1019.         mcall   4,,,hidetext+1,1
  1020.  
  1021.         mcall   12,2
  1022.         popa
  1023.         ret
  1024. ;------------------------------------------------------------------------------
  1025. align 4
  1026. right_button:
  1027.         mov     [small_draw],dword draw_small_right
  1028.  
  1029.         mcall   14
  1030.  
  1031.         shr     eax, 16
  1032.         mov     ebx, eax
  1033.         mov     ecx, -1
  1034.         mov     edx, 9
  1035.         sub     ebx, edx
  1036.         mov     esi, -1
  1037.         mcall   67
  1038.  
  1039.         call    draw_small_right
  1040.         jmp     small_wait
  1041. ;------------------------------------------------------------------------------
  1042. align 4
  1043. left_button:
  1044.         mov     [small_draw],dword draw_small_left
  1045.  
  1046.         xor     ebx,ebx
  1047.         mcall   67,,-1,9,-1
  1048.  
  1049.         call    draw_small_left
  1050. ;--------------------------------------
  1051. align 4
  1052. small_wait:
  1053.         mcall   10
  1054.         cmp     eax,1
  1055.         jne     no_win
  1056.  
  1057.         call    [small_draw]
  1058.         jmp     small_wait
  1059. ;--------------------------------------
  1060. align 4
  1061. no_win:
  1062.         cmp     eax,2
  1063.         jne     no_key
  1064.  
  1065.         call    handle_key
  1066.         jmp     small_wait
  1067. ;--------------------------------------
  1068. align 4
  1069. no_key:
  1070.         mcall   17
  1071.         cmp     ah,1
  1072.         jne     no_full
  1073.  
  1074.         mcall   14      ; get screen max x & max y
  1075.  
  1076.         mov     edx, eax
  1077.         shr     edx, 16
  1078.         xor     ebx, ebx
  1079.         mcall   67,,-1,,-1 ; x0 y0 xs ys
  1080.  
  1081.         jmp     still
  1082. ;--------------------------------------
  1083. align 4
  1084. no_full:
  1085.         call    menu_handler
  1086.         jmp     small_wait
  1087. ;------------------------------------------------------------------------------
  1088. ;align 4
  1089. ;set_variables:
  1090. ;       pusha
  1091. ;       mov     [button_frames],0x0
  1092. ;       cmp     [buttons],0
  1093. ;       jne     no_frames
  1094.  
  1095. ;       mov     [button_frames],0x40000000
  1096. ;--------------------------------------
  1097. ;align 4
  1098. ;no_frames:
  1099. ;       mcall   48,1,1  ; 3d button look
  1100. ;       popa
  1101. ;       ret
  1102. ;------------------------------------------------------------------------------
  1103. include 'libini.inc'
  1104. ;------------------------------------------------------------------------------
  1105. include 'dll.inc'
  1106. ;------------------------------------------------------------------------------
  1107. include 'drawappl.inc'
  1108. ;------------------------------------------------------------------------------
  1109. include 'drawbutt.inc'
  1110. ;------------------------------------------------------------------------------
  1111. include 'drawwind.inc'
  1112. ;------------------------------------------------------------------------------
  1113. include 'drawtray.inc'
  1114. ;------------------------------------------------------------------------------
  1115. include 'ctx_menu.asm'
  1116. ;------------------------------------------------------------------------------
  1117. include 'i_data.inc'
  1118. ;------------------------------------------------------------------------------
  1119. IM_END:
  1120. ;------------------------------------------------------------------------------
  1121. include 'u_data.inc'
  1122. ;------------------------------------------------------------------------------
  1123. I_END:
  1124. ;------------------------------------------------------------------------------
  1125.