From 6ec2b20b1c4fc862ceebdb8cd419bc20a807af59 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 3 Nov 2008 13:17:12 +0000 Subject: [PATCH] Eolite, the lastest version git-svn-id: svn://kolibrios.org@902 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/fs/Eolite/trunk/include/LVabout.c-- | 129 ++++++++++++++++++ programs/fs/Eolite/trunk/include/icons_f.h-- | 68 +++++++++ programs/fs/Eolite/trunk/include/run_file.h-- | 92 +++++++++++++ 3 files changed, 289 insertions(+) create mode 100644 programs/fs/Eolite/trunk/include/LVabout.c-- create mode 100644 programs/fs/Eolite/trunk/include/icons_f.h-- create mode 100644 programs/fs/Eolite/trunk/include/run_file.h-- diff --git a/programs/fs/Eolite/trunk/include/LVabout.c-- b/programs/fs/Eolite/trunk/include/LVabout.c-- new file mode 100644 index 0000000000..af5b1b9ec3 --- /dev/null +++ b/programs/fs/Eolite/trunk/include/LVabout.c-- @@ -0,0 +1,129 @@ +#include "imgs\logo.cpp" + +/*void authors() +{ + _HH: + WindowRedrawStatus(1); + DefineAndDrawWindow(500,200,181,256,0x04,0x10EFEBEF,0,0,"About Eolite"); + //DrawTitle("About Eolite"); + DrawBar(5,0,172,50,0x8494C4); //голубое сзади + PutImage(#logo,85,85,48,7); + WriteText(32,100,0x80,0xBF40BF,"Eolite v0.96.4 beta7",0); + WriteText(68,120,0x80,0,"Authors:",0); + WriteText(44,130,0x80,0,"Leency & Veliant",0); + WriteText(50,140,0x80,0,"KolibriOS Team",0); + WriteText(26,160,0x80,0,"Made using C-- in 2008",0); + WriteText(23,170,0x80,0,"Visit www.kolibrios.org",0); + DrawFlatButton(90,190,70,22,2,0x00D7D7D7, "Close"); + WindowRedrawStatus(2); + loop() + { + SWITCH(WaitEvent()) + { + CASE evButton: ExitProcess(); + CASE evKey: IF (GetKey()==27) ExitProcess(); break; + CASE evReDraw: GOTO _HH; + BREAK; + } + } + ExitProcess(); +}*/ + + +void authors() +{ + loop() + { + switch(WaitEvent()) + { + CASE evButton: ExitProcess(); + CASE evKey: IF (GetKey()==27) ExitProcess(); break; + CASE evReDraw: + WindowRedrawStatus(1); + DefineAndDrawWindow(500,200,181,256,0x04,0x10EFEBEF,0,0,"About Eolite"); + //DrawTitle("About Eolite"); + DrawBar(5,0,172,50,0x8494C4); //голубое сзади + PutImage(#logo,85,85,48,7); + WriteText(32,100,0x80,0xBF40BF,"Eolite v0.96.7 beta7",0); + WriteText(68,120,0x80,0,"Authors:",0); + WriteText(44,130,0x80,0,"Leency & Veliant",0); + WriteText(50,140,0x80,0,"KolibriOS Team",0); + WriteText(26,160,0x80,0,"Made using C-- in 2008",0); + WriteText(23,170,0x80,0,"Visit www.kolibrios.org",0); + DrawFlatButton(90,190,70,22,2,0x00D7D7D7, "Close"); + WindowRedrawStatus(2); + } + } + //ExitProcess(); +} + + +dword ConvertSize(dword bytes) +{ + byte size_prefix[7], temp[3]; + IF (bytes>=1073741824) copystr(" Gb",#temp); + ELSE IF (bytes>=1048576) copystr(" Mb",#temp); + ELSE IF (bytes>=1024) copystr(" Kb",#temp); + ELSE copystr(" b ",#temp); + WHILE (bytes>1023) bytes/=1024; + copystr(IntToStr(bytes),#size_prefix); + copystr(#temp,#size_prefix+strlen(#size_prefix)); + EAX=#size_prefix; +} + + +void Sort_by_Size(int a, b) // для первого вызова: a = 0, b = <элементов в массиве> - 1 +{ + int i= a; + IF (a >= b) return; + FOR (j = a; j <= b; j++) + { + IF (ESDWORD[file_mas[j]*304 + buf+72-8] <= ESDWORD[file_mas[b]*304 + buf+72-8]) + { file_mas[i] >< file_mas[j]; i++;} + } + Sort_by_Size (a, i-2); + Sort_by_Size (i, b); +} + + +void Sort_by_Name(int a, b) // для первого вызова: a = 0, b = <элементов в массиве> - 1 +{ + int i = a; + IF (a >= b) return; + FOR (j = a; j <= b; j++) + IF (strcmp(file_mas[j]*304 + buf+72, file_mas[b]*304 + buf+72)<=0) { file_mas[i] >< file_mas[j]; i++;} + Sort_by_Name(a, i-2); + Sort_by_Name(i, b); +} + + +int partition1(dword a, b) +{ + dword i = a; byte filename1[256], filename2[256]; int n; + for (j = a; j <= b; j++) + { + // + copystr(file_mas[j]*304 + buf+72, #filename1); + copystr(file_mas[b]*304 + buf+72, #filename2); + n=strlen(#filename1)-1; + WHILE (filename1[n]<>'.') && (n>0) n--; + IF (n) copystr(#filename1+n+1, #filename1); + n=strlen(#filename2)-1; + WHILE (filename2[n]<>'.') && (n>0) n--; + IF (n) copystr(#filename2+n+1, #filename2); + // + n=strcmp(#filename1, #filename2); + IF (n<0) { file_mas[i] >< file_mas[j]; i++;} + IF (n==0) && (strcmp(file_mas[j]*304 + buf+72, file_mas[b]*304 + buf+72)<=0) { file_mas[i] >< file_mas[j]; i++;} + } + EAX = i-1; +} + +void Sort_by_Type(dword a, b) // для первого вызова: a = 0, b = <элементов в массиве> - 1 +{ + int c; + IF (a >= b) RETURN; + c = partition1(a, b); + Sort_by_Type(a, c-1); + Sort_by_Type(c+1, b); +} diff --git a/programs/fs/Eolite/trunk/include/icons_f.h-- b/programs/fs/Eolite/trunk/include/icons_f.h-- new file mode 100644 index 0000000000..edbeeadc84 --- /dev/null +++ b/programs/fs/Eolite/trunk/include/icons_f.h-- @@ -0,0 +1,68 @@ +void IconFairing(dword filenum, y, videlenie) +{ + if (filenum<5) //файлик + { + DrawBar(200,y-26,2,15,videlenie); + DrawBar(214,y-26,2,15,videlenie); + DrawBar(210,y-26,4,1,videlenie);//ле + DrawBar(211,y-25,3,1,videlenie);//сен + DrawBar(212,y-24,2,1,videlenie);//ка + DrawBar(213,y-23,1,1,videlenie);// + } + if (filenum==16) || (filenum==17) //папка + { + DrawBar(201,y-13,15,2,videlenie); //снизу линия + DrawBar(200,y-26,1,15,videlenie); //слева линия + DrawBar(208,y-26,8,2,videlenie); //сверху справа линия + IF (filenum==17) DrawBar(211,y-25,1,1,0x1A7B17); //зелёная точка стрелки + //.точки + PutPixel(201,y-26+skin_width,videlenie); //сверху слева точка + PutPixel(207,y-26+skin_width,videlenie); //сверху справа точка + PutPixel(201,y-14+skin_width,videlenie); //слева снизу точка + PutPixel(215,y-14+skin_width,videlenie); //справа снизу точка + PutPixel(215,y-24+skin_width,videlenie); //какая разница где + } + IF (filenum==13) PutPixel(215,y-26+skin_width,videlenie); //skin + IF (filenum==14) {DrawBar(200,y-26,1,15,videlenie); DrawBar(215,y-26,1,15,videlenie);} //video +} + +dword Put_icon(dword extension, yy) +{ + dword ftype="", fnum=0; //еши неизвесный файл + IF (strcmp(extension,".kex")==0) {fnum = 6; ftype="Program";} + IF (strcmp(extension,".cvs")==0) {fnum = 18; ftype="Graph";} + IF (strcmp(extension,".cmd")==0) {fnum = 5; ftype="CMD skript";} + IF (strcmp(extension,".skn")==0) {fnum = 13; ftype="Skin";} + IF (strcmp(extension,".chr")==0) {fnum = 10; ftype="Font";} + IF (strcmp(extension,".avi")==0) {fnum = 14; ftype="Video";} + IF (strcmp(extension,".asm")==0) {fnum = 11; ftype="Source";} + IF (strcmp(extension,".inc")==0) fnum = 9; + IF (strcmp(extension,".exe")==0) {fnum = 7; ftype="Win32 Exec";} + IF (strcmp(extension,".dll")==0) || (strcmp(extension,".obj")==0) {fnum = 8; ftype="Library";} + IF (strcmp(extension,".ini")==0) || (strcmp(extension,"conf")==0) {fnum = 8; ftype="Config";} + IF (strcmp(extension,".htm")==0) || (strcmp(extension,"html")==0) {fnum = 2; ftype="Web-page";} + //text + IF (strcmp(extension,".txt")==0) {fnum = 1; ftype="Text";} + IF (strcmp(extension,".doc")==0) {fnum = 1; ftype="Text";} + IF (strcmp(extension,".rtf")==0) {fnum = 1; ftype="Text";} + //изображения + IF (strcmp(extension,".gif")==0) || (strcmp(extension,".bmp")==0) || + (strcmp(extension,".tga")==0) || (strcmp(extension,".pcx")==0) || + (strcmp(extension,".png")==0) || (strcmp(extension,".jpg")==0) || + (strcmp(extension,"jpeg")==0) || (strcmp(extension,".raw")==0) {fnum = 3; ftype="Image";} + //архивы + IF (strcmp(extension,".rar")==0) || (strcmp(extension,".zip")==0) || + (strcmp(extension,".cab")==0) || (strcmp(extension,".tar")==0) || + (strcmp(extension,".ajr")==0) {fnum = 15; ftype="Archive";} + //audio + IF (strcmp(extension,".mp3")==0) {fnum = 12; ftype="Music";} + IF (strcmp(extension,".wav")==0) || (strcmp(extension,".mid")==0) || + (strcmp(extension,"midi")==0) || (strcmp(extension,".ogg")==0) {fnum = 12; ftype="Audio";} + //папка + IF (strcmp(extension,"")==0) || (strcmp(extension," ")==0) + { fnum=21-strlen(extension); WriteText(onLeft(140,0),yy-22,0x80,0,extension,0);} + // + PutImage(fnum*16*15*3+#ficons,16,15,200,yy-26); + WriteText(onLeft(155,0),yy-22,0x80,0,ftype,0); + return fnum; +} diff --git a/programs/fs/Eolite/trunk/include/run_file.h-- b/programs/fs/Eolite/trunk/include/run_file.h-- new file mode 100644 index 0000000000..f9cb423eba --- /dev/null +++ b/programs/fs/Eolite/trunk/include/run_file.h-- @@ -0,0 +1,92 @@ +#include "imgs\icons.cpp" + +struct { + int func; + int flag; + int param; + int rez1; + int rez2; + char rezerv2; + int stroka; +}run_file_70; + + +/////////////////////////// +// Запуск программы // +/////////////////////////// +void Run_Program(dword run_path, run_param) +{ + run_file_70.func = 7; + run_file_70.flag = 0; + run_file_70.param= run_param; + run_file_70.rez1 = 0; + run_file_70.rez2 = 0; + run_file_70.rezerv2 = 0; + run_file_70.stroka = run_path; + $mov eax,70 + $mov ebx,#run_file_70.func + $int 0x40 +} + + +/*char *extension[25]={".skn",".avi",".htm","html",".3ds",".lif",".cvs",".mp3", +".wav",".mid","midi",".rtf",".txt",".inc",".ini",".dat",".asm",".gif",".bmp", +".tga",".pcx",".png",".jpg","jpeg", 0}; //массив указателей +char *prog_path[25]={"desktop","/sys/kvid","/sys/network/HTMLv","/sys/network/HTMLv", +"/sys/demos/3d/view3ds","/sys/demos/life2","graph","AC97SND","AC97SND","MIDAMP", +"MIDAMP","RtfRead","TinyPad","TinyPad","TinyPad","TinyPad","TinyPad","MV","MV", +"MV","MV","@rcher","JpegView","JpegView", 0}; + + +void Run_File(dword fpath) +{ + byte i; + dword file_ext[4]=fpath+strlen(fpath)-4; + FOR(i=0; extension[i]!=0; i++) IF (strcmp(file_ext,extension[i])==0) + { + Run_Program(prog_path[i], fpath); + return; + } + Run_Program(fpath, ""); +}*/ + +/////////////////////////// +// Запуск файла // +/////////////////////////// +void Run_File(dword fpath) +{ + dword extension[4], fparam[256]; + copystr(fpath,#fparam); //по-умолчанию прога и параметр равны, если окажется что это файл, парам - сбросим + copystr(fpath+strlen(fpath)-4,#extension); //узнаём расширение файла с каким работаем + //тут мы это расширение сравнимаем, и, если оно асоциируется с прогой, прога - это fpath + IF (strcmp(#extension,".skn")==0) copystr("desktop",fpath); + IF (strcmp(#extension,".avi")==0) copystr("/sys/kvid",fpath); + IF (strcmp(#extension,".htm")==0) copystr("/sys/network/HTMLv",fpath); + IF (strcmp(#extension,"html")==0) copystr("/sys/network/HTMLv",fpath); + //IF (strcmp(#extension,".htm")==0) || (strcmp(#extension,"html")==0) copystr("/hd0/2/Programs/QIP/Users/419114984/RcvdFiles/313257308_Veliant/browser/HTMLv",fpath); + IF (strcmp(#extension,".3ds")==0) copystr("/sys/demos/3d/view3ds",fpath); + IF (strcmp(#extension,".lif")==0) copystr("/sys/demos/life2",fpath); + IF (strcmp(#extension,".cvs")==0) copystr("graph",fpath); + //audio + IF (strcmp(#extension,".mp3")==0) copystr("AC97SND",fpath); + IF (strcmp(#extension,".wav")==0) copystr("AC97SND",fpath); + IF (strcmp(#extension,".mid")==0) copystr("MIDAMP",fpath); + IF (strcmp(#extension,"midi")==0) copystr("MIDAMP",fpath); + //text + IF (strcmp(#extension,".rtf")==0) copystr("RtfRead",fpath); + IF (strcmp(#extension,".txt")==0) copystr("TinyPad",fpath); + IF (strcmp(#extension,".inc")==0) copystr("TinyPad",fpath); + IF (strcmp(#extension,".ini")==0) copystr("TinyPad",fpath); + IF (strcmp(#extension,".dat")==0) copystr("TinyPad",fpath); + IF (strcmp(#extension,".asm")==0) copystr("TinyPad",fpath); //AsmMenu1,AsmMenu2 + //изображения + IF (strcmp(#extension,".gif")==0) copystr("MV",fpath); //GifView,MenuAnimage + IF (strcmp(#extension,".bmp")==0) copystr("MV",fpath); //BmpMenu1,MenuAnimage + IF (strcmp(#extension,".tga")==0) copystr("MV",fpath); + IF (strcmp(#extension,".pcx")==0) copystr("MV",fpath); + IF (strcmp(#extension,".png")==0) copystr("@rcher",fpath); + IF (strcmp(#extension,".jpg")==0) copystr("JpegView",fpath); + IF (strcmp(#extension,"jpeg")==0) copystr("JpegView",fpath); + IF (strcmp(fpath,#fparam)==0) copystr("",#fparam); //если fpath не изменился, то это таки, наверное, прога, параметров нет. + Run_Program(fpath, #fparam); //запуск! +}