Subversion Repositories Kolibri OS

Rev

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