Subversion Repositories Kolibri OS

Rev

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

  1. mouse:
  2.     mcall 18,7
  3.     cmp  [active_process],eax
  4.     jne  still
  5.     mcall 37,7
  6.     mov   [mouse_scroll_data],eax
  7. ;    test  eax,eax
  8. ;    jnz   .continue_2
  9.     mcall 37,2
  10.     cmp  [mouse_keys],eax
  11.     je   @f
  12.     mov  [mouse_keys],eax
  13.     mov  [mouse_keys_delta],0
  14.     jmp  .continue_2
  15. @@:
  16.     mov  [mouse_keys_delta],1
  17. .continue_2:
  18.     mcall 37,1
  19.     mov  [mouse_position],eax
  20. ;    mcall 18,7
  21. ;    cmp  [active_process],eax
  22. ;    jne  still
  23.     mov  eax,[mouse_position]
  24.     test eax,0x80000000
  25.     jnz   still
  26.     test eax,0x8000
  27.     jnz   still
  28.     mov   ebx,eax
  29.     shr   ebx,16
  30.     shl   eax,16
  31.     shr   eax,16
  32.     cmp   [mouse_keys_delta],0
  33.     je    @f
  34.     cmp   [scroll_pointer],0
  35.     jne   .check_scroll_bar_left
  36. @@:
  37.     cmp   ebx,[window_width]
  38.     ja    still
  39.     cmp   eax,[window_high]
  40.     ja    still
  41. .check_scroll_bar_left:
  42.     xor   ecx,ecx
  43.     mov   cx,[left_panel_y.start_y]
  44.     cmp   [mouse_keys_delta],0
  45.     je    @f
  46.     cmp   [scroll_pointer],1
  47.     je    .check_scroll_bar_left_event
  48.     cmp   [scroll_pointer],2
  49.     je   .check_scroll_bar_right_event
  50. @@:
  51.     cmp   ax,cx
  52.     jbe    .other
  53.     add   cx,[left_panel_y.size_y]
  54.     cmp   ax,cx
  55.     jae    .other
  56.     mov   cx,[left_panel_x.start_x]
  57.     cmp   bx,cx
  58.     jbe    .other
  59.     add   cx,[left_panel_x.size_x]
  60.     cmp   bx,cx
  61.     jae    .check_scroll_bar_right
  62.     mov   edx,[left_folder_block]
  63.     cmp   edx,[max_panel_line]
  64.     jbe   @f
  65. .check_scroll_bar_left_event:
  66.     mov   [scroll_bar_event],0
  67.     call  check_scroll_left_event
  68.     cmp   [scroll_bar_event],0
  69.     jne    still
  70.     mov   [scroll_bar_event],0
  71.     call  check_scroll_bar_left_event
  72.     cmp   [scroll_bar_event],0
  73.     jne    still  ;.continue
  74. ;    cmp   [scroll_pointer],1
  75. ;    je   .continue
  76. @@:
  77.     call  check_left_panel_mouse_event
  78. ;    jmp   still
  79. .continue:
  80. ;    mov   [temp_edx],mouse_left_panel
  81. ;    call  mouse.draw_data
  82. ;    mov  [scroll_pointer],0
  83. ;    mov  [mouse_keys_delta_1],0
  84.     jmp   still
  85.  
  86. .check_scroll_bar_right:
  87.     xor   ecx,ecx
  88.     mov   cx,[right_panel_x.start_x]
  89.     cmp   bx,cx
  90.     jbe    .other
  91.     add   cx,[right_panel_x.size_x]
  92.     cmp   bx,cx
  93.     jae    .other
  94.     mov   edx,[right_folder_block]
  95.     cmp   edx,[max_panel_line]
  96.     jbe   @f
  97. .check_scroll_bar_right_event:
  98.     mov   [scroll_bar_event],0
  99.     call  check_scroll_right_event
  100.     cmp   [scroll_bar_event],0
  101.     jne    still
  102.     mov   [scroll_bar_event],0
  103.     call  check_scroll_bar_right_event
  104.     cmp   [scroll_bar_event],0
  105.     jne    still   ;.continue_1
  106. @@:
  107.     call  check_right_panel_mouse_event
  108. .continue_1:
  109. ;    mov   [temp_edx],mouse_right_panel
  110. ;    call  mouse.draw_data
  111.     jmp   still
  112.  
  113. .other:
  114. ;    mov   [temp_edx],mouse_other_panel
  115. ;    call  mouse.draw_data
  116.     jmp   still
  117.  
  118. ;.draw_data:
  119. ;    pusha
  120. ;    mov   [temp_eax],eax
  121. ;    mcall 13,<190,400>,<3,15>,0x0
  122. ;    xor   ecx,ecx
  123. ;    mov   cx,[mouse_position.x]
  124. ;    mcall 47,0x80000, ,<200, 5>,0xffffff
  125. ;    mov   cx,[mouse_position.y]
  126. ;    mcall 47,0x80000, ,<300, 5>,0xffffff
  127. ;    mcall 47,0x80000,[mouse_keys],<400, 5>,0xffffff
  128. ;    mcall 4,<500,5>,0xffffff,[temp_edx],5
  129. ;    mcall 47,0x80000,[mouse_keys],<200, 5>,0xffffff
  130. ;    popa
  131. ;    ret
  132. ;---------------------------------------------------------------------
  133. check_left_panel_mouse_event:
  134. ;    cmp  [scroll_pointer],0
  135. ;    je   @f
  136.     mov  [scroll_pointer],0
  137. ;    ret
  138. @@:
  139.     cmp  [mouse_keys_delta],0
  140.     jz   .start
  141.     cmp  [mouse_keys],0
  142.     jz  .end
  143. .start:
  144.     sub  ax,[left_panel_y.start_y]
  145.     mov  ebx,10
  146.     xor  edx,edx
  147.     div  ebx
  148.     imul eax,10
  149.     cmp  [select_panel_counter],0
  150.     je   @f
  151.     mov  [select_panel_counter],0
  152.     mov  [mouse_keys_delta_1],0
  153.     push  eax
  154.     call draw_right_panel
  155.     pop   eax
  156.     jmp  .continue
  157. @@:
  158.     cmp  [left_start_draw_cursor_line],ax
  159.     jne   @f
  160.     cmp  [mouse_keys],0
  161.     jnz  .continue
  162.     cmp  [mouse_keys_delta],0
  163.     je   .enter
  164. @@:
  165.     mov  [mouse_keys_delta_1],0
  166. .continue:
  167.     imul  ebx,[left_folder_block],10
  168.     cmp  eax,ebx
  169.     jb   @f
  170.     sub  ebx,10
  171.     mov  [left_start_draw_cursor_line],bx
  172.     jmp  .continue_1
  173. @@:
  174.     mov  [left_start_draw_cursor_line],ax
  175. .continue_1:
  176.     call draw_left_panel
  177. .end:
  178.     ret
  179. .enter:
  180.     cmp  [mouse_keys_delta_1],1
  181.     je   .enter_1
  182.     mcall 26,9
  183.     add  eax,[mouse_key_delay]
  184.     mov  [mouse_keys_tick],eax
  185.     mov  [mouse_keys_delta_1],1
  186.     jmp  .continue_1
  187. .enter_1:
  188.     mov  [mouse_keys_delta_1],0
  189.     mcall 26,9
  190.     cmp  eax,[mouse_keys_tick]
  191.     jbe  @f
  192.     ret
  193. @@:
  194.     add  esp,4
  195. ;    call draw_left_panel
  196.     jmp  key_28.1
  197. ;---------------------------------------------------------------------
  198. check_right_panel_mouse_event:
  199. ;    cmp  [scroll_pointer],0
  200. ;    je   @f
  201.     mov  [scroll_pointer],0
  202. ;    ret
  203. @@:
  204.     cmp  [mouse_keys_delta],0
  205.     jz   .start
  206.     cmp [mouse_keys],0
  207.     jz  .end
  208. .start:
  209.     sub  ax,[right_panel_y.start_y]
  210.     mov  ebx,10
  211.     xor  edx,edx
  212.     div  ebx
  213.     imul eax,10
  214.     cmp  [select_panel_counter],1
  215.     je   @f
  216.     mov  [select_panel_counter],1
  217.     mov  [mouse_keys_delta_1],0
  218.     push eax
  219.     call draw_left_panel
  220.     pop  eax
  221.     jmp  .continue
  222. @@:
  223.     cmp  [right_start_draw_cursor_line],ax
  224.     jne   @f
  225.     cmp  [mouse_keys],0
  226.     jnz  .continue
  227.     cmp  [mouse_keys_delta],0
  228.     je   .enter
  229. @@:
  230.     mov  [mouse_keys_delta_1],0
  231. ;    cmp  [mouse_keys_delta],1
  232. ;    je   .continue
  233. ;    cmp  [right_start_draw_cursor_line],ax
  234. ;    je   .enter
  235. .continue:
  236.     imul  ebx,[right_folder_block],10
  237.     cmp  eax,ebx
  238.     jb   @f
  239.     sub  ebx,10
  240.     mov  [right_start_draw_cursor_line],bx
  241.     jmp  .continue_1
  242. @@:
  243.     mov  [right_start_draw_cursor_line],ax
  244. .continue_1:
  245.     call draw_right_panel
  246. .end:
  247.     ret
  248. .enter:
  249.     cmp  [mouse_keys_delta_1],1
  250.     je   .enter_1
  251.     mcall 26,9
  252.     add  eax,[mouse_key_delay]
  253.     mov  [mouse_keys_tick],eax
  254.     mov  [mouse_keys_delta_1],1
  255.     jmp  .continue_1
  256. .enter_1:
  257.     mov  [mouse_keys_delta_1],0
  258.     mcall 26,9
  259.     cmp  eax,[mouse_keys_tick]
  260.     jbe  @f
  261.     ret
  262. @@:
  263.     add  esp,4
  264. ;    call draw_right_panel
  265.     jmp  key_28.1
  266. ;---------------------------------------------------------------------