Subversion Repositories Kolibri OS

Rev

Rev 633 | Blame | Last modification | View Log | Download | RSS feed

  1. context_menu_start:
  2.  
  3.     mov        eax, 40
  4.     mov        ebx, 00100111b
  5.     int        0x40
  6.  
  7.     ;call       draw_ctx_menu
  8.  
  9.     mov        ebp, 2           ; 2 ç áâ® ¨á¯®«ì§ã¥âáï.
  10. ; // Alver 26.08.2007 // {
  11. ;    xor        ecx, ecx
  12. ;    mov        edx, [ctx_menu_PID]
  13. ;  find_slot:
  14. ;    inc        ecx
  15. ;    mov        eax, 9
  16. ;    mov        ebx, process_info_buffer
  17. ;    int        0x40
  18. ;    cmp        dword [process_info_buffer + 30], edx
  19. ;    jne        find_slot
  20.     mov        ecx, [ctx_menu_PID]
  21.     mcall      18,21
  22.     mov        ecx, eax
  23. ; } \\ Alver \\
  24.     mov        eax, 18
  25.     mov        ebx, 3
  26.     ;mov       ecx, ecx         ; :)
  27.     int        0x40
  28.  
  29.     call       draw_ctx_menu
  30.  
  31.   ctx_menu_still:
  32.     mov        eax, 10
  33.     int        0x40
  34.  
  35.     cmp        eax, ebp         ; cmp     eax, 2
  36.     jz         ctx_menu_key
  37.     cmp        eax, 3
  38.     jz         ctx_menu_button
  39.     cmp        eax, 6
  40.     jz         ctx_menu_mouse
  41.  
  42.     call       draw_ctx_menu
  43.  
  44.     jmp        ctx_menu_still
  45.  
  46.   ctx_menu_key:
  47.     mov        eax, ebp         ; mov     eax, 2
  48.     int        0x40
  49.  
  50.   ctx_menu_button:
  51.     mov        eax, 17
  52.     int        0x40
  53.  
  54.     cmp        ah, 1
  55. ; // Alver 26.08.2007 // {
  56. ;    jne        ctx_menu_still
  57.     jne        @f
  58. ; } \\ Alver \\
  59.     mov        eax, 18
  60.     mov        ebx, ebp         ; mov     eax, 2
  61.     mov        ecx, [n_slot]
  62. ; // Alver 26.08.2007 // {
  63.     jmp        .lllxxx
  64. @@:
  65.     cmp        ah, 2
  66.     jne        ctx_menu_still
  67.     mov        eax, 18
  68.     mov        ebx, 22
  69.     mov        edx, [n_slot]
  70.     xor        ecx, ecx
  71. ; \begin{diamond}[20.09.2007]
  72.     test       byte [procinfo_for_detect+70], 2
  73.     setnz      cl
  74.     add        cl, cl
  75. ; \end{diamond}[20.09.2007]
  76.   .lllxxx:
  77. ; } \\ Alver \\
  78.     int        0x40
  79.     jmp        ctx_menu_exit
  80.  
  81.   ctx_menu_mouse:
  82.     mov        eax, 37
  83.     mov        ebx, ebp         ; mov     ebx, 2
  84.     int        0x40
  85.  
  86.     xchg       eax, ecx         ; cmp     eax, 0  …᫨ ­¥ ®¤­  ¨§ ª­®¯®ª ­¥ ­ ¦ â  ¢®§¢à é ¥¬áï
  87.                                 ;                 ¢ £« ¢­ë© 横« ¯®â®ª 
  88.     jecxz      ctx_menu_still
  89.  
  90.     mov        eax, 37
  91.     xor        ebx, ebx         ; mov     ebx, 1
  92.     inc        ebx
  93.     int        0x40
  94.  
  95.     cmp        ax, 0            ; ’ã⠯஢¥à塞 ¯à®¨§®èñ«-«¨ ª«¨ª §  ¯à¥¤¥« ¬¨ ®ª­  ª®­â¥ªáâ­®£®
  96.     jb         ctx_menu_exit    ; ¬¥­î, ¥á«¨ §  ¯à¥¤¥« ¬¨ â® § ªà뢠¥¬ ª®­â¥ªáâ­®¥ ¬¥­î
  97.     cmp        ax, 60           ; 41
  98.     ja         ctx_menu_exit
  99.     shr        eax, 16
  100.     cmp        ax, 0
  101.     jb         ctx_menu_exit
  102.     cmp        ax, 133
  103.     ja         ctx_menu_exit
  104.  
  105.     jmp        ctx_menu_still
  106.  
  107.   ctx_menu_exit:
  108.  
  109.     xor        eax, eax
  110.     dec        eax              ; mov        eax, -1
  111.     int        0x40
  112.  
  113. func  draw_ctx_menu
  114.  
  115.     mov        eax, 12
  116.     xor        ebx, ebx         ; mov        ebx, 1
  117.     inc        ebx
  118.     int        0x40
  119.  
  120.     xor        eax, eax         ; mov        eax, 0
  121.     movzx      ebx, [x_coord]
  122.     shl        ebx, 16
  123.     add        ebx, 133
  124.     movzx      ecx, [y_coord]
  125.     sub        ecx, 60         ; 41
  126.     shl        ecx, 16
  127.     add        ecx, 60         ; 41
  128.     mov        edx, [system_colours + 20]    ; sc.work
  129.     mov        esi, [system_colours + 4]     ; sc.grab
  130.     or         esi, 0x81000000
  131.     mov        edi, [system_colours]         ; sc.frame
  132.     int        0x40
  133.  
  134.     mov        eax, 8
  135.     mov        ebx, 0 * 65536 + 133
  136.     mov        ecx, 22 * 65536 + 16
  137.     mov        edx, 0x40000001
  138.     int        0x40
  139.  
  140.     mov        eax, 8
  141.     mov        ebx, 0 * 65536 + 133
  142.     mov        ecx, 40 * 65536 + 18
  143.     mov        edx, 0x40000002
  144.     int        0x40
  145.  
  146.     shr        eax, 1   ; mov   eax, 4
  147.     mov        ebx, 36 * 65536 + 7
  148.     mov        ecx, [system_colours + 16]    ; sc.grab_text
  149.     or         ecx, 0x10000000
  150.  
  151.     mov        edx, ctx_menu_title
  152.  
  153.     mov        esi, ctx_menu_title_end - ctx_menu_title
  154.     int        0x40
  155.  
  156.     add        ebx, 1 * 65536
  157.     int        0x40
  158.  
  159.     mov        ebx, 4 * 65536 + 28
  160.     mov        ecx, 0x80000000
  161.     mov        edx, ctx_menu_text
  162. ; // Alver 26.08.2007 // {
  163.     int        0x40
  164.     add        bx, 18
  165.     mov        edx, ctx_menu_text2
  166. ; \begin{diamond}[20.09.2007]
  167.     test       byte [procinfo_for_detect+70], 2
  168.     jz         @f
  169.     mov        edx, ctx_menu_text3
  170. @@:
  171. ; \end{diamond}[20.09.2007]
  172.     int        0x40
  173. ; } \\ Alver \\
  174.     mov        eax, 12
  175.     mov        ebx, ebp         ; mov     ebx, 2
  176.     int        0x40
  177.  
  178.     ret
  179.  
  180. endf
  181.  
  182. x_coord rw      1
  183. y_coord rw      1
  184. n_slot  rd      1
  185. lsz ctx_menu_text,\
  186.   ru, <"X ‡ ªàëâì    Alt + F4",0>,\
  187.   en, <"X Close      Alt + F4",0>,\
  188.   et, <"X Sulge      Alt + F4",0>      ; Now correct
  189. ; // Alver 26.08.2007 // {
  190. lsz ctx_menu_text2,\
  191.   ru, <25," ‘¢¥à­ãâì           ",0>,\
  192.   en, <25," Minimize           ",0>,\
  193. ; } \\ Alver \\
  194. ; \begin{diamond}[20.09.2007]
  195. lsz ctx_menu_text3,\
  196.   ru, <24," ‚®ááâ ­®¢¨âì       ",0>,\
  197.   en, <24," Restore            ",0>
  198. ; \end{diamond}[20.09.2007]
  199. ctx_menu_PID    rd      1
  200.  
  201. ctx_menu_title:
  202.         db      'KolibriOS'
  203. ctx_menu_title_end:
  204.