From 104d5409201850cca3e343672b585b97214c0b92 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Fri, 19 Dec 2008 02:44:13 +0000 Subject: [PATCH] Eolite 0.98.2 git-svn-id: svn://kolibrios.org@975 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/fs/Eolite/trunk/Eolite.c-- | 464 +++++++++--------- programs/fs/Eolite/trunk/include/LVabout.h-- | 78 +++ programs/fs/Eolite/trunk/include/icons_f.h-- | 105 ++-- .../include/{LVabout.c-- => sorting.h--} | 42 +- programs/fs/Eolite/trunk/lib/IPC.H-- | 186 ------- programs/fs/Eolite/trunk/lib/Nable_lib.H-- | 119 ----- programs/fs/Eolite/trunk/lib/edit_box_lib.h-- | 2 +- programs/fs/Eolite/trunk/lib/file_system.h-- | 115 ++--- programs/fs/Eolite/trunk/lib/kolibri.h-- | 131 +++-- 9 files changed, 504 insertions(+), 738 deletions(-) create mode 100644 programs/fs/Eolite/trunk/include/LVabout.h-- rename programs/fs/Eolite/trunk/include/{LVabout.c-- => sorting.h--} (55%) delete mode 100644 programs/fs/Eolite/trunk/lib/IPC.H-- delete mode 100644 programs/fs/Eolite/trunk/lib/Nable_lib.H-- diff --git a/programs/fs/Eolite/trunk/Eolite.c-- b/programs/fs/Eolite/trunk/Eolite.c-- index 9d2a447f7e..b0529c4307 100644 --- a/programs/fs/Eolite/trunk/Eolite.c-- +++ b/programs/fs/Eolite/trunk/Eolite.c-- @@ -1,5 +1,12 @@ //Leency & Veliant -=- KolibriOS Team -=- 2008 +//строка 258, кейап! +//возможно, баг в KEdit +//find_symbol надо читать с конца +//335 строка +//PathHistory бля надо API для работы с историей, в т.ч. проверять не равна ли новая папка предыдущей +//DrawBar(sort_num[1],45,6,9,0xE4DFE1); + #codesize #include "lib\kolibri.h--" #include "lib\memory.h--" @@ -9,77 +16,103 @@ #include "imgs\left_p.txt" //локализация и настройки -#define header "Eolite File Manager v0.97.2" +#define header "Eolite File Manager v0.98.2" #define videlenie 0x94AECE //0x94AECE,0xFEA4B7,0x8BCDFF,0xB8C9B8}; //цвет выделенного элемента из списка файлов -byte toolbar_buttons_x[6]={14,51,90,139,172,208}; +byte toolbar_buttons_x[6]={9,46,85,134,167,203}; // -dword but_num, kolichestvo, za_kadrom, curbtn, razm_scrl; -byte cut_active, rename_active, del_active; -byte show_actions=1, show_preview=0, sort_num=1, isdir; -char path[256]="/rd/1/", edit_path[256], PathHistory[2560], temp[256]; //для путей -char file_path[256], file_name[256]; //для файлов -char copyfile[256],copy_name[256]; //копирование -dword file_mas[6898]; //список файлов +dword but_num, + kolichestvo, + za_kadrom, + curbtn, + razm_scrl; +byte cut_active, + rename_active, + del_active; +byte show_actions=1, + show_preview=0, + sort_num=2, + isdir; +char path[256]="/rd/1/", + edit_path[256], + file_path[256], + file_name[256], + copy_file[256], + temp[256]; +char PathHistory[2560]; + +dword file_mas[6898]; int temp_int, j, i; + dword stak[100]=0; //окно About -edit_box edit1= {250,252,17,0xffffff,0x94AECE,0xD3DDEB,0xffffff,0,248,#edit_path,64,6,6}; -edit_box edit2= {250,218,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,64,6,6}; +edit_box edit1= {250,247,17,0xffffff,0x94AECE,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}; -proc_info Form; +proc_info Form; dword buf=0, off; //для текста и буфера dword devbuf=0, dev_num; -#include "include\LVabout.c--" +#include "include\LVabout.h--" +#include "include\sorting.h--" #include "include\icons_f.h--" - -//IPC -#include "lib\Nable_lib.h--" -#include "lib\ipc.h--" - -int pLoadedImage; -void GetImage(dword ipath) -{ - IF (pLoadedImage) free(pLoadedImage); - pLoadedImage=loadimage_viaIPC(ipath, #CurrentImage); - SetEventMask(100111b); //restore normal event mask -} - - -void main() -byte pressed, key, id; +void main() +byte key, id; mouse m; int pressed_y; { + load_editbox_lib(); devbuf= malloc(3112); //буфер где-то на 10 девайсов в левой панели ReadDir(10, devbuf, "/"); dev_num=EBX; - load_dll(); //подгружает либу с едит_боксом - IF (param[0]<>'') {copystr(#param,#edit_path); Goto_edit_path();} - Open_Dir(#path,2); + IF (param[0]<>'') {copystr(#param,#edit_path); Goto_edit_path();} ELSE Open_Dir(#path,2); //был ли запуск с параметром loop() { switch(WaitEvent()) { CASE evMouse: - id = 0; IF (del_active==1) break; m.get(); - // + + if (m.x>=Form.width-21) && (m.x<=Form.width-6) && (m.y>40) && (m.y<57) + { + IF (m.lkm==1) DrawRegion_3D(onLeft(26,0),41,14,14,0xC7C7C7,0xFFFFFF); + WHILE (m.lkm==1) && (za_kadrom>0) + { + Pause(10); + za_kadrom--; + List_ReDraw(); + m.get(); + } + DrawRegion_3D(onLeft(26,0),41,14,14,0xFFFFFF,0xC7C7C7); + } + + if (m.x>=Form.width-21) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.ym.y) || (m.y<0) || (m.y>4000) m.y=razm_scrl/2+57; //если курсор над окном - IF (m.lkm==0) pressed=0; ELSE - IF (m.x>=Form.width-21) && (m.x<=Form.width-6) pressed=1; - IF (pressed==1) + if (m.x>=Form.width-21) && (m.x<=Form.width-6) while (m.lkm) { + IF (razm_scrl/2+57>m.y) || (m.y<0) || (m.y>4000) m.y=razm_scrl/2+57; //если курсор над окном temp_int=za_kadrom; //сохраняем старое количество j= razm_scrl/2; za_kadrom = m.y -j -57 * kolichestvo / onTop(22,57); IF (but_num+za_kadrom>kolichestvo) za_kadrom=kolichestvo-but_num; IF (temp_int<>za_kadrom) List_ReDraw(); //чтоб лишний раз не перерисовывать + m.get(); } break; //Button pressed----------------------------------------------------------------------------- @@ -98,22 +131,14 @@ int pressed_y; CASE 27: Goto_edit_path(); break; //goto edit_path CASE 31...33: //sort IF (sort_num==id-30) break; - IF(sort_num==1)DrawBar(onLeft(197,163)/2+215,45,6,9,0xE4DFE1); - IF(sort_num==2)DrawBar(onLeft(110,0),45,6,9,0xE4DFE1); - IF(sort_num==3)DrawBar(onLeft(39,0),45,6,9,0xE4DFE1); + IF(sort_num==1)DrawBar(onLeft(192,168)/2+210,45,6,9,0xE4DFE1); + IF(sort_num==2)DrawBar(onLeft(115,0),45,6,9,0xE4DFE1); + IF(sort_num==3)DrawBar(onLeft(44,0),45,6,9,0xE4DFE1); sort_num=id-30; Open_Dir(#path,1); break; case 30: //about - EAX = 51; EBX = 1; - ECX = #authors; EDX = #stak; - $int 40h; - break; - case 50: //стрелка вверх на скроле - FileList_ReDraw(-1); - break; - case 51: //стрелка вниз на скроле - FileList_ReDraw(1); + CreateThread(#authors,#stak); break; case 78: //preview IF (show_preview==1) show_preview=0; ELSE show_preview=1; @@ -136,31 +161,29 @@ int pressed_y; za_kadrom=curbtn=0; Open_Dir(#path,1); FOR (i=0; i64) && (key<>13) && (key<>27) {EAX=key<<8; edit_box_key stdcall (#edit2); break;} switch (key) { - case 209...217: id=key-109; IF(dev_num>id-100)GOTO DEVICE_MARK; break; + case 209...217: id=key-109; GOTO DEVICE_MARK; case 8: GoBack(); break; //Назад case 014: MoveSize(80,80,OLD,OLD); RunProgram("/sys/File Managers/Eolite", #path); break; //новое окно case 024: //Ctrl+X cut @@ -184,15 +207,14 @@ int pressed_y; case 003: //Ctrl+C copy CTRLC_MARK: IF (isdir) break; //папки пока что копировать не умеем - copystr(#file_name,#copy_name); - copystr(#file_path,#copyfile); //вычисляем какой файл копировать + copystr(#file_path,#copy_file); //вычисляем какой файл копировать IF (key==24) cut_active=1; ELSE cut_active=0; break; case 022: Paste(); break;//Ctrl+V paste case 027: //Esc IF (rename_active==1) {Line_ReDraw(videlenie, 100);} break; - case 013: //Enter + case 013: //Enter IF (rename_active==1) {Line_ReDraw(videlenie, curbtn); break;} IF (strcmp(#path,#edit_path)<>0) Goto_edit_path(); ELSE GOTO OPEN_MARK; @@ -210,7 +232,7 @@ int pressed_y; FileList_ReDraw(-za_kadrom-curbtn); break; case 181: //end - FileList_ReDraw(kolichestvo-za_kadrom-curbtn+but_num); + FileList_ReDraw(kolichestvo-za_kadrom-curbtn+but_num-1); break; case 183: //Page Down FileList_ReDraw(but_num-1); @@ -220,32 +242,35 @@ int pressed_y; break; case 051: //Нажата F2 REN_MARK: - //IF (isdir==1) break; //папки пока что копировать не умеем - edit2.flags=66; //делаем компонент активным DeleteButton(curbtn+201); //это чтоб можно было выделять мышью + edit2.flags=66; //делаем компонент активным edit2.width=onLeft(24,217); - edit2.top=curbtn*18+59+skin_width; - edit2.size=strlen(#file_name); edit2.pos=strlen(#file_name); + edit2.top=curbtn*18+59; + edit2.size=edit2.pos=strlen(#file_name); edit_box_draw stdcall (#edit2); - DrawBar(218,curbtn*18+58,edit2.width+1,1,0xFFFFCC); //полоса желтая сверху для одинаковости + DrawBar(213,curbtn*18+58,edit2.width+1,1,0xFFFFCC); //полоса желтая сверху для одинаковости rename_active=1; break; case 052: //Нажата F3 - IF (isdir==false) RunProgram("/sys/tinypad", #file_path); break; - case 054: Open_Dir(#path,1); break; //перерисовать окно F5 - case 182: Del_Form(); break; //delete file + IF (isdir==false) RunProgram("/sys/tinypad", #file_path); + break; + case 054: //F5 + Open_Dir(#path,1); + break; + case 182: //delete file + Del_Form(); + break; default: - IF (strcmp("..",buf+72+304)<>0) temp_int=0; ELSE temp_int=1; - for (i=curbtn+za_kadrom+1; i='A')&&(AL<='Z')DSBYTE[#temp]=AL|0x20; IF (temp[0]==key) {FileList_ReDraw(i-curbtn-za_kadrom); break;} } } - break; - case evReDraw: draw_window(); BREAK; + BREAK; + case evReDraw: draw_window(); } IF (rename_active==0) edit_box_mouse stdcall(#edit1); ELSE edit_box_mouse stdcall(#edit2); } @@ -256,47 +281,38 @@ inline fastcall void draw_window() { WindowRedrawStatus(1); skin_width = GetSkinWidth(); - DefineAndDrawWindow(100,100,600,410,0x43,0x10E4DFE1,0,0,header); + DefineAndDrawWindow(100,100,600,410,0x73,0x10E4DFE1,0,0,header); Form.GetInfo(SelfInfo); - 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.width<480) MoveSize(OLD,OLD,480,OLD); //toolbar buttons - PutPaletteImage(#toolbar,246,39,5,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); //полоса адреса - DrawBar(251,0,onLeft(251,60),12,0xE4DFE1); //фон над полосой адреса + DrawBar(246,0,onLeft(246,60),12,0xE4DFE1); //фон над полосой адреса edit1.width=Form.width-314; - edit1.top=13+skin_width; + edit1.top=13; KEdit(); - DrawRegion(251,12,onLeft(61,251),16,0x94AECE); //ободок - DrawBar(251,29,onLeft(251,60),10,0xE4DFE1); //фон под полосой адреса + DrawRegion_3D(246,12,onLeft(66,246),16,0x94AECE,0x94AECE); //ободок + DrawBar(246,29,onLeft(246,60),10,0xE4DFE1); //фон под полосой адреса DefineButton(onLeft(34,0),6,27,28,30+BT_HIDE+BT_NOFRAME,0xE4DFE1); //about DefineButton(onLeft(61,0),12,18,16,27+BT_HIDE,0xE4DFE1); //кнопка перехода - PutPaletteImage(#goto_about,56,40,Form.width-60,0,#goto_about_pal); + PutPaletteImage(#goto_about,56,40,Form.width-65,0,#goto_about_pal); //прямоугольники внутри - DrawRegion(6,40,Form.width-12,Form.height-skin_width-46,0x94AECE); //синий ободок - DrawRegion(5,39,Form.width-10,Form.height-skin_width-44,0xE4DFE1); //фон + DrawRegion_3D(1,40,Form.width-12,Form.height-skin_width-46,0x94AECE,0x94AECE); //синий ободок + DrawRegion_3D(0,39,Form.width-10,Form.height-skin_width-44,0xE4DFE1,0xE4DFE1); //фон Devices(); //панель слева на синем фоне - //Buttons - DrawFlatButton(197,40,onLeft(197,163),16,31,0xE4DFE1,"File"); - DrawFlatButton(onLeft(163,0),40,73,16,32,0xE4DFE1,"Type"); - DrawFlatButton(onLeft(90,0),40,68,16,33,0xE4DFE1,"Size"); - IF (sort_num==1) WriteText(onLeft(197,163)/2+197+18,45,0x80,0x4E78AC,"\x19",0); - ELSE IF (sort_num==2) WriteText(onLeft(110,0),45,0x80,0x4E78AC,"\x19",0); - ELSE WriteText(onLeft(39,0),45,0x80,0x4E78AC,"\x19",0); + //SortButtons + DrawFlatButton(192,40,onLeft(192,168),16,31,0xE4DFE1,"File"); + DrawFlatButton(onLeft(168,0),40,73,16,32,0xE4DFE1,"Type"); + DrawFlatButton(onLeft(95,0),40,68,16,33,0xE4DFE1,"Size"); //прокрутка - DrawFlatButton(onLeft(22,0),40,16,16,50,0xE4DFE1,"\x18"); //прокрутка вверх - DrawFlatButton(onLeft(22,0),onTop(22,0),16,16,51,0xE4DFE1,"\x19");//прокрутка вниз + 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");//прокрутка вниз // - //DrawBar(197,57,onLeft(22,197),onTop(57,6),0xFFFFFF); //заливка белым - // - DrawBar(onLeft(22,0),57,1,onTop(22,57),0x94AECE); //линия слева от прокрутки - but_num=onTop(6,57)/18; - IF (but_num>100) but_num=1; ELSE IF (kolichestvoonTop(22,57)-on_y+56) || (za_kadrom+but_num>=kolichestvo) on_y=onTop(23+razm_scrl,0); //для большого списка - DrawFlatButton(onLeft(22,0),on_y,16,razm_scrl,0,0xE4DFE1,"");//ползунок - DrawBar(onLeft(21,0),57,15,on_y-57,0xCED0D0);//поле до ползунка - DrawBar(onLeft(21,0),on_y+razm_scrl+1,15,onTop(22,57)-razm_scrl-on_y+56,0xCED0D0); //поле после ползунка + DrawFlatButton(onLeft(27,0),on_y,16,razm_scrl,0,0xE4DFE1,"");//ползунок + DrawBar(onLeft(26,0),57,15,on_y-57,0xCED0D0);//поле до ползунка + DrawBar(onLeft(26,0),on_y+razm_scrl+1,15,onTop(22,57)-razm_scrl-on_y+56,0xCED0D0); //поле после ползунка } @@ -355,7 +371,7 @@ void FileList_ReDraw(int curbtn_) ELSE { IF(but_num+za_kadrom+curbtn_>=kolichestvo) za_kadrom=kolichestvo-but_num; ELSE za_kadrom+=curbtn_+curbtn-but_num+1; - curbtn=but_num; + curbtn=but_num-1; List_ReDraw(); } } @@ -364,15 +380,14 @@ void FileList_ReDraw(int curbtn_) void List_ReDraw() { - IF (kolichestvo-za_kadrombut_num-1) curbtn=but_num-1; //это если выделение после схлопывания окна за кадром + IF (kolichestvo-za_kadrombut_num-1) //если мы в конце списка файлов развернём окно появяться пустяе белые кнопки + { za_kadrom=kolichestvo-but_num; curbtn=but_num-1; } //это если выделение после схлопывания окна за кадром // FOR (j=0; jj) Line_ReDraw(0xFFFFFF, j); ELSE Line_ReDraw(videlenie, curbtn); temp_int=but_num*18+57; - DrawBar(197,temp_int,onLeft(22,197),onTop(temp_int,6),0xFFFFFF); //заливка белым доконца - DrawBar(onLeft(163,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //полоса серая вертикальная 1 - DrawBar(onLeft(90,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //полоса серая вертикальная 2 + DrawBar(192,temp_int,onLeft(27,192),onTop(temp_int,6),0xFFFFFF); //заливка белым доконца + DrawBar(onLeft(168,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //полоса серая вертикальная 1 + DrawBar(onLeft(95,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //полоса серая вертикальная 2 TVScroll(); } @@ -383,7 +398,7 @@ void Line_ReDraw(dword color, filenum){ { rename_active=0; edit2.flags=64; - DefineButton(197,curbtn*18+57,onLeft(22,197),18,curbtn+201+BT_HIDE+BT_NOFRAME,0xFFFFFF); + 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); @@ -393,7 +408,7 @@ void Line_ReDraw(dword color, filenum){ { //Del_File(true); DeleleFile(#file_path); - IF (EAX<>0) {DrawFlatButton(Form.width-200+197/2,160,200,80,0,0xFFB6B5, "Error. Folder isn't empty."); Pause(200);} + 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); } @@ -402,12 +417,10 @@ void Line_ReDraw(dword color, filenum){ } y=filenum*18+57; //да, я не спорю что изврат, но перерисовка зато маленькая - 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); + 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); // - 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; + off=file_mas[filenum+za_kadrom]*304 + buf+72; EAX=ESDWORD[off-40]; $shr eax,4 $and eax,1 @@ -415,14 +428,14 @@ void Line_ReDraw(dword color, filenum){ if (!EAX) { 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(70,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("", y+2); if (color==videlenie) { IconFairing(temp_int, y+2); //закрашиваем иконку - copystr(#path,#file_path); copystr(off,#file_name); - copystr(off,#file_path+strlen(#file_path)); //итак, file_path=файлу, т.к. по-умолчанию это прога + copystr(#path,#file_path); + copystr(#file_name,#file_path+strlen(#file_path)); //полный путь к файлу /*IF (show_preview) && (!isdir) { GetImage(#file_path); @@ -431,107 +444,97 @@ void Line_ReDraw(dword color, filenum){ IF (pLoadedImage<>0) DrawImage(#CurrentImage, 22*65536+j+skin_width+18); }*/ } - temp_int = onLeft(220,160)/6; + temp_int = onLeft(215,160)/6; IF (strlen(off)3) + { + copystr(temp_, #path_); + IF (somelen) path_[somelen]=0x00; + // + IF (buf) free(buf); + buf = malloc(32); + ReadDir(0, buf, #path_); + kolichestvo = ESDWORD[buf+8]; + buf = realloc(kolichestvo * 304 + 32, buf); + ReadDir(kolichestvo, buf, #path_); + IF (EBX>6898) && (EBX<>-1) EBX=6898; + kolichestvo=EBX; + } if (kolichestvo<>-1) && (redraw>0) { - FOR (j=0;j0) ChangeCase(off);} //регистр + IF (!strcmp(".",buf+72)) {memmov(buf,buf+304,kolichestvo-1*304); kolichestvo--; } //фильтруем элемент "." FOR (j=0;j100) but_num=1; ELSE//эта странная строчка для того если размеры окна слишком маленькие + but_num=onTop(6,57)/18; + IF (but_num>100) but_num=1; ELSE //эта странная строчка для того если размеры окна слишком маленькие IF (kolichestvo3) Sorting(); + IF (redraw==1) || (redraw==3) List_ReDraw(); + copystr(temp_,#edit_path); KEdit(); copystr("|",#PathHistory+strlen(#PathHistory)); copystr(#path,#PathHistory+strlen(#PathHistory)); + //стрелочка сортировки + 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 (kolichestvo==-1) {but_num=kolichestvo=0; List_ReDraw();} } -void FoldesGoUp() +inline Sorting() { - dword k=0, l=0; off=buf+72; - IF (strcmp(#path,"/rd/1/")==0) || (strcmp(#path,"/fd/1/")==0) kolichestvo--; - IF (strcmp(".",buf+72)<>0) && (strlen(#path)>6) kolichestvo--; //фак! это бред! хз как оно работает - FOR (j=0;j<=kolichestvo;j++) //а папки вверх, файлы вниз + dword k=0, l=1; + IF (!strcmp(#path,"/")) {FOR(k=1;k=0; j--, off-=304;) //папки вверх, файлы вниз { - EAX=ESDWORD[off-40]; + ChangeCase(off+40); + EAX=ESDWORD[off]; $shr eax,4 $and eax,1 - IF (EAX) {file_mas[k]=j; k++;} - ELSE {file_mas[kolichestvo-l]=j; l++;} - off += 304; + IF (EAX) {file_mas[k]=j; k++;} ELSE + {file_mas[kolichestvo-l]=j; l++;} } - switch(sort_num) - { - CASE 1: //упорядочиваем файлы по имени - WriteText(onLeft(197,163)/2+215,45,0x80,0x4E78AC,"\x19",0); - IF (strcmp(#path,"/")==0) break; - IF (strcmp("..",buf+72+304)<>0) Sort_by_Name(k,kolichestvo-1); ELSE Sort_by_Name(k,kolichestvo); - break; - case 2: //упорядочиваем файлы по типу - WriteText(onLeft(110,0),45,0x80,0x4E78AC,"\x19",0); - IF (strcmp("..",buf+72+304)<>0) Sort_by_Type(k, kolichestvo-1); ELSE Sort_by_Type(k, kolichestvo); - break; - case 3: - WriteText(onLeft(39,0),45,0x80,0x4E78AC,"\x19",0); - IF (strcmp("..",buf+72+304)<>0) Sort_by_Size(k,kolichestvo-1); ELSE Sort_by_Size(k,kolichestvo); - BREAK; - } - IF (strcmp(#path,"/")<>0) IF (strcmp("..",304+buf+72)<>0) Sort_by_Name(0,k-1); ELSE Sort_by_Name(2,k-1); //иногда имя папки начинается с !,&... - IF (strcmp(".",buf+72)<>0) && (strlen(#path)>6) kolichestvo++; + //Собственно сортировка + Sort_by_Name(0,k-1); + IF (sort_num==1) Sort_by_Name(k,kolichestvo-1); + IF (sort_num==2) Sort_by_Type(k, kolichestvo-1); + IF (sort_num==3) Sort_by_Size(k,kolichestvo-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]>0) && (isdir==true) {DrawFlatButton(temp_int,160,200,80,0,0xFFB6B5, "Error. Folder isn't empty."); Pause(200);} + IF (EAX<>0) && (isdir==true) {DrawFlatButton(Form.width/2-13,160,200,80,0,0xFFB6B5, "Error. Folder isn't empty."); Pause(200);} } del_active=0; DeleteButton(301); DeleteButton(302); //удаляем кнопочки Yes/No @@ -551,21 +554,21 @@ void Del_File(byte dodel) void Paste() { - IF (strcmp(#copyfile,"")==0) return; //отмена, еши ещё ничё не скопировали + IF (!copy_file) return; //отмена, еши ещё ничё не скопировали copystr(#path,#temp); - copystr(#copy_name,#temp+strlen(#temp)); - if (strcmp(#copyfile,#temp)==0) //если мы копируем и вставляем в одной и той же папке + copystr(#copy_file+find_symbol(#copy_file,'/'),#temp+strlen(#temp)); + if (strcmp(#copy_file,#temp)==0) //если мы копируем и вставляем в одной и той же папке { copystr(#path,#temp); copystr("new_",#temp+strlen(#temp)); - copystr(#copy_name,#temp+strlen(#temp)); + copystr(#copy_file+find_symbol(#copy_file,'/'),#temp+strlen(#temp)); } - CopyFile(#copyfile,#temp); + CopyFile(#copy_file,#temp); IF (cut_active==1) //если мы выбрали вырезать { - copystr(#copyfile,#file_path); + copystr(#copy_file,#file_path); Del_File(true); - copyfile=''; + copy_file=''; cut_active=0; } Open_Dir(#path,1); @@ -574,26 +577,26 @@ void Paste() void Tip(int y, dword caption, id, arrow) { - DrawBar(22,y,160,17,0xE4DFE1); //серое сверху - WriteText(30,y+5,0x80,0,caption,0); //text Goto: - IF (id<>0) DefineButton(164,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0xE4DFE1); //кнопа для стрелки - WriteText(170,y+5,0x80,0,arrow,0); //стрелка вниз - DrawBar(22,y+17,160,1,0x94AECE); //подчёркивание + DrawBar(17,y,160,17,0xE4DFE1); //серое сверху + WriteText(25,y+5,0x80,0,caption,0); //text Goto: + IF (id<>0) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0xE4DFE1); //кнопа для стрелки + WriteText(165,y+5,0x80,0,arrow,0); //стрелка вниз + DrawBar(17,y+17,160,1,0x94AECE); //подчёркивание } void Devices() { byte dev_icon; dword drive_name[30]; char dev_name[4]; - DrawBar(7,41,190,15,0x00699C); //синий прямоугольник - сверху - DrawBar(7,56,15,onTop(21,41),0x00699C); //синий прямоугольник - слева - DrawBar(182,56,15,onTop(21,41),0x00699C); //синий прямоугольник - справа + 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, ""); - DrawBar(22,74,160,dev_num*16+1,0xFFFFFF); //белое + DrawBar(17,74,160,dev_num*16+1,0xFFFFFF); //белое for (i=0;i",0); + WriteText(42,dev_num*16+113,0x80,0,"Rename file ",0); //delete file - DefineButton(22,dev_num*16+125,159,16,81+BT_HIDE,0xE4DFE1); - WriteText(47,dev_num*16+130,0x80,0,"Delete file ",0); + DefineButton(17,dev_num*16+125,159,16,81+BT_HIDE,0xE4DFE1); + WriteText(42,dev_num*16+130,0x80,0,"Delete file ",0); //create folder - DefineButton(22,dev_num*16+142,159,16,82+BT_HIDE,0xE4DFE1); - WriteText(47,dev_num*16+147,0x80,0,"Create folder ",0); - DrawBar(22,dev_num*16+159,160,15,0x00699C); //синее после Actions + DefineButton(17,dev_num*16+142,159,16,82+BT_HIDE,0xE4DFE1); + WriteText(42,dev_num*16+147,0x80,0,"Create folder ",0); + DrawBar(17,dev_num*16+159,160,15,0x00699C); //синее после Actions } ELSE { DeleteButton(80); DeleteButton(81); DeleteButton(82); Tip(dev_num*16+90, "Actions", 77, "\x18"); - DrawBar(22,dev_num*16+108,160,51,0x00699C); //синее + DrawBar(17,dev_num*16+108,160,51,0x00699C); //синее } } void Dir_Up() { - byte temp_[256]; + char temp_[256]; i=strlen(#path)-1; path[i]=0x00; do i--; while (path[i]<>'/'); copystr(#path+i+1,#temp_); @@ -650,14 +653,14 @@ void Dir_Up() 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; + FOR (i=kolichestvo-1; i>0; i--;) IF(strcmp(file_mas[i]*304+buf+72,#temp_)==0) BREAK; // if (i>kolichestvo-but_num) { za_kadrom=kolichestvo-but_num; - IF (strcmp(".",buf+72)<>0) curbtn=i-kolichestvo+but_num; ELSE curbtn=i-kolichestvo+but_num-1; + curbtn=i-kolichestvo+but_num; } - ELSE IF (strcmp(".",buf+72)<>0) FileList_ReDraw(i); ELSE FileList_ReDraw(i-1); + ELSE FileList_ReDraw(i); List_ReDraw(); } @@ -670,21 +673,21 @@ void Preview() if (show_preview==1) { Tip(top_pr,"Preview",78,"\x19"); - DrawBar(22,top_pr+18,160,100,0xFFFFFF); //белое - /*WriteText(30,top_pr+30,0x80,0,"kolichestvo:",0); WriteText(105,top_pr+30,0x80,0,IntToStr(kolichestvo),0); - WriteText(30,top_pr+40,0x80,0,"but_num:",0); WriteText(105,top_pr+40,0x80,0,IntToStr(but_num),0); + DrawBar(17,top_pr+18,160,100,0xFFFFFF); //белое + WriteText(25,top_pr+30,0x80,0,"Number of files:",0); WriteText(135,top_pr+30,0x80,0,IntToStr(kolichestvo),0); + /*WriteText(30,top_pr+40,0x80,0,"but_num:",0); WriteText(105,top_pr+40,0x80,0,IntToStr(but_num),0); WriteText(30,top_pr+50,0x80,0,"curbtn",0); WriteText(105,top_pr+50,0x80,0,IntToStr(curbtn),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+80,0x80,0,#file_name,0);*/ //WriteText(30,top_pr+60,0x80,0,"Not realized... I think",0); //WriteText(30,top_pr+70,0x80,0,"it will be realired soon.",0); - DrawBar(22,top_pr+118,160,onTop(top_pr+118,6),0x00699C); //синее + DrawBar(17,top_pr+118,160,onTop(top_pr+118,6),0x00699C); //синее } ELSE { Tip(top_pr,"Preview",78,"\x18"); - DrawBar(22,top_pr+18,160,onTop(top_pr+18,6),0x00699C); //синее + DrawBar(17,top_pr+18,160,onTop(top_pr+18,6),0x00699C); //синее } } @@ -700,6 +703,7 @@ void Goto_edit_path() } + inline fastcall void GoBack() //вначале удаляем текущий путь, а потом копируем то, что осталось { //char old_dir[256]=''; diff --git a/programs/fs/Eolite/trunk/include/LVabout.h-- b/programs/fs/Eolite/trunk/include/LVabout.h-- new file mode 100644 index 0000000000..bcabd9c387 --- /dev/null +++ b/programs/fs/Eolite/trunk/include/LVabout.h-- @@ -0,0 +1,78 @@ +#include "imgs\logo.txt" + +/* +//IPC +#include "lib\Nable_lib.h--" +#include "lib\ipc.h--" + +int pLoadedImage; +void GetImage(dword ipath) +{ + IF (pLoadedImage) free(pLoadedImage); + pLoadedImage=loadimage_viaIPC(ipath, #CurrentImage); + SetEventMask(100111b); //restore normal event mask +} + +*/ + + +void authors() +{ + mouse mm; + byte 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: ExitProcess(); + case evKey: IF (GetKey()==27) ExitProcess(); break; + case evReDraw: + WindowRedrawStatus(1); + DefineAndDrawWindow(500,200,181,256,0x34,0x10EFEBEF,0,0,"About Eolite"); + DrawBar(0,0,172,50,0x8494C4); //голубое сзади + PutPaletteImage(#logo,85,85,48,7,#logo_pal); + WriteText(33,100,0x80,0xBF40BF,"Eolite v0.98.2 RC1",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(21,160,0x80,0,"Made using C-- in 2008",0); + WriteText(18,170,0x80,0,"Visit www.kolibrios.org",0); + DrawFlatButton(85,190,70,22,0,0xE4DFE1, "Close"); + WindowRedrawStatus(2); + } +} + + +/*типа анимация +WHILE (m.lkm==1) +{ + Pause(10); + PutPaletteImage(p*16*15+#ficons,16,15,100,350,#ficons_pal); + IF (p>21) p=0; ELSE p++; + m.get(); +}*/ + + +dword onLeft(dword right,left) {EAX=Form.width-right-left;} +dword onTop(dword down,up) {EAX=Form.height-skin_width-down-up;} + + +dword ConvertSize(dword bytes) +{ + char size_prefix[7], temp[3]; + IF (bytes>=1073741824) copystr(" Gb",#temp); + ELSE IF (bytes>=1048576) copystr(" Mb",#temp); + ELSE IF (bytes>=1024) copystr(" Kb",#temp); + ELSE copystr(" b ",#temp); + WHILE (bytes>1023) bytes/=1024; + copystr(IntToStr(bytes),#size_prefix); + copystr(#temp,#size_prefix+strlen(#size_prefix)); + EAX=#size_prefix; +} diff --git a/programs/fs/Eolite/trunk/include/icons_f.h-- b/programs/fs/Eolite/trunk/include/icons_f.h-- index 263e5a4432..2a1060f61d 100644 --- a/programs/fs/Eolite/trunk/include/icons_f.h-- +++ b/programs/fs/Eolite/trunk/include/icons_f.h-- @@ -3,65 +3,65 @@ void IconFairing(int filenum, y) switch(filenum) { case 0...4: //файлик - DrawBar(200,y,2,15,videlenie); - DrawBar(214,y,2,15,videlenie); - DrawBar(210,y,4,1,videlenie); - DrawBar(211,y+1,3,1,videlenie); - DrawBar(212,y+2,2,1,videlenie); - PutPixel(213,y+3,videlenie); + DrawBar(195,y,2,15,videlenie); + 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 16...17: //папка - DrawBar(200,y,1,15,videlenie); - DrawBar(208,y,8,2,videlenie); - IF (filenum==17) PutPixel(211,y+1,0x1A7B17); //зелёная точка стрелки - DrawBar(201,y+13,15,2,videlenie); - PutPixel(201,y,videlenie); //.точки - PutPixel(207,y,videlenie); - PutPixel(215,y+2,videlenie); - PutPixel(201,y+12,videlenie); - PutPixel(215,y+12,videlenie); + 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 13: //skin - PutPixel(215,y,videlenie); + PutPixel(210,y,videlenie); return; case 11: //asm - DrawBar(201,y,1,15,videlenie); + DrawBar(196,y,1,15,videlenie); case 14: //video - DrawBar(200,y,1,15,videlenie); - DrawBar(215,y,1,15,videlenie); + DrawBar(195,y,1,15,videlenie); + DrawBar(210,y,1,15,videlenie); return; case 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); + PutPixel(195,y,videlenie); //справа справа + DrawBar(208,y,3,1,videlenie); + DrawBar(209,y+1,2,1,videlenie); + PutPixel(210,y+2,videlenie); + PutPixel(195,y+11,videlenie); + DrawBar(195,y+12,2,1,videlenie); + DrawBar(195,y+13,3,1,videlenie); + DrawBar(195,y+14,4,1,videlenie); return; case 19: //изображение - DrawBar(200,y+14,16,1,videlenie); + DrawBar(195,y+14,16,1,videlenie); return; case 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); + 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 21: //дискета - PutPixel(200,y,videlenie); - PutPixel(215,y,videlenie); + PutPixel(195,y,videlenie); + PutPixel(210,y,videlenie); return; case 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); + 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; } } @@ -73,23 +73,23 @@ dword Put_icon(dword extension, yy) dword ftype="", fnum=0; //еши неизвесный файл IF (!strcmp(extension,".kex")) {fnum = 6; ftype="Program";} IF (!strcmp(extension,".cvs")) {fnum = 18; ftype="Graph";} - IF (!strcmp(extension,".cmd")) || (!strcmp(extension,".bat")) {fnum = 5; ftype="CMD skript";} + IF (!strcmp(extension,".cmd")) || (!strcmp(extension,".bat")) {fnum = 5; ftype="Script";} IF (!strcmp(extension,".skn")) {fnum = 13; ftype="Skin";} IF (!strcmp(extension,".chr"))|| (!strcmp(extension+1,".mt")) || (!strcmp(extension,".ttf")) || (!strcmp(extension,".fon")) {fnum = 10; ftype="Font";} IF (!strcmp(extension,".asm")) {fnum = 11; ftype="Source";} IF (!strcmp(extension,".inc")) fnum = 9; IF (!strcmp(extension,".exe")) || (!strcmp(extension,".msi")) {fnum = 7; ftype="Win32 Exec";} - IF (!strcmp(extension,".com")) fnum = 5; + IF (!strcmp(extension,".com")) {fnum = 5; ftype="DOS Exec";} IF (!strcmp(extension,".cpp")) {fnum = 3; ftype="C++ code";} IF (!strcmp(extension,".nes")) {fnum = 20; ftype="Cartridge";} IF (!strcmp(extension,".img")) || (!strcmp(extension,".ima")) {fnum = 21; ftype="Image";} IF (!strcmp(extension,".dll")) || (!strcmp(extension,".obj")) {fnum = 22; ftype="Library";} - IF (!strcmp(extension,".sys")) || (!strcmp(extension,".ocx")) fnum = 8; + IF (!strcmp(extension,".sys")) || (!strcmp(extension,".ocx")) || (!strcmp(extension,".drv")) fnum = 8; IF (!strcmp(extension,".ini")) || (!strcmp(extension,"conf")) {fnum = 4; ftype="Config";} IF (!strcmp(extension,".htm")) || (!strcmp(extension,"html")) {fnum = 2; ftype="Web-page";} //text IF (!strcmp(extension,".txt")) || (!strcmp(extension,".doc")) || - (!strcmp(extension,".rtf")) {fnum = 1; ftype="Text";} + (!strcmp(extension,".rtf")) || (!strcmp(extension,".pdf")) {fnum = 1; ftype="Text";} //изображения IF (!strcmp(extension,".gif")) || (!strcmp(extension,".bmp")) || (!strcmp(extension,".tga")) || (!strcmp(extension,".pcx")) || @@ -102,16 +102,17 @@ dword Put_icon(dword extension, yy) (!strcmp(extension+1,".7z")){fnum = 15; ftype="Archive";} //audio IF (!strcmp(extension,".mp3")) {fnum = 12; ftype="Music";} - IF (!strcmp(extension,".wav")) || (strcmp(extension,".mid")==0) || - (!strcmp(extension,"midi")) || (strcmp(extension,".ogg")==0) {fnum = 12; ftype="Audio";} + IF (!strcmp(extension,".wav")) || (!strcmp(extension,".mid")) || + (!strcmp(extension,"midi")) || (!strcmp(extension,".ogg")) || + (!strcmp(extension,".wma")) {fnum = 12; ftype="Audio";} //video IF (!strcmp(extension,".avi")) || (!strcmp(extension,".flv")) || (!strcmp(extension,".mpg")) || - (!strcmp(extension,".wmv")) {fnum = 14; ftype="Video";} + (!strcmp(extension,".wmv")) || (!strcmp(extension,".mov")) {fnum = 14; ftype="Video";} //папки - IF (!strcmp(extension,"")) { fnum=16; WriteText(onLeft(140,0),yy+4,0x80,0,extension,0);} + IF (!strcmp(extension,"")) { fnum=16; WriteText(onLeft(145,0),yy+4,0x80,0,extension,0);} IF (!strcmp(extension,"..")) fnum=17; // - PutPaletteImage(fnum*16*15+#ficons,16,15,200,yy,#ficons_pal); - WriteText(onLeft(155,0),yy+4,0x80,0,ftype,0); + PutPaletteImage(fnum*16*15+#ficons,16,15,195,yy,#ficons_pal); + WriteText(onLeft(160,0),yy+4,0x80,0,ftype,0); return fnum; } diff --git a/programs/fs/Eolite/trunk/include/LVabout.c-- b/programs/fs/Eolite/trunk/include/sorting.h-- similarity index 55% rename from programs/fs/Eolite/trunk/include/LVabout.c-- rename to programs/fs/Eolite/trunk/include/sorting.h-- index 400c77d594..04f0a9e262 100644 --- a/programs/fs/Eolite/trunk/include/LVabout.c-- +++ b/programs/fs/Eolite/trunk/include/sorting.h-- @@ -1,44 +1,4 @@ -#include "imgs\logo.txt" - -void authors() -{ - loop() - { - switch(WaitEvent()) - { - CASE evButton: ExitProcess(); - CASE evKey: IF (GetKey()==27) ExitProcess(); break; - CASE evReDraw: - WindowRedrawStatus(1); - DefineAndDrawWindow(500,200,181,256,0x04,0x10EFEBEF,0,0,"About Eolite"); - DrawBar(5,0,172,50,0x8494C4); //голубое сзади - PutPaletteImage(#logo,85,85,48,7,#logo_pal); - WriteText(32,100,0x80,0xBF40BF,"Eolite v0.97.2 beta7",0); - WriteText(60,120,0x80,0,"Developers:",0); - WriteText(44,130,0x80,0,"Leency & Veliant",0); - WriteText(35,140,0x80,0,"Lrz, Diamond, Nable",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,0xE4DFE1, "Close"); - WindowRedrawStatus(2); - } - } -} - - -dword ConvertSize(dword bytes) -{ - char size_prefix[7], temp[3]; - IF (bytes>=1073741824) copystr(" Gb",#temp); - ELSE IF (bytes>=1048576) copystr(" Mb",#temp); - ELSE IF (bytes>=1024) copystr(" Kb",#temp); - ELSE copystr(" b ",#temp); - WHILE (bytes>1023) bytes/=1024; - copystr(IntToStr(bytes),#size_prefix); - copystr(#temp,#size_prefix+strlen(#size_prefix)); - EAX=#size_prefix; -} - +//Быстрая сортировка. Leency 2008. GPL license. void Sort_by_Size(int a, b) // для первого вызова: a = 0, b = <элементов в массиве> - 1 { diff --git a/programs/fs/Eolite/trunk/lib/IPC.H-- b/programs/fs/Eolite/trunk/lib/IPC.H-- deleted file mode 100644 index a0f9677688..0000000000 --- a/programs/fs/Eolite/trunk/lib/IPC.H-- +++ /dev/null @@ -1,186 +0,0 @@ -//stuff for loading images via MeView via IPC by Nable. 2008 -//Last changed 13.11.2008 - -inline fastcall void registerIPCbuffer(dword ECX, dword EDX) -//ecx - pointer to buffer, edx - buffer size -{ - EAX=60; - EBX=1; - $int 0x40 -} - -inline fastcall void build_param_string(dword ESI, dword EDI) -//first parameter - pointer to filename string, second - pointer to -//the output area for commandline for MeView -proc_info _p_info; -{ - _p_info.GetInfo(SelfInfo); - EBX = _p_info.ID; - EAX = 'NCPI'; //'IPCN' in reversed byte order - $STOSD - ECX = 8; - -___NEW_SYMBOL_OF_PID: - $ROL EBX,4 - - EAX = EBX; - EAX &= 0xF; - EAX += '0'; - - $CMP AL,'9' - $JBE ___NEW_SYMBOL_OF_PID_PRINT - $ADD AL,7 //('A'-'0'-10) -___NEW_SYMBOL_OF_PID_PRINT: - $STOSB - $LOOP ___NEW_SYMBOL_OF_PID - -___NEW_SYMBOL_OF_PATH_COPY: - $LODSB - $STOSB - $OR AL,AL - $JNE ___NEW_SYMBOL_OF_PATH_COPY -} - -char _Path2MeView[]="/sys/mv"; - -inline int RunMV(char* parameters) -f70 _run_struct; -{ - _run_struct.func = 7; - _run_struct.param1 = 0; - _run_struct.param2 = parameters; - _run_struct.param3 = - _run_struct.param4 = - _run_struct.rezerv = 0; - _run_struct.name = #_Path2MeView; - - EAX=70; - EBX=#_run_struct; - $int 0x40 - //EAX (return code) will contain positive PID of new process or negative error code. -} - - -int loadimage_viaIPC(char* file_name_to_load, int initial_values) -//really it must be IMAGE_INFO* initial_values, but compiler rejected -//this, so I had to use 'int initial_values' -char param_string[255]; -unsigned int _FrameCountTemp; -int temp0; //scratch variable -int came_size; //sizeof data that came. It's used to shrink unneeded IPC data -//added by Nable 13.11.2008 3.36am (begin) -int MVsPID; //no comments -int MVsSlot; //no comments -proc_info _p_info; //this structure will be used to test if MV is alive -//added by Nable 13.11.2008 3.36am (end) -{ - int pIPCbuffer = malloc(64); //IPC buffer for the first message can be - //rather small but >= 8+8+24 - - /*Here you can add error checking code, i.e. if(!pIPCbuffer) - { ErrorExit("OUT OF MEMORY!"); }; */ - - registerIPCbuffer(pIPCbuffer,64); - DSDWORD[pIPCbuffer+4]=8; //at +4 in IPC buffer is a relative pointer to free place - - build_param_string(file_name_to_load, #param_string); - - DSDWORD[pIPCbuffer]=0; //unlock the buffer - - SetEventMask(01000000b); // 1 << (evIPC-1) -//13.11.2008 3.45am Nable's fixes (begin1) - MVsPID = RunMV(#param_string); //you can use here your function but don't forget - //about parameters (param_string). - MVsSlot = PIDtoSlot(MVsPID); - - WHILE(!(WaitEventTimeout(100))){ - //we have only one event - evIPC so return value may be 0 or evIPC but if received 0 it can mean - //either MV terminated silently or it just hasn't done the work and we should wait. Test for it - _p_info.GetInfo(MVsSlot); - IF((_p_info.status_slot > 2)||(_p_info.ID != MVsPID)) return 0; - } -//13.11.2008 4.26am Nable's fixes ( end1) - -//else we got the message. Process it. - DSDWORD[pIPCbuffer] |= -1; //lock the buffer - - //the first dword of the message is frame count - _FrameCountTemp = DSDWORD[pIPCbuffer+16]; //note that data of the first - //message is located at offset 16 in IPC buffer; - - IF(_FrameCountTemp <= 1) //see docs - { - ESI = pIPCbuffer+16+12; - EDI = initial_values; //offset of CurrentImage structure - - //Left and top corner's coords (not used in many cases but who knows?) - $MOVSD - //Width and height - $MOVSD - //bpp - $LODSD - $movzx eax,ax - CurrentImage.BitsPerPixel = EAX; - } - //see docs - came_size = DSDWORD[pIPCbuffer+24]; //amount of useful data - temp0 = came_size + 4096; //+4096 - some reserve - realloc(temp0+4096, pIPCbuffer); //+4096 - some reserve - registerIPCbuffer(pIPCbuffer, temp0); //re-register IPC buffer with a new size - - DSDWORD[pIPCbuffer+4]=8; //delete first message, at +4 in IPC buffer is a - //relative pointer to free place - - DSDWORD[pIPCbuffer]=0; //unlock the buffer to receive second msg - -//13.11.2008 4.26am Nable's fixes ( begin2) - WHILE(!(WaitEventTimeout(100))){ - //we have only one event - evIPC so return value may be 0 or evIPC but if received 0 it can mean - //either MV terminated silently or it just hasn't done the work and we should wait. Test for it - _p_info.GetInfo(MVsSlot); - IF((_p_info.status_slot > 2)||(_p_info.ID != MVsPID)) return 0; - } -//13.11.2008 4.26am Nable's fixes ( end2) - -//if we are here, then we received the second message. if FrameCount==1 then -//it's a pure image data (if BitsPerPixel==15, 16, 24 or 32) or -//(dword)sizeof(palette[]) then palette[] and then the image. -//Parse it as you like, here's my way: - - registerIPCbuffer(pIPCbuffer, 0); // there are no function 'unregister - //IPC buffer' in Kolibri - so I have to use 'dark power' - - //shrink unneeded IPC data - ECX = came_size; - $SHR ECX,2 - ECX++; //ECX = number of useful dwords - EDI = pIPCbuffer; - ESI = EDI + 16; - $CLD - $REP $MOVSD - - //now we must interpret second message - EDI = initial_values; - IF(_FrameCountTemp <= 1) - { - IF(DSDWORD[EDI+24] > 8) //CurrentImage.BitsPerPixel - { - DSDWORD[EDI+20] = 0; //CurrentImage.pPalette=0 - DSDWORD[EDI+16] = pIPCbuffer; //CurrentImage.StartOfImage=pIPCbuffer - } - ELSE - { - EAX = pIPCbuffer + 4; - DSDWORD[EDI+20] = EAX; //CurrentImage.pPalette=EAX - EAX += DSDWORD[EAX-4]; - DSDWORD[EDI+16] = EAX; //CurrentImage.StartOfImage = EAX; - }; - } - ELSE - { - GetNthImageInfo(pIPCbuffer,EDI,0); - }; - - EBX = _FrameCountTemp; - return pIPCbuffer; -} diff --git a/programs/fs/Eolite/trunk/lib/Nable_lib.H-- b/programs/fs/Eolite/trunk/lib/Nable_lib.H-- deleted file mode 100644 index 56289f291a..0000000000 --- a/programs/fs/Eolite/trunk/lib/Nable_lib.H-- +++ /dev/null @@ -1,119 +0,0 @@ -/*------------------------------------------------------------------------------- -C-- base library for Kolibri, Nable's variant. --------------------------------------------------------------------------------*/ - -inline fastcall dword WaitEventTimeout(dword EBX){ - EAX = 23; // wait here for event - $int 0x40 -} - -//------------------------------------------------------------------------------- -struct IMAGE_INFO{ - word Left,Top,Width,Height; //+0, +2, +4, +6 - dword Delay,Displacement,StartOfImage; //+8, +12, +16 - dword pPalette,BitsPerPixel; //+20, +24 -}; - -IMAGE_INFO CurrentImage; - -//------------------------------------------------------------------------------- -fastcall int GetNthImageInfo(dword ESI, EDI, ECX) -//esi - pointer to structure with multiple images -//edi - pointer to structure of type IMG_INFO -//ecx - CurrentFrameNum -//returns 0 if error -int pCurrentImage; -{ - pCurrentImage = EDI; - EAX = 0; - EBX = ESI; - $jecxz _END_LOOP -_1: - $TEST ESI,ESI - $JE __EXIT - - //MOV ESI,[ESI] - c-- refused to compile it - $DB 8Bh - $DB 36h - - $ADD ESI,EBX - $loop _1 -_END_LOOP: - $LODSD - //left and top - $MOVSD - //width and height - $MOVSD - //delay - $MOVSD - //displacement - $MOVSD - - EDI = pCurrentImage; - - $LODSD - $TEST EAX,EAX - $JS _NO_PALETTE - $ADD EAX,EBX - - //Stay calm, this pervertion is only because of uncomplete - //pointers' support in C-- - - //CurrentImage.pPalette=ESI; - DSDWORD[EDI+20] = ESI; - - //CurrentImage.StartOfImage=EAX; - DSDWORD[EDI+16] = EAX; - - //CurrentImage.BitsPerPixel=8; - DSDWORD[EDI+24] = 8; - GOTO __EXIT; - -_NO_PALETTE: - $NEG EAX - //CurrentImage.BitsPerPixel=EAX; - DSDWORD[EDI+24] = EAX; - - //CurrentImage.pPalette=0; - DSDWORD[EDI+20] = 0; - - //CurrentImage.StartOfImage=ESI; - DSDWORD[EDI+16] = ESI; -__EXIT: -} - -//As a parameter you should send PID of needed slot -//return value will be 0 if not found -inline fastcall int PIDtoSlot(dword EDX) -{ - proc_info _p_info; - EBX=#_p_info; //pointer to the structure - ECX=2;//slot 1 is system - WHILE(ECX<256){ - EAX=9; - $INT 0x40 - IF(_p_info.ID == EDX) return ECX; - ECX++; - } - return 0; -} - - -void fastcall DrawImage(dword EBX, EDX) -{ - $PUSHAD - EAX = 65; - EBP = 0; - EDI = DSDWORD[EBX+20]; - ESI = DSDWORD[EBX+24]; - $ROR EDX,16 - EDX += DSDWORD[EBX]; - $ROR EDX,16 - ECX = DSDWORD[EBX+4]; - $ROR ECX,16 - EBX = DSDWORD[EBX+16]; - $INT 0x40 - $POPAD -} - - diff --git a/programs/fs/Eolite/trunk/lib/edit_box_lib.h-- b/programs/fs/Eolite/trunk/lib/edit_box_lib.h-- index 15968b60b6..c66a4398d0 100644 --- a/programs/fs/Eolite/trunk/lib/edit_box_lib.h-- +++ b/programs/fs/Eolite/trunk/lib/edit_box_lib.h-- @@ -28,7 +28,7 @@ text_color, max, text, flags, size, pos, offset, cl_curs_x, cl_curs_y, shift, sh -int load_dll(EAX) +int load_editbox_lib(EAX) { //set mask $mov eax,40 diff --git a/programs/fs/Eolite/trunk/lib/file_system.h-- b/programs/fs/Eolite/trunk/lib/file_system.h-- index 870edb7a6b..0cf3ddb6ab 100644 --- a/programs/fs/Eolite/trunk/lib/file_system.h-- +++ b/programs/fs/Eolite/trunk/lib/file_system.h-- @@ -1,3 +1,18 @@ +#define ac97snd "AC97SND" +#define desktop "desktop" +#define fce "/sys/games/fce" +#define graph "graph" +#define htmlv "/sys/network/HTMLv" +#define jpegview "JpegView" +#define kvid "/sys/kvid" +#define life2 "/sys/demos/life2" +#define midamp "MIDAMP" +#define mv "MV" +#define pngview "pngview" +#define rtfread "RtfRead" +#define tinypad "TinyPad" +#define view3ds "/sys/demos/3d/view3ds" + struct f70{ dword func; dword param1; @@ -8,6 +23,21 @@ struct f70{ 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]; +}; + //////////////////////////// // Прочитать файл // //////////////////////////// @@ -139,67 +169,38 @@ inline fastcall dword CopyFile(dword EBX,ECX) } -/*char *extension[25]={".skn",".avi",".htm","html",".3ds",".lif",".cvs",".mp3", -".wav",".mid","midi",".rtf",".txt",".inc",".ini",".dat",".asm",".gif",".bmp", -".tga",".pcx",".png",".jpg","jpeg", 0}; //массив указателей -char *prog_path[25]={"desktop","/sys/kvid","/sys/network/HTMLv","/sys/network/HTMLv", -"/sys/demos/3d/view3ds","/sys/demos/life2","graph","AC97SND","AC97SND","MIDAMP", -"MIDAMP","RtfRead","TinyPad","TinyPad","TinyPad","TinyPad","TinyPad","MV","MV", -"MV","MV","@rcher","JpegView","JpegView", 0}; - - void Run_File(dword fpath) { - byte i; - dword file_ext[4]=fpath+strlen(fpath)-4; - FOR(i=0; extension[i]!=0; i++) IF (strcmp(file_ext,extension[i])==0) - { - Run_Program(prog_path[i], fpath); - return; - } - Run_Program(fpath, ""); -}*/ - - -void Run_File(dword fpath) -{ - dword extension[4], fparam[256]; + 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")) copystr("/sys/kvid",fpath); - IF (!strcmp(#extension,".mpg")) copystr("/sys/kvid",fpath); - IF (!strcmp(#extension,".htm")) copystr("/sys/network/HTMLv",fpath); - IF (!strcmp(#extension,"html")) copystr("/sys/network/HTMLv",fpath); - //IF (strcmp(#extension,".htm")==0) || (strcmp(#extension,"html")==0) copystr("/hd0/2/Programs/QIP/Users/419114984/RcvdFiles/313257308_Veliant/browser/HTMLv",fpath); - IF (!strcmp(#extension,".3ds")) copystr("/sys/demos/3d/view3ds",fpath); - IF (!strcmp(#extension,".lif")) copystr("/sys/demos/life2",fpath); - IF (!strcmp(#extension,".cvs")) copystr("graph",fpath); - IF (!strcmp(#extension,".nes")) copystr("/sys/games/fce",fpath); - //audio - IF (!strcmp(#extension,".mp3")) copystr("AC97SND",fpath); - IF (!strcmp(#extension,".wav")) copystr("AC97SND",fpath); - IF (!strcmp(#extension,".mid")) copystr("MIDAMP",fpath); - IF (!strcmp(#extension,"midi")) copystr("MIDAMP",fpath); - //text - IF (!strcmp(#extension,".rtf")) copystr("RtfRead",fpath); - IF (!strcmp(#extension,".txt")) copystr("TinyPad",fpath); - IF (!strcmp(#extension,".inc")) copystr("TinyPad",fpath); - IF (!strcmp(#extension,".ini")) copystr("TinyPad",fpath); - IF (!strcmp(#extension,".dat")) copystr("TinyPad",fpath); - IF (!strcmp(#extension,".asm")) copystr("TinyPad",fpath); - IF (!strcmp(#extension,".cpp")) copystr("TinyPad",fpath); - //изображения - IF (!strcmp(#extension,".gif")) copystr("MV",fpath); //GifView,MenuAnimage - IF (!strcmp(#extension,".bmp")) copystr("MV",fpath); //BmpMenu1,MenuAnimage - IF (!strcmp(#extension,".tga")) copystr("MV",fpath); - IF (!strcmp(#extension,".pcx")) copystr("MV",fpath); - IF (!strcmp(#extension,".cur")) copystr("MV",fpath); - IF (!strcmp(#extension,".ico")) copystr("MV",fpath); - IF (!strcmp(#extension,".png")) copystr("pngview",fpath); - IF (!strcmp(#extension,".jpg")) copystr("JpegView",fpath); - IF (!strcmp(#extension,"jpeg")) copystr("JpegView",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 не изменился, то это таки, наверное, прога, параметров нет. - RunProgram(fpath, #fparam); //запуск! + IF (needrun == 1) RunProgram(fpath, #fparam); //запуск! } diff --git a/programs/fs/Eolite/trunk/lib/kolibri.h-- b/programs/fs/Eolite/trunk/lib/kolibri.h-- index 3df248d1fd..b805fb2a11 100644 --- a/programs/fs/Eolite/trunk/lib/kolibri.h-- +++ b/programs/fs/Eolite/trunk/lib/kolibri.h-- @@ -46,7 +46,7 @@ void mouse::get() $shr eax, 16 $and ebx,0x0000FFFF x = EAX; - y = EBX-skin_width; + y = EBX; EAX = 37; EBX = 2; $int 0x40 @@ -66,21 +66,6 @@ void mouse::get() vert = EBX; } -//--------------------------------------------------------------------------- -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]; -}; //--------------------------------------------------------------------------- struct proc_info{ dword use_cpu; @@ -148,6 +133,13 @@ void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword $int 0x40 } +inline fastcall dword CreateThread(dword ECX,EDX) +{ + EAX = 51; + EBX = 1; + $int 0x40 +} + inline fastcall void DrawTitle(dword ECX){ EAX = 71; EBX = 1; @@ -221,50 +213,88 @@ f3: } -inline fastcall int strcmp(dword EAX,EBX) +inline fastcall int strcmp(ESI, EDI) { - #speed - ESI=EAX; - EBX--; -TOP: - EBX++; - $LODSB - $CMP AL,0 - $JE HERE - $CMP DSBYTE[EBX],AL - $JE TOP -HERE: - AL-=DSBYTE[EBX]; - return AL; - #codesize + loop() + { + 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 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: + } } inline fastcall dword ChangeCase(dword EDX) { - #speed AL=DSBYTE[EDX]; IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f; - EDX++; + IF (AL>=160) && (AL<=175) DSBYTE[EDX] = AL - 32; //а-п + IF (AL>=224) && (AL<=239) DSBYTE[EDX] = AL - 80; //а-п do{ - AL=DSBYTE[EDX]; - IF(AL>='A')&&(AL<='Z')DSBYTE[EDX]=AL|0x20; 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); - #codesize } + //------------------------------------------------------------------------------ inline fastcall void PutPixel(dword EBX,ECX,EDX){ EAX=1; - ECX+=skin_width; $int 0x40 } void DefineButton(dword x,y,w,h,EDX,ESI){ EAX = 8; EBX = x<<16+w; - ECX = skin_width+y<<16+h; + ECX = y<<16+h; $int 0x40 } @@ -278,7 +308,7 @@ inline fastcall void DeleteButton(dword EDX) void WriteText(dword x,y,byte fontType, dword color, EDX, ESI) { EAX = 4; - EBX = x<<16+skin_width+y; + EBX = x<<16+y; ECX = fontType<<24+color; $int 0x40; } @@ -288,26 +318,23 @@ void DrawBar(dword x,y,w,h,EDX) #speed EAX = 13; EBX = x<<16+w; - ECX = skin_width+y<<16+h; + ECX = y<<16+h; $int 0x40 #codesize } -void DrawRegion(dword x,y,width,height,color1) +void DrawRegion_3D(dword x,y,width,height,color1,color2) { - DrawBar(x,y,width,1,color1); //Ї®«®б  Ј®а ᢥаег - DrawBar(x,y+height,width,1,color1); //Ї®«®б  Ј®а б­Ё§г - DrawBar(x,y,1,height,color1); //Ї®«®б  ўҐаег б«Ґў  - DrawBar(x+width,y,1,height+1,color1); //Ї®«®б  ўҐаег бЇа ў  + 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(x,y,width,height,0x94AECE); - DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //Ї®«®б  Ј®а ЎҐ« п - DrawBar(x+1,y+height-1,width-2,1,0xC7C7C7); //ўҐ­¬ ўҐаў - DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //Ї®«®б  ўҐаў ЎҐ« Ї - DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //ўҐ­¬ ўҐаў + 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,y,width,height,id+BT_HIDE,0xEFEBEF); //Є­®ЇЄ  WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0); @@ -317,7 +344,7 @@ void PutImage(dword EBX,w,h,x,y) { EAX = 7; ECX = w<<16+h; - EDX = x<<16+y+skin_width; + EDX = x<<16+y; $int 0x40 } @@ -325,7 +352,7 @@ void PutPaletteImage(dword EBX,w,h,x,y, EDI) { EAX = 65; ECX = w<<16+h; - EDX = x<<16+y+skin_width; + EDX = x<<16+y; ESI = 8; EBP = 0; $int 0x40