Subversion Repositories Kolibri OS

Rev

Rev 9568 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9568 Rev 9587
1
use32
1
use32
2
	org 0
2
	org 0
3
	db 'MENUET01'
3
	db 'MENUET01'
4
	dd 1,start,i_end,mem,stacktop,file_name,sys_path
4
	dd 1,start,i_end,mem,stacktop,file_name,sys_path
5
 
5
 
6
include '../../macros.inc'
6
include '../../macros.inc'
7
include '../../proc32.inc'
7
include '../../proc32.inc'
8
include '../../KOSfuncs.inc'
8
include '../../KOSfuncs.inc'
9
include '../../load_img.inc'
9
include '../../load_img.inc'
10
include '../../load_lib.mac'
10
include '../../load_lib.mac'
11
include '../../develop/libraries/libs-dev/libimg/libimg.inc'
11
include '../../develop/libraries/libs-dev/libimg/libimg.inc'
12
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
12
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
13
include 'lang.inc'
13
include 'lang.inc'
14
include 'cnc_editor.inc'
14
include 'cnc_editor.inc'
15
include '../../develop/info3ds/info_fun_float.inc'
15
include '../../develop/info3ds/info_fun_float.inc'
16
 
16
 
17
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
17
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
18
caption db 'CNC editor 23.05.19',0 ;¯®¤¯¨áì ®ª­ 
18
caption db 'CNC editor 23.05.19',0 ;¯®¤¯¨áì ®ª­ 
19
 
19
 
20
run_file_70 FileInfoBlock
20
run_file_70 FileInfoBlock
21
 
21
 
22
offs_last_timer dd 0 ;¯®á«¥¤­¨© ᤢ¨£ ¯®ª § ­ë© ¢ ä㭪樨 â ©¬¥à 
22
offs_last_timer dd 0 ;¯®á«¥¤­¨© ᤢ¨£ ¯®ª § ­ë© ¢ ä㭪樨 â ©¬¥à 
23
 
23
 
24
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
24
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
25
image_data_toolbar dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
25
image_data_toolbar dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
26
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
26
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
27
icon_toolbar dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï ¨ª®­®ª ®¡ê¥ªâ®¢
27
icon_toolbar dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï ¨ª®­®ª ®¡ê¥ªâ®¢
28
 
28
 
29
include 'wnd_point_coords.inc'
29
include 'wnd_point_coords.inc'
30
include 'wnd_scale.inc'
30
include 'wnd_scale.inc'
31
include 'wnd_new_file.inc'
31
include 'wnd_new_file.inc'
32
 
32
 
33
align 4
33
align 4
34
start:
34
start:
35
	;--- copy cmd line ---
35
	;--- copy cmd line ---
36
	mov esi,file_name
36
	mov esi,file_name
37
	mov edi,openfile_path
37
	mov edi,openfile_path
38
@@:
38
@@:
39
	lodsd
39
	lodsd
40
	or eax,eax
40
	or eax,eax
41
	jz @f ;¢ë室, ¥á«¨ 0
41
	jz @f ;¢ë室, ¥á«¨ 0
42
	stosd
42
	stosd
43
	jmp @b
43
	jmp @b
44
@@:
44
@@:
45
	stosd
45
	stosd
46
 
46
 
47
	load_libraries l_libs_start,l_libs_end
47
	load_libraries l_libs_start,l_libs_end
48
	;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
48
	;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
49
	mov	ebp,lib_0
49
	mov	ebp,lib_0
50
	cmp	dword [ebp+ll_struc_size-4],0
50
	cmp	dword [ebp+ll_struc_size-4],0
51
	jz	@f
51
	jz	@f
52
		mcall SF_TERMINATE_PROCESS
52
		mcall SF_TERMINATE_PROCESS
53
	@@:
53
	@@:
54
	mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
54
	mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
55
	mcall SF_SET_EVENTS_MASK,0xC0000027
55
	mcall SF_SET_EVENTS_MASK,0xC0000027
56
	stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
56
	stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
57
 
57
 
58
	stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
58
	stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
59
 
59
 
60
	;èà¨äâ ¤¥« ¥¬ ¤® ᮧ¤ ­¨ï ¯ ­¥«¨ (¤«ï íª®­®¬¨¨ 㪠§ â¥«ï image_data_toolbar)
60
	;èà¨äâ ¤¥« ¥¬ ¤® ᮧ¤ ­¨ï ¯ ­¥«¨ (¤«ï íª®­®¬¨¨ 㪠§ â¥«ï image_data_toolbar)
61
	include_image_file '..\..\fs\kfar\trunk\font6x9.bmp', image_data_toolbar, buf_1.w,buf_1.h
61
	include_image_file '..\..\fs\kfar\trunk\font6x9.bmp', image_data_toolbar, buf_1.w,buf_1.h
62
	stdcall [buf2d_create_f_img], buf_1,[image_data_toolbar] ;ᮧ¤ ¥¬ ¡ãä¥à
62
	stdcall [buf2d_create_f_img], buf_1,[image_data_toolbar] ;ᮧ¤ ¥¬ ¡ãä¥à
63
	stdcall mem.Free,[image_data_toolbar] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
63
	stdcall mem.Free,[image_data_toolbar] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
64
	stdcall [buf2d_conv_24_to_8], buf_1,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8 ¡¨â
64
	stdcall [buf2d_conv_24_to_8], buf_1,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8 ¡¨â
65
	stdcall [buf2d_convert_text_matrix], buf_1
65
	stdcall [buf2d_convert_text_matrix], buf_1
66
	mov eax,[buf_1.h]
66
	mov eax,[buf_1.h]
67
	shr eax,8
67
	shr eax,8
68
	mov [font_h],eax
68
	mov [font_h],eax
69
 
69
 
70
	include_image_file 'toolbar.png', image_data_toolbar
70
	include_image_file 'toolbar.png', image_data_toolbar
71
 
71
 
72
	mov dword[w_scr_t1.type],1
72
	mov dword[w_scr_t1.type],1
73
	stdcall dword[tl_data_init], tree1
73
	stdcall dword[tl_data_init], tree1
74
	;á¨á⥬­ë¥ ¨ª®­ª¨ 16*16 ¤«ï tree_list
74
	;á¨á⥬­ë¥ ¨ª®­ª¨ 16*16 ¤«ï tree_list
75
	include_image_file 'tl_sys_16.png', icon_tl_sys
75
	include_image_file 'tl_sys_16.png', icon_tl_sys
76
	mov eax,dword[icon_tl_sys]
76
	mov eax,dword[icon_tl_sys]
77
	mov dword[tree1.data_img_sys],eax
77
	mov dword[tree1.data_img_sys],eax
78
 
78
 
79
	include_image_file 'objects.png', icon_toolbar
79
	include_image_file 'objects.png', icon_toolbar
80
	mov eax,dword[icon_toolbar]
80
	mov eax,dword[icon_toolbar]
81
	mov dword[tree1.data_img],eax
81
	mov dword[tree1.data_img],eax
82
 
82
 
83
	;*** ãáâ ­®¢ª  ¢à¥¬¥­¨ ¤«ï â ©¬¥à 
83
	;*** ãáâ ­®¢ª  ¢à¥¬¥­¨ ¤«ï â ©¬¥à 
84
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
84
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
85
	mov [last_time],eax
85
	mov [last_time],eax
86
 
86
 
87
	;open file from cmd line
87
	;open file from cmd line
88
	cmp dword[openfile_path],0
88
	cmp dword[openfile_path],0
89
	je @f
89
	je @f
90
		call but_open_file.no_dlg
90
		call but_open_file.no_dlg
91
	@@:
91
	@@:
92
 
92
 
93
align 4
93
align 4
94
red_win:
94
red_win:
95
	call draw_window
95
	call draw_window
96
 
96
 
97
align 4
97
align 4
98
still:
98
still:
99
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
99
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
100
	mov ebx,[last_time]
100
	mov ebx,[last_time]
101
	add ebx,10 ;§ ¤¥à¦ª 
101
	add ebx,10 ;§ ¤¥à¦ª 
102
	cmp ebx,eax
102
	cmp ebx,eax
103
	jge @f
103
	jge @f
104
		mov ebx,eax
104
		mov ebx,eax
105
	@@:
105
	@@:
106
	sub ebx,eax
106
	sub ebx,eax
107
	mcall SF_WAIT_EVENT_TIMEOUT
107
	mcall SF_WAIT_EVENT_TIMEOUT
108
	cmp eax,0
108
	cmp eax,0
109
	jne @f
109
	jne @f
110
		call timer_funct
110
		call timer_funct
111
		jmp still
111
		jmp still
112
	@@:
112
	@@:
113
 
113
 
114
	cmp al,1
114
	cmp al,1
115
	jz red_win
115
	jz red_win
116
	cmp al,2
116
	cmp al,2
117
	jz key
117
	jz key
118
	cmp al,3
118
	cmp al,3
119
	jz button
119
	jz button
120
	cmp al,6
120
	cmp al,6
121
	jne @f
121
	jne @f
122
		mcall SF_THREAD_INFO,procinfo,-1
122
		mcall SF_THREAD_INFO,procinfo,-1
123
		cmp ax,word[procinfo.window_stack_position]
123
		cmp ax,word[procinfo.window_stack_position]
124
		jne @f ;®ª­® ­¥  ªâ¨¢­®
124
		jne @f ;®ª­® ­¥  ªâ¨¢­®
125
		call mouse
125
		call mouse
126
	@@:
126
	@@:
127
	jmp still
127
	jmp still
128
 
128
 
129
align 4
129
align 4
130
mouse:
130
mouse:
131
	push eax ebx ecx
131
	push eax ebx ecx
132
	mcall SF_MOUSE_GET,SSF_BUTTON_EXT
132
	mcall SF_MOUSE_GET,SSF_BUTTON_EXT
133
	bt eax,8
133
	bt eax,8
134
	jnc @f
134
	jnc @f
135
		;mouse l. but. press
135
		;mouse l. but. press
136
		call mouse_left_d
136
		call mouse_left_d
137
		jmp .end_l
137
		jmp .end_l
138
	@@:
138
	@@:
139
	;bt eax,0
139
	;bt eax,0
140
	;jnc @f
140
	;jnc @f
141
		;mouse l. but. move
141
		;mouse l. but. move
142
		;call mouse_left_m
142
		;call mouse_left_m
143
		;jmp .end_l
143
		;jmp .end_l
144
	;@@:
144
	;@@:
145
	bt eax,16
145
	bt eax,16
146
	jnc .end_l
146
	jnc .end_l
147
		;mouse l. but. up
147
		;mouse l. but. up
148
		call mouse_left_u
148
		call mouse_left_u
149
		;jmp .end_l
149
		;jmp .end_l
150
	.end_l:
150
	.end_l:
151
	bt eax,9
151
	bt eax,9
152
	jnc @f
152
	jnc @f
153
		;mouse r. but. press
153
		;mouse r. but. press
154
		call mouse_right_d
154
		call mouse_right_d
155
		;jmp .end_r
155
		;jmp .end_r
156
	@@:
156
	@@:
157
	;bt eax,1
157
	;bt eax,1
158
	;jnc @f
158
	;jnc @f
159
		;mouse r. but. move
159
		;mouse r. but. move
160
		;call mouse_right_m
160
		;call mouse_right_m
161
		;jmp .end_r
161
		;jmp .end_r
162
	;@@:
162
	;@@:
163
	;.end_r:
163
	;.end_r:
164
 
164
 
165
	call buf_get_mouse_coord
165
	call buf_get_mouse_coord
166
	cmp eax,-1
166
	cmp eax,-1
167
	je .end0
167
	je .end0
168
		shl eax,1
168
		shl eax,1
169
		sub eax,[buf_0.w]
169
		sub eax,[buf_0.w]
170
		sar eax,1
170
		sar eax,1
171
		mov [mouse_prop_x],eax
171
		mov [mouse_prop_x],eax
172
		stdcall [tl_node_get_data],tree1
172
		stdcall [tl_node_get_data],tree1
173
		or eax,eax
173
		or eax,eax
174
		jz .end0
174
		jz .end0
175
		cmp [eax+Figure.OType],'Fig'
175
		cmp [eax+Figure.OType],'Fig'
176
		je @f
176
		je @f
177
		cmp [eax+Figure.OType],'Obj'
177
		cmp [eax+Figure.OType],'Obj'
178
		je .end1
178
		je .end1
179
			jmp .end0
179
			jmp .end0
180
		.end1:
180
		.end1:
181
			mov eax,ObjData
181
			mov eax,ObjData
182
		@@:
182
		@@:
183
		mov ecx,eax
183
		mov ecx,eax
184
		shl ebx,1
184
		shl ebx,1
185
		sub ebx,[buf_0.h]
185
		sub ebx,[buf_0.h]
186
		sar ebx,1
186
		sar ebx,1
187
		mov [mouse_prop_y],ebx
187
		mov [mouse_prop_y],ebx
188
 
188
 
189
		mcall SF_MOUSE_GET,SSF_SCROLL_DATA
189
		mcall SF_MOUSE_GET,SSF_SCROLL_DATA
190
		test ax,ax
190
		test ax,ax
191
		jz .end0
191
		jz .end0
192
		finit
192
		finit
193
		fld qword[zoom_plus]
193
		fld qword[zoom_plus]
194
		fld1
194
		fld1
195
		fsubp
195
		fsubp
196
		fld st0 ;for Y coord
196
		fld st0 ;for Y coord
197
 
197
 
198
		;for X coord
198
		;for X coord
199
		fild dword[mouse_prop_x]
199
		fild dword[mouse_prop_x]
200
		fmulp st1,st0
200
		fmulp st1,st0
201
 
201
 
202
		mov ebx,eax
202
		mov ebx,eax
203
		test ax,0x8000
203
		test ax,0x8000
204
		jnz .decr
204
		jnz .decr
205
			;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
205
			;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
206
			fchs
206
			fchs
207
			fild dword[ecx+Figure.MCentrX] ;add old value
207
			fild dword[ecx+Figure.MCentrX] ;add old value
208
			fmul qword[zoom_plus]
208
			fmul qword[zoom_plus]
209
			faddp
209
			faddp
210
 
210
 
211
			fld qword[ecx+Figure.MScale]
211
			fld qword[ecx+Figure.MScale]
212
			fmul qword[zoom_plus]
212
			fmul qword[zoom_plus]
213
			;if (Figure.MScale>16.0)
213
			;if (Figure.MScale>16.0)
214
			;...
214
			;...
215
			jmp @f
215
			jmp @f
216
		.decr:
216
		.decr:
217
			;㬥­ì襭¨¥ ¬ áèâ ¡ 
217
			;㬥­ì襭¨¥ ¬ áèâ ¡ 
218
			fild dword[ecx+Figure.MCentrX] ;add old value
218
			fild dword[ecx+Figure.MCentrX] ;add old value
219
			fdiv qword[zoom_plus]
219
			fdiv qword[zoom_plus]
220
			faddp
220
			faddp
221
 
221
 
222
			fld qword[ecx+Figure.MScale]
222
			fld qword[ecx+Figure.MScale]
223
			fdiv qword[zoom_plus]
223
			fdiv qword[zoom_plus]
224
			fld1
224
			fld1
225
			fcomp
225
			fcomp
226
			fstsw ax
226
			fstsw ax
227
			sahf
227
			sahf
228
			jbe @f
228
			jbe @f
229
				;if (Figure.MScale<1.0)
229
				;if (Figure.MScale<1.0)
230
				ffree st0
230
				ffree st0
231
				fincstp
231
				fincstp
232
				ffree st0
232
				ffree st0
233
				fincstp
233
				fincstp
234
				fldz ;default Figure.MCentrX
234
				fldz ;default Figure.MCentrX
235
				fld1 ;default Figure.MScale
235
				fld1 ;default Figure.MScale
236
				mov dword[ecx+Figure.MCentrY],0
236
				mov dword[ecx+Figure.MCentrY],0
237
		@@:
237
		@@:
238
		fstp qword[ecx+Figure.MScale]
238
		fstp qword[ecx+Figure.MScale]
239
		fistp dword[ecx+Figure.MCentrX]
239
		fistp dword[ecx+Figure.MCentrX]
240
 
240
 
241
		;for Y coord
241
		;for Y coord
242
		fild dword[mouse_prop_y]
242
		fild dword[mouse_prop_y]
243
		fmulp st1,st0
243
		fmulp st1,st0
244
		test bx,0x8000
244
		test bx,0x8000
245
		jnz .decr_y
245
		jnz .decr_y
246
			;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
246
			;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
247
			fild dword[ecx+Figure.MCentrY] ;add old value
247
			fild dword[ecx+Figure.MCentrY] ;add old value
248
			fmul qword[zoom_plus]
248
			fmul qword[zoom_plus]
249
			faddp
249
			faddp
250
			jmp @f
250
			jmp @f
251
		.decr_y:
251
		.decr_y:
252
			;㬥­ì襭¨¥ ¬ áèâ ¡ 
252
			;㬥­ì襭¨¥ ¬ áèâ ¡ 
253
			fchs
253
			fchs
254
			fild dword[ecx+Figure.MCentrY] ;add old value
254
			fild dword[ecx+Figure.MCentrY] ;add old value
255
			fdiv qword[zoom_plus]
255
			fdiv qword[zoom_plus]
256
			faddp
256
			faddp
257
		@@:
257
		@@:
258
		fistp dword[ecx+Figure.MCentrY]
258
		fistp dword[ecx+Figure.MCentrY]
259
 
259
 
260
		mov dword[offs_last_timer],0
260
		mov dword[offs_last_timer],0
261
	.end0:
261
	.end0:
262
 
262
 
263
	stdcall [tl_mouse], tree1
263
	stdcall [tl_mouse], tree1
264
	pop ecx ebx eax
264
	pop ecx ebx eax
265
	ret
265
	ret
266
 
266
 
267
;output:
267
;output:
268
; eax - buffer coord X (¥á«¨ ªãàá®à §  ¡ãä¥à®¬ -1)
268
; eax - buffer coord X (¥á«¨ ªãàá®à §  ¡ãä¥à®¬ -1)
269
; ebx - buffer coord Y (¥á«¨ ªãàá®à §  ¡ãä¥à®¬ -1)
269
; ebx - buffer coord Y (¥á«¨ ªãàá®à §  ¡ãä¥à®¬ -1)
270
align 4
270
align 4
271
proc buf_get_mouse_coord
271
proc buf_get_mouse_coord
272
	mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
272
	mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
273
	cmp ax,word[buf_0.t]
273
	cmp ax,word[buf_0.t]
274
	jl .no_buf ;­¥ ¯®¯ «¨ ¢ ®ª­® ¡ãä¥à  ¯® ®á¨ y
274
	jl .no_buf ;­¥ ¯®¯ «¨ ¢ ®ª­® ¡ãä¥à  ¯® ®á¨ y
275
	mov ebx,eax
275
	mov ebx,eax
276
	shr ebx,16
276
	shr ebx,16
277
	cmp bx,word[buf_0.l]
277
	cmp bx,word[buf_0.l]
278
	jl .no_buf ;­¥ ¯®¯ «¨ ¢ ®ª­® ¡ãä¥à  ¯® ®á¨ x
278
	jl .no_buf ;­¥ ¯®¯ «¨ ¢ ®ª­® ¡ãä¥à  ¯® ®á¨ x
279
 
279
 
280
	and eax,0xffff ;®áâ ¢«ï¥¬ ª®®à¤¨­ âã y
280
	and eax,0xffff ;®áâ ¢«ï¥¬ ª®®à¤¨­ âã y
281
	sub ax,word[buf_0.t]
281
	sub ax,word[buf_0.t]
282
	cmp eax,[buf_0.h]
282
	cmp eax,[buf_0.h]
283
	jg .no_buf
283
	jg .no_buf
284
	sub bx,word[buf_0.l]
284
	sub bx,word[buf_0.l]
285
	cmp ebx,[buf_0.w]
285
	cmp ebx,[buf_0.w]
286
	jg .no_buf
286
	jg .no_buf
287
	xchg eax,ebx
287
	xchg eax,ebx
288
	jmp .end_f
288
	jmp .end_f
289
	.no_buf:
289
	.no_buf:
290
		xor eax,eax
290
		xor eax,eax
291
		not eax
291
		not eax
292
		xor ebx,ebx
292
		xor ebx,ebx
293
		not ebx
293
		not ebx
294
	.end_f:
294
	.end_f:
295
	ret
295
	ret
296
endp
296
endp
297
 
297
 
298
align 4
298
align 4
299
proc timer_funct
299
proc timer_funct
300
	pushad
300
	pushad
301
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
301
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
302
	mov [last_time],eax
302
	mov [last_time],eax
303
 
303
 
304
	;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥­­ë© ¡«®ª ¤ ­­ëå
304
	;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥­­ë© ¡«®ª ¤ ­­ëå
305
	stdcall [tl_node_get_data],tree1
305
	stdcall [tl_node_get_data],tree1
306
	or eax,eax
306
	or eax,eax
307
	jz .end_f
307
	jz .end_f
308
	cmp dword[offs_last_timer],eax
308
	cmp dword[offs_last_timer],eax
309
	je .end_f
309
	je .end_f
310
		;¥á«¨ ¢ë¤¥«¥­­ë© ¡«®ª ¤ ­­ëå ­¥ ᮢ¯ ¤ ¥â á ¯®á«¥¤­¨¬ § ¯®¬­¥­­ë¬
310
		;¥á«¨ ¢ë¤¥«¥­­ë© ¡«®ª ¤ ­­ëå ­¥ ᮢ¯ ¤ ¥â á ¯®á«¥¤­¨¬ § ¯®¬­¥­­ë¬
