Subversion Repositories Kolibri OS

Rev

Rev 5002 | Rev 5009 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. use32
  2.         org 0x0
  3.         db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
  4.         dd 0x1
  5.         dd start
  6.         dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
  7.         dd mem
  8.         dd stacktop
  9.         dd 0
  10.         dd sys_path
  11.  
  12. include '../../../../macros.inc'
  13. include '../../../../proc32.inc'
  14. include '../../../../develop/libraries/box_lib/load_lib.mac'
  15. include '../../../../develop/libraries/box_lib/trunk/box_lib.mac'
  16. include '../../../../dll.inc'
  17.  
  18. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  19. caption db 'à®á¬®âà ¨­ä®à¬ æ¨¨ Exif 18.07.14',0 ;¯®¤¯¨áì ®ª­ 
  20.  
  21. struct FileInfoBlock
  22.         Function dd ?
  23.         Position dd ?
  24.         Flags    dd ?
  25.         Count    dd ?
  26.         Buffer   dd ?
  27.                 db ?
  28.         FileName dd ?
  29. ends
  30.  
  31. run_file_70 FileInfoBlock
  32. image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  33.  
  34. fn_toolbar db 'toolbar.png',0
  35. IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
  36. IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*6
  37. image_data_toolbar dd 0
  38.  
  39. IMAGE_FILE1_SIZE equ 128*144*3+54 ;à §¬¥à ä ©«  á ¨§®¡à ¦¥­¨¥¬
  40.  
  41. memory_file_size dd 512*1024 ;à §¬¥à ¯ ¬ï⨠¤«ï ®âªàëâ¨ï ä ©«®¢ (¢ ­ ç «¥ 512 Kb, ­® ¬®¦¥â 㢥«¨ç¨¢ âáï ¯à¨ ­¥®¡å®¤¨¬®áâ¨)
  42.  
  43. macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
  44.         ;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
  45.         if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
  46.                 jmp @f
  47.                         local .path_str
  48.                         .path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
  49.                         db 0
  50.                 @@:
  51.                 ;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
  52.                 copy_path .path_str,[32],file_name,0x0
  53.         else
  54.                 copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
  55.         end if
  56.  
  57.         stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
  58.         mov [buf],eax
  59.  
  60.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  61.         mov [run_file_70.Function], 0
  62.         mov [run_file_70.Position], 0
  63.         mov [run_file_70.Flags], 0
  64.         mov [run_file_70.Count], dword size
  65.         m2m [run_file_70.Buffer], [buf]
  66.         mov byte[run_file_70+20], 0
  67.         mov [run_file_70.FileName], file_name
  68.         mov ebx,run_file_70
  69.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  70.         cmp ebx,0xffffffff
  71.         je @f
  72.                 ;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
  73.                 stdcall dword[img_decode], dword[buf],ebx,0
  74.                 mov dword[image_data],eax
  75.                 ;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
  76.                 stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
  77.                 ;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
  78.                 stdcall dword[img_destroy], dword[image_data]
  79.         @@:
  80. }
  81.  
  82.  
  83.  
  84. align 4
  85. start:
  86.         load_libraries l_libs_start,l_libs_end
  87.         ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
  88.         mov     ebp,lib_0
  89.         cmp     dword [ebp+ll_struc_size-4],0
  90.         jz      @f
  91.                 mcall -1 ;exit not correct
  92.         @@:
  93.         mcall 48,3,sc,sizeof.system_colors
  94.         mcall 40,0xC0000027
  95.         stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
  96.  
  97.         stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
  98.  
  99.         load_image_file 'font8x9.bmp', image_data_toolbar,IMAGE_FILE1_SIZE
  100.         stdcall [buf2d_create_f_img], buf_1,[image_data_toolbar] ;ᮧ¤ ¥¬ ¡ãä¥à
  101.         stdcall mem.Free,[image_data_toolbar] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
  102.         stdcall [buf2d_conv_24_to_8], buf_1,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8 ¡¨â
  103.         stdcall [buf2d_convert_text_matrix], buf_1
  104.  
  105.         load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
  106.  
  107.         stdcall mem.Alloc,[memory_file_size]
  108.         mov dword[open_file],eax
  109.        
  110.         call but_new_file
  111.  
  112. align 4
  113. red_win:
  114.         call draw_window
  115.  
  116. align 4
  117. still:
  118.         mcall 10
  119.  
  120.         cmp al,1
  121.         jz red_win
  122.         cmp al,2
  123.         jz key
  124.         cmp al,3
  125.         jz button
  126.         cmp al,6 ;¬ëèì
  127.         jne @f
  128.                 jmp mouse
  129.         @@:
  130.         jmp still
  131.  
  132. align 4
  133. draw_window:
  134. pushad
  135.         mcall 12,1
  136.  
  137.         ; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
  138.         xor eax,eax
  139.         mov ebx,(20 shl 16)+480
  140.         mov ecx,(20 shl 16)+540
  141.         mov edx,[sc.work]
  142.         or  edx,(3 shl 24)+0x30000000
  143.         mov edi,caption
  144.         int 0x40
  145.  
  146.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
  147.         mov eax,8
  148.         mov ebx,(5 shl 16)+20
  149.         mov ecx,(5 shl 16)+20
  150.         mov edx,3
  151.         mov esi,[sc.work_button]
  152.         int 0x40
  153.  
  154.         mov ebx,(30 shl 16)+20
  155.         mov edx,4
  156.         int 0x40
  157.  
  158.         mov ebx,(55 shl 16)+20
  159.         mov edx,5
  160.         int 0x40
  161.  
  162.         mov ebx,(85 shl 16)+20
  163.         mov edx,6
  164.         int 0x40
  165.  
  166.         mov ebx,(110 shl 16)+20
  167.         mov edx,7
  168.         int 0x40
  169.  
  170.         mov ebx,(135 shl 16)+20
  171.         mov edx,8
  172.         int 0x40
  173.  
  174.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  175.         mov eax,7
  176.         mov ebx,[image_data_toolbar]
  177.         mov ecx,(16 shl 16)+16
  178.         mov edx,(7 shl 16)+7 ;icon new
  179.         int 0x40
  180.  
  181.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  182.         add edx,(25 shl 16) ;icon open
  183.         int 0x40
  184.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  185.         add edx,(25 shl 16) ;icon save
  186.         int 0x40
  187.  
  188.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  189.         add edx,(30 shl 16) ;
  190.         int 0x40
  191.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  192.         add edx,(25 shl 16) ;
  193.         int 0x40
  194.         ;add ebx,IMAGE_TOOLBAR_ICON_SIZE
  195.         ;add edx,(25 shl 16) ;
  196.         ;int 0x40
  197.  
  198.         ; *** à¨á®¢ ­¨¥ ¡ãä¥à  ***
  199.         stdcall [buf2d_draw], buf_0
  200.  
  201.         mcall 12,2
  202. popad
  203.         ret
  204.  
  205. align 4
  206. key:
  207.         mcall 2
  208.         jmp still
  209.  
  210. align 4
  211. mouse:
  212.  
  213.         jmp still
  214.  
  215. align 4
  216. button:
  217.         mcall 17
  218.         cmp ah,3
  219.         jne @f
  220.                 call but_new_file
  221.         @@:
  222.         cmp ah,4
  223.         jne @f
  224.                 call but_open_file
  225.         @@:
  226.         cmp ah,5
  227.         jne @f
  228.                 call but_save_file
  229.         @@:
  230.         cmp ah,6
  231.         jne @f
  232.                 call but_1
  233.         @@:
  234.         cmp ah,7
  235.         jne @f
  236.                 call but_2
  237.         @@:
  238.         cmp ah,8
  239.         jne @f
  240.                 call but_3
  241.         @@:
  242.         cmp ah,1
  243.         jne still
  244. .exit:
  245.         stdcall [buf2d_delete],buf_0
  246.         stdcall [buf2d_delete],buf_1 ;㤠«ï¥¬ ¡ãä¥à
  247.         stdcall mem.Free,[image_data_toolbar]
  248.         stdcall mem.Free,[open_file]
  249.         mcall -1
  250.  
  251.  
  252. align 4
  253. but_new_file:
  254.         mov dword[open_file_size],0
  255.         call draw_file_1
  256.         ret
  257.  
  258. align 4
  259. open_file dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢
  260. open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©«  (¤®«¦¥­ ¡ëâì ­¥ ¡®«ìè¥ memory_file_size)
  261.  
  262. align 4
  263. but_open_file:
  264.         pushad
  265.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  266.         mov [OpenDialog_data.type],0
  267.         stdcall [OpenDialog_Start],OpenDialog_data
  268.         cmp [OpenDialog_data.status],2
  269.         je .end_open_file
  270.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  271.  
  272.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  273.         mov [run_file_70.Function], 5
  274.         mov [run_file_70.Position], 0
  275.         mov [run_file_70.Flags], 0
  276.         mov dword[run_file_70.Count], 0
  277.         m2m [run_file_70.Buffer], [open_file]
  278.         mov byte[run_file_70+20], 0
  279.         mov dword[run_file_70.FileName], openfile_path
  280.         mov ebx,run_file_70
  281.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  282.         cmp eax,0
  283.         jne .end_open_file
  284.  
  285.         mov eax,[open_file]
  286.         mov ebx,dword[eax+32] ;dword[eax+32] - à §¬¥à ®âªà뢠¥¬®£® ä ©« 
  287.         mov dword[open_file_size],ebx ;ebx - à §¬¥à ®âªà뢠¥¬®£® ä ©« 
  288.         ;memory_file_size - à §¬¥à ¢ë¤¥«¥­­®© ¯ ¬ï⨠¤«ï ä ©« 
  289.         cmp dword[memory_file_size],ebx
  290.         jge @f
  291.                 ;㢥«¨ç¨¢ ¥¬ ¯ ¬ïâì ¥á«¨ ­¥ 墠⨫®
  292.                 mov dword[memory_file_size],ebx
  293.                 stdcall mem.ReAlloc, dword[open_file],ebx
  294.         @@:
  295.  
  296.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  297.         mov [run_file_70.Function], 0
  298.         mov [run_file_70.Position], 0
  299.         mov [run_file_70.Flags], 0
  300.         m2m dword[run_file_70.Count], dword[open_file_size]
  301.         m2m dword[run_file_70.Buffer],dword[open_file]
  302.         mov byte[run_file_70+20], 0
  303.         mov dword[run_file_70.FileName], openfile_path
  304.         mov ebx,run_file_70
  305.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  306.         cmp ebx,0xffffffff
  307.         je .end_open_file
  308.  
  309.         mov [open_file_size],ebx
  310.         ;add ebx,dword[open_file]
  311.         ;mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
  312.         stdcall [exif_get_app1], [open_file],h_app1
  313.         mcall 71,1,openfile_path
  314.  
  315.         call draw_file_1
  316.         .end_open_file:
  317.         popad
  318.         ret
  319.  
  320. align 4
  321. draw_file_1:
  322. pushad
  323.         stdcall [buf2d_clear], buf_0, [buf_0.color]
  324.         cmp dword[open_file_size],0
  325.         je .open_file
  326.  
  327.         mov eax,1
  328.         mov ebx,1
  329.         .cycle_0:
  330.                 stdcall [exif_get_app1_tag], h_app1,eax,txt_buf,80
  331.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_buf,3,ebx,0xb0
  332.                 inc eax
  333.                 add ebx,10
  334.                 cmp byte[txt_buf],0
  335.                 jne .cycle_0
  336.  
  337.         ;áç¨â뢠¥¬ ¤®ç¥à­¨¥ ⥣¨ ¤«ï 0x8769
  338.         stdcall [exif_get_app1_child], h_app1,h_child,0x8769
  339.         cmp dword[h_child],0
  340.         je .no_found_child
  341.  
  342.         mov eax,1
  343.         sub ebx,5
  344.         .cycle_1:
  345.                 stdcall [exif_get_app1_tag], h_child,eax,txt_buf,80
  346.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_buf,3,ebx,0xb00000
  347.                 inc eax
  348.                 add ebx,10
  349.                 cmp byte[txt_buf],0
  350.                 jne .cycle_1
  351.  
  352.         jmp @f
  353.         .no_found_child:
  354.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_nochild,3,ebx,0xb000
  355.                 jmp @f
  356.         .open_file:
  357.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_openfile,3,3,0xb000
  358.         @@:
  359.         stdcall [buf2d_draw], buf_0
  360. popad
  361.         ret
  362.  
  363. align 4
  364. draw_file_2:
  365. pushad
  366.         stdcall [buf2d_clear], buf_0, [buf_0.color]
  367.         cmp dword[open_file_size],0
  368.         je .open_file
  369.  
  370.         mov eax,1
  371.         mov ebx,1
  372.         .cycle_0:
  373.                 stdcall [exif_get_app1_tag], h_app1,eax,txt_buf,80
  374.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_buf,3,ebx,0xb0
  375.                 inc eax
  376.                 add ebx,10
  377.                 cmp byte[txt_buf],0
  378.                 jne .cycle_0
  379.  
  380.         ;áç¨â뢠¥¬ ¤®ç¥à­¨¥ ⥣¨ ¤«ï 0x8825
  381.         stdcall [exif_get_app1_child], h_app1,h_child,0x8825
  382.         cmp dword[h_child],0
  383.         je .no_found_child
  384.  
  385.         mov eax,1
  386.         sub ebx,5
  387.         .cycle_1:
  388.                 stdcall [exif_get_app1_tag], h_child,eax,txt_buf,80
  389.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_buf,3,ebx,0xb00000
  390.                 inc eax
  391.                 add ebx,10
  392.                 cmp byte[txt_buf],0
  393.                 jne .cycle_1
  394.  
  395.         jmp @f
  396.         .no_found_child:
  397.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_nochild,3,ebx,0xb000
  398.                 jmp @f
  399.         .open_file:
  400.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_openfile,3,3,0xb000
  401.         @@:
  402.         stdcall [buf2d_draw], buf_0
  403. popad
  404.         ret
  405.  
  406. align 4
  407. draw_file_3:
  408. pushad
  409.         stdcall [buf2d_clear], buf_0, [buf_0.color]
  410.         cmp dword[open_file_size],0
  411.         je .open_file
  412.  
  413.         mov eax,1
  414.         mov ebx,1
  415.         .cycle_0:
  416.                 stdcall [exif_get_app1_tag], h_app1,eax,txt_buf,80
  417.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_buf,3,ebx,0xb0
  418.                 inc eax
  419.                 add ebx,10
  420.                 cmp byte[txt_buf],0
  421.                 jne .cycle_0
  422.  
  423.         ;áç¨â뢠¥¬ ¤®ç¥à­¨¥ ⥣¨ ¤«ï 0x8769
  424.         stdcall [exif_get_app1_child], h_app1,h_child,0x8769
  425.         cmp dword[h_child],0
  426.         je .no_found_child
  427.         ;áç¨â뢠¥¬ ¤®ç¥à­¨¥ ⥣¨ ¤«ï 0xa005
  428.         stdcall [exif_get_app1_child], h_child,h_child,0xa005
  429.         cmp dword[h_child],0
  430.         je .no_found_child
  431.  
  432.         mov eax,1
  433.         sub ebx,5
  434.         .cycle_1:
  435.                 stdcall [exif_get_app1_tag], h_child,eax,txt_buf,80
  436.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_buf,3,ebx,0xb00000
  437.                 inc eax
  438.                 add ebx,10
  439.                 cmp byte[txt_buf],0
  440.                 jne .cycle_1
  441.  
  442.         jmp @f
  443.         .no_found_child:
  444.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_nochild,3,ebx,0xb000
  445.                 jmp @f
  446.         .open_file:
  447.                 stdcall [buf2d_draw_text], buf_0, buf_1,txt_openfile,3,3,0xb000
  448.         @@:
  449.         stdcall [buf2d_draw], buf_0
  450. popad
  451.         ret
  452.  
  453. align 4
  454. but_save_file:
  455.         pushad
  456.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  457.         mov [OpenDialog_data.type],1
  458.         stdcall [OpenDialog_Start],OpenDialog_data
  459.         cmp [OpenDialog_data.status],2
  460.         je .end_save_file
  461.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  462.  
  463.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  464.         mov [run_file_70.Function], 2
  465.         mov [run_file_70.Position], 0
  466.         mov [run_file_70.Flags], 0
  467.         mov ebx, dword[open_file]
  468.         mov [run_file_70.Buffer], ebx
  469.         mov ebx,[open_file_size]
  470.         mov dword[run_file_70.Count], ebx ;à §¬¥à ä ©« 
  471.         mov byte[run_file_70+20], 0
  472.         mov dword[run_file_70.FileName], openfile_path
  473.         mov ebx,run_file_70
  474.         int 0x40 ;á®å࠭塞 ä ©« ¨§®¡à ¦¥­¨ï
  475.         ;cmp ebx,0xffffffff
  476.         ;je .end_save_file
  477.         ; ... á®®¡é¥­¨¥ ® ­¥ã¤ ç­®¬ á®åà ­¥­¨¨ ...
  478.  
  479.         .end_save_file:
  480.         popad
  481.         ret
  482.  
  483. align 4
  484. but_1:
  485.         call draw_file_1 ;®á­®¢­ ï ¨­ä®à¬ æ¨ï
  486.         ret
  487.  
  488. align 4
  489. but_2:
  490.         call draw_file_2 ;¨­ä®à¬ æ¨ï ¯® GPS
  491.         ret
  492.  
  493. align 4
  494. but_3:
  495.         call draw_file_3 ;¥é¥ ª ª ï-â® ¨­ä®à¬ æ¨ï ...
  496.         ret
  497.  
  498. ;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
  499. align 4
  500. OpenDialog_data:
  501. .type                   dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
  502. .procinfo               dd procinfo     ;+4
  503. .com_area_name          dd communication_area_name      ;+8
  504. .com_area               dd 0    ;+12
  505. .opendir_path           dd plugin_path  ;+16
  506. .dir_default_path       dd default_dir ;+20
  507. .start_path             dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  508. .draw_window            dd draw_window  ;+28
  509. .status                 dd 0    ;+32
  510. .openfile_path          dd openfile_path        ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  511. .filename_area          dd filename_area        ;+40
  512. .filter_area            dd Filter
  513. .x:
  514. .x_size                 dw 420 ;+48 ; Window X size
  515. .x_start                dw 10 ;+50 ; Window X position
  516. .y:
  517. .y_size                 dw 320 ;+52 ; Window y size
  518. .y_start                dw 10 ;+54 ; Window Y position
  519.  
  520. default_dir db '/rd/1',0
  521.  
  522. communication_area_name:
  523.         db 'FFFFFFFF_open_dialog',0
  524. open_dialog_name:
  525.         db 'opendial',0
  526. communication_area_default_path:
  527.         db '/rd/1/File managers/',0
  528.  
  529. Filter:
  530. dd Filter.end - Filter ;.1
  531. .1:
  532. db 'JPG',0
  533. db 'JPEG',0
  534. .end:
  535. db 0
  536.  
  537.  
  538.  
  539. head_f_i:
  540. head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
  541.  
  542. system_dir_0 db '/sys/lib/'
  543. lib_name_0 db 'proc_lib.obj',0
  544. err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
  545. err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
  546.  
  547. system_dir_1 db '/sys/lib/'
  548. lib_name_1 db 'libimg.obj',0
  549. err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
  550. err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
  551.  
  552. system_dir_2 db '/sys/lib/'
  553. lib_name_2 db 'buf2d.obj',0
  554. err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
  555. err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
  556.  
  557. system_dir_3 db '/sys/lib/'
  558. lib_name_3 db 'exif.obj',0
  559. err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'exif.obj',39,0
  560. err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'exif',39,0
  561.  
  562. l_libs_start:
  563.         lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  564.                 err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
  565.         lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  566.                 err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
  567.         lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
  568.                 err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
  569.         lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
  570.                 err_msg_found_lib_3,head_f_l,import_exif,err_msg_import_3,head_f_i
  571. l_libs_end:
  572.  
  573. align 4
  574. import_libimg:
  575.         dd alib_init1
  576.         img_is_img  dd aimg_is_img
  577.         img_info    dd aimg_info
  578.         img_from_file dd aimg_from_file
  579.         img_to_file dd aimg_to_file
  580.         img_from_rgb dd aimg_from_rgb
  581.         img_to_rgb  dd aimg_to_rgb
  582.         img_to_rgb2 dd aimg_to_rgb2
  583.         img_decode  dd aimg_decode
  584.         img_encode  dd aimg_encode
  585.         img_create  dd aimg_create
  586.         img_destroy dd aimg_destroy
  587.         img_destroy_layer dd aimg_destroy_layer
  588.         img_count   dd aimg_count
  589.         img_lock_bits dd aimg_lock_bits
  590.         img_unlock_bits dd aimg_unlock_bits
  591.         img_flip    dd aimg_flip
  592.         img_flip_layer dd aimg_flip_layer
  593.         img_rotate  dd aimg_rotate
  594.         img_rotate_layer dd aimg_rotate_layer
  595.         img_draw    dd aimg_draw
  596.  
  597.         dd 0,0
  598.         alib_init1   db 'lib_init',0
  599.         aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
  600.         aimg_info    db 'img_info',0
  601.         aimg_from_file db 'img_from_file',0
  602.         aimg_to_file db 'img_to_file',0
  603.         aimg_from_rgb db 'img_from_rgb',0
  604.         aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
  605.         aimg_to_rgb2 db 'img_to_rgb2',0
  606.         aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
  607.         aimg_encode  db 'img_encode',0
  608.         aimg_create  db 'img_create',0
  609.         aimg_destroy db 'img_destroy',0
  610.         aimg_destroy_layer db 'img_destroy_layer',0
  611.         aimg_count   db 'img_count',0
  612.         aimg_lock_bits db 'img_lock_bits',0
  613.         aimg_unlock_bits db 'img_unlock_bits',0
  614.         aimg_flip    db 'img_flip',0
  615.         aimg_flip_layer db 'img_flip_layer',0
  616.         aimg_rotate  db 'img_rotate',0
  617.         aimg_rotate_layer db 'img_rotate_layer',0
  618.         aimg_draw    db 'img_draw',0
  619.  
  620. align 4
  621. proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
  622.         OpenDialog_Init dd aOpenDialog_Init
  623.         OpenDialog_Start dd aOpenDialog_Start
  624. dd 0,0
  625.         aOpenDialog_Init db 'OpenDialog_init',0
  626.         aOpenDialog_Start db 'OpenDialog_start',0
  627.  
  628. align 4
  629. import_buf2d:
  630.         init dd sz_init
  631.         buf2d_create dd sz_buf2d_create
  632.         buf2d_create_f_img dd sz_buf2d_create_f_img
  633.         buf2d_clear dd sz_buf2d_clear
  634.         buf2d_draw dd sz_buf2d_draw
  635.         buf2d_delete dd sz_buf2d_delete
  636.         buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
  637.         buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
  638.         buf2d_draw_text dd sz_buf2d_draw_text
  639.         dd 0,0
  640.         sz_init db 'lib_init',0
  641.         sz_buf2d_create db 'buf2d_create',0
  642.         sz_buf2d_create_f_img db 'buf2d_create_f_img',0
  643.         sz_buf2d_clear db 'buf2d_clear',0
  644.         sz_buf2d_draw db 'buf2d_draw',0
  645.         sz_buf2d_delete db 'buf2d_delete',0
  646.         sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
  647.         sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
  648.         sz_buf2d_draw_text db 'buf2d_draw_text',0
  649.  
  650. align 4
  651. import_exif: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
  652.         exif_get_app1 dd sz_exif_get_app1
  653.         exif_get_app1_tag dd sz_exif_get_app1_tag
  654.         exif_get_app1_child dd sz_exif_get_app1_child
  655. dd 0,0
  656.         sz_exif_get_app1 db 'exif_get_app1',0
  657.         sz_exif_get_app1_tag db 'exif_get_app1_tag',0
  658.         sz_exif_get_app1_child db 'exif_get_app1_child',0
  659.         ;exif_get_image_160_120
  660.  
  661. sc system_colors
  662.  
  663. align 16
  664. procinfo process_information
  665.  
  666. align 4
  667. buf_0: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  668.         dw 5 ;+4 left
  669.         dw 31 ;+6 top
  670. .w: dd 456 ;+8 w
  671. .h: dd 480 ;+12 h
  672. .color: dd 0xffffd0 ;+16 color
  673.         db 24 ;+20 bit in pixel
  674.  
  675. align 4
  676. buf_1:
  677.         dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  678.         dw 25 ;+4 left
  679.         dw 25 ;+6 top
  680.         dd 128 ;+8 w
  681.         dd 144 ;+12 h
  682.         dd 0 ;+16 color
  683.         db 24 ;+20 bit in pixel
  684.  
  685. h_app1  dd 0,0,0 ;áâàãªâãà  ¤«ï § £®«®¢ª  £« ¢­ëå ⥣®¢
  686. h_child dd 0,0,0 ;áâàãªâãà  ¤«ï § £®«®¢ª  ¤®ç¥à­¨å ⥣®¢
  687. txt_openfile db 'Žâªà®©â¥ ä ©« ¨§®¡à ¦¥­¨ï ¢ ä®à¬ â¥ *.jpg.',0
  688. txt_nochild  db 'ˆ­ä®à¬ æ¨ï ¯® í⮩ ª­®¯ª¥ ­¥ ­ ©¤¥­ .',0
  689. txt_buf rb 80
  690.  
  691. i_end:
  692.         rb 2048
  693. stacktop:
  694.         sys_path rb 1024
  695.         file_name:
  696.                 rb 1024 ;4096
  697.         library_path rb 1024
  698.         plugin_path rb 4096
  699.         openfile_path rb 4096
  700.         filename_area rb 256
  701. mem:
  702.