forked from KolibriOS/kolibrios
Eolite 0.98.5
git-svn-id: svn://kolibrios.org@984 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
5628c096c5
commit
5e2872af34
@ -1,9 +1,7 @@
|
|||||||
//Leency & Veliant -=- KolibriOS Team -=- 2008
|
//Leency & Veliant -=- KolibriOS Team -=- 2008
|
||||||
|
|
||||||
//ñòðîêà 258, êåéàï!
|
//ñòðîêà 258, êåéàï!
|
||||||
//find_symbol íàäî ÷èòàòü ñ êîíöà
|
|
||||||
//DrawBar(sort_num[1],45,6,9,0xE4DFE1);
|
//DrawBar(sort_num[1],45,6,9,0xE4DFE1);
|
||||||
//Open_Dir íàõðåí èñïàãàíåí èôàìè, ñäåëàòü äåôàéëû èëè åù¸ ÷òî-òî, ïîòîìó ÷òî ïîêà ýòî âûãëÿäèò íåêðàñèâî
|
|
||||||
|
|
||||||
#codesize
|
#codesize
|
||||||
#include "lib\kolibri.h--"
|
#include "lib\kolibri.h--"
|
||||||
@ -13,12 +11,12 @@
|
|||||||
#include "imgs\toolbar.txt"
|
#include "imgs\toolbar.txt"
|
||||||
#include "imgs\left_p.txt"
|
#include "imgs\left_p.txt"
|
||||||
|
|
||||||
//ëîêàëèçàöèÿ è íàñòðîéêè
|
//ïåðåìåííûå
|
||||||
#define title "Eolite File Manager v0.98.3"
|
#define title "Eolite File Manager v0.98.5"
|
||||||
#define videlenie 0x94AECE //0x94AECE,0xFEA4B7,0x8BCDFF,0xB8C9B8}; //öâåò âûäåëåííîãî ýëåìåíòà èç ñïèñêà ôàéëîâ
|
#define videlenie 0x94AECE //0xFEA4B7,0x8BCDFF,0xB8C9B8}; //öâåò âûäåëåííîãî ýëåìåíòà èç ñïèñêà ôàéëîâ
|
||||||
byte toolbar_buttons_x[6]={9,46,85,134,167,203};
|
byte toolbar_buttons_x[6]={9,46,85,134,167,203};
|
||||||
//
|
//
|
||||||
dword but_num,
|
int but_num,
|
||||||
count,
|
count,
|
||||||
za_kadrom,
|
za_kadrom,
|
||||||
curbtn,
|
curbtn,
|
||||||
@ -39,23 +37,24 @@ byte path[256]="/rd/1/",
|
|||||||
byte PathHistory[2560];
|
byte PathHistory[2560];
|
||||||
|
|
||||||
dword file_mas[6898];
|
dword file_mas[6898];
|
||||||
int temp_int, j, i;
|
int j, i;
|
||||||
|
|
||||||
dword stak[100]=0; //îêíî About
|
dword stak[100]=0; //îêíî About
|
||||||
|
|
||||||
edit_box edit1= {250,247,17,0xffffff,0x94AECE,0xD3DDEB,0xffffff,0,248,#edit_path,64,6,6};
|
edit_box edit1= {250,247,13,0xffffff,videlenie,0xD3DDEB,0xffffff,0,248,#edit_path,64,6,6};
|
||||||
edit_box edit2= {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,64,6,6};
|
edit_box edit2= {250,213,80,0xFFFFCC,videlenie,0xFFFFCC,0xffffff,0,248,#file_name,64,6,6};
|
||||||
|
|
||||||
proc_info Form;
|
proc_info Form;
|
||||||
dword buf=0, off; //äëÿ òåêñòà è áóôåðà
|
dword buf, off; //äëÿ òåêñòà è áóôåðà
|
||||||
dword devbuf=0, dev_num;
|
dword devbuf, dev_num;
|
||||||
#include "include\LVabout.h--"
|
#include "include\LVabout.h--"
|
||||||
#include "include\sorting.h--"
|
#include "include\sorting.h--"
|
||||||
#include "include\icons_f.h--"
|
#include "include\icons_f.h--"
|
||||||
|
#include "include\ini.h--"
|
||||||
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
byte key, id;
|
word key, id;
|
||||||
mouse m;
|
mouse m;
|
||||||
int pressed_y;
|
int pressed_y;
|
||||||
{
|
{
|
||||||
@ -64,6 +63,7 @@ int pressed_y;
|
|||||||
ReadDir(10, devbuf, "/");
|
ReadDir(10, devbuf, "/");
|
||||||
dev_num=EBX;
|
dev_num=EBX;
|
||||||
IF (param[0]<>'') {copystr(#param,#edit_path); Goto_edit_path();} ELSE Open_Dir(#path,2); //áûë ëè çàïóñê ñ ïàðàìåòðîì
|
IF (param[0]<>'') {copystr(#param,#edit_path); Goto_edit_path();} ELSE Open_Dir(#path,2); //áûë ëè çàïóñê ñ ïàðàìåòðîì
|
||||||
|
//GetIni("/sys/File managers/Eolite.ini");
|
||||||
loop()
|
loop()
|
||||||
{
|
{
|
||||||
switch(WaitEvent())
|
switch(WaitEvent())
|
||||||
@ -105,11 +105,11 @@ int pressed_y;
|
|||||||
if (m.x>=Form.width-21) && (m.x<=Form.width-6) while (m.lkm)
|
if (m.x>=Form.width-21) && (m.x<=Form.width-6) while (m.lkm)
|
||||||
{
|
{
|
||||||
IF (scroll_size/2+57>m.y) || (m.y<0) || (m.y>4000) m.y=scroll_size/2+57; //åñëè êóðñîð íàä îêíîì
|
IF (scroll_size/2+57>m.y) || (m.y<0) || (m.y>4000) m.y=scroll_size/2+57; //åñëè êóðñîð íàä îêíîì
|
||||||
temp_int=za_kadrom; //ñîõðàíÿåì ñòàðîå êîëè÷åñòâî
|
id=za_kadrom; //ñîõðàíÿåì ñòàðîå êîëè÷åñòâî
|
||||||
j= scroll_size/2;
|
j= scroll_size/2;
|
||||||
za_kadrom = m.y -j -57 * count / onTop(22,57);
|
za_kadrom = m.y -j -57 * count; za_kadrom /= onTop(22,57);
|
||||||
IF (but_num+za_kadrom>count) za_kadrom=count-but_num;
|
IF (but_num+za_kadrom>count) za_kadrom=count-but_num;
|
||||||
IF (temp_int<>za_kadrom) List_ReDraw(); //÷òîá ëèøíèé ðàç íå ïåðåðèñîâûâàòü
|
IF (id<>za_kadrom) List_ReDraw(); //÷òîá ëèøíèé ðàç íå ïåðåðèñîâûâàòü
|
||||||
m.get();
|
m.get();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -140,7 +140,7 @@ int pressed_y;
|
|||||||
break;
|
break;
|
||||||
case 78: //preview
|
case 78: //preview
|
||||||
IF (show_preview==1) show_preview=0; ELSE show_preview=1;
|
IF (show_preview==1) show_preview=0; ELSE show_preview=1;
|
||||||
Preview();
|
Preview(ANIM);
|
||||||
break;
|
break;
|
||||||
case 77: //actions
|
case 77: //actions
|
||||||
IF (show_actions==1) show_actions=0; ELSE show_actions=1;
|
IF (show_actions==1) show_actions=0; ELSE show_actions=1;
|
||||||
@ -171,8 +171,8 @@ int pressed_y;
|
|||||||
if (id<200) break; //êíîïêè èç ñïèñêà ôàéëîâ
|
if (id<200) break; //êíîïêè èç ñïèñêà ôàéëîâ
|
||||||
IF (curbtn!=id-201) {FileList_ReDraw(id-201-curbtn); break;}
|
IF (curbtn!=id-201) {FileList_ReDraw(id-201-curbtn); break;}
|
||||||
else OPEN_MARK:
|
else OPEN_MARK:
|
||||||
if (!isdir) Run_File(#file_path); else
|
if (!isdir) GetIni("/sys/File managers/Eolite.ini"); ELSE //Run_File(#file_path); ELSE
|
||||||
if (strcmp(#file_name,"..")==0) Dir_Up(); else
|
IF (strcmp(#file_name,"..")==0) Dir_Up(); ELSE
|
||||||
{ OPEN_DEV:
|
{ OPEN_DEV:
|
||||||
copystr(#file_path, #path);
|
copystr(#file_path, #path);
|
||||||
copystr("/", #path+strlen(#path));
|
copystr("/", #path+strlen(#path));
|
||||||
@ -190,14 +190,14 @@ int pressed_y;
|
|||||||
IF (key==027) Del_File(false);
|
IF (key==027) Del_File(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
IF (edit1.flags<>64) && IF (edit1.flags<>0) && (key<>13) {EAX=key<<8; edit_box_key stdcall (#edit1); break;}
|
IF (edit1.flags<>64) && (edit1.flags<>0) && (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;}
|
IF (edit2.flags<>64) && (key<>13) && (key<>27) {EAX=key<<8; edit_box_key stdcall (#edit2); break;}
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case 209...217: id=key-109; GOTO DEVICE_MARK;
|
case 209...217: id=key-109; GOTO DEVICE_MARK;
|
||||||
case 8: GoBack(); break; //Íàçàä
|
case 8: GoBack(); break; //Íàçàä
|
||||||
case 014: MoveSize(80,80,OLD,OLD); RunProgram("/sys/File Managers/Eolite", #path); break; //íîâîå îêíî
|
case 014: MoveSize(80,80,OLD,OLD); RunProgram("/sys/File Managers/Eolite", #path); break; //íîâîå îêíî
|
||||||
case 024: //Ctrl+X cut
|
case 024: //Ctrl+X cut
|
||||||
case 089: //Ctrl+Ins copy
|
case 089: //Ctrl+Ins copy
|
||||||
case 003: //Ctrl+C copy
|
case 003: //Ctrl+C copy
|
||||||
CTRLC_MARK:
|
CTRLC_MARK:
|
||||||
@ -207,10 +207,10 @@ int pressed_y;
|
|||||||
break;
|
break;
|
||||||
case 022: Paste(); break;//Ctrl+V paste
|
case 022: Paste(); break;//Ctrl+V paste
|
||||||
case 027: //Esc
|
case 027: //Esc
|
||||||
IF (rename_active==1) {Line_ReDraw(videlenie, 100);}
|
IF (rename_active==1) ReName(false);
|
||||||
break;
|
break;
|
||||||
case 013: //Enter
|
case 013: //Enter
|
||||||
IF (rename_active==1) {Line_ReDraw(videlenie, curbtn); break;}
|
IF (rename_active==1) {ReName(true); break;}
|
||||||
IF (strcmp(#path,#edit_path)<>0) Goto_edit_path();
|
IF (strcmp(#path,#edit_path)<>0) Goto_edit_path();
|
||||||
ELSE GOTO OPEN_MARK;
|
ELSE GOTO OPEN_MARK;
|
||||||
break;
|
break;
|
||||||
@ -273,47 +273,39 @@ int pressed_y;
|
|||||||
|
|
||||||
|
|
||||||
inline fastcall void draw_window()
|
inline fastcall void draw_window()
|
||||||
{
|
{
|
||||||
WindowRedrawStatus(1);
|
WindowRedrawStatus(1);
|
||||||
skin_width = GetSkinWidth();
|
DefineAndDrawWindow(100,100,600,410,0x73,0x10E4DFE1,0,0,title);
|
||||||
DefineAndDrawWindow(100,100,600,410,0x73,0x10E4DFE1,0,0,title);
|
WindowRedrawStatus(2);
|
||||||
Form.GetInfo(SelfInfo);
|
Form.GetInfo(SelfInfo);
|
||||||
IF (Form.height==skin_width+3) {WindowRedrawStatus(2); return;} //íè÷åãî íå äåëàòü åñëè îêíî ñõëîïíóòî â çàãîëîâîê
|
IF (Form.height==GetSkinWidth()+3) return; //íè÷åãî íå äåëàòü åñëè îêíî ñõëîïíóòî â çàãîëîâîê
|
||||||
IF (Form.height<280) MoveSize(OLD,OLD,OLD,280);
|
IF (Form.height<280) MoveSize(OLD,OLD,OLD,280);
|
||||||
IF (Form.width<480) MoveSize(OLD,OLD,480,OLD);
|
IF (Form.width<480) MoveSize(OLD,OLD,480,OLD);
|
||||||
//toolbar buttons
|
//toolbar buttons
|
||||||
PutPaletteImage(#toolbar,246,39,0,0,#toolbar_pal);
|
PutPaletteImage(#toolbar,246,39,0,0,#toolbar_pal);
|
||||||
FOR (j=0; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,0xE4DFE1);
|
FOR (j=0; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,0xE4DFE1);
|
||||||
//ïîëîñà àäðåñà
|
//ïîëîñà àäðåñà
|
||||||
DrawBar(246,0,onLeft(246,60),12,0xE4DFE1); //ôîí íàä ïîëîñîé àäðåñà
|
|
||||||
edit1.width=Form.width-314;
|
edit1.width=Form.width-314;
|
||||||
edit1.top=13;
|
DrawBar(246,0,onLeft(246,60),12,0xE4DFE1); //ôîí íàä ïîëîñîé àäðåñà
|
||||||
KEdit();
|
|
||||||
DrawRegion_3D(246,12,onLeft(66,246),16,0x94AECE,0x94AECE); //îáîäîê
|
|
||||||
DrawBar(246,29,onLeft(246,60),10,0xE4DFE1); //ôîí ïîä ïîëîñîé àäðåñà
|
DrawBar(246,29,onLeft(246,60),10,0xE4DFE1); //ôîí ïîä ïîëîñîé àäðåñà
|
||||||
|
DrawRegion_3D(246,12,onLeft(66,246),16,0x94AECE,0x94AECE); //îáîäîê
|
||||||
DefineButton(onLeft(34,0),6,27,28,30+BT_HIDE+BT_NOFRAME,0xE4DFE1); //about
|
DefineButton(onLeft(34,0),6,27,28,30+BT_HIDE+BT_NOFRAME,0xE4DFE1); //about
|
||||||
DefineButton(onLeft(66,0),12,18,16,27+BT_HIDE,0xE4DFE1); //êíîïêà ïåðåõîäà
|
DefineButton(onLeft(66,0),12,18,16,27+BT_HIDE,0xE4DFE1); //êíîïêà ïåðåõîäà
|
||||||
PutPaletteImage(#goto_about,56,40,Form.width-65,0,#goto_about_pal);
|
PutPaletteImage(#goto_about,56,40,Form.width-65,0,#goto_about_pal);
|
||||||
//ïðÿìîóãîëüíèêè âíóòðè
|
//ïðÿìîóãîëüíèêè âíóòðè
|
||||||
DrawRegion_3D(1,40,Form.width-12,Form.height-skin_width-46,0x94AECE,0x94AECE); //ñèíèé îáîäîê
|
DrawRegion_3D(1,40,Form.width-12,onTop(46,0),0x94AECE,0x94AECE); //ñèíèé îáîäîê
|
||||||
DrawRegion_3D(0,39,Form.width-10,Form.height-skin_width-44,0xE4DFE1,0xE4DFE1); //ôîí
|
DrawRegion_3D(0,39,Form.width-10,onTop(44,0),0xE4DFE1,0xE4DFE1); //ôîí
|
||||||
Devices(); //ïàíåëü ñëåâà íà ñèíåì ôîíå
|
Devices(); //ïàíåëü ñëåâà íà ñèíåì ôîíå
|
||||||
//SortButtons
|
//SortButtons
|
||||||
DrawFlatButton(192,40,onLeft(192,168),16,31,0xE4DFE1,"File");
|
DrawFlatButton(192,40,onLeft(192,168),16,31,0xE4DFE1,"File");
|
||||||
DrawFlatButton(onLeft(168,0),40,73,16,32,0xE4DFE1,"Type");
|
DrawFlatButton(onLeft(168,0),40,73,16,32,0xE4DFE1,"Type");
|
||||||
DrawFlatButton(onLeft(95,0),40,68,16,33,0xE4DFE1,"Size");
|
DrawFlatButton(onLeft(95,0),40,68,16,33,0xE4DFE1,"Size");
|
||||||
//
|
//Ïåðåðèñîâûâàåì ñïèñîê
|
||||||
//sort_type[1]=onLeft(192,168)/2+210;
|
Open_Dir(#path,ONLY_SHOW);
|
||||||
//sort_type[2]=onLeft(115,0);
|
|
||||||
//sort_type[3]=onLeft(44,0);
|
|
||||||
//ïðîêðóòêà
|
//ïðîêðóòêà
|
||||||
DrawBar(onLeft(27,0),57,1,onTop(22,57),0x94AECE); //ëèíèÿ ñëåâà îò ïðîêðóòêè
|
DrawBar(onLeft(27,0),57,1,onTop(22,57),0x94AECE); //ëèíèÿ ñëåâà îò ïðîêðóòêè
|
||||||
DrawFlatButton(onLeft(27,0),40,16,16,0,0xE4DFE1,"\x18"); //ïðîêðóòêà ââåðõ
|
DrawFlatButton(onLeft(27,0),40,16,16,0,0xE4DFE1,"\x18"); //ïðîêðóòêà ââåðõ
|
||||||
DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,0xE4DFE1,"\x19");//ïðîêðóòêà âíèç
|
DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,0xE4DFE1,"\x19");//ïðîêðóòêà âíèç
|
||||||
//
|
|
||||||
Open_Dir(#path,3);
|
|
||||||
//
|
|
||||||
WindowRedrawStatus(2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -321,11 +313,6 @@ void KEdit()
|
|||||||
{
|
{
|
||||||
edit1.size=edit1.pos=strlen(#edit_path);
|
edit1.size=edit1.pos=strlen(#edit_path);
|
||||||
edit_box_draw stdcall (#edit1);
|
edit_box_draw stdcall (#edit1);
|
||||||
/*edit2.flags=66; //äåëàåì êîìïîíåíò àêòèâíûì
|
|
||||||
edit2.width=onLeft(24,217);
|
|
||||||
edit2.top=curbtn*18+59;
|
|
||||||
edit2.size=edit2.pos=strlen(#file_name);
|
|
||||||
edit_box_draw stdcall (#edit2);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -346,7 +333,7 @@ void FileList_ReDraw(int curbtn_)
|
|||||||
{
|
{
|
||||||
if (curbtn_<=0) //ââåðõ
|
if (curbtn_<=0) //ââåðõ
|
||||||
{
|
{
|
||||||
IF (za_kadrom==0) && (curbtn==0) return;
|
IF (za_kadrom==0) && (curbtn<=0) return;
|
||||||
IF (-curbtn_-1<curbtn)
|
IF (-curbtn_-1<curbtn)
|
||||||
{
|
{
|
||||||
Line_ReDraw(0xFFFFFF, curbtn); //áåëàÿ ïîëîñà
|
Line_ReDraw(0xFFFFFF, curbtn); //áåëàÿ ïîëîñà
|
||||||
@ -384,74 +371,43 @@ void FileList_ReDraw(int curbtn_)
|
|||||||
|
|
||||||
void List_ReDraw()
|
void List_ReDraw()
|
||||||
{
|
{
|
||||||
|
int paint_x=but_num*18+57;
|
||||||
IF (count-za_kadrom<but_num) || (curbtn>but_num-1) //åñëè ìû â êîíöå ñïèñêà ôàéëîâ ðàçâåðí¸ì îêíî ïîÿâÿòüñÿ ïóñòÿå áåëûå êíîïêè
|
IF (count-za_kadrom<but_num) || (curbtn>but_num-1) //åñëè ìû â êîíöå ñïèñêà ôàéëîâ ðàçâåðí¸ì îêíî ïîÿâÿòüñÿ ïóñòÿå áåëûå êíîïêè
|
||||||
{ za_kadrom=count-but_num; curbtn=but_num-1; } //ýòî åñëè âûäåëåíèå ïîñëå ñõëîïûâàíèÿ îêíà çà êàäðîì
|
{ za_kadrom=count-but_num; curbtn=but_num-1; } //ýòî åñëè âûäåëåíèå ïîñëå ñõëîïûâàíèÿ îêíà çà êàäðîì
|
||||||
//
|
//
|
||||||
FOR (j=0; j<but_num; j++) IF (curbtn<>j) Line_ReDraw(0xFFFFFF, j); ELSE Line_ReDraw(videlenie, curbtn);
|
FOR (j=0; j<but_num; j++) IF (curbtn<>j) Line_ReDraw(0xFFFFFF, j); ELSE Line_ReDraw(videlenie, curbtn);
|
||||||
temp_int=but_num*18+57;
|
DrawBar(192,paint_x,onLeft(27,192),onTop(paint_x,6),0xFFFFFF); //çàëèâêà áåëûì äîêîíöà
|
||||||
DrawBar(192,temp_int,onLeft(27,192),onTop(temp_int,6),0xFFFFFF); //çàëèâêà áåëûì äîêîíöà
|
DrawBar(onLeft(168,0),paint_x,1,onTop(paint_x,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 1
|
||||||
DrawBar(onLeft(168,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 1
|
DrawBar(onLeft(95,0),paint_x,1,onTop(paint_x,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2
|
||||||
DrawBar(onLeft(95,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2
|
|
||||||
TVScroll();
|
TVScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//puticon+icon_fairing!!!
|
||||||
void Line_ReDraw(dword color, filenum){
|
void Line_ReDraw(dword color, filenum){
|
||||||
dword text_col, y;//ïîëîæåíèå òåêñòà ïî Y;
|
dword text_col=0, temp_int,
|
||||||
if (rename_active==1) //âñ¸ ýòî ïîëíûé ïèïåö, è íàäî âûíåñòè â îòäåëüíóþ ïðîöåäóðó
|
y=filenum*18+57; //ïîëîæåíèå òåêñòà ïî Y
|
||||||
{
|
IF (rename_active==1) ReName(false);
|
||||||
rename_active=0;
|
|
||||||
edit2.flags=64;
|
|
||||||
DefineButton(192,curbtn*18+57,onLeft(27,192),18,curbtn+201+BT_HIDE+BT_NOFRAME,0xFFFFFF);
|
|
||||||
IF (filenum==100) filenum=curbtn; else
|
|
||||||
{
|
|
||||||
copystr(#path,#temp);
|
|
||||||
copystr(#file_name,#temp+strlen(#temp));
|
|
||||||
if (strcmp(#file_path,#temp)<>0) && (strlen(#file_name)>0)
|
|
||||||
IF (isdir)
|
|
||||||
{
|
|
||||||
//Del_File(true);
|
|
||||||
DeleleFile(#file_path);
|
|
||||||
IF (EAX) {DrawFlatButton(Form.width-200+192/2,160,200,80,0,0xFFB6B5, "Error. Folder isn't empty."); Pause(200);}
|
|
||||||
ELSE CreateFolder(#temp);
|
|
||||||
Open_Dir(#path,1);
|
|
||||||
}
|
|
||||||
ELSE { CopyFile(#file_path,#temp); Del_File(true); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
y=filenum*18+57;
|
|
||||||
//äà, ÿ íå ñïîðþ ÷òî èçâðàò, íî ïåðåðèñîâêà çàòî ìàëåíüêàÿ
|
//äà, ÿ íå ñïîðþ ÷òî èçâðàò, íî ïåðåðèñîâêà çàòî ìàëåíüêàÿ
|
||||||
DrawBar(192,y,3,18,color); DrawBar(195,y,16,2,color);
|
DrawBar(192,y,3,18,color); DrawBar(195,y,16,2,color);
|
||||||
DrawBar(192+19,y,onLeft(46,192),18,color); DrawBar(195,y+17,16,1,color);
|
DrawBar(192+19,y,onLeft(46,192),18,color); DrawBar(195,y+17,16,1,color);
|
||||||
off=file_mas[filenum+za_kadrom]*304 + buf+72;
|
|
||||||
//
|
//
|
||||||
EBX=EAX=ESDWORD[off-40];
|
off=file_mas[filenum+za_kadrom]*304 + buf+72;
|
||||||
$shr ebx,2 //ôàéë ñêðûòûé?
|
if (TestBit(ESDWORD[off-40],2)) text_col=0xA6A6B7;
|
||||||
$and ebx,1
|
if (!TestBit(ESDWORD[off-40],4))
|
||||||
IF (!EBX) text_col=0; ELSE text_col=0xA6A6B7;
|
|
||||||
$shr eax,4 //ýòî ïàïêà?
|
|
||||||
$and eax,1
|
|
||||||
IF (color==videlenie) isdir=EAX;
|
|
||||||
if (!EAX)
|
|
||||||
{
|
{
|
||||||
temp_int = Put_icon(off+strlen(off)-4, y+2);
|
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
|
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)) temp_int=Put_icon("..", y+2); ELSE temp_int=Put_icon("<DIR>", y+2);
|
} ELSE IF (!strcmp("..",off)) temp_int=Put_icon("..", y+2); ELSE temp_int=Put_icon("<DIR>", y+2);
|
||||||
if (color==videlenie)
|
if (color==videlenie)
|
||||||
{
|
{
|
||||||
|
isdir=TestBit(ESDWORD[off-40], 4);
|
||||||
IconFairing(temp_int, y+2); //çàêðàøèâàåì èêîíêó
|
IconFairing(temp_int, y+2); //çàêðàøèâàåì èêîíêó
|
||||||
copystr(off,#file_name);
|
copystr(off,#file_name);
|
||||||
copystr(#path,#file_path);
|
copystr(#path,#file_path);
|
||||||
copystr(#file_name,#file_path+strlen(#file_path)); //ïîëíûé ïóòü ê ôàéëó
|
copystr(#file_name,#file_path+strlen(#file_path)); //ïîëíûé ïóòü ê ôàéëó
|
||||||
Preview();
|
Preview(NOTIP);
|
||||||
IF (text_col==0xA6A6B7) text_col=0xFFFFFF;
|
IF (text_col==0xA6A6B7) text_col=0xFFFFFF;
|
||||||
/*IF (show_preview) && (!isdir)
|
|
||||||
{
|
|
||||||
GetImage(#file_path);
|
|
||||||
j=dev_num*16+123;
|
|
||||||
j+=show_actions*51;
|
|
||||||
IF (pLoadedImage<>0) DrawImage(#CurrentImage, 22*65536+j+skin_width+18);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
temp_int = onLeft(215,165)/6;
|
temp_int = onLeft(215,165)/6;
|
||||||
IF (strlen(off)<temp_int) temp_int = strlen(off); //äëèííà íàçâàíèÿ ôàéëà
|
IF (strlen(off)<temp_int) temp_int = strlen(off); //äëèííà íàçâàíèÿ ôàéëà
|
||||||
@ -463,7 +419,7 @@ void Line_ReDraw(dword color, filenum){
|
|||||||
|
|
||||||
void Open_Dir(dword temp_, redraw){
|
void Open_Dir(dword temp_, redraw){
|
||||||
byte path_[256], somelen=strlen(temp_)-1;
|
byte path_[256], somelen=strlen(temp_)-1;
|
||||||
if (redraw<>3)
|
if (redraw<>ONLY_SHOW)
|
||||||
{
|
{
|
||||||
copystr(temp_, #path_);
|
copystr(temp_, #path_);
|
||||||
IF (somelen) path_[somelen]=0x00;
|
IF (somelen) path_[somelen]=0x00;
|
||||||
@ -477,25 +433,24 @@ void Open_Dir(dword temp_, redraw){
|
|||||||
IF (EBX>6897) && (EBX<>-1) EBX=6897; //1 íà óäà÷ó ;)
|
IF (EBX>6897) && (EBX<>-1) EBX=6897; //1 íà óäà÷ó ;)
|
||||||
count=EBX;
|
count=EBX;
|
||||||
}
|
}
|
||||||
if (count<>-1) && (redraw>0)
|
if (count<>-1)
|
||||||
{
|
{
|
||||||
IF (!strcmp(".",buf+72)) {memmov(buf,buf+304,count-1*304); count--; } //ôèëüòðóåì ýëåìåíò "."
|
IF (!strcmp(".",buf+72)) {memmov(buf,buf+304,count-1*304); count--;} //ôèëüòðóåì ýëåìåíò "."
|
||||||
FOR (j=0;j<but_num;j++) DeleteButton(201+j); //óäàëÿåì ñòàðûå
|
FOR (j=0;j<but_num;j++) DeleteButton(201+j); //óäàëÿåì ñòàðûå
|
||||||
but_num=onTop(6,57)/18;
|
but_num=onTop(6,57)/18;
|
||||||
IF (but_num>100) but_num=1; ELSE //ýòà ñòðàííàÿ ñòðî÷êà äëÿ òîãî åñëè ðàçìåðû îêíà ñëèøêîì ìàëåíüêèå
|
|
||||||
IF (count<but_num) but_num=count;
|
IF (count<but_num) but_num=count;
|
||||||
FOR (j=0;j<but_num;j++) DefineButton(192,j*18+57,onLeft(27,192),18,201+j+BT_HIDE+BT_NOFRAME,0xFFFFFF); //íîâûå êíîïû
|
FOR (j=0;j<but_num;j++) DefineButton(192,j*18+57,onLeft(27,192),18,201+j+BT_HIDE+BT_NOFRAME,0xFFFFFF); //íîâûå êíîïû
|
||||||
IF (redraw<>3) Sorting();
|
//ñòðåëî÷êà ñîðòèðîâêè
|
||||||
IF (redraw==1) || (redraw==3) List_ReDraw();
|
IF (sort_num==1) WriteText(Form.width+60/2,45,0x80,0x4E78AC,"\x19",0);
|
||||||
|
IF (sort_num==2) WriteText(Form.width-115,45,0x80,0x4E78AC,"\x19",0);
|
||||||
|
IF (sort_num==3) WriteText(Form.width-44,45,0x80,0x4E78AC,"\x19",0);
|
||||||
|
IF (redraw<>ONLY_SHOW) Sorting(); //äëÿ áîëüøèõ ïàïîê ïðè ðåïåèíòå îêíà
|
||||||
|
IF (redraw<>ONLY_OPEN) List_ReDraw();
|
||||||
copystr(temp_,#edit_path);
|
copystr(temp_,#edit_path);
|
||||||
KEdit();
|
KEdit();
|
||||||
HistoryPath(add_new_path);
|
HistoryPath(add_new_path);
|
||||||
//ñòðåëî÷êà ñîðòèðîâêè
|
|
||||||
IF (sort_num==1) WriteText(onLeft(192,168)/2+210,45,0x80,0x4E78AC,"\x19",0);
|
|
||||||
IF (sort_num==2) WriteText(onLeft(115,0),45,0x80,0x4E78AC,"\x19",0);
|
|
||||||
IF (sort_num==3) WriteText(onLeft(44,0),45,0x80,0x4E78AC,"\x19",0);
|
|
||||||
}
|
}
|
||||||
IF (count==-1) {but_num=count=0; List_ReDraw();}
|
IF (count==-1) && (redraw<>ONLY_OPEN) {but_num=count=0; List_ReDraw();}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -507,19 +462,16 @@ inline Sorting()
|
|||||||
FOR (j=count-1, off=count-1*304+buf+32; j>=0; j--, off-=304;) //ïàïêè ââåðõ, ôàéëû âíèç
|
FOR (j=count-1, off=count-1*304+buf+32; j>=0; j--, off-=304;) //ïàïêè ââåðõ, ôàéëû âíèç
|
||||||
{
|
{
|
||||||
ChangeCase(off+40);
|
ChangeCase(off+40);
|
||||||
EAX=ESDWORD[off];
|
IF (TestBit(ESDWORD[off],4)) {file_mas[k]=j; k++;}
|
||||||
$shr eax,4
|
ELSE {file_mas[count-l]=j; l++;}
|
||||||
$and eax,1
|
|
||||||
IF (EAX) {file_mas[k]=j; k++;} ELSE
|
|
||||||
{file_mas[count-l]=j; l++;}
|
|
||||||
}
|
}
|
||||||
//Ñîáñòâåííî ñîðòèðîâêà
|
//Ñîáñòâåííî ñîðòèðîâêà: âíà÷àëå ïàïêè, ïîòîì ôàéëû
|
||||||
Sort_by_Name(0,k-1); //ñîðòèðóåì ïàïêè, íèæå - ôàéëû
|
Sort_by_Name(0,k-1);
|
||||||
IF (sort_num==1) Sort_by_Name(k,count-1);
|
IF (sort_num==1) Sort_by_Name(k,count-1);
|
||||||
IF (sort_num==2) Sort_by_Type(k, count-1);
|
IF (sort_num==2) Sort_by_Type(k, count-1);
|
||||||
IF (sort_num==3) Sort_by_Size(k,count-1);
|
IF (sort_num==3) Sort_by_Size(k,count-1);
|
||||||
//åñëè ïàïêà ".." íå ïåðâàÿ, ñòàâèì å¸ òóäà
|
//åñëè ïàïêà ".." íå ïåðâàÿ, ñòàâèì å¸ òóäà
|
||||||
IF (strcmp(file_mas[0]*304+buf+72,"..")<>0) FOR(k=k-1; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) file_mas[k]><file_mas[0];
|
IF (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")<>0) FOR(k=k-1; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) file_mas[k]><file_mas[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -593,6 +545,34 @@ void Tip(int y, dword caption, id, arrow)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ReName(byte rename)
|
||||||
|
{
|
||||||
|
rename_active=0;
|
||||||
|
edit2.flags=64;
|
||||||
|
DefineButton(192,curbtn*18+57,onLeft(27,192),18,curbtn+201+BT_HIDE+BT_NOFRAME,0xFFFFFF);
|
||||||
|
if (rename==true)
|
||||||
|
{
|
||||||
|
copystr(#path,#temp);
|
||||||
|
copystr(#file_name,#temp+strlen(#temp));
|
||||||
|
if (strcmp(#file_path,#temp)<>0) && (file_name)
|
||||||
|
IF (isdir)
|
||||||
|
{
|
||||||
|
DeleleFile(#file_path);
|
||||||
|
IF (EAX) {DrawFlatButton(Form.width-8/2,160,200,80,0,0xFFB6B5, "Error. Folder isn't empty."); Pause(200);}
|
||||||
|
ELSE CreateFolder(#temp);
|
||||||
|
Open_Dir(#path,1);
|
||||||
|
}
|
||||||
|
ELSE
|
||||||
|
{
|
||||||
|
CopyFile(#file_path,#temp);
|
||||||
|
Del_File(true);
|
||||||
|
}
|
||||||
|
SelectFile(#temp+find_symbol(#path,'/'));
|
||||||
|
}
|
||||||
|
Line_ReDraw(videlenie,curbtn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Devices()
|
void Devices()
|
||||||
{
|
{
|
||||||
byte dev_icon; dword drive_name[30]; char dev_name[4];
|
byte dev_icon; dword drive_name[30]; char dev_name[4];
|
||||||
@ -601,10 +581,10 @@ void Devices()
|
|||||||
DrawBar(177,56,15,onTop(21,41),0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà
|
DrawBar(177,56,15,onTop(21,41),0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà
|
||||||
//ñïèñîê äèñêîâ
|
//ñïèñîê äèñêîâ
|
||||||
Tip(56, "Goto:", 0, "");
|
Tip(56, "Goto:", 0, "");
|
||||||
DrawBar(17,74,160,dev_num*16+1,0xFFFFFF); //áåëîå
|
|
||||||
for (i=0;i<dev_num;i++)
|
for (i=0;i<dev_num;i++)
|
||||||
{
|
{
|
||||||
DefineButton(17,i*16+74,159,16,100+i+BT_HIDE,0xE4DFE1); //ñîçäà¸ì êíîïêè, à ïîòîì âûâîäèì íàçâàíèÿ äèñêîâ
|
DrawBar(17,i*16+74,160,17,0xFFFFFF); //áåëîå
|
||||||
|
DefineButton(17,i*16+74,159,16,100+i+BT_HIDE,0xFFFFFF); //ñîçäà¸ì êíîïêè, à ïîòîì âûâîäèì íàçâàíèÿ äèñêîâ
|
||||||
copystr("Unknown drive",#drive_name); //èçíà÷àëüíî íåèçâåñíûé íîñèòåëü
|
copystr("Unknown drive",#drive_name); //èçíà÷àëüíî íåèçâåñíûé íîñèòåëü
|
||||||
dev_icon=3; //ïî-óìîë÷àíèþ óñòðîéñòâî âûãëÿäèò êàê æåñòÿê
|
dev_icon=3; //ïî-óìîë÷àíèþ óñòðîéñòâî âûãëÿäèò êàê æåñòÿê
|
||||||
copystr(i*304+ devbuf+72, #dev_name);
|
copystr(i*304+ devbuf+72, #dev_name);
|
||||||
@ -649,31 +629,41 @@ void Actions()
|
|||||||
Tip(dev_num*16+90, "Actions", 77, "\x18");
|
Tip(dev_num*16+90, "Actions", 77, "\x18");
|
||||||
DrawBar(17,dev_num*16+108,160,51,0x00699C); //ñèíåå
|
DrawBar(17,dev_num*16+108,160,51,0x00699C); //ñèíåå
|
||||||
}
|
}
|
||||||
Preview();
|
Preview(REDRAW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Preview()
|
void Preview(byte param)
|
||||||
{
|
{
|
||||||
dword top_pr=dev_num*16+123;
|
dword ti, text_buf, top_pr=dev_num*16+123;
|
||||||
top_pr+=show_actions*51; //íà÷èíàåì íèæå, åñëè Ýêøíñ âèäèìû
|
top_pr+=show_actions*51; //íà÷èíàåì íèæå, åñëè Ýêøíñ âèäèìû
|
||||||
DeleteButton(78);
|
IF (param<>NOTIP) DeleteButton(78);
|
||||||
if (show_preview==1)
|
if (show_preview==1)
|
||||||
{
|
{
|
||||||
Tip(top_pr,"Preview",78,"\x19");
|
IF (param<>NOTIP) Tip(top_pr,"Preview",78,"\x19");
|
||||||
DrawBar(17,top_pr+18,160,100,0xFFFFFF); //áåëîå
|
DrawBar(17,top_pr+18,160,5,0xFFFFFF); //áåëîå
|
||||||
DrawBar(17,top_pr+118,160,onTop(top_pr+118,6),0x00699C); //ñèíåå
|
DrawBar(17,top_pr+113,160,onTop(top_pr+113,6),0x00699C); //ñèíåå
|
||||||
//
|
//
|
||||||
WriteText(25,top_pr+30,0x80,0,"Number of files:",0); WriteText(135,top_pr+30,0x80,0,IntToStr(count),0);
|
text_buf = malloc(256);
|
||||||
WriteText(30,top_pr+40,0x80,0,"but_num:",0); WriteText(105,top_pr+40,0x80,0,IntToStr(but_num),0);
|
ReadFile(0, 256, text_buf, #file_path);
|
||||||
WriteText(30,top_pr+50,0x80,0,"curbtn",0); WriteText(105,top_pr+50,0x80,0,IntToStr(curbtn),0);
|
FOR (ti=0;ti<9; ti++)
|
||||||
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);
|
DrawBar(17,ti*10+top_pr+23,160,10,0xFFFFFF); //áåëîå
|
||||||
WriteText(30,top_pr+80,0x80,0,IntToStr(edit1.flags),0); WriteText(30,top_pr+90,0x80,0,IntToStr(edit2.flags),0);
|
WriteText(22,ti*10+top_pr+23,0x00,0,ti*25+text_buf,25);
|
||||||
|
IF (param==ANIM) Pause(2);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
/*WriteDebug("");
|
||||||
|
WriteDebug("");
|
||||||
|
WriteDebug(#path);
|
||||||
|
WriteDebug("Number of files:"); WriteDebug(IntToStr(count));
|
||||||
|
WriteDebug("but_num:"); WriteDebug(IntToStr(but_num));
|
||||||
|
WriteDebug("curbtn"); WriteDebug(IntToStr(curbtn));
|
||||||
|
WriteDebug("ra_kadrom:"); WriteDebug(IntToStr(za_kadrom));*/
|
||||||
}
|
}
|
||||||
ELSE
|
ELSE
|
||||||
{
|
{
|
||||||
Tip(top_pr,"Preview",78,"\x18");
|
IF (param<>NOTIP) Tip(top_pr,"Preview",78,"\x18");
|
||||||
DrawBar(17,top_pr+18,160,onTop(top_pr+18,6),0x00699C); //ñèíåå
|
DrawBar(17,top_pr+18,160,onTop(top_pr+18,6),0x00699C); //ñèíåå
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -683,7 +673,7 @@ void Goto_edit_path()
|
|||||||
{
|
{
|
||||||
IF (strcmp(#path,#edit_path)==0) return; //ïðîâåðêà íå â ýòîé ëè ìû ïàïêå
|
IF (strcmp(#path,#edit_path)==0) return; //ïðîâåðêà íå â ýòîé ëè ìû ïàïêå
|
||||||
IF (strcmp(#edit_path+strlen(#edit_path)-1,"/")<>0) copystr("/",#edit_path+strlen(#edit_path)); //åñëè íåò, + "/"
|
IF (strcmp(#edit_path+strlen(#edit_path)-1,"/")<>0) copystr("/",#edit_path+strlen(#edit_path)); //åñëè íåò, + "/"
|
||||||
Open_Dir(#edit_path,0); //ïðîâåðÿåì åñëè ôàéëû â ïàïêå, òàê ìû óçíà¸ì ñóùåñòâóåò ëè îíà
|
Open_Dir(#edit_path,2); //ïðîâåðÿåì åñëè ôàéëû â ïàïêå, òàê ìû óçíà¸ì ñóùåñòâóåò ëè îíà
|
||||||
IF (count<1) KEdit(); ELSE //ïðîñòî î÷èùàåì ïîëîñó àäðåñà
|
IF (count<1) KEdit(); ELSE //ïðîñòî î÷èùàåì ïîëîñó àäðåñà
|
||||||
{za_kadrom=curbtn=0; copystr(#edit_path,#path);}//íàâåðõ ñïèñêà
|
{za_kadrom=curbtn=0; copystr(#edit_path,#path);}//íàâåðõ ñïèñêà
|
||||||
Open_Dir(#path,1);
|
Open_Dir(#path,1);
|
||||||
@ -707,7 +697,7 @@ void SelectFile(dword that_file)
|
|||||||
|
|
||||||
void Dir_Up()
|
void Dir_Up()
|
||||||
{
|
{
|
||||||
char temp_[256];
|
byte temp_[256];
|
||||||
i=strlen(#path)-1;
|
i=strlen(#path)-1;
|
||||||
path[i]=0x00;
|
path[i]=0x00;
|
||||||
do i--; while (path[i]<>'/'); copystr(#path+i+1,#temp_);
|
do i--; while (path[i]<>'/'); copystr(#path+i+1,#temp_);
|
||||||
@ -716,19 +706,10 @@ void Dir_Up()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*inline fastcall void GoBack() //âíà÷àëå óäàëÿåì òåêóùèé ïóòü, à ïîòîì êîïèðóåì òî, ÷òî îñòàëîñü
|
|
||||||
{
|
|
||||||
i=strlen(#PathHistory)-1;
|
|
||||||
PathHistory[i]=0x00;
|
|
||||||
copystr(#PathHistory+find_symbol(#PathHistory,'/'),#temp); //ïàïêà â êîòîðîé áûëè
|
|
||||||
HistoryPath(go_back);
|
|
||||||
SelectFile(#temp);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
inline fastcall void GoBack() //âíà÷àëå óäàëÿåì òåêóùèé ïóòü, à ïîòîì êîïèðóåì òî, ÷òî îñòàëîñü
|
inline fastcall void GoBack() //âíà÷àëå óäàëÿåì òåêóùèé ïóòü, à ïîòîì êîïèðóåì òî, ÷òî îñòàëîñü
|
||||||
{
|
{
|
||||||
i=strlen(#PathHistory)-1;
|
i=strlen(#PathHistory)-1;
|
||||||
IF (i<7) return;
|
IF (i<7) RETURN;
|
||||||
PathHistory[i]=0x00;
|
PathHistory[i]=0x00;
|
||||||
copystr(#PathHistory+find_symbol(#PathHistory,'/'),#temp); //ïàïêà â êîòîðîé áûëè
|
copystr(#PathHistory+find_symbol(#PathHistory,'/'),#temp); //ïàïêà â êîòîðîé áûëè
|
||||||
HistoryPath(go_back);
|
HistoryPath(go_back);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
..\C--\c-- Eolite.c--
|
..\C--\c-- Eolite.c--
|
||||||
del Eolite.kex
|
del Eolite
|
||||||
rename Eolite.com Eolite.kex
|
rename Eolite.com Eolite
|
||||||
|
..\C--\kpack Eolite
|
||||||
pause
|
pause
|
@ -3,6 +3,14 @@
|
|||||||
?define add_new_path 1
|
?define add_new_path 1
|
||||||
?define go_back 2
|
?define go_back 2
|
||||||
|
|
||||||
|
?define ONLY_SHOW 0
|
||||||
|
?define WITH_REDRAW 1
|
||||||
|
?define ONLY_OPEN 2
|
||||||
|
|
||||||
|
?define REDRAW 1
|
||||||
|
?define ANIM 2
|
||||||
|
?define NOTIP 3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//IPC
|
//IPC
|
||||||
#include "lib\Nable_lib.h--"
|
#include "lib\Nable_lib.h--"
|
||||||
@ -41,7 +49,7 @@ void authors()
|
|||||||
DefineAndDrawWindow(500,200,181,256,0x34,0x10EFEBEF,0,0,"About Eolite");
|
DefineAndDrawWindow(500,200,181,256,0x34,0x10EFEBEF,0,0,"About Eolite");
|
||||||
DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
|
DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
|
||||||
PutPaletteImage(#logo,85,85,48,7,#logo_pal);
|
PutPaletteImage(#logo,85,85,48,7,#logo_pal);
|
||||||
WriteText(33,100,0x80,0xBF40BF,"Eolite v0.98.3 RC2",0);
|
WriteText(33,100,0x80,0xBF40BF,"Eolite v0.98.5 RC2",0);
|
||||||
WriteText(55,120,0x80,0,"Developers:",0);
|
WriteText(55,120,0x80,0,"Developers:",0);
|
||||||
WriteText(39,130,0x80,0,"Leency & Veliant",0);
|
WriteText(39,130,0x80,0,"Leency & Veliant",0);
|
||||||
WriteText(30,140,0x80,0,"Diamond, Lrz, Nable",0);
|
WriteText(30,140,0x80,0,"Diamond, Lrz, Nable",0);
|
||||||
@ -84,12 +92,12 @@ WHILE (m.lkm==1)
|
|||||||
|
|
||||||
|
|
||||||
dword onLeft(dword right,left) {EAX=Form.width-right-left;}
|
dword onLeft(dword right,left) {EAX=Form.width-right-left;}
|
||||||
dword onTop(dword down,up) {EAX=Form.height-skin_width-down-up;}
|
dword onTop(dword down,up) {EAX=Form.height-GetSkinWidth()-down-up;}
|
||||||
|
|
||||||
|
|
||||||
dword ConvertSize(dword bytes)
|
dword ConvertSize(dword bytes)
|
||||||
{
|
{
|
||||||
char size_prefix[7], temp[3];
|
byte size_prefix[8], temp[3];
|
||||||
IF (bytes>=1073741824) copystr(" Gb",#temp);
|
IF (bytes>=1073741824) copystr(" Gb",#temp);
|
||||||
ELSE IF (bytes>=1048576) copystr(" Mb",#temp);
|
ELSE IF (bytes>=1048576) copystr(" Mb",#temp);
|
||||||
ELSE IF (bytes>=1024) copystr(" Kb",#temp);
|
ELSE IF (bytes>=1024) copystr(" Kb",#temp);
|
||||||
|
66
programs/fs/Eolite/trunk/include/ini.h--
Normal file
66
programs/fs/Eolite/trunk/include/ini.h--
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
//INI parser in C--, GPL licence.
|
||||||
|
//Copyright 2008 by Leency
|
||||||
|
|
||||||
|
#define COMMENT 0
|
||||||
|
#define SECTION 1
|
||||||
|
#define PARAM 2
|
||||||
|
#define OPTION 3
|
||||||
|
|
||||||
|
void GetIni(dword inipath)
|
||||||
|
{
|
||||||
|
byte section[32]='', parametr[32]='', option[256]='', InfType=0;
|
||||||
|
word bukva[1];
|
||||||
|
dword buff, fsize, tj;
|
||||||
|
//÷èòàåì ôàéë
|
||||||
|
buff = malloc(1048576);
|
||||||
|
ReadFile(0, 1048576, buff, inipath);
|
||||||
|
IF (EAX<>6) {WriteDebug("INI-file not found. Defaults will be used."); goto INI_END;}
|
||||||
|
fsize=EBX;
|
||||||
|
//ïàðñèì åãî
|
||||||
|
for (tj=0; tj<fsize; tj++;)
|
||||||
|
{
|
||||||
|
bukva = ESBYTE[buff+tj];
|
||||||
|
switch (bukva)
|
||||||
|
{
|
||||||
|
case ';':
|
||||||
|
InfType=COMMENT;
|
||||||
|
break;
|
||||||
|
case '[':
|
||||||
|
InfType=SECTION;
|
||||||
|
section='';
|
||||||
|
break;
|
||||||
|
case ']':
|
||||||
|
InfType=PARAM;
|
||||||
|
break;
|
||||||
|
case '=':
|
||||||
|
InfType=OPTION;
|
||||||
|
break;
|
||||||
|
case 0x0a:
|
||||||
|
case 0x0d:
|
||||||
|
InfType=PARAM;
|
||||||
|
//IF (strcmp(#parametr,"select_color")==0) videlenie=StrToCol(#option);
|
||||||
|
IF (parametr) && (!strcmp(#file_name+find_symbol(#file_name,'.'),#parametr)) {RunProgram(#option,#file_path); return;}
|
||||||
|
parametr=option='';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
IF (InfType==SECTION) copystr(#bukva,#section+strlen(#section));
|
||||||
|
IF (InfType==PARAM) copystr(#bukva,#parametr+strlen(#parametr));
|
||||||
|
IF (InfType==OPTION) copystr(#bukva,#option+strlen(#option));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
INI_END:
|
||||||
|
IF (file_path) RunProgram(#file_path,'');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*inline fastcall void OpenFile(ESI)
|
||||||
|
{
|
||||||
|
byte ext_n_progs="ext|tinypad|ext2|Eolite|"; //=ESI
|
||||||
|
byte str;
|
||||||
|
do{
|
||||||
|
$lodsb
|
||||||
|
IF(AL=='|') str='';
|
||||||
|
copystr(ESBYTE[AL],str);
|
||||||
|
} while(AL!=0);
|
||||||
|
//RunProgram(fpath, #fparam); //çàïóñê!
|
||||||
|
}*/
|
@ -5,10 +5,8 @@ void Sort_by_Size(int a, b) //
|
|||||||
int i= a;
|
int i= a;
|
||||||
IF (a >= b) return;
|
IF (a >= b) return;
|
||||||
FOR (j = a; j <= b; j++)
|
FOR (j = a; j <= b; j++)
|
||||||
{
|
IF (ESDWORD[file_mas[j]*304 + buf+64] <= ESDWORD[file_mas[b]*304 + buf+64])
|
||||||
IF (ESDWORD[file_mas[j]*304 + buf+72-8] <= ESDWORD[file_mas[b]*304 + buf+72-8])
|
|
||||||
{ file_mas[i] >< file_mas[j]; i++;}
|
{ file_mas[i] >< file_mas[j]; i++;}
|
||||||
}
|
|
||||||
Sort_by_Size (a, i-2);
|
Sort_by_Size (a, i-2);
|
||||||
Sort_by_Size (i, b);
|
Sort_by_Size (i, b);
|
||||||
}
|
}
|
||||||
@ -24,33 +22,11 @@ void Sort_by_Name(int a, b) //
|
|||||||
Sort_by_Name(i, b);
|
Sort_by_Name(i, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*int partition1(dword a, b)
|
void Sort_by_Type(int a, b) // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1
|
||||||
{
|
{
|
||||||
dword i = a; byte filename1[256], filename2[256]; int n;
|
int i=a; dword offset=buf+72; byte filename1[256], filename2[256]; int n;
|
||||||
for (j = a; j <= b; j++)
|
IF (a >= b) return;
|
||||||
{
|
|
||||||
//
|
|
||||||
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;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
int partition1(dword a, b)
|
|
||||||
{
|
|
||||||
dword i = a; byte filename1[256], filename2[256]; int n;
|
|
||||||
dword offset=buf+72;
|
|
||||||
for (j = a; j <= b; j++)
|
for (j = a; j <= b; j++)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@ -67,16 +43,9 @@ int partition1(dword a, b)
|
|||||||
IF (n<0) { file_mas[i] >< file_mas[j]; i++;}
|
IF (n<0) { file_mas[i] >< file_mas[j]; i++;}
|
||||||
IF (n==0) && (strcmp(file_mas[j]*304 + offset, file_mas[b]*304 + offset)<=0) { file_mas[i] >< file_mas[j]; i++;}
|
IF (n==0) && (strcmp(file_mas[j]*304 + offset, file_mas[b]*304 + offset)<=0) { file_mas[i] >< file_mas[j]; i++;}
|
||||||
}
|
}
|
||||||
EAX = i-1;
|
Sort_by_Type(a, i-2);
|
||||||
}
|
Sort_by_Type(i, b);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
dword edit_box_draw = #aEdit_box_draw;
|
dword edit_box_draw = #aEdit_box_draw;
|
||||||
dword edit_box_key = #aEdit_box_key;
|
dword edit_box_key = #aEdit_box_key;
|
||||||
dword edit_box_mouse = #aEdit_box_mouse;
|
dword edit_box_mouse = #aEdit_box_mouse;
|
||||||
dword version_ed = #aVersion_ed;
|
|
||||||
|
|
||||||
dword am__ = 0x0;
|
dword am__ = 0x0;
|
||||||
dword bm__ = 0x0;
|
dword bm__ = 0x0;
|
||||||
@ -10,15 +10,7 @@ dword bm__ = 0x0;
|
|||||||
char aEdit_box_draw[9] = "edit_box\0";
|
char aEdit_box_draw[9] = "edit_box\0";
|
||||||
char aEdit_box_key[13] = "edit_box_key\0";
|
char aEdit_box_key[13] = "edit_box_key\0";
|
||||||
char aEdit_box_mouse[15] = "edit_box_mouse\0";
|
char aEdit_box_mouse[15] = "edit_box_mouse\0";
|
||||||
char aVersion_ed[11] = "version_ed\0";
|
|
||||||
|
|
||||||
char aCheck_box_draw [15] = "check_box_draw\0";
|
|
||||||
char aCheck_box_mouse [16] = "check_box_mouse\0";
|
|
||||||
char aVersion_ch [11] = "version_ch\0";
|
|
||||||
|
|
||||||
char aOption_box_draw [16] = "option_box_draw\0";
|
|
||||||
char aOption_box_mouse[17] = "option_box_mouse\0";
|
|
||||||
char aVersion_op [11] = "version_op\0" ;
|
|
||||||
|
|
||||||
|
|
||||||
struct edit_box{
|
struct edit_box{
|
||||||
@ -27,8 +19,7 @@ text_color, max, text, flags, size, pos, offset, cl_curs_x, cl_curs_y, shift, sh
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
int fastcall load_editbox_lib(EAX)
|
||||||
int load_editbox_lib(EAX)
|
|
||||||
{
|
{
|
||||||
//set mask
|
//set mask
|
||||||
$mov eax,40
|
$mov eax,40
|
||||||
|
@ -4,15 +4,13 @@
|
|||||||
#define graph "graph"
|
#define graph "graph"
|
||||||
#define htmlv "/sys/network/HTMLv"
|
#define htmlv "/sys/network/HTMLv"
|
||||||
#define jpegview "jpegview"
|
#define jpegview "jpegview"
|
||||||
#define kvid "/sys/kvid"
|
|
||||||
#define life2 "/sys/demos/life2"
|
#define life2 "/sys/demos/life2"
|
||||||
#define midamp "/sys/multimedia/midamp"
|
#define midamp "/sys/multimedia/midamp"
|
||||||
//#define mv "MV"
|
#define mv "MV"
|
||||||
#define mv "/sys/multimedia/imgview"
|
//#define mv "/sys/multimedia/imgview"
|
||||||
#define pngview "/sys/multimedia/pngview"
|
#define pngview "/sys/multimedia/pngview"
|
||||||
#define rtfread "RtfRead"
|
|
||||||
#define tinypad "TinyPad"
|
#define tinypad "TinyPad"
|
||||||
#define view3ds "/sys/demos/3d/view3ds"
|
|
||||||
|
|
||||||
struct f70{
|
struct f70{
|
||||||
dword func;
|
dword func;
|
||||||
@ -150,7 +148,7 @@ inline fastcall dword CopyFile(dword EBX,ECX)
|
|||||||
|
|
||||||
if (!EAX)
|
if (!EAX)
|
||||||
{
|
{
|
||||||
cBufer = malloc(CopyFile_atr.sizelo);
|
cBufer = malloc(2*CopyFile_atr.sizelo);
|
||||||
ReadFile(dword 0, CopyFile_atr.sizelo, cBufer, s);
|
ReadFile(dword 0, CopyFile_atr.sizelo, cBufer, s);
|
||||||
|
|
||||||
IF (!EAX)
|
IF (!EAX)
|
||||||
@ -170,38 +168,4 @@ inline fastcall dword CopyFile(dword EBX,ECX)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Run_File(dword fpath)
|
|
||||||
{
|
|
||||||
dword extension[4], fparam[256]; byte needrun;
|
|
||||||
needrun = 1; //åñëè 1 òî íóæíî çàïóñêàòü, åñëè 0 òî íå íàäî
|
|
||||||
copystr(fpath,#fparam); //ïî-óìîë÷àíèþ ïðîãà è ïàðàìåòð ðàâíû, åñëè îêàæåòñÿ ÷òî ýòî ôàéë, ïàðàì - ñáðîñèì
|
|
||||||
copystr(fpath+strlen(fpath)-4,#extension); //óçíà¸ì ðàñøèðåíèå ôàéëà ñ êàêèì ðàáîòàåì
|
|
||||||
//òóò ìû ýòî ðàñøèðåíèå ñðàâíèìàåì, è, åñëè îíî àñîöèèðóåòñÿ ñ ïðîãîé, ïðîãà - ýòî fpath
|
|
||||||
IF (!strcmp(#extension,".skn")) copystr("desktop",fpath);
|
|
||||||
IF (!strcmp(#extension,".avi")) || (!strcmp(#extension,".mpg")) copystr(kvid,fpath);
|
|
||||||
IF (!strcmp(#extension,".htm")) || (!strcmp(#extension,"html")) copystr(htmlv,fpath);
|
|
||||||
IF (!strcmp(#extension,".3ds")) copystr(view3ds,fpath);
|
|
||||||
IF (!strcmp(#extension,".lif")) copystr(life2,fpath);
|
|
||||||
IF (!strcmp(#extension,".cvs")) copystr(graph,fpath);
|
|
||||||
IF (!strcmp(#extension,".nes")) copystr(fce,fpath);
|
|
||||||
//audio
|
|
||||||
IF (!strcmp(#extension,".mp3")) || (!strcmp(#extension,".wav")) copystr(ac97snd,fpath);
|
|
||||||
IF (!strcmp(#extension,".mid")) || (!strcmp(#extension,"midi")) copystr(midamp,fpath);
|
|
||||||
//text
|
|
||||||
IF (!strcmp(#extension,".rtf")) copystr(rtfread,fpath);
|
|
||||||
IF (!strcmp(#extension,".txt")) || (!strcmp(#extension,".inc")) ||
|
|
||||||
(!strcmp(#extension,".ini")) || (!strcmp(#extension,".dat")) ||
|
|
||||||
(!strcmp(#extension,".asm")) || (!strcmp(#extension,".cpp")) copystr(tinypad,fpath);
|
|
||||||
//èçîáðàæåíèÿ
|
|
||||||
IF (!strcmp(#extension,".gif")) || (!strcmp(#extension,".bmp")) ||
|
|
||||||
(!strcmp(#extension,".tga")) || (!strcmp(#extension,".pcx")) ||
|
|
||||||
(!strcmp(#extension,".cur")) || (!strcmp(#extension,".ico")) copystr(mv,fpath);
|
|
||||||
IF (!strcmp(#extension,".png")) copystr(pngview,fpath);
|
|
||||||
IF (!strcmp(#extension,".jpg")) || (!strcmp(#extension,"jpeg")) copystr(jpegview,fpath);
|
|
||||||
|
|
||||||
IF (!strcmp(#extension,".sys")) || (!strcmp(#extension,".drv")) ||
|
|
||||||
(!strcmp(#extension,".obj")) needrun=0; // ýòè ôàéëû íå äëÿ çàïóñêà
|
|
||||||
|
|
||||||
IF (!strcmp(fpath,#fparam)) fparam=''; //åñëè fpath íå èçìåíèëñÿ, òî ýòî òàêè, íàâåðíîå, ïðîãà, ïàðàìåòðîâ íåò.
|
|
||||||
IF (needrun == 1) RunProgram(fpath, #fparam); //çàïóñê!
|
|
||||||
}
|
|
||||||
|
@ -11,7 +11,6 @@ dword alloc_mem = 0x00100000;
|
|||||||
dword x86esp_reg = 0x00100000; // 0x0007fff0;
|
dword x86esp_reg = 0x00100000; // 0x0007fff0;
|
||||||
dword I_Param = #param;
|
dword I_Param = #param;
|
||||||
dword I_Icon = 0x0;
|
dword I_Icon = 0x0;
|
||||||
dword skin_width;
|
|
||||||
char param[256]="";
|
char param[256]="";
|
||||||
|
|
||||||
//Events
|
//Events
|
||||||
@ -115,7 +114,7 @@ inline fastcall void ExitProcess(){
|
|||||||
$int 0x40
|
$int 0x40
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pause(dword EBX){
|
inline fastcall void Pause(dword EBX){
|
||||||
$mov eax, 5 //<2F> 㧠, ¢ á®âëå ¤®«ïå ᥪã¤ë
|
$mov eax, 5 //<2F> 㧠, ¢ á®âëå ¤®«ïå ᥪã¤ë
|
||||||
$int 0x40
|
$int 0x40
|
||||||
}
|
}
|
||||||
@ -132,7 +131,7 @@ void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword
|
|||||||
$int 0x40
|
$int 0x40
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fastcall dword CreateThread(dword ECX,EDX)
|
inline fastcall void CreateThread(dword ECX,EDX)
|
||||||
{
|
{
|
||||||
EAX = 51;
|
EAX = 51;
|
||||||
EBX = 1;
|
EBX = 1;
|
||||||
@ -157,7 +156,7 @@ inline fastcall dword GetSkinWidth(){
|
|||||||
$int 0x40
|
$int 0x40
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fastcall dword MoveSize(dword EBX,ECX,EDX,ESI){
|
inline fastcall void MoveSize(dword EBX,ECX,EDX,ESI){
|
||||||
EAX = 67;
|
EAX = 67;
|
||||||
$int 0x40
|
$int 0x40
|
||||||
}
|
}
|
||||||
@ -183,6 +182,13 @@ l1:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
byte fastcall TestBit(EAX, CL)
|
||||||
|
{
|
||||||
|
$shr eax,cl
|
||||||
|
$and eax,1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
char buffer[11]="";
|
char buffer[11]="";
|
||||||
inline fastcall dword IntToStr(dword ESI)
|
inline fastcall dword IntToStr(dword ESI)
|
||||||
{
|
{
|
||||||
@ -212,6 +218,22 @@ f3:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dword StrToCol(char* htmlcolor)
|
||||||
|
{
|
||||||
|
dword j=1, color=0; char ch=0x00;
|
||||||
|
IF (ESBYTE[htmlcolor]<>'#') RETURN;
|
||||||
|
FOR (;j<7;j++)
|
||||||
|
{
|
||||||
|
ch=ESBYTE[htmlcolor+j];
|
||||||
|
IF ((ch>='0') && (ch<='9')) ch -= '0';
|
||||||
|
IF ((ch>='A') && (ch<='F')) ch -= 'A'-10;
|
||||||
|
IF ((ch>='a') && (ch<='f')) ch -= 'a'-10;
|
||||||
|
color = color*0x10 + ch;
|
||||||
|
}
|
||||||
|
EAX=color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline fastcall int strcmp(ESI, EDI)
|
inline fastcall int strcmp(ESI, EDI)
|
||||||
{
|
{
|
||||||
loop()
|
loop()
|
||||||
@ -268,7 +290,7 @@ L2:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline fastcall dword ChangeCase(dword EDX)
|
inline fastcall ChangeCase(dword EDX)
|
||||||
{
|
{
|
||||||
AL=DSBYTE[EDX];
|
AL=DSBYTE[EDX];
|
||||||
IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f;
|
IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f;
|
||||||
|
Loading…
Reference in New Issue
Block a user