diff --git a/programs/fs/Eolite/trunk/Eolite.c-- b/programs/fs/Eolite/trunk/Eolite.c-- index 15a8fcd12e..85879bdcfe 100644 --- a/programs/fs/Eolite/trunk/Eolite.c-- +++ b/programs/fs/Eolite/trunk/Eolite.c-- @@ -5,14 +5,13 @@ #include "lib\memory.h--" #include "lib\edit_box_lib.h--" #include "include\run_file.h--" -#include "include\icons_f.h--" -#include "imgs\toolbar_new.cpp" +#include "imgs\toolbar.txt" #include "imgs\left_p.cpp" //локализация и настройки -byte header[27] = "Eolite File Manager v0.96.7"; +byte header[27] = "Eolite File Manager v0.97"; #define videlenie 0x94AECE; //цвет выделенного элемента из списка файлов -int toolbar_buttons_x[6]={14,51,90,139,172,208}; +byte toolbar_buttons_x[6]={14,51,90,139,172,208}; // dword but_num=0, kolichestvo=0, curbtn=0, za_kadrom=0; byte cut_active, rename_active, del_active; @@ -23,48 +22,39 @@ byte file_path[256], file_name[256]; // byte copyfile[256],copy_name[256]; //копирование dword i; //для циклов dword file_mas[6898]; //список файлов -dword temp_int; +int temp_int, j; dword stak[100]=0; //окно About edit_box edit1= {250,252,17,0xffffff,0x94AECE,0xD3DDEB,0xffffff,0,248,#edit_path,64,6,6}; edit_box edit2= {250,218,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,64,6,6}; proc_info Form; - -struct { - int func; - int pos; - int rezerv; - int sizefile; - int buffer; - char rezerv2; - int stroka; -}open_file_70; +f70 open_dir_70; dword buf=0, off; //для текста и буфера dword devbuf=0, dev_num; #include "include\LVabout.c--" - +#include "include\icons_f.h--" void main() byte pressed, key, id; mouse m; { devbuf= malloc(3112); //буфер где-то на 10 девайсов в левой панели - open_file_70.func = 1; - open_file_70.pos = 0; - open_file_70.rezerv = 0; - open_file_70.sizefile = 10; - open_file_70.buffer = devbuf; - open_file_70.rezerv2 = 0; - open_file_70.stroka = "/"; + open_dir_70.func = 1; + open_dir_70.param1 = 0; + open_dir_70.param2 = 0; + open_dir_70.param3 = 10; + open_dir_70.param4 = devbuf; + open_dir_70.rezerv = 0; + open_dir_70.name = "/"; $mov eax,70 - $mov ebx,#open_file_70.func + $mov ebx,#open_dir_70.func $int 0x40 dev_num=EBX; load_dll(); //подгружает либу с едит_боксом IF (param[0]<>'') {copystr(#param,#edit_path); Goto_edit_path();} Open_Dir(#path,2); - SetEventMask(); + //SetEventMask(100111b); loop() { switch(WaitEvent()) @@ -95,7 +85,7 @@ mouse m; case evButton: IF (edit1.flags<>64) {edit1.flags=64; edit_box_draw stdcall(#edit1);} //сбрасываем выделение при нажатии на батон id=GetButtonID(); - IF (id==1) ExitProcess(); + IF (id==1) {IF(buf)free(buf); ExitProcess();} IF (del_active==1) {IF (id==301) || (id==302) Del_File(302-id); break;} switch(id) { @@ -170,7 +160,8 @@ mouse m; IF (key==027) Del_File(false); break; } - IF (edit1.flags<>64) || (edit2.flags<>64) SWITCH (key) { CASE 8: CASE 180...182: CASE 051...056: goto EDIT_KEY_MARK; } //1..10 и ноум/енд в едитбоксах + IF (edit1.flags<>64) && (key<>13) {EAX=key<<8; edit_box_key stdcall (#edit1); break;} + IF (edit2.flags<>64) && (key<>13) && (key<>27) {EAX=key<<8; edit_box_key stdcall (#edit2); break;} switch (key) { case 209...217: id=key-109; IF(dev_num>id-100)GOTO DEVICE_MARK; break; @@ -224,14 +215,20 @@ mouse m; edit_box_draw stdcall (#edit2); DrawBar(218,curbtn*18+58,edit2.width+1,1,0xFFFFCC); //полоса желтая сверху для одинаковости rename_active=1; - BREAK; + break; case 052: //Нажата F3 - IF (isdir==false) Run_Program("/sys/tinypad", #file_path); BREAK; - case 054: Open_Dir(#path,1); BREAK; //перерисовать окно F5 - case 182: Del_Form(); BREAK; //delete file - default: EDIT_KEY_MARK: - EAX=key <<8; - IF (rename_active==0) edit_box_key stdcall (#edit1); ELSE edit_box_key stdcall (#edit2); + IF (isdir==false) Run_Program("/sys/tinypad", #file_path); break; + case 054: Open_Dir(#path,1); break; //перерисовать окно F5 + case 182: Del_Form(); break; //delete file + default: + IF (strcmp("..",buf+72+304)<>0) temp_int=0; ELSE temp_int=1; + for (i=curbtn+za_kadrom+1; i='A')&&(AL<='Z')DSBYTE[#temp]=AL|0x20; + IF (temp[0]==key) {FileList_ReDraw(i-curbtn-za_kadrom); break;} + } } break; case evReDraw: draw_window(); BREAK; @@ -247,13 +244,13 @@ inline fastcall void draw_window() { WindowRedrawStatus(1); skin_width = GetSkinWidth(); - DefineAndDrawWindow(100,100,600,410,0x43,0x10E4DFE1,0,0,#header); //DrawTitle(#header); + DefineAndDrawWindow(100,100,600,410,0x43,0x10E4DFE1,0,0,#header); Form.getme(); IF (Form.height==skin_width+3) {WindowRedrawStatus(2); return;} //это зачёт! IF (Form.height<280) MoveSize(OLD,OLD,OLD,280); IF (Form.width<480) MoveSize(OLD,OLD,480,OLD); //toolbar buttons - PutImage(#toolbar,246,39,5,0); + PutPaletteImage(#toolbar,246,39,5,0,#toolbar_pal); FOR (j=0; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,0xE4DFE1); //полоса адреса DrawBar(251,0,onLeft(251,60),12,0xE4DFE1); //фон над полосой адреса @@ -279,10 +276,13 @@ inline fastcall void draw_window() //прокрутка DrawFlatButton(onLeft(22,0),40,16,16,50,0xE4DFE1,"\x18"); //прокрутка вверх DrawFlatButton(onLeft(22,0),onTop(22,0),16,16,51,0xE4DFE1,"\x19");//прокрутка вниз + // + //DrawBar(197,57,onLeft(22,197),onTop(57,6),0xFFFFFF); //заливка белым + // DrawBar(onLeft(22,0),57,1,onTop(22,57),0x94AECE); //линия слева от прокрутки but_num=onTop(6,57)/18; IF (but_num>100) but_num=1; ELSE IF (kolichestvobut_num-1) curbtn=but_num-1; //это если выделение после схлопывания окна за кадром // FOR (j=0; jj) Line_ReDraw(0xFFFFFF, j); ELSE Line_ReDraw(videlenie, curbtn); - temp_int=but_num-1*18+75; + temp_int=but_num*18+57; DrawBar(197,temp_int,onLeft(22,197),onTop(temp_int,6),0xFFFFFF); //заливка белым доконца DrawBar(onLeft(163,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //полоса серая вертикальная 1 DrawBar(onLeft(90,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //полоса серая вертикальная 2 TVScroll(); } +/*void List_ReDraw() +{ + int i; + for (j=0; j<5; j++;) for (i=0; i<6; i++;) + { + PutImage(#def_file,48,48,i*64+197,j*64+57); + off=file_mas[i+j+za_kadrom]*304 + buf+72; + DrawBar(i*64+197,j*64+57+50,10*6,9,0xFFFFFF); //заливка белым + WriteText(i*64+197,j*64+57+50,0,0,off,10); + } + TVScroll(); +}*/ + void Line_ReDraw(dword color, filenum){ - dword y, size; + dword y=filenum*18+57; //положение текста по Y; if (rename_active==1) { rename_active=0; edit2.flags=64; - DefineButton(197,curbtn+1*18+39,onLeft(22,197),18,curbtn+201+BT_HIDE+BT_NOFRAME,0xFFFFFF); + DefineButton(197,curbtn*18+57,onLeft(22,197),18,curbtn+201+BT_HIDE+BT_NOFRAME,0xFFFFFF); IF (filenum==100) filenum=curbtn; ELSE { copystr(#path,#temp); @@ -377,48 +390,46 @@ void Line_ReDraw(dword color, filenum){ { CopyFile(#file_path,#temp); Del_File(true); } } } - DrawBar(197,filenum*18+57,onLeft(22,197),18,color); //полоса белая или выделения + //да, я не спорю что изврат, но перерисовка зато маленькая + DrawBar(197,y,3,18,color); + DrawBar(200,y,16,2,color); + DrawBar(197+19,y,onLeft(22+19,197),18,color); + DrawBar(200,y+17,16,1,color); // - y= filenum*18+85; //положение текста по Y IF (strcmp(".",buf+72)<>0) off=file_mas[filenum+za_kadrom]*304 + buf+72; ELSE off=file_mas[filenum+za_kadrom+1]*304 + buf+72; - temp_int = onLeft(220,160)/6; - IF (strlen(off)", y); + temp_int = Put_icon(off+strlen(off)-4, y+2); + WriteText(7-strlen(ConvertSize(ESDWORD[off-8]))*6+onLeft(75,0),y+6,0x80,0,ConvertSize(ESDWORD[off-8]),0); //size + } ELSE IF (strcmp("..",off)==0) temp_int=Put_icon("..", y+2); ELSE temp_int=Put_icon("", y+2); IF (color==videlenie) { - IconFairing(temp_int, y, videlenie); //закрашиваем иконку + IconFairing(temp_int, y+2, videlenie); //закрашиваем иконку copystr(#path,#file_path); copystr(off,#file_name); copystr(off,#file_path+strlen(#file_path)); //итак, file_path=файлу, т.к. по-умолчанию это прога } - DrawBar(onLeft(163,0),filenum*18+57,1,18,0xE4DFE1); //полоса серая вертикальная 1 - DrawBar(onLeft(90,0),filenum*18+57,1,18,0xE4DFE1); //полоса серая вертикальная 2 + temp_int = onLeft(220,160)/6; + IF (strlen(off)0) && (strlen(#path)>6) kolichestvo--; //фак! это бред! хз как оно работает - FOR (i=0;i<=kolichestvo;i++) //а папки всё выше и выше... + FOR (j=0;j<=kolichestvo;j++) //а папки вверх, файлы вниз { EAX=ESDWORD[off-40]; $shr eax,4 $and eax,1 - IF (EAX) {file_mas[k]=i; k++;} - ELSE {file_mas[kolichestvo-l]=i; l++;} + IF (EAX) {file_mas[k]=j; k++;} + ELSE {file_mas[kolichestvo-l]=j; l++;} off += 304; } //k=0; l=kolichestvo; @@ -506,19 +517,20 @@ void Del_Form() DrawFlatButton(temp_int+111,208,70,20,302,0xC6DFC6,"No"); del_active=1; } - + +f70 del_file_70; void Del_File(byte dodel) -{ +{ IF (dodel==true){ - run_file_70.func = 8; - run_file_70.flag = 0; - run_file_70.param= 0; - run_file_70.rez1 = 0; - run_file_70.rez2 = 0; - run_file_70.rezerv2 = 0; - run_file_70.stroka = #file_path; + del_file_70.func = 8; + del_file_70.param1 = 0; + del_file_70.param2 = 0; + del_file_70.param3 = 0; + del_file_70.param4 = 0; + del_file_70.rezerv = 0; + del_file_70.name = #file_path; $mov eax,70 - $mov ebx,#run_file_70.func + $mov ebx,#del_file_70.func $int 0x40} del_active=0; DeleteButton(301); DeleteButton(302); //удаляем кнопочки Yes/No @@ -583,11 +595,12 @@ void Devices() IF (dev_name[0]=='r') { copystr("RAM-disk /rd/1/",#drive_name); dev_icon=0; } WriteText(45,i*16+79,0x80,0,#drive_name,0); PutImage(dev_icon*14*13*3+#devices,14,13,26,i*16+76); - } + } Actions(); //функции файлов и папок Preview(); } + void Actions() { DrawBar(22,dev_num*16+75,160,15,0x00699C); //синий прямоугольник - под девайсами @@ -616,33 +629,6 @@ void Actions() } -/*void Dir_Up() -{ - byte temp_[256]; - i=strlen(#path)-1; - path[i]=0x00; - do i--; while (path[i]<>'/'); copystr(#path+i+1,#temp_); - path[i+1]=0x00; - ChangeCase(#temp_); - za_kadrom=curbtn=0; //вверх списка - Open_Dir(#path,2); - FOR (i=kolichestvo; i>0; i--;) IF(strcmp(file_mas[i]*304+buf+72,#temp_)==0) BREAK; - // - IF (i0) za_kadrom=i; ELSE za_kadrom=i-1;} - ELSE {za_kadrom=kolichestvo-but_num; curbtn=i-kolichestvo+but_num;} - List_ReDraw(); -}*/ - -/*void Dir_Up() -{ - i=strlen(#path)-1; - do i--; while (path[i]<>'/'); - path[i+1]=0x00; - za_kadrom=0; curbtn=0; //вверх списка - Open_Dir(#path,1); -}*/ - -//баг - если сверху, то сверху,а не снизу void Dir_Up() { byte temp_[256]; @@ -668,7 +654,7 @@ void Dir_Up() void Preview() { dword top_pr=dev_num*16+123; - top_pr+=show_actions*51; //ничинаем ниже, если Акшнс видимы + top_pr+=show_actions*51; //начинаем ниже, если Экшнс видимы DeleteButton(78); if (show_preview==1) { @@ -680,8 +666,8 @@ void Preview() //WriteText(30,top_pr+60,0x80,0,"ra_kadrom:",0); WriteText(105,top_pr+60,0x80,0,IntToStr(za_kadrom),0); //WriteText(30,top_pr+70,0x80,0,#file_path,0); //WriteText(30,top_pr+80,0x80,0,#file_name,0); - WriteText(30,top_pr+60,0x80,0,"Not realized... Yet.",0); - //WriteText(30,top_pr+70,0x80,0,"Nable, I'm waiting (:",0); + WriteText(30,top_pr+60,0x80,0,"Not realized... I think",0); + WriteText(30,top_pr+70,0x80,0,"it will be realired soon.",0); DrawBar(22,top_pr+118,160,onTop(top_pr+118,6),0x00699C); //синее } ELSE { diff --git a/programs/fs/Eolite/trunk/imgs/imgs.zip b/programs/fs/Eolite/trunk/imgs/imgs.zip index f34d2a1169..eb2b59e14f 100644 Binary files a/programs/fs/Eolite/trunk/imgs/imgs.zip and b/programs/fs/Eolite/trunk/imgs/imgs.zip differ diff --git a/programs/fs/Eolite/trunk/include/LVabout.c-- b/programs/fs/Eolite/trunk/include/LVabout.c-- index af5b1b9ec3..a901b3757c 100644 --- a/programs/fs/Eolite/trunk/include/LVabout.c-- +++ b/programs/fs/Eolite/trunk/include/LVabout.c-- @@ -1,34 +1,4 @@ -#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(); -}*/ - +#include "imgs\logo.txt" void authors() { @@ -41,20 +11,19 @@ void authors() 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); + //PutImage(#logo,85,85,48,7); + PutPaletteImage(#logo,85,85,48,7,#logo_pal); + WriteText(38,100,0x80,0xBF40BF,"Eolite v0.97 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"); + DrawFlatButton(90,190,70,22,2,0xE4DFE1, "Close"); WindowRedrawStatus(2); } } - //ExitProcess(); } @@ -127,3 +96,5 @@ void Sort_by_Type(dword 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-- index edbeeadc84..7338fbe57d 100644 --- a/programs/fs/Eolite/trunk/include/icons_f.h-- +++ b/programs/fs/Eolite/trunk/include/icons_f.h-- @@ -2,67 +2,110 @@ 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);// + DrawBar(200,y,2,15,videlenie); + DrawBar(214,y,2,15,videlenie); + DrawBar(210,y,4,1,videlenie);//ле + DrawBar(211,y+1,3,1,videlenie);//сен + DrawBar(212,y+2,2,1,videlenie);//ка + DrawBar(213,y+3,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); //зелёная точка стрелки + DrawBar(200,y,1,15,videlenie); //слева линия + DrawBar(208,y,8,2,videlenie); //сверху справа линия + IF (filenum==17) DrawBar(211,y+1,1,1,0x1A7B17); //зелёная точка стрелки + DrawBar(201,y+13,15,2,videlenie); //снизу линия //.точки - 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); //какая разница где + PutPixel(201,y,videlenie); //сверху слева точка + PutPixel(207,y,videlenie); //сверху справа точка + PutPixel(215,y+2,videlenie); //какая разница где + PutPixel(201,y+12,videlenie); //слева снизу точка + PutPixel(215,y+12,videlenie); //справа снизу точка + } + IF (filenum==13) PutPixel(215,y,videlenie); //skin + IF (filenum==20) //картридж + { + DrawBar(200,y,16,2,videlenie); + DrawBar(200,y+11,1,2,videlenie); + DrawBar(215,y+11,1,2,videlenie); + DrawBar(200,y+13,16,2,videlenie); + } + IF (filenum==14) //video + {DrawBar(200,y,1,15,videlenie); DrawBar(215,y,1,15,videlenie);} + IF (filenum==21) //дискета + { PutPixel(200,y,videlenie); PutPixel(215,y,videlenie); } + IF (filenum==19) //изображение + DrawBar(200,y+14,16,1,videlenie); + if (filenum==22) //библиотека + { + DrawBar(200,y,16,1,videlenie); //сверху слева + DrawBar(200,y+1,3,1,videlenie); + DrawBar(200,y+2,2,1,videlenie); + PutPixel(200,y+3,videlenie); + // + PutPixel(215,y+11,videlenie); //справа справа + DrawBar(214,y+12,2,1,videlenie); + DrawBar(213,y+13,3,1,videlenie); + DrawBar(212,y+14,4,1,videlenie); + } + if (filenum==15) //архив + { + PutPixel(200,y,videlenie); //справа справа + DrawBar(213,y,3,1,videlenie); + DrawBar(214,y+1,2,1,videlenie); + PutPixel(215,y+2,videlenie); + PutPixel(200,y+11,videlenie); + DrawBar(200,y+12,2,1,videlenie); + DrawBar(200,y+13,3,1,videlenie); + DrawBar(200,y+14,4,1,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 } +#include "imgs\icons.txt" 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";} + IF (!strcmp(extension,".kex")) {fnum = 6; ftype="Program";} + IF (!strcmp(extension,".cvs")) {fnum = 18; ftype="Graph";} + IF (!strcmp(extension,".cmd")) || (!strcmp(extension,".bat")) {fnum = 5; ftype="CMD skript";} + IF (!strcmp(extension,".skn")) {fnum = 13; ftype="Skin";} + IF (!strcmp(extension,".chr"))|| (!strcmp(extension+1,".mt")) || (!strcmp(extension,".ttf")) || (!strcmp(extension,".fon")) {fnum = 10; ftype="Font";} + IF (!strcmp(extension,".asm")) {fnum = 11; ftype="Source";} + IF (!strcmp(extension,".inc")) fnum = 9; + IF (!strcmp(extension,".exe")) || (!strcmp(extension,".msi")) {fnum = 7; ftype="Win32 Exec";} + IF (!strcmp(extension,".com")) fnum = 5; + IF (!strcmp(extension,".cpp")) {fnum = 3; ftype="C++ code";} + IF (!strcmp(extension,".nes")) {fnum = 20; ftype="Cartridge";} + IF (!strcmp(extension,".img")) || (!strcmp(extension,".ima")) {fnum = 21; ftype="Image";} + IF (!strcmp(extension,".dll")) || (!strcmp(extension,".obj")) {fnum = 22; ftype="Library";} + IF (!strcmp(extension,".sys")) || (!strcmp(extension,".ocx")) fnum = 8; + IF (!strcmp(extension,".ini")) || (!strcmp(extension,"conf")) {fnum = 4; ftype="Config";} + IF (!strcmp(extension,".htm")) || (!strcmp(extension,"html")) {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,".txt")) || (!strcmp(extension,".doc")) || + (!strcmp(extension,".rtf")) {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,".gif")) || (!strcmp(extension,".bmp")) || + (!strcmp(extension,".tga")) || (!strcmp(extension,".pcx")) || + (!strcmp(extension,".png")) || (!strcmp(extension,".jpg")) || + (!strcmp(extension,"jpeg")) || (!strcmp(extension,".raw")) {fnum = 19; 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";} + IF (!strcmp(extension,".rar")) || (!strcmp(extension,".zip")) || + (!strcmp(extension,".cab")) || (!strcmp(extension,".tar")) || + (!strcmp(extension,".ajr")) || (!strcmp(extension,".jar")) || + (!strcmp(extension+1,".7z")){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);} + IF (!strcmp(extension,".mp3")) {fnum = 12; ftype="Music";} + IF (!strcmp(extension,".wav")) || (strcmp(extension,".mid")==0) || + (!strcmp(extension,"midi")) || (strcmp(extension,".ogg")==0) {fnum = 12; ftype="Audio";} + //video + IF (!strcmp(extension,".avi")) || (!strcmp(extension,".flv")) || (!strcmp(extension,".mpg")) || + (!strcmp(extension,".wmv")) {fnum = 14; ftype="Video";} + //папки + IF (!strcmp(extension,"")) { fnum=16; WriteText(onLeft(140,0),yy+4,0x80,0,extension,0);} + IF (!strcmp(extension,"..")) fnum=17; // - PutImage(fnum*16*15*3+#ficons,16,15,200,yy-26); - WriteText(onLeft(155,0),yy-22,0x80,0,ftype,0); + PutPaletteImage(fnum*16*15+#ficons,16,15,200,yy,#ficons_pal); + WriteText(onLeft(155,0),yy+4,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-- index f9cb423eba..954bb9f6f6 100644 --- a/programs/fs/Eolite/trunk/include/run_file.h-- +++ b/programs/fs/Eolite/trunk/include/run_file.h-- @@ -1,28 +1,17 @@ -#include "imgs\icons.cpp" - -struct { - int func; - int flag; - int param; - int rez1; - int rez2; - char rezerv2; - int stroka; -}run_file_70; - +f70 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; + run_file_70.param1 = 0; + run_file_70.param2 = run_param; + run_file_70.param3 = 0; + run_file_70.param4 = 0; + run_file_70.rezerv = 0; + run_file_70.name = run_path; $mov eax,70 $mov ebx,#run_file_70.func $int 0x40 @@ -50,43 +39,46 @@ void Run_File(dword fpath) 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,".skn")) copystr("desktop",fpath); + IF (!strcmp(#extension,".avi")) copystr("/sys/kvid",fpath); + IF (!strcmp(#extension,".mpg")) copystr("/sys/kvid",fpath); + IF (!strcmp(#extension,".htm")) copystr("/sys/network/HTMLv",fpath); + IF (!strcmp(#extension,"html")) 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); + IF (!strcmp(#extension,".3ds")) copystr("/sys/demos/3d/view3ds",fpath); + IF (!strcmp(#extension,".lif")) copystr("/sys/demos/life2",fpath); + IF (!strcmp(#extension,".cvs")) copystr("graph",fpath); + IF (!strcmp(#extension,".nes")) copystr("/sys/games/fce",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); + IF (!strcmp(#extension,".mp3")) copystr("AC97SND",fpath); + IF (!strcmp(#extension,".wav")) copystr("AC97SND",fpath); + IF (!strcmp(#extension,".mid")) copystr("MIDAMP",fpath); + IF (!strcmp(#extension,"midi")) 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,".rtf")) copystr("RtfRead",fpath); + IF (!strcmp(#extension,".txt")) copystr("TinyPad",fpath); + IF (!strcmp(#extension,".inc")) copystr("TinyPad",fpath); + IF (!strcmp(#extension,".ini")) copystr("TinyPad",fpath); + IF (!strcmp(#extension,".dat")) copystr("TinyPad",fpath); + IF (!strcmp(#extension,".asm")) copystr("TinyPad",fpath); + IF (!strcmp(#extension,".cpp")) copystr("TinyPad",fpath); //изображения - 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 не изменился, то это таки, наверное, прога, параметров нет. + IF (!strcmp(#extension,".gif")) copystr("MV",fpath); //GifView,MenuAnimage + IF (!strcmp(#extension,".bmp")) copystr("MV",fpath); //BmpMenu1,MenuAnimage + IF (!strcmp(#extension,".tga")) copystr("MV",fpath); + IF (!strcmp(#extension,".pcx")) copystr("MV",fpath); + IF (!strcmp(#extension,".cur")) copystr("MV",fpath); + IF (!strcmp(#extension,".ico")) copystr("MV",fpath); + IF (!strcmp(#extension,".png")) copystr("@rcher",fpath); + IF (!strcmp(#extension,".jpg")) copystr("JpegView",fpath); + IF (!strcmp(#extension,"jpeg")) copystr("JpegView",fpath); + IF (!strcmp(fpath,#fparam)) fparam=''; //если fpath не изменился, то это таки, наверное, прога, параметров нет. Run_Program(fpath, #fparam); //запуск! } diff --git a/programs/fs/Eolite/trunk/lib/kolibri.h-- b/programs/fs/Eolite/trunk/lib/kolibri.h-- index 898cbf3e2f..5df4293a02 100644 --- a/programs/fs/Eolite/trunk/lib/kolibri.h-- +++ b/programs/fs/Eolite/trunk/lib/kolibri.h-- @@ -11,12 +11,11 @@ dword alloc_mem = 0x00100000; dword x86esp_reg = 0x00100000; // 0x0007fff0; dword I_Param = #param; dword I_Icon = 0x0; -dword skin_width; - +dword skin_width; char param[256]=""; //Events -#define evMouse 6 +#define evMouse 6 #define evButton 3 #define evKey 2 #define evReDraw 1 @@ -121,10 +120,11 @@ inline fastcall dword WaitEvent(){ $int 0x40 } -inline fastcall void ExitProcess(){ - EAX = -1; // close this program - $int 0x40 -} +/*inline fastcall void SetEventMask(dword EBX){ + $mov eax,40 + //$mov ebx,100111b + $int 0x40 +}*/ inline fastcall word GetKey(){ EAX = 2; // just read this key from buffer @@ -138,166 +138,64 @@ inline fastcall word GetButtonID(){ EAX = EAX >> 8; } +inline fastcall void ExitProcess(){ + EAX = -1; // close this program + $int 0x40 +} -inline fastcall void DrawTitle(dword ECX) +/*void Pause(dword EBX) +{ //Џ г§ , ў б®вле ¤®«пе ᥪ㭤л EBX = value + $mov eax, 5 + $int 0x40 +}*/ + +//------------------------------------------------------------------------------ +void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword + mainAreaColor,byte headerType,dword headerColor,EDI) { + EBX = x << 16 + sizeX; + ECX = y << 16 + sizeY; + EDX = mainAreaType << 24 | mainAreaColor; + ESI = headerType << 24 | headerColor; + $xor eax,eax + $int 0x40 +} + +inline fastcall void DrawTitle(dword ECX){ EAX = 71; EBX = 1; $int 0x40; } -inline fastcall dword GetSkinWidth() -{ + +inline fastcall void WindowRedrawStatus(dword EBX){ + EAX = 12; //tell os about windowdraw + $int 0x40 +} + +inline fastcall dword GetSkinWidth(){ EAX = 48; EBX = 4; $int 0x40 } - -inline fastcall void DeleteButton(dword EDX) -{ - EAX = 8; - EDX = EDX + BT_DEL; - $int 0x40; +inline fastcall dword MoveSize(dword EBX,ECX,EDX,ESI){ + EAX = 67; + $int 0x40 } +//------------------------------------------------------------------------------ -inline fastcall dword strlen(dword EDI) -{ -#speed +inline fastcall dword strlen(dword EDI){ ECX=EAX=0; ECX--; $REPNE $SCASB - EAX=EAX-2-ECX; -#codesize + EAX-=2+ECX; } -inline fastcall int strcmp(dword EAX,EBX) +inline fastcall copystr(dword ESI,EDI) { -#speed - ESI=EAX; - EBX--; -TOP: - EBX++; - $LODSB - $CMP AL,0 - $JE HERE - $CMP DSBYTE[EBX],AL - $JE TOP -HERE: - AL-=DSBYTE[EBX]; - return AL; -#codesize -} - - -inline fastcall dword ChangeCase(dword EDX) -{ -#speed - AL=DSBYTE[EDX]; - IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f; - EDX++; - do{ - AL=DSBYTE[EDX]; - IF(AL>='A')&&(AL<='Z')DSBYTE[EDX]=AL|0x20; - EDX++; - }while(AL!=0); -#codesize -} - - -inline fastcall void WindowRedrawStatus(dword EBX) -{ - EAX = 12; // function 12:tell os about windowdraw - $int 0x40 -} - - -void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI) -{ - EBX = x << 16 + sizeX; - ECX = y << 16 + sizeY; - EDX = mainAreaType << 24 | mainAreaColour; - ESI = headerType << 24 | headerColour; - $xor eax,eax - $int 0x40 -} - - -inline fastcall void SetEventMask(dword EBX,ECX,EDX) //Coded by Leency :D -{ - $mov eax,40 - $mov ebx,100111b - $int 0x40 -} - -void DefineButton(dword x,y,w,h,EDX,ESI) -{ - EAX = 8; - EBX = x<<16+w; - ECX = skin_width+y<<16+h; - $int 0x40 -} - -void WriteText(dword x,y,byte fontType, dword color, EDX, ESI) -{ - EAX = 4; - EBX = x<<16+skin_width+y; - ECX = fontType<<24+color; - $int 0x40; -} - -inline fastcall void PutPixel(dword EBX,ECX,EDX) -{ - EAX=1; - $int 0x40 -} - -void DrawBar(dword x,y,w,h,EDX) -{ -#speed - EAX = 13; - EBX = x<<16+w; - ECX = skin_width+y<<16+h; - $int 0x40 -#codesize -} - -void DrawRegion(dword x,y,width,height,color1) -{ - DrawBar(x,y,width,1,color1); //Ї®«®б  Ј®а ᢥаег - DrawBar(x,y+height,width,1,color1); //Ї®«®б  Ј®а б­Ё§г - DrawBar(x,y,1,height,color1); //Ї®«®б  ўҐаег б«Ґў  - DrawBar(x+width,y,1,height+1,color1); //Ї®«®б  ўҐаег бЇа ў  -} - -void DrawFlatButton(dword x,y,width,height,id,color,text) -{ - DrawRegion(x,y,width,height,0x94AECE); - DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //Ї®«®б  Ј®а ЎҐ« п - DrawBar(x+1,y+height-1,width-2,1,0xC7C7C7); //ўҐ­¬ ўҐаў - DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //Ї®«®б  ўҐаў ЎҐ« Ї - DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //ўҐ­¬ ўҐаў - DrawBar(x+2,y+2,width-3,height-3,color); //§ «ЁўЄ  - IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //®ЇаҐ¤Ґ«ЇҐ¬ Є­®ЇЄЈ - WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0); -} - - -void PutImage(dword EBX,w,h,x,y) -{ - EAX = 7; - ECX = w<<16+h; - EDX = x<<16+y+skin_width; - $int 0x40 -} - - -void copystr(dword s,d) -{ - $mov esi,s - $mov edi,d $cld l1: $lodsb @@ -307,7 +205,6 @@ l1: } -int j=0; char buffer[11]=""; inline fastcall dword IntToStr(dword ESI) { @@ -337,12 +234,117 @@ f3: } -inline fastcall dword MoveSize(dword EBX,ECX,EDX,ESI) +inline fastcall int strcmp(dword EAX,EBX) { - EAX = 67; + #speed + ESI=EAX; + EBX--; +TOP: + EBX++; + $LODSB + $CMP AL,0 + $JE HERE + $CMP DSBYTE[EBX],AL + $JE TOP +HERE: + AL-=DSBYTE[EBX]; + return AL; + #codesize +} + + +inline fastcall dword ChangeCase(dword EDX) +{ + #speed + AL=DSBYTE[EDX]; + IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f; + EDX++; + do{ + AL=DSBYTE[EDX]; + IF(AL>='A')&&(AL<='Z')DSBYTE[EDX]=AL|0x20; + EDX++; + }while(AL!=0); + #codesize +} + +//------------------------------------------------------------------------------ +inline fastcall void PutPixel(dword EBX,ECX,EDX){ + EAX=1; + ECX+=skin_width; + $int 0x40 +} + +void DefineButton(dword x,y,w,h,EDX,ESI){ + EAX = 8; + EBX = x<<16+w; + ECX = skin_width+y<<16+h; $int 0x40 } +inline fastcall void DeleteButton(dword EDX) +{ + EAX = 8; + EDX += BT_DEL; + $int 0x40; +} + +void WriteText(dword x,y,byte fontType, dword color, EDX, ESI) +{ + EAX = 4; + EBX = x<<16+skin_width+y; + ECX = fontType<<24+color; + $int 0x40; +} + +void DrawBar(dword x,y,w,h,EDX) +{ + #speed + EAX = 13; + EBX = x<<16+w; + ECX = skin_width+y<<16+h; + $int 0x40 + #codesize +} + +void DrawRegion(dword x,y,width,height,color1) +{ + DrawBar(x,y,width,1,color1); //Ї®«®б  Ј®а ᢥаег + DrawBar(x,y+height,width,1,color1); //Ї®«®б  Ј®а б­Ё§г + DrawBar(x,y,1,height,color1); //Ї®«®б  ўҐаег б«Ґў  + DrawBar(x+width,y,1,height+1,color1); //Ї®«®б  ўҐаег бЇа ў  +} + +void DrawFlatButton(dword x,y,width,height,id,color,text) +{ + DrawRegion(x,y,width,height,0x94AECE); + DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //Ї®«®б  Ј®а ЎҐ« п + DrawBar(x+1,y+height-1,width-2,1,0xC7C7C7); //ўҐ­¬ ўҐаў + DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //Ї®«®б  ўҐаў ЎҐ« Ї + DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //ўҐ­¬ ўҐаў + DrawBar(x+2,y+2,width-3,height-3,color); //§ «ЁўЄ  + IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //Є­®ЇЄ  + WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0); +} + +void PutImage(dword EBX,w,h,x,y) +{ + EAX = 7; + ECX = w<<16+h; + EDX = x<<16+y+skin_width; + $int 0x40 +} + +void PutPaletteImage(dword EBX,w,h,x,y, EDI) +{ + EAX = 65; + ECX = w<<16+h; + EDX = x<<16+y+skin_width; + ESI = 8; + EBP = 0; + $int 0x40 +} + +//------------------------------------------------------------------------------ f70 CopyFile_f; BDVK CopyFile_atr; @@ -360,7 +362,7 @@ inline fastcall dword CopyFile(dword EBX,ECX) $mov ebx, #CopyFile_f $int 0x40 - if (EAX == 0) + if (!EAX) { cBufer = malloc(CopyFile_atr.sizelo); CopyFile_f.func = 0; @@ -374,7 +376,7 @@ inline fastcall dword CopyFile(dword EBX,ECX) $mov ebx, #CopyFile_f $int 0x40 - IF (EAX == 0) + IF (!EAX) { CopyFile_f.func = 2; CopyFile_f.param1 = 0;