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