From cd41c5ddfc23a9bd3371eefefeeb5e497dda4546 Mon Sep 17 00:00:00 2001 From: pavelyakov Date: Thu, 5 Nov 2015 20:49:42 +0000 Subject: [PATCH] Eolite: uses library fs.obj git-svn-id: svn://kolibrios.org@5883 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/common/lib/array.obj | Bin 1609 -> 1613 bytes data/common/lib/fs.obj | Bin 3259 -> 3288 bytes data/common/lib/library.obj | Bin 1412 -> 1391 bytes programs/cmm/eolite/Eolite.c | 9 ++- programs/cmm/eolite/include/copy.h | 34 +++++++++--- programs/cmm/eolite/include/properties.h | 16 ++++-- programs/cmm/lib/dll.h | 56 ++++++++++++++++--- programs/cmm/lib/kolibri.h | 2 + programs/cmm/lib/obj/fs.h | 68 +++++++++++++++++++++++ 9 files changed, 164 insertions(+), 21 deletions(-) create mode 100644 programs/cmm/lib/obj/fs.h diff --git a/data/common/lib/array.obj b/data/common/lib/array.obj index 815fc5acfc096ec7d1b91863222dc1183ec82fab..d6498c1cdc8db06c07b4f4117b8ba1b44d216942 100644 GIT binary patch delta 751 zcmVey7jPl3k^ zV3#PAj8Qg^11jD0t&tP38%>F7Xt!%o;nl?C0gkOBX42HFYad79H0 z?kEKhcNB-k6L*>(-Ocn8a}VxQp_T1-;bniAvW|sMr7;l!h3d0Un&x=#^?iSTH)IBN zkHr#DJeJzvgHKh*m(S3dNPjW6J&|srQ$iT(f-_a6&Y<@=E;b%>%APc<9>EsD_rEf< zxPUSA6q*%i#JXfPY@c{|wP-JWu@K0Z1-?qs*?)7#{GAQ%dOJ20*h;|gus^Mf4~zb%mwSeUgL00x@_YL%k395y$$cojWw_K0 zImgac0U?oR+64gma0$NGDvYXN*?h2_-mt4bnx=vm^bQaA3jH{OU>ae~d zQ9}AfKEfzj7KmJoynhP$8^UI*)DVPOw_Rfv6>={hCT!A{)FItF4-Q$eAg69WdEC?C z1nm%&j7)S#jPiy(1JC1w_XtY~ChBuqs`&Z# zZN4$_<2&3paD|Hq0VNE+Ka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;T)tkCbiaiarmuRw{uiWPqoj;EGGK4ehx_m1f53qBOcx<$^ty($+qCUlmX}?-6>R zhuDR|YWj;W+QUQr+Nlu^eHvS-lDZ2XtUxN~w?GO))`V53;+*p`anv}`qo?s%5E!lq zCUuhI{jwU5Sa@QJsX5P|$x2IIMggFH1;}HDFO-Fa58kY+IS%ln zsQGWl5X%du6Ui*g^3wjv1LS6tU|BGP+iG!o3%50E4OA%PbQ1zuSrTI_A{nU!Va|)! z?c3<#jm-Nv$v?siK-&G?}1I-;%k)jS zr>H!Ly%Xy&D26F-GZ;wQV+Yyna>^JyQdOAZs5#HqzfL2X4gpM8G=crvJAHMjsV{la zEsDS&&A@uqDvszFfs?A}^chlHO*$EuW7xD*26$y@NT_wxbe_-SYK7RlB}bt(1H9Qt>-}{@QC;R z+oR%KDv?kSj3J?x5E!3O5`d6nRF zV~Q{g8zRt-Ma7nf2C>+^rt-}k*# z;Idi0Fu(R#VP8mU@T34<>;`zqtn&`I=)-EP3Xnr#D&7H-Gq|m+5D?tlYF0Zi;=sN7 zhEqdIo;{IH_6?*@^>j!=v3BZcNlZ7|gx|dtMvk|RRkaG}+TjJrfwVKjmoZe*eNg}~ tz{1Dtzw{wP^(_IFksNa&?R3TXGmSG$_ph83*hFNV0K4_(0J8u900jTEU#$QD diff --git a/data/common/lib/library.obj b/data/common/lib/library.obj index d4a4b365fe7c4fa965cef5e384449a6db34cbb5b..1787cc559c5f6c1df5fe335c9774f8128a63f25f 100644 GIT binary patch delta 1103 zcmV-V1hD&r3-1aAOHe~gTd@T)0e>>KU)kGwIdaq(ZKduo&g>nIvu@y-^SNHU^AHdUbrCo<8Z?Ssb@NPZM8?(@kr&r z6ZnZM#~Y@c5Sbc;bX9xULzha*d;BWF=VIou35(=GRwQH>D2<9^T&ylRntxz+$#p*I z_V=C8JienXk3HSVI(QjBFzft$Y1)x}^kaITbIk&FxGA zCNFwo+e=qgN$OdVK8edQ1u)^Qx2k)w9(}KZVgag=!$2=YR)xc}Fu;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N0}ks=WxapH qiQTH<{~#V(Frqu$b%r=__f4M|()mR8LHS1}2QLV_000vJ0008pwkN#+ diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index a43d99684f..cb3ff1668d 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -18,6 +18,7 @@ //obj #include "..\lib\obj\libini.h" #include "..\lib\obj\box_lib.h" +#include "..\lib\obj\fs.h" byte CMD_ENABLE_SAVE_IMG = false; @@ -124,6 +125,9 @@ void main() load_dll(boxlib, #box_lib_init,0); load_dll(libini, #lib_init,1); + + lib_init_fs(); + eolite_ini_path = abspath("Eolite.ini"); fd_path_eolite_ini_path = "/fd/1/File Managers/Eolite.ini"; @@ -874,7 +878,7 @@ void Del_Form() int del_error; int Del_File2(dword way, sh_progr) { - dword dirbuf, fcount, i, filename; + /*dword dirbuf, fcount, i, filename; int error; char del_from[4096]; if (isdir(way)) @@ -896,7 +900,8 @@ int Del_File2(dword way, sh_progr) } } } - if (error = DeleteFile(way)) del_error = error; + if (error = DeleteFile(way)) del_error = error;*/ + fs.remove(way); } void Del_File_Thread() diff --git a/programs/cmm/eolite/include/copy.h b/programs/cmm/eolite/include/copy.h index 4998a5127e..bb79896330 100644 --- a/programs/cmm/eolite/include/copy.h +++ b/programs/cmm/eolite/include/copy.h @@ -7,12 +7,14 @@ enum {NOCUT, CUT}; Clipboard clipboard; +dword _copy_path_ = 0; void Copy(dword pcth, char cut) { dword selected_offset2; byte copy_t[4096]; dword buff_data; int ind = 0; + /* if (selected_count) { buff_data = malloc(selected_count*4096+10); @@ -42,6 +44,9 @@ void Copy(dword pcth, char cut) } cut_active = cut; free(buff_data); + */ + _copy_path_ = strdup(#file_path); + cut_active = cut; } @@ -56,9 +61,27 @@ void PasteThread() int j; int cnt = 0; dword buf; + dword tmp; file_count_copy = 0; copy_bar.value = 0; - + if(_copy_path_) + { + DisplayOperationForm(); + IF(!TEMP) TEMP = malloc(4096); + buf = _copy_path_; + while(DSBYTE[buf]) + { + IF(DSBYTE[buf]=='/')tmp = buf; + buf++; + } + sprintf(TEMP,"%s/%s",#path,tmp); + IF(cut_active) fs.move(_copy_path_,TEMP); + ELSE fs.copy(_copy_path_,TEMP); + free(_copy_path_); + DialogExit(); + } + _copy_path_ = 0; + /* buf = clipboard.GetSlotData(clipboard.GetSlotCount()-1); if (DSDWORD[buf+4] != 3) return; cnt = ESINT[buf+8]; @@ -101,11 +124,8 @@ void PasteThread() Del_File2(#copy_from, 0); } - } - if (cut_active) - { - cut_active=false; - } + }*/ + cut_active=false; if (info_after_copy) notify(INFO_AFTER_COPY); - DialogExit(); + } \ No newline at end of file diff --git a/programs/cmm/eolite/include/properties.h b/programs/cmm/eolite/include/properties.h index 2d85979fe4..fa9a0f030d 100644 --- a/programs/cmm/eolite/include/properties.h +++ b/programs/cmm/eolite/include/properties.h @@ -155,6 +155,7 @@ void Quest() DrawFlatButton(145,138,70,20,302,0xC6DFC6,T_NO); } +/* void GetSizeDir(dword way) { dword dirbuf, fcount, i, filename; @@ -184,17 +185,21 @@ void GetSizeDir(dword way) free(cur_file); } } +*/ void GetSizeMoreFiles(dword way) { char cur_file[4096]; dword selected_offset2; - + size_dir = 0; for (i=0; i]\n" + +#ifndef INCLUDE_KOLIBRI_H +#include "../lib/kolibri.h" +#endif + +#ifndef INCLUDE_DLL_H +#include "../lib/dll.h" +#endif + +:struct FILE_SYSTEM_FUNCTION +{ + dword remove_pointer; + byte remove(dword path); + + dword move_pointer; + byte move(dword path1,path2); + + dword copy_pointer; + byte copy(dword path1,path2); + + dword get_size_pointer; + qword get_size(dword path); +} fs; + +:byte FILE_SYSTEM_FUNCTION::remove(dword path) +{ + dword tmp = path; + remove_pointer stdcall(tmp); + return EAX; +} + +:qword FILE_SYSTEM_FUNCTION::get_size(dword path) +{ + dword tmp = path; + get_size_pointer stdcall(tmp); + return EAX; +} + +:byte FILE_SYSTEM_FUNCTION::move(dword path1,path2) +{ + dword tmp1 = path1; + dword tmp2 = path2; + move_pointer stdcall(tmp1,tmp2); + return EAX; +} + +:byte FILE_SYSTEM_FUNCTION::copy(dword path1,path2) +{ + dword tmp1 = path1; + dword tmp2 = path2; + copy_pointer stdcall(tmp1,tmp2); + return EAX; +} + +:void lib_init_fs() +{ + library.load("/sys/LIB/FS.OBJ"); + fs.remove_pointer = library.get("fs.remove"); + fs.get_size_pointer = library.get("fs.get_size"); + fs.move_pointer = library.get("fs.move"); + fs.copy_pointer = library.get("fs.copy"); + //alert(itoa(fs.get_size("/sys/"))); +} + +#endif \ No newline at end of file