Rev 7786 | Rev 9531 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
341 | heavyiron | 1 | ; RDsave для Kolibri (0.6.5.0 и старше) |
4213 | heavyiron | 2 | ; Save RAM-disk to hard or floppy drive |
1606 | mario79 | 3 | ;--------------------------------------------------------------------- |
205 | heavyiron | 4 | ; Mario79 2005 |
341 | heavyiron | 5 | ; Heavyiron 12.02.2007 |
1070 | Lrz | 6 | ; |
4213 | heavyiron | 7 | ; Mario79 08.09.2010 - select path with OpenDialog,keys 1,2,3,4 for select options |
8 | ; Heavyiron 01.12.2013 - new logic |
||
341 | heavyiron | 9 | ;--------------------------------------------------------------------- |
205 | heavyiron | 10 | appname equ 'RDsave ' |
4319 | heavyiron | 11 | version equ '1.43' |
4810 | eAndrew | 12 | debug equ no |
3634 | fedesco | 13 | |
4810 | eAndrew | 14 | use32 ; включить 32-битный режим ассемблера |
4213 | heavyiron | 15 | org 0x0 ; адресация с нуля |
205 | heavyiron | 16 | |
4810 | eAndrew | 17 | db 'MENUET01' ; 8-байтный идентификатор MenuetOS |
18 | dd 0x01 ; версия заголовка (всегда 1) |
||
19 | dd START ; адрес первой команды |
||
20 | dd IM_END ; размер программы |
||
21 | dd I_END ; количество памяти |
||
22 | dd stacktop ; адрес вершины стека |
||
23 | dd PARAMS ; адрес буфера для параметров |
||
4213 | heavyiron | 24 | dd cur_dir_path |
205 | heavyiron | 25 | |
4213 | heavyiron | 26 | |
27 | include 'lang.inc' |
||
28 | include '../../../macros.inc' |
||
29 | if debug eq yes |
||
30 | include '../../../debug.inc' |
||
31 | end if |
||
32 | include '../../../proc32.inc' |
||
33 | include '../../../dll.inc' |
||
1111 | Lrz | 34 | include '../../../develop/libraries/box_lib/load_lib.mac' |
1373 | IgorA | 35 | include '../../../develop/libraries/box_lib/trunk/box_lib.mac' |
4213 | heavyiron | 36 | include 'str.inc' |
1070 | Lrz | 37 | |
4810 | eAndrew | 38 | @use_library |
341 | heavyiron | 39 | ;--------------------------------------------------------------------- |
40 | ;--- НАЧАЛО ПРОГРАММЫ ---------------------------------------------- |
||
41 | ;--------------------------------------------------------------------- |
||
1070 | Lrz | 42 | align 4 |
43 | START: |
||
4213 | heavyiron | 44 | ;--------------------------------------------------------------------- |
4810 | eAndrew | 45 | mcall 68,11 |
1606 | mario79 | 46 | |
47 | load_libraries l_libs_start,end_l_libs |
||
4810 | eAndrew | 48 | inc eax |
49 | test eax,eax |
||
50 | jz close |
||
1606 | mario79 | 51 | |
4810 | eAndrew | 52 | stdcall dll.Init,[init_lib] |
205 | heavyiron | 53 | |
4810 | eAndrew | 54 | invoke ini_get_int,ini_file,asettings,aautoclose,0 |
55 | mov [autoclose],eax |
||
56 | invoke ini_get_str,ini_file,apath,apath,fname_buf,4096,path |
||
57 | stdcall _lstrcpy,ini_path,fname_buf |
||
58 | stdcall _lstrcpy,filename_area,start_temp_file_name |
||
4213 | heavyiron | 59 | |
4810 | eAndrew | 60 | mov eax,PARAMS |
61 | cmp byte[eax], 0 |
||
62 | je no_params |
||
63 | cmp byte[eax], 'h' |
||
64 | je @f |
||
65 | cmp byte[eax], 'H' |
||
66 | jne .no_h |
||
1606 | mario79 | 67 | @@: |
4810 | eAndrew | 68 | mov [hidden],1 |
69 | jmp no_params |
||
4213 | heavyiron | 70 | .no_h: |
4810 | eAndrew | 71 | mov [param],1 |
72 | stdcall _lstrcpy,fname_buf,eax |
||
73 | mov ah,2 |
||
74 | jmp noclose |
||
1228 | Lrz | 75 | |
4270 | heavyiron | 76 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 77 | no_params: |
4810 | eAndrew | 78 | stdcall _lstrcpy,check_dir,ini_path |
79 | call check_path |
||
80 | test eax,eax |
||
81 | jz path_ok |
||
82 | cmp eax,6 |
||
83 | je path_ok |
||
4213 | heavyiron | 84 | ;--------------------------------------------------------------------- |
85 | if debug eq yes |
||
86 | dps 'read_folder_error' |
||
87 | newline |
||
88 | end if |
||
89 | ;--------------------------------------------------------------------- |
||
4290 | heavyiron | 90 | default_path: |
4810 | eAndrew | 91 | stdcall _lstrcpy,fname_buf,communication_area_default_path |
92 | mov [hidden],0 |
||
4213 | heavyiron | 93 | |
94 | ;OpenDialog initialisation |
||
4810 | eAndrew | 95 | push dword OpenDialog_data |
96 | call [OpenDialog_Init] |
||
4213 | heavyiron | 97 | |
1606 | mario79 | 98 | ; prepare for PathShow |
4810 | eAndrew | 99 | push dword PathShow_data_1 |
100 | call [PathShow_prepare] |
||
4290 | heavyiron | 101 | |
4810 | eAndrew | 102 | mcall 40,0x00000027 |
4290 | heavyiron | 103 | |
4810 | eAndrew | 104 | call draw_window |
105 | mov ah,3 |
||
106 | jmp noclose |
||
4213 | heavyiron | 107 | ;--------------------------------------------------------------------- |
108 | path_ok: |
||
109 | ;OpenDialog initialisation |
||
4810 | eAndrew | 110 | push dword OpenDialog_data |
111 | call [OpenDialog_Init] |
||
1606 | mario79 | 112 | |
4213 | heavyiron | 113 | ; prepare for PathShow |
4810 | eAndrew | 114 | push dword PathShow_data_1 |
115 | call [PathShow_prepare] |
||
205 | heavyiron | 116 | |
4810 | eAndrew | 117 | mcall 40,0x00000027 |
4213 | heavyiron | 118 | |
4810 | eAndrew | 119 | cmp [hidden],1 |
120 | jne red |
||
121 | mov ah,2 |
||
122 | jmp noclose |
||
4213 | heavyiron | 123 | red: |
4810 | eAndrew | 124 | call draw_window |
341 | heavyiron | 125 | ;--------------------------------------------------------------------- |
126 | still: |
||
4810 | eAndrew | 127 | mcall 10 |
205 | heavyiron | 128 | |
4810 | eAndrew | 129 | dec eax ; перерисовать окно? |
130 | jz red ; если да - на метку red |
||
131 | dec eax |
||
132 | jz key |
||
133 | dec eax |
||
134 | jz button |
||
135 | jmp still |
||
1606 | mario79 | 136 | ;--------------------------------------------------------------------- |
341 | heavyiron | 137 | button: |
4810 | eAndrew | 138 | mcall 17 ; получить идентификатор нажатой кнопки |
139 | cmp ah,1 ; кнопка с id=1("закрыть")? |
||
140 | jne noclose |
||
1070 | Lrz | 141 | close: |
4810 | eAndrew | 142 | mcall -1 ; функция -1: завершить программу |
143 | |||
4213 | heavyiron | 144 | ;--------------------------------------------------------------------- |
145 | key: |
||
4810 | eAndrew | 146 | mcall 2 |
147 | cmp ah,0x1b |
||
148 | je close |
||
149 | cmp ah,0x0D |
||
150 | jne @f |
||
151 | mov ah,2 |
||
152 | jmp noclose |
||
4213 | heavyiron | 153 | @@: |
4810 | eAndrew | 154 | cmp ah,9h |
155 | jne still |
||
4213 | heavyiron | 156 | ;--------------------------------------------------------------------- |
341 | heavyiron | 157 | noclose: |
4810 | eAndrew | 158 | mov ecx,fname_buf |
159 | push 16 |
||
160 | mov ebx,1 |
||
161 | cmp byte[ecx+1],'f' |
||
162 | je @f |
||
163 | cmp byte[ecx+1],'F' |
||
164 | jne not_fdd |
||
4213 | heavyiron | 165 | @@: |
4810 | eAndrew | 166 | cmp byte[ecx+4],'1' |
167 | jne @f |
||
168 | cmp ah,2 |
||
169 | je doit |
||
4213 | heavyiron | 170 | @@: |
4810 | eAndrew | 171 | inc ebx |
172 | cmp ah,2 |
||
173 | je doit |
||
4213 | heavyiron | 174 | not_fdd: |
4810 | eAndrew | 175 | push 18 |
176 | mov ebx,6 ; 18.6 = save to specified folder |
||
177 | cmp ah,2 |
||
178 | je doit |
||
1606 | mario79 | 179 | |
180 | ; invoke OpenDialog |
||
4810 | eAndrew | 181 | push dword OpenDialog_data |
182 | call [OpenDialog_Start] |
||
183 | cmp [OpenDialog_data.status],1 |
||
184 | jne still |
||
1606 | mario79 | 185 | |
186 | ; prepare for PathShow |
||
4810 | eAndrew | 187 | push dword PathShow_data_1 |
188 | call [PathShow_prepare] |
||
189 | call draw_window |
||
190 | mov ah,2 |
||
191 | jmp noclose |
||
1606 | mario79 | 192 | |
4213 | heavyiron | 193 | doit: |
4810 | eAndrew | 194 | cmp [param],0 |
195 | jne @f |
||
196 | call save_ini |
||
4270 | heavyiron | 197 | @@: |
4810 | eAndrew | 198 | cmp byte[ecx+1],'r' |
199 | je @f |
||
200 | cmp byte[ecx+1],'R' |
||
5142 | Heavyiron | 201 | je @f |
202 | cmp byte[ecx],'/' |
||
203 | je not_rd |
||
4270 | heavyiron | 204 | @@: |
4810 | eAndrew | 205 | mov edx,rdError |
206 | call print_err |
||
207 | jmp still |
||
4290 | heavyiron | 208 | not_rd: |
4810 | eAndrew | 209 | cmp [hidden],0 |
210 | jne @f |
||
211 | pusha |
||
212 | stdcall _lstrcpy,msg,label2 |
||
213 | mov eax,[sc.work_text] |
||
214 | or eax,0xc0000088 |
||
215 | mov [color],eax |
||
216 | call print_msg |
||
217 | popa |
||
4270 | heavyiron | 218 | @@: |
4810 | eAndrew | 219 | pop eax |
220 | mcall |
||
221 | call check_for_error |
||
222 | jmp still |
||
1606 | mario79 | 223 | |
224 | ;--------------------------------------------------------------------- |
||
4810 | eAndrew | 225 | check_for_error: ;Обработчик ошибок |
226 | test eax,eax |
||
227 | jz print_ok |
||
228 | cmp ebx,6 |
||
229 | je @f |
||
230 | mov edx,error11 |
||
231 | jmp print_err |
||
232 | @@: |
||
233 | cmp eax, 11 |
||
234 | ja .unknown |
||
235 | mov edx, [errors+eax*4] |
||
236 | stdcall _lstrcpy,msg,error |
||
237 | stdcall _lstrcat,msg,edx |
||
238 | mov edx,msg |
||
239 | jmp print_err |
||
4213 | heavyiron | 240 | .unknown: |
4810 | eAndrew | 241 | mov edx, aUnknownError |
4290 | heavyiron | 242 | |
4213 | heavyiron | 243 | print_err: |
4810 | eAndrew | 244 | stdcall _lstrlen,ini_path |
245 | pusha |
||
246 | invoke ini_set_str,ini_file,apath,apath,ini_path,eax |
||
247 | popa |
||
248 | stdcall _lstrcpy,msg,edx |
||
249 | cmp [hidden],1 |
||
250 | je @f |
||
251 | cmp [param],1 |
||
252 | je @f |
||
253 | mov ecx,[sc.work_text] |
||
254 | or ecx,0xc0880000 |
||
255 | mov [color],ecx |
||
256 | call print_msg |
||
257 | ret |
||
4270 | heavyiron | 258 | @@: |
4810 | eAndrew | 259 | stdcall _lstrcpy, ntf_msg, ntf_start |
260 | stdcall _lstrcat, ntf_msg, edx |
||
261 | stdcall _lstrcat, ntf_msg, ntf_end_e |
||
262 | mov dword [is_notify + 8], ntf_msg |
||
263 | mcall 70, is_notify |
||
264 | mov [param],0 |
||
265 | mov [hidden],0 |
||
266 | stdcall _lstrcpy,fname_buf,ini_path |
||
267 | jmp no_params |
||
4290 | heavyiron | 268 | |
4213 | heavyiron | 269 | print_ok: |
4810 | eAndrew | 270 | cmp [hidden],1 |
271 | je @f |
||
272 | cmp [param],1 |
||
273 | je @f |
||
274 | stdcall _lstrcpy,msg,ok |
||
275 | mov ecx,[sc.work_text] |
||
276 | or ecx,0xc0008800 |
||
277 | mov [color],ecx |
||
278 | call print_msg |
||
279 | mcall 5,100 |
||
280 | cmp [autoclose],1 |
||
281 | je close |
||
282 | ret |
||
4319 | heavyiron | 283 | @@: |
4810 | eAndrew | 284 | stdcall _lstrcpy,msg,ok |
285 | stdcall _lstrcat,msg,fname_buf |
||
286 | stdcall _lstrcpy, ntf_msg, ntf_start |
||
287 | stdcall _lstrcat, ntf_msg, msg |
||
288 | stdcall _lstrcat, ntf_msg, ntf_end_o |
||
4811 | eAndrew | 289 | mov edx,ntf_msg |
4810 | eAndrew | 290 | mov dword [is_notify + 8], edx |
291 | mcall 70, is_notify |
||
292 | mcall 5,100 |
||
293 | jmp close |
||
4319 | heavyiron | 294 | ;--------------------------------------------------------------------- |
295 | print_msg: |
||
4810 | eAndrew | 296 | mcall 13,<5,380>,<96,10>,[sc.work] |
297 | stdcall _lstrlen,msg |
||
298 | lea eax,[eax+eax*2] |
||
299 | add eax,eax |
||
300 | mov ebx,390 |
||
301 | sub ebx,eax |
||
302 | shl ebx,15 |
||
303 | add ebx,96 |
||
304 | mcall 4, ,[color],msg, ,[sc.work] |
||
305 | ret |
||
1606 | mario79 | 306 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 307 | draw_PathShow: |
4810 | eAndrew | 308 | pusha |
309 | mcall 13,<15,280>,<32,16>,0xffffff |
||
310 | push dword PathShow_data_1 |
||
311 | call [PathShow_draw] |
||
312 | popa |
||
313 | ret |
||
1606 | mario79 | 314 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 315 | save_ini: |
4810 | eAndrew | 316 | pusha |
317 | stdcall _lstrlen,fname_buf |
||
318 | invoke ini_set_str,ini_file,apath,apath,fname_buf,eax |
||
319 | invoke ini_set_int,ini_file,asettings,aautoclose,[autoclose] |
||
320 | popa |
||
321 | ret |
||
341 | heavyiron | 322 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 323 | check_path: |
4810 | eAndrew | 324 | stdcall _lstrlen,check_dir |
325 | add eax,check_dir |
||
4213 | heavyiron | 326 | @@: |
4810 | eAndrew | 327 | dec eax |
328 | cmp byte [eax],'/' |
||
329 | jne @b |
||
330 | mov byte [eax+1],0 |
||
4213 | heavyiron | 331 | |
4810 | eAndrew | 332 | mcall 70,read_folder |
333 | ret |
||
1606 | mario79 | 334 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 335 | ;--- Draw window --------------------------------------------------- |
341 | heavyiron | 336 | ;--------------------------------------------------------------------- |
205 | heavyiron | 337 | draw_window: |
5142 | Heavyiron | 338 | mcall 48,3,sc,sizeof.system_colors |
4810 | eAndrew | 339 | mcall 12,1 |
205 | heavyiron | 340 | |
9035 | leency | 341 | mcall 48,4 |
342 | mov ecx,200*65536+111 |
||
343 | add ecx,eax |
||
205 | heavyiron | 344 | |
9035 | leency | 345 | mov edx,[sc.work] |
346 | or edx,0x34000000 |
||
347 | mcall 0,<200,400>,, , ,title |
||
348 | |||
4213 | heavyiron | 349 | ;buttons |
4810 | eAndrew | 350 | mcall 8,<198,70>,<68,20>,1,[sc.work_button] |
351 | inc edx |
||
352 | mcall ,<125,70>, |
||
353 | inc edx |
||
354 | mcall ,<300,75>,<30,20> |
||
1070 | Lrz | 355 | |
4213 | heavyiron | 356 | ;labels |
4810 | eAndrew | 357 | mov ecx,[sc.work_button_text] |
358 | or ecx,0x80000000 |
||
359 | mcall 4,<134,75>, ,save |
||
360 | mcall ,<215,75>, ,cancel |
||
361 | mcall ,<315,36>, ,select |
||
205 | heavyiron | 362 | |
7548 | leency | 363 | m2m dword [frame_data.font_backgr_color],[sc.work] |
364 | m2m dword [frame_data.font_color],[sc.work_text] |
||
365 | m2m dword [frame_data.ext_fr_col],[sc.work_graph] |
||
7786 | leency | 366 | m2m dword [frame_data.int_fr_col],[sc.work_light] |
7548 | leency | 367 | |
4810 | eAndrew | 368 | push dword frame_data |
369 | call [Frame_draw] |
||
205 | heavyiron | 370 | |
4810 | eAndrew | 371 | call draw_PathShow |
372 | call print_msg |
||
205 | heavyiron | 373 | |
4810 | eAndrew | 374 | mcall 12,2 |
375 | ret |
||
376 | |||
341 | heavyiron | 377 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 378 | ;--- Data ---------------------------------------------------------- |
1606 | mario79 | 379 | ;--------------------------------------------------------------------- |
205 | heavyiron | 380 | if lang eq ru |
4810 | eAndrew | 381 | save db 'Сохранить',0 |
382 | cancel db 'Отмена',0 |
||
383 | select db 'Изменить',0 |
||
384 | label1 db ' Образ будет сохранен в: ',0 |
||
385 | label2 db 'Сохранение образа...',0 |
||
386 | ok db 'RAM-диск сохранен успешно ',0 |
||
387 | error1 db 'не определена база и/или раздел жёсткого диска',0 |
||
388 | error2 db 'функция не поддерживается для данной файловой системы',0 |
||
389 | error3 db 'неизвестная файловая система',0 |
||
390 | error4 db 'странно... Ошибка 4',0 |
||
391 | error5 db 'несуществующий путь',0 |
||
392 | error6 db 'файл закончился',0 |
||
393 | error7 db 'указатель вне памяти приложения',0 |
||
394 | error8 db 'диск заполнен',0 |
||
395 | error9 db 'файловая структура разрушена',0 |
||
396 | error10 db 'доступ запрещён',0 |
||
397 | error11 db 'Ошибка устройства',0 |
||
398 | aUnknownError db 'Неизвестная ошибка',0 |
||
399 | rdError db 'Нельзя сохранять образ в самого себя',0 |
||
400 | error db 'Ошибка: ',0 |
||
1606 | mario79 | 401 | ;--------------------------------------------------------------------- |
605 | kaitz | 402 | else if lang eq et |
4810 | eAndrew | 403 | save db 'Salvesta',0 |
404 | cancel db 'Cancel',0 |
||
405 | select db ' Valige',0 |
||
406 | label1 db ' RAM-drive will be saved as: ',0 |
||
407 | label2 db 'Saving in progress...',0 |
||
408 | ok db 'RAM-ketas salvestatud edukalt ',0 |
||
409 | error1 db 'hard disk base and/or partition not defined',0 |
||
410 | error2 db 'the file system does not support this function',0 |
||
411 | error3 db 'tundmatu failis№steem',0 |
||
412 | error4 db 'strange... Error 4',0 |
||
413 | error5 db 'vigane teekond',0 |
||
414 | error6 db 'end of file',0 |
||
415 | error7 db 'pointer is outside of application memory',0 |
||
416 | error8 db 'ketas tфis',0 |
||
417 | error9 db 'FAT tabel vigane',0 |
||
418 | error10 db 'juurdepффs keelatud',0 |
||
419 | error11 db 'Seadme viga',0 |
||
420 | aUnknownError db 'Tundmatu viga',0 |
||
421 | rdError db "You can't save image on itself",0 |
||
422 | error db 'Viga: ',0 |
||
1606 | mario79 | 423 | ;--------------------------------------------------------------------- |
3634 | fedesco | 424 | else if lang eq it |
4810 | eAndrew | 425 | save db ' Salva',0 |
426 | cancel db 'Cancel',0 |
||
427 | select db 'Seleziona',0 |
||
428 | label1 db ' RAM-drive will be saved as: ',0 |
||
429 | label2 db 'Saving in progress...',0 |
||
430 | ok db 'Il RAM-drivet e stato salvato ',0 |
||
431 | error1 db 'hard disk base and/or partition not defined',0 |
||
432 | error2 db 'the file system does not support this function',0 |
||
433 | error3 db 'filesystem sconosciuto',0 |
||
434 | error4 db 'strange... Error 4',0 |
||
435 | error5 db 'percorso non valido',0 |
||
436 | error6 db 'end of file',0 |
||
437 | error7 db 'pointer is outside of application memory',0 |
||
438 | error8 db 'disco pieno',0 |
||
439 | error9 db 'tabella FAT corrotta',0 |
||
440 | error10 db 'accesso negato',0 |
||
441 | error11 db 'Errore di device',0 |
||
442 | aUnknownError db 'Errore sconosciuto',0 |
||
443 | rdError db "You can't save image on itself",0 |
||
444 | error db 'Errore: ',0 |
||
3634 | fedesco | 445 | ;--------------------------------------------------------------------- |
205 | heavyiron | 446 | else |
4810 | eAndrew | 447 | save db ' Save',0 |
448 | cancel db 'Cancel',0 |
||
449 | select db ' Select',0 |
||
450 | label1 db ' RAM-drive will be saved as: ',0 |
||
451 | label2 db 'Saving in progress...',0 |
||
452 | ok db 'RAM-drive was saved successfully ',0 |
||
453 | error1 db 'hard disk base and/or partition not defined',0 |
||
454 | error2 db 'the file system does not support this function',0 |
||
455 | error3 db 'unknown file system',0 |
||
456 | error4 db 'strange... Error 4',0 |
||
457 | error5 db 'incorrect path',0 |
||
458 | error6 db 'end of file',0 |
||
459 | error7 db 'pointer is outside of application memory',0 |
||
460 | error8 db 'disk is full',0 |
||
461 | error9 db 'file structure is destroyed',0 |
||
462 | error10 db 'access denied',0 |
||
463 | error11 db 'Device error',0 |
||
464 | aUnknownError db 'Unknown error',0 |
||
465 | rdError db "You can't save image on itself",0 |
||
466 | error db 'Error: ',0 |
||
205 | heavyiron | 467 | end if |
4213 | heavyiron | 468 | ;--------------------------------------------------------------------- |
4810 | eAndrew | 469 | ntf_start db '"RDSave\n', 0 |
470 | ntf_end_o db '" -tO', 0 |
||
471 | ntf_end_e db '" -tE', 0 |
||
472 | ;--------------------------------------------------------------------- |
||
4213 | heavyiron | 473 | errors: |
4810 | eAndrew | 474 | dd ok |
475 | dd error1 |
||
476 | dd error2 |
||
477 | dd error3 |
||
478 | dd error4 |
||
479 | dd error5 |
||
480 | dd error6 |
||
481 | dd error7 |
||
482 | dd error8 |
||
483 | dd error9 |
||
484 | dd error10 |
||
485 | dd error11 |
||
4213 | heavyiron | 486 | ;--------------------------------------------------------------------- |
4270 | heavyiron | 487 | |
4810 | eAndrew | 488 | title db appname,version,0 |
4270 | heavyiron | 489 | |
4213 | heavyiron | 490 | ;Lib_DATA |
1070 | Lrz | 491 | ;Всегда соблюдать последовательность в имени. |
4810 | eAndrew | 492 | system_dir_Boxlib db '/sys/lib/box_lib.obj',0 |
493 | system_dir_ProcLib db '/sys/lib/proc_lib.obj',0 |
||
494 | system_dir_libini db '/sys/lib/libini.obj',0 |
||
4213 | heavyiron | 495 | ;--------------------------------------------------------------------- |
1070 | Lrz | 496 | head_f_i: |
4810 | eAndrew | 497 | head_f_l db 'System error',0 |
1606 | mario79 | 498 | |
4810 | eAndrew | 499 | err_message_found_lib1 db 'box_lib.obj - Not found!',0 |
500 | err_message_found_lib2 db 'proc_lib.obj - Not found!',0 |
||
501 | err_message_found_lib3 db 'libini.obj - Not found!',0 |
||
1606 | mario79 | 502 | |
4810 | eAndrew | 503 | err_message_import1 db 'box_lib.obj - Wrong import!',0 |
504 | err_message_import2 db 'proc_lib.obj - Wrong import!',0 |
||
505 | err_message_import3 db 'libini.obj - Wrong import!',0 |
||
1606 | mario79 | 506 | ;--------------------------------------------------------------------- |
507 | l_libs_start: |
||
508 | |||
509 | library01 l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \ |
||
510 | err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i |
||
511 | |||
512 | library02 l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \ |
||
513 | err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i |
||
514 | |||
4213 | heavyiron | 515 | library03 l_libs system_dir_libini+9, cur_dir_path, library_path, system_dir_libini, \ |
516 | err_message_found_lib3, head_f_l, libini_import, err_message_import3, head_f_i |
||
517 | |||
1606 | mario79 | 518 | end_l_libs: |
519 | ;--------------------------------------------------------------------- |
||
520 | OpenDialog_data: |
||
4810 | eAndrew | 521 | .type dd 1 ; Save |
522 | .procinfo dd procinfo ;+4 |
||
523 | .com_area_name dd communication_area_name ;+8 |
||
524 | .com_area dd 0 ;+12 |
||
525 | .opendir_path dd temp_dir_path ;+16 |
||
526 | .dir_default_path dd communication_area_default_path ;+20 |
||
527 | .start_path dd open_dialog_path ;+24 |
||
528 | .draw_window dd draw_window ;+28 |
||
529 | .status dd 0 ;+32 |
||
530 | .openfile_pach dd fname_buf ;+36 |
||
531 | .filename_area dd filename_area ;+40 |
||
532 | .filter_area dd Filter |
||
1606 | mario79 | 533 | .x: |
4810 | eAndrew | 534 | .x_size dw 420 ;+48 ; Window X size |
535 | .x_start dw 200 ;+50 ; Window X position |
||
1606 | mario79 | 536 | .y: |
4810 | eAndrew | 537 | .y_size dw 320 ;+52 ; Window y size |
538 | .y_start dw 120 ;+54 ; Window Y position |
||
1606 | mario79 | 539 | |
540 | communication_area_name: |
||
4810 | eAndrew | 541 | db 'FFFFFFFF_open_dialog',0 |
1606 | mario79 | 542 | open_dialog_path: |
1702 | Lrz | 543 | if __nightbuild eq yes |
544 | db '/sys/MANAGERS/opendial',0 |
||
545 | else |
||
546 | db '/sys/File Managers/opendial',0 |
||
547 | end if |
||
4213 | heavyiron | 548 | communication_area_default_path: |
4810 | eAndrew | 549 | db '/',0 |
1606 | mario79 | 550 | |
551 | Filter: |
||
4810 | eAndrew | 552 | dd Filter.end - Filter |
1606 | mario79 | 553 | .1: |
4810 | eAndrew | 554 | db 'IMG',0 |
555 | db 'IMA',0 |
||
1606 | mario79 | 556 | .end: |
4810 | eAndrew | 557 | db 0 |
1606 | mario79 | 558 | |
4810 | eAndrew | 559 | start_temp_file_name: db 'kolibri.img',0 |
1606 | mario79 | 560 | |
561 | ;--------------------------------------------------------------------- |
||
1070 | Lrz | 562 | align 4 |
1606 | mario79 | 563 | ProcLib_import: |
4810 | eAndrew | 564 | OpenDialog_Init dd aOpenDialog_Init |
565 | OpenDialog_Start dd aOpenDialog_Start |
||
566 | dd 0 |
||
567 | dd 0 |
||
568 | aOpenDialog_Init db 'OpenDialog_init',0 |
||
569 | aOpenDialog_Start db 'OpenDialog_start',0 |
||
1606 | mario79 | 570 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 571 | PathShow_data_1: |
4810 | eAndrew | 572 | .type dd 0 ;+0 |
573 | .start_y dw 36 ;+4 |
||
574 | .start_x dw 20 ;+6 |
||
575 | .font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1 |
||
576 | .area_size_x dw 270 ;+10 |
||
577 | .font_number dd 0 ;+12 ; 0 - monospace, 1 - variable |
||
578 | .background_flag dd 0 ;+16 |
||
579 | .font_color dd 0 ;+20 |
||
580 | .background_color dd 0 ;+24 |
||
581 | .text_pointer dd fname_buf ;+28 |
||
582 | .work_area_pointer dd text_work_area ;+32 |
||
583 | .temp_text_length dd 0 ;+36 |
||
4213 | heavyiron | 584 | ;--------------------------------------------------------------------- |
1606 | mario79 | 585 | align 4 |
3634 | fedesco | 586 | Box_lib_import: |
4213 | heavyiron | 587 | ;edit_box_draw dd aEdit_box_draw |
588 | ;edit_box_key dd aEdit_box_key |
||
589 | ;edit_box_mouse dd aEdit_box_mouse |
||
590 | ;version_ed dd aVersion_ed |
||
485 | heavyiron | 591 | |
4810 | eAndrew | 592 | PathShow_prepare dd sz_PathShow_prepare |
593 | PathShow_draw dd sz_PathShow_draw |
||
594 | Frame_draw dd sz_Frame_draw |
||
595 | dd 0 |
||
596 | dd 0 |
||
1070 | Lrz | 597 | |
4213 | heavyiron | 598 | ;aEdit_box_draw db 'edit_box',0 |
599 | ;aEdit_box_key db 'edit_box_key',0 |
||
600 | ;aEdit_box_mouse db 'edit_box_mouse',0 |
||
601 | ;aVersion_ed db 'version_ed',0 |
||
1070 | Lrz | 602 | |
4810 | eAndrew | 603 | sz_PathShow_prepare db 'PathShow_prepare',0 |
604 | sz_PathShow_draw db 'PathShow_draw',0 |
||
1070 | Lrz | 605 | |
4810 | eAndrew | 606 | sz_Frame_draw db 'frame_draw',0 |
4213 | heavyiron | 607 | ;szVersion_frame db 'version_frame',0 |
608 | ;--------------------------------------------------------------------- |
||
609 | frame_data: |
||
4810 | eAndrew | 610 | .type dd 0 ;+0 |
4213 | heavyiron | 611 | .x: |
4810 | eAndrew | 612 | .x_size dw 374 ;+4 |
613 | .x_start dw 8 ;+6 |
||
4213 | heavyiron | 614 | .y: |
4810 | eAndrew | 615 | .y_size dw 45 ;+8 |
616 | .y_start dw 17 ;+10 |
||
617 | .ext_fr_col dd 0x888888 ;+12 |
||
618 | .int_fr_col dd 0xffffff ;+16 |
||
619 | .draw_text_flag dd 1 ;+20 |
||
620 | .text_pointer dd label1 ;+24 |
||
621 | .text_position dd 0 ;+28 |
||
622 | .font_number dd 0 ;+32 |
||
623 | .font_size_y dd 9 ;+36 |
||
624 | .font_color dd 0x0 ;+40 |
||
625 | .font_backgr_color dd 0xdddddd ;+44 |
||
4213 | heavyiron | 626 | ;--------------------------------------------------------------------- |
627 | align 4 |
||
628 | libini_import: |
||
629 | init_lib dd a_init |
||
630 | ini_get_str dd aini_get_str |
||
631 | ini_get_int dd aini_get_int |
||
632 | ini_set_str dd aini_set_str |
||
633 | ini_set_int dd aini_set_int |
||
4810 | eAndrew | 634 | dd 0 |
635 | dd 0 |
||
636 | a_init db 'lib_init',0 |
||
4213 | heavyiron | 637 | aini_get_str db 'ini_get_str',0 |
638 | aini_get_int db 'ini_get_int',0 |
||
639 | aini_set_str db 'ini_set_str',0 |
||
640 | aini_set_int db 'ini_set_int',0 |
||
641 | ;--------------------------------------------------------------------- |
||
1070 | Lrz | 642 | |
4213 | heavyiron | 643 | apath db 'path',0 |
644 | asettings db 'settings',0 |
||
645 | aautoclose db 'autoclose',0 |
||
4810 | eAndrew | 646 | path db '/hd2/1/kolibri.img',0 |
4213 | heavyiron | 647 | ini_file db '/sys/settings/rdsave.ini',0 |
648 | ;ini_file db '/sys/rdsave.ini',0 |
||
649 | ;--------------------------------------------------------------------- |
||
650 | is_notify: |
||
4810 | eAndrew | 651 | dd 7, 0, ok, 0, 0 |
652 | db "/rd/1/@notify", 0 |
||
653 | |||
4213 | heavyiron | 654 | read_folder: |
4810 | eAndrew | 655 | .subfunction dd 1 |
656 | .start dd 0 |
||
657 | .flags dd 0 |
||
658 | .size dd 1 |
||
659 | .return dd folder_data |
||
660 | db 0 |
||
661 | .name: dd check_dir |
||
1070 | Lrz | 662 | |
4213 | heavyiron | 663 | param dd 0 |
664 | hidden dd 0 |
||
665 | ;--------------------------------------------------------------------- |
||
666 | IM_END: |
||
667 | ;--------------------------------------------------------------------- |
||
668 | align 4 |
||
669 | PARAMS: |
||
670 | rb 256 |
||
671 | ini_path: |
||
4810 | eAndrew | 672 | rb 4096 |
4213 | heavyiron | 673 | check_dir: |
4810 | eAndrew | 674 | rb 4096 |
1606 | mario79 | 675 | |
4213 | heavyiron | 676 | sc system_colors |
1606 | mario79 | 677 | |
4213 | heavyiron | 678 | autoclose rd 1 |
1606 | mario79 | 679 | |
4810 | eAndrew | 680 | color rd 1 |
4319 | heavyiron | 681 | |
682 | msg: |
||
4810 | eAndrew | 683 | rb 1024 |
4290 | heavyiron | 684 | |
4810 | eAndrew | 685 | ntf_msg: |
686 | rb 1024 |
||
687 | |||
4213 | heavyiron | 688 | folder_data: |
4810 | eAndrew | 689 | rb 304*32+32 ; 9 Kb |
1606 | mario79 | 690 | ;--------------------------------------------------------------------- |
691 | cur_dir_path: |
||
4810 | eAndrew | 692 | rb 4096 |
1606 | mario79 | 693 | ;--------------------------------------------------------------------- |
694 | library_path: |
||
4810 | eAndrew | 695 | rb 4096 |
1606 | mario79 | 696 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 697 | temp_dir_path: |
4810 | eAndrew | 698 | rb 4096 |
1606 | mario79 | 699 | ;--------------------------------------------------------------------- |
700 | fname_buf: |
||
4810 | eAndrew | 701 | rb 4096 |
1606 | mario79 | 702 | ;--------------------------------------------------------------------- |
703 | procinfo: |
||
4810 | eAndrew | 704 | rb 1024 |
1606 | mario79 | 705 | ;--------------------------------------------------------------------- |
706 | filename_area: |
||
4810 | eAndrew | 707 | rb 256 |
1606 | mario79 | 708 | ;--------------------------------------------------------------------- |
709 | text_work_area: |
||
4810 | eAndrew | 710 | rb 1024 |
1606 | mario79 | 711 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 712 | align 32 |
4810 | eAndrew | 713 | rb 4096 |
1606 | mario79 | 714 | stacktop: |
4319 | heavyiron | 715 | I_END:315,36>215,75>134,75>30,20>300,75>125,70>68,20>198,70>200,400>32,16>15,280>96,10>5,380> |