Subversion Repositories Kolibri OS

Rev

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

  1. ;*******************************************************
  2. ;**************GRAPHICS EDITOR ANIMAGE *****************
  3. ;*******************************************************
  4. ; version: 1.51
  5. ; last update:  23.03.2016
  6. ; changes:      Use library 'kmenu.obj', update GUI
  7. ; autors:       IgorA, Veliant, Leency
  8. ;--------------------------------------------------------
  9. ; version: 1.4
  10. ; last update:  12.03.2016
  11. ; changes:      Use library 'libimg.obj'
  12. ; autors:       IgorA
  13. ;--------------------------------------------------------
  14. ; version: 1.3
  15. ; last update:  05.10.2010
  16. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  17. ; changes:      Fixed window flicker when redrawing,
  18. ;               Fixed memory leak for stack
  19. ;--------------------------------------------------------
  20. ; version: 1.2
  21. ; last update:  30.09.2010
  22. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  23. ; changes:      Program used function 68 instead 64 is now,
  24. ;               select path with OpenDialog
  25. ;--------------------------------------------------------
  26. ; version: 1.1
  27. ; last update:  09.12.2006
  28. ; autors:
  29. ; programming by andrew_programmer
  30. ; design by golus
  31.  
  32. use32
  33. org     0x0
  34.         db 'MENUET01'
  35.         dd 1, START, IM_END, I_END
  36.         dd stacktop, file_path, cur_dir_path
  37.  
  38. include '../../../config.inc' ;for nightbuild
  39. include '../../../macros.inc'
  40. include '../../../proc32.inc'
  41. include '../../../KOSfuncs.inc'
  42. include '../../../develop/libraries/box_lib/load_lib.mac'
  43. include '../../../dll.inc'
  44. include '../../../libio.inc'
  45. ;include '../../../develop/libraries/libs-dev/libimg/libimg.inc'
  46.  
  47. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  48.  
  49. ;---------------------------------------------------------
  50. ; *** ª®­áâ ­âë ¤«ï ¨­â¥àä¥©á  ***
  51. ; *** constants for interface  ***
  52.  
  53. ; ª®à४â¨à®¢ª¨ ­  ᪨­
  54. ci_offs_skin_w equ  5 ;ª®à४â¨à®¢ª  ­  è¨à¨­ã à ¬ª¨ ᪨­ 
  55. ci_offs_skin_h equ 24 ;ª®à४â¨à®¢ª  ­  ¢ëá®âã ᪨­ 
  56.  
  57. ; £« ¢­®¥ ®ª­®
  58. ci_wnd_min_siz_x equ 585 ;minimum size x
  59. ci_wnd_min_siz_y equ 400 ;minimum size y
  60.  
  61. ; ¯ ­¥«ì ¨­áâà㬥­â®¢
  62. ci_panel_x_pos equ  0 ;ª®®à¤. x ¤«ï ¯ ­¥«¨
  63. ci_panel_y_pos equ 20 ;ª®®à¤. y ¤«ï ¯ ­¥«¨
  64. ci_panel_but_y1 equ ci_panel_y_pos +5 ;ª®®à¤. y ¤«ï 1-£® à鸞 ª­®¯®ª
  65. ci_panel_but_y2 equ ci_panel_y_pos+30 ;ª®®à¤. y ¤«ï 2-£® à鸞 ª­®¯®ª
  66. ci_palete_y_pos equ ci_panel_y_pos+51 ;ª®®à¤. y ¤«ï ¯ «¨âàë 梥⮢
  67. ci_panel_zoom_x equ 178 ;ª®®à¤. x ¤«ï ª­®¯®ª ¯ ­¥«¨ ¬ áèâ ¡ 
  68.  
  69. ; ®ª­® । ªâ®à 
  70. ci_edit_wnd_x_pos  equ  0 ;ª®®à¤. x ¤«ï ®ª­  । ªâ®à 
  71. ci_edit_wnd_y_pos  equ 71 ;ª®®à¤. y ¤«ï ®ª­  । ªâ®à 
  72. ci_edit_wnd_border equ  3 ;à ¬ª  ¢®ªà㣠®ª­  । ªâ®à 
  73.  
  74. ; áªà®««¨­£¨
  75. ci_scroll_dim equ 22 ;à §¬¥àë áªà®««¨­£®¢
  76. ci_scrollh_coord_x_min equ (ci_edit_wnd_x_pos+3) ;¬¨­¨¬ «ì­ ï ¯®§¨æ¨ï ¯®«§ã­ª 
  77.         ;£®à¨§®­â «ì­®£® áªà®««¨­£ 
  78. ci_scrollv_coord_y_min equ (ci_edit_wnd_y_pos+3) ;¬¨­¨¬ «ì­ ï ¯®§¨æ¨ï ¯®«§ã­ª 
  79.         ;¢¥à⨪ «ì­®£® áªà®««¨­£ 
  80. ;---------------------------------------------------------
  81.  
  82. include 'bmplib.inc'
  83. include 'dialog2.inc'
  84. include 'design.inc'
  85. include 'graphlib.inc'
  86.  
  87. include 'cursors.inc'
  88. include 'memory.inc'
  89. include 'load_from_parameters.inc'
  90.  
  91. START:
  92.         mcall SF_SYS_MISC,SSF_HEAP_INIT
  93.         mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, syscolors, syscolors_end-syscolors
  94.        
  95. load_libraries l_libs_start,end_l_libs
  96.  
  97.         cmp     eax,-1
  98.         jz      close
  99.  
  100.         mcall SF_SET_EVENTS_MASK,0x80000067 ; 1100111b
  101. ;---------------------------------------------------------
  102. ;-----------------------init data-------------------------
  103. ;---------------------------------------------------------
  104. include 'init_data.inc'
  105.  
  106. ;----------------------------------------------------------
  107. ;--------get memory and draw window of program-------------
  108. ;----------------------------------------------------------
  109.         call GetMemory
  110.         mov     [Current_instrument],10 ;pencil
  111.         call TakeButtonInstruments  ;set startup instrument
  112.         call cleare_work_arrea
  113.         call load_icons
  114.         call init_main_menu
  115.  
  116. ;load cursors
  117.         mov     eax,CursorsID
  118.         call load_cursors
  119.  
  120. ;---------------------------------------------------------
  121. ;---------check loading of file from parameters-----------
  122. ;---------------------------------------------------------
  123.         mov     eax,file_path
  124.         cmp [eax],byte 0
  125.         jz @f
  126.         call load_picture
  127.         call MovePictureToWorkScreen
  128. @@:
  129.  
  130. ;---------------------------------------------------------------------
  131.         mov     edi,filename_area
  132.         mov     esi,path4+5
  133.         call    copy_str_1
  134.  
  135.         mov     edi,file_path
  136.         cmp     [edi],byte 0
  137.         jne     @f
  138.         mov     esi,path4
  139.         call    copy_str_1
  140. @@:
  141. ;OpenDialog     initialisation
  142.         stdcall [OpenDialog_Init], OpenDialog_data
  143. ;---------------------------------------------------------------------
  144.  
  145. align 4
  146. red:
  147.         call drawwin
  148. ;----------------------------------------------------------
  149. ;---------------------main loop----------------------------
  150. ;----------------------------------------------------------
  151. align 4
  152. still:
  153.         mcall SF_WAIT_EVENT
  154.  
  155.         cmp     eax,1
  156.         je      red
  157.  
  158.         cmp     eax,2
  159.         je      keys
  160.  
  161.         cmp     eax,3
  162.         je      buttons
  163.  
  164.         cmp     eax,6
  165.         je      mouse
  166.  
  167.         jmp     still
  168.        
  169. ;---------------------------------------------------------------------
  170. copy_str_1:
  171.         xor     eax,eax
  172.         cld
  173. @@:
  174.         lodsb
  175.         stosb
  176.         test    eax,eax
  177.         jnz     @b
  178.         ret
  179. ;---------------------------------------------------------------------
  180. include 'events.inc'
  181. include 'events_of_window.inc'
  182. include 'events_of_keys.inc'
  183. include 'events_of_buttons.inc'
  184. include 'events_of_mouse.inc'
  185. include 'panel_engen.inc'
  186. include 'screen.inc'
  187. include 'menu_instruments.inc'
  188. include 'icons_instruments.inc'
  189. include 'icons.inc'
  190. include 'sprites.inc'
  191. include 'string.inc'
  192. include 'palette.inc'
  193. include 'files.inc'
  194. include 'time.inc'
  195. include 'menu.inc'
  196. ;-----------------------------------------------------------
  197. ;------------variables and data of program------------------
  198. ;-----------------------------------------------------------
  199. ;sound_havent_memory db 150,64,0
  200.  
  201. include 'lib_data.inc'
  202. include 'panel_data.inc'
  203. include 'palitra256.inc'
  204. include 'brushes.inc'
  205. include 'spray.inc'
  206. include 'width_lines.inc'
  207. ;----------------------------------------------------------
  208. ;-------------------icon's picture-------------------------
  209. ;----------------------------------------------------------
  210. align 4
  211. panel_picture:
  212. file 'panel_buttons.png'
  213. .end:
  214. align 4
  215. panel_zoom:
  216. file 'panel_zoom.png'
  217. .end:
  218. ;****************cursors******************
  219. brush_cursor:
  220. file 'cursors/brush.cur'
  221. flood_fill_cursor:
  222. file 'cursors/flood_fill.cur'
  223. lastik_cursor:
  224. file 'cursors/lastik.cur'
  225. other_cursor:
  226. file 'cursors/other.cur'
  227. pencil_cursor:
  228. file 'cursors/pencil.cur'
  229. pipette_cursor:
  230. file 'cursors/pipette.cur'
  231. spray_cursor:
  232. file 'cursors/spray.cur'
  233. zoom_cursor:
  234. file 'cursors/zoom.cur'
  235. ;----------------------------------------------------------
  236. align 4
  237. IM_END:
  238. ;-----------------------------------------------------------
  239. ;------------variables and data of program------------------
  240. ;-----------------------------------------------------------
  241. time                    rd 1
  242. PosX                    rd 1 ;scroll x file position
  243. PosY                    rd 1 ;scroll y file position
  244. PointerToIcons          rd 1
  245. ScreenPointer           rd 1
  246. PointerToPicture        rd 1
  247. PointerToCopyPicture    rd 1
  248. PointerToCopyPicture2   rd 1
  249. PointerToEditBufer      rd 1
  250. PointerToSpriteBufer    rd 1
  251. PointerToPalette        rd 1 ;㪠§ â¥«ì ­  ¯¨«¨âàã (­ã¦¥­ ¤«ï á®åà ­¥­¨ï ¢ *.bmp)
  252. Color                   rd 1
  253. SColor                  rd 1
  254. Number_Brush            rd 1
  255. Brush_SizeX             rd 1
  256. Brush_SizeY             rd 1
  257. Current_instrument      rd 1
  258. Last_instrument         rd 1
  259. OldX                    rd 1
  260. OldY                    rd 1
  261.  
  262. MouseX                  rd 1
  263. MouseY                  rd 1
  264. Window_SizeX            rd 1
  265. Window_SizeY            rd 1
  266. Window_CordinatX        rd 1
  267. Window_CordinatY        rd 1
  268. Picture_SizeX           rd 1
  269. Picture_SizeY           rd 1
  270. ScreenX                 rd 1 ;ª®®à¤¨­ â  x ªãàá®à  á ãç¥â®¬ ¬ áèâ ¡ 
  271. ScreenY                 rd 1 ;ª®®à¤¨­ â  y ªãàá®à  á ãç¥â®¬ ¬ áèâ ¡ 
  272. WorkScreen_SizeX        rd 1 ;è¨à¨­  à ¡®ç¥£® íªà ­ 
  273. WorkScreen_SizeY        rd 1 ;¢ëá®â  à ¡®ç¥£® íªà ­ 
  274. MaxWorkScreen_SizeX     rd 1
  275. MaxWorkScreen_SizeY     rd 1
  276. k                       rd 1 ;¬ áèâ ¡
  277.  
  278. ReserveArray            rd 1 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¨á¯®«ì§ã¥¬ãî ¯à¨ à¨á®¢ ­¨¨ 䨣ãà
  279.         ;¤«ï á®åà ­¥­¨ï ãç á⪮¢ ä®­  ¯®¤ 䨣ãà ¬¨,   â ª¦¥ ¤«ï § «¨¢ª¨
  280. CounterX                rd 1 ;ç¨á«® ¯¨ªá¥«¥© ¨§®¡à ¦¥­¨ï ¯® è¨à¨­¥, ª®â®àë¥ ¯®¯ ¤ îâ
  281.         ;¢ íªà ­ à ¡®ç¥© ®¡« áâ¨, á ãç¥â®¬ ⥪ã饣® ¬ áèâ ¡ 
  282. CounterY                rd 1
  283. OffsetYPicture          rd 1 ;ᤢ¨£ ¯® ®á¨ y ¢ ¡ãä¥à¥ ¨§®¡à ¦¥­¨ï ¯à¨ à¨á®¢ ­¨¨
  284.         ;á«¥¤ãî饩 «¨­¨¨ ¨§®¡à ¦¥­¨ï
  285. OffsetYWorkScreen       rd 1 ;ᤢ¨£ ¯® ®á¨ y ¢ ¡ãä¥à¥ à ¡®ç¥© ®¡« á⨠¯à¨
  286.         ;à¨á®¢ ­¨¨ á«¥¤ãî饩 «¨­¨¨ ¯¨ªá¥«¥©. —¥¬ ¡®«ìè¥ ¬ áèâ ¡, ⥬ ­¨¦¥
  287.         ;­ã¦­® ®¯ã᪠âìáï ¯® à ¡®ç¥© ®¡« áâ¨.
  288. OffsetYBigPixel         rd 1 ;ᤢ¨£ ¯® ®á¨ y ¤«ï à¨á®¢ ­¨ï ¯¨ªá¥«¥© ­  ¡®«ì讬
  289.         ;¬ áèâ ¡¥. ¨áã¥âáï 1-ï ¯®«®á  ¯¨ªá¥«ï,   ¯®â®¬ ­ã¦­® ¯¥à¥©â¨ ¢­¨§ ¨
  290.         ;¢«¥¢® ¤«ï à¨á®¢ ­¨ï á«¥¤ãî饩 ¯®«®áë.
  291.  
  292. Icon_X                  rd 1
  293. Icon_Y                  rd 1
  294. counter                 rd 1
  295. counter2                rd 1
  296. number_panel            rd 1
  297. number_menu             rd 1
  298.  
  299. Scroll1CoordinatX       rd 1 ;scroll x screen position
  300. Scroll1CoordinatY       rd 1 ;scroll y screen position
  301. Scroll1MaxSizeX         rd 1
  302. Scroll1MaxSizeY         rd 1
  303. Scroll1SizeX            rd 1 ;scroll polzunok size
  304. Scroll1FreeX            rd 1
  305.  
  306. Scroll2CoordinatX       rd 1
  307. Scroll2CoordinatY       rd 1
  308. Scroll2MaxSizeX         rd 1
  309. Scroll2MaxSizeY         rd 1
  310. Scroll2SizeY            rd 1
  311. Scroll2FreeY            rd 1
  312.  
  313. x                       rd 1
  314. y                       rd 1
  315.  
  316. Radius                  rd 1
  317. Dx_                     rd 1
  318. Dy_                     rd 1
  319. line_width              rd 1
  320. a_ellips                rd 1
  321. b_ellips                rd 1
  322.  
  323. used_OldX               rd 1 ;for draw hard contour
  324. used_OldY               rd 1
  325. rectangular_shade_x     rd 1 ;ª®®à¤¨­ â  x ®¡« á⨠¤«ï ª®¯¨à®¢ ­¨ï
  326. rectangular_shade_y     rd 1
  327. paste_img_w rd 1 ;è¨à¨­  ¢áâ ¢«ï¥¬®£® ¨§®¡à ¦¥­¨ï
  328. paste_img_h rd 1 ;¢ëá®â  ¢áâ ¢«ï¥¬®£® ¨§®¡à ¦¥­¨ï
  329. crossing_old_x          rd 1
  330. crossing_old_y          rd 1
  331. crossing                rd 1
  332. finishing_crossing      rd 1
  333. number_undo             rd 1
  334. SpriteSizeX             rd 1
  335. SpriteSizeY             rd 1
  336. SpriteCoordinatX        rd 1
  337. SpriteCoordinatY        rd 1
  338. SpriteOldCoordinatX     rd 1
  339. SpriteOldCoordinatY     rd 1
  340.  
  341. CursorsID       rd 10
  342.  
  343. Activate_instrument     rb 1
  344. save_flag               rb 1
  345. exit_from_work_arrea    rb 1
  346. lastik_is_active        rb 1
  347. instrument_used         rb 1
  348. DrawSprite_flag         rb 1
  349. Paste_flag              rb 1
  350. ;---------------------------------------------------------------------
  351. IncludeUGlobals
  352. ;---------------------------------------------------------------------
  353. align 4
  354. file_path rb 4096
  355. filename_area rb 256
  356. temp_dir_pach rb 4096
  357. library_path rb 4096
  358. cur_dir_path rb 4096
  359. procinfo: rb 1024
  360. align 4
  361. syscolors rb 192
  362. syscolors_end:
  363. ;---------------------------------------------------------------------
  364. align 4
  365.         rb 4096
  366. stacktop:
  367. ;---------------------------------------------------------------------
  368. I_END: