Subversion Repositories Kolibri OS

Rev

Rev 6342 | Rev 6357 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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