Subversion Repositories Kolibri OS

Rev

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