Eolite 0.97

git-svn-id: svn://kolibrios.org@935 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2008-11-24 00:49:58 +00:00
parent f703792c6e
commit e80aaced2b
6 changed files with 379 additions and 385 deletions

View File

@ -5,14 +5,13 @@
#include "lib\memory.h--" #include "lib\memory.h--"
#include "lib\edit_box_lib.h--" #include "lib\edit_box_lib.h--"
#include "include\run_file.h--" #include "include\run_file.h--"
#include "include\icons_f.h--" #include "imgs\toolbar.txt"
#include "imgs\toolbar_new.cpp"
#include "imgs\left_p.cpp" #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; //öâåò âûäåëåííîãî ýëåìåíòà èç ñïèñêà ôàéëîâ #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; dword but_num=0, kolichestvo=0, curbtn=0, za_kadrom=0;
byte cut_active, rename_active, del_active; byte cut_active, rename_active, del_active;
@ -23,48 +22,39 @@ byte file_path[256], file_name[256]; //
byte copyfile[256],copy_name[256]; //êîïèðîâàíèå byte copyfile[256],copy_name[256]; //êîïèðîâàíèå
dword i; //äëÿ öèêëîâ dword i; //äëÿ öèêëîâ
dword file_mas[6898]; //ñïèñîê ôàéëîâ dword file_mas[6898]; //ñïèñîê ôàéëîâ
dword temp_int; int temp_int, j;
dword stak[100]=0; //îêíî About dword stak[100]=0; //îêíî About
edit_box edit1= {250,252,17,0xffffff,0x94AECE,0xD3DDEB,0xffffff,0,248,#edit_path,64,6,6}; 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}; edit_box edit2= {250,218,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,64,6,6};
proc_info Form; proc_info Form;
f70 open_dir_70;
struct {
int func;
int pos;
int rezerv;
int sizefile;
int buffer;
char rezerv2;
int stroka;
}open_file_70;
dword buf=0, off; //äëÿ òåêñòà è áóôåðà dword buf=0, off; //äëÿ òåêñòà è áóôåðà
dword devbuf=0, dev_num; dword devbuf=0, dev_num;
#include "include\LVabout.c--" #include "include\LVabout.c--"
#include "include\icons_f.h--"
void main() void main()
byte pressed, key, id; byte pressed, key, id;
mouse m; mouse m;
{ {
devbuf= malloc(3112); //áóôåð ãäå-òî íà 10 äåâàéñîâ â ëåâîé ïàíåëè devbuf= malloc(3112); //áóôåð ãäå-òî íà 10 äåâàéñîâ â ëåâîé ïàíåëè
open_file_70.func = 1; open_dir_70.func = 1;
open_file_70.pos = 0; open_dir_70.param1 = 0;
open_file_70.rezerv = 0; open_dir_70.param2 = 0;
open_file_70.sizefile = 10; open_dir_70.param3 = 10;
open_file_70.buffer = devbuf; open_dir_70.param4 = devbuf;
open_file_70.rezerv2 = 0; open_dir_70.rezerv = 0;
open_file_70.stroka = "/"; open_dir_70.name = "/";
$mov eax,70 $mov eax,70
$mov ebx,#open_file_70.func $mov ebx,#open_dir_70.func
$int 0x40 $int 0x40
dev_num=EBX; dev_num=EBX;
load_dll(); //ïîäãðóæàåò ëèáó ñ åäèò_áîêñîì load_dll(); //ïîäãðóæàåò ëèáó ñ åäèò_áîêñîì
IF (param[0]<>'') {copystr(#param,#edit_path); Goto_edit_path();} IF (param[0]<>'') {copystr(#param,#edit_path); Goto_edit_path();}
Open_Dir(#path,2); Open_Dir(#path,2);
SetEventMask(); //SetEventMask(100111b);
loop() loop()
{ {
switch(WaitEvent()) switch(WaitEvent())
@ -95,7 +85,7 @@ mouse m;
case evButton: case evButton:
IF (edit1.flags<>64) {edit1.flags=64; edit_box_draw stdcall(#edit1);} //ñáðàñûâàåì âûäåëåíèå ïðè íàæàòèè íà áàòîí IF (edit1.flags<>64) {edit1.flags=64; edit_box_draw stdcall(#edit1);} //ñáðàñûâàåì âûäåëåíèå ïðè íàæàòèè íà áàòîí
id=GetButtonID(); 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;} IF (del_active==1) {IF (id==301) || (id==302) Del_File(302-id); break;}
switch(id) switch(id)
{ {
@ -170,7 +160,8 @@ mouse m;
IF (key==027) Del_File(false); IF (key==027) Del_File(false);
break; 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) switch (key)
{ {
case 209...217: id=key-109; IF(dev_num>id-100)GOTO DEVICE_MARK; break; 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); edit_box_draw stdcall (#edit2);
DrawBar(218,curbtn*18+58,edit2.width+1,1,0xFFFFCC); //ïîëîñà æåëòàÿ ñâåðõó äëÿ îäèíàêîâîñòè DrawBar(218,curbtn*18+58,edit2.width+1,1,0xFFFFCC); //ïîëîñà æåëòàÿ ñâåðõó äëÿ îäèíàêîâîñòè
rename_active=1; rename_active=1;
BREAK; break;
case 052: //Íàæàòà F3 case 052: //Íàæàòà F3
IF (isdir==false) Run_Program("/sys/tinypad", #file_path); BREAK; IF (isdir==false) Run_Program("/sys/tinypad", #file_path); break;
case 054: Open_Dir(#path,1); BREAK; //ïåðåðèñîâàòü îêíî F5 case 054: Open_Dir(#path,1); break; //ïåðåðèñîâàòü îêíî F5
case 182: Del_Form(); BREAK; //delete file case 182: Del_Form(); break; //delete file
default: EDIT_KEY_MARK: default:
EAX=key <<8; IF (strcmp("..",buf+72+304)<>0) temp_int=0; ELSE temp_int=1;
IF (rename_active==0) edit_box_key stdcall (#edit1); ELSE edit_box_key stdcall (#edit2); for (i=curbtn+za_kadrom+1; i<kolichestvo; i++)
{
copystr(file_mas[i+temp_int]*304+buf+72,#temp);
AL=DSBYTE[#temp];
IF(AL>='A')&&(AL<='Z')DSBYTE[#temp]=AL|0x20;
IF (temp[0]==key) {FileList_ReDraw(i-curbtn-za_kadrom); break;}
}
} }
break; break;
case evReDraw: draw_window(); BREAK; case evReDraw: draw_window(); BREAK;
@ -247,13 +244,13 @@ inline fastcall void draw_window()
{ {
WindowRedrawStatus(1); WindowRedrawStatus(1);
skin_width = GetSkinWidth(); 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(); Form.getme();
IF (Form.height==skin_width+3) {WindowRedrawStatus(2); return;} //ýòî çà÷¸ò! IF (Form.height==skin_width+3) {WindowRedrawStatus(2); 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
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); 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); //ôîí íàä ïîëîñîé àäðåñà 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),40,16,16,50,0xE4DFE1,"\x18"); //ïðîêðóòêà ââåðõ
DrawFlatButton(onLeft(22,0),onTop(22,0),16,16,51,0xE4DFE1,"\x19");//ïðîêðóòêà âíèç 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); //ëèíèÿ ñëåâà îò ïðîêðóòêè DrawBar(onLeft(22,0),57,1,onTop(22,57),0x94AECE); //ëèíèÿ ñëåâà îò ïðîêðóòêè
but_num=onTop(6,57)/18; but_num=onTop(6,57)/18;
IF (but_num>100) but_num=1; ELSE IF (kolichestvo<but_num) but_num=kolichestvo; IF (but_num>100) but_num=1; ELSE IF (kolichestvo<but_num) but_num=kolichestvo;
FOR (j=0;j<but_num;j++) DefineButton(197,j+1*18+39,onLeft(22,197),18,201+j+BT_HIDE+BT_NOFRAME,0xFFFFFF); //íîâûå êíîïêè FOR (j=0;j<but_num;j++) DefineButton(197,j*18+57,onLeft(22,197),18,201+j+BT_HIDE+BT_NOFRAME,0xFFFFFF); //íîâûå êíîïêè
List_ReDraw(); List_ReDraw();
IF (del_active==1) Del_Form(); IF (del_active==1) Del_Form();
WindowRedrawStatus(2); WindowRedrawStatus(2);
@ -354,21 +354,34 @@ void List_ReDraw()
ELSE IF (curbtn>but_num-1) curbtn=but_num-1; //ýòî åñëè âûäåëåíèå ïîñëå ñõëîïûâàíèÿ îêíà çà êàäðîì ELSE IF (curbtn>but_num-1) 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-1*18+75; temp_int=but_num*18+57;
DrawBar(197,temp_int,onLeft(22,197),onTop(temp_int,6),0xFFFFFF); //çàëèâêà áåëûì äîêîíöà 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(163,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 1
DrawBar(onLeft(90,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2 DrawBar(onLeft(90,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2
TVScroll(); 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){ void Line_ReDraw(dword color, filenum){
dword y, size; dword y=filenum*18+57; //ïîëîæåíèå òåêñòà ïî Y;
if (rename_active==1) if (rename_active==1)
{ {
rename_active=0; rename_active=0;
edit2.flags=64; 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 IF (filenum==100) filenum=curbtn; ELSE
{ {
copystr(#path,#temp); copystr(#path,#temp);
@ -377,48 +390,46 @@ void Line_ReDraw(dword color, filenum){
{ CopyFile(#file_path,#temp); Del_File(true); } { 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; 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)<temp_int) temp_int = strlen(off); //äëèííà íàçâàíèÿ ôàéëà
WriteText(220,y-22,0,0,off,temp_int); //èìÿ ôàéëà
size=ESDWORD[off-8];
EAX=ESDWORD[off-40]; EAX=ESDWORD[off-40];
$shr eax,4 $shr eax,4
$and eax,1 $and eax,1
IF (color==videlenie) isdir=EAX; //íàäî îáüåäèíèòü ñ òåì øî ñíèçó IF (color==videlenie) isdir=EAX; //íàäî îáüåäèíèòü ñ òåì øî ñíèçó
IF (!EAX) if (!EAX)
{ {
temp_int = Put_icon(off+strlen(off)-4, y); temp_int = Put_icon(off+strlen(off)-4, y+2);
WriteText(7-strlen(ConvertSize(size))*6+onLeft(75,0),y-22,0x80,0,ConvertSize(size),0); 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); ELSE temp_int=Put_icon("<DIR>", y); } ELSE IF (strcmp("..",off)==0) temp_int=Put_icon("..", y+2); ELSE temp_int=Put_icon("<DIR>", y+2);
IF (color==videlenie) IF (color==videlenie)
{ {
IconFairing(temp_int, y, videlenie); //çàêðàøèâàåì èêîíêó IconFairing(temp_int, y+2, videlenie); //çàêðàøèâàåì èêîíêó
copystr(#path,#file_path); copystr(#path,#file_path);
copystr(off,#file_name); copystr(off,#file_name);
copystr(off,#file_path+strlen(#file_path)); //èòàê, file_path=ôàéëó, ò.ê. ïî-óìîë÷àíèþ ýòî ïðîãà copystr(off,#file_path+strlen(#file_path)); //èòàê, file_path=ôàéëó, ò.ê. ïî-óìîë÷àíèþ ýòî ïðîãà
} }
DrawBar(onLeft(163,0),filenum*18+57,1,18,0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 1 temp_int = onLeft(220,160)/6;
DrawBar(onLeft(90,0),filenum*18+57,1,18,0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2 IF (strlen(off)<temp_int) temp_int = strlen(off); //äëèííà íàçâàíèÿ ôàéëà
WriteText(220,y+6,0,0,off,temp_int); //èìÿ ôàéëà
DrawBar(onLeft(163,0),y,1,18,0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 1
DrawBar(onLeft(90,0),y,1,18,0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2
//Preview(); //Preview();
} }
void Open_Dir(dword path_,redraw){ void Open_Dir(dword path_,redraw){
IF (buf) free(buf); IF (buf) free(buf);
//open_file_70.func = 1; //à íàôèãà, îíè ñâåðõó åñòü... open_dir_70.param3 = 6898; //filenum
//open_file_70.pos = 0;
//open_file_70.rezerv = 0;
open_file_70.sizefile = 6898;
buf = malloc(2097152); buf = malloc(2097152);
open_file_70.buffer = buf; open_dir_70.param4 = buf;
//open_file_70.rezerv2 = 0; open_dir_70.name = path_;
open_file_70.stroka = path_;
$mov eax,70 $mov eax,70
$mov ebx,#open_file_70.func $mov ebx,#open_dir_70.func
$int 0x40 $int 0x40
kolichestvo=EBX; kolichestvo=EBX;
// //
@ -448,13 +459,13 @@ void FoldesGoUp()
dword k=0, l=0; off=buf+72; dword k=0, l=0; off=buf+72;
IF (strcmp(#path,"/rd/1/")==0) || (strcmp(#path,"/fd/1/")==0) kolichestvo--; IF (strcmp(#path,"/rd/1/")==0) || (strcmp(#path,"/fd/1/")==0) kolichestvo--;
IF (strcmp(".",buf+72)<>0) && (strlen(#path)>6) kolichestvo--; //ôàê! ýòî áðåä! õç êàê îíî ðàáîòàåò IF (strcmp(".",buf+72)<>0) && (strlen(#path)>6) kolichestvo--; //ôàê! ýòî áðåä! õç êàê îíî ðàáîòàåò
FOR (i=0;i<=kolichestvo;i++) //à ïàïêè âñ¸ âûøå è âûøå... FOR (j=0;j<=kolichestvo;j++) //à ïàïêè ââåðõ, ôàéëû âíèç
{ {
EAX=ESDWORD[off-40]; EAX=ESDWORD[off-40];
$shr eax,4 $shr eax,4
$and eax,1 $and eax,1
IF (EAX) {file_mas[k]=i; k++;} IF (EAX) {file_mas[k]=j; k++;}
ELSE {file_mas[kolichestvo-l]=i; l++;} ELSE {file_mas[kolichestvo-l]=j; l++;}
off += 304; off += 304;
} }
//k=0; l=kolichestvo; //k=0; l=kolichestvo;
@ -507,18 +518,19 @@ void Del_Form()
del_active=1; del_active=1;
} }
f70 del_file_70;
void Del_File(byte dodel) void Del_File(byte dodel)
{ {
IF (dodel==true){ IF (dodel==true){
run_file_70.func = 8; del_file_70.func = 8;
run_file_70.flag = 0; del_file_70.param1 = 0;
run_file_70.param= 0; del_file_70.param2 = 0;
run_file_70.rez1 = 0; del_file_70.param3 = 0;
run_file_70.rez2 = 0; del_file_70.param4 = 0;
run_file_70.rezerv2 = 0; del_file_70.rezerv = 0;
run_file_70.stroka = #file_path; del_file_70.name = #file_path;
$mov eax,70 $mov eax,70
$mov ebx,#run_file_70.func $mov ebx,#del_file_70.func
$int 0x40} $int 0x40}
del_active=0; del_active=0;
DeleteButton(301); DeleteButton(302); //óäàëÿåì êíîïî÷êè Yes/No DeleteButton(301); DeleteButton(302); //óäàëÿåì êíîïî÷êè Yes/No
@ -588,6 +600,7 @@ void Devices()
Preview(); Preview();
} }
void Actions() void Actions()
{ {
DrawBar(22,dev_num*16+75,160,15,0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè 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 (i<kolichestvo-but_num) {IF (strcmp(".",buf+72)<>0) 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() void Dir_Up()
{ {
byte temp_[256]; byte temp_[256];
@ -668,7 +654,7 @@ void Dir_Up()
void Preview() void Preview()
{ {
dword top_pr=dev_num*16+123; dword top_pr=dev_num*16+123;
top_pr+=show_actions*51; //íè÷èíàåì íèæå, åñëè Àêøíñ âèäèìû top_pr+=show_actions*51; //íà÷èíàåì íèæå, åñëè Ýêøíñ âèäèìû
DeleteButton(78); DeleteButton(78);
if (show_preview==1) 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+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+70,0x80,0,#file_path,0);
//WriteText(30,top_pr+80,0x80,0,#file_name,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+60,0x80,0,"Not realized... I think",0);
//WriteText(30,top_pr+70,0x80,0,"Nable, I'm waiting (:",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); //ñèíåå DrawBar(22,top_pr+118,160,onTop(top_pr+118,6),0x00699C); //ñèíåå
} }
ELSE { ELSE {

View File

@ -1,34 +1,4 @@
#include "imgs\logo.cpp" #include "imgs\logo.txt"
/*void authors()
{
_HH:
WindowRedrawStatus(1);
DefineAndDrawWindow(500,200,181,256,0x04,0x10EFEBEF,0,0,"About Eolite");
//DrawTitle("About Eolite");
DrawBar(5,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
PutImage(#logo,85,85,48,7);
WriteText(32,100,0x80,0xBF40BF,"Eolite v0.96.4 beta7",0);
WriteText(68,120,0x80,0,"Authors:",0);
WriteText(44,130,0x80,0,"Leency & Veliant",0);
WriteText(50,140,0x80,0,"KolibriOS Team",0);
WriteText(26,160,0x80,0,"Made using C-- in 2008",0);
WriteText(23,170,0x80,0,"Visit www.kolibrios.org",0);
DrawFlatButton(90,190,70,22,2,0x00D7D7D7, "Close");
WindowRedrawStatus(2);
loop()
{
SWITCH(WaitEvent())
{
CASE evButton: ExitProcess();
CASE evKey: IF (GetKey()==27) ExitProcess(); break;
CASE evReDraw: GOTO _HH;
BREAK;
}
}
ExitProcess();
}*/
void authors() void authors()
{ {
@ -41,20 +11,19 @@ void authors()
CASE evReDraw: CASE evReDraw:
WindowRedrawStatus(1); WindowRedrawStatus(1);
DefineAndDrawWindow(500,200,181,256,0x04,0x10EFEBEF,0,0,"About Eolite"); DefineAndDrawWindow(500,200,181,256,0x04,0x10EFEBEF,0,0,"About Eolite");
//DrawTitle("About Eolite");
DrawBar(5,0,172,50,0x8494C4); //ãîëóáîå ñçàäè DrawBar(5,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
PutImage(#logo,85,85,48,7); //PutImage(#logo,85,85,48,7);
WriteText(32,100,0x80,0xBF40BF,"Eolite v0.96.7 beta7",0); 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(68,120,0x80,0,"Authors:",0);
WriteText(44,130,0x80,0,"Leency & Veliant",0); WriteText(44,130,0x80,0,"Leency & Veliant",0);
WriteText(50,140,0x80,0,"KolibriOS Team",0); WriteText(50,140,0x80,0,"KolibriOS Team",0);
WriteText(26,160,0x80,0,"Made using C-- in 2008",0); WriteText(26,160,0x80,0,"Made using C-- in 2008",0);
WriteText(23,170,0x80,0,"Visit www.kolibrios.org",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); WindowRedrawStatus(2);
} }
} }
//ExitProcess();
} }
@ -127,3 +96,5 @@ void Sort_by_Type(dword a, b) //
Sort_by_Type(a, c-1); Sort_by_Type(a, c-1);
Sort_by_Type(c+1, b); Sort_by_Type(c+1, b);
} }

View File

@ -2,67 +2,110 @@ void IconFairing(dword filenum, y, videlenie)
{ {
if (filenum<5) //ôàéëèê if (filenum<5) //ôàéëèê
{ {
DrawBar(200,y-26,2,15,videlenie); DrawBar(200,y,2,15,videlenie);
DrawBar(214,y-26,2,15,videlenie); DrawBar(214,y,2,15,videlenie);
DrawBar(210,y-26,4,1,videlenie);//ëå DrawBar(210,y,4,1,videlenie);//ëå
DrawBar(211,y-25,3,1,videlenie);//ñåí DrawBar(211,y+1,3,1,videlenie);//ñåí
DrawBar(212,y-24,2,1,videlenie);//êà DrawBar(212,y+2,2,1,videlenie);//êà
DrawBar(213,y-23,1,1,videlenie);// DrawBar(213,y+3,1,1,videlenie);//
} }
if (filenum==16) || (filenum==17) //ïàïêà if (filenum==16) || (filenum==17) //ïàïêà
{ {
DrawBar(201,y-13,15,2,videlenie); //ñíèçó ëèíèÿ DrawBar(200,y,1,15,videlenie); //ñëåâà ëèíèÿ
DrawBar(200,y-26,1,15,videlenie); //ñëåâà ëèíèÿ DrawBar(208,y,8,2,videlenie); //ñâåðõó ñïðàâà ëèíèÿ
DrawBar(208,y-26,8,2,videlenie); //ñâåðõó ñïðàâà ëèíèÿ IF (filenum==17) DrawBar(211,y+1,1,1,0x1A7B17); //çåë¸íàÿ òî÷êà ñòðåëêè
IF (filenum==17) DrawBar(211,y-25,1,1,0x1A7B17); //çåë¸íàÿ òî÷êà ñòðåëêè DrawBar(201,y+13,15,2,videlenie); //ñíèçó ëèíèÿ
//.òî÷êè //.òî÷êè
PutPixel(201,y-26+skin_width,videlenie); //ñâåðõó ñëåâà òî÷êà PutPixel(201,y,videlenie); //ñâåðõó ñëåâà òî÷êà
PutPixel(207,y-26+skin_width,videlenie); //ñâåðõó ñïðàâà òî÷êà PutPixel(207,y,videlenie); //ñâåðõó ñïðàâà òî÷êà
PutPixel(201,y-14+skin_width,videlenie); //ñëåâà ñíèçó òî÷êà PutPixel(215,y+2,videlenie); //êàêàÿ ðàçíèöà ãäå
PutPixel(215,y-14+skin_width,videlenie); //ñïðàâà ñíèçó òî÷êà PutPixel(201,y+12,videlenie); //ñëåâà ñíèçó òî÷êà
PutPixel(215,y-24+skin_width,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 Put_icon(dword extension, yy)
{ {
dword ftype="", fnum=0; //åøè íåèçâåñíûé ôàéë dword ftype="", fnum=0; //åøè íåèçâåñíûé ôàéë
IF (strcmp(extension,".kex")==0) {fnum = 6; ftype="Program";} IF (!strcmp(extension,".kex")) {fnum = 6; ftype="Program";}
IF (strcmp(extension,".cvs")==0) {fnum = 18; ftype="Graph";} IF (!strcmp(extension,".cvs")) {fnum = 18; ftype="Graph";}
IF (strcmp(extension,".cmd")==0) {fnum = 5; ftype="CMD skript";} IF (!strcmp(extension,".cmd")) || (!strcmp(extension,".bat")) {fnum = 5; ftype="CMD skript";}
IF (strcmp(extension,".skn")==0) {fnum = 13; ftype="Skin";} IF (!strcmp(extension,".skn")) {fnum = 13; ftype="Skin";}
IF (strcmp(extension,".chr")==0) {fnum = 10; ftype="Font";} IF (!strcmp(extension,".chr"))|| (!strcmp(extension+1,".mt")) || (!strcmp(extension,".ttf")) || (!strcmp(extension,".fon")) {fnum = 10; ftype="Font";}
IF (strcmp(extension,".avi")==0) {fnum = 14; ftype="Video";} IF (!strcmp(extension,".asm")) {fnum = 11; ftype="Source";}
IF (strcmp(extension,".asm")==0) {fnum = 11; ftype="Source";} IF (!strcmp(extension,".inc")) fnum = 9;
IF (strcmp(extension,".inc")==0) fnum = 9; IF (!strcmp(extension,".exe")) || (!strcmp(extension,".msi")) {fnum = 7; ftype="Win32 Exec";}
IF (strcmp(extension,".exe")==0) {fnum = 7; ftype="Win32 Exec";} IF (!strcmp(extension,".com")) fnum = 5;
IF (strcmp(extension,".dll")==0) || (strcmp(extension,".obj")==0) {fnum = 8; ftype="Library";} IF (!strcmp(extension,".cpp")) {fnum = 3; ftype="C++ code";}
IF (strcmp(extension,".ini")==0) || (strcmp(extension,"conf")==0) {fnum = 8; ftype="Config";} IF (!strcmp(extension,".nes")) {fnum = 20; ftype="Cartridge";}
IF (strcmp(extension,".htm")==0) || (strcmp(extension,"html")==0) {fnum = 2; ftype="Web-page";} 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 //text
IF (strcmp(extension,".txt")==0) {fnum = 1; ftype="Text";} IF (!strcmp(extension,".txt")) || (!strcmp(extension,".doc")) ||
IF (strcmp(extension,".doc")==0) {fnum = 1; ftype="Text";} (!strcmp(extension,".rtf")) {fnum = 1; ftype="Text";}
IF (strcmp(extension,".rtf")==0) {fnum = 1; ftype="Text";}
//èçîáðàæåíèÿ //èçîáðàæåíèÿ
IF (strcmp(extension,".gif")==0) || (strcmp(extension,".bmp")==0) || IF (!strcmp(extension,".gif")) || (!strcmp(extension,".bmp")) ||
(strcmp(extension,".tga")==0) || (strcmp(extension,".pcx")==0) || (!strcmp(extension,".tga")) || (!strcmp(extension,".pcx")) ||
(strcmp(extension,".png")==0) || (strcmp(extension,".jpg")==0) || (!strcmp(extension,".png")) || (!strcmp(extension,".jpg")) ||
(strcmp(extension,"jpeg")==0) || (strcmp(extension,".raw")==0) {fnum = 3; ftype="Image";} (!strcmp(extension,"jpeg")) || (!strcmp(extension,".raw")) {fnum = 19; ftype="Image";}
//àðõèâû //àðõèâû
IF (strcmp(extension,".rar")==0) || (strcmp(extension,".zip")==0) || IF (!strcmp(extension,".rar")) || (!strcmp(extension,".zip")) ||
(strcmp(extension,".cab")==0) || (strcmp(extension,".tar")==0) || (!strcmp(extension,".cab")) || (!strcmp(extension,".tar")) ||
(strcmp(extension,".ajr")==0) {fnum = 15; ftype="Archive";} (!strcmp(extension,".ajr")) || (!strcmp(extension,".jar")) ||
(!strcmp(extension+1,".7z")){fnum = 15; ftype="Archive";}
//audio //audio
IF (strcmp(extension,".mp3")==0) {fnum = 12; ftype="Music";} IF (!strcmp(extension,".mp3")) {fnum = 12; ftype="Music";}
IF (strcmp(extension,".wav")==0) || (strcmp(extension,".mid")==0) || IF (!strcmp(extension,".wav")) || (strcmp(extension,".mid")==0) ||
(strcmp(extension,"midi")==0) || (strcmp(extension,".ogg")==0) {fnum = 12; ftype="Audio";} (!strcmp(extension,"midi")) || (strcmp(extension,".ogg")==0) {fnum = 12; ftype="Audio";}
//ïàïêà //video
IF (strcmp(extension,"<DIR>")==0) || (strcmp(extension," ")==0) IF (!strcmp(extension,".avi")) || (!strcmp(extension,".flv")) || (!strcmp(extension,".mpg")) ||
{ fnum=21-strlen(extension); WriteText(onLeft(140,0),yy-22,0x80,0,extension,0);} (!strcmp(extension,".wmv")) {fnum = 14; ftype="Video";}
//ïàïêè
IF (!strcmp(extension,"<DIR>")) { 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); PutPaletteImage(fnum*16*15+#ficons,16,15,200,yy,#ficons_pal);
WriteText(onLeft(155,0),yy-22,0x80,0,ftype,0); WriteText(onLeft(155,0),yy+4,0x80,0,ftype,0);
return fnum; return fnum;
} }

View File

@ -1,15 +1,4 @@
#include "imgs\icons.cpp" f70 run_file_70;
struct {
int func;
int flag;
int param;
int rez1;
int rez2;
char rezerv2;
int stroka;
}run_file_70;
/////////////////////////// ///////////////////////////
// Запуск программы // // Запуск программы //
@ -17,12 +6,12 @@ struct {
void Run_Program(dword run_path, run_param) void Run_Program(dword run_path, run_param)
{ {
run_file_70.func = 7; run_file_70.func = 7;
run_file_70.flag = 0; run_file_70.param1 = 0;
run_file_70.param= run_param; run_file_70.param2 = run_param;
run_file_70.rez1 = 0; run_file_70.param3 = 0;
run_file_70.rez2 = 0; run_file_70.param4 = 0;
run_file_70.rezerv2 = 0; run_file_70.rezerv = 0;
run_file_70.stroka = run_path; run_file_70.name = run_path;
$mov eax,70 $mov eax,70
$mov ebx,#run_file_70.func $mov ebx,#run_file_70.func
$int 0x40 $int 0x40
@ -50,43 +39,46 @@ void Run_File(dword fpath)
Run_Program(fpath, ""); Run_Program(fpath, "");
}*/ }*/
///////////////////////////
// Çàïóñê ôàéëà //
///////////////////////////
void Run_File(dword fpath) void Run_File(dword fpath)
{ {
dword extension[4], fparam[256]; dword extension[4], fparam[256];
copystr(fpath,#fparam); //по-умолчанию прога и параметр равны, если окажется что это файл, парам - сбросим copystr(fpath,#fparam); //по-умолчанию прога и параметр равны, если окажется что это файл, парам - сбросим
copystr(fpath+strlen(fpath)-4,#extension); //узнаём расширение файла с каким работаем copystr(fpath+strlen(fpath)-4,#extension); //узнаём расширение файла с каким работаем
//тут мы это расширение сравнимаем, и, если оно асоциируется с прогой, прога - это fpath //тут мы это расширение сравнимаем, и, если оно асоциируется с прогой, прога - это fpath
IF (strcmp(#extension,".skn")==0) copystr("desktop",fpath); IF (!strcmp(#extension,".skn")) copystr("desktop",fpath);
IF (strcmp(#extension,".avi")==0) copystr("/sys/kvid",fpath); IF (!strcmp(#extension,".avi")) copystr("/sys/kvid",fpath);
IF (strcmp(#extension,".htm")==0) copystr("/sys/network/HTMLv",fpath); IF (!strcmp(#extension,".mpg")) copystr("/sys/kvid",fpath);
IF (strcmp(#extension,"html")==0) copystr("/sys/network/HTMLv",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,".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,".3ds")) copystr("/sys/demos/3d/view3ds",fpath);
IF (strcmp(#extension,".lif")==0) copystr("/sys/demos/life2",fpath); IF (!strcmp(#extension,".lif")) copystr("/sys/demos/life2",fpath);
IF (strcmp(#extension,".cvs")==0) copystr("graph",fpath); IF (!strcmp(#extension,".cvs")) copystr("graph",fpath);
IF (!strcmp(#extension,".nes")) copystr("/sys/games/fce",fpath);
//audio //audio
IF (strcmp(#extension,".mp3")==0) copystr("AC97SND",fpath); IF (!strcmp(#extension,".mp3")) copystr("AC97SND",fpath);
IF (strcmp(#extension,".wav")==0) copystr("AC97SND",fpath); IF (!strcmp(#extension,".wav")) copystr("AC97SND",fpath);
IF (strcmp(#extension,".mid")==0) copystr("MIDAMP",fpath); IF (!strcmp(#extension,".mid")) copystr("MIDAMP",fpath);
IF (strcmp(#extension,"midi")==0) copystr("MIDAMP",fpath); IF (!strcmp(#extension,"midi")) copystr("MIDAMP",fpath);
//text //text
IF (strcmp(#extension,".rtf")==0) copystr("RtfRead",fpath); IF (!strcmp(#extension,".rtf")) copystr("RtfRead",fpath);
IF (strcmp(#extension,".txt")==0) copystr("TinyPad",fpath); IF (!strcmp(#extension,".txt")) copystr("TinyPad",fpath);
IF (strcmp(#extension,".inc")==0) copystr("TinyPad",fpath); IF (!strcmp(#extension,".inc")) copystr("TinyPad",fpath);
IF (strcmp(#extension,".ini")==0) copystr("TinyPad",fpath); IF (!strcmp(#extension,".ini")) copystr("TinyPad",fpath);
IF (strcmp(#extension,".dat")==0) copystr("TinyPad",fpath); IF (!strcmp(#extension,".dat")) copystr("TinyPad",fpath);
IF (strcmp(#extension,".asm")==0) copystr("TinyPad",fpath); //AsmMenu1,AsmMenu2 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,".gif")) copystr("MV",fpath); //GifView,MenuAnimage
IF (strcmp(#extension,".bmp")==0) copystr("MV",fpath); //BmpMenu1,MenuAnimage IF (!strcmp(#extension,".bmp")) copystr("MV",fpath); //BmpMenu1,MenuAnimage
IF (strcmp(#extension,".tga")==0) copystr("MV",fpath); IF (!strcmp(#extension,".tga")) copystr("MV",fpath);
IF (strcmp(#extension,".pcx")==0) copystr("MV",fpath); IF (!strcmp(#extension,".pcx")) copystr("MV",fpath);
IF (strcmp(#extension,".png")==0) copystr("@rcher",fpath); IF (!strcmp(#extension,".cur")) copystr("MV",fpath);
IF (strcmp(#extension,".jpg")==0) copystr("JpegView",fpath); IF (!strcmp(#extension,".ico")) copystr("MV",fpath);
IF (strcmp(#extension,"jpeg")==0) copystr("JpegView",fpath); IF (!strcmp(#extension,".png")) copystr("@rcher",fpath);
IF (strcmp(fpath,#fparam)==0) copystr("",#fparam); //åñëè 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); //запуск! Run_Program(fpath, #fparam); //запуск!
} }

View File

@ -12,7 +12,6 @@ dword x86esp_reg = 0x00100000; // 0x0007fff0;
dword I_Param = #param; dword I_Param = #param;
dword I_Icon = 0x0; dword I_Icon = 0x0;
dword skin_width; dword skin_width;
char param[256]=""; char param[256]="";
//Events //Events
@ -121,10 +120,11 @@ inline fastcall dword WaitEvent(){
$int 0x40 $int 0x40
} }
inline fastcall void ExitProcess(){ /*inline fastcall void SetEventMask(dword EBX){
EAX = -1; // close this program $mov eax,40
//$mov ebx,100111b
$int 0x40 $int 0x40
} }*/
inline fastcall word GetKey(){ inline fastcall word GetKey(){
EAX = 2; // just read this key from buffer EAX = 2; // just read this key from buffer
@ -138,38 +138,99 @@ inline fastcall word GetButtonID(){
EAX = EAX >> 8; EAX = EAX >> 8;
} }
inline fastcall void ExitProcess(){
EAX = -1; // close this program
$int 0x40
}
inline fastcall void DrawTitle(dword ECX) /*void Pause(dword EBX)
{ //<2F> ã§ , ¢ á®âëå ¤®«ïå ᥪ㭤ë 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; EAX = 71;
EBX = 1; EBX = 1;
$int 0x40; $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; EAX = 48;
EBX = 4; EBX = 4;
$int 0x40 $int 0x40
} }
inline fastcall dword MoveSize(dword EBX,ECX,EDX,ESI){
inline fastcall void DeleteButton(dword EDX) EAX = 67;
{ $int 0x40
EAX = 8;
EDX = EDX + BT_DEL;
$int 0x40;
} }
//------------------------------------------------------------------------------
inline fastcall dword strlen(dword EDI) inline fastcall dword strlen(dword EDI){
{
#speed
ECX=EAX=0; ECX=EAX=0;
ECX--; ECX--;
$REPNE $SCASB $REPNE $SCASB
EAX=EAX-2-ECX; EAX-=2+ECX;
#codesize }
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
} }
@ -206,40 +267,27 @@ inline fastcall dword ChangeCase(dword EDX)
#codesize #codesize
} }
//------------------------------------------------------------------------------
inline fastcall void WindowRedrawStatus(dword EBX) inline fastcall void PutPixel(dword EBX,ECX,EDX){
{ EAX=1;
EAX = 12; // function 12:tell os about windowdraw ECX+=skin_width;
$int 0x40 $int 0x40
} }
void DefineButton(dword x,y,w,h,EDX,ESI){
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; EAX = 8;
EBX = x<<16+w; EBX = x<<16+w;
ECX = skin_width+y<<16+h; ECX = skin_width+y<<16+h;
$int 0x40 $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) void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
{ {
EAX = 4; EAX = 4;
@ -248,12 +296,6 @@ void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
$int 0x40; $int 0x40;
} }
inline fastcall void PutPixel(dword EBX,ECX,EDX)
{
EAX=1;
$int 0x40
}
void DrawBar(dword x,y,w,h,EDX) void DrawBar(dword x,y,w,h,EDX)
{ {
#speed #speed
@ -280,11 +322,10 @@ void DrawFlatButton(dword x,y,width,height,id,color,text)
DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //¯®«®á  ¢¥à¢ ¡¥« ¯ DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //¯®«®á  ¢¥à¢ ¡¥« ¯
DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //¢¥­¬ ¢¥à¢ DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //¢¥­¬ ¢¥à¢
DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª  DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª 
IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //®¯à¥¤¥«¯¥¬ ª­®¯ª£ 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); WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
} }
void PutImage(dword EBX,w,h,x,y) void PutImage(dword EBX,w,h,x,y)
{ {
EAX = 7; EAX = 7;
@ -293,56 +334,17 @@ void PutImage(dword EBX,w,h,x,y)
$int 0x40 $int 0x40
} }
void PutPaletteImage(dword EBX,w,h,x,y, EDI)
void copystr(dword s,d)
{ {
$mov esi,s EAX = 65;
$mov edi,d ECX = w<<16+h;
$cld EDX = x<<16+y+skin_width;
l1: ESI = 8;
$lodsb EBP = 0;
$stosb
$test al,al
$jnz l1
}
int j=0;
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 MoveSize(dword EBX,ECX,EDX,ESI)
{
EAX = 67;
$int 0x40 $int 0x40
} }
//------------------------------------------------------------------------------
f70 CopyFile_f; f70 CopyFile_f;
BDVK CopyFile_atr; BDVK CopyFile_atr;
@ -360,7 +362,7 @@ inline fastcall dword CopyFile(dword EBX,ECX)
$mov ebx, #CopyFile_f $mov ebx, #CopyFile_f
$int 0x40 $int 0x40
if (EAX == 0) if (!EAX)
{ {
cBufer = malloc(CopyFile_atr.sizelo); cBufer = malloc(CopyFile_atr.sizelo);
CopyFile_f.func = 0; CopyFile_f.func = 0;
@ -374,7 +376,7 @@ inline fastcall dword CopyFile(dword EBX,ECX)
$mov ebx, #CopyFile_f $mov ebx, #CopyFile_f
$int 0x40 $int 0x40
IF (EAX == 0) IF (!EAX)
{ {
CopyFile_f.func = 2; CopyFile_f.func = 2;
CopyFile_f.param1 = 0; CopyFile_f.param1 = 0;