Subversion Repositories Kolibri OS

Rev

Rev 552 | Rev 1643 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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