311
		mov dword[offs_last_timer],eax
311
		mov dword[offs_last_timer],eax
312
 
312
 
313
		stdcall get_object_data,eax
313
		stdcall get_object_data,eax
314
		or ecx,ecx
314
		or ecx,ecx
315
		jz .end_oblo
315
		jz .end_oblo
316
			stdcall draw_obj2d,ecx
316
			stdcall draw_obj2d,ecx
317
			stdcall [buf2d_draw], buf_0
317
			stdcall [buf2d_draw], buf_0
318
			jmp .end_f
318
			jmp .end_f
319
		.end_oblo:
319
		.end_oblo:
320
 
320
 
321
		cmp [eax+Figure.OType],'Fig'
321
		cmp [eax+Figure.OType],'Fig'
322
		jne .end_fblo
322
		jne .end_fblo
323
			stdcall draw_fig2d,eax
323
			stdcall draw_fig2d,eax
324
			stdcall [buf2d_draw], buf_0
324
			stdcall [buf2d_draw], buf_0
325
			jmp .end_f
325
			jmp .end_f
326
		.end_fblo:
326
		.end_fblo:
327
 
327
 
328
	.end_f:
328
	.end_f:
329
 
329
 
330
	popad
330
	popad
331
	ret
331
	ret
332
endp
332
endp
333
 
333
 
334
align 4
334
align 4
335
draw_window:
335
draw_window:
336
pushad
336
pushad
337
	mcall SF_REDRAW,SSF_BEGIN_DRAW
337
	mcall SF_REDRAW,SSF_BEGIN_DRAW
338
 
338
 
339
	; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
339
	; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
340
	mov edx,[sc.work]
340
	mov edx,[sc.work]
341
	or  edx,0x33000000
341
	or  edx,0x33000000
342
	mov edi,caption
342
	mov edi,caption
343
	mcall SF_CREATE_WINDOW,(20 shl 16)+599,(20 shl 16)+415
343
	mcall SF_CREATE_WINDOW,(20 shl 16)+599,(20 shl 16)+415
344
 
344
 
345
	mcall SF_THREAD_INFO,procinfo,-1
345
	mcall SF_THREAD_INFO,procinfo,-1
346
	mov eax,dword[procinfo.box.height]
346
	mov eax,dword[procinfo.box.height]
347
	cmp eax,120
347
	cmp eax,120
348
	jge @f
348
	jge @f
349
		mov eax,120 ;min size
349
		mov eax,120 ;min size
350
	@@:
350
	@@:
351
	sub eax,65
351
	sub eax,65
352
	mov dword[tree1.box_height],eax
352
	mov dword[tree1.box_height],eax
353
	mov word[w_scr_t1.y_size],ax ;­®¢ë¥ à §¬¥àë áªà®««¨­£ 
353
	mov word[w_scr_t1.y_size],ax ;­®¢ë¥ à §¬¥àë áªà®««¨­£ 
354
	mov ebx,dword[procinfo.box.width]
354
	mov ebx,dword[procinfo.box.width]
355
	cmp ebx,270
355
	cmp ebx,270
356
	jge @f
356
	jge @f
357
		mov ebx,270
357
		mov ebx,270
358
	@@:
358
	@@:
359
	sub ebx,215
359
	sub ebx,215
360
	cmp eax,dword[buf_0.h] ;ᬮâਬ à §¬¥à ¡ãä¥à 
360
	cmp eax,dword[buf_0.h] ;ᬮâਬ à §¬¥à ¡ãä¥à 
361
	jne @f
361
	jne @f
362
	cmp ebx,dword[buf_0.w]
362
	cmp ebx,dword[buf_0.w]
363
	jne @f
363
	jne @f
364
		jmp .end0
364
		jmp .end0
365
	@@:
365
	@@:
366
		stdcall [buf2d_resize],buf_0,ebx,eax,1
366
		stdcall [buf2d_resize],buf_0,ebx,eax,1
367
		mov eax,ObjData
367
		mov eax,ObjData
368
		mov ecx,[eax+Object.FigCount]
368
		mov ecx,[eax+Object.FigCount]
369
		or ecx,ecx
369
		or ecx,ecx
370
		jz .end0
370
		jz .end0
371
		mov eax,[eax+Object.FigData]
371
		mov eax,[eax+Object.FigData]
372
		xor edx,edx
372
		xor edx,edx
373
		.cycle0:
373
		.cycle0:
374
			stdcall FigCalculateSizes,[eax+4*edx],0
374
			stdcall FigCalculateSizes,[eax+4*edx],0
375
			inc edx
375
			inc edx
376
			loop .cycle0
376
			loop .cycle0
377
		stdcall ObjCalculateScale,ObjData
377
		stdcall ObjCalculateScale,ObjData
378
		mov dword[offs_last_timer],0
378
		mov dword[offs_last_timer],0
379
		call timer_funct
379
		call timer_funct
380
	.end0:
380
	.end0:
381
 
381
 
382
	; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
382
	; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
383
	mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3, [sc.work_button]
383
	mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3, [sc.work_button]
384
 
384
 
385
	add ebx,25 shl 16
385
	add ebx,25 shl 16
386
	mcall ,,,4 ;open
386
	mcall ,,,4 ;open
387
	add ebx,25 shl 16
387
	add ebx,25 shl 16
388
	mcall ,,,5 ;save
388
	mcall ,,,5 ;save
389
 
389
 
390
	add ebx,30 shl 16
390
	add ebx,30 shl 16
391
	mcall ,,,6 ;captions on off
391
	mcall ,,,6 ;captions on off
392
 
392
 
393
	add ebx,25 shl 16
393
	add ebx,25 shl 16
394
	mcall ,,,7 ;figure move up
394
	mcall ,,,7 ;figure move up
395
	add ebx,25 shl 16
395
	add ebx,25 shl 16
396
	mcall ,,,8 ;figure move down
396
	mcall ,,,8 ;figure move down
397
 
397
 
398
	add ebx,25 shl 16
398
	add ebx,25 shl 16
399
	mcall ,,,9 ;sel points dlg
399
	mcall ,,,9 ;sel points dlg
400
 
400
 
401
	add ebx,25 shl 16
401
	add ebx,25 shl 16
402
	mcall ,,,10 ;sel points move up
402
	mcall ,,,10 ;sel points move up
403
	add ebx,25 shl 16
403
	add ebx,25 shl 16
404
	mcall ,,,11 ;sel points move down
404
	mcall ,,,11 ;sel points move down
405
 
405
 
406
	add ebx,25 shl 16
406
	add ebx,25 shl 16
407
	mcall ,,,12 ;align sel points left
407
	mcall ,,,12 ;align sel points left
408
	add ebx,25 shl 16
408
	add ebx,25 shl 16
409
	mcall ,,,13 ;align sel points right
409
	mcall ,,,13 ;align sel points right
410
	add ebx,25 shl 16
410
	add ebx,25 shl 16
411
	mcall ,,,14 ;align sel points top
411
	mcall ,,,14 ;align sel points top
412
	add ebx,25 shl 16
412
	add ebx,25 shl 16
413
	mcall ,,,15 ;align sel points bottom
413
	mcall ,,,15 ;align sel points bottom
414
	add ebx,25 shl 16
414
	add ebx,25 shl 16
415
	mcall ,,,16 ;optimize figure
415
	mcall ,,,16 ;optimize figure
416
 
416
 
417
	add ebx,30 shl 16
417
	add ebx,30 shl 16
418
	mcall ,,,17 ;copy to clipboard
418
	mcall ,,,17 ;copy to clipboard
419
	add ebx,25 shl 16
419
	add ebx,25 shl 16
420
	mcall ,,,18 ;paste from clipboard
420
	mcall ,,,18 ;paste from clipboard
421
 
421
 
422
	add ebx,25 shl 16
422
	add ebx,25 shl 16
423
	mcall ,,,19 ;sel points del
423
	mcall ,,,19 ;sel points del
424
 
424
 
425
	add ebx,30 shl 16
425
	add ebx,30 shl 16
426
	mcall ,,,20 ;restore zoom
426
	mcall ,,,20 ;restore zoom
427
 
427
 
428
	add ebx,30 shl 16
428
	add ebx,30 shl 16
429
	mcall ,,,21 ;.png
429
	mcall ,,,21 ;.png
430
 
430
 
431
	add ebx,25 shl 16
431
	add ebx,25 shl 16
432
	mcall ,,,22 ;options scale
432
	mcall ,,,22 ;options scale
433
 
433
 
434
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
434
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
435
	mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16,(7 shl 16)+7 ;icon new
435
	mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16,(7 shl 16)+7 ;icon new
436
 
436
 
437
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
437
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
438
	add edx,(25 shl 16) ;icon open
438
	add edx,(25 shl 16) ;icon open
439
	int 0x40
439
	int 0x40
440
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
440
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
441
	add edx,(25 shl 16) ;icon save
441
	add edx,(25 shl 16) ;icon save
442
	int 0x40
442
	int 0x40
443
 
443
 
444
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
444
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
445
	add edx,(30 shl 16) ;captions on off
445
	add edx,(30 shl 16) ;captions on off
446
	int 0x40
446
	int 0x40
447
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
447
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
448
	add edx,(25 shl 16) ;figure move up
448
	add edx,(25 shl 16) ;figure move up
449
	int 0x40
449
	int 0x40
450
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
450
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
451
	add edx,(25 shl 16) ;figure move down
451
	add edx,(25 shl 16) ;figure move down
452
	int 0x40
452
	int 0x40
453
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
453
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
454
	add edx,(25 shl 16) ;sel points dlg
454
	add edx,(25 shl 16) ;sel points dlg
455
	int 0x40
455
	int 0x40
456
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
456
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
457
	add edx,(25 shl 16) ;sel points move up
457
	add edx,(25 shl 16) ;sel points move up
458
	int 0x40
458
	int 0x40
459
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
459
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
460
	add edx,(25 shl 16) ;sel points move down
460
	add edx,(25 shl 16) ;sel points move down
461
	int 0x40
461
	int 0x40
462
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
462
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
463
	add edx,(25 shl 16) ;aling sel points left
463
	add edx,(25 shl 16) ;aling sel points left
464
	int 0x40
464
	int 0x40
465
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
465
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
466
	add edx,(25 shl 16) ;aling sel points right
466
	add edx,(25 shl 16) ;aling sel points right
467
	int 0x40
467
	int 0x40
468
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
468
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
469
	add edx,(25 shl 16) ;aling sel points top
469
	add edx,(25 shl 16) ;aling sel points top
470
	int 0x40
470
	int 0x40
471
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
471
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
472
	add edx,(25 shl 16) ;aling sel points bottom
472
	add edx,(25 shl 16) ;aling sel points bottom
473
	int 0x40
473
	int 0x40
474
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
474
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
475
	add edx,(25 shl 16) ;optimize figure
475
	add edx,(25 shl 16) ;optimize figure
476
	int 0x40
476
	int 0x40
477
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
477
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
478
	add edx,(30 shl 16) ;copy to clipboard
478
	add edx,(30 shl 16) ;copy to clipboard
479
	int 0x40
479
	int 0x40
480
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
480
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
481
	add edx,(25 shl 16) ;paste from clipboard
481
	add edx,(25 shl 16) ;paste from clipboard
482
	int 0x40
482
	int 0x40
483
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
483
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
484
	add edx,(25 shl 16) ;sel points del
484
	add edx,(25 shl 16) ;sel points del
485
	int 0x40
485
	int 0x40
486
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
486
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
487
	add edx,(30 shl 16) ;restore zoom
487
	add edx,(30 shl 16) ;restore zoom
488
	int 0x40
488
	int 0x40
489
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
489
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
490
	add edx,(30 shl 16) ;.png
490
	add edx,(30 shl 16) ;.png
491
	int 0x40
491
	int 0x40
492
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
492
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
493
	add edx,(25 shl 16) ;options scale
493
	add edx,(25 shl 16) ;options scale
494
	int 0x40
494
	int 0x40
495
 
495
 
496
	mov dword[w_scr_t1.all_redraw],1
496
	mov dword[w_scr_t1.all_redraw],1
497
	stdcall [tl_draw], tree1
497
	stdcall [tl_draw], tree1
498
	stdcall [buf2d_draw], buf_0
498
	stdcall [buf2d_draw], buf_0
499
 
499
 
500
	mcall SF_REDRAW,SSF_END_DRAW
500
	mcall SF_REDRAW,SSF_END_DRAW
501
popad
501
popad
502
	ret
502
	ret
503
 
503
 
504
align 4
504
align 4
505
key:
505
key:
506
	mcall SF_GET_KEY
506
	mcall SF_GET_KEY
507
	cmp dword[el_focus], tree1
507
	cmp dword[el_focus], tree1
508
	jne @f
508
	jne @f
509
		stdcall [tl_key], tree1
509
		stdcall [tl_key], tree1
510
		jmp .end0
510
		jmp .end0
511
	@@:
511
	@@:
512
	
512
	
513
	cmp ah,178 ;Up
513
	cmp ah,178 ;Up
514
	jne @f
514
	jne @f
515
		call but_selection_move_up
515
		call but_selection_move_up
516
		jmp .end0
516
		jmp .end0
517
	@@:
517
	@@:
518
	cmp ah,177 ;Down
518
	cmp ah,177 ;Down
519
	jne @f
519
	jne @f
520
		call but_selection_move_down
520
		call but_selection_move_down
521
		jmp .end0
521
		jmp .end0
522
	@@:
522
	@@:
523
	cmp ah,176 ;Left
523
	cmp ah,176 ;Left
524
	jne @f
524
	jne @f
525
		call but_selection_move_up
525
		call but_selection_move_up
526
		jmp .end0
526
		jmp .end0
527
	@@:
527
	@@:
528
	cmp ah,179 ;Right
528
	cmp ah,179 ;Right
529
	jne @f
529
	jne @f
530
		call but_selection_move_down
530
		call but_selection_move_down
531
		jmp .end0
531
		jmp .end0
532
	@@:
532
	@@:
533
	cmp ah,182 ;Delete
533
	cmp ah,182 ;Delete
534
	jne @f
534
	jne @f
535
		call but_sel_points_del
535
		call but_sel_points_del
536
		jmp .end0
536
		jmp .end0
537
	@@:
537
	@@:
538
 
538
 
539
	mov ecx,eax
539
	mov ecx,eax
540
	mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS
540
	mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS
541
	bt eax,2 ;left Ctrl
541
	bt eax,2 ;left Ctrl
542
	jc .key_Ctrl
542
	jc .key_Ctrl
543
	bt eax,3 ;right Ctrl
543
	bt eax,3 ;right Ctrl
544
	jc .key_Ctrl
544
	jc .key_Ctrl
545
	jmp .end0
545
	jmp .end0
546
	.key_Ctrl:
546
	.key_Ctrl:
547
		cmp ch,15 ;111 ;Ctrl+O
547
		cmp ch,15 ;111 ;Ctrl+O
548
		jne @f
548
		jne @f
549
			call but_open_file
549
			call but_open_file
550
		@@:
550
		@@:
551
		cmp ch,19 ;115 ;Ctrl+S
551
		cmp ch,19 ;115 ;Ctrl+S
552
		jne @f
552
		jne @f
553
			call but_save_file
553
			call but_save_file
554
		@@:
554
		@@:
555
		cmp ch,14 ;110 ;Ctrl+N
555
		cmp ch,14 ;110 ;Ctrl+N
556
		jne @f
556
		jne @f
557
			call but_new_file
557
			call but_new_file
558
		@@:
558
		@@:
559
		cmp ch,1 ;97 ;Ctrl+A
559
		cmp ch,1 ;97 ;Ctrl+A
560
		jne @f
560
		jne @f
561
			call but_sel_points_all
561
			call but_sel_points_all
562
		@@:
562
		@@:
563
	.end0:
563
	.end0:
564
	jmp still
564
	jmp still
565
 
565
 
566
 
566
 
567
align 4
567
align 4
568
button:
568
button:
569
	mcall SF_GET_BUTTON
569
	mcall SF_GET_BUTTON
570
	cmp ah,3
570
	cmp ah,3
571
	jne @f
571
	jne @f
572
		call but_new_file
572
		call but_new_file
573
		jmp still
573
		jmp still
574
	@@:
574
	@@:
575
	cmp ah,4
575
	cmp ah,4
576
	jne @f
576
	jne @f
577
		call but_open_file
577
		call but_open_file
578
		jmp still
578
		jmp still
579
	@@:
579
	@@:
580
	cmp ah,5
580
	cmp ah,5
581
	jne @f
581
	jne @f
582
		call but_save_file
582
		call but_save_file
583
		jmp still
583
		jmp still
584
	@@:
584
	@@:
585
	cmp ah,6
585
	cmp ah,6
586
	jne @f
586
	jne @f
587
		call but_captions_on_off
587
		call but_captions_on_off
588
		jmp still
588
		jmp still
589
	@@:
589
	@@:
590
	cmp ah,7
590
	cmp ah,7
591
	jne @f
591
	jne @f
592
		call but_sel_figure_move_up
592
		call but_sel_figure_move_up
593
		jmp still
593
		jmp still
594
	@@:
594
	@@:
595
	cmp ah,8
595
	cmp ah,8
596
	jne @f
596
	jne @f
597
		call but_sel_figure_move_down
597
		call but_sel_figure_move_down
598
		jmp still
598
		jmp still
599
	@@:
599
	@@:
600
	cmp ah,9
600
	cmp ah,9
601
	jne @f
601
	jne @f
602
		call but_dlg_point_coords
602
		call but_dlg_point_coords
603
		jmp still
603
		jmp still
604
	@@:
604
	@@:
605
	cmp ah,10
605
	cmp ah,10
606
	jne @f
606
	jne @f
607
		call but_sel_points_move_up
607
		call but_sel_points_move_up
608
		jmp still
608
		jmp still
609
	@@:
609
	@@:
610
	cmp ah,11
610
	cmp ah,11
611
	jne @f
611
	jne @f
612
		call but_sel_points_move_down
612
		call but_sel_points_move_down
613
		jmp still
613
		jmp still
614
	@@:
614
	@@:
615
	cmp ah,12
615
	cmp ah,12
616
	jne @f
616
	jne @f
617
		call but_sel_points_align_coord_xmin
617
		call but_sel_points_align_coord_xmin
618
		jmp still
618
		jmp still
619
	@@:
619
	@@:
620
	cmp ah,13
620
	cmp ah,13
621
	jne @f
621
	jne @f
622
		call but_sel_points_align_coord_xmax
622
		call but_sel_points_align_coord_xmax
623
		jmp still
623
		jmp still
624
	@@:
624
	@@:
625
	cmp ah,14
625
	cmp ah,14
626
	jne @f
626
	jne @f
627
		call but_sel_points_align_coord_ymax
627
		call but_sel_points_align_coord_ymax
628
		jmp still
628
		jmp still
629
	@@:
629
	@@:
630
	cmp ah,15
630
	cmp ah,15
631
	jne @f
631
	jne @f
632
		call but_sel_points_align_coord_ymin
632
		call but_sel_points_align_coord_ymin
633
	@@:
633
	@@:
634
	cmp ah,16
634
	cmp ah,16
635
	jne @f
635
	jne @f
636
		call but_points_optimize
636
		call but_points_optimize
637
		jmp still
637
		jmp still
638
	@@:
638
	@@:
639
	cmp ah,17
639
	cmp ah,17
640
	jne @f
640
	jne @f
641
		call but_clipboard_copy_points
641
		call but_clipboard_copy_points
642
		jmp still
642
		jmp still
643
	@@:
643
	@@:
644
	cmp ah,18
644
	cmp ah,18
645
	jne @f
645
	jne @f
646
		call but_clipboard_paste_points
646
		call but_clipboard_paste_points
647
		jmp still
647
		jmp still
648
	@@:
648
	@@:
649
	cmp ah,19
649
	cmp ah,19
650
	jne @f
650
	jne @f
651
		call but_sel_points_del
651
		call but_sel_points_del
652
		jmp still
652
		jmp still
653
	@@:
653
	@@:
654
	cmp ah,20
654
	cmp ah,20
655
	jne @f
655
	jne @f
656
		call but_restore_zoom
656
		call but_restore_zoom
657
		jmp still
657
		jmp still
658
	@@:
658
	@@:
659
	cmp ah,21
659
	cmp ah,21
660
	jne @f
660
	jne @f
661
		call but_save_png
661
		call but_save_png
662
		jmp still
662
		jmp still
663
	@@:
663
	@@:
664
	cmp ah,22
664
	cmp ah,22
665
	jne @f
665
	jne @f
666
		call but_dlg_opt_scale
666
		call but_dlg_opt_scale
667
		jmp still
667
		jmp still
668
	@@:
668
	@@:
669
 
669
 
670
	;cmp ah,23
670
	;cmp ah,23
671
	;jne @f
671
	;jne @f
672
		;call but_...
672
		;call but_...
673
		;jmp still
673
		;jmp still
674
	;@@:
674
	;@@:
675
	cmp ah,1
675
	cmp ah,1
676
	jne still
676
	jne still
677
.exit:
677
.exit:
678
	stdcall [buf2d_delete],buf_0
678
	stdcall [buf2d_delete],buf_0
679
	stdcall mem.Free,[image_data_toolbar]
679
	stdcall mem.Free,[image_data_toolbar]
680
	stdcall mem.Free,[open_file_data]
680
	stdcall mem.Free,[open_file_data]
681
	mcall SF_TERMINATE_PROCESS
681
	mcall SF_TERMINATE_PROCESS
682
 
682
 
683
 
683
 
684
align 4
684
align 4
685
but_new_file:
685
but_new_file:
686
	cmp byte[wnd_n_file],0
686
	cmp byte[wnd_n_file],0
687
	jne .end_f
687
	jne .end_f
688
pushad
688
pushad
689
	mcall SF_CREATE_THREAD,1,start_n_file,thread_n_file
689
	mcall SF_CREATE_THREAD,1,start_n_file,thread_n_file
690
popad
690
popad
691
	.end_f:
691
	.end_f:
692
	ret
692
	ret
693
 
693
 
694
align 4
694
align 4
695
open_file_data dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢
695
open_file_data dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢
696
open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©« 
696
open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©« 
697
 
697
 
698
align 4
698
align 4
699
but_open_file:
699
but_open_file:
700
	copy_path open_dialog_name,communication_area_default_path,file_name,0
700
	copy_path open_dialog_name,communication_area_default_path,file_name,0
701
	pushad
701
	pushad
702
	mov [OpenDialog_data.type],0
702
	mov [OpenDialog_data.type],0
703
	stdcall [OpenDialog_Start],OpenDialog_data
703
	stdcall [OpenDialog_Start],OpenDialog_data
704
	cmp [OpenDialog_data.status],2
704
	cmp [OpenDialog_data.status],2
705
	je .end_open_file
705
	je .end_open_file
706
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
706
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
707
	jmp .end0
707
	jmp .end0
708
.no_dlg: ;¥á«¨ ¬¨­ã¥¬ ¤¨ «®£ ®âªàëâ¨ï ä ©« 
708
.no_dlg: ;¥á«¨ ¬¨­ã¥¬ ¤¨ «®£ ®âªàëâ¨ï ä ©« 
709
		pushad
709
		pushad
710
		mov esi,openfile_path
710
		mov esi,openfile_path
711
		stdcall str_len,esi
711
		stdcall str_len,esi
712
		add esi,eax
712
		add esi,eax
713
		@@: ;横« ¤«ï ¯®¨áª  ­ ç «  ¨¬¥­¨ ä ©« 
713
		@@: ;横« ¤«ï ¯®¨áª  ­ ç «  ¨¬¥­¨ ä ©« 
714
			dec esi
714
			dec esi
715
			cmp byte[esi],'/'
715
			cmp byte[esi],'/'
716
			je @f
716
			je @f
717
			cmp byte[esi],0x5c ;'\'
717
			cmp byte[esi],0x5c ;'\'
718
			je @f
718
			je @f
719
			cmp esi,openfile_path
719
			cmp esi,openfile_path
720
			jg @b
720
			jg @b
721
		@@:
721
		@@:
722
		inc esi
722
		inc esi
723
		stdcall [OpenDialog_Set_file_name],OpenDialog_data,esi ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¤¨ «®£ á®åà ­¥­¨ï
723
		stdcall [OpenDialog_Set_file_name],OpenDialog_data,esi ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¤¨ «®£ á®åà ­¥­¨ï
724
	.end0:
724
	.end0:
725
 
725
 
726
	mov [run_file_70.Function], SSF_GET_INFO
726
	mov [run_file_70.Function], SSF_GET_INFO
727
	mov [run_file_70.Position], 0
727
	mov [run_file_70.Position], 0
728
	mov [run_file_70.Flags], 0
728
	mov [run_file_70.Flags], 0
729
	mov dword[run_file_70.Count], 0
729
	mov dword[run_file_70.Count], 0
730
	mov dword[run_file_70.Buffer], open_b
730
	mov dword[run_file_70.Buffer], open_b
731
	mov byte[run_file_70+20], 0
731
	mov byte[run_file_70+20], 0
732
	mov dword[run_file_70.FileName], openfile_path
732
	mov dword[run_file_70.FileName], openfile_path
733
	mcall SF_FILE,run_file_70
733
	mcall SF_FILE,run_file_70
734
 
734
 
735
	mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©«  ¢ ¡ ©â å
735
	mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©«  ¢ ¡ ©â å
736
	inc ecx ;for text files
736
	inc ecx ;for text files
737
	stdcall mem.ReAlloc,[open_file_data],ecx
737
	stdcall mem.ReAlloc,[open_file_data],ecx
738
	mov [open_file_data],eax
738
	mov [open_file_data],eax
739
	dec ecx ;for text files
739
	dec ecx ;for text files
740
	mov byte[eax+ecx],0 ;for text files
740
	mov byte[eax+ecx],0 ;for text files
741
 
741
 
742
	mov [run_file_70.Function], SSF_READ_FILE
742
	mov [run_file_70.Function], SSF_READ_FILE
743
	mov [run_file_70.Position], 0
743
	mov [run_file_70.Position], 0
744
	mov [run_file_70.Flags], 0
744
	mov [run_file_70.Flags], 0
745
	mov dword[run_file_70.Count], ecx
745
	mov dword[run_file_70.Count], ecx
746
	m2m dword[run_file_70.Buffer], dword[open_file_data]
746
	m2m dword[run_file_70.Buffer], dword[open_file_data]
747
	mov byte[run_file_70+20], 0
747
	mov byte[run_file_70+20], 0
748
	mov dword[run_file_70.FileName], openfile_path
748
	mov dword[run_file_70.FileName], openfile_path
749
	mcall SF_FILE,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
749
	mcall SF_FILE,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
750
	test eax,eax
750
	test eax,eax
751
	jnz .end_open_file
751
	jnz .end_open_file
752
	cmp ebx,0xffffffff
752
	cmp ebx,0xffffffff
753
	je .end_open_file
753
	je .end_open_file
754
 
754
 
755
		mov [open_file_size],ebx
755
		mov [open_file_size],ebx
756
		mcall SF_SET_CAPTION,1,openfile_path
756
		mcall SF_SET_CAPTION,1,openfile_path
757
 
757
 
758
		;---
758
		;---
759
		and dword[tree1.style],not tl_cursor_pos_limited
759
		and dword[tree1.style],not tl_cursor_pos_limited
760
		stdcall FileInit,[open_file_data],[open_file_size]
760
		stdcall FileInit,[open_file_data],[open_file_size]
761
		or dword[tree1.style], tl_cursor_pos_limited
761
		or dword[tree1.style], tl_cursor_pos_limited
762
		stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
762
		stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
763
		stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
763
		stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
764
	.end_open_file:
764
	.end_open_file:
765
	popad
765
	popad
766
	ret
766
	ret
767
 
767
 
768
align 4
768
align 4
769
proc but_save_file
769
proc but_save_file
770
locals
770
locals
771
	pCou dd ?
771
	pCou dd ?
772
	pData dd ?
772
	pData dd ?
773
endl
773
endl
774
	pushad
774
	pushad
775
	copy_path open_dialog_name,communication_area_default_path,file_name,0
775
	copy_path open_dialog_name,communication_area_default_path,file_name,0
776
	mov [OpenDialog_data.type],1
776
	mov [OpenDialog_data.type],1
777
	stdcall [OpenDialog_Set_file_ext],OpenDialog_data,Filter.1 ;.nc
777
	stdcall [OpenDialog_Set_file_ext],OpenDialog_data,Filter.1 ;.nc
778
	stdcall [OpenDialog_Start],OpenDialog_data
778
	stdcall [OpenDialog_Start],OpenDialog_data
779
	cmp [OpenDialog_data.status],2
779
	cmp [OpenDialog_data.status],2
780
	je .end_save_file
780
	je .end_save_file
781
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
781
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
782
 
782
 
783
	;*** ®¯à¥¤¥«¥­¨¥ ¯à¨¬¥à­®£® à §¬¥à  ä ©« 
783
	;*** ®¯à¥¤¥«¥­¨¥ ¯à¨¬¥à­®£® à §¬¥à  ä ©« 
784
	call get_file_save_size
784
	call get_file_save_size
785
	stdcall mem.ReAlloc,[open_file_data],ecx
785
	stdcall mem.ReAlloc,[open_file_data],ecx
786
	mov [open_file_data],eax
786
	mov [open_file_data],eax
787
	mov [open_file_size],ecx
787
	mov [open_file_size],ecx
788
 
788
 
789
	;clear memory
789
	;clear memory
790
	mov edi,eax
790
	mov edi,eax
791
	xor eax,eax
791
	xor eax,eax
792
	shr ecx,2
792
	shr ecx,2
793
	rep stosd
793
	rep stosd
794
	
794
	
795
	;*** ¯¨è¥¬ ¨­ä®à¬ æ¨î ¢ ¯ ¬ïâì
795
	;*** ¯¨è¥¬ ¨­ä®à¬ æ¨î ¢ ¯ ¬ïâì
796
	mov edi,[open_file_data]
796
	mov edi,[open_file_data]
797
	mov ebx,ObjData
797
	mov ebx,ObjData
798
	mov edx,[ebx+Object.FigCount]
798
	mov edx,[ebx+Object.FigCount]
799
	or edx,edx
799
	or edx,edx
800
	jz .cycle1end
800
	jz .cycle1end
801
	mov esi,[ebx+Object.FigData]
801
	mov esi,[ebx+Object.FigData]
802
align 4
802
align 4
803
	.cycle1: ;横« ¯® 䨣ãà ¬
803
	.cycle1: ;横« ¯® 䨣ãà ¬
804
		;param 1
804
		;param 1
805
		mov eax,[esi]
805
		mov eax,[esi]
806
		or eax,eax
806
		or eax,eax
807
		jz .err_save
807
		jz .err_save
808
		mov eax,[eax+Figure.PoiCount]
808
		mov eax,[eax+Figure.PoiCount]
809
		mov [pCou],eax
809
		mov [pCou],eax
810
		or eax,eax
810
		or eax,eax
811
		jnz @f
811
		jnz @f
812
			mov eax,[esi]
812
			mov eax,[esi]
813
			lea eax,[eax+Figure.Caption]
813
			lea eax,[eax+Figure.Caption]
814
			stdcall str_cat,edi,eax
814
			stdcall str_cat,edi,eax
815
			stdcall str_len,edi
815
			stdcall str_len,edi
816
			add edi,eax
816
			add edi,eax
817
			stdcall str_cat,edi,txt_nl
817
			stdcall str_cat,edi,txt_nl
818
		@@:
818
		@@:
819
		cmp dword[pCou],0
819
		cmp dword[pCou],0
820
		je .cycle2end
820
		je .cycle2end
821
		mov eax,[esi]
821
		mov eax,[esi]
822
		mov eax,[eax+Figure.PoiData]
822
		mov eax,[eax+Figure.PoiData]
823
		mov [pData],eax
823
		mov [pData],eax
824
		mov word[NumberSymbolsAD],8
824
		mov word[NumberSymbolsAD],8
825
align 4
825
align 4
826
		.cycle2: ;横« ¯® â®çª ¬
826
		.cycle2: ;横« ¯® â®çª ¬
827
			stdcall str_cat,edi,txt_s_poi
827
			stdcall str_cat,edi,txt_s_poi
828
			;param 1
828
			;param 1
829
			push edi esi
829
			push edi esi
830
			mov esi,[pData]
830
			mov esi,[pData]
831
			lea esi,[esi+Point.CoordX]
831
			lea esi,[esi+Point.CoordX]
832
			mov edi,Data_Double
832
			mov edi,Data_Double
833
			movsd
833
			movsd
834
			movsd
834
			movsd
835
			pop esi edi
835
			pop esi edi
836
			call DoubleFloat_to_String
836
			call DoubleFloat_to_String
837
			call String_crop_0
837
			call String_crop_0
838
			stdcall str_cat,edi,Data_String
838
			stdcall str_cat,edi,Data_String
839
			stdcall str_cat,edi,txt_s_poi_Y
839
			stdcall str_cat,edi,txt_s_poi_Y
840
			;param 2
840
			;param 2
841
			push edi esi
841
			push edi esi
842
			mov esi,[pData]
842
			mov esi,[pData]
843
			lea esi,[esi+Point.CoordY]
843
			lea esi,[esi+Point.CoordY]
844
			mov edi,Data_Double
844
			mov edi,Data_Double
845
			movsd
845
			movsd
846
			movsd
846
			movsd
847
			pop esi edi
847
			pop esi edi
848
			call DoubleFloat_to_String
848
			call DoubleFloat_to_String
849
			call String_crop_0
849
			call String_crop_0
850
			stdcall str_cat,edi,Data_String
850
			stdcall str_cat,edi,Data_String
851
			;
851
			;
852
			stdcall str_cat,edi,txt_nl
852
			stdcall str_cat,edi,txt_nl
853
			add dword[pData],sizeof.Point
853
			add dword[pData],sizeof.Point
854
			dec dword[pCou]
854
			dec dword[pCou]
855
			jnz .cycle2
855
			jnz .cycle2
856
		.cycle2end:
856
		.cycle2end:
857
		add esi,4
857
		add esi,4
858
		dec edx
858
		dec edx
859
		jnz .cycle1
859
		jnz .cycle1
860
	.cycle1end:
860
	.cycle1end:
861
	
861
	
862
	jmp @f
862
	jmp @f
863
	.err_save:
863
	.err_save:
864
		notify_window_run txt_err_save_txt_file_1
864
		notify_window_run txt_err_save_txt_file_1
865
	@@:
865
	@@:
866
 
866
 
867
	;*** ®¯à¥¤¥«¥­¨¥ ¯ à ¬¥â஢ ä ©« 
867
	;*** ®¯à¥¤¥«¥­¨¥ ¯ à ¬¥â஢ ä ©« 
868
	mov edi,[open_file_data]
868
	mov edi,[open_file_data]
869
	stdcall str_len,edi
869
	stdcall str_len,edi
870
	;;cmp eax,[open_file_size]
870
	;;cmp eax,[open_file_size]
871
	mov [run_file_70.Count],eax ;à §¬¥à ä ©« 
871
	mov [run_file_70.Count],eax ;à §¬¥à ä ©« 
872
 
872
 
873
	;*** á®å࠭塞 ä ©«
873
	;*** á®å࠭塞 ä ©«
874
	mov [run_file_70.Function], SSF_CREATE_FILE
874
	mov [run_file_70.Function], SSF_CREATE_FILE
875
	mov [run_file_70.Position], 0
875
	mov [run_file_70.Position], 0
876
	mov [run_file_70.Flags], 0
876
	mov [run_file_70.Flags], 0
877
	mov ebx, dword[open_file_data]
877
	mov ebx, dword[open_file_data]
878
	mov [run_file_70.Buffer], ebx
878
	mov [run_file_70.Buffer], ebx
879
	mov byte[run_file_70+20], 0
879
	mov byte[run_file_70+20], 0
880
	mov dword[run_file_70.FileName], openfile_path
880
	mov dword[run_file_70.FileName], openfile_path
881
	mcall SF_FILE,run_file_70
881
	mcall SF_FILE,run_file_70
882
	or eax,eax
882
	or eax,eax
883
	jz .end_save_file
883
	jz .end_save_file
884
	or ebx,ebx
884
	or ebx,ebx
885
	jnz .end_save_file
885
	jnz .end_save_file
886
		;á®®¡é¥­¨¥ ® ­¥ã¤ ç­®¬ á®åà ­¥­¨¨
886
		;á®®¡é¥­¨¥ ® ­¥ã¤ ç­®¬ á®åà ­¥­¨¨
887
		notify_window_run txt_err_save_txt_file_0
887
		notify_window_run txt_err_save_txt_file_0
888
	.end_save_file:
888
	.end_save_file:
889
	popad
889
	popad
890
	ret
890
	ret
891
endp
891
endp
892
 
892
 
893
;output:
893
;output:
894
; ecx - memory size for save file
894
; ecx - memory size for save file
895
align 4
895
align 4
896
proc get_file_save_size uses eax ebx edx esi
896
proc get_file_save_size uses eax ebx edx esi
897
	mov ecx,100 ;title
897
	mov ecx,100 ;title
898
	mov ebx,ObjData
898
	mov ebx,ObjData
899
	add ecx,50 ;object
899
	add ecx,50 ;object
900
	mov edx,[ebx+Object.FigCount]
900
	mov edx,[ebx+Object.FigCount]
901
	or edx,edx
901
	or edx,edx
902
	jz .cycle1end
902
	jz .cycle1end
903
	mov esi,[ebx+Object.FigData]
903
	mov esi,[ebx+Object.FigData]
904
align 4
904
align 4
905
	.cycle1: ; 横« ¯® 䨣ãà ¬
905
	.cycle1: ; 横« ¯® 䨣ãà ¬
906
		add ecx,80 ;figure
906
		add ecx,80 ;figure
907
		mov eax,[esi]
907
		mov eax,[esi]
908
		or eax,eax
908
		or eax,eax
909
		jz @f
909
		jz @f
910
			mov eax,[eax+Figure.PoiCount]
910
			mov eax,[eax+Figure.PoiCount]
911
			imul eax,70
911
			imul eax,70
912
			add ecx,eax ;points
912
			add ecx,eax ;points
913
		@@:
913
		@@:
914
		add esi,4
914
		add esi,4
915
		dec edx
915
		dec edx
916
		jnz .cycle1
916
		jnz .cycle1
917
	.cycle1end:
917
	.cycle1end:
918
	ret
918
	ret
919
endp
919
endp
920
 
920
 
921
align 4
921
align 4
922
but_captions_on_off:
922
but_captions_on_off:
923
	xor dword[opt_draw],1
923
	xor dword[opt_draw],1
924
	mov dword[offs_last_timer],0 ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
924
	mov dword[offs_last_timer],0 ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
925
	ret
925
	ret
926
 
926
 
927
align 4
927
align 4
928
but_sel_figure_move_up:
928
but_sel_figure_move_up:
929
	pushad
929
	pushad
930
	stdcall [tl_node_get_data],tree1
930
	stdcall [tl_node_get_data],tree1
931
	or eax,eax
931
	or eax,eax
932
	jz .end_fblo
932
	jz .end_fblo
933
	cmp [eax+Figure.OType],'Fig'
933
	cmp [eax+Figure.OType],'Fig'
934
	jne .end_fblo
934
	jne .end_fblo
935
		stdcall found_parent_obj,eax
935
		stdcall found_parent_obj,eax
936
		or eax,eax
936
		or eax,eax
937
		jz .end_f ;if not found
937
		jz .end_f ;if not found
938
		or ecx,ecx
938
		or ecx,ecx
939
		jz .fig_is_0 ;¥á«¨ 䨣ãà  ¢ ­ ç «¥ ᯨ᪠
939
		jz .fig_is_0 ;¥á«¨ 䨣ãà  ¢ ­ ç «¥ ᯨ᪠
940
		mov ebx,[eax+Object.FigData]
940
		mov ebx,[eax+Object.FigData]
941
		mov edx,[ebx+4*ecx] ;¯¥à¥¤¢¨£ ¥¬ ï 䨣ãà 
941
		mov edx,[ebx+4*ecx] ;¯¥à¥¤¢¨£ ¥¬ ï 䨣ãà 
942
		mov edi,[ebx+4*ecx-4]
942
		mov edi,[ebx+4*ecx-4]
943
		;¬¥­ï¥¬ 䨣ãàë ¬¥áâ ¬¨
943
		;¬¥­ï¥¬ 䨣ãàë ¬¥áâ ¬¨
944
		mov [ebx+4*ecx],edi
944
		mov [ebx+4*ecx],edi
945
		mov [ebx+4*ecx-4],edx
945
		mov [ebx+4*ecx-4],edx
946
		;¬¥­ï¥¬ 䨣ãàë ¢ ᯨ᪥
946
		;¬¥­ï¥¬ 䨣ãàë ¢ ᯨ᪥
947
		stdcall [tl_node_move_up],tree1
947
		stdcall [tl_node_move_up],tree1
948
		jmp .end_f
948
		jmp .end_f
949
	.fig_is_0:
949
	.fig_is_0:
950
		notify_window_run txt_err_figure_is_0
950
		notify_window_run txt_err_figure_is_0
951
		jmp .end_f
951
		jmp .end_f
952
	.end_fblo:
952
	.end_fblo:
953
		notify_window_run txt_err_no_figure_select
953
		notify_window_run txt_err_no_figure_select
954
	.end_f:
954
	.end_f:
955
	popad
955
	popad
956
	ret
956
	ret
957
 
957
 
958
align 4
958
align 4
959
but_save_png:
959
but_save_png:
960
	pushad
960
	pushad
961
	stdcall [tl_node_get_data],tree1
961
	stdcall [tl_node_get_data],tree1
962
	or eax,eax
962
	or eax,eax
963
	jz .end_save_file
963
	jz .end_save_file
964
 
964
 
965
	stdcall get_object_data,eax
965
	stdcall get_object_data,eax
966
	or ecx,ecx
966
	or ecx,ecx
967
	jz .end_oblo
967
	jz .end_oblo
968
		stdcall draw_obj2d_png,ecx
968
		stdcall draw_obj2d_png,ecx
969
		jmp .beg0
969
		jmp .beg0
970
	.end_oblo:
970
	.end_oblo:
971
 
971
 
972
;       cmp [eax+Figure.OType],'Fig'
972
;       cmp [eax+Figure.OType],'Fig'
973
;       jne .end_fblo
973
;       jne .end_fblo
974
;               stdcall draw_fig2d_png,eax
974
;               stdcall draw_fig2d_png,eax
975
;               jmp .beg0
975
;               jmp .beg0
976
;       .end_fblo:
976
;       .end_fblo:
977
 
977
 
978
	jmp .end_save_file
978
	jmp .end_save_file
979
	.beg0:
979
	.beg0:
980
	copy_path open_dialog_name,communication_area_default_path,file_name,0
980
	copy_path open_dialog_name,communication_area_default_path,file_name,0
981
	mov [OpenDialog_data.type],1
981
	mov [OpenDialog_data.type],1
982
	stdcall [OpenDialog_Set_file_ext],OpenDialog_data,Filter.2 ;.png
982
	stdcall [OpenDialog_Set_file_ext],OpenDialog_data,Filter.2 ;.png
983
	stdcall [OpenDialog_Start],OpenDialog_data
983
	stdcall [OpenDialog_Start],OpenDialog_data
984
	cmp [OpenDialog_data.status],1
984
	cmp [OpenDialog_data.status],1
985
	jne .end_save_file
985
	jne .end_save_file
986
		;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
986
		;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
987
		mov dword[png_data],0
987
		mov dword[png_data],0
988
 
988
 
989
		;create image struct
989
		;create image struct
990
		stdcall [img_create], [buf_png.w], [buf_png.h], Image.bpp24
990
		stdcall [img_create], [buf_png.w], [buf_png.h], Image.bpp24
991
		mov ebx,eax
991
		mov ebx,eax
992
		test eax,eax
992
		test eax,eax
993
		jz @f
993
		jz @f
994
			;copy foto to image buffer
994
			;copy foto to image buffer
995
			mov edi,[eax+Image.Data]
995
			mov edi,[eax+Image.Data]
996
			mov esi,[buf_png]
996
			mov esi,[buf_png]
997
			mov ecx,[buf_png.w]
997
			mov ecx,[buf_png.w]
998
			mov edx,[buf_png.h]
998
			mov edx,[buf_png.h]
999
			imul ecx,edx
999
			imul ecx,edx
1000
			imul ecx,3
1000
			imul ecx,3
1001
			shr ecx,2 ;OpenGL buffer align to 4
1001
			shr ecx,2 ;OpenGL buffer align to 4
1002
			rep movsd
1002
			rep movsd
1003
 
1003
 
1004
			;encode image
1004
			;encode image
1005
			stdcall [img_encode], eax, LIBIMG_FORMAT_PNG, 0
1005
			stdcall [img_encode], eax, LIBIMG_FORMAT_PNG, 0
1006
			test eax,eax
1006
			test eax,eax
1007
			jz @f
1007
			jz @f
1008
				mov [png_data],eax
1008
				mov [png_data],eax
1009
				mov [png_size],ecx
1009
				mov [png_size],ecx
1010
		@@:
1010
		@@:
1011
		stdcall [img_destroy],ebx
1011
		stdcall [img_destroy],ebx
1012
 
1012
 
1013
	; § ¯®«­ï¥¬ áâàãªâãàã ¤«ï á®åà ­¥­¨ï ä ©« 
1013
	; § ¯®«­ï¥¬ áâàãªâãàã ¤«ï á®åà ­¥­¨ï ä ©« 
1014
	mov ebx,run_file_70
1014
	mov ebx,run_file_70
1015
	mov dword[ebx],SSF_CREATE_FILE
1015
	mov dword[ebx],SSF_CREATE_FILE
1016
	mov eax,[png_size]
1016
	mov eax,[png_size]
1017
	mov [ebx+12],eax ;file size
1017
	mov [ebx+12],eax ;file size
1018
	mov eax,[png_data]
1018
	mov eax,[png_data]
1019
	mov [ebx+16],eax
1019
	mov [ebx+16],eax
1020
	mov dword[ebx+FileInfoBlock.FileName], openfile_path
1020
	mov dword[ebx+FileInfoBlock.FileName], openfile_path
1021
 
1021
 
1022
	mcall SF_FILE,run_file_70
1022
	mcall SF_FILE,run_file_70
1023
	test eax,eax
1023
	test eax,eax
1024
	jnz .save_error
1024
	jnz .save_error
1025
			;notify_window_run openfile_path
1025
			;notify_window_run openfile_path
1026
			jmp @f
1026
			jmp @f
1027
		.save_error:
1027
		.save_error:
1028
			;á®®¡é¥­¨¥ ® ­¥ã¤ ç­®¬ á®åà ­¥­¨¨
1028
			;á®®¡é¥­¨¥ ® ­¥ã¤ ç­®¬ á®åà ­¥­¨¨
1029
			notify_window_run txt_err_save_img_file
1029
			notify_window_run txt_err_save_img_file
1030
		@@:
1030
		@@:
1031
		mcall SF_SYS_MISC, SSF_MEM_FREE, [png_data]
1031
		mcall SF_SYS_MISC, SSF_MEM_FREE, [png_data]
1032
	.end_save_file:
1032
	.end_save_file:
1033
	popad
1033
	popad
1034
	ret
1034
	ret
1035
 
1035
 
1036
;description:
1036
;description:
1037
; ¢ë¤¥«¥­­ë¥ â®çª¨ ᤢ¨£ îâáï ¢¢¥àå
1037
; ¢ë¤¥«¥­­ë¥ â®çª¨ ᤢ¨£ îâáï ¢¢¥àå
1038
align 4
1038
align 4
1039
proc but_sel_points_move_up
1039
proc but_sel_points_move_up
1040
locals
1040
locals
1041
	pObj dd ?
1041
	pObj dd ?
1042
	pFig dd ?
1042
	pFig dd ?
1043
	idFig dd ?
1043
	idFig dd ?
1044
endl
1044
endl
1045
	pushad
1045
	pushad
1046
	stdcall [tl_node_get_data],tree1
1046
	stdcall [tl_node_get_data],tree1
1047
	or eax,eax
1047
	or eax,eax
1048
	jz .no_point
1048
	jz .no_point
1049
	cmp [eax+Figure.OType],'Fig'
1049
	cmp [eax+Figure.OType],'Fig'
1050
	jne .no_point
1050
	jne .no_point
1051
 
1051
 
1052
	mov [pFig],eax
1052
	mov [pFig],eax
1053
	stdcall sel_points_get_count,eax
1053
	stdcall sel_points_get_count,eax
1054
	or eax,eax
1054
	or eax,eax
1055
	jz .no_point
1055
	jz .no_point
1056
 
1056
 
1057
	stdcall found_parent_obj,[pFig]
1057
	stdcall found_parent_obj,[pFig]
1058
	or eax,eax
1058
	or eax,eax
1059
	jz .end_f ;if not found
1059
	jz .end_f ;if not found
1060
	mov [pObj],eax
1060
	mov [pObj],eax
1061
	mov [idFig],ecx
1061
	mov [idFig],ecx
1062
 
1062
 
1063
	;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
1063
	;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
1064
	mov eax,[pFig]
1064
	mov eax,[pFig]
1065
	mov ecx,[eax+Figure.PoiCount]
1065
	mov ecx,[eax+Figure.PoiCount]
1066
	or ecx,ecx
1066
	or ecx,ecx
1067
	jz .no_point
1067
	jz .no_point
1068
	mov ebx,[eax+Figure.PoiData]
1068
	mov ebx,[eax+Figure.PoiData]
1069
	xor eax,eax
1069
	xor eax,eax
1070
	.cycle0:
1070
	.cycle0:
1071
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1071
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1072
		jnc @f
1072
		jnc @f
1073
			or eax,eax
1073
			or eax,eax
1074
			jz .point_is_0
1074
			jz .point_is_0
1075
			stdcall point_move_up, [pObj],[pFig],[idFig],ebx;,eax
1075
			stdcall point_move_up, [pObj],[pFig],[idFig],ebx;,eax
1076
		@@:
1076
		@@:
1077
		inc eax
1077
		inc eax
1078
		add ebx,sizeof.Point
1078
		add ebx,sizeof.Point
1079
		loop .cycle0
1079
		loop .cycle0
1080
 
1080
 
1081
		;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1081
		;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1082
		mov dword[offs_last_timer],0
1082
		mov dword[offs_last_timer],0
1083
		jmp .end_f
1083
		jmp .end_f
1084
	.point_is_0:
1084
	.point_is_0:
1085
		notify_window_run txt_err_poi_is_0
1085
		notify_window_run txt_err_poi_is_0
1086
		jmp .end_f
1086
		jmp .end_f
1087
	.no_point:
1087
	.no_point:
1088
		notify_window_run txt_err_no_point_sel
1088
		notify_window_run txt_err_no_point_sel
1089
	.end_f:
1089
	.end_f:
1090
	popad
1090
	popad
1091
	ret
1091
	ret
1092
endp
1092
endp
1093
 
1093
 
1094
;description:
1094
;description:
1095
; ¢ë¤¥«¥­­ë¥ â®çª¨ ᤢ¨£ îâáï ¢­¨§
1095
; ¢ë¤¥«¥­­ë¥ â®çª¨ ᤢ¨£ îâáï ¢­¨§
1096
align 4
1096
align 4
1097
proc but_sel_points_move_down
1097
proc but_sel_points_move_down
1098
locals
1098
locals
1099
	pObj dd ?
1099
	pObj dd ?
1100
	pFig dd ?
1100
	pFig dd ?
1101
	idFig dd ?
1101
	idFig dd ?
1102
endl
1102
endl
1103
	pushad
1103
	pushad
1104
	stdcall [tl_node_get_data],tree1
1104
	stdcall [tl_node_get_data],tree1
1105
	or eax,eax
1105
	or eax,eax
1106
	jz .no_point
1106
	jz .no_point
1107
	cmp [eax+Figure.OType],'Fig'
1107
	cmp [eax+Figure.OType],'Fig'
1108
	jne .no_point
1108
	jne .no_point
1109
 
1109
 
1110
	mov [pFig],eax
1110
	mov [pFig],eax
1111
	stdcall sel_points_get_count,eax
1111
	stdcall sel_points_get_count,eax
1112
	or eax,eax
1112
	or eax,eax
1113
	jz .no_point
1113
	jz .no_point
1114
 
1114
 
1115
	stdcall found_parent_obj,[pFig]
1115
	stdcall found_parent_obj,[pFig]
1116
	or eax,eax
1116
	or eax,eax
1117
	jz .end_f ;if not found
1117
	jz .end_f ;if not found
1118
	mov [pObj],eax
1118
	mov [pObj],eax
1119
	mov [idFig],ecx
1119
	mov [idFig],ecx
1120
 
1120
 
1121
	;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
1121
	;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
1122
	mov eax,[pFig]
1122
	mov eax,[pFig]
1123
	mov ecx,[eax+Figure.PoiCount]
1123
	mov ecx,[eax+Figure.PoiCount]
1124
	or ecx,ecx
1124
	or ecx,ecx
1125
	jz .no_point
1125
	jz .no_point
1126
	mov ebx,ecx
1126
	mov ebx,ecx
1127
	dec ebx
1127
	dec ebx
1128
	imul ebx,sizeof.Point
1128
	imul ebx,sizeof.Point
1129
	add ebx,[eax+Figure.PoiData]
1129
	add ebx,[eax+Figure.PoiData]
1130
	.cycle0:
1130
	.cycle0:
1131
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1131
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1132
		jnc @f
1132
		jnc @f
1133
			cmp ecx,[eax+Figure.PoiCount]
1133
			cmp ecx,[eax+Figure.PoiCount]
1134
			je .point_is_last
1134
			je .point_is_last
1135
			mov edi,ebx
1135
			mov edi,ebx
1136
			add edi,sizeof.Point
1136
			add edi,sizeof.Point
1137
			stdcall point_move_up, [pObj],[pFig],[idFig],edi;,ecx
1137
			stdcall point_move_up, [pObj],[pFig],[idFig],edi;,ecx
1138
		@@:
1138
		@@:
1139
		sub ebx,sizeof.Point
1139
		sub ebx,sizeof.Point
1140
		loop .cycle0
1140
		loop .cycle0
1141
 
1141
 
1142
		;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1142
		;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1143
		mov dword[offs_last_timer],0
1143
		mov dword[offs_last_timer],0
1144
		jmp .end_f
1144
		jmp .end_f
1145
	.point_is_last:
1145
	.point_is_last:
1146
		notify_window_run txt_err_poi_is_last
1146
		notify_window_run txt_err_poi_is_last
1147
		jmp .end_f
1147
		jmp .end_f
1148
	.no_point:
1148
	.no_point:
1149
		notify_window_run txt_err_no_point_sel
1149
		notify_window_run txt_err_no_point_sel
1150
	.end_f:
1150
	.end_f:
1151
	popad
1151
	popad
1152
	ret
1152
	ret
1153
endp
1153
endp
1154
 
1154
 
1155
;description:
1155
;description:
1156
; ¢ë¤¥«¥­¨¥ ¢ë¡à ­­®© â®çª¨ ᤢ¨£ ¥âáï ¢¢¥àå
1156
; ¢ë¤¥«¥­¨¥ ¢ë¡à ­­®© â®çª¨ ᤢ¨£ ¥âáï ¢¢¥àå
1157
align 4
1157
align 4
1158
proc but_selection_move_up
1158
proc but_selection_move_up
1159
locals
1159
locals
1160
	pFig dd ?
1160
	pFig dd ?
1161
endl
1161
endl
1162
	pushad
1162
	pushad
1163
	stdcall [tl_node_get_data],tree1
1163
	stdcall [tl_node_get_data],tree1
1164
	or eax,eax
1164
	or eax,eax
1165
	jz .end_fblo
1165
	jz .end_fblo
1166
	cmp [eax+Figure.OType],'Fig'
1166
	cmp [eax+Figure.OType],'Fig'
1167
	jne .end_fblo
1167
	jne .end_fblo
1168
 
1168
 
1169
	mov [pFig],eax
1169
	mov [pFig],eax
1170
	stdcall sel_points_get_count,eax
1170
	stdcall sel_points_get_count,eax
1171
	cmp eax,1
1171
	cmp eax,1
1172
	jne .no_point
1172
	jne .no_point
1173
 
1173
 
1174
	;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
1174
	;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
1175
	mov eax,[pFig]
1175
	mov eax,[pFig]
1176
	mov ecx,[eax+Figure.PoiCount]
1176
	mov ecx,[eax+Figure.PoiCount]
1177
	or ecx,ecx
1177
	or ecx,ecx
1178
	jz .no_point
1178
	jz .no_point
1179
	dec ecx
1179
	dec ecx
1180
	jecxz .end_f
1180
	jecxz .end_f
1181
	mov ebx,[eax+Figure.PoiData]
1181
	mov ebx,[eax+Figure.PoiData]
1182
	.cycle0:
1182
	.cycle0:
1183
		add ebx,sizeof.Point
1183
		add ebx,sizeof.Point
1184
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1184
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1185
		jnc @f
1185
		jnc @f
1186
			btr dword[ebx+Point.Prop],PROP_BIT_SELECT
1186
			btr dword[ebx+Point.Prop],PROP_BIT_SELECT
1187
			bts dword[ebx+Point.Prop-sizeof.Point],PROP_BIT_SELECT
1187
			bts dword[ebx+Point.Prop-sizeof.Point],PROP_BIT_SELECT
1188
			xor ecx,ecx
1188
			xor ecx,ecx
1189
			inc ecx ;ecx = 1 - for exit from cycle
1189
			inc ecx ;ecx = 1 - for exit from cycle
1190
		@@:
1190
		@@:
1191
		loop .cycle0
1191
		loop .cycle0
1192
 
1192
 
1193
		;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1193
		;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1194
		mov dword[offs_last_timer],0
1194
		mov dword[offs_last_timer],0
1195
		jmp .end_f
1195
		jmp .end_f
1196
	.no_point:
1196
	.no_point:
1197
		notify_window_run txt_err_no_point_sel_1
1197
		notify_window_run txt_err_no_point_sel_1
1198
		jmp .end_f
1198
		jmp .end_f
1199
	.end_fblo:
1199
	.end_fblo:
1200
		;notify_window_run txt_err_no_figure_select
1200
		;notify_window_run txt_err_no_figure_select
1201
	.end_f:
1201
	.end_f:
1202
	popad
1202
	popad
1203
	ret
1203
	ret
1204
endp
1204
endp
1205
 
1205
 
1206
;description:
1206
;description:
1207
; ¢ë¤¥«¥­¨¥ ¢ë¡à ­­®© â®çª¨ ᤢ¨£ ¥âáï ¢­¨§
1207
; ¢ë¤¥«¥­¨¥ ¢ë¡à ­­®© â®çª¨ ᤢ¨£ ¥âáï ¢­¨§
1208
align 4
1208
align 4
1209
proc but_selection_move_down
1209
proc but_selection_move_down
1210
locals
1210
locals
1211
	pFig dd ?
1211
	pFig dd ?
1212
endl
1212
endl
1213
	pushad
1213
	pushad
1214
	stdcall [tl_node_get_data],tree1
1214
	stdcall [tl_node_get_data],tree1
1215
	or eax,eax
1215
	or eax,eax
1216
	jz .end_fblo
1216
	jz .end_fblo
1217
	cmp [eax+Figure.OType],'Fig'
1217
	cmp [eax+Figure.OType],'Fig'
1218
	jne .end_fblo
1218
	jne .end_fblo
1219
 
1219
 
1220
	mov [pFig],eax
1220
	mov [pFig],eax
1221
	stdcall sel_points_get_count,eax
1221
	stdcall sel_points_get_count,eax
1222
	cmp eax,1
1222
	cmp eax,1
1223
	jne .no_point
1223
	jne .no_point
1224
 
1224
 
1225
	;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
1225
	;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
1226
	mov eax,[pFig]
1226
	mov eax,[pFig]
1227
	mov ecx,[eax+Figure.PoiCount]
1227
	mov ecx,[eax+Figure.PoiCount]
1228
	or ecx,ecx
1228
	or ecx,ecx
1229
	jz .no_point
1229
	jz .no_point
1230
	dec ecx
1230
	dec ecx
1231
	jecxz .end_f
1231
	jecxz .end_f
1232
	mov ebx,[eax+Figure.PoiData]
1232
	mov ebx,[eax+Figure.PoiData]
1233
	.cycle0:
1233
	.cycle0:
1234
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1234
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1235
		jnc @f
1235
		jnc @f
1236
			btr dword[ebx+Point.Prop],PROP_BIT_SELECT
1236
			btr dword[ebx+Point.Prop],PROP_BIT_SELECT
1237
			bts dword[ebx+Point.Prop+sizeof.Point],PROP_BIT_SELECT
1237
			bts dword[ebx+Point.Prop+sizeof.Point],PROP_BIT_SELECT
1238
			xor ecx,ecx
1238
			xor ecx,ecx
1239
			inc ecx ;ecx = 1 - for exit from cycle
1239
			inc ecx ;ecx = 1 - for exit from cycle
1240
		@@:
1240
		@@:
1241
		add ebx,sizeof.Point
1241
		add ebx,sizeof.Point
1242
		loop .cycle0
1242
		loop .cycle0
1243
 
1243
 
1244
		;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1244
		;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1245
		mov dword[offs_last_timer],0
1245
		mov dword[offs_last_timer],0
1246
		jmp .end_f
1246
		jmp .end_f
1247
	.no_point:
1247
	.no_point:
1248
		notify_window_run txt_err_no_point_sel_1
1248
		notify_window_run txt_err_no_point_sel_1
1249
		jmp .end_f
1249
		jmp .end_f
1250
	.end_fblo:
1250
	.end_fblo:
1251
		;notify_window_run txt_err_no_figure_select
1251
		;notify_window_run txt_err_no_figure_select
1252
	.end_f:
1252
	.end_f:
1253
	popad
1253
	popad
1254
	ret
1254
	ret
1255
endp
1255
endp
1256
 
1256
 
1257
;output:
1257
;output:
1258
; eax - couunt new points
1258
; eax - couunt new points
1259
align 4
1259
align 4
1260
proc but_clipboard_copy_points uses ebx ecx edx edi esi
1260
proc but_clipboard_copy_points uses ebx ecx edx edi esi
1261
locals
1261
locals
1262
	pData dd 0
1262
	pData dd 0
1263
	pBuf dd 0
1263
	pBuf dd 0
1264
endl
1264
endl
1265
	stdcall [tl_node_get_data],tree1
1265
	stdcall [tl_node_get_data],tree1
1266
	or eax,eax
1266
	or eax,eax
1267
	jz .no_point
1267
	jz .no_point
1268
	cmp [eax+Figure.OType],'Fig'
1268
	cmp [eax+Figure.OType],'Fig'
1269
	jne .no_point
1269
	jne .no_point
1270
 
1270
 
1271
	mov ecx,[eax+Figure.PoiData]
1271
	mov ecx,[eax+Figure.PoiData]
1272
	mov [pData],ecx
1272
	mov [pData],ecx
1273
	mov ecx,[eax+Figure.PoiCount]
1273
	mov ecx,[eax+Figure.PoiCount]
1274
	stdcall sel_points_get_count,eax
1274
	stdcall sel_points_get_count,eax
1275
	or eax,eax
1275
	or eax,eax
1276
	jz .no_point
1276
	jz .no_point
1277
	push eax
1277
	push eax
1278
		imul eax,32 ;for string 'X___.________ Y___.________^^'
1278
		imul eax,32 ;for string 'X___.________ Y___.________^^'
1279
		stdcall mem.Alloc,eax
1279
		stdcall mem.Alloc,eax
1280
		mov [pBuf],eax
1280
		mov [pBuf],eax
1281
 
1281
 
1282
		mov edx,eax
1282
		mov edx,eax
1283
		mov dword[edx+4],0 ;text data
1283
		mov dword[edx+4],0 ;text data
1284
		mov dword[edx+8],1 ;code 866
1284
		mov dword[edx+8],1 ;code 866
1285
		add edx,12 ;system buffer header size
1285
		add edx,12 ;system buffer header size
