Subversion Repositories Kolibri OS

Rev

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