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