Subversion Repositories Kolibri OS

Rev

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