1286
		mov dword[edx],0
1286
		mov dword[edx],0
1287
		mov word[NumberSymbolsAD],8
1287
		mov word[NumberSymbolsAD],8
1288
align 4
1288
align 4
1289
		.cycle2: ;横« ¯® â®çª ¬
1289
		.cycle2: ;横« ¯® â®çª ¬
1290
			mov esi,[pData]
1290
			mov esi,[pData]
1291
			bt dword[esi+Point.Prop],PROP_BIT_SELECT
1291
			bt dword[esi+Point.Prop],PROP_BIT_SELECT
1292
			jnc .end0
1292
			jnc .end0
1293
			stdcall str_cat,edx,txt_s_poi
1293
			stdcall str_cat,edx,txt_s_poi
1294
			;param 1
1294
			;param 1
1295
			add esi,Point.CoordX
1295
			add esi,Point.CoordX
1296
			mov edi,Data_Double
1296
			mov edi,Data_Double
1297
			movsd
1297
			movsd
1298
			movsd
1298
			movsd
1299
			call DoubleFloat_to_String
1299
			call DoubleFloat_to_String
1300
			call String_crop_0
1300
			call String_crop_0
1301
			stdcall str_cat,edx,Data_String
1301
			stdcall str_cat,edx,Data_String
1302
			stdcall str_cat,edx,txt_s_poi_Y
1302
			stdcall str_cat,edx,txt_s_poi_Y
1303
			;param 2
1303
			;param 2
1304
			;;mov esi,[pData]
1304
			;;mov esi,[pData]
1305
			;;lea esi,[esi+Point.CoordY]
1305
			;;lea esi,[esi+Point.CoordY]
1306
			mov edi,Data_Double
1306
			mov edi,Data_Double
1307
			movsd
1307
			movsd
1308
			movsd
1308
			movsd
1309
			call DoubleFloat_to_String
1309
			call DoubleFloat_to_String
1310
			call String_crop_0
1310
			call String_crop_0
1311
			stdcall str_cat,edx,Data_String
1311
			stdcall str_cat,edx,Data_String
1312
			;
1312
			;
1313
			stdcall str_cat,edx,txt_nl
1313
			stdcall str_cat,edx,txt_nl
1314
			.end0:
1314
			.end0:
1315
			add dword[pData],sizeof.Point
1315
			add dword[pData],sizeof.Point
1316
			loop .cycle2
1316
			loop .cycle2
1317
		.cycle2end:
1317
		.cycle2end:
1318
 
1318
 
1319
		mov edx,[pBuf]
1319
		mov edx,[pBuf]
1320
		add edx,12
1320
		add edx,12
1321
		stdcall str_len,edx
1321
		stdcall str_len,edx
1322
		sub edx,12
1322
		sub edx,12
1323
		mov [edx],eax
1323
		mov [edx],eax
1324
		add eax,12
1324
		add eax,12
1325
		mov ecx,eax
1325
		mov ecx,eax
1326
		mcall SF_CLIPBOARD,SSF_WRITE_CB ;,ecx,edx
1326
		mcall SF_CLIPBOARD,SSF_WRITE_CB ;,ecx,edx
1327
		stdcall mem.Free,[pBuf]
1327
		stdcall mem.Free,[pBuf]
1328
	pop eax
1328
	pop eax
1329
 
1329
 
1330
	.no_point:
1330
	.no_point:
1331
	ret
1331
	ret
1332
endp
1332
endp
1333
 
1333
 
1334
;output:
1334
;output:
1335
; eax - couunt new points
1335
; eax - couunt new points
1336
align 4
1336
align 4
1337
proc but_clipboard_paste_points uses ebx ecx edx esi edi
1337
proc but_clipboard_paste_points uses ebx ecx edx esi edi
1338
locals
1338
locals
1339
	pFig dd ?
1339
	pFig dd ?
1340
	nCount dd ?
1340
	nCount dd ?
1341
endl
1341
endl
1342
	stdcall [tl_node_get_data],tree1
1342
	stdcall [tl_node_get_data],tree1
1343
	or eax,eax
1343
	or eax,eax
1344
	jz .end0
1344
	jz .end0
1345
	cmp [eax+Figure.OType],'Fig'
1345
	cmp [eax+Figure.OType],'Fig'
1346
	jne .end0
1346
	jne .end0
1347
 
1347
 
1348
	mov [pFig],eax
1348
	mov [pFig],eax
1349
 
1349
 
1350
	mcall SF_CLIPBOARD,SSF_GET_SLOT_COUNT
1350
	mcall SF_CLIPBOARD,SSF_GET_SLOT_COUNT
1351
	cmp eax,1
1351
	cmp eax,1
1352
	jl .end0
1352
	jl .end0
1353
 
1353
 
1354
	mov esi,eax
1354
	mov esi,eax
1355
	.cycle0: ;®¡à â­ë© 横« ¯® ᫮⠬
1355
	.cycle0: ;®¡à â­ë© 横« ¯® ᫮⠬
1356
	dec esi ;­®¬¥à ⥪ã饣®, ¯à®¢¥à塞®£® á«®â 
1356
	dec esi ;­®¬¥à ⥪ã饣®, ¯à®¢¥à塞®£® á«®â 
1357
	mcall SF_CLIPBOARD,SSF_READ_CB,esi
1357
	mcall SF_CLIPBOARD,SSF_READ_CB,esi
1358
	cmp eax,1
1358
	cmp eax,1
1359
	je .end0
1359
	je .end0
1360
	cmp eax,-1
1360
	cmp eax,-1
1361
	je .end0
1361
	je .end0
1362
		mov ecx,dword[eax]
1362
		mov ecx,dword[eax]
1363
		cmp ecx,5 ;min text size
1363
		cmp ecx,5 ;min text size
1364
		jl .end0
1364
		jl .end0
1365
		cmp dword[eax+4],0 ;text
1365
		cmp dword[eax+4],0 ;text
1366
		je @f
1366
		je @f
1367
			cmp esi,1
1367
			cmp esi,1
1368
			jge .cycle0 ;¥á«¨ ¢ ¡ãä¥à¥ ­¥ ⥪áâ,   ᫮⮢ ¢ ¡ãä¥à¥ ­¥áª®«ìª®, ¯à®¡ã¥¬ ¯¥à¥©â¨ ª ¢¥àå­¥¬ã á«®âã
1368
			jge .cycle0 ;¥á«¨ ¢ ¡ãä¥à¥ ­¥ ⥪áâ,   ᫮⮢ ¢ ¡ãä¥à¥ ­¥áª®«ìª®, ¯à®¡ã¥¬ ¯¥à¥©â¨ ª ¢¥àå­¥¬ã á«®âã
1369
			jmp .end0
1369
			jmp .end0
1370
		@@:
1370
		@@:
1371
 
1371
 
1372
	mov esi,eax
1372
	mov esi,eax
1373
	add esi,12 ;ᬥ饭¨¥ ­ ç «  ⥪áâ  ¢ ¡ãä¥à¥
1373
	add esi,12 ;ᬥ饭¨¥ ­ ç «  ⥪áâ  ¢ ¡ãä¥à¥
1374
	stdcall get_max_points
1374
	stdcall get_max_points
1375
	or eax,eax
1375
	or eax,eax
1376
	jz .end_f
1376
	jz .end_f
1377
		mov [nCount],eax
1377
		mov [nCount],eax
1378
		mov ebx,[pFig]
1378
		mov ebx,[pFig]
1379
		mov edi,[ebx+Figure.PoiCount]
1379
		mov edi,[ebx+Figure.PoiCount]
1380
		add [ebx+Figure.PoiCount],eax
1380
		add [ebx+Figure.PoiCount],eax
1381
		add eax,edi
1381
		add eax,edi
1382
		imul eax,sizeof.Point
1382
		imul eax,sizeof.Point
1383
		stdcall mem.ReAlloc,[ebx+Figure.PoiData],eax
1383
		stdcall mem.ReAlloc,[ebx+Figure.PoiData],eax
1384
		mov [ebx+Figure.PoiData],eax
1384
		mov [ebx+Figure.PoiData],eax
1385
 
1385
 
1386
		mov ecx,edi
1386
		mov ecx,edi
1387
		mov edx,eax
1387
		mov edx,eax
1388
align 4
1388
align 4
1389
		.cycle1: ;横« ¤«ï á­ïâ¨ï ¢ë¤¥«¥­¨ï á® áâ àëå â®ç¥ª
1389
		.cycle1: ;横« ¤«ï á­ïâ¨ï ¢ë¤¥«¥­¨ï á® áâ àëå â®ç¥ª
1390
			btr dword[edx+Point.Prop],PROP_BIT_SELECT
1390
			btr dword[edx+Point.Prop],PROP_BIT_SELECT
1391
			add edx,sizeof.Point
1391
			add edx,sizeof.Point
1392
			loop .cycle1
1392
			loop .cycle1
1393
 
1393
 
1394
		mov ecx,[nCount]
1394
		mov ecx,[nCount]
1395
		imul edi,sizeof.Point
1395
		imul edi,sizeof.Point
1396
		add edi,eax
1396
		add edi,eax
1397
		finit
1397
		finit
1398
align 4
1398
align 4
1399
		.cycle2: ;横« ¤«ï ¤®¡ ¢«¥­¨ï ­®¢ëå â®ç¥ª
1399
		.cycle2: ;横« ¤«ï ¤®¡ ¢«¥­¨ï ­®¢ëå â®ç¥ª
1400
			stdcall PointInit,edi
1400
			stdcall PointInit,edi
1401
			or eax,eax
1401
			or eax,eax
1402
			jz .cycle2end
1402
			jz .cycle2end
1403
			bts dword[edi+Point.Prop],PROP_BIT_SELECT
1403
			bts dword[edi+Point.Prop],PROP_BIT_SELECT
1404
			add edi,sizeof.Point
1404
			add edi,sizeof.Point
1405
			loop .cycle2
1405
			loop .cycle2
1406
		.cycle2end:
1406
		.cycle2end:
1407
		or ecx,ecx
1407
		or ecx,ecx
1408
		jz .end1
1408
		jz .end1
1409
			;㬥­ìè ¥¬ ®¡ê¥¬ ¯ ¬ï⨠¢ë¤¥«¥­­ë© ¤«ï â®ç¥ª
1409
			;㬥­ìè ¥¬ ®¡ê¥¬ ¯ ¬ï⨠¢ë¤¥«¥­­ë© ¤«ï â®ç¥ª
1410
			sub [ebx+Figure.PoiCount],ecx
1410
			sub [ebx+Figure.PoiCount],ecx
1411
			mov eax,[ebx+Figure.PoiCount]
1411
			mov eax,[ebx+Figure.PoiCount]
1412
			imul eax,sizeof.Point
1412
			imul eax,sizeof.Point
1413
			stdcall mem.ReAlloc,[ebx+Figure.PoiData],eax
1413
			stdcall mem.ReAlloc,[ebx+Figure.PoiData],eax
1414
			mov [ebx+Figure.PoiData],eax
1414
			mov [ebx+Figure.PoiData],eax
1415
		.end1:
1415
		.end1:
1416
		stdcall found_parent_obj,ebx ;get figure number in ecx
1416
		stdcall found_parent_obj,ebx ;get figure number in ecx
1417
		stdcall figure_update_coords,ObjData,ecx
1417
		stdcall figure_update_coords,ObjData,ecx
1418
		
1418
		
1419
		mov eax,[nCount]
1419
		mov eax,[nCount]
1420
		mov dword[offs_last_timer],0
1420
		mov dword[offs_last_timer],0
1421
		jmp .end_f
1421
		jmp .end_f
1422
	.end0:
1422
	.end0:
1423
		xor eax,eax
1423
		xor eax,eax
1424
	.end_f:
1424
	.end_f:
1425
	ret
1425
	ret
1426
endp
1426
endp
1427
 
1427
 
1428
align 4
1428
align 4
1429
proc but_sel_points_del
1429
proc but_sel_points_del
1430
locals
1430
locals
1431
	pFig dd ?
1431
	pFig dd ?
1432
	nDel dd ? ;need delete
1432
	nDel dd ? ;need delete
1433
endl
1433
endl
1434
	pushad
1434
	pushad
1435
	stdcall [tl_node_get_data],tree1
1435
	stdcall [tl_node_get_data],tree1
1436
	or eax,eax
1436
	or eax,eax
1437
	jz .no_point
1437
	jz .no_point
1438
	cmp [eax+Figure.OType],'Fig'
1438
	cmp [eax+Figure.OType],'Fig'
1439
	jne .no_point
1439
	jne .no_point
1440
 
1440
 
1441
	mov [pFig],eax
1441
	mov [pFig],eax
1442
	stdcall sel_points_get_count,eax
1442
	stdcall sel_points_get_count,eax
1443
	or eax,eax
1443
	or eax,eax
1444
	jz .no_point
1444
	jz .no_point
1445
	mov [nDel],eax
1445
	mov [nDel],eax
1446
 
1446
 
1447
	;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
1447
	;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
1448
	mov ebx,[pFig]
1448
	mov ebx,[pFig]
1449
	mov ecx,[ebx+Figure.PoiCount]
1449
	mov ecx,[ebx+Figure.PoiCount]
1450
	or ecx,ecx
1450
	or ecx,ecx
1451
	jz .no_point
1451
	jz .no_point
1452
 
1452
 
1453
	cmp ecx,eax
1453
	cmp ecx,eax
1454
	jle .no_all
1454
	jle .no_all
1455
 
1455
 
1456
	stdcall found_parent_obj,[pFig]
1456
	stdcall found_parent_obj,[pFig]
1457
	or eax,eax
1457
	or eax,eax
1458
	jz .end_f ;if not found
1458
	jz .end_f ;if not found
1459
		mov edi,[ebx+Figure.PoiData]
1459
		mov edi,[ebx+Figure.PoiData]
1460
		mov edx,[ebx+Figure.PoiCount]
1460
		mov edx,[ebx+Figure.PoiCount]
1461
		imul edx,sizeof.Point
1461
		imul edx,sizeof.Point
1462
		add edx,edi
1462
		add edx,edi
1463
 
1463
 
1464
		.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
1464
		.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
1465
			cmp edi,edx
1465
			cmp edi,edx
1466
			jge .end0
1466
			jge .end0
1467
			bt dword[edi+Point.Prop],PROP_BIT_SELECT
1467
			bt dword[edi+Point.Prop],PROP_BIT_SELECT
1468
			jc .cycle0end
1468
			jc .cycle0end
1469
				add edi,sizeof.Point
1469
				add edi,sizeof.Point
1470
				jmp .cycle0
1470
				jmp .cycle0
1471
		.cycle0end:
1471
		.cycle0end:
1472
 
1472
 
1473
		mov esi,edi ;á«¥¤ãé ï 1-ï ­¥ ¢ë¤¥«¥­­ ï â®çª 
1473
		mov esi,edi ;á«¥¤ãé ï 1-ï ­¥ ¢ë¤¥«¥­­ ï â®çª 
1474
		add esi,sizeof.Point
1474
		add esi,sizeof.Point
1475
		.cycle1:
1475
		.cycle1:
1476
			cmp esi,edx
1476
			cmp esi,edx
1477
			jge .end0
1477
			jge .end0
1478
			bt dword[esi+Point.Prop],PROP_BIT_SELECT
1478
			bt dword[esi+Point.Prop],PROP_BIT_SELECT
1479
			jnc .cycle1end
1479
			jnc .cycle1end
1480
				add esi,sizeof.Point
1480
				add esi,sizeof.Point
1481
				jmp .cycle1
1481
				jmp .cycle1
1482
		.cycle1end:
1482
		.cycle1end:
1483
 
1483
 
1484
		mov ecx,sizeof.Point
1484
		mov ecx,sizeof.Point
1485
		rep movsb ;§ ¬¥­  ¢ë¤¥«¥­­®© â®çª¨
1485
		rep movsb ;§ ¬¥­  ¢ë¤¥«¥­­®© â®çª¨
1486
		bts dword[esi+Point.Prop-sizeof.Point],PROP_BIT_SELECT ;áâ ¢¨¬ ¢ë¤¥«¥­¨¥ ­  â®çªã, çâ®-¡ë ¯®â®¬ ¥¥ 㤠«¨âì
1486
		bts dword[esi+Point.Prop-sizeof.Point],PROP_BIT_SELECT ;áâ ¢¨¬ ¢ë¤¥«¥­¨¥ ­  â®çªã, çâ®-¡ë ¯®â®¬ ¥¥ 㤠«¨âì
1487
 
1487
 
1488
		jmp .cycle0
1488
		jmp .cycle0
1489
		.end0:
1489
		.end0:
1490
 
1490
 
1491
		;®¡­®¢«¥­¨¥ ¯ ¬ïâ¨
1491
		;®¡­®¢«¥­¨¥ ¯ ¬ïâ¨
1492
		mov eax,[ebx+Figure.PoiCount]
1492
		mov eax,[ebx+Figure.PoiCount]
1493
		sub eax,[nDel]
1493
		sub eax,[nDel]
1494
		mov [ebx+Figure.PoiCount],eax
1494
		mov [ebx+Figure.PoiCount],eax
1495
		imul eax,sizeof.Point
1495
		imul eax,sizeof.Point
1496
		stdcall mem.ReAlloc,[ebx+Figure.PoiData],eax
1496
		stdcall mem.ReAlloc,[ebx+Figure.PoiData],eax
1497
		mov [ebx+Figure.PoiData],eax
1497
		mov [ebx+Figure.PoiData],eax
1498
 
1498
 
1499
		;¯¥à¥à áç¥â à §¬¥à®¢ 䨣ãàë
1499
		;¯¥à¥à áç¥â à §¬¥à®¢ 䨣ãàë
1500
		stdcall found_parent_obj,ebx ;get figure number in ecx
1500
		stdcall found_parent_obj,ebx ;get figure number in ecx
1501
		stdcall figure_update_coords,ObjData,ecx
1501
		stdcall figure_update_coords,ObjData,ecx
1502
 
1502
 
1503
		;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1503
		;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1504
		mov dword[offs_last_timer],0
1504
		mov dword[offs_last_timer],0
1505
		jmp .end_f
1505
		jmp .end_f
1506
 
1506
 
1507
	.no_all:
1507
	.no_all:
1508
		notify_window_run txt_err_no_point_del
1508
		notify_window_run txt_err_no_point_del
1509
		jmp .end_f
1509
		jmp .end_f
1510
	.no_point:
1510
	.no_point:
1511
		notify_window_run txt_err_no_point_sel
1511
		notify_window_run txt_err_no_point_sel
1512
	.end_f:
1512
	.end_f:
1513
	popad
1513
	popad
1514
	ret
1514
	ret
1515
endp
1515
endp
1516
 
1516
 
1517
align 4
1517
align 4
1518
proc but_sel_points_all uses eax ecx
1518
proc but_sel_points_all uses eax ecx
1519
	stdcall [tl_node_get_data],tree1
1519
	stdcall [tl_node_get_data],tree1
1520
	or eax,eax
1520
	or eax,eax
1521
	jz .no_point
1521
	jz .no_point
1522
	cmp [eax+Figure.OType],'Fig'
1522
	cmp [eax+Figure.OType],'Fig'
1523
	jne .no_point
1523
	jne .no_point
1524
 
1524
 
1525
	mov ecx,[eax+Figure.PoiCount]
1525
	mov ecx,[eax+Figure.PoiCount]
1526
	or ecx,ecx
1526
	or ecx,ecx
1527
	jz .no_point
1527
	jz .no_point
1528
	mov eax,[eax+Figure.PoiData]
1528
	mov eax,[eax+Figure.PoiData]
1529
	.cycle0: ;横« ¤«ï ¢ë¤¥«¥­­¨ï â®ç¥ª
1529
	.cycle0: ;横« ¤«ï ¢ë¤¥«¥­­¨ï â®ç¥ª
1530
		bts dword[eax+Point.Prop],PROP_BIT_SELECT
1530
		bts dword[eax+Point.Prop],PROP_BIT_SELECT
1531
		add eax,sizeof.Point
1531
		add eax,sizeof.Point
1532
		loop .cycle0
1532
		loop .cycle0
1533
	;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1533
	;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1534
	mov dword[offs_last_timer],0
1534
	mov dword[offs_last_timer],0
1535
	.no_point:
1535
	.no_point:
1536
	ret
1536
	ret
1537
endp
1537
endp
1538
 
1538
 
1539
align 4
1539
align 4
1540
proc but_sel_points_align_coord_xmin
1540
proc but_sel_points_align_coord_xmin
1541
pushad
1541
pushad
1542
	stdcall [tl_node_get_data],tree1
1542
	stdcall [tl_node_get_data],tree1
1543
	or eax,eax
1543
	or eax,eax
1544
	jz .no_point
1544
	jz .no_point
1545
	cmp [eax+Figure.OType],'Fig'
1545
	cmp [eax+Figure.OType],'Fig'
1546
	jne .no_point
1546
	jne .no_point
1547
 
1547
 
1548
	mov ebx,eax
1548
	mov ebx,eax
1549
	stdcall sel_points_get_count,eax
1549
	stdcall sel_points_get_count,eax
1550
	cmp eax,1
1550
	cmp eax,1
1551
	jle .no_point
1551
	jle .no_point
1552
	mov ecx,[ebx+Figure.PoiCount]
1552
	mov ecx,[ebx+Figure.PoiCount]
1553
	or ecx,ecx
1553
	or ecx,ecx
1554
	jz .no_point
1554
	jz .no_point
1555
	cmp eax,ecx
1555
	cmp eax,ecx
1556
	je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
1556
	je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
1557
 
1557
 
1558
	mov edx,ecx
1558
	mov edx,ecx
1559
	imul edx,sizeof.Point
1559
	imul edx,sizeof.Point
1560
	mov ebx,[ebx+Figure.PoiData]
1560
	mov ebx,[ebx+Figure.PoiData]
1561
	add edx,ebx
1561
	add edx,ebx
1562
align 4
1562
align 4
1563
	.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
1563
	.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
1564
		cmp ebx,edx
1564
		cmp ebx,edx
1565
		jge .no_point
1565
		jge .no_point
1566
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1566
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1567
		jc .cycle0end
1567
		jc .cycle0end
1568
		add ebx,sizeof.Point
1568
		add ebx,sizeof.Point
1569
		jmp .cycle0
1569
		jmp .cycle0
1570
	.cycle0end:
1570
	.cycle0end:
1571
	lea esi,[ebx+Point.CoordX]
1571
	lea esi,[ebx+Point.CoordX]
1572
	mov edi,Data_Double
1572
	mov edi,Data_Double
1573
	movsd
1573
	movsd
1574
	movsd
1574
	movsd
1575
	finit
1575
	finit
1576
	fld qword[Data_Double]
1576
	fld qword[Data_Double]
1577
align 4
1577
align 4
1578
	.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï min(Point.CoordX)
1578
	.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï min(Point.CoordX)
1579
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1579
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1580
		jnc .no_sel
1580
		jnc .no_sel
1581
			fcom qword[ebx+Point.CoordX]
1581
			fcom qword[ebx+Point.CoordX]
1582
			fstsw ax
1582
			fstsw ax
1583
			sahf
1583
			sahf
1584
			jbe .no_sel
1584
			jbe .no_sel
1585
				;if (st0>Point.CoordX)
1585
				;if (st0>Point.CoordX)
1586
				ffree st0
1586
				ffree st0
1587
				fincstp
1587
				fincstp
1588
				fld qword[ebx+Point.CoordX]
1588
				fld qword[ebx+Point.CoordX]
1589
		.no_sel:
1589
		.no_sel:
1590
		add ebx,sizeof.Point
1590
		add ebx,sizeof.Point
1591
		cmp ebx,edx
1591
		cmp ebx,edx
1592
		jl .cycle1
1592
		jl .cycle1
1593
	fstp qword[Data_Double]
1593
	fstp qword[Data_Double]
1594
align 4
1594
align 4
1595
	.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordX = min(Point.CoordX)
1595
	.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordX = min(Point.CoordX)
1596
		sub edx,sizeof.Point
1596
		sub edx,sizeof.Point
1597
		bt dword[edx+Point.Prop],PROP_BIT_SELECT
1597
		bt dword[edx+Point.Prop],PROP_BIT_SELECT
1598
		jnc @f
1598
		jnc @f
1599
			mov esi,Data_Double
1599
			mov esi,Data_Double
1600
			lea edi,[edx+Point.CoordX]
1600
			lea edi,[edx+Point.CoordX]
1601
			movsd
1601
			movsd
1602
			movsd
1602
			movsd
1603
		@@:
1603
		@@:
1604
		loop .cycle2
1604
		loop .cycle2
1605
	;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1605
	;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1606
	mov dword[offs_last_timer],0
1606
	mov dword[offs_last_timer],0
1607
	.no_point:
1607
	.no_point:
1608
popad
1608
popad
1609
	ret
1609
	ret
1610
endp
1610
endp
1611
 
1611
 
1612
align 4
1612
align 4
1613
proc but_sel_points_align_coord_ymin
1613
proc but_sel_points_align_coord_ymin
1614
pushad
1614
pushad
1615
	stdcall [tl_node_get_data],tree1
1615
	stdcall [tl_node_get_data],tree1
1616
	or eax,eax
1616
	or eax,eax
1617
	jz .no_point
1617
	jz .no_point
1618
	cmp [eax+Figure.OType],'Fig'
1618
	cmp [eax+Figure.OType],'Fig'
1619
	jne .no_point
1619
	jne .no_point
1620
 
1620
 
1621
	mov ebx,eax
1621
	mov ebx,eax
1622
	stdcall sel_points_get_count,eax
1622
	stdcall sel_points_get_count,eax
1623
	cmp eax,1
1623
	cmp eax,1
1624
	jle .no_point
1624
	jle .no_point
1625
	mov ecx,[ebx+Figure.PoiCount]
1625
	mov ecx,[ebx+Figure.PoiCount]
1626
	or ecx,ecx
1626
	or ecx,ecx
1627
	jz .no_point
1627
	jz .no_point
1628
	cmp eax,ecx
1628
	cmp eax,ecx
1629
	je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
1629
	je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
1630
 
1630
 
1631
	mov edx,ecx
1631
	mov edx,ecx
1632
	imul edx,sizeof.Point
1632
	imul edx,sizeof.Point
1633
	mov ebx,[ebx+Figure.PoiData]
1633
	mov ebx,[ebx+Figure.PoiData]
1634
	add edx,ebx
1634
	add edx,ebx
1635
align 4
1635
align 4
1636
	.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
1636
	.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
1637
		cmp ebx,edx
1637
		cmp ebx,edx
1638
		jge .no_point
1638
		jge .no_point
1639
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1639
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1640
		jc .cycle0end
1640
		jc .cycle0end
1641
		add ebx,sizeof.Point
1641
		add ebx,sizeof.Point
1642
		jmp .cycle0
1642
		jmp .cycle0
1643
	.cycle0end:
1643
	.cycle0end:
1644
	lea esi,[ebx+Point.CoordY]
1644
	lea esi,[ebx+Point.CoordY]
1645
	mov edi,Data_Double
1645
	mov edi,Data_Double
1646
	movsd
1646
	movsd
1647
	movsd
1647
	movsd
1648
	finit
1648
	finit
1649
	fld qword[Data_Double]
1649
	fld qword[Data_Double]
1650
align 4
1650
align 4
1651
	.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï min(Point.CoordY)
1651
	.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï min(Point.CoordY)
1652
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1652
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1653
		jnc .no_sel
1653
		jnc .no_sel
1654
			fcom qword[ebx+Point.CoordY]
1654
			fcom qword[ebx+Point.CoordY]
1655
			fstsw ax
1655
			fstsw ax
1656
			sahf
1656
			sahf
1657
			jbe .no_sel
1657
			jbe .no_sel
1658
				;if (st0>Point.CoordY)
1658
				;if (st0>Point.CoordY)
1659
				ffree st0
1659
				ffree st0
1660
				fincstp
1660
				fincstp
1661
				fld qword[ebx+Point.CoordY]
1661
				fld qword[ebx+Point.CoordY]
1662
		.no_sel:
1662
		.no_sel:
1663
		add ebx,sizeof.Point
1663
		add ebx,sizeof.Point
1664
		cmp ebx,edx
1664
		cmp ebx,edx
1665
		jl .cycle1
1665
		jl .cycle1
1666
	fstp qword[Data_Double]
1666
	fstp qword[Data_Double]
1667
align 4
1667
align 4
1668
	.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordY = min(Point.CoordY)
1668
	.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordY = min(Point.CoordY)
1669
		sub edx,sizeof.Point
1669
		sub edx,sizeof.Point
1670
		bt dword[edx+Point.Prop],PROP_BIT_SELECT
1670
		bt dword[edx+Point.Prop],PROP_BIT_SELECT
1671
		jnc @f
1671
		jnc @f
1672
			mov esi,Data_Double
1672
			mov esi,Data_Double
1673
			lea edi,[edx+Point.CoordY]
1673
			lea edi,[edx+Point.CoordY]
1674
			movsd
1674
			movsd
1675
			movsd
1675
			movsd
1676
		@@:
1676
		@@:
1677
		loop .cycle2
1677
		loop .cycle2
1678
	;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1678
	;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1679
	mov dword[offs_last_timer],0
1679
	mov dword[offs_last_timer],0
1680
	.no_point:
1680
	.no_point:
1681
popad
1681
popad
1682
	ret
1682
	ret
1683
endp
1683
endp
1684
 
1684
 
1685
align 4
1685
align 4
1686
proc but_sel_points_align_coord_xmax
1686
proc but_sel_points_align_coord_xmax
1687
pushad
1687
pushad
1688
	stdcall [tl_node_get_data],tree1
1688
	stdcall [tl_node_get_data],tree1
1689
	or eax,eax
1689
	or eax,eax
1690
	jz .no_point
1690
	jz .no_point
1691
	cmp [eax+Figure.OType],'Fig'
1691
	cmp [eax+Figure.OType],'Fig'
1692
	jne .no_point
1692
	jne .no_point
1693
 
1693
 
1694
	mov ebx,eax
1694
	mov ebx,eax
1695
	stdcall sel_points_get_count,eax
1695
	stdcall sel_points_get_count,eax
1696
	cmp eax,1
1696
	cmp eax,1
1697
	jle .no_point
1697
	jle .no_point
1698
	mov ecx,[ebx+Figure.PoiCount]
1698
	mov ecx,[ebx+Figure.PoiCount]
1699
	or ecx,ecx
1699
	or ecx,ecx
1700
	jz .no_point
1700
	jz .no_point
1701
	cmp eax,ecx
1701
	cmp eax,ecx
1702
	je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
1702
	je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
1703
 
1703
 
1704
	mov edx,ecx
1704
	mov edx,ecx
1705
	imul edx,sizeof.Point
1705
	imul edx,sizeof.Point
1706
	mov ebx,[ebx+Figure.PoiData]
1706
	mov ebx,[ebx+Figure.PoiData]
1707
	add edx,ebx
1707
	add edx,ebx
1708
align 4
1708
align 4
1709
	.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
1709
	.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
1710
		cmp ebx,edx
1710
		cmp ebx,edx
1711
		jge .no_point
1711
		jge .no_point
1712
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1712
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1713
		jc .cycle0end
1713
		jc .cycle0end
1714
		add ebx,sizeof.Point
1714
		add ebx,sizeof.Point
1715
		jmp .cycle0
1715
		jmp .cycle0
1716
	.cycle0end:
1716
	.cycle0end:
1717
	lea esi,[ebx+Point.CoordX]
1717
	lea esi,[ebx+Point.CoordX]
1718
	mov edi,Data_Double
1718
	mov edi,Data_Double
1719
	movsd
1719
	movsd
1720
	movsd
1720
	movsd
1721
	finit
1721
	finit
1722
	fld qword[Data_Double]
1722
	fld qword[Data_Double]
1723
align 4
1723
align 4
1724
	.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï max(Point.CoordX)
1724
	.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï max(Point.CoordX)
1725
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1725
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1726
		jnc .no_sel
1726
		jnc .no_sel
1727
			fcom qword[ebx+Point.CoordX]
1727
			fcom qword[ebx+Point.CoordX]
1728
			fstsw ax
1728
			fstsw ax
1729
			sahf
1729
			sahf
1730
			jae .no_sel
1730
			jae .no_sel
1731
				;if (st0
1731
				;if (st0
1732
				ffree st0
1732
				ffree st0
1733
				fincstp
1733
				fincstp
1734
				fld qword[ebx+Point.CoordX]
1734
				fld qword[ebx+Point.CoordX]
1735
		.no_sel:
1735
		.no_sel:
1736
		add ebx,sizeof.Point
1736
		add ebx,sizeof.Point
1737
		cmp ebx,edx
1737
		cmp ebx,edx
1738
		jl .cycle1
1738
		jl .cycle1
1739
	fstp qword[Data_Double]
1739
	fstp qword[Data_Double]
1740
align 4
1740
align 4
1741
	.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordX = max(Point.CoordX)
1741
	.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordX = max(Point.CoordX)
1742
		sub edx,sizeof.Point
1742
		sub edx,sizeof.Point
1743
		bt dword[edx+Point.Prop],PROP_BIT_SELECT
1743
		bt dword[edx+Point.Prop],PROP_BIT_SELECT
1744
		jnc @f
1744
		jnc @f
1745
			mov esi,Data_Double
1745
			mov esi,Data_Double
1746
			lea edi,[edx+Point.CoordX]
1746
			lea edi,[edx+Point.CoordX]
1747
			movsd
1747
			movsd
1748
			movsd
1748
			movsd
1749
		@@:
1749
		@@:
1750
		loop .cycle2
1750
		loop .cycle2
1751
	;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1751
	;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1752
	mov dword[offs_last_timer],0
1752
	mov dword[offs_last_timer],0
1753
	.no_point:
1753
	.no_point:
1754
popad
1754
popad
1755
	ret
1755
	ret
1756
endp
1756
endp
1757
 
1757
 
1758
align 4
1758
align 4
1759
proc but_sel_points_align_coord_ymax
1759
proc but_sel_points_align_coord_ymax
1760
pushad
1760
pushad
1761
	stdcall [tl_node_get_data],tree1
1761
	stdcall [tl_node_get_data],tree1
1762
	or eax,eax
1762
	or eax,eax
1763
	jz .no_point
1763
	jz .no_point
1764
	cmp [eax+Figure.OType],'Fig'
1764
	cmp [eax+Figure.OType],'Fig'
1765
	jne .no_point
1765
	jne .no_point
1766
 
1766
 
1767
	mov ebx,eax
1767
	mov ebx,eax
1768
	stdcall sel_points_get_count,eax
1768
	stdcall sel_points_get_count,eax
1769
	cmp eax,1
1769
	cmp eax,1
1770
	jle .no_point
1770
	jle .no_point
1771
	mov ecx,[ebx+Figure.PoiCount]
1771
	mov ecx,[ebx+Figure.PoiCount]
1772
	or ecx,ecx
1772
	or ecx,ecx
1773
	jz .no_point
1773
	jz .no_point
1774
	cmp eax,ecx
1774
	cmp eax,ecx
1775
	je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
1775
	je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
1776
 
1776
 
1777
	mov edx,ecx
1777
	mov edx,ecx
1778
	imul edx,sizeof.Point
1778
	imul edx,sizeof.Point
1779
	mov ebx,[ebx+Figure.PoiData]
1779
	mov ebx,[ebx+Figure.PoiData]
1780
	add edx,ebx
1780
	add edx,ebx
1781
align 4
1781
align 4
1782
	.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
1782
	.cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
1783
		cmp ebx,edx
1783
		cmp ebx,edx
1784
		jge .no_point
1784
		jge .no_point
1785
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1785
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1786
		jc .cycle0end
1786
		jc .cycle0end
1787
		add ebx,sizeof.Point
1787
		add ebx,sizeof.Point
1788
		jmp .cycle0
1788
		jmp .cycle0
1789
	.cycle0end:
1789
	.cycle0end:
1790
	lea esi,[ebx+Point.CoordY]
1790
	lea esi,[ebx+Point.CoordY]
1791
	mov edi,Data_Double
1791
	mov edi,Data_Double
1792
	movsd
1792
	movsd
1793
	movsd
1793
	movsd
1794
	finit
1794
	finit
1795
	fld qword[Data_Double]
1795
	fld qword[Data_Double]
1796
align 4
1796
align 4
1797
	.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï max(Point.CoordY)
1797
	.cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï max(Point.CoordY)
1798
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1798
		bt dword[ebx+Point.Prop],PROP_BIT_SELECT
1799
		jnc .no_sel
1799
		jnc .no_sel
1800
			fcom qword[ebx+Point.CoordY]
1800
			fcom qword[ebx+Point.CoordY]
1801
			fstsw ax
1801
			fstsw ax
1802
			sahf
1802
			sahf
1803
			jae .no_sel
1803
			jae .no_sel
1804
				;if (st0
1804
				;if (st0
1805
				ffree st0
1805
				ffree st0
1806
				fincstp
1806
				fincstp
1807
				fld qword[ebx+Point.CoordY]
1807
				fld qword[ebx+Point.CoordY]
1808
		.no_sel:
1808
		.no_sel:
1809
		add ebx,sizeof.Point
1809
		add ebx,sizeof.Point
1810
		cmp ebx,edx
1810
		cmp ebx,edx
1811
		jl .cycle1
1811
		jl .cycle1
1812
	fstp qword[Data_Double]
1812
	fstp qword[Data_Double]
1813
align 4
1813
align 4
1814
	.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordY = max(Point.CoordY)
1814
	.cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordY = max(Point.CoordY)
1815
		sub edx,sizeof.Point
1815
		sub edx,sizeof.Point
1816
		bt dword[edx+Point.Prop],PROP_BIT_SELECT
1816
		bt dword[edx+Point.Prop],PROP_BIT_SELECT
1817
		jnc @f
1817
		jnc @f
1818
			mov esi,Data_Double
1818
			mov esi,Data_Double
1819
			lea edi,[edx+Point.CoordY]
1819
			lea edi,[edx+Point.CoordY]
1820
			movsd
1820
			movsd
1821
			movsd
1821
			movsd
1822
		@@:
1822
		@@:
1823
		loop .cycle2
1823
		loop .cycle2
1824
	;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1824
	;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1825
	mov dword[offs_last_timer],0
1825
	mov dword[offs_last_timer],0
1826
	.no_point:
1826
	.no_point:
1827
popad
1827
popad
1828
	ret
1828
	ret
1829
endp
1829
endp
1830
 
1830
 
1831
;description:
1831
;description:
1832
; ®¯â¨¬¨§ æ¨ï 䨣ãàë
1832
; ®¯â¨¬¨§ æ¨ï 䨣ãàë
1833
align 4
1833
align 4
1834
proc but_points_optimize uses eax
1834
proc but_points_optimize uses eax
1835
	stdcall [tl_node_get_data],tree1
1835
	stdcall [tl_node_get_data],tree1
1836
	or eax,eax
1836
	or eax,eax
1837
	jz .no_point
1837
	jz .no_point
1838
	cmp [eax+Figure.OType],'Fig'
1838
	cmp [eax+Figure.OType],'Fig'
1839
	jne .no_point
1839
	jne .no_point
1840
		stdcall points_optimize,eax
1840
		stdcall points_optimize,eax
1841
		mov dword[offs_last_timer],0 ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1841
		mov dword[offs_last_timer],0 ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
1842
	.no_point:
1842
	.no_point:
1843
	ret
1843
	ret
1844
endp
1844
endp
1845
 
1845
 
1846
align 4
1846
align 4
1847
proc but_restore_zoom uses eax
1847
proc but_restore_zoom uses eax
1848
	stdcall [tl_node_get_data],tree1
1848
	stdcall [tl_node_get_data],tree1
1849
	or eax,eax
1849
	or eax,eax
1850
	jz .end_f
1850
	jz .end_f
1851
	cmp [eax+Figure.OType],'Fig'
1851
	cmp [eax+Figure.OType],'Fig'
1852
	je @f
1852
	je @f
1853
	cmp [eax+Figure.OType],'Obj'
1853
	cmp [eax+Figure.OType],'Obj'
1854
	je .end0
1854
	je .end0
1855
		jmp .end_f
1855
		jmp .end_f
1856
	.end0:
1856
	.end0:
1857
		mov eax,ObjData
1857
		mov eax,ObjData
1858
	@@:
1858
	@@:
1859
		finit
1859
		finit
1860
		fld1
1860
		fld1
1861
		fstp qword[eax+Figure.MScale]
1861
		fstp qword[eax+Figure.MScale]
1862
		mov dword[eax+Figure.MCentrX],0
1862
		mov dword[eax+Figure.MCentrX],0
1863
		mov dword[eax+Figure.MCentrY],0
1863
		mov dword[eax+Figure.MCentrY],0
1864
		mov dword[offs_last_timer],0
1864
		mov dword[offs_last_timer],0
1865
	.end_f:
1865
	.end_f:
1866
	ret
1866
	ret
1867
endp
1867
endp
1868
 
1868
 
1869
align 4
1869
align 4
1870
but_sel_figure_move_down:
1870
but_sel_figure_move_down:
1871
	pushad
1871
	pushad
1872
	stdcall [tl_node_get_data],tree1
1872
	stdcall [tl_node_get_data],tree1
1873
	or eax,eax
1873
	or eax,eax
1874
	jz .end_fblo
1874
	jz .end_fblo
1875
	cmp [eax+Figure.OType],'Fig'
1875
	cmp [eax+Figure.OType],'Fig'
1876
	jne .end_fblo
1876
	jne .end_fblo
1877
		stdcall found_parent_obj,eax
1877
		stdcall found_parent_obj,eax
1878
		or eax,eax
1878
		or eax,eax
1879
		jz .end_f ;if not found
1879
		jz .end_f ;if not found
1880
		inc ecx
1880
		inc ecx
1881
		cmp ecx,[eax+Object.FigCount]
1881
		cmp ecx,[eax+Object.FigCount]
1882
		jge .fig_is_last ;¥á«¨ 䨣ãà  ¢ ª®­æ¥ ᯨ᪠
1882
		jge .fig_is_last ;¥á«¨ 䨣ãà  ¢ ª®­æ¥ ᯨ᪠
1883
		mov ebx,[eax+Object.FigData]
1883
		mov ebx,[eax+Object.FigData]
1884
		mov edx,[ebx+4*ecx] ;¯¥à¥¤¢¨£ ¥¬ ï 䨣ãà 
1884
		mov edx,[ebx+4*ecx] ;¯¥à¥¤¢¨£ ¥¬ ï 䨣ãà 
1885
		mov edi,[ebx+4*ecx-4]
1885
		mov edi,[ebx+4*ecx-4]
1886
		;¬¥­ï¥¬ 䨣ãàë ¬¥áâ ¬¨
1886
		;¬¥­ï¥¬ 䨣ãàë ¬¥áâ ¬¨
1887
		mov [ebx+4*ecx],edi
1887
		mov [ebx+4*ecx],edi
1888
		mov [ebx+4*ecx-4],edx
1888
		mov [ebx+4*ecx-4],edx
1889
		;¬¥­ï¥¬ 䨣ãàë ¢ ᯨ᪥
1889
		;¬¥­ï¥¬ 䨣ãàë ¢ ᯨ᪥
1890
		stdcall [tl_node_move_down],tree1
1890
		stdcall [tl_node_move_down],tree1
1891
		jmp .end_f
1891
		jmp .end_f
1892
	.fig_is_last:
1892
	.fig_is_last:
1893
		notify_window_run txt_err_figure_is_last
1893
		notify_window_run txt_err_figure_is_last
1894
		jmp .end_f
1894
		jmp .end_f
1895
	.end_fblo:
1895
	.end_fblo:
1896
		notify_window_run txt_err_no_figure_select
1896
		notify_window_run txt_err_no_figure_select
1897
	.end_f:
1897
	.end_f:
1898
	popad
1898
	popad
1899
	ret
1899
	ret
1900
 
1900
 
1901
;description:
1901
;description:
1902
; § ¯ã᪠®ª­  ᮧ¤ ­¨ï/। ªâ¨à®¢ ­¨ï â®çª¨
1902
; § ¯ã᪠®ª­  ᮧ¤ ­¨ï/। ªâ¨à®¢ ­¨ï â®çª¨
1903
align 4
1903
align 4
1904
but_dlg_point_coords:
1904
but_dlg_point_coords:
1905
	cmp byte[wnd_run_prop],0
1905
	cmp byte[wnd_run_prop],0
1906
	jne .end_f
1906
	jne .end_f
1907
pushad
1907
pushad
1908
	stdcall [tl_node_get_data],tree1
1908
	stdcall [tl_node_get_data],tree1
1909
	or eax,eax
1909
	or eax,eax
1910
	jz .end_fblo
1910
	jz .end_fblo
1911
	cmp [eax+Figure.OType],'Fig'
1911
	cmp [eax+Figure.OType],'Fig'
1912
	jne .end_fblo
1912
	jne .end_fblo
1913
	mov [wnd_pFig],eax ;䨣ãà 
1913
	mov [wnd_pFig],eax ;䨣ãà 
1914
	stdcall sel_points_get_count,eax
1914
	stdcall sel_points_get_count,eax
1915
	cmp eax,1
1915
	cmp eax,1
1916
	jne .no_select_1
1916
	jne .no_select_1
1917
		stdcall found_parent_obj,[wnd_pFig]
1917
		stdcall found_parent_obj,[wnd_pFig]
1918
		or eax,eax
1918
		or eax,eax
1919
		jz .end0 ;if not found
1919
		jz .end0 ;if not found
1920
 
1920
 
1921
		mov [wnd_pObj],eax ;obj
1921
		mov [wnd_pObj],eax ;obj
1922
		mov [wnd_FigN],ecx ;fig number
1922
		mov [wnd_FigN],ecx ;fig number
1923
		stdcall sel_points_get_first,[wnd_pFig]
1923
		stdcall sel_points_get_first,[wnd_pFig]
1924
		mov [wnd_pPoi],eax
1924
		mov [wnd_pPoi],eax
1925
		mov edx,[wnd_pFig]
1925
		mov edx,[wnd_pFig]
1926
		sub eax,[edx+Figure.PoiData]
1926
		sub eax,[edx+Figure.PoiData]
1927
		xor edx,edx
1927
		xor edx,edx
1928
		mov ecx,sizeof.Point
1928
		mov ecx,sizeof.Point
1929
		div ecx
1929
		div ecx
1930
		jmp .end1
1930
		jmp .end1
1931
	.no_select_1:
1931
	.no_select_1:
1932
	or eax,eax
1932
	or eax,eax
1933
	jnz .end_fblo
1933
	jnz .end_fblo
1934
		stdcall found_parent_obj,[wnd_pFig]
1934
		stdcall found_parent_obj,[wnd_pFig]
1935
		or eax,eax
1935
		or eax,eax
1936
		jz .end0 ;if not found
1936
		jz .end0 ;if not found
1937
 
1937
 
1938
		mov [wnd_pObj],eax ;obj
1938
		mov [wnd_pObj],eax ;obj
1939
		mov [wnd_FigN],ecx ;fig number
1939
		mov [wnd_FigN],ecx ;fig number
1940
		xor eax,eax
1940
		xor eax,eax
1941
		mov [wnd_pPoi],eax
1941
		mov [wnd_pPoi],eax
1942
		mov edx,[wnd_pFig]
1942
		mov edx,[wnd_pFig]
1943
		mov eax,[edx+Figure.PoiCount]
1943
		mov eax,[edx+Figure.PoiCount]
1944
	.end1:
1944
	.end1:
1945
		mov [wnd_PoiN],eax
1945
		mov [wnd_PoiN],eax
1946
		mcall SF_CREATE_THREAD,1,start_prop,thread_coords
1946
		mcall SF_CREATE_THREAD,1,start_prop,thread_coords
1947
		jmp .end0
1947
		jmp .end0
1948
	.end_fblo:
1948
	.end_fblo:
1949
		notify_window_run txt_err_no_1_point_sel
1949
		notify_window_run txt_err_no_1_point_sel
1950
		;jmp @f
1950
		;jmp @f
1951
	;.end_fblo:
1951
	;.end_fblo:
1952
		;notify_window_run txt_err_...
1952
		;notify_window_run txt_err_...
1953
	.end0:
1953
	.end0:
1954
popad
1954
popad
1955
	.end_f:
1955
	.end_f:
1956
	ret
1956
	ret
1957
 
1957
 
1958
align 4
1958
align 4
1959
but_dlg_opt_scale:
1959
but_dlg_opt_scale:
1960
	cmp byte[wnd_run_scale],0
1960
	cmp byte[wnd_run_scale],0
1961
	jne .end_f
1961
	jne .end_f
1962
pushad
1962
pushad
1963
	mcall SF_CREATE_THREAD,1,start_scale,thread_scale
1963
	mcall SF_CREATE_THREAD,1,start_scale,thread_scale
1964
popad
1964
popad
1965
	.end_f:
1965
	.end_f:
1966
	ret
1966
	ret
1967
 
1967
 
1968
 
1968
 
1969
 
1969
 
1970
;input:
1970
;input:
1971
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
1971
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
1972
;output:
1972
;output:
1973
; eax - ç¨á«®
1973
; eax - ç¨á«®
1974
align 4
1974
align 4
1975
proc conv_str_to_int uses ebx ecx esi, buf:dword
1975
proc conv_str_to_int uses ebx ecx esi, buf:dword
1976
	xor eax,eax
1976
	xor eax,eax
1977
	xor ebx,ebx
1977
	xor ebx,ebx
1978
	mov esi,[buf]
1978
	mov esi,[buf]
1979
 
1979
 
1980
	;­  á«ãç © ¥á«¨ ¯¥à¥¤ ç¨á«®¬ ­ å®¤ïâáï ¯à®¡¥«ë
1980
	;­  á«ãç © ¥á«¨ ¯¥à¥¤ ç¨á«®¬ ­ å®¤ïâáï ¯à®¡¥«ë
1981
	@@:
1981
	@@:
1982
	cmp byte[esi],' '
1982
	cmp byte[esi],' '
1983
	jne @f
1983
	jne @f
1984
		inc esi
1984
		inc esi
1985
		jmp @b
1985
		jmp @b
1986
	@@:
1986
	@@:
1987
 
1987
 
1988
	;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
1988
	;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
1989
	xor ecx,ecx
1989
	xor ecx,ecx
1990
	inc ecx
1990
	inc ecx
1991
	cmp byte[esi],'-'
1991
	cmp byte[esi],'-'
1992
	jne @f
1992
	jne @f
1993
		dec ecx
1993
		dec ecx
1994
		inc esi
1994
		inc esi
1995
	@@:
1995
	@@:
1996
 
1996
 
1997
	cmp word[esi],'0x'
1997
	cmp word[esi],'0x'
1998
	je .load_digit_16
1998
	je .load_digit_16
1999
 
1999
 
2000
	.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
2000
	.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
2001
		mov bl,byte[esi]
2001
		mov bl,byte[esi]
2002
		cmp bl,'0'
2002
		cmp bl,'0'
2003
		jl @f
2003
		jl @f
2004
		cmp bl,'9'
2004
		cmp bl,'9'
2005
		jg @f
2005
		jg @f
2006
			sub bl,'0'
2006
			sub bl,'0'
2007
			imul eax,10
2007
			imul eax,10
2008
			add eax,ebx
2008
			add eax,ebx
2009
			inc esi
2009
			inc esi
2010
			jmp .load_digit_10
2010
			jmp .load_digit_10
2011
	jmp @f
2011
	jmp @f
2012
 
2012
 
2013
	.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
2013
	.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
2014
		add esi,2
2014
		add esi,2
2015
	.cycle_16:
2015
	.cycle_16:
2016
		mov bl,byte[esi]
2016
		mov bl,byte[esi]
2017
		cmp bl,'0'
2017
		cmp bl,'0'
2018
		jl @f
2018
		jl @f
2019
		cmp bl,'f'
2019
		cmp bl,'f'
2020
		jg @f
2020
		jg @f
2021
		cmp bl,'9'
2021
		cmp bl,'9'
2022
		jle .us1
2022
		jle .us1
2023
			cmp bl,'A'
2023
			cmp bl,'A'
2024
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
2024
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
2025
		.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
2025
		.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
2026
		cmp bl,'F'
2026
		cmp bl,'F'
2027
		jle .us2
2027
		jle .us2
2028
			cmp bl,'a'
2028
			cmp bl,'a'
2029
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
2029
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
2030
			sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
2030
			sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
2031
		.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
2031
		.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
2032
			sub bl,'0'
2032
			sub bl,'0'
2033
			cmp bl,9
2033
			cmp bl,9
2034
			jle .cor1
2034
			jle .cor1
2035
				sub bl,7 ;convert 'A' to '10'
2035
				sub bl,7 ;convert 'A' to '10'
2036
			.cor1:
2036
			.cor1:
2037
			shl eax,4
2037
			shl eax,4
2038
			add eax,ebx
2038
			add eax,ebx
2039
			inc esi
2039
			inc esi
2040
			jmp .cycle_16
2040
			jmp .cycle_16
2041
	@@:
2041
	@@:
2042
	cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
2042
	cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
2043
	jne @f
2043
	jne @f
2044
		sub ecx,eax
2044
		sub ecx,eax
2045
		mov eax,ecx
2045
		mov eax,ecx
2046
	@@:
2046
	@@:
2047
	ret
2047
	ret
2048
endp
2048
endp
2049
 
2049
 
2050
 
2050
 
2051
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
2051
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
2052
align 4
2052
align 4
2053
OpenDialog_data:
2053
OpenDialog_data:
2054
.type			dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
2054
.type			dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
2055
.procinfo		dd procinfo	;+4
2055
.procinfo		dd procinfo	;+4
2056
.com_area_name		dd communication_area_name	;+8
2056
.com_area_name		dd communication_area_name	;+8
2057
.com_area		dd 0	;+12
2057
.com_area		dd 0	;+12
2058
.opendir_path		dd plugin_path	;+16
2058
.opendir_path		dd plugin_path	;+16
2059
.dir_default_path	dd default_dir ;+20
2059
.dir_default_path	dd default_dir ;+20
2060
.start_path		dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
2060
.start_path		dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
2061
.draw_window		dd draw_window	;+28
2061
.draw_window		dd draw_window	;+28
2062
.status 		dd 0	;+32
2062
.status 		dd 0	;+32
2063
.openfile_path		dd openfile_path	;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
2063
.openfile_path		dd openfile_path	;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
2064
.filename_area		dd filename_area	;+40
2064
.filename_area		dd filename_area	;+40
2065
.filter_area		dd Filter
2065
.filter_area		dd Filter
2066
.x:
2066
.x:
2067
.x_size 		dw 420 ;+48 ; Window X size
2067
.x_size 		dw 420 ;+48 ; Window X size
2068
.x_start		dw 10 ;+50 ; Window X position
2068
.x_start		dw 10 ;+50 ; Window X position
2069
.y:
2069
.y:
2070
.y_size 		dw 320 ;+52 ; Window y size
2070
.y_size 		dw 320 ;+52 ; Window y size
2071
.y_start		dw 10 ;+54 ; Window Y position
2071
.y_start		dw 10 ;+54 ; Window Y position
2072
 
2072
 
2073
default_dir db '/rd/1',0
2073
default_dir db '/sys',0
2074
 
2074
 
2075
communication_area_name:
2075
communication_area_name:
2076
	db 'FFFFFFFF_open_dialog',0
2076
	db 'FFFFFFFF_open_dialog',0
2077
open_dialog_name:
2077
open_dialog_name:
2078
	db 'opendial',0
2078
	db 'opendial',0
2079
communication_area_default_path:
2079
communication_area_default_path:
2080
	db '/rd/1/File managers/',0
2080
	db '/sys/File managers/',0
2081
 
2081
 
2082
Filter:
2082
Filter:
2083
dd Filter.end - Filter ;.1
2083
dd Filter.end - Filter ;.1
2084
.1: db 'NC',0
2084
.1: db 'NC',0
2085
.2: db 'PNG',0
2085
.2: db 'PNG',0
2086
.end:
2086
.end:
2087
db 0
2087
db 0
2088
 
2088
 
2089
 
2089
 
2090
align 4
2090
align 4
2091
system_dir_0 db '/sys/lib/'
2091
system_dir_0 db '/sys/lib/'
2092
lib_name_0 db 'proc_lib.obj',0
2092
lib_name_0 db 'proc_lib.obj',0
2093
system_dir_1 db '/sys/lib/'
2093
system_dir_1 db '/sys/lib/'
2094
lib_name_1 db 'libimg.obj',0
2094
lib_name_1 db 'libimg.obj',0
2095
system_dir_2 db '/sys/lib/'
2095
system_dir_2 db '/sys/lib/'
2096
lib_name_2 db 'buf2d.obj',0
2096
lib_name_2 db 'buf2d.obj',0
2097
system_dir_3 db '/sys/lib/'
2097
system_dir_3 db '/sys/lib/'
2098
lib_name_3 db 'box_lib.obj',0
2098
lib_name_3 db 'box_lib.obj',0
2099
 
2099
 
2100
align 4
2100
align 4
2101
l_libs_start:
2101
l_libs_start:
2102
	lib_0 l_libs lib_name_0, file_name, system_dir_0, import_proclib
2102
	lib_0 l_libs lib_name_0, file_name, system_dir_0, import_proclib
2103
	lib_1 l_libs lib_name_1, file_name, system_dir_1, import_libimg
2103
	lib_1 l_libs lib_name_1, file_name, system_dir_1, import_libimg
2104
	lib_2 l_libs lib_name_2, library_path, system_dir_2, import_buf2d
2104
	lib_2 l_libs lib_name_2, library_path, system_dir_2, import_buf2d
2105
	lib_3 l_libs lib_name_3, file_name, system_dir_3, import_box_lib
2105
	lib_3 l_libs lib_name_3, file_name, system_dir_3, import_box_lib
2106
l_libs_end:
2106
l_libs_end:
2107
 
2107
 
2108
align 4
2108
align 4
2109
import_libimg:
2109
import_libimg:
2110
	dd alib_init1
2110
	dd alib_init1
2111
	img_is_img  dd aimg_is_img
2111
	img_is_img  dd aimg_is_img
2112
	img_info    dd aimg_info
2112
	img_info    dd aimg_info
2113
	img_from_file dd aimg_from_file
2113
	img_from_file dd aimg_from_file
2114
	img_to_file dd aimg_to_file
2114
	img_to_file dd aimg_to_file
2115
	img_from_rgb dd aimg_from_rgb
2115
	img_from_rgb dd aimg_from_rgb
2116
	img_to_rgb  dd aimg_to_rgb
2116
	img_to_rgb  dd aimg_to_rgb
2117
	img_to_rgb2 dd aimg_to_rgb2
2117
	img_to_rgb2 dd aimg_to_rgb2
2118
	img_decode  dd aimg_decode
2118
	img_decode  dd aimg_decode
2119
	img_encode  dd aimg_encode
2119
	img_encode  dd aimg_encode
2120
	img_create  dd aimg_create
2120
	img_create  dd aimg_create
2121
	img_destroy dd aimg_destroy
2121
	img_destroy dd aimg_destroy
2122
	img_destroy_layer dd aimg_destroy_layer
2122
	img_destroy_layer dd aimg_destroy_layer
2123
	img_count   dd aimg_count
2123
	img_count   dd aimg_count
2124
	img_lock_bits dd aimg_lock_bits
2124
	img_lock_bits dd aimg_lock_bits
2125
	img_unlock_bits dd aimg_unlock_bits
2125
	img_unlock_bits dd aimg_unlock_bits
2126
	img_flip    dd aimg_flip
2126
	img_flip    dd aimg_flip
2127
	img_flip_layer dd aimg_flip_layer
2127
	img_flip_layer dd aimg_flip_layer
2128
	img_rotate  dd aimg_rotate
2128
	img_rotate  dd aimg_rotate
2129
	img_rotate_layer dd aimg_rotate_layer
2129
	img_rotate_layer dd aimg_rotate_layer
2130
	img_draw    dd aimg_draw
2130
	img_draw    dd aimg_draw
2131
 
2131
 
2132
	dd 0,0
2132
	dd 0,0
2133
	alib_init1   db 'lib_init',0
2133
	alib_init1   db 'lib_init',0
2134
	aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
2134
	aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
2135
	aimg_info    db 'img_info',0
2135
	aimg_info    db 'img_info',0
2136
	aimg_from_file db 'img_from_file',0
2136
	aimg_from_file db 'img_from_file',0
2137
	aimg_to_file db 'img_to_file',0
2137
	aimg_to_file db 'img_to_file',0
2138
	aimg_from_rgb db 'img_from_rgb',0
2138
	aimg_from_rgb db 'img_from_rgb',0
2139
	aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
2139
	aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
2140
	aimg_to_rgb2 db 'img_to_rgb2',0
2140
	aimg_to_rgb2 db 'img_to_rgb2',0
2141
	aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
2141
	aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
2142
	aimg_encode  db 'img_encode',0
2142
	aimg_encode  db 'img_encode',0
2143
	aimg_create  db 'img_create',0
2143
	aimg_create  db 'img_create',0
2144
	aimg_destroy db 'img_destroy',0
2144
	aimg_destroy db 'img_destroy',0
2145
	aimg_destroy_layer db 'img_destroy_layer',0
2145
	aimg_destroy_layer db 'img_destroy_layer',0
2146
	aimg_count   db 'img_count',0
2146
	aimg_count   db 'img_count',0
2147
	aimg_lock_bits db 'img_lock_bits',0
2147
	aimg_lock_bits db 'img_lock_bits',0
2148
	aimg_unlock_bits db 'img_unlock_bits',0
2148
	aimg_unlock_bits db 'img_unlock_bits',0
2149
	aimg_flip    db 'img_flip',0
2149
	aimg_flip    db 'img_flip',0
2150
	aimg_flip_layer db 'img_flip_layer',0
2150
	aimg_flip_layer db 'img_flip_layer',0
2151
	aimg_rotate  db 'img_rotate',0
2151
	aimg_rotate  db 'img_rotate',0
2152
	aimg_rotate_layer db 'img_rotate_layer',0
2152
	aimg_rotate_layer db 'img_rotate_layer',0
2153
	aimg_draw    db 'img_draw',0
2153
	aimg_draw    db 'img_draw',0
2154
 
2154
 
2155
align 4
2155
align 4
2156
import_proclib:
2156
import_proclib:
2157
	OpenDialog_Init dd aOpenDialog_Init
2157
	OpenDialog_Init dd aOpenDialog_Init
2158
	OpenDialog_Start dd aOpenDialog_Start
2158
	OpenDialog_Start dd aOpenDialog_Start
2159
	OpenDialog_Set_file_name dd aOpenDialog_Set_file_name
2159
	OpenDialog_Set_file_name dd aOpenDialog_Set_file_name
2160
	OpenDialog_Set_file_ext dd aOpenDialog_Set_file_ext
2160
	OpenDialog_Set_file_ext dd aOpenDialog_Set_file_ext
2161
dd 0,0
2161
dd 0,0
2162
	aOpenDialog_Init db 'OpenDialog_init',0
2162
	aOpenDialog_Init db 'OpenDialog_init',0
2163
	aOpenDialog_Start db 'OpenDialog_start',0
2163
	aOpenDialog_Start db 'OpenDialog_start',0
2164
	aOpenDialog_Set_file_name db 'OpenDialog_set_file_name',0
2164
	aOpenDialog_Set_file_name db 'OpenDialog_set_file_name',0
2165
	aOpenDialog_Set_file_ext db 'OpenDialog_set_file_ext',0
2165
	aOpenDialog_Set_file_ext db 'OpenDialog_set_file_ext',0
2166
 
2166
 
2167
align 4
2167
align 4
2168
import_buf2d:
2168
import_buf2d:
2169
	init dd sz_init
2169
	init dd sz_init
2170
	buf2d_create dd sz_buf2d_create
2170
	buf2d_create dd sz_buf2d_create
2171
	buf2d_create_f_img dd sz_buf2d_create_f_img
2171
	buf2d_create_f_img dd sz_buf2d_create_f_img
2172
	buf2d_clear dd sz_buf2d_clear
2172
	buf2d_clear dd sz_buf2d_clear
2173
	buf2d_draw dd sz_buf2d_draw
2173
	buf2d_draw dd sz_buf2d_draw
2174
	buf2d_delete dd sz_buf2d_delete
2174
	buf2d_delete dd sz_buf2d_delete
2175
	buf2d_resize dd sz_buf2d_resize
2175
	buf2d_resize dd sz_buf2d_resize
2176
	buf2d_line dd sz_buf2d_line
2176
	buf2d_line dd sz_buf2d_line
2177
	buf2d_line_sm dd sz_buf2d_line_sm
2177
	buf2d_line_sm dd sz_buf2d_line_sm
2178
	buf2d_rect_by_size dd sz_buf2d_rect_by_size
2178
	buf2d_rect_by_size dd sz_buf2d_rect_by_size
2179
	buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
2179
	buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
2180
	buf2d_circle dd sz_buf2d_circle
2180
	buf2d_circle dd sz_buf2d_circle
2181
	buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
2181
	buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
2182
	buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
2182
	buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
2183
	buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
2183
	buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
2184
	buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
2184
	buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
2185
	buf2d_bit_blt dd sz_buf2d_bit_blt
2185
	buf2d_bit_blt dd sz_buf2d_bit_blt
2186
	buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
2186
	buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
2187
	buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
2187
	buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
2188
	buf2d_curve_bezier dd sz_buf2d_curve_bezier
2188
	buf2d_curve_bezier dd sz_buf2d_curve_bezier
2189
	buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
2189
	buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
2190
	buf2d_draw_text dd sz_buf2d_draw_text
2190
	buf2d_draw_text dd sz_buf2d_draw_text
2191
	buf2d_crop_color dd sz_buf2d_crop_color
2191
	buf2d_crop_color dd sz_buf2d_crop_color
2192
	buf2d_flip_h dd sz_buf2d_flip_h
2192
	buf2d_flip_h dd sz_buf2d_flip_h
2193
	buf2d_flip_v dd sz_buf2d_flip_v
2193
	buf2d_flip_v dd sz_buf2d_flip_v
2194
	buf2d_offset_h dd sz_buf2d_offset_h
2194
	buf2d_offset_h dd sz_buf2d_offset_h
2195
	buf2d_flood_fill dd sz_buf2d_flood_fill
2195
	buf2d_flood_fill dd sz_buf2d_flood_fill
2196
	buf2d_set_pixel dd sz_buf2d_set_pixel
2196
	buf2d_set_pixel dd sz_buf2d_set_pixel
2197
	dd 0,0
2197
	dd 0,0
2198
	sz_init db 'lib_init',0
2198
	sz_init db 'lib_init',0
2199
	sz_buf2d_create db 'buf2d_create',0
2199
	sz_buf2d_create db 'buf2d_create',0
2200
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
2200
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
2201
	sz_buf2d_clear db 'buf2d_clear',0
2201
	sz_buf2d_clear db 'buf2d_clear',0
2202
	sz_buf2d_draw db 'buf2d_draw',0
2202
	sz_buf2d_draw db 'buf2d_draw',0
2203
	sz_buf2d_delete db 'buf2d_delete',0
2203
	sz_buf2d_delete db 'buf2d_delete',0
2204
	sz_buf2d_resize db 'buf2d_resize',0
2204
	sz_buf2d_resize db 'buf2d_resize',0
2205
	sz_buf2d_line db 'buf2d_line',0
2205
	sz_buf2d_line db 'buf2d_line',0
2206
	sz_buf2d_line_sm db 'buf2d_line_sm',0
2206
	sz_buf2d_line_sm db 'buf2d_line_sm',0
2207
	sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
2207
	sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
2208
	sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
2208
	sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
2209
	sz_buf2d_circle db 'buf2d_circle',0
2209
	sz_buf2d_circle db 'buf2d_circle',0
2210
	sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
2210
	sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
2211
	sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
2211
	sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
2212
	sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
2212
	sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
2213
	sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
2213
	sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
2214
	sz_buf2d_bit_blt db 'buf2d_bit_blt',0
2214
	sz_buf2d_bit_blt db 'buf2d_bit_blt',0
2215
	sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
2215
	sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
2216
	sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
2216
	sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
2217
	sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
2217
	sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
2218
	sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
2218
	sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
2219
	sz_buf2d_draw_text db 'buf2d_draw_text',0
2219
	sz_buf2d_draw_text db 'buf2d_draw_text',0
2220
	sz_buf2d_crop_color db 'buf2d_crop_color',0
2220
	sz_buf2d_crop_color db 'buf2d_crop_color',0
2221
	sz_buf2d_flip_h db 'buf2d_flip_h',0
2221
	sz_buf2d_flip_h db 'buf2d_flip_h',0
2222
	sz_buf2d_flip_v db 'buf2d_flip_v',0
2222
	sz_buf2d_flip_v db 'buf2d_flip_v',0
2223
	sz_buf2d_offset_h db 'buf2d_offset_h',0
2223
	sz_buf2d_offset_h db 'buf2d_offset_h',0
2224
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
2224
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
2225
	sz_buf2d_set_pixel db 'buf2d_set_pixel',0
2225
	sz_buf2d_set_pixel db 'buf2d_set_pixel',0
2226
 
2226
 
2227
align 4
2227
align 4
2228
import_box_lib:
2228
import_box_lib:
2229
	dd sz_init1
2229
	dd sz_init1
2230
 
2230
 
2231
	init_checkbox   dd sz_Init_checkbox
2231
	init_checkbox   dd sz_Init_checkbox
2232
	check_box_draw  dd sz_Check_box_draw
2232
	check_box_draw  dd sz_Check_box_draw
2233
	check_box_mouse dd sz_Check_box_mouse
2233
	check_box_mouse dd sz_Check_box_mouse
2234
	;version_ch     dd sz_Version_ch
2234
	;version_ch     dd sz_Version_ch
2235
 
2235
 
2236
	option_box_draw	 dd sz_Option_box_draw
2236
	option_box_draw	 dd sz_Option_box_draw
2237
	option_box_mouse dd sz_Option_box_mouse
2237
	option_box_mouse dd sz_Option_box_mouse
2238
	;version_op      dd sz_Version_op
2238
	;version_op      dd sz_Version_op
2239
 
2239
 
2240
	edit_box_draw      dd sz_edit_box_draw
2240
	edit_box_draw      dd sz_edit_box_draw
2241
	edit_box_key       dd sz_edit_box_key
2241
	edit_box_key       dd sz_edit_box_key
2242
	edit_box_mouse     dd sz_edit_box_mouse
2242
	edit_box_mouse     dd sz_edit_box_mouse
2243
	edit_box_set_text  dd sz_edit_box_set_text
2243
	edit_box_set_text  dd sz_edit_box_set_text
2244
	scrollbar_ver_draw dd sz_scrollbar_ver_draw
2244
	scrollbar_ver_draw dd sz_scrollbar_ver_draw
2245
	scrollbar_hor_draw dd sz_scrollbar_hor_draw
2245
	scrollbar_hor_draw dd sz_scrollbar_hor_draw
2246
 
2246
 
2247
	tl_data_init dd sz_tl_data_init
2247
	tl_data_init dd sz_tl_data_init
2248
	tl_data_clear dd sz_tl_data_clear
2248
	tl_data_clear dd sz_tl_data_clear
2249
	tl_info_clear dd sz_tl_info_clear
2249
	tl_info_clear dd sz_tl_info_clear
2250
	tl_key dd sz_tl_key
2250
	tl_key dd sz_tl_key
2251
	tl_mouse dd sz_tl_mouse
2251
	tl_mouse dd sz_tl_mouse
2252
	tl_draw dd sz_tl_draw
2252
	tl_draw dd sz_tl_draw
2253
	tl_info_undo dd sz_tl_info_undo
2253
	tl_info_undo dd sz_tl_info_undo
2254
	tl_info_redo dd sz_tl_info_redo
2254
	tl_info_redo dd sz_tl_info_redo
2255
	tl_node_add dd sz_tl_node_add
2255
	tl_node_add dd sz_tl_node_add
2256
	tl_node_set_data dd sz_tl_node_set_data
2256
	tl_node_set_data dd sz_tl_node_set_data
2257
	tl_node_get_data dd sz_tl_node_get_data
2257
	tl_node_get_data dd sz_tl_node_get_data
2258
	tl_node_delete dd sz_tl_node_delete
2258
	tl_node_delete dd sz_tl_node_delete
2259
	tl_node_move_up dd sz_tl_node_move_up
2259
	tl_node_move_up dd sz_tl_node_move_up
2260
	tl_node_move_down dd sz_tl_node_move_down
2260
	tl_node_move_down dd sz_tl_node_move_down
2261
	tl_cur_beg dd sz_tl_cur_beg
2261
	tl_cur_beg dd sz_tl_cur_beg
2262
	tl_cur_next dd sz_tl_cur_next
2262
	tl_cur_next dd sz_tl_cur_next
2263
	tl_cur_perv dd sz_tl_cur_perv
2263
	tl_cur_perv dd sz_tl_cur_perv
2264
	tl_node_close_open dd sz_tl_node_close_open
2264
	tl_node_close_open dd sz_tl_node_close_open
2265
	tl_node_lev_inc dd sz_tl_node_lev_inc
2265
	tl_node_lev_inc dd sz_tl_node_lev_inc
2266
	tl_node_lev_dec dd sz_tl_node_lev_dec
2266
	tl_node_lev_dec dd sz_tl_node_lev_dec
2267
	tl_node_poi_get_info dd sz_tl_node_poi_get_info
2267
	tl_node_poi_get_info dd sz_tl_node_poi_get_info
2268
	tl_node_poi_get_next_info dd sz_tl_node_poi_get_next_info
2268
	tl_node_poi_get_next_info dd sz_tl_node_poi_get_next_info
2269
	tl_node_poi_get_data dd sz_tl_node_poi_get_data
2269
	tl_node_poi_get_data dd sz_tl_node_poi_get_data
2270
 
2270
 
2271
	dd 0,0
2271
	dd 0,0
2272
	sz_init1 db 'lib_init',0
2272
	sz_init1 db 'lib_init',0
2273
 
2273
 
2274
	sz_Init_checkbox   db 'init_checkbox2',0
2274
	sz_Init_checkbox   db 'init_checkbox2',0
2275
	sz_Check_box_draw  db 'check_box_draw2',0
2275
	sz_Check_box_draw  db 'check_box_draw2',0
2276
	sz_Check_box_mouse db 'check_box_mouse2',0
2276
	sz_Check_box_mouse db 'check_box_mouse2',0
2277
	;sz_Version_ch     db 'version_ch2',0
2277
	;sz_Version_ch     db 'version_ch2',0
2278
 
2278
 
2279
	sz_Option_box_draw	db 'option_box_draw',0
2279
	sz_Option_box_draw	db 'option_box_draw',0
2280
	sz_Option_box_mouse	db 'option_box_mouse',0
2280
	sz_Option_box_mouse	db 'option_box_mouse',0
2281
	;sz_Version_op      db 'version_op',0
2281
	;sz_Version_op      db 'version_op',0
2282
 
2282
 
2283
	sz_edit_box_draw      db 'edit_box_draw',0
2283
	sz_edit_box_draw      db 'edit_box_draw',0
2284
	sz_edit_box_key       db 'edit_box_key',0
2284
	sz_edit_box_key       db 'edit_box_key',0
2285
	sz_edit_box_mouse     db 'edit_box_mouse',0
2285
	sz_edit_box_mouse     db 'edit_box_mouse',0
2286
	sz_edit_box_set_text  db 'edit_box_set_text',0
2286
	sz_edit_box_set_text  db 'edit_box_set_text',0
2287
	sz_scrollbar_ver_draw db 'scrollbar_v_draw',0
2287
	sz_scrollbar_ver_draw db 'scrollbar_v_draw',0
2288
	sz_scrollbar_hor_draw db 'scrollbar_h_draw',0
2288
	sz_scrollbar_hor_draw db 'scrollbar_h_draw',0
2289
 
2289
 
2290
	sz_tl_data_init db 'tl_data_init',0
2290
	sz_tl_data_init db 'tl_data_init',0
2291
	sz_tl_data_clear db 'tl_data_clear',0
2291
	sz_tl_data_clear db 'tl_data_clear',0
2292
	sz_tl_info_clear db 'tl_info_clear',0
2292
	sz_tl_info_clear db 'tl_info_clear',0
2293
	sz_tl_key db 'tl_key',0
2293
	sz_tl_key db 'tl_key',0
2294
	sz_tl_mouse db 'tl_mouse',0
2294
	sz_tl_mouse db 'tl_mouse',0
2295
	sz_tl_draw db 'tl_draw',0
2295
	sz_tl_draw db 'tl_draw',0
2296
	sz_tl_info_undo db 'tl_info_undo',0
2296
	sz_tl_info_undo db 'tl_info_undo',0
2297
	sz_tl_info_redo db 'tl_info_redo',0
2297
	sz_tl_info_redo db 'tl_info_redo',0
2298
	sz_tl_node_add db 'tl_node_add',0
2298
	sz_tl_node_add db 'tl_node_add',0
2299
	sz_tl_node_set_data db 'tl_node_set_data',0
2299
	sz_tl_node_set_data db 'tl_node_set_data',0
2300
	sz_tl_node_get_data db 'tl_node_get_data',0
2300
	sz_tl_node_get_data db 'tl_node_get_data',0
2301
	sz_tl_node_delete db 'tl_node_delete',0
2301
	sz_tl_node_delete db 'tl_node_delete',0
2302
	sz_tl_node_move_up db 'tl_node_move_up',0
2302
	sz_tl_node_move_up db 'tl_node_move_up',0
2303
	sz_tl_node_move_down db 'tl_node_move_down',0
2303
	sz_tl_node_move_down db 'tl_node_move_down',0
2304
	sz_tl_cur_beg db 'tl_cur_beg',0
2304
	sz_tl_cur_beg db 'tl_cur_beg',0
2305
	sz_tl_cur_next db 'tl_cur_next',0
2305
	sz_tl_cur_next db 'tl_cur_next',0
2306
	sz_tl_cur_perv db 'tl_cur_perv',0
2306
	sz_tl_cur_perv db 'tl_cur_perv',0
2307
	sz_tl_node_close_open db 'tl_node_close_open',0
2307
	sz_tl_node_close_open db 'tl_node_close_open',0
2308
	sz_tl_node_lev_inc db 'tl_node_lev_inc',0
2308
	sz_tl_node_lev_inc db 'tl_node_lev_inc',0
2309
	sz_tl_node_lev_dec db 'tl_node_lev_dec',0
2309
	sz_tl_node_lev_dec db 'tl_node_lev_dec',0
2310
	sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
2310
	sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
2311
	sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
2311
	sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
2312
	sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
2312
	sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
2313
 
2313
 
2314
align 4
2314
align 4
2315
mouse_dd dd 0
2315
mouse_dd dd 0
2316
last_time dd 0
2316
last_time dd 0
2317
 
2317
 
2318
align 16
2318
align 16
2319
sc system_colors 
2319
sc system_colors 
2320
 
2320
 
2321
align 16
2321
align 16
2322
procinfo process_information 
2322
procinfo process_information 
2323
 
2323
 
2324
align 4
2324
align 4
2325
buf_0: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
2325
buf_0: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
2326
.l: dw 205 ;+4 left
2326
.l: dw 205 ;+4 left
2327
.t: dw 35 ;+6 top
2327
.t: dw 35 ;+6 top
2328
.w: dd 384 ;+8 w
2328
.w: dd 384 ;+8 w
2329
.h: dd 350 ;+12 h
2329
.h: dd 350 ;+12 h
2330
.color: dd 0xffffd0 ;+16 color
2330
.color: dd 0xffffd0 ;+16 color
2331
	db 24 ;+20 bit in pixel
2331
	db 24 ;+20 bit in pixel
2332
 
2332
 
2333
align 4
2333
align 4
2334
buf_1:
2334
buf_1:
2335
	dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
2335
	dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
2336
	dd 0 ;+4 left,top
2336
	dd 0 ;+4 left,top
2337
.w: dd 0
2337
.w: dd 0
2338
.h: dd 0,0,24 ;+12 color,bit in pixel
2338
.h: dd 0,0,24 ;+12 color,bit in pixel
2339
 
2339
 
2340
font_h dd 0 ;¢ëá®â  èà¨äâ 
2340
font_h dd 0 ;¢ëá®â  èà¨äâ 
2341
 
2341
 
2342
align 4
2342
align 4
2343
buf_png:
2343
buf_png:
2344
	dd 0,0
2344
	dd 0,0
2345
.w: dd 0
2345
.w: dd 0
2346
.h: dd 0,0xffffff,24
2346
.h: dd 0,0xffffff,24
2347
 
2347
 
2348
align 4
2348
align 4
2349
el_focus dd tree1
2349
el_focus dd tree1
2350
tree1 tree_list size_one_list,1000+2, tl_key_no_edit+tl_draw_par_line,\
2350
tree1 tree_list size_one_list,1000+2, tl_key_no_edit+tl_draw_par_line,\
2351
	16,16, 0xffffff,0xb0d0ff,0x400040, 5,35,195-16,340, 16,Figure.Caption,0,\
2351
	16,16, 0xffffff,0xb0d0ff,0x400040, 5,35,195-16,340, 16,Figure.Caption,0,\
2352
	el_focus,w_scr_t1,0
2352
	el_focus,w_scr_t1,0
2353
 
2353
 
2354
align 4
2354
align 4
2355
w_scr_t1 scrollbar 16,0, 3,0, 15, 100, 0,0, 0,0,0, 1
2355
w_scr_t1 scrollbar 16,0, 3,0, 15, 100, 0,0, 0,0,0, 1
2356
 
2356
 
2357
;input:
2357
;input:
2358
; eax - ç¨á«®
2358
; eax - ç¨á«®
2359
; edi - ¡ãä¥à ¤«ï áâப¨
2359
; edi - ¡ãä¥à ¤«ï áâப¨
2360
; len - ¤«¨­­  ¡ãä¥à 
2360
; len - ¤«¨­­  ¡ãä¥à 
2361
;output:
2361
;output:
2362
align 4
2362
align 4
2363
proc convert_int_to_str uses eax ecx edx edi esi, len:dword
2363
proc convert_int_to_str uses eax ecx edx edi esi, len:dword
2364
	mov esi,[len]
2364
	mov esi,[len]
2365
	add esi,edi
2365
	add esi,edi
2366
	dec esi
2366
	dec esi
2367
	call .str
2367
	call .str
2368
	ret
2368
	ret
2369
endp
2369
endp
2370
 
2370
 
2371
align 4
2371
align 4
2372
.str:
2372
.str:
2373
	mov ecx,10
2373
	mov ecx,10
2374
	cmp eax,ecx
2374
	cmp eax,ecx
2375
	jb @f
2375
	jb @f
2376
		xor edx,edx
2376
		xor edx,edx
2377
		div ecx
2377
		div ecx
2378
		push edx
2378
		push edx
2379
		;dec edi  ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
2379
		;dec edi  ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
2380
		call .str
2380
		call .str
2381
		pop eax
2381
		pop eax
2382
	@@:
2382
	@@:
2383
	cmp edi,esi
2383
	cmp edi,esi
2384
	jge @f
2384
	jge @f
2385
		or al,0x30
2385
		or al,0x30
2386
		stosb
2386
		stosb
2387
		mov byte[edi],0 ;¢ ª®­¥æ áâப¨ áâ ¢¨¬ 0, çâ®-¡ë ­¥ ¢ë« §¨« ¬ãá®à
2387
		mov byte[edi],0 ;¢ ª®­¥æ áâப¨ áâ ¢¨¬ 0, çâ®-¡ë ­¥ ¢ë« §¨« ¬ãá®à
2388
	@@:
2388
	@@:
2389
	ret
2389
	ret
2390
 
2390
 
2391
align 4
2391
align 4
2392
proc mem_copy uses ecx esi edi, destination:dword, source:dword, len:dword
2392
proc mem_copy uses ecx esi edi, destination:dword, source:dword, len:dword
2393
	cld
2393
	cld
2394
	mov esi, dword[source]
2394
	mov esi, dword[source]
2395
	mov edi, dword[destination]
2395
	mov edi, dword[destination]
2396
	mov ecx, dword[len]
2396
	mov ecx, dword[len]
2397
	rep movsb
2397
	rep movsb
2398
	ret
2398
	ret
2399
endp
2399
endp
2400
 
2400
 
2401
align 16
2401
align 16
2402
i_end:
2402
i_end:
2403
	rb 2048
2403
	rb 2048
2404
thread_coords:
2404
thread_coords:
2405
	rb 2048
2405
	rb 2048
2406
thread_scale:
2406
thread_scale:
2407
	rb 2048
2407
	rb 2048
2408
thread_n_file:
2408
thread_n_file:
2409
	rb 2048
2409
	rb 2048
2410
stacktop:
2410
stacktop:
2411
	sys_path rb 1024
2411
	sys_path rb 1024
2412
	file_name:
2412
	file_name:
2413
		rb 1024 ;4096 
2413
		rb 1024 ;4096 
2414
	library_path rb 1024
2414
	library_path rb 1024
2415
	plugin_path rb 4096
2415
	plugin_path rb 4096
2416
	openfile_path rb 4096
2416
	openfile_path rb 4096
2417
	filename_area rb 256
2417
	filename_area rb 256
2418
mem:
2418
mem:
2419
>
2419
>
2420
>
2420
>
2421
>
2421
>
2422
>
2422
>
2423
>
2423
>