Subversion Repositories Kolibri OS

Rev

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