/programs/fs/Eolite/trunk/Eolite.c-- |
---|
1,10 → 1,10 |
//Leency & Veliant -=- KolibriOS Team -=- 2012 |
//GNU GPL licence. |
#include "lib\kolibri.h--" |
#include "lib\memory.h--" |
#include "lib\edit_box_lib.h--" |
#include "lib\file_system.h--" |
#include "lib\kolibri.h" |
#include "lib\memory.h" |
#include "lib\edit_box_lib.h" |
#include "lib\file_system.h" |
#include "imgs\toolbar.txt" |
#include "imgs\left_p.txt" |
16,9 → 16,8 |
#define ONLY_OPEN 2 |
//ïåðåìåííûå |
#define title "Eolite File Manager v1.0" |
#define videlenie 0x94AECE //0xFEA4B7,0x8BCDFF,0xB8C9B8}; //öâåò âûäåëåííîãî ýëåìåíòà èç ñïèñêà ôàéëîâ |
byte toolbar_buttons_x[6]={9,46,85,134,167,203}; |
#define title "Eolite File Manager v1.1" |
dword videlenie=0x94AECE; //öâåò âûäåëåííîãî ýëåìåíòà èç ñïèñêà ôàéëîâ |
// |
int but_num, |
count, |
31,7 → 30,7 |
byte show_actions=1, |
sort_num=2, |
isdir; |
char path[4096]="/rd/1/", |
char path[4096], |
edit_path[4096], |
file_path[4096], |
file_name[4096], |
39,70 → 38,40 |
temp[4096]; |
byte PathHistory[4096]; |
int toolbar_buttons_x[6]={9,46,85,134,167,203}; |
dword file_mas[6898]; |
int j, i, mouse_dd; |
dword stak[100]; //îêíî About |
edit_box edit1= {250,247,13,0xffffff,videlenie,0xD3DDEB,0xffffff,0,248,#edit_path,#mouse_dd,64,6,6}; |
edit_box edit2= {250,213,80,0xFFFFCC,videlenie,0xFFFFCC,0xffffff,0,248,#file_name,#mouse_dd,64,6,6}; |
edit_box edit1= {250,247,13,0xffffff,0x94AECE,0xD3DDEB,0xffffff,0,248,#edit_path,#mouse_dd,64,6,6}; |
edit_box edit2= {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,#mouse_dd,64,6,6}; |
proc_info Form; |
dword buf, off; //äëÿ òåêñòà è áóôåðà |
dword devbuf, dev_num; |
#include "include\about_dialog.h--" |
#include "include\some_code.h--" |
#include "include\sorting.h--" |
#include "include\icons_f.h--" |
#include "include\ini.h--" |
#include "include\about_dialog.h" |
#include "include\some_code.h" |
#include "include\sorting.h" |
#include "include\icons_f.h" |
#include "include\ini.h" |
#include "include\devices.h" |
void Devices() |
{ |
byte dev_icon; |
dword drive_name[30]; |
char dev_name[4]; |
DrawBar(2,41,190,15,0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñâåðõó |
DrawBar(2,56,15,onTop(21,41),0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñëåâà |
DrawBar(177,56,15,onTop(21,41),0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà |
//ñïèñîê äèñêîâ |
Tip(56, "Goto:", 0, ""); |
for (i=0;i<dev_num;i++) |
{ |
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); //èçíà÷àëüíî íåèçâåñíûé íîñèòåëü |
dev_icon=3; //ïî-óìîë÷àíèþ óñòðîéñòâî âûãëÿäèò êàê æåñòÿê |
copystr(i*304+ devbuf+72, #dev_name); |
IF (dev_name[0]=='r') { dev_icon=0; copystr("RAM-disk /rd/1",#drive_name); } |
IF (dev_name[0]=='c') { dev_icon=1; copystr("CD-drive /",#drive_name); } |
IF (dev_name[0]=='f') { dev_icon=2; copystr("Floppy disk /",#drive_name); } |
IF (dev_name[0]=='h') copystr("Hard disk drive /",#drive_name); |
IF (dev_name[0]=='b') copystr("SATA disk drive /",#drive_name); |
// |
IF (dev_icon<>0) copystr(#dev_name,#drive_name+strlen(#drive_name)); |
copystr("/",#drive_name+strlen(#drive_name)); |
// |
WriteText(45,i*16+79,0x80,0,#drive_name,0); |
PutImage(dev_icon*14*13*3+#devices,14,13,21,i*16+76); |
} |
} |
void main() |
word key, id; |
mouse m; |
int pressed_y; |
{ |
GetIni(1); |
// |
load_editbox_lib(); |
devbuf= malloc(3112); //áóôåð ãäå-òî íà 10 äåâàéñîâ â ëåâîé ïàíåëè |
ReadDir(10, devbuf, "/"); |
dev_num=EBX; |
// |
//curbtn=za_kadrom=0; |
GetSystemDiscs(); |
GetIni(1); |
edit1.shift_color=videlenie; |
edit2.shift_color=videlenie; |
HistoryPath(add_new_path); |
IF (param[0]<>'') //áûë ëè çàïóñê ñ ïàðàìåòðîì |
{ |
109,6 → 78,7 |
copystr(#param, #path); |
IF (strcmp(#path+strlen(#path)-1,"/")<>0) copystr("/",#path+strlen(#path)); //åñëè íåò, + "/" |
} |
else copystr("/rd/1/", #path); |
Open_Dir(#path,ONLY_OPEN); |
loop() |
{ |
167,7 → 137,8 |
IF (scroll_size/2+57>m.y) || (m.y<0) || (m.y>4000) m.y=scroll_size/2+57; //åñëè êóðñîð íàä îêíîì |
id=za_kadrom; //ñîõðàíÿåì ñòàðîå êîëè÷åñòâî |
j= scroll_size/2; |
za_kadrom = m.y -j -57 * count; za_kadrom /= 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 (id<>za_kadrom) List_ReDraw(); //÷òîá ëèøíèé ðàç íå ïåðåðèñîâûâàòü |
m.get(); |
229,22 → 200,21 |
break; |
case 100...120: |
DEVICE_MARK: |
copystr(id-100*304+ devbuf+72, #path); |
IF (path[0]=='r') copystr("/rd/1",#file_path); |
ELSE { |
copystr("/", #file_path); |
copystr(#path, #file_path+strlen(#file_path)); |
} |
GOTO OPEN_DEV; |
//copystr(#disk_list[id-100].Item, #file_path); |
//GOTO OPEN_DEV; |
copystr(#disk_list[id-100].Item, #path); |
za_kadrom=curbtn=0; |
Open_Dir(#path,1); |
break; |
default: |
if (id<200) break; //êíîïêè èç ñïèñêà ôàéëîâ |
IF (curbtn!=id-201) {FileList_ReDraw(id-201-curbtn); break;} |
else OPEN_MARK: |
if (!isdir) GetIni(0); ELSE |
IF (strcmp(#file_name,"..")==0) Dir_Up(); ELSE |
if (!isdir) GetIni(0); else |
if (strcmp(#file_name,"..")==0) Dir_Up(); else |
{ OPEN_DEV: |
copystr(#file_path, #path); |
copystr("/", #path+strlen(#path)); |
IF (strcmp(#path+strlen(#path)-1,"/")<>0) copystr("/",#path+strlen(#path)); //åñëè íåò, + "/" |
za_kadrom=curbtn=0; |
Open_Dir(#path,1); |
} |
275,7 → 245,7 |
{ |
case 209...217: |
id=key-110; |
IF (id-100>=dev_num) break; |
IF (id-100>=disc_num) break; |
GOTO DEVICE_MARK; |
case 8: //Íàçàä |
GoBack(); |
396,8 → 366,8 |
//ïðÿìîóãîëüíèêè âíóòðè |
DrawRegion_3D(1,40,Form.width-12,onTop(46,0),0x94AECE,0x94AECE); //ñèíèé îáîäîê |
DrawRegion_3D(0,39,Form.width-10,onTop(44,0),0xE4DFE1,0xE4DFE1); //ôîí |
Devices(); //ïàíåëü ñëåâà íà ñèíåì ôîíå |
Actions(); //ôóíêöèè ôàéëîâ è ïàïîê |
DrawSystemDiscs(); |
Actions(); |
//SortButtons |
DrawFlatButton(192,40,onLeft(192,168),16,31,0xE4DFE1,"File"); |
DrawFlatButton(onLeft(168,0),40,73,16,32,0xE4DFE1,"Type"); |
408,6 → 378,7 |
DrawBar(onLeft(27,0),57,1,onTop(22,57),0x94AECE); //ëèíèÿ ñëåâà îò ïðîêðóòêè |
DrawFlatButton(onLeft(27,0),40,16,16,0,0xE4DFE1,"\x18"); //ïðîêðóòêà ââåðõ |
DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,0xE4DFE1,"\x19");//ïðîêðóòêà âíèç |
if (del_active==1) Del_Form(); |
} |
453,13 → 424,6 |
} |
else //âíèç |
{ |
/*if (count-za_kadrom-but_num==1) //ýòî çàãëóøêà |
{ |
za_kadrom=count-but_num; |
curbtn=but_num-1; |
List_ReDraw(); |
}*/ |
IF (za_kadrom==count-but_num) && (curbtn==but_num-1) return; |
IF (but_num-curbtn>curbtn_) |
{ |
470,7 → 434,6 |
} |
else |
{ |
//IF(za_kadrom+but_num+curbtn_>=count) //à òóò êàæèñü áûë áàã |
IF(za_kadrom+curbtn+curbtn_>=count) |
{ |
za_kadrom=count-but_num; |
513,7 → 476,7 |
//puticon+icon_fairing!!! |
void Line_ReDraw(dword color, filenum){ |
dword text_col=0, temp_int, |
/* |
/* //ýòî ÿ ïûòàëñÿ ñäåëàòü âèä êðóïíûìè çíà÷êàìè |
dword text_col=0, temp_int, x, |
max_x=onLeft(28,192)/BUTTON_HEIGHT, |
y=filenum/max_x*BUTTON_HEIGHT+57; //ïîëîæåíèå òåêñòà ïî Y |
525,9 → 488,10 |
IF (rename_active==1) ReName(false); |
//äà, ÿ íå ñïîðþ ÷òî èçâðàò, íî ïåðåðèñîâêà çàòî ìàëåíüêàÿ |
DefineButton(192,y,onLeft(28,192),BUTTON_HEIGHT,201+filenum+BT_HIDE+BT_NOFRAME,color); //êíîïà |
DrawBar(192,y,3,BUTTON_HEIGHT,color); DrawBar(195,y,16,2,color); |
DrawBar(192,y,3,BUTTON_HEIGHT,color); |
DrawBar(192+19,y,onLeft(46,192),BUTTON_HEIGHT,color); DrawBar(195,y+17,16,1,color); |
if (BUTTON_HEIGHT>18) DrawBar(195,y+18,16,BUTTON_HEIGHT-18,color); |
if (BUTTON_HEIGHT>15) DrawBar(195,y,16,BUTTON_HEIGHT-15,color); |
// |
off=file_mas[filenum+za_kadrom]*304 + buf+72; |
if (TestBit(ESDWORD[off-40],1)) || (TestBit(ESDWORD[off-40],2)) text_col=0xA6A6B7; |
534,17 → 498,17 |
if (!TestBit(ESDWORD[off-40],4)) |
{ |
copystr(off,#temp); |
temp_int = Put_icon(#temp+find_symbol(#temp,'.'), BUTTON_HEIGHT-14/2+y); |
temp_int = Put_icon(#temp+find_symbol(#temp,'.'), BUTTON_HEIGHT/2-7+y); |
WriteText(7-strlen(ConvertSize(ESDWORD[off-8]))*6+onLeft(75,0),BUTTON_HEIGHT-6/2+y,0x80,0,ConvertSize(ESDWORD[off-8]),0); //size |
} |
ELSE |
IF (!strcmp("..",off)) temp_int=Put_icon("..", y+2); |
IF (!strcmp("..",off)) temp_int=Put_icon("..", BUTTON_HEIGHT/2-7+y); |
ELSE |
temp_int=Put_icon("<DIR>", y+2); |
temp_int=Put_icon("<DIR>", BUTTON_HEIGHT/2-7+y); |
if (color==videlenie) |
{ |
isdir=TestBit(ESDWORD[off-40], 4); |
IconFairing(temp_int, y+2); //çàêðàøèâàåì èêîíêó |
IconFairing(temp_int, BUTTON_HEIGHT/2-7+y); //çàêðàøèâàåì èêîíêó |
copystr(off,#file_name); |
copystr(#path,#file_path); |
copystr(#file_name,#file_path+strlen(#file_path)); //ïîëíûé ïóòü ê ôàéëó |
607,13 → 571,25 |
inline Sorting() |
{ |
dword k=0, l=1; |
IF (!strcmp(#path,"/")) {FOR(k=1;k<count;k++;)file_mas[k]=k; return;} //íå ñîðòèðîâàòü ïàïêè è íå ìåíÿòü ðåãèñòð â "/" |
if (!strcmp(#path,"/")) //íå ñîðòèðîâàòü ïàïêè è íå ìåíÿòü ðåãèñòð â "/" |
{ |
FOR(k=1;k<count;k++;) file_mas[k]=k; |
return; |
} |
FOR (j=count-1, off=count-1*304+buf+32; j>=0; j--, off-=304;) //ïàïêè ââåðõ, ôàéëû âíèç |
{ |
ChangeCase(off+40); |
IF (TestBit(ESDWORD[off],4)) {file_mas[k]=j; k++;} |
ELSE {file_mas[count-l]=j; l++;} |
if (TestBit(ESDWORD[off],4)) //ïàïêà? |
{ |
file_mas[k]=j; |
k++; |
} |
else |
{ |
file_mas[count-l]=j; |
l++; |
} |
} |
//Ñîáñòâåííî ñîðòèðîâêà: âíà÷àëå ïàïêè, ïîòîì ôàéëû |
Sort_by_Name(0,k-1); |
IF (sort_num==1) Sort_by_Name(k,count-1); |
747,15 → 723,16 |
void Actions() |
{ |
int actions_y=dev_num*16; |
int actions_y=disc_num*16; |
DrawBar(17,actions_y+75,160,15,0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè |
DrawBar(17,show_actions*51+actions_y+108,160,onTop(show_actions*51+actions_y+108,6),0x00699C); //ñèíåå â êîíöå |
if (show_actions==1) |
{ |
Tip(actions_y+90, "Actions", 77, "\x19"); |
Tip(actions_y+90, "Actions", 77, "\x19"); //çàãîëîâîê |
DrawBar(17,actions_y+108,160,51,0xFFFFFF); //áåëîå |
PutImage(#factions,16,44,21,actions_y+113); //ïèêòîãðàìêè |
PutImage(#factions,16,44,21,actions_y+113); //èêîíêè |
//rename file |
DefineButton(22,actions_y+108,159,16,80+BT_HIDE,0xE4DFE1); |
DefineButton(17,actions_y+108,159,16,80+BT_HIDE,0xE4DFE1); |
WriteText(42,actions_y+113,0x80,0,"Rename file <F2>",0); |
//delete file |
DefineButton(17,actions_y+125,159,16,81+BT_HIDE,0xE4DFE1); |
764,12 → 741,13 |
DefineButton(17,actions_y+142,159,16,82+BT_HIDE,0xE4DFE1); |
WriteText(42,actions_y+147,0x80,0,"Create folder <F6>",0); |
} |
ELSE |
else |
{ |
DeleteButton(80); DeleteButton(81); DeleteButton(82); |
DeleteButton(80); |
DeleteButton(81); |
DeleteButton(82); |
Tip(actions_y+90, "Actions", 77, "\x18"); |
} |
DrawBar(17,show_actions*51+actions_y+108,160,onTop(show_actions*51+actions_y+108,6),0x00699C); //ñèíåå â êîíöå |
} |
789,13 → 767,8 |
za_kadrom=curbtn=0; //ââåðõ ñïèñêà |
Open_Dir(#path,ONLY_OPEN); |
ChangeCase(that_file); |
FOR (i=count-1; i>=0; i--;) IF(strcmp(file_mas[i]*304+buf+72,that_file)==0) BREAK; |
/*IF (i>but_num-1) && (i>count-but_num) //âñ¸ ýòî ïî-èäåå ìîæíî ñäåëàòü ÷åðåç FileList_ReDraw(i) èëè ÿ íåïðàâ? |
{ |
za_kadrom=count-but_num; |
curbtn=i-count+but_num; |
} |
ELSE FileList_ReDraw(i);*/ |
for (i=count-1; i>=0; i--;) |
if (strcmp(file_mas[i]*304+buf+72,that_file)==0) break; |
FileList_ReDraw(i); |
List_ReDraw(); |
} |
/programs/fs/Eolite/trunk/History.txt |
---|
1,6 → 1,19 |
05.04.12 -- v1.1 --16,2 Êá |
- îòîáðàæåíèå ñïèñêà äèñêîâ, à íå óñòðîéñòâ â ïàíåëè ñëåâà; |
- óìåíüøåí ðàçìåð ïðîãðàììû è ïîòðåáëÿåìîé ïàìÿòè; |
- âîçìîæíîñòü çàäàòü öâåò âûäåëåíèÿ è âûñîòó ïóíêòà â ñïèñêå ôàéëîâ; |
- ïîñëå ïåðåðèñîâêè îêíà ïðîïàäàë äèàëîã óäàëåíèÿ ôàéëà |
- äðóãèå ìåëêèå èñïðàâëåíèÿ. |
26.03.12 -- v1.0 --16,2 Êá |
Ìåëêèå èñïðàâëåíèÿ. |
27.08.11 -- v0.99.8 RC3 -- 16.2 Êá |
- èñïðàâëåíèÿ â ñêðîëëáàðå, áàã ñî âðåì¸í ïåðâûõ âåðñèé; |
- â 90% ñëó÷àåâ íå âûäåëÿëî ïåðåèìåíîâàíûé ôàéë; |
/programs/fs/Eolite/trunk/ReadMe_en.txt |
---|
29,6 → 29,7 |
turbanoff |
Sorcerer |
Gluk |
lev |
KolibriOS Forever! |
/programs/fs/Eolite/trunk/ReadMe_ru.txt |
---|
27,6 → 27,7 |
Mario79 - ñîâåòû. |
S1n - çà ðåàëèçàöèþ ðàáîòû ñ lib_ini (óâû íå èñïîëüçóåìóþ). |
Rock_maniak_forever, turbanoff, Sorcerer, Gluk, Albom - çà íàéäåíûå áàãè. |
lev - çà àëãîðèòì ðàáîòû ñ ìàññèâàìè ñòðîê. |
Ó íàñ áóäåò ñâîé Ìåíóåò ñ áëåêäæåêîì! È øëþõàìè! KolibriOS Forever! |
/programs/fs/Eolite/trunk/compile.bat |
---|
1,5 → 1,5 |
@..\C--\c-- Eolite.c-- |
del Eolite |
rename Eolite.com Eolite |
@..\C--\kpack Eolite |
rem @..\C--\kpack Eolite |
pause |
/programs/fs/Eolite/trunk/include/some_code.h-- |
---|
File deleted |
/programs/fs/Eolite/trunk/include/icons_f.h-- |
---|
File deleted |
/programs/fs/Eolite/trunk/include/about_dialog.h-- |
---|
File deleted |
\ No newline at end of file |
/programs/fs/Eolite/trunk/include/sorting.h-- |
---|
File deleted |
/programs/fs/Eolite/trunk/include/ini.h-- |
---|
File deleted |
/programs/fs/Eolite/trunk/include/about_dialog.h |
---|
0,0 → 1,56 |
//Leency - 2012 |
#include "imgs\logo.txt" |
#define BROWSER_PATH "/sys/htmlv" |
#define BROWSER_LINK "http://www.kolibri-os.narod.ru" |
void authors() |
{ |
byte p; |
mouse mm; |
byte id, letitclose=0; |
SetEventMask(100111b); |
loop() switch(WaitEvent()) |
{ |
case evMouse: |
mm.get(); |
//êóëüíî |
IF (mm.x>85) && (mm.x<155) && (mm.y>190) && (mm.y<190+22) |
IF (mm.lkm) {DrawRegion_3D(86,191,68,20,0xC7C7C7,0xFFFFFF); letitclose=1;} |
ELSE {IF (letitclose) {DrawRegion_3D(86,191,68,20,0xFFFFFF,0xC7C7C7); Pause(7); ExitProcess();}} |
ELSE IF (letitclose) {letitclose=0; DrawRegion_3D(86,191,68,20,0xFFFFFF,0xC7C7C7);} |
break; |
case evButton: |
id=GetButtonID(); |
IF (id==1) ExitProcess(); |
IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK); |
break; |
case evKey: |
IF (GetKey()==27) ExitProcess(); |
break; |
case evReDraw: |
DefineAndDrawWindow(600,150,181,256,0x34,0x10EFEBEF,0,0,"About Eolite"); |
DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè |
PutPaletteImage(#logo,85,85,43,7,#logo_pal); |
WriteText(54,100,0x80,0xBF40BF,"Eolite v1.1",0); |
WriteText(55,120,0x80,0,"Developers:",0); |
WriteText(39,130,0x80,0,"Leency & Veliant",0); |
WriteText(30,140,0x80,0,"Diamond, Lrz, Nable",0); |
WriteText(55,150,0x80,0," 2008-2012 ",0); |
WriteText(12,170,0x80,0,"Visit",0); |
DrawLink(48,170,23, "kolibri-os.narod.ru"); //ññûëêa |
DrawFlatButton(85,190,70,22,0,0xE4DFE1, "Close"); |
} |
} |
void DrawLink(dword x,y,btn_id, inscription) |
{ |
WriteText(x,y,0x80,0x4E00E7,inscription,0); |
DrawBar(x,y+8,strlen(inscription)*6,1,0x4E00E7); //ïîä÷åðêíóòü ññûëêó |
DefineButton(x-1,y-1,strlen(inscription)*6,10,btn_id+BT_HIDE,0); |
} |
/programs/fs/Eolite/trunk/include/devices.h |
---|
0,0 → 1,70 |
//03.04.2012 |
struct string { |
char Item[4096]; |
}; |
string disk_list[20]; |
int disc_num; |
void GetSystemDiscs() |
{ |
char dev_name[10], sys_discs[10]; |
int i1, j1, dev_num, dev_disc_num; |
dword devbuf; |
devbuf= malloc(3112); //áóôåð ãäå-òî íà 10 äåâàéñîâ â ëåâîé ïàíåëè |
ReadDir(10, devbuf, "/"); |
dev_num = EBX; |
for (i1=0; i1<dev_num; i1++) |
{ |
copystr("/", #dev_name); // / |
copystr(i1*304+ devbuf+72, #dev_name+strlen(#dev_name)); // /rd |
copystr("/", #dev_name+strlen(#dev_name)); // /rd/ |
Open_Dir(#dev_name, ONLY_OPEN); |
dev_disc_num = count; |
for (j1=0; j1<dev_disc_num; j1++;) |
{ |
copystr(#dev_name, #sys_discs); // /rd/ |
copystr(j1*304+ buf+72, #sys_discs+strlen(#sys_discs)); // /rd/1 |
copystr("/", #sys_discs+strlen(#sys_discs)); // /rd/1/ |
copystr(#sys_discs,#disk_list[disc_num].Item); |
disc_num++; |
} |
} |
} |
void DrawSystemDiscs() |
{ |
byte disc_icon; |
char dev_name[6]; |
char disc_name[100]; |
int i, dev_icon; |
DrawBar(2,41,190,15,0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñâåðõó |
DrawBar(2,56,15,onTop(21,41),0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñëåâà |
DrawBar(177,56,15,onTop(21,41),0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà |
//ñïèñîê äèñêîâ |
Tip(56, "Disks", 0, ""); |
for (i=0;i<disc_num;i++) |
{ |
DrawBar(17,i*16+74,160,17,0xFFFFFF); //áåëîå |
DefineButton(17,i*16+74,159,16,100+i+BT_HIDE,0xFFFFFF); //ñîçäà¸ì êíîïêè, à ïîòîì âûâîäèì íàçâàíèÿ äèñêîâ |
copystr("Unknown drive",#disc_name); //èçíà÷àëüíî íåèçâåñíûé íîñèòåëü |
dev_icon=3; //ïî-óìîë÷àíèþ óñòðîéñòâî âûãëÿäèò êàê æåñòÿê |
copystr(#disk_list[i].Item, #dev_name); |
IF (dev_name[1]=='r') { dev_icon=0; copystr("RAM disk ",#disc_name); } |
IF (dev_name[1]=='c') { dev_icon=1; copystr("CD-ROM ",#disc_name); } |
IF (dev_name[1]=='f') { dev_icon=2; copystr("Floppy disk ",#disc_name); } |
IF (dev_name[1]=='h') || (dev_name[1]=='b') copystr("Hard disk ",#disc_name); |
//IF (dev_name[1]=='b') copystr("SATA disk ",#disc_name); |
copystr(#dev_name,#disc_name+strlen(#disc_name)); |
// |
WriteText(45,i*16+79,0x80,0,#disc_name,0); |
PutImage(dev_icon*14*13*3+#devices,14,13,21,i*16+76); |
} |
} |
/programs/fs/Eolite/trunk/include/icons_f.h |
---|
0,0 → 1,247 |
#include "imgs\icons.txt" |
dword Put_icon(dword extension, yy) |
{ |
dword ftype="", fnum=0; //åøè íåèçâåñíûé ôàéë |
IF (!strcmp(extension,"htm")) || (!strcmp(extension,"html")) || |
(!strcmp(extension,"mht")) {fnum = 2; ftype="Web-page";} |
IF (!strcmp(extension,"ini")) || (!strcmp(extension,"conf")) {fnum = 3; ftype="Config";} |
IF (!strcmp(extension,"xlt")) || (!strcmp(extension,"xls")) || |
(!strcmp(extension,"ods")) || (!strcmp(extension,"xlsx")) {fnum = 4; ftype="Table";} |
IF (!strcmp(extension,"cmd")) || (!strcmp(extension,"bat")) || (!strcmp(extension,"sh")) {fnum = 5; ftype="Script";} |
IF (!strcmp(extension,"com")) {fnum = 5; ftype="DOS Exec";} |
IF (!strcmp(extension,"kex")) {fnum = 6; ftype="Program";} |
IF (!strcmp(extension,"exe")) || (!strcmp(extension,"msi")) {fnum = 7; ftype="Win32 Exec";} |
IF (!strcmp(extension,"sys")) || (!strcmp(extension,"ocx")) || |
(!strcmp(extension,"drv")) || (!strcmp(extension,"so")) fnum = 8; |
IF (!strcmp(extension,"inc")) fnum = 9; |
IF (!strcmp(extension,"chr")) || (!strcmp(extension,"mt")) || |
(!strcmp(extension,"ttf")) || (!strcmp(extension,"fon")) {fnum = 10; ftype="Font";} |
IF (!strcmp(extension,"asm")) {fnum = 11; ftype="Source";} |
IF (!strcmp(extension,"skn")) {fnum = 13; ftype="Skin";} |
IF (!strcmp(extension,"djvu")) || (!strcmp(extension,"pdf")) {fnum = 15; ftype="Book";} |
IF (!strcmp(extension,"nes")) {fnum = 18; 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,"iso")) || (!strcmp(extension,"cue")) || |
(!strcmp(extension,"nrg")) || (!strcmp(extension,"mdf")) {fnum = 24; ftype="Disc image";} |
//text |
IF (!strcmp(extension,"txt")) || (!strcmp(extension,"doc")) || |
(!strcmp(extension,"rtf")) || (!strcmp(extension,"odt")) || |
(!strcmp(extension,"log")) || (!strcmp(extension,"docx")) {fnum = 1; ftype="Text";} |
//èçîáðàæåíèÿ |
IF (!strcmp(extension,"gif")) || (!strcmp(extension,"bmp")) || |
(!strcmp(extension,"tga")) || (!strcmp(extension,"pcx")) || |
(!strcmp(extension,"png")) || (!strcmp(extension,"jpg")) {fnum = 19; ftype="Image";} |
IF (!strcmp(extension,"xcf")) || (!strcmp(extension,"ai")) || |
(!strcmp(extension,"jpeg")) || (!strcmp(extension,"raw")) || |
(!strcmp(extension,"psd")) {fnum = 19; ftype="Image";} |
//ïèêòîãðàììû |
IF (!strcmp(extension,"ico")) {fnum = 20; ftype="Icon";} |
IF (!strcmp(extension,"cur")) || (!strcmp(extension,"ani")) {fnum = 20; ftype="Cursor";} |
//àðõèâû |
IF (!strcmp(extension,"rar")) || (!strcmp(extension,"zip")) || |
(!strcmp(extension,"cab")) || (!strcmp(extension,"tar")) || |
(!strcmp(extension,"ajr")) || (!strcmp(extension,"jar")) || |
(!strcmp(extension,"7z")) ||(!strcmp(extension,"gz")) {fnum = 23; ftype="Archive";} |
//audio |
IF (!strcmp(extension,"mp3")) {fnum = 12; ftype="Music";} |
IF (!strcmp(extension,"wav")) || (!strcmp(extension,"mid")) || |
(!strcmp(extension,"midi")) || (!strcmp(extension,"ogg")) || |
(!strcmp(extension,"wma")) || (!strcmp(extension,"flac")) {fnum = 12; ftype="Audio";} |
//video |
IF (!strcmp(extension,"avi")) || (!strcmp(extension,"flv")) || |
(!strcmp(extension,"mpg")) || (!strcmp(extension,"wmv")) || |
(!strcmp(extension,"mov")) || (!strcmp(extension,"mkv")) || |
(!strcmp(extension,"mp4")) || (!strcmp(extension,"vob")) {fnum = 14; ftype="Video";} |
//ïàïêè |
IF (!strcmp(extension,"<DIR>")) { fnum=16; WriteText(onLeft(145,0),yy+4,0x80,0,extension,0);} |
IF (!strcmp(extension,"..")) fnum=17; |
// |
PutPaletteImage(fnum*16*15+#ficons,16,15,195,yy,#ficons_pal); |
WriteText(onLeft(160,0),yy+4,0x80,0,ftype,0); |
return fnum; |
} |
void IconFairing(int filenum, y) |
{ |
switch(filenum) |
{ |
case 0...1: //ôàéëèê |
DrawBar(195,y,2,15,videlenie); |
RIGHT_PAINT: |
DrawBar(209,y,2,15,videlenie); |
DrawBar(205,y,4,1,videlenie); |
DrawBar(206,y+1,3,1,videlenie); |
DrawBar(207,y+2,2,1,videlenie); |
PutPixel(208,y+3,videlenie); |
return; |
case 2: //html |
DrawBar(195,y,1,7,videlenie); |
DrawBar(196,y,1,6,videlenie); |
DrawBar(195,y+10,1,5,videlenie); |
DrawBar(196,y+11,1,4,videlenie); |
GOTO RIGHT_PAINT; |
case 3: //íàñòðîéêè |
DrawBar(195,y,2,7,videlenie); |
DrawBar(195,y+7,1,2,videlenie); |
DrawBar(195,y+12,1,3,videlenie); |
PutPixel(196,y+14,videlenie); |
GOTO RIGHT_PAINT; |
case 9: //inc |
DrawBar(195,y,1,12,videlenie); |
DrawBar(196,y,1,11,videlenie); |
DrawBar(197,y,1,10,videlenie); |
DrawBar(198,y,1,5,videlenie); |
DrawBar(199,y,1,4,videlenie); |
DrawBar(200,y,1,3,videlenie); |
DrawBar(201,y,1,2,videlenie); |
DrawBar(202,y,1,3,videlenie); |
DrawBar(203,y,1,2,videlenie); |
PutPixel(204,y,videlenie); |
PutPixel(205,y+4,videlenie); |
PutPixel(206,y+3,videlenie); |
PutPixel(207,y,videlenie); |
PutPixel(207,y+2,videlenie); |
DrawBar(208,y,1,3,videlenie); |
DrawBar(209,y,2,4,videlenie); |
DrawBar(210,y,1,15,videlenie); |
PutPixel(198,y+14,videlenie); |
DrawBar(199,y+13,1,2,videlenie); |
DrawBar(200,y+12,10,3,videlenie); |
PutPixel(205,y+11,videlenie); |
DrawBar(206,y+10,1,2,videlenie); |
DrawBar(207,y+9,1,3,videlenie); |
PutPixel(207,y+7,videlenie); |
DrawBar(208,y+6,2,7,videlenie); |
PutPixel(209,y+5,videlenie); |
return; |
case 10: //font |
DrawRegion_3D(195,y,15,14,videlenie,videlenie); |
DrawBar(196,y+1,1,13,videlenie); |
DrawBar(197,y+1,1,11,videlenie); |
DrawBar(198,y+1,1,10,videlenie); |
DrawBar(199,y+1,1,9,videlenie); |
DrawBar(200,y+1,1,7,videlenie); |
DrawBar(201,y+1,1,5,videlenie); |
DrawBar(202,y+1,1,4,videlenie); |
DrawBar(203,y+1,1,2,videlenie); |
DrawBar(209,y+1,1,13,videlenie); |
DrawBar(208,y+1,1,11,videlenie); |
PutPixel(204,y+6,videlenie); |
DrawBar(203,y+10,2,1,videlenie); |
DrawBar(202,y+11,2,3,videlenie); |
return; |
case 11: //asm |
DrawBar(195,y,1,15,videlenie); |
return; |
case 12: //audio |
DrawBar(195,y,16,1,videlenie); |
DrawBar(195,y,1,15,videlenie); |
DrawBar(196,y+1,4,8,videlenie); |
DrawBar(196,y+9,1,2,videlenie); |
PutPixel(197,y+9,videlenie); |
PutPixel(196,y+14,videlenie); |
DrawBar(210,y+1,1,14,videlenie); |
DrawBar(202,y+4,6,4,videlenie); |
DrawBar(202,y+8,4,1,videlenie); |
DrawBar(202,y+9,3,1,videlenie); |
DrawBar(202,y+10,2,3,videlenie); |
DrawBar(201,y+13,4,1,videlenie); |
DrawBar(200,y+14,14,1,videlenie); |
DrawBar(209,y+12,1,2,videlenie); |
PutPixel(208,y+13,videlenie); |
return; |
case 13: //skin |
PutPixel(210,y,videlenie); |
return; |
case 14...15: //video, book |
DrawBar(195,y,1,15,videlenie); |
DrawBar(210,y,1,15,videlenie); |
return; |
case 16...17: //ïàïêà |
DrawBar(195,y,1,15,videlenie); |
DrawBar(203,y,8,2,videlenie); |
IF (filenum==17) PutPixel(206,y+1,0x1A7B17); //çåë¸íàÿ òî÷êà ñòðåëêè |
DrawBar(196,y+13,15,2,videlenie); |
PutPixel(196,y,videlenie); //.òî÷êè |
PutPixel(202,y,videlenie); |
PutPixel(210,y+2,videlenie); |
PutPixel(196,y+12,videlenie); |
PutPixel(210,y+12,videlenie); |
return; |
case 18: //êàðòðèäæ |
DrawBar(195,y,16,2,videlenie); |
DrawBar(195,y+11,1,2,videlenie); |
DrawBar(210,y+11,1,2,videlenie); |
DrawBar(195,y+13,16,2,videlenie); |
return; |
case 19: //èçîáðàæåíèå |
case 20: //èçîáðàæåíèå |
DrawBar(195,y+14,16,1,videlenie); |
return; |
case 21: //äèñêåòà |
PutPixel(195,y,videlenie); |
PutPixel(210,y,videlenie); |
return; |
case 22: //áèáëèîòåêà |
DrawBar(195,y,16,1,videlenie); //ñâåðõó ñëåâà |
DrawBar(195,y+1,3,1,videlenie); |
DrawBar(195,y+2,2,1,videlenie); |
PutPixel(195,y+3,videlenie); |
PutPixel(210,y+11,videlenie); //ñïðàâà ñïðàâà |
DrawBar(209,y+12,2,1,videlenie); |
DrawBar(208,y+13,3,1,videlenie); |
DrawBar(207,y+14,4,1,videlenie); |
return; |
case 23: //àðõèâ |
PutPixel(195,y+3,videlenie); |
PutPixel(195,y+11,videlenie); |
PutPixel(210,y+3,videlenie); |
PutPixel(210,y+11,videlenie); |
DrawBar(195,y,7,1,videlenie); |
DrawBar(204,y,7,1,videlenie); |
DrawBar(195,y+14,7,1,videlenie); |
DrawBar(204,y+14,7,1,videlenie); |
DrawBar(195,y+1,5,1,videlenie); |
DrawBar(206,y+1,5,1,videlenie); |
DrawBar(195,y+13,5,1,videlenie); |
DrawBar(206,y+13,5,1,videlenie); |
DrawBar(195,y+2,3,1,videlenie); |
DrawBar(208,y+2,3,1,videlenie); |
DrawBar(195,y+12,3,1,videlenie); |
DrawBar(208,y+12,3,1,videlenie); |
return; |
case 24: //îáðàç |
DrawBar(195,y,6,1,videlenie); |
DrawBar(195,y+1,4,1,videlenie); |
DrawBar(195,y+2,3,1,videlenie); |
DrawBar(195,y+3,2,2,videlenie); |
DrawBar(195,y+5,1,5,videlenie); |
DrawBar(195,y+10,2,2,videlenie); |
DrawBar(195,y+12,3,1,videlenie); |
DrawBar(195,y+13,4,1,videlenie); |
DrawBar(195,y+14,6,1,videlenie); |
DrawBar(195+11,y,5,1,videlenie); |
DrawBar(195+13,y+1,3,1,videlenie); |
DrawBar(195+14,y+2,2,1,videlenie); |
DrawBar(195+15,y+3,1,2,videlenie); |
DrawBar(195+15,y+10,1,2,videlenie); |
DrawBar(195+14,y+12,2,1,videlenie); |
DrawBar(195+13,y+13,3,1,videlenie); |
DrawBar(195+11,y+14,5,1,videlenie); |
return; |
} |
} |
/programs/fs/Eolite/trunk/include/ini.h |
---|
0,0 → 1,121 |
//INI parser in C--, GPL licence. |
//Leency - 2012 |
#define COMMENT 0 |
#define SECTION 1 |
#define PARAM 2 |
#define OPTION 3 |
char NOTIFY_PATH[7]="@notify"; |
void GetIni(byte onload) |
{ |
byte section[32]='', parametr[32]='', option[256]='', InfType=0; |
word bukva[1]; |
int errornum; |
dword buff, fsize, tj; |
//÷èòàåì ôàéë |
buff = malloc(1048576); |
IF (onload==1) copystr(".ini", #program_path+strlen(#program_path)); //facepalm |
ReadFile(0, 1048576, buff, #program_path); |
IF (EAX<>6) //åñëè ôàéëà ñ íàñòðîéêàìè íåò â ïàïêå ñ ïðîãðàììîé ñìîòðèì â ïàïêå ïî-óìîë÷àíèþ |
ReadFile(0, 1048576, buff, "/sys/File managers/Eolite.ini"); |
IF (EAX<>6) //åñëè ôàéëà ñ íàñòðîéêàìè òóïî íåò ïå÷àëüêà |
{ |
IF (onload==1) RunProgram(#NOTIFY_PATH, "Eolite.ini not found. Defaults will be used."); |
IF (onload==0) goto RUN_AS_PROGRAM; |
} |
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,"SelectionColor")==0) videlenie=StrToCol(#option); |
IF (strcmp(#parametr,"LineHeight")==0) BUTTON_HEIGHT=StrToInt(#option); |
IF (parametr) && (!strcmp(#file_name+find_symbol(#file_name,'.'),#parametr)) { |
errornum=RunProgram(#option,#file_path); |
IF (errornum<0) //åñëè îøèáî÷êà âûøëà ïðè çàïóñêå |
{ |
//WriteDebug(#option); |
Write_Debug_Error(errornum); |
} |
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)); |
} |
} |
RUN_AS_PROGRAM: |
IF (file_path) errornum=RunProgram(#file_path,''); |
IF (errornum<0) //åñëè îøèáî÷êà âûøëà ïðè çàïóñêå |
{ |
//WriteDebug(#file_path); |
Write_Debug_Error(errornum); |
} |
} |
/////////////////////////////////////////// |
/// íóæíî ÷òîáû ïðîñòî âîçâðàùàëî òåêñò /// |
/////////////////////////////////////////// |
void Write_Debug_Error(int error_number) |
{ |
char unknown_error[8]; |
if (error_number<0) error_number=-1*error_number; |
switch (error_number) //èçâåñíàÿ îøèáêà - ïèøåì êàêàÿ è óõîäèì |
{ |
CASE 2: RunProgram(#NOTIFY_PATH, "Eolite: error 2 - Function is not supported for the given file system"); |
return; |
CASE 3: RunProgram(#NOTIFY_PATH, "Eolite: error 3 - Unknown file system"); |
return; |
CASE 5: RunProgram(#NOTIFY_PATH, "Eolite: error 5 - File or folder not found"); |
return; |
CASE 6: RunProgram(#NOTIFY_PATH, "Eolite: error 6 - End of file, EOF"); |
return; |
CASE 7: RunProgram(#NOTIFY_PATH, "Eolite: error 7 - Pointer lies outside of application memory"); |
return; |
case 8: RunProgram(#NOTIFY_PATH, "Eolite: error 8 - FAT table is destroyed"); |
return; |
case 9: RunProgram(#NOTIFY_PATH, "Eolite: error 9 - FAT table is destroyed"); |
return; |
case 10:RunProgram(#NOTIFY_PATH, "Eolite: error 10 - Access denied"); |
RETURN; |
case 11:RunProgram(#NOTIFY_PATH, "Eolite: error 11 - Device error"); |
RETURN; |
case 30:RunProgram(#NOTIFY_PATH, "Eolite: error 30 - Not enough memory"); |
RETURN; |
case 31:RunProgram(#NOTIFY_PATH, "Eolite: error 31 - File is not executable"); |
RETURN; |
case 32:RunProgram(#NOTIFY_PATH, "Eolite: error 32 - Too many processes"); |
RETURN; |
default:copystr(IntToStr(error_number), #unknown_error); |
copystr(" - Unknown error number O_o", #unknown_error+strlen(#unknown_error)); |
RunProgram(#NOTIFY_PATH, #unknown_error); |
} |
} |
/programs/fs/Eolite/trunk/include/some_code.h |
---|
0,0 → 1,53 |
//Leency - 2012 |
#define add_new_path 1 |
#define go_back 2 |
void HistoryPath(byte action) |
{ |
if (action==add_new_path) |
{ |
IF (strcmp(#PathHistory+find_symbol(#PathHistory,'|'),#path)==0) return; |
IF (strlen(#PathHistory)+strlen(#path)>2560) |
{ |
copystr(#PathHistory+1024,#PathHistory); |
copystr("/",#PathHistory+strlen(#PathHistory)); |
} |
copystr("|",#PathHistory+strlen(#PathHistory)); |
copystr(#path,#PathHistory+strlen(#PathHistory)); |
} |
if (action==go_back) |
{ |
i=strlen(#PathHistory)-1; |
WHILE (PathHistory[i]<>'|') { i--; }; |
IF (i>0) PathHistory[i]=0x00; |
WHILE (PathHistory[i]<>'|') { copystr(#PathHistory[i],#path); i--; } |
IF (i>0) PathHistory[i]=0x00; |
} |
} |
dword onLeft(dword right,left) {EAX=Form.width-right-left;} |
dword onTop(dword down,up) {EAX=Form.height-GetSkinWidth()-down-up;} |
void ShowMessage(dword message) |
{ |
DrawFlatButton(Form.width/2-13,160,200,80,0,0xFFB6B5, message); |
Pause(150); |
List_ReDraw(); |
} |
dword ConvertSize(dword bytes) |
{ |
byte size_prefix[8], 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; |
} |
/programs/fs/Eolite/trunk/include/sorting.h |
---|
0,0 → 1,55 |
//Áûñòðàÿ ñîðòèðîâêà. Leency 2008. |
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+64] <= ESDWORD[file_mas[b]*304 + buf+64]) |
{ 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); |
} |
void Sort_by_Type(int a, b) // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1 |
{ |
int i=a; |
int n; |
dword offset=buf+72; |
byte filename1[256], filename2[256]; |
IF (a >= b) return; |
for (j = a; j <= b; j++) |
{ |
// |
copystr(file_mas[j]*304 + offset, #filename1); |
copystr(file_mas[b]*304 + offset, #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 + offset, file_mas[b]*304 + offset)<=0) { file_mas[i] >< file_mas[j]; i++;} |
} |
Sort_by_Type(a, i-2); |
Sort_by_Type(i, b); |
} |
/programs/fs/Eolite/trunk/lib/file_system.h-- |
---|
File deleted |
/programs/fs/Eolite/trunk/lib/edit_box_lib.h-- |
---|
File deleted |
/programs/fs/Eolite/trunk/lib/memory.h-- |
---|
File deleted |
/programs/fs/Eolite/trunk/lib/kolibri.h-- |
---|
File deleted |
\ No newline at end of file |
/programs/fs/Eolite/trunk/lib/edit_box_lib.h |
---|
0,0 → 1,94 |
//BOX_LIB |
//Lrz - 2008 |
dword edit_box_draw = #aEdit_box_draw; |
dword edit_box_key = #aEdit_box_key; |
dword edit_box_mouse = #aEdit_box_mouse; |
dword am__ = 0x0; |
dword bm__ = 0x0; |
char aEdit_box_draw[9] = "edit_box\0"; |
char aEdit_box_key[13] = "edit_box_key\0"; |
char aEdit_box_mouse[15] = "edit_box_mouse\0"; |
struct edit_box{ |
dword width, left, top, color, shift_color, focus_border_color, blur_border_color, |
text_color, max, text, mouse_variable, flags, size, pos, offset, cl_curs_x, cl_curs_y, shift, shift_old; |
}; |
//ed_width equ [edi] ;è¨à¨ ª®¬¯®¥â |
//ed_left equ [edi+4] ;¯®«®¦¥¨¥ ¯® ®á¨ å |
//ed_top equ [edi+8] ;¯®«®¦¥¨¥ ¯® ®á¨ ã |
//ed_color equ [edi+12] ;梥â ä® ª®¬¯®¥â |
//shift_color equ [edi+16] ;=0x6a9480 |
//ed_focus_border_color equ [edi+20] ;梥â à ¬ª¨ ª®¬¯®¥â |
//ed_blur_border_color equ [edi+24] ;梥⠥ ªâ¨¢®£® ª®¬¯®¥â |
//ed_text_color equ [edi+28] ;梥â ⥪áâ |
//ed_max equ [edi+32] ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦® ¬ ªá¨¬ «ì® ¢¢¥á⨠|
//ed_text equ [edi+36] ;㪠§ â¥«ì ¡ãä¥à |
//ed_flags equ [edi+40] ;ä« £¨ |
//ed_size equ [edi+42] ;ª®«-¢® ᨬ¢®«®¢ |
//ed_pos equ [edi+46] ;¯®§¨æ¨ï ªãàá®à |
//ed_offset equ [edi+50] ;ᬥ饨¥ |
//cl_curs_x equ [edi+54] ;¯à¥¤ë¤ã饥 ª®®à¤¨ â ªãàá®à ¯® å |
//cl_curs_y equ [edi+58] ;¯à¥¤ë¤ã饥 ª®®à¤¨ â ªãàá®à ¯® ã |
//ed_shift_pos equ [edi+62] ;¯®«®¦¥¨¥ ªãàá®à |
//ed_shift_pos_old equ [edi+66] ;áâ ஥ ¯®«®¦¥¨¥ ªãàá®à |
int fastcall load_editbox_lib(EAX) |
{ |
//set mask |
$mov eax,40 |
$mov ebx,0x27 |
$int 0x40 |
// load DLL |
$mov eax, 68 |
$mov ebx, 19 |
ECX="/sys/lib/box_lib.obj"; |
$int 0x40 |
$test eax, eax |
$jz exit |
// initialize import |
$mov edx,eax |
ESI=#edit_box_draw; |
import_loop: |
$lodsd |
$test eax,eax |
$jz import_done |
$push edx |
import_find: |
$mov ebx,DSDWORD[EDX] |
$test ebx, ebx |
$jz exit |
$push eax |
nex1: |
$mov cl,DSBYTE[EAX]; |
$cmp cl,DSBYTE[EBX]; |
$jnz import_find_next |
$test cl,cl |
$jz import_found |
$inc eax |
$inc ebx |
$jmp nex1 |
import_find_next: |
$pop eax |
$add edx, 8 |
$jmp import_find |
import_found: |
$pop eax |
$mov eax,DSDWORD[edx+4] |
$mov DSDWORD[esi-4],eax |
$pop edx |
$jmp import_loop |
import_done: |
return 0; |
exit: |
return -1; |
} |
/programs/fs/Eolite/trunk/lib/file_system.h |
---|
0,0 → 1,160 |
//CODED by Veliant, Leency 2008-2012. GNU GPL licence. |
struct f70{ |
dword func; |
dword param1; |
dword param2; |
dword param3; |
dword param4; |
char rezerv; |
dword name; |
}; |
struct BDVK{ |
dword attr; |
byte type_name; |
byte rez1, rez2, rez3; |
dword timecreate; |
dword datecreate; |
dword timelastaccess; |
dword datelastaccess; |
dword timelastedit; |
dword datelastedit; |
dword sizelo; |
dword sizehi; |
char name[518]; |
}; |
//////////////////////////// |
// ³ðî÷èòàòü ôàéë // |
//////////////////////////// |
f70 read_file_70; |
void ReadFile(dword pos, file_size, read_buffer, file_path) |
{ |
read_file_70.func = 0; |
read_file_70.param1 = pos; |
read_file_70.param2 = 0; |
read_file_70.param3 = file_size; |
read_file_70.param4 = read_buffer; |
read_file_70.rezerv = 0; |
read_file_70.name = file_path; |
$mov eax,70 |
$mov ebx,#read_file_70.func |
$int 0x40 |
} |
/////////////////////////// |
// ³ðî÷èòàòü ïàïêó // |
/////////////////////////// |
f70 read_dir_70; |
int ReadDir(dword file_count, read_buffer, read_dir_path) |
{ |
read_dir_70.func = 1; |
read_dir_70.param1 = 0; |
read_dir_70.param2 = 0; |
read_dir_70.param3 = file_count; |
read_dir_70.param4 = read_buffer; |
read_dir_70.rezerv = 0; |
read_dir_70.name = read_dir_path; |
$mov eax,70 |
$mov ebx,#read_dir_70.func |
$int 0x40 |
} |
/////////////////////////// |
// ³àïóñê ïðîãðàììv // |
/////////////////////////// |
f70 run_file_70; |
int RunProgram(dword run_path, run_param) |
{ |
run_file_70.func = 7; |
run_file_70.param1 = |
run_file_70.param3 = |
run_file_70.param4 = |
run_file_70.rezerv = 0; |
run_file_70.param2 = run_param; |
run_file_70.name = run_path; |
$mov eax,70 |
$mov ebx,#run_file_70.func |
$int 0x40 |
} |
/////////////////////////// |
// Tîçäàíèå ïàïêè // |
/////////////////////////// |
f70 create_dir_70; |
int CreateFolder(dword new_folder_path) |
{ |
create_dir_70.func = 9; |
create_dir_70.param1 = |
create_dir_70.param2 = |
create_dir_70.param3 = |
create_dir_70.param4 = |
create_dir_70.rezerv = 0; |
create_dir_70.name = new_folder_path; |
$mov eax,70 |
$mov ebx,#create_dir_70.func |
$int 0x40 |
} |
//////////////////////////// |
// Läàëåíèå ôàéëà/ïàïêè // |
//////////////////////////// |
f70 del_file_70; |
int DeleleFile(dword del_file_path) |
{ |
del_file_70.func = 8; |
del_file_70.param1 = |
del_file_70.param2 = |
del_file_70.param3 = |
del_file_70.param4 = |
del_file_70.rezerv = 0; |
del_file_70.name = del_file_path; |
$mov eax,70 |
$mov ebx,#del_file_70.func |
$int 0x40 |
} |
/////////////////////////// |
// Têîïèðîâàòü ôàéë // |
/////////////////////////// |
f70 CopyFile_f; |
inline fastcall int CopyFile(dword EBX,ECX) |
{ |
BDVK CopyFile_atr; |
dword s=EBX, d=ECX, cBufer=0; |
CopyFile_f.func = 5; |
CopyFile_f.param1 = 0; |
CopyFile_f.param2 = 0; |
CopyFile_f.param3 = 0; |
CopyFile_f.param4 = #CopyFile_atr; |
CopyFile_f.rezerv = 0; |
CopyFile_f.name = s; |
$mov eax, 70 |
$mov ebx, #CopyFile_f |
$int 0x40 |
if (!EAX) |
{ |
cBufer = malloc(2*CopyFile_atr.sizelo); |
ReadFile(dword 0, CopyFile_atr.sizelo, cBufer, s); |
IF (!EAX) |
{ |
CopyFile_f.func = 2; |
CopyFile_f.param1 = 0; |
CopyFile_f.param2 = 0; |
CopyFile_f.param3 = CopyFile_atr.sizelo; |
CopyFile_f.param4 = cBufer; |
CopyFile_f.rezerv = 0; |
CopyFile_f.name = d; |
$mov eax, 70 |
$mov ebx, #CopyFile_f |
$int 0x40 |
} |
} |
return EAX; |
} |
/programs/fs/Eolite/trunk/lib/kolibri.h |
---|
0,0 → 1,442 |
//CODED by Veliant, Leency 2008-2012. GNU GPL licence. |
#startaddress 0 |
#code32 TRUE |
byte os_name[8] = {'M','E','N','U','E','T','0','1'}; |
dword os_version = 0x00000001; |
dword start_addr = #main; |
dword final_addr = #stop+32; |
dword alloc_mem = 0x00070000; |
dword x86esp_reg = 0x00070000; // 0x0007fff0; |
dword I_Param = #param; |
dword I_Path = #program_path; |
char param[4096]; |
char program_path[4096]; |
//Events |
#define evMouse 6 |
#define evButton 3 |
#define evKey 2 |
#define evReDraw 1 |
//Button options |
#define BT_DEL 0x80000000 |
#define BT_HIDE 0x40000000 |
#define BT_NOFRAME 0x20000000 |
#define OLD -1 |
#define true 1 |
#define false 0 |
struct mouse{ |
unsigned int x,y,lkm,pkm,hor,vert; |
void get(); |
}; |
inline fastcall int TestBit(EAX, CL) |
{ |
$shr eax,cl |
$and eax,1 |
} |
void mouse::get() |
{ |
EAX = 37; |
EBX = 1; |
$int 0x40 |
$mov ebx, eax |
$shr eax, 16 |
$and ebx,0x0000FFFF |
x = EAX; |
y = EBX; |
EAX = 37; |
EBX = 2; |
$int 0x40 |
$mov ebx, eax |
$and eax, 0x00000001 |
$shr ebx, 1 |
$and ebx, 0x00000001 |
lkm = EAX; |
pkm = EBX; |
EAX = 37; //scroll |
EBX = 7; |
$int 0x40 |
$mov ebx, eax |
$shr eax, 16 |
$and ebx,0x0000FFFF |
//hor = EAX; |
vert = EBX; |
} |
//--------------------------------------------------------------------------- |
struct proc_info{ |
dword use_cpu; |
word pos_in_stack,num_slot,rezerv1; |
char name[11]; |
char rezerv2; |
dword adress,use_memory,ID,left,top,width,height; |
word status_slot,rezerv3; |
dword work_left,work_top,work_width,work_height; |
char status_window; |
void GetInfo(dword ECX); |
byte reserved[1024-71]; |
#define SelfInfo -1 |
}; |
void proc_info::GetInfo(dword EBX, ECX) |
{ |
EAX = 9; |
$int 0x40 |
} |
inline fastcall int GetSlot(dword ECX) |
{ |
EAX = 18; |
EBX = 21; |
$int 0x40 |
} |
inline fastcall int ActiveProcess() |
{ |
EAX = 18; |
EBX = 7; |
$int 0x40 |
} |
//------------------------------------------------------------------------------- |
inline fastcall dword WaitEvent(){ |
EAX = 10; // wait here for event |
$int 0x40 |
} |
inline fastcall void SetEventMask(dword EBX) |
{ |
EAX = 40; |
$int 0x40 |
} |
inline fastcall word GetKey(){ //Gluk fix |
$push edx |
@getkey: |
$mov eax,2 |
$int 0x40 |
$cmp eax,1 |
$jne getkeyi |
$mov ah,dh |
$jmp getkeyii //jz? |
@getkeyi: |
$mov dh,ah |
$jmp getkey |
@getkeyii: |
$pop edx |
EAX = EAX >> 8; |
} |
inline fastcall word GetButtonID(){ |
EAX = 17; // Get ID |
$int 0x40 |
EAX = EAX >> 8; |
} |
inline fastcall void ExitProcess(){ |
EAX = -1; // close this program |
$int 0x40 |
} |
inline fastcall void Pause(dword EBX){ |
$mov eax, 5 // 㧠, ¢ á®âëå ¤®«ïå ᥪã¤ë |
$int 0x40 |
} |
//------------------------------------------------------------------------------ |
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType, |
dword mainAreaColour,byte headerType,dword headerColour,EDI) |
{ |
EAX = 12; // function 12:tell os about windowdraw |
EBX = 1; |
$int 0x40 |
EBX = x << 16 + sizeX; |
ECX = y << 16 + sizeY; |
EDX = mainAreaType << 24 | mainAreaColour; |
ESI = headerType << 24 | headerColour; |
$xor eax,eax |
$int 0x40 |
EAX = 12; // function 12:tell os about windowdraw |
EBX = 2; |
$int 0x40 |
} |
inline fastcall void CreateThread(dword ECX,EDX) |
{ |
EAX = 51; |
EBX = 1; |
$int 0x40 |
} |
inline fastcall void DrawTitle(dword ECX){ |
EAX = 71; |
EBX = 1; |
$int 0x40; |
} |
inline fastcall dword GetSkinWidth(){ |
EAX = 48; |
EBX = 4; |
$int 0x40 |
} |
inline fastcall void MoveSize(dword EBX,ECX,EDX,ESI){ |
EAX = 67; |
$int 0x40 |
} |
//------------------------------------------------------------------------------ |
inline fastcall dword strlen(EDI){ |
asm { |
xor ecx, ecx |
xor eax, eax |
dec ecx |
repne scasb |
sub eax, 2 |
sub eax, ecx |
} |
} |
inline fastcall copystr(dword ESI,EDI) |
{ |
$cld |
l1: |
$lodsb |
$stosb |
$test al,al |
$jnz l1 |
} |
char buffer[11]; |
inline fastcall dword IntToStr(dword ESI) |
{ |
$mov edi, #buffer |
$mov ecx, 10 |
$test esi, esi |
$jns f1 |
$mov al, '-' |
$stosb |
$neg esi |
f1: |
$mov eax, esi |
$push -'0' |
f2: |
$xor edx, edx |
$div ecx |
$push edx |
$test eax, eax |
$jnz f2 |
f3: |
$pop eax |
$add al, '0' |
$stosb |
$jnz f3 |
$mov eax, #buffer |
$ret |
} |
inline fastcall dword StrToInt() |
{ |
ESI=EDI=EAX; |
IF(DSBYTE[ESI]=='-')ESI++; |
EAX=0; |
BH=AL; |
do{ |
BL=DSBYTE[ESI]-'0'; |
EAX=EAX*10+EBX; |
ESI++; |
}while(DSBYTE[ESI]>0); |
IF(DSBYTE[EDI]=='-') -EAX; |
} |
dword StrToCol(char* htmlcolor) |
{ |
dword j, color=0; |
char ch=0x00; |
FOR (j=0; j<6; 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; |
} |
return color; |
} |
inline fastcall int strcmp(ESI, EDI) |
{ |
loop() |
{ |
IF (DSBYTE[ESI]<DSBYTE[EDI]) RETURN -1; |
IF (DSBYTE[ESI]>DSBYTE[EDI]) RETURN 1; |
IF (DSBYTE[ESI]=='\0') RETURN 0; |
ESI++; |
EDI++; |
} |
} |
inline fastcall unsigned int find_symbol(ESI,BL) |
{ |
int jj=0, last=-1; |
do{ |
jj++; |
$lodsb |
IF(AL==BL) last=jj; |
} while(AL!=0); |
return last; |
} |
inline fastcall ChangeCase(dword EDX) |
{ |
AL=DSBYTE[EDX]; |
IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f; |
IF (AL>=160) && (AL<=175) DSBYTE[EDX] = AL - 32; //à-ï |
IF (AL>=224) && (AL<=239) DSBYTE[EDX] = AL - 80; //à-ï |
do{ |
EDX++; |
AL=DSBYTE[EDX]; |
IF(AL>='A')&&(AL<='Z'){DSBYTE[EDX]=AL|0x20; CONTINUE;} |
IF(AL>='')&&(AL<='')DSBYTE[EDX]=AL|0x20; // -¯ |
IF (AL>=144) && (AL<=159) DSBYTE[EDX] = AL + 80; //à-ï |
}while(AL!=0); |
} |
//------------------------------------------------------------------------------ |
inline fastcall void PutPixel(dword EBX,ECX,EDX){ |
EAX=1; |
$int 0x40 |
} |
void DefineButton(dword x,y,w,h,EDX,ESI) |
{ |
EAX = 8; |
$push edx |
EDX += BT_DEL; //âíà÷àëå óäàëÿåì êíîïó ñ ýòè èä, ïîòîì ñîçäà¸ì |
$int 0x40; |
EBX = x<<16+w; |
ECX = y<<16+h; |
$pop edx |
$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+y; |
ECX = fontType<<24+color; |
$int 0x40; |
} |
void DrawBar(dword x,y,w,h,EDX) |
{ |
#speed |
EAX = 13; |
EBX = x<<16+w; |
ECX = y<<16+h; |
$int 0x40 |
#codesize |
} |
void DrawRegion_3D(dword x,y,width,height,color1,color2) |
{ |
DrawBar(x,y,width+1,1,color1); //¯®«®á £®à ᢥàåã |
DrawBar(x,y+1,1,height-1,color1); //¯®«®á á«¥¢ |
DrawBar(x+width,y+1,1,height,color2); //¯®«®á á¯à ¢ |
DrawBar(x,y+height,width,1,color2); //¯®«®á £®à ᨧã |
} |
void DrawFlatButton(dword x,y,width,height,id,color,text) |
{ |
DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE); |
DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7); |
DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª |
IF (id<>0) DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF); //ª®¯ª |
WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0); |
} |
void PutPaletteImage(dword EBX,w,h,x,y, EDI) |
{ |
EAX = 65; |
ECX = w<<16+h; |
EDX = x<<16+y; |
ESI = 8; |
EBP = 0; |
$int 0x40 |
} |
void PutImage(dword EBX,w,h,x,y) |
{ |
EAX = 7; |
ECX = w<<16+h; |
EDX = x<<16+y; |
$int 0x40 |
} |
//------------------------------------------------------------------------------ |
inline fastcall void WriteDebug(dword EDX) |
{ |
$mov eax, 63 |
$mov ebx, 1 |
next_char: |
$mov ecx, DSDWORD[edx] |
$or cl, cl |
$jz done |
$int 0x40 |
$inc edx |
$jmp next_char |
done: |
$mov cl, 13 |
$int 0x40 |
$mov cl, 10 |
$int 0x40 |
} |
inline fastcall void WriteFullDebug(dword ESI) |
{ |
WriteDebug(""); |
WriteDebug(ESI); |
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)); |
Pause(200); |
} |
/programs/fs/Eolite/trunk/lib/memory.h |
---|
0,0 → 1,67 |
#code32 TRUE |
inline fastcall dword malloc(dword ECX){ |
dword size, heap; |
#speed |
size = ECX; |
EAX = 68; |
EBX = 11; |
$int 0x40; |
heap = EAX; |
IF (size<=heap) |
{ |
EAX = 68; |
EBX = 12; |
ECX = size; |
$int 0x40; |
} |
ELSE EAX=-1; |
#codesize |
} |
inline fastcall dword free(dword ECX){ |
#speed |
EAX = 68; |
EBX = 13; |
$int 0x40; |
#codesize |
} |
inline fastcall dword realloc(dword ECX, EDX){ |
#speed |
EAX = 68; |
EBX = 20; |
$int 0x40; |
#codesize |
} |
inline fastcall memmov( EDI, ESI, ECX) |
{ |
asm { |
MOV EAX, ECX |
CMP EDI, ESI |
JG L1 |
JE L2 |
SAR ECX, 2 |
JS L2 |
REP MOVSD |
MOV ECX, EAX |
AND ECX, 3 |
REP MOVSB |
JMP SHORT L2 |
L1: LEA ESI, DSDWORD[ ESI+ECX-4] |
LEA EDI, DSDWORD[ EDI+ECX-4] |
SAR ECX, 2 |
JS L2 |
STD |
REP MOVSD |
MOV ECX, EAX |
AND ECX, 3 |
ADD ESI, 3 |
ADD EDI, 3 |
REP MOVSB |
CLD |
L2: |
} |
} |