Subversion Repositories Kolibri OS

Rev

Rev 2125 | Rev 4990 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2125 Rev 2159
1
use32
1
use32
2
  org 0x0
2
  org 0x0
3
  db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
3
  db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
4
  dd 0x01
4
  dd 0x01
5
  dd start
5
  dd start
6
  dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
6
  dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
7
  dd mem
7
  dd mem
8
  dd stacktop
8
  dd stacktop
9
  dd file_name
9
  dd file_name
10
  dd sys_path
10
  dd sys_path
11
 
11
 
12
MAX_COLOR_WORD_LEN equ 40
12
MAX_COLOR_WORD_LEN equ 40
13
BUF_SIZE equ 1000 ;buffer for copy|paste
13
BUF_SIZE equ 1000 ;buffer for copy|paste
14
maxSyntaxFileSize equ 310000
14
maxSyntaxFileSize equ 310000
15
CAPT_PATH_WIDTH equ 50 ;è¨à¨­  ¯®¤¯¨á¨ ¯¥à¥¤ ⥪áâ®¢ë¬ ¯®«¥¬
15
CAPT_PATH_WIDTH equ 50 ;è¨à¨­  ¯®¤¯¨á¨ ¯¥à¥¤ ⥪áâ®¢ë¬ ¯®«¥¬
16
 
16
 
17
include '../../macros.inc'
17
include '../../macros.inc'
18
include '../../proc32.inc'
18
include '../../proc32.inc'
19
include '../../develop/libraries/box_lib/load_lib.mac'
19
include '../../develop/libraries/box_lib/load_lib.mac'
20
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
20
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
21
include '../t_edit/mem.inc'
21
include '../t_edit/mem.inc'
22
include 'te_data.inc'
22
include 'te_data.inc'
23
include 'te_work.inc' ;text work functions
23
include 'te_work.inc' ;text work functions
24
 
24
 
25
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,0
25
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,0
26
 
26
 
27
align 4
27
align 4
28
start:
28
start:
29
  mov eax,48
29
  mov eax,48
30
  mov ebx,3
30
  mov ebx,3
31
  mov ecx,sc
31
  mov ecx,sc
32
  mov edx,sizeof.system_colors
32
  mov edx,sizeof.system_colors
33
  mcall
33
  mcall
34
 
34
 
35
  mcall 68,11
35
  mcall 68,11
36
  or eax,eax
36
  or eax,eax
37
  jz button.exit
37
  jz button.exit
38
 
38
 
39
  mcall 40,0x27
39
  mcall 40,0x27
40
 
40
 
41
;-------------------------------------------------
41
;-------------------------------------------------
42
  mov ecx,maxSyntaxFileSize
42
  mov ecx,maxSyntaxFileSize
43
  stdcall mem.Alloc,ecx
43
  stdcall mem.Alloc,ecx
44
  mov [options_file],eax
44
  mov [options_file],eax
45
  mov [options_file_end],eax
45
  mov [options_file_end],eax
46
  add [options_file_end],ecx
46
  add [options_file_end],ecx
47
 
47
 
48
 
48
 
49
load_libraries l_libs_start,load_lib_end
49
load_libraries l_libs_start,load_lib_end
50
 
50
 
51
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  «¨¡ 
51
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  «¨¡ 
52
	mov	ebp,lib0
52
	mov	ebp,lib0
53
	cmp	dword [ebp+ll_struc_size-4],0
53
	cmp	dword [ebp+ll_struc_size-4],0
54
	jz	@f
54
	jz	@f
55
	mcall	-1	;exit not correct
55
	mcall	-1	;exit not correct
56
@@:
56
@@:
57
 
57
 
58
;---------------------------------------------------------------------
58
;---------------------------------------------------------------------
59
  stdcall dword[tl_data_init],dword tree1
59
  stdcall dword[tl_data_init],dword tree1
60
  copy_path fn_icon_tl_sys,sys_path,file_name,0
60
  copy_path fn_icon_tl_sys,sys_path,file_name,0
61
 
61
 
62
  mov ecx,3*256*13
62
  mov ecx,3*256*13
63
  stdcall mem.Alloc,ecx
63
  stdcall mem.Alloc,ecx
64
  mov dword[tree1.data_img_sys],eax
64
  mov dword[tree1.data_img_sys],eax
65
 
65
 
66
  mov [run_file_70.Function], 0
66
  mov [run_file_70.Function], 0
67
  mov [run_file_70.Position], 54
67
  mov [run_file_70.Position], 54
68
  mov [run_file_70.Flags], 0
68
  mov [run_file_70.Flags], 0
69
  mov [run_file_70.Count], ecx
69
  mov [run_file_70.Count], ecx
70
  mov [run_file_70.Buffer], eax
70
  mov [run_file_70.Buffer], eax
71
  mov byte[run_file_70+20], 0
71
  mov byte[run_file_70+20], 0
72
  mov [run_file_70.FileName], file_name
72
  mov [run_file_70.FileName], file_name
73
 
73
 
74
  mov eax,70 ;load icon file
74
  mov eax,70 ;load icon file
75
  mov ebx,run_file_70
75
  mov ebx,run_file_70
76
  int 0x40
76
  int 0x40
77
  cmp ebx,0
77
  cmp ebx,0
78
  jg @f
78
  jg @f
79
    mov dword[tree1.data_img_sys],0
79
    mov dword[tree1.data_img_sys],0
80
  @@:
80
  @@:
81
;---------------------------------------------------------------------
81
;---------------------------------------------------------------------
82
; ç¨â ¥¬ bmp ä ©« á ¨ª®­ª ¬¨ 㧫®¢
82
; ç¨â ¥¬ bmp ä ©« á ¨ª®­ª ¬¨ 㧫®¢
83
  copy_path fn_icon_tl_nod,sys_path,file_name,0
83
  copy_path fn_icon_tl_nod,sys_path,file_name,0
84
 
84
 
85
  mov ecx,3*256*2
85
  mov ecx,3*256*2
86
  stdcall mem.Alloc,ecx
86
  stdcall mem.Alloc,ecx
87
  mov dword[tree1.data_img],eax
87
  mov dword[tree1.data_img],eax
88
 
88
 
89
;  mov [run_file_70.Function], 0
89
;  mov [run_file_70.Function], 0
90
;  mov [run_file_70.Position], 54
90
;  mov [run_file_70.Position], 54
91
;  mov [run_file_70.Flags], 0
91
;  mov [run_file_70.Flags], 0
92
  mov [run_file_70.Count], ecx
92
  mov [run_file_70.Count], ecx
93
  mov [run_file_70.Buffer], eax
93
  mov [run_file_70.Buffer], eax
94
;  mov byte[run_file_70+20], 0
94
;  mov byte[run_file_70+20], 0
95
;  mov [run_file_70.FileName], file_name
95
;  mov [run_file_70.FileName], file_name
96
 
96
 
97
  mov eax,70 ;load icon file
97
  mov eax,70 ;load icon file
98
  mov ebx,run_file_70
98
  mov ebx,run_file_70
99
  int 0x40
99
  int 0x40
100
  cmp ebx,0
100
  cmp ebx,0
101
  jg @f
101
  jg @f
102
    mov dword[tree1.data_img],0
102
    mov dword[tree1.data_img],0
103
  @@:
103
  @@:
104
;------------------------------------------------------------------------------
104
;------------------------------------------------------------------------------
105
  copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
105
  copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
106
  mov eax,70
106
  mov eax,70
107
  mov ebx,tree_file_struct
107
  mov ebx,tree_file_struct
108
  int 0x40
108
  int 0x40
109
 
109
 
110
cmp ebx,-1
110
cmp ebx,-1
111
je .end_dir_init
111
je .end_dir_init
112
 
112
 
113
  mov eax,dir_mem
113
  mov eax,dir_mem
114
  add eax,32+4+1+3+4*6+8
114
  add eax,32+4+1+3+4*6+8
115
mov ecx,ebx
115
mov ecx,ebx
116
@@:
116
@@:
117
  cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
117
  cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
118
  je .filter
118
  je .filter
119
    push dword tree1
119
    push dword tree1
120
    push dword 0x10000 ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
120
    push dword 0x10000 ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
121
    push dword eax
121
    push dword eax
122
    call dword[tl_node_add]
122
    call dword[tl_node_add]
123
 
123
 
124
    stdcall dword[tl_cur_next],tree1
124
    stdcall dword[tl_cur_next],tree1
125
  .filter:
125
  .filter:
126
  add eax,304
126
  add eax,304
127
  loop @b
127
  loop @b
128
  stdcall dword[tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
128
  stdcall dword[tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
129
.end_dir_init:
129
.end_dir_init:
130
 
130
 
131
;--- load color option file ---
131
;--- load color option file ---
132
stdcall [ted_init], tedit0
132
stdcall [ted_init], tedit0
133
mov byte[file_name],0
133
mov byte[file_name],0
134
 
134
 
135
align 4
135
align 4
136
red_win:
136
red_win:
137
	call draw_window
137
	call draw_window
138
 
138
 
139
align 4
139
align 4
140
still:
140
still:
141
  mcall 10
141
  mcall 10
142
 
142
 
143
  cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
143
  cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
144
  jz red_win
144
  jz red_win
145
  cmp al,2
145
  cmp al,2
146
  jz key
146
  jz key
147
  cmp al,3
147
  cmp al,3
148
  jz button
148
  jz button
149
  cmp al,6
149
  cmp al,6
150
  jz mouse
150
  jz mouse
151
 
151
 
152
  jmp still
152
  jmp still
153
 
153
 
154
 
154
 
155
align 4
155
align 4
156
draw_window:
156
draw_window:
157
	pushad
157
	pushad
158
	mcall 12,1
158
	mcall 12,1
159
 
159
 
160
	mov edx,[sc.work]
160
	mov edx,[sc.work]
161
	or  edx,0x33000000
161
	or  edx,0x33000000
162
	mov edi,hed
162
	mov edi,hed
163
	mcall 0,<10,555>,<10,333>
163
	mcall 0,<10,555>,<10,333>
164
 
164
 
165
	mcall 9,procinfo,-1
165
	mcall 9,procinfo,-1
166
 
166
 
167
	mov eax,8 ;ª­®¯ª 
167
	mov eax,8 ;ª­®¯ª 
168
	mov ebx,5*65536+90
168
	mov ebx,5*65536+90
169
	mov ecx,195*65536+20
169
	mov ecx,195*65536+20
170
	mov edx,200
170
	mov edx,200
171
	mov esi,[sc.work_button];0xd0
171
	mov esi,[sc.work_button];0xd0
172
	mcall
172
	mcall
173
 
173
 
174
	;mov eax,8
174
	;mov eax,8
175
	mov ebx,100*65536+85
175
	mov ebx,100*65536+85
176
	mov ecx,195*65536+20
176
	mov ecx,195*65536+20
177
	mov edx,201
177
	mov edx,201
178
	mov esi,0xd00000
178
	mov esi,0xd00000
179
	mcall
179
	mcall
180
 
180
 
181
	mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
181
	mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
182
	mov ebx,10*65536+200
182
	mov ebx,10*65536+200
183
	mov ecx,[sc.work_button_text]
183
	mov ecx,[sc.work_button_text]
184
	or  ecx,0x80000000
184
	or  ecx,0x80000000
185
	mov edx,txt122
185
	mov edx,txt122
186
	mcall
186
	mcall
187
 
187
 
188
	mov ebx,105*65536+200
188
	mov ebx,105*65536+200
189
	mov ecx,0xffff00
189
	mov ecx,0xffff00
190
	or  ecx,0x80000000
190
	or  ecx,0x80000000
191
	mov edx,txt148
191
	mov edx,txt148
192
	mcall
192
	mcall
193
 
193
 
194
	mov ebx,195*65536+10
194
	mov ebx,195*65536+10
195
	mov ecx,[sc.work_text]
195
	mov ecx,[sc.work_text]
196
	or  ecx,0x80000000
196
	or  ecx,0x80000000
197
	mov edx,txt_inp_file
197
	mov edx,txt_inp_file
198
	int 0x40
198
	int 0x40
199
 
199
 
200
	add ebx,20
200
	add ebx,20
201
	mov edx,txt_out_file
201
	mov edx,txt_out_file
202
	int 0x40
202
	int 0x40
203
 
203
 
204
	push dword PathShow_data_1
204
	push dword PathShow_data_1
205
	call [PathShow_draw]
205
	call [PathShow_draw]
206
	
206
	
207
	stdcall [edit_box_draw],dword edit1
207
	stdcall [edit_box_draw],dword edit1
208
	stdcall [tl_draw],dword tree1
208
	stdcall [tl_draw],dword tree1
209
 
209
 
210
	;scroll 1
210
	;scroll 1
211
	mov [ws_dir_lbox.all_redraw],1
211
	mov [ws_dir_lbox.all_redraw],1
212
	stdcall [scrollbar_ver_draw],dword ws_dir_lbox
212
	stdcall [scrollbar_ver_draw],dword ws_dir_lbox
213
	stdcall [ted_draw], tedit0
213
	stdcall [ted_draw], tedit0
214
 
214
 
215
	mcall 12,2
215
	mcall 12,2
216
	popad
216
	popad
217
	ret
217
	ret
218
 
218
 
219
align 4
219
align 4
220
mouse:
220
mouse:
221
	stdcall [tl_mouse],tree1
221
	stdcall [tl_mouse],tree1
222
	stdcall [edit_box_mouse],edit1
222
	stdcall [edit_box_mouse],edit1
223
	stdcall [ted_mouse], tedit0
223
	stdcall [ted_mouse], tedit0
224
	jmp still
224
	jmp still
225
 
225
 
226
 
226
 
227
align 4
227
align 4
228
key:
228
key:
229
	mcall 2
229
	mcall 2
230
	stdcall [tl_key],tree1
230
	stdcall [tl_key],tree1
231
	stdcall [edit_box_key],edit1
231
	stdcall [edit_box_key],edit1
232
;;;stdcall [ted_key], tedit0, conv_tabl,esi
232
;;;stdcall [ted_key], tedit0, conv_tabl,esi
233
	jmp still
233
	jmp still
234
 
234
 
235
align 4
235
align 4
236
button:
236
button:
237
;  cmp [menu_active],1 ;¥á«¨ ­ ¦ «¨ ¬¥­î, â® á­ ç «  ॠªæ¨ï ­  ¬¥­î
237
;  cmp [menu_active],1 ;¥á«¨ ­ ¦ «¨ ¬¥­î, â® á­ ç «  ॠªæ¨ï ­  ¬¥­î
238
;  jne @f ;mouse.menu_bar_1
238
;  jne @f ;mouse.menu_bar_1
239
;    mov [menu_active],0
239
;    mov [menu_active],0
240
;    jmp still
240
;    jmp still
241
;  @@:
241
;  @@:
242
 
242
 
243
  mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
243
  mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
244
 
244
 
245
  cmp ah,200
245
  cmp ah,200
246
  jne @f
246
  jne @f
247
    call but_OpenSyntax
247
    call but_OpenSyntax
248
  @@:
248
  @@:
249
  cmp ah,201
249
  cmp ah,201
250
  jne @f
250
  jne @f
251
    call but_SaveSyntax
251
    call but_SaveSyntax
252
  @@:
252
  @@:
253
 
253
 
254
  cmp ah,1
254
  cmp ah,1
255
  jne still
255
  jne still
256
.exit:
256
.exit:
257
  ;push eax
257
  ;push eax
258
 
258
 
259
  stdcall mem.Free,[options_file]
259
  stdcall mem.Free,[options_file]
260
 
260
 
261
  stdcall [tl_data_clear], tree1
261
  stdcall [tl_data_clear], tree1
262
  stdcall [ted_delete], tedit0
262
  stdcall [ted_delete], tedit0
263
  mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
263
  mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
264
 
264
 
265
align 4
265
align 4
266
but_OpenSyntax:
266
but_OpenSyntax:
267
  stdcall [tl_node_get_data],tree1
267
  stdcall [tl_node_get_data],tree1
268
  pop dword [fn_col_option]
268
  pop dword [fn_col_option]
269
  call InitColText
269
  call InitColText
270
  ret
270
  ret
271
 
271
 
272
align 4
272
align 4
273
but_SaveSyntax:
273
but_SaveSyntax:
274
	stdcall [ted_but_save_file], tedit0,run_file_70,[edit1.text]
274
	stdcall [ted_but_save_file], tedit0,run_file_70,[edit1.text]
275
	ret
275
	ret
276
 
276
 
277
align 4
277
align 4
278
but_ctrl_o:
278
but_ctrl_o:
279
	push eax
279
	push eax
280
	call get_wnd_in_focus
280
	call get_wnd_in_focus
281
	cmp eax,0
281
	cmp eax,0
282
	je @f
282
	je @f
283
		stdcall [ted_open_file], eax,str_file_70,[edit1.text]
283
		stdcall [ted_open_file], eax,str_file_70,[edit1.text]
284
	@@:
284
	@@:
285
	pop eax
285
	pop eax
286
	ret
286
	ret
287
 
287
 
288
;ᮧ¤ ­¨¥ ­®¢®£® ä ©« 
288
;ᮧ¤ ­¨¥ ­®¢®£® ä ©« 
289
align 4
289
align 4
290
but_ctrl_n:
290
but_ctrl_n:
291
	push eax
291
	push eax
292
	call get_wnd_in_focus
292
	call get_wnd_in_focus
293
	cmp eax,0
293
	cmp eax,0
294
	je @f
294
	je @f
295
		stdcall [ted_clear], eax,1
295
		stdcall [ted_clear], eax,1
296
		stdcall [ted_draw], eax
296
		stdcall [ted_draw], eax
297
	@@:
297
	@@:
298
	pop eax
298
	pop eax
299
	ret
299
	ret
300
 
300
 
301
;®¯à¥¤¥«ï¥¬ ª ª®¥ ¨§ ®ª®­ । ªâ®à  ¢ 䮪ãá¥
301
;®¯à¥¤¥«ï¥¬ ª ª®¥ ¨§ ®ª®­ । ªâ®à  ¢ 䮪ãá¥
302
align 4
302
align 4
303
get_wnd_in_focus:
303
get_wnd_in_focus:
304
	xor eax,eax
304
	xor eax,eax
305
	cmp dword[el_focus],tedit0
305
	cmp dword[el_focus],tedit0
306
	jne @f
306
	jne @f
307
		mov eax,tedit0
307
		mov eax,tedit0
308
	@@:
308
	@@:
309
	;cmp dword[el_focus],tedit1
309
	;cmp dword[el_focus],tedit1
310
	;jne @f
310
	;jne @f
311
	;       mov eax,tedit1
311
	;       mov eax,tedit1
312
	;@@:
312
	;@@:
313
	ret
313
	ret
314
 
314
 
315
hed db 'TextEditor syntax file converter 26.08.11',0 ;¯®¤¯¨áì ®ª­ 
315
hed db 'TextEditor syntax file converter 06.09.11',0 ;¯®¤¯¨áì ®ª­ 
316
 
316
 
317
txt122 db '‡ £à. ä ©«',0
317
txt122 db '‡ £à. ä ©«',0
318
txt148 db '‘®åà. ä ©«',0
318
txt148 db '‘®åà. ä ©«',0
319
txt_inp_file db 'ˆáå. ä ©«:',0
319
txt_inp_file db 'ˆáå. ä ©«:',0
320
txt_out_file db '‚ëå. ä ©«:',0
320
txt_out_file db '‚ëå. ä ©«:',0
321
 
321
 
322
err_message_found_lib0	 db 'Sorry I cannot found library box_lib.obj',0
322
err_message_found_lib0	 db 'Sorry I cannot found library box_lib.obj',0
323
head_f_i0:
323
head_f_i0:
324
head_f_l0	  db 'System error',0
324
head_f_l0	  db 'System error',0
325
err_message_import0	 db 'Error on load import library box_lib.obj',0
325
err_message_import0	 db 'Error on load import library box_lib.obj',0
326
err_message_found_lib1	db 'Sorry I cannot found library msgbox.obj',0
326
err_message_found_lib1	db 'Sorry I cannot found library msgbox.obj',0
327
 
327
 
328
;library structures
328
;library structures
329
l_libs_start:
329
l_libs_start:
330
  lib0 l_libs boxlib_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l0, boxlib_import,err_message_import0, head_f_i0
330
  lib0 l_libs boxlib_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l0, boxlib_import,err_message_import0, head_f_i0
331
load_lib_end:
331
load_lib_end:
332
 
332
 
333
 
333
 
334
i_end:
334
i_end:
335
	rb 1024
335
	rb 1024
336
	align 16
336
	align 16
337
	procinfo process_information
337
	procinfo process_information
338
	thread:
338
	thread:
339
		rb 1024
339
		rb 1024
340
stacktop:
340
stacktop:
341
  sys_path:
341
  sys_path:
342
    rb 4096
342
    rb 4096
343
  file_name:
343
  file_name:
344
    rb 4096
344
    rb 4096
345
  file_name_rez:
345
  file_name_rez:
346
    rb 4096
346
    rb 4096
347
mem:
347
mem: