Subversion Repositories Kolibri OS

Rev

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