Subversion Repositories Kolibri OS

Rev

Rev 6328 | Rev 6342 | 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.4
  5. ; last update:  12/03/2016
  6. ; changes:      Use library 'libimg.obj'
  7. ;--------------------------------------------------------
  8. ; version:      1.3
  9. ; last update:  05/10/2010
  10. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  11. ; changes:      Fixed window flicker when redrawing,
  12. ;               Fixed memory leak for stack
  13. ;--------------------------------------------------------
  14. ; version:      1.2
  15. ; last update:  30/09/2010
  16. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  17. ; changes:      Program used function 68 instead 64 is now,
  18. ;               select path with OpenDialog
  19. ;--------------------------------------------------------
  20. ; version 1.1 year 9.12.2006
  21. ; AUTORS:
  22. ; programming by andrew_programmer
  23. ; design by golus
  24.  
  25. use32
  26. org     0x0
  27.         db 'MENUET01'
  28.         dd 0x1
  29.         dd START
  30.         dd IM_END
  31.         dd I_END
  32.         dd stacktop
  33.         dd file_path    ;parameters
  34.         dd cur_dir_path
  35.  
  36. include '../../../config.inc'           ;for nightbuild
  37. include '../../../macros.inc'
  38. include '../../../proc32.inc'
  39. include '../../../KOSfuncs.inc'
  40. include '../../../develop/libraries/box_lib/load_lib.mac'
  41. include '../../../dll.inc'
  42. include '../../../libio.inc'
  43.  
  44. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  45.  
  46. COLOR_ORDER equ MENUETOS
  47. include 'bmplib.inc'
  48. include 'dialog2.inc'
  49. include 'design.inc'
  50. include 'graphlib.inc'
  51.  
  52. include 'cursors.inc'
  53.  
  54. include 'load_from_parameters.inc'
  55.  
  56. START:
  57.         mcall SF_SYS_MISC,SSF_HEAP_INIT
  58.        
  59. load_libraries l_libs_start,end_l_libs
  60.  
  61.         cmp     eax,-1
  62.         jz      close
  63. ;--------------------------------------------------------
  64. ;---------------set events mask--------------------------
  65. ;--------------------------------------------------------
  66.         mcall SF_SET_EVENTS_MASK,0x80000067 ; 1100111b
  67. ;---------------------------------------------------------
  68. ;-----------------------init data-------------------------
  69. ;---------------------------------------------------------
  70. include 'init_data.inc'
  71.  
  72. ;----------------------------------------------------------
  73. ;--------get memory and draw window of program-------------
  74. ;----------------------------------------------------------
  75.         call    GetMemory
  76.         call    cleare_work_arrea
  77.         call    load_icons
  78.  
  79. ;load cursors
  80.         mov     eax,CursorsID
  81.         call    load_cursors
  82.  
  83.         call    drawwin
  84. ;---------------------------------------------------------
  85. ;---------Check loading of file from parameters-----------
  86. ;---------------------------------------------------------
  87.         mov     eax,file_path
  88.         cmp [eax],byte 0
  89.         jz @f
  90.         call load_picture
  91.         call MovePictureToWorkScreen
  92.         mov [Scroll1CoordinatX],9
  93.         mov [Scroll2CoordinatY],89
  94. @@:
  95.  
  96. ;---------------------------------------------------------------------
  97.         mov     edi,filename_area
  98.         mov     esi,path4+5
  99.         call    copy_str_1
  100.  
  101.         mov     edi,file_path
  102.         cmp     [edi],byte 0
  103.         jne     @f
  104.         mov     esi,path4
  105.         call    copy_str_1
  106. @@:
  107. ;OpenDialog     initialisation
  108.         push    dword OpenDialog_data
  109.         call    [OpenDialog_Init]
  110. ;---------------------------------------------------------------------
  111. ;----------------------------------------------------------
  112. ;---------------------MAIN LOOP----------------------------
  113. ;----------------------------------------------------------
  114. red:
  115.         call    drawwin
  116. still:
  117.         call    event
  118.  
  119.         cmp     eax,1
  120.         je      red
  121.  
  122.         cmp     eax,2
  123.         je      keys
  124.  
  125.         cmp     eax,3
  126.         je      buttons
  127.  
  128.         cmp     eax,6
  129.         je      mouse
  130.  
  131.         jmp     still
  132.        
  133. ;---------------------------------------------------------------------
  134. copy_str_1:
  135.         xor     eax,eax
  136.         cld
  137. @@:
  138.         lodsb
  139.         stosb
  140.         test    eax,eax
  141.         jnz     @b
  142.         ret
  143. ;---------------------------------------------------------------------
  144. ;---------------------------------------------------------
  145. ;---------------------------------------------------------
  146. ;---------------------------------------------------------
  147. include 'events.inc'
  148. include 'events_of_window.inc'
  149. include 'events_of_keys.inc'
  150. include 'events_of_buttons.inc'
  151. include 'events_of_mouse.inc'
  152. include 'panel_engen.inc'
  153. include 'screen.inc'
  154. include 'menu_instruments.inc'
  155. include 'icons_instruments.inc'
  156. include 'icons.inc'
  157. include 'sprites.inc'
  158. include 'string.inc'
  159. include 'palette.inc'
  160. include 'files.inc'
  161. include 'time.inc'
  162. include 'memory.inc'
  163. ;-----------------------------------------------------------
  164. ;------------variables and data of program------------------
  165. ;-----------------------------------------------------------
  166. sound_havent_memory     db 150,64,0
  167.  
  168. include 'lib_data.inc'
  169. include 'panel_data.inc'
  170. include 'palitra256.inc'
  171. include 'brushes.inc'
  172. include 'spray.inc'
  173. include 'width_lines.inc'
  174. ;----------------------------------------------------------
  175. ;-------------------ICON"S picture-------------------------
  176. ;----------------------------------------------------------
  177.         dd      0
  178. panel_picture:
  179. file 'panel_buttons.png'
  180. .end:
  181. ;****************cursors******************
  182. brush_cursor:
  183. file 'brush.cur'
  184. ;----------------------------------------------------------
  185. flood_fill_cursor:
  186. file 'flood_fill.cur'
  187. ;----------------------------------------------------------
  188. lastik_cursor:
  189. file 'lastik.cur'
  190. ;----------------------------------------------------------
  191. other_cursor:
  192. file 'other.cur'
  193. ;----------------------------------------------------------
  194. pencil_cursor:
  195. file 'pencil.cur'
  196. ;----------------------------------------------------------
  197. pipette_cursor:
  198. file 'pipette.cur'
  199. ;----------------------------------------------------------
  200. spray_cursor:
  201. file 'spray.cur'
  202. ;----------------------------------------------------------
  203. zoom_cursor:
  204. file 'zoom.cur'
  205. ;----------------------------------------------------------
  206. IM_END:
  207. ;-----------------------------------------------------------
  208. ;------------variables and data of program------------------
  209. ;-----------------------------------------------------------
  210. time                    rd 1
  211. PosX                    rd 1
  212. PosY                    rd 1
  213. PointerToIcons          rd 1
  214. ScreenPointer           rd 1
  215. PointerToPicture        rd 1
  216. PointerToCopyPicture    rd 1
  217. PointerToCopyPicture2   rd 1
  218. PointerToEditBufer      rd 1
  219. PointerToSpriteBufer    rd 1
  220. PointerToPalette        rd 1
  221. Color                   rd 1
  222. Number_Brush            rd 1
  223. Brush_SizeX             rd 1
  224. Brush_SizeY             rd 1
  225. Current_instrument      rd 1
  226. Last_instrument         rd 1
  227. Activate_instrument     rb 1
  228. SColor                  rd 1
  229. OldX                    rd 1
  230. OldY                    rd 1
  231.  
  232. MouseX                  rd 1
  233. MouseY                  rd 1
  234. Window_SizeX            rd 1
  235. Window_SizeY            rd 1
  236. Window_CordinatX        rd 1
  237. Window_CordinatY        rd 1
  238. Picture_SizeX           rd 1
  239. Picture_SizeY           rd 1
  240. ScreenX                 rd 1
  241. ScreenY                 rd 1
  242. WorkScreen_SizeX        rd 1
  243. WorkScreen_SizeY        rd 1
  244. MaxWorkScreen_SizeX     rd 1
  245. MaxWorkScreen_SizeY     rd 1
  246. k                       rd 1
  247.  
  248. ReserveArray            rd 1
  249. register                rd 1
  250. CounterX                rd 1
  251. CounterY                rd 1
  252. OffsetYPicture          rd 1
  253. OffsetYWorkScreen       rd 1
  254. OffsetYBigPixel         rd 1
  255.  
  256. Icon_X                  rd 1
  257. Icon_Y                  rd 1
  258. counter                 rd 1
  259. counter2                rd 1
  260. Icon_text_x             rd 1
  261. Icon_text_y             rd 1
  262. Panel_flag              rb 1
  263. counter_menu            rd 1
  264. menu_coordinat_x        rd 1
  265. menu_size_x             rd 1
  266. menu_counter            rd 1
  267. counter_11              rd 1
  268. number_panel            rd 1
  269. number_menu             rd 1
  270.  
  271. Scroll1CoordinatX       rd 1
  272. Scroll1CoordinatY       rd 1
  273. Scroll1MaxSizeX         rd 1
  274. Scroll1MaxSizeY         rd 1
  275. Scroll1SizeX            rd 1
  276. Scroll1FreeX            rd 1
  277.  
  278. Scroll2CoordinatX       rd 1
  279. Scroll2CoordinatY       rd 1
  280. Scroll2MaxSizeX         rd 1
  281. Scroll2MaxSizeY         rd 1
  282. Scroll2SizeY            rd 1
  283. Scroll2FreeY            rd 1
  284.  
  285. ;extended_memory                rd 1
  286. type                    rw 1
  287. x                       rd 1
  288. y                       rd 1
  289. save_flag               rb 1
  290. exit_from_work_arrea    rb 1
  291.  
  292. Radius                  rd 1
  293. Dx_                     rd 1
  294. Dy_                     rd 1
  295. line_width              rd 1
  296. lastik_is_active        rb 1
  297. a_ellips                rd 1
  298. b_ellips                rd 1
  299. instrument_used         rb 1
  300. used_OldX               rd 1
  301. used_OldY               rd 1
  302. rectangular_shade_x     rd 1
  303. rectangular_shade_y     rd 1
  304. crossing_old_x          rd 1
  305. crossing_old_y          rd 1
  306. crossing                rd 1
  307. finishing_crossing      rd 1
  308. number_undo             rd 1
  309. DrawSprite_flag         rb 1
  310. Paste_flag              rb 1
  311. SpriteSizeX             rd 1
  312. SpriteSizeY             rd 1
  313. SpriteCoordinatX        rd 1
  314. SpriteCoordinatY        rd 1
  315. SpriteOldCoordinatX     rd 1
  316. SpriteOldCoordinatY     rd 1
  317. ;---------------------------------------------------------------------
  318. IncludeUGlobals
  319. ;---------------------------------------------------------------------
  320. align 4
  321. CursorsID       rd 10
  322. ;---------------------------------------------------------------------
  323. align 4
  324. file_path rb 4096
  325. filename_area rb 256
  326. temp_dir_pach rb 4096
  327. library_path rb 4096
  328. cur_dir_path rb 4096
  329. procinfo: rb 1024
  330. ;---------------------------------------------------------------------
  331. align 4
  332.         rb 4096
  333. stacktop:
  334. ;---------------------------------------------------------------------
  335. I_END: