Subversion Repositories Kolibri OS

Rev

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

  1. ;---------------------------------------------------------------------
  2.   key:                          ; key
  3.     mcall 2
  4.     cmp   [extended_key],1
  5.     je    .extended_key
  6.     test  al, al
  7.     jnz   still
  8.     cmp   ah, 0xE0
  9.     jne   @f
  10.     mov   [extended_key],1
  11.     jmp   still
  12. @@:
  13.     cmp   ah,151  ; i - file information
  14.         je    kinfo
  15.     cmp   ah,152  ; o - application options
  16.         je    check_key_O ;k_option
  17.     cmp   ah,159  ; s - sort mode
  18.         je    k_sort_directory
  19.     cmp   ah,145  ; w - wallpaper
  20.         je    k_background
  21.     cmp   ah,183  ; * - scaling to window
  22.         je    scaling
  23.     cmp   ah,139  ; 0 - scaling to window
  24.         je    scaling
  25.     cmp   ah,202  ; "-" - zoom minus
  26.         je    zoom_minus
  27.     cmp   ah,140  ; "-" - zoom minus
  28.         je    zoom_minus
  29.     cmp   ah,206  ; "+" - zoom plus
  30.         je    zoom_plus
  31.     cmp   ah,141  ; "+" - zoom plus
  32.         je    zoom_plus
  33.     cmp   ah,171  ; "\" - zoom 100%
  34.         je    no_scaling
  35.        
  36.         cmp   ah,72 ; up arrow
  37.         je    key_up_arrow
  38.         cmp   ah,80 ; down arrow
  39.         je    key_down_arrow
  40.         cmp   ah,75 ; left arrow
  41.         je    key_left_arrow
  42.         cmp   ah,77 ; right arrow
  43.         je    key_right_arrow
  44.        
  45.         cmp   ah,28 ; Enter
  46.         je    full_screen
  47.         cmp     ah,187  ; F1
  48.         je      select_menu ;key_alt_down
  49.  
  50.         cmp     ah,42
  51.         je      key_shift_up
  52.         cmp     ah,54
  53.         je      key_shift_up
  54.         cmp     ah,170
  55.         je      key_shift_down
  56.         cmp     ah,182
  57.         je      key_shift_down
  58.         cmp     ah,29
  59.         je      key_ctrl_up
  60.         cmp     ah,157
  61.         je      key_ctrl_down
  62.         cmp     ah,56
  63.         je      key_alt_up
  64.         cmp     ah,184
  65.         je      key_alt_down
  66.        
  67.     jmp  still 
  68. .extended_key:
  69.     mov  [extended_key],0
  70.         mov  [current_key_code],ah
  71. ;       push  eax
  72. ;       mcall 26,9
  73. ;       mov  [timer_counter],eax
  74. ;       pop   eax
  75.  
  76. ;    mov  al,ah
  77. ;    cmp  al,130  ; 1
  78. ;    je  kfile
  79. ;    cmp  al,131  ; 2
  80. ;    je  kopen
  81. ;    cmp  al,132  ; 3
  82. ;    je  kinfo
  83. ;    cmp  al,133  ; 4
  84. ;    je  kbgrd
  85.         cmp  ah,73
  86.         je   move_to_left
  87.         cmp  ah,81
  88.         je   move_to_right
  89.         cmp  ah,71
  90.         je   left_limit
  91.         cmp  ah,79
  92.         je   right_limit
  93.     cmp   ah,181  ; / - zoom 100%
  94.         je    no_scaling
  95.        
  96.         cmp   ah,72 ; up arrow
  97.         je    key_up_arrow
  98.         cmp   ah,80 ; down arrow
  99.         je    key_down_arrow
  100.         cmp   ah,75 ; left arrow
  101.         je    key_left_arrow
  102.         cmp   ah,77 ; right arrow
  103.         je    key_right_arrow
  104.        
  105.         cmp   ah,28 ; Enter
  106.         je    full_screen
  107.        
  108.         cmp   ah,183 ; Print Screen  - Slides Show
  109.         je    slide_show.3
  110.  
  111.         cmp     ah,29
  112.         je      key_ctrl_up
  113.         cmp     ah,157
  114.         je      key_ctrl_down
  115.         cmp     ah,56
  116.         je      key_alt_up
  117.         cmp     ah,184
  118.         je      key_alt_down
  119.     jmp  still
  120. ;---------------------------------------------------------------------
  121. key_shift_up:
  122.         mov     [shift_flag],1
  123.         jmp     still
  124. ;---------------------------------------------------------------------
  125. key_shift_down:
  126.         mov     [shift_flag],0
  127.         jmp     still
  128. ;---------------------------------------------------------------------
  129. key_ctrl_up:
  130.         mov     [ctrl_flag],1
  131.         jmp     still
  132. ;---------------------------------------------------------------------
  133. key_ctrl_down:
  134.         mov     [ctrl_flag],0
  135.         jmp     still
  136. ;---------------------------------------------------------------------
  137. key_alt_up:
  138.         mov     [alt_flag],1
  139.         jmp     still
  140. ;---------------------------------------------------------------------
  141. key_alt_down:
  142.         mov     [alt_flag],0
  143.         jmp     still
  144. ;---------------------------------------------------------------------
  145. check_key_O:
  146.         cmp     [ctrl_flag],0
  147.         jne     kfile
  148.         jmp     k_option
  149. ;---------------------------------------------------------------------
  150. move_to_left:
  151.         xor   eax,eax
  152.         cmp   [load_file_number],eax
  153.         je    still
  154.     dec   [load_file_number]
  155.         jmp  right_limit.2
  156. ;----------------------------------------    
  157. move_to_right:
  158.         mov   eax,[load_directory_pointer]
  159.         mov   eax,[eax+4]
  160.         test  eax,eax
  161.         jz    @f
  162.         dec   eax
  163. @@:
  164.         cmp   [load_file_number],eax
  165.         je    still
  166.     inc   [load_file_number]
  167.         jmp  right_limit.2
  168. ;----------------------------------------
  169. left_limit:
  170.         xor  eax,eax
  171.         jmp  right_limit.1
  172. ;----------------------------------------
  173. right_limit:
  174.         mov   eax,[load_directory_pointer]
  175.         mov   eax,[eax+4]
  176.         test  eax,eax
  177.         jz    @f
  178.         dec   eax
  179. @@:
  180. .1:
  181.         cmp   [load_file_number],eax
  182.         je    still
  183.         mov  [load_file_number],eax
  184. .2:
  185.         imul  ebx,[load_file_number],304
  186.         add   ebx,32+40
  187.         add   ebx,[load_directory_pointer]
  188.        
  189.     mov   esi,string
  190.     mov   edi,plugin_pach
  191.     call  copy_file_path
  192.  
  193.         mov  esi,plugin_pach
  194.         mov  edi,string
  195.         mov  ecx,4096/4
  196.         cld
  197.         rep  movsd
  198.  
  199. ;       jmp   kopen
  200.     mov  [open_file_flag],0
  201.     mov ecx,-1
  202.     call  getappinfo
  203.     call  load_image
  204.         test  eax,eax
  205.         jnz    kopen_1.err
  206.        
  207.     call  convert
  208.        
  209.         call load_directory.copy_dir_path      
  210.        
  211.     call  get_window_param
  212.     test  [window_status],1b
  213.     jz    @f ;draw_still
  214.         mov   [no_draw_window],1
  215.     call  draw_other
  216.         mov   [no_draw_window],0
  217.         jmp   .3
  218.        
  219. @@:
  220.     call draw_window
  221. .3:
  222.         mov  al,[old_key_code]
  223.         mov  ah,[current_key_code]
  224.         mov  [old_key_code],ah
  225.         cmp  al,ah
  226.         jne  still  ;key.extended_key  ;still
  227. .still:
  228.     mcall 2
  229.     cmp   [extended_key],1
  230.     je    .extended_key
  231.     test  al, al
  232.     jnz   still
  233.     cmp   ah, 0xE0
  234.     jne   @f
  235.     mov   [extended_key],1
  236.     jmp   .still
  237. @@:
  238.     jmp   still
  239. .extended_key:
  240.     mov  [extended_key],0
  241.         mov  [current_key_code],ah
  242.         jmp  .3
  243. .4:
  244.         mov  ah,[current_key_code]
  245.         mov  [old_key_code],ah
  246.         jmp  key.extended_key
  247. ;---------------------------------------------------------------------
  248. slide_show:
  249.         mov   eax,[load_directory_pointer]
  250.         cmp   [eax+4],dword 1
  251.         jbe   still
  252.     mcall 26,9
  253.         cmp   [timer],eax
  254.         jbe   .1
  255.         jmp   .still
  256. .red:
  257.     call draw_window
  258. .still:
  259.         mcall 23,10
  260.     cmp  eax,1        ; ïåðåðèñîâàòü îêíî ?
  261.     je     .red
  262.     cmp  eax,2        ; íàæàòà êëàâèøà ?
  263.     je     .key       ; åñëè äà - íà key
  264.     cmp  eax,3        ; íàæàòà êíîïêà ?
  265.     je     .button     ; åñëè äà - íà button
  266. ;       mcall 68,1
  267.         jmp   slide_show
  268. ;-------------------------------------------
  269. .key:
  270.     mcall 2
  271.     cmp   [extended_key],1
  272.     je    .extended_key
  273.     test  al, al
  274.     jnz   .still
  275.     cmp   ah, 0xE0
  276.     jne   @f
  277.     mov   [extended_key],1
  278.     jmp   .still
  279. @@:
  280.     cmp   ah,1  ; Esc
  281.         je    still
  282.     cmp   ah,185  ; Space
  283.         je    still
  284.         jmp  .still
  285. .extended_key:
  286.     mov  [extended_key],0
  287.         mov  [current_key_code],ah
  288.         jmp   .still
  289. ;-------------------------------------------
  290. .button:                        ; button
  291.     mov  eax,17                 ; get id
  292.     mcall
  293.     cmp  ah,1             ; button id=1 ?
  294.         je  START.exit
  295. .noclose:
  296.     cmp  ah,2
  297.         je   still
  298.         jmp  slide_show
  299. ;-------------------------------------------
  300. .1:
  301. ;    mcall 26,9
  302. ;       add  eax,[slide_show_delay]   ;500
  303. ;       mov   [timer],eax
  304.        
  305.         mov   eax,[load_directory_pointer]
  306.         mov   eax,[eax+4]
  307.         test  eax,eax
  308.         jz    @f
  309.         dec   eax
  310. @@:
  311.         cmp   [load_file_number],eax
  312.         je    still
  313.     inc   [load_file_number]
  314.         imul  ebx,[load_file_number],304
  315.         add   ebx,32+40
  316.         add   ebx,[load_directory_pointer]
  317.        
  318.     mov   esi,string
  319.     mov   edi,plugin_pach
  320.     call  copy_file_path
  321.        
  322.         mov  esi,plugin_pach
  323.         mov  edi,string
  324.         mov  ecx,4096/4
  325.         cld
  326.         rep  movsd
  327.     mov  [open_file_flag],0
  328.     mov ecx,-1
  329.     call  getappinfo
  330.     call  load_image
  331.        
  332.         test  eax,eax
  333.         jnz    kopen_1.err
  334.        
  335.     call  convert
  336.         call load_directory.copy_dir_path
  337.        
  338.     call  get_window_param
  339.     test  [window_status],1b
  340.     jz    @f ;draw_still
  341.         mov   [no_draw_window],1
  342.     call  draw_other
  343.         mov   [no_draw_window],0
  344.         jmp   .3  ;slide_show
  345. @@:
  346.     call draw_window
  347. ;       jmp   slide_show
  348. .3:
  349.     mcall 26,9
  350.         add  eax,[slide_show_delay]  ;500
  351.         mov   [timer],eax
  352.     jmp  slide_show
  353. ;---------------------------------------------------------------------
  354. key_up_arrow:
  355.         mov  eax,[scroll_bar_data_vertical.ar_offset]
  356.         mov  ebx,scroll_bar_data_vertical.position
  357.         cmp  [ebx],eax
  358.         jbe  @f
  359.         sub  [ebx],eax
  360.         jmp  .1
  361. @@:
  362.         xor   eax,eax
  363.         cmp  [ebx],eax
  364.         je   still
  365.         mov   [ebx],eax
  366. .1:
  367.         call  drawimage
  368.         call  draw_scrollbars
  369.         jmp   still
  370. ;---------------------------------------------------------------------
  371. key_down_arrow:
  372.         mov  ecx,[scroll_bar_data_vertical.ar_offset]
  373.         mov  ebx,scroll_bar_data_vertical.position
  374.         mov  eax,[scroll_bar_data_vertical.max_area]
  375.         sub  eax,[scroll_bar_data_vertical.cur_area]
  376.         cmp  [ebx],eax
  377.         je   still
  378.         push eax
  379.         sub  eax,ecx
  380.         cmp  [ebx],eax
  381.         pop  eax
  382.         jae  @f
  383.         add  [ebx],ecx
  384.         jmp  key_up_arrow.1
  385. @@:
  386.         mov  [ebx],eax
  387.         jmp  key_up_arrow.1
  388. ;---------------------------------------------------------------------
  389. key_left_arrow:
  390.         mov  eax,[scroll_bar_data_horizontal.ar_offset]
  391.         mov  ebx,scroll_bar_data_horizontal.position
  392.         cmp  [ebx],eax
  393.         jbe  @f
  394.         sub  [ebx],eax
  395.         jmp  key_up_arrow.1
  396. @@:
  397.         xor   eax,eax
  398.         cmp  [ebx],eax
  399.         je   still
  400.         mov   [ebx],eax
  401.         jmp  key_up_arrow.1
  402. ;---------------------------------------------------------------------
  403. key_right_arrow:
  404.         mov  ecx,[scroll_bar_data_horizontal.ar_offset]
  405.         mov  ebx,scroll_bar_data_horizontal.position
  406.         mov  eax,[scroll_bar_data_horizontal.max_area]
  407.         sub  eax,[scroll_bar_data_horizontal.cur_area]
  408.         cmp  [ebx],eax
  409.         je   still
  410.         push eax
  411.         sub  eax,ecx
  412.         cmp  [ebx],eax
  413.         pop  eax
  414.         jae  @f
  415.         add  [ebx],ecx
  416.         jmp  key_up_arrow.1
  417. @@:
  418.         mov  [ebx],eax
  419.        
  420. ;       xor   eax,eax
  421. ;       mov   ax,[scroll_bar_data_horizontal.size_x]
  422. ;       sub   eax,[scroll_bar_data_horizontal.btn_high]
  423. ;       sub   eax,[scroll_bar_data_horizontal.btn_high]
  424. ;       sub   eax,[scroll_bar_data_horizontal.run_size]
  425. ;       mov   [scroll_bar_data_horizontal.position2],eax
  426.         jmp  key_up_arrow.1
  427. ;---------------------------------------------------------------------