Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3444 → Rev 3443

/programs/cmm/eolite/Eolite.c
19,13 → 19,15
#include "imgs\toolbar.txt"
#include "imgs\left_p.txt"
 
//for OpenDir
#define ONLY_SHOW 0
#define WITH_REDRAW 1
#define ONLY_OPEN 2
 
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
 
#define TITLE "Eolite File Manager v1.88"
#define ABOUT_TITLE "Eolite v1.88"
#define TITLE "Eolite File Manager v1.81"
#define ABOUT_TITLE "Eolite v1.81"
dword col_work = 0xE4DFE1;
dword col_border = 0x9098B0; //A0A0B8; //0x819FC5;
dword col_border = 0x819FC5;
dword col_padding = 0xC8C9C9;
dword col_selec = 0x94AECE;
dword col_lpanel = 0x00699C;
40,8 → 42,10
path[4096],
file_path[4096],
file_name[256],
copy_file[4096],
temp[4096];
byte
cut_active=0,
rename_active=0,
del_active=0,
show_dev_name=1,
67,11 → 71,10
#include "include\left_panel.h"
#include "include\history.h"
#include "include\file_menu.h"
#include "include\copypaste.h"
 
void main()
{
word key, id, can_show, can_select, m_selected;
word key, id, can_show, can_select;
 
files.line_h=18;
mem_Init();
92,14 → 95,13
case evMouse:
IF (del_active) break;
id=GetProcessSlot(Form.ID);
IF (id!=GetActiveProcess()) || (Form.status_window>2) break;
IF (id<>GetActiveProcess()) || (Form.status_window>2) break;
IF (rename_active) { edit_box_mouse stdcall(#edit2); break; }
m.get();
 
if (m.x > files.x) && (m.x < files.x + files.w) && (m.y > files.y) && (m.y < files.y+files.h) && (!can_select)
if (m.x > files.x) && (m.x < files.x + files.w) && (m.y > files.y) && (m.y < files.y+files.h)
{
m_selected = m.y - 57 / files.line_h;
if (m.lkm) can_select = 1;
if (m.pkm)
{
114,8 → 116,7
can_select = 0;
if (m.y<57) break;
id = m.y - 57 / files.line_h;
if (id!=m_selected) {can_show=0; break;}
if (files.current!=id) List_Current(id-files.current);
if (files.current!=id) FileList_ReDraw(id-files.current);
else Open();
};
// } select/open file
126,7 → 127,7
can_show = 0;
if (m.y<57) break;
SwitchToAnotherThread();
CreateThread(#FileMenu,#menu_stak);
CreateThread(#FileMenu,#stak2);
break;
}
// } file menu
177,7 → 178,7
files.first = m.y -j -57 * files.count;
files.first /= onTop(22,57);
IF (files.visible+files.first>files.count) files.first=files.count-files.visible;
IF (id!=files.first) List_ReDraw();
IF (id<>files.first) List_ReDraw();
}
break;
//Button pressed-----------------------------------------------------------------------------
207,13 → 208,11
Dir_Up();
break;
case 24: //cut
Copy(#file_path, NOCUT);
break;
key=24;
case 25: //copy
Copy(#file_path, CUT);
break;
goto CTRLC_MARK;
case 26: //paste
CreateThread(#Paste,#copy_stak);
Paste();
break;
case 31...33: //sort
IF(sort_num==1) DrawFilledBar(onLeft(192,168)/2+210,42,6,10);
223,16 → 222,16
Open_Dir(#path,WITH_REDRAW);
break;
case 50...60: //Actions
FnProcess(id-50);
ActionsProcess(id-50);
break;
case 100...120:
DEVICE_MARK:
DrawRectangle(17,id-100*16+74,159,16, 0); //auaaeaiea
DrawRectangle3D(17,id-100*16+74,159,16, 0, 0); //auaaeaiea
strcpy(#path, #disk_list[id-100].Item);
files.first=files.current=0;
Open_Dir(#path,WITH_REDRAW);
Open_Dir(#path,1);
pause(5);
DrawRectangle(17,id-100*16+74,159,16, 0xFFFFFF);
DrawRectangle3D(17,id-100*16+74,159,16, 0xFFFFFF, 0xFFFFFF);
break;
case 130...160:
tmp_disk_del_param[1]=disk_list[id-130].Item[4];
254,7 → 253,7
IF (key==027) Del_File(false);
break;
}
IF (edit2.flags!=64) && (key!=13) && (key!=27)
IF (edit2.flags<>64) && (key<>13) && (key<>27)
{
EAX=key<<8;
edit_box_key stdcall (#edit2);
280,13 → 279,14
RunProgram("/sys/File Managers/Eolite", #path);
break;
case 024: //Ctrl+X
Copy(#file_path, CUT);
break;
case 003: //Ctrl+C
Copy(#file_path, NOCUT);
CTRLC_MARK:
IF (itdir) break;
strcpy(#copy_file, #file_path);
IF (key==24) cut_active=1; ELSE cut_active=0;
break;
case 022: //Ctrl+V
CreateThread(#Paste,#copy_stak);
Paste();
break;
case 027: //Esc
IF (rename_active==1) ReName(false);
296,10 → 296,10
Open();
break;
case 178: //up
List_Current(-1);
FileList_ReDraw(-1);
break;
case 177: //down
List_Current(1);
FileList_ReDraw(1);
break;
case 180: //home
files.first=0;
312,16 → 312,16
List_ReDraw();
break;
case 183: //Page Down
List_Current(files.visible-1);
FileList_ReDraw(files.visible-1);
break;
case 184: //Page Up
List_Current(-files.visible+1);
FileList_ReDraw(-files.visible+1);
break;
case 182: //del
Del_Form();
break;
case 050...059: //F1-F10
FnProcess(key-49);
ActionsProcess(key-49);
break;
default:
for (i=files.current+files.first+1; i<files.count; i++)
329,7 → 329,7
strcpy(#temp, file_mas[i]*304+buf+72);
IF (temp[0]==key) || (temp[0]==key-32)
{
List_Current(i-files.current-files.first);
FileList_ReDraw(i-files.current-files.first);
break;
}
}
336,33 → 336,32
}
break;
case evReDraw:
draw_window();
}
}
 
 
void draw_window()
{
DefineAndDrawWindow(40,20,550,500,0x73,col_work,TITLE);
GetProcessInfo(#Form, SelfInfo);
if (Form.status_window>2) return;
if (Form.status_window>2) break;
files.SetSizes(192, 57, onLeft(192,27), onTop(57,6), disc_num*16+195,files.line_h);
if (Form.height < files.min_h) MoveSize(OLD,OLD,OLD,files.min_h);
if (Form.width<480) MoveSize(OLD,OLD,480,OLD);
GetProcessInfo(#Form, SelfInfo); //if win_size changed
draw_window();
}
}
 
 
inline fastcall void draw_window()
{
//toolbar
PutPaletteImage(#toolbar,246,34,0,0,8,#toolbar_pal);
DrawBar(127, 8, 1, 25, col_border);
for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,col_work);
for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,col_work);
DrawBar(246,0,onLeft(246,60),12, col_work); //upper editbox
DrawBar(246,29,onLeft(246,60),5,col_work); //under editbox
DrawRectangle(246,12,onLeft(66,246),16,col_border);
DefineButton(onLeft(34,0),6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
DrawBar(246,0,onLeft(246,60),12, col_work); //ôîí íàä ïîëîñîé àäðåñà
DrawBar(246,29,onLeft(246,60),5,col_work); //ôîí ïîä ïîëîñîé àäðåñà
DrawRectangle3D(246,12,onLeft(66,246),16,col_border,col_border);
DefineButton(onLeft(34,0),6,27,28,51+BT_HIDE+BT_NOFRAME,col_work); //about
PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
//main rectangles
DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),col_border);
DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg
DrawRectangle3D(1,40,Form.cwidth-3,onTop(46,0),col_border,col_border);
DrawRectangle3D(0,39,Form.cwidth-1,onTop(44,0),col_palette[4],col_palette[4]); //bg
for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);
DrawLeftPanel();
//ListBox
374,7 → 373,7
DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,col_work,"\x19");
Open_Dir(#path,ONLY_SHOW);
if (del_active) Del_Form();
if (rename_active) FnProcess(2);
if (rename_active) ActionsProcess(2);
}
 
 
388,7 → 387,7
}
 
 
void List_Current(int cur)
void FileList_ReDraw(int cur)
{
if (cur<=0) //up
{
441,6 → 440,8
}
 
 
 
 
void List_ReDraw()
{
int paint_y;
449,7 → 450,7
if (files.count-files.first<files.visible) || (files.current>files.visible-1)
{ files.first=files.count-files.visible; files.current=files.visible-1; }
 
for (j=0; j<files.visible; j++) if (files.current!=j) Line_ReDraw(0xFFFFFF, j); else Line_ReDraw(col_selec, files.current);
for (j=0; j<files.visible; j++) if (files.current<>j) Line_ReDraw(0xFFFFFF, j); else Line_ReDraw(col_selec, files.current);
//in the bottom
paint_y = j * files.line_h + files.y;
DrawBar(files.x,paint_y,files.w,onTop(paint_y,6),0xFFFFFF);
458,7 → 459,6
Scroll();
}
 
 
void Line_ReDraw(dword color, filenum){
dword text_col=0, name_len=0, y=filenum*files.line_h+57;
DrawBar(192,y,3,files.line_h,color);
480,7 → 480,7
else
Put_icon("<DIR>", files.line_h/2-7+y, color);
if (TestBit(ESDWORD[off-40],1)) || (TestBit(ESDWORD[off-40],2)) text_col=0xA6A6B7; //system or hiden?
if (color!=0xFFFfff)
if (color<>0xFFFfff)
{
itdir=TestBit(ESDWORD[off-40], 4);
strcpy(#file_name, off);
502,16 → 502,20
}
 
 
void Open_Dir(dword dir_path, redraw){
int errornum, maxcount;
void Open_Dir(dword temp_, redraw){
int errornum, count;
char path_[4096],
somelen=strlen(temp_)-1;
 
if (redraw!=ONLY_SHOW)
if (redraw<>ONLY_SHOW)
{
if (ESBYTE[dir_path+1]!='\0') ESBYTE[dir_path+strlen(dir_path)-1] = '\0';
strcpy(#path_, temp_);
if (somelen) path_[somelen]=NULL;
if (buf) free(buf);
errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT);
if (ESBYTE[dir_path+1]!='\0') chrcat(dir_path, '/');
if (errornum)
buf = malloc(32);
errornum=ReadDir(0, buf, #path_);
if (errornum<>0)
{
HistoryPath(ADD_NEW_PATH);
GoBack();
518,25 → 522,32
Write_Error(errornum);
return;
}
maxcount = sizeof(file_mas)/sizeof(dword)-1;
if (files.count>maxcount) files.count = maxcount;
files.count = ESDWORD[buf+8];
buf = realloc(buf, files.count * 304 + 32);
ReadDir(files.count, buf, #path_);
files.count=EBX;
count = sizeof(file_mas)/sizeof(dword)-1;
if (files.count>count) files.count=count;
}
if (files.count!=-1)
if (files.count<>-1)
{
KEdit();
HistoryPath(ADD_NEW_PATH);
files.visible = files.h / files.line_h;
IF (!strcmp(".",buf+72)) {files.count--; memmov(buf,buf+304,files.count*304);} //oeeuo?oai yeaiaio "."
files.visible=onTop(6,57)/files.line_h;
IF (files.count < files.visible) files.visible = files.count;
IF (sort_num==1) WriteText(Form.width+60/2,45,0x80,col_border,"\x19");
IF (sort_num==2) WriteText(Form.width-115,45,0x80,col_border,"\x19");
IF (sort_num==3) WriteText(Form.width-44,45,0x80,col_border,"\x19");
IF (redraw!=ONLY_SHOW) Sorting();
IF (redraw!=ONLY_OPEN) List_ReDraw();
IF (sort_num==1) WriteText(Form.width+60/2,45,0x80,0x4E78AC,"\x19");
IF (sort_num==2) WriteText(Form.width-115,45,0x80,0x4E78AC,"\x19");
IF (sort_num==3) WriteText(Form.width-44,45,0x80,0x4E78AC,"\x19");
IF (redraw<>ONLY_SHOW) Sorting();
IF (redraw<>ONLY_OPEN) List_ReDraw();
}
IF (files.count==-1) && (redraw!=ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();}
IF (files.count==-1) && (redraw<>ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();}
}
 
 
 
inline Sorting()
{
dword k=0, l=1;
566,14 → 577,13
IF (sort_num==2) Sort_by_Type(k,files.count-1);
IF (sort_num==3) Sort_by_Size(k,files.count-1);
//".." should be first
IF (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")!=0)
FOR(k--; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) {file_mas[k]><file_mas[0]; break;}
IF (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")<>0) FOR(k--; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) file_mas[k]><file_mas[0];
}
 
 
void Del_Form()
{
int dform_x = files.w - 200 / 2 + files.x;
int dform_x=Form.width/2-13;
//oeia ieii
if (!files.count) return;
DrawFlatButton(dform_x,160,200,80,0,col_work, ""); //oi?ia
589,6 → 599,7
ESI = 24;
WriteText(dform_x+20,190,0,0,#file_name); //ieoai eiy
}
//eiiii?ee
DrawFlatButton(dform_x+20,208,70,20,301,0xFFB6B5,"Yes");
DrawFlatButton(dform_x+111,208,70,20,302,0xC6DFC6,"No");
del_active=1;
601,7 → 612,7
IF (dodel==true)
{
del_rezult = DeleteFile(#file_path);
IF (del_rezult)
IF (del_rezult<>0)
{
Write_Error(del_rezult);
IF ( itdir) ShowMessage("Error. Folder isn't empty.");
610,10 → 621,40
}
del_active=0;
DeleteButton(301); DeleteButton(302);
Open_Dir(#path,WITH_REDRAW);
Open_Dir(#path,1);
}
 
void Paste()
{
char new_copy_path[4096];
int copy_rezult;
 
IF (!copy_file) return;
strcpy(#new_copy_path, #path);
strcat(#new_copy_path, #copy_file+strrchr(#copy_file,'/'));
if (!strcmp(#copy_file,#new_copy_path))
{
strcpy(#new_copy_path, #path);
strcat(#new_copy_path, "new_");
strcat(#new_copy_path, #copy_file+strrchr(#copy_file,'/'));
}
copy_rezult = CopyFile(#copy_file,#new_copy_path);
IF (copy_rezult!=0)
{
Write_Error(copy_rezult);
return;
}
IF (cut_active)
{
strcpy(#file_path, #copy_file);
Del_File(true);
copy_file=NULL;
cut_active=false;
}
SelectFile(#new_copy_path+strrchr(#new_copy_path,'/'));
}
 
 
void ReName(byte rename)
{
int del_rezult, copy_rezult;
625,11 → 666,11
strcpy(#temp, #path);
strcpy(#edit_name, #file_name); //save edit name to select it later
strcat(#temp, #file_name);
if (strcmp(#file_path,#temp)!=0) && (file_name)
if (itdir)
if (strcmp(#file_path,#temp)<>0) && (file_name)
IF (itdir)
{
del_rezult = DeleteFile(#file_path);
if (del_rezult!=0)
IF (del_rezult!=0)
{
Write_Error(del_rezult);
ShowMessage("Error. Folder isn't empty.");
636,7 → 677,7
return;
}
ELSE CreateDir(#temp);
Open_Dir(#path,WITH_REDRAW);
Open_Dir(#path,1);
}
ELSE
{
656,7 → 697,7
strttl(that_file);
for (i=files.count-1; i>=0; i--;)
if (!strcmp(file_mas[i]*304+buf+72,that_file)) break;
List_Current(i);
FileList_ReDraw(i);
List_ReDraw();
}
 
675,7 → 716,6
 
void Open()
{
if (!files.count) return;
if (!itdir)
{
GetIni(0);
686,7 → 726,7
strcpy(#path, #file_path);
if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
files.first=files.current=0;
Open_Dir(#path,WITH_REDRAW);
Open_Dir(#path,1);
}
}
 
698,13 → 738,13
if (HistoryPath(GO_BACK)) SelectFile(#cur_folder);
}
 
void FnProcess(char N)
void ActionsProcess(char N)
{
switch(N)
{
case 1:
SwitchToAnotherThread();
CreateThread(#about_dialog,#about_stak);
CreateThread(#about_dialog,#stak1);
break;
case 2:
if (!files.count) break;
728,7 → 768,7
pause(10);
GetIni(1);
SystemDiscsGet();
Open_Dir(#path,WITH_REDRAW);
Open_Dir(#path,1);
DrawLeftPanel();
break;
case 6:
737,7 → 777,7
CreateDir(#temp);
if (!EAX){
SelectFile("New folder");
FnProcess(2);
ActionsProcess(2);
}
else
{
751,7 → 791,7
WriteFile(0, 0, #temp);
if (!EAX){
SelectFile("New file");
FnProcess(2);
ActionsProcess(2);
}
else
{
765,9 → 805,11
}
}
 
void copyf_Action() {
return;
}
 
stop:
 
char about_stak[512];
char menu_stak[512];
char copy_stak[4096];
char stak1[512];
char stak2[512];
/programs/cmm/eolite/include/copypaste.h
File deleted
/programs/cmm/eolite/include/file_menu.h
45,11 → 45,11
id=GetButtonID();
if (id==100) Open();
if (id==101) notify("Not compleated yet");
if (id==102) FnProcess(3);
if (id==103) FnProcess(4);
if (id==104) FnProcess(2);
if (id==102) ActionsProcess(3);
if (id==103) ActionsProcess(4);
if (id==104) ActionsProcess(2);
if (id==105) Del_Form();
if (id==106) FnProcess(5);
if (id==106) ActionsProcess(5);
ExitProcess();
break;
58,15 → 58,13
break;
case evReDraw: _MENU_DRAW:
DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+3,ccount*lineh+6,0x01, 0, 0, 0x01fffFFF);
DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+2,ccount*lineh+5,0x01, 0, 0, 0x01fffFFF);
GetProcessInfo(#MenuForm, SelfInfo);
/* _PutImage(1,23, 16,44, #factions); //èêîíêè */
DrawRectangle(0,0,linew+1,ccount*lineh+2,col_border);
DrawBar(1,1,linew,1,0xFFFfff);
PutShadow(linew+2,1,1,ccount*lineh+2,0,2);
PutShadow(linew+3,2,1,ccount*lineh+2,0,1);
PutShadow(1,ccount*lineh+3,linew+2,1,0,2);
PutShadow(2,ccount*lineh+4,linew+1,1,0,1);
PutShadow(linew+2,1,1,ccount*lineh+2,0,1);
PutShadow(1,ccount*lineh+3,linew+2,1,0,1);
 
_ITEMS_DRAW:
for (i=0; captions[i*2]!=0; i++)
/programs/cmm/eolite/include/left_panel.h
6,9 → 6,9
DrawBar(17,y,160,1,0xEFEDEE);
DrawFilledBar(17, y+1, 160, 16);
WriteText(25,y+5,0x80,0,caption);
IF (id<>0) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //êíîïà äëÿ ñòðåëêè
IF (id<>0) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0xE4DFE1); //êíîïà äëÿ ñòðåëêè
WriteText(165,y+5,0x80,0,arrow); //ñòðåëêà âíèç
DrawBar(17,y+17,160,1,col_border); //ïîä÷¸ðêèâàíèå
DrawBar(17,y+17,160,1,0x94AECE); //ïîä÷¸ðêèâàíèå
}
 
 
132,7 → 132,7
int start_y = actions_y+156;
DrawBar(2,41,190,15,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè
DrawBar(17,actions_y+75,160,15,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè
PutShadow(17,actions_y+75,160,1,1,4);
PutShadow(17,actions_y+75,160,1,1,2);
PutShadow(18,actions_y+75+1,158,1,1,1);
DrawBar(2,56,15,actions_y+103,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ñëåâà
DrawBar(177,56,15,actions_y+103,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà
143,7 → 143,7
DrawBar(2,start_y,190,onTop(start_y,6+268),col_lpanel);
PutPaletteImage(#blue_hl, 190, 268, 2, onTop(268,6), 8, #blue_hl_pal);
}
PutShadow(17,start_y,160,1,1,4);
PutShadow(17,start_y,160,1,1,2);
PutShadow(18,start_y+1,158,1,1,1);
}
 
/programs/cmm/eolite/txt/History.txt
1,8 → 1,3
04.05.13 -- v1.88
- êîïèðîâàíèå ÷åðåç ïîòîê;
- êîïèðîâàíèå ïàïîê;
- íåáîëüøèå èçìåíåíèÿ â GUI.
 
01.05.13 -- v1.8
- èñïðàâëåíî ïàäåíèå ïðè èçìåíåíèè ðàçìåðà îêíà (íàø¸ë 0CodErr);
- ìåíþ ôàéëîâ;
/programs/cmm/installer/installation.c
58,7 → 58,7
ShowProgress("Copying files...");
copyf("/sys/docpack", "/tmp9/1/docpack");
DeleteFile("/sys/docpack");
copyf(abspath("sys"), "/rd/1");
copyf(abspath("sys"), "/sys");
copyf(abspath("tmp"), "/tmp9/1");
ShowProgress("Post install actions...");
RunProgram("/sys/launcher", NULL);
/programs/cmm/lib/copyf.h
1,24 → 1,15
//copyf - copy file or folder with content
:int copyf(dword from1, in1)
// универсальность добавления /
 
:void copyf(dword from1, in1)
{
dword error;
BDVK CopyFile_atr1;
if (!from1) || (!in1)
{
notify("Error: too less copyf params!");
notify(from1);
notify(in1);
return;
}
if (error = GetFileInfo(from1, #CopyFile_atr1))
{
if (!from1) || (!in1) { notify("Error: too less copyf params!"); notify(from1); notify(in1); return; }
error = GetFileInfo(from1, #CopyFile_atr1);
if (error)
debug("Error: copyf->GetFileInfo");
return error;
}
if (isdir(from1))
return CopyFolder(from1, in1);
else
return CopyFile(from1, in1);
if (isdir(from1)) CopyFolder(from1, in1); else CopyFile(from1, in1);
}
 
:int CopyFile(dword copy_from3, copy_in3)
25,71 → 16,78
{
BDVK CopyFile_atr;
dword error, cbuf;
if (error = GetFileInfo(copy_from3, #CopyFile_atr))
debug("Error: CopyFile->GetFileInfo");
debug(copy_from3);
error = GetFileInfo(copy_from3, #CopyFile_atr);
if (error)
{debug("Error: CopyFile->GetFileInfo"); debug(copy_from3);}
else
{
cbuf = malloc(CopyFile_atr.sizelo);
if (error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3))
error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3);
if (error)
debug("Error: CopyFile->ReadFile");
else
{
if (error = WriteFile(CopyFile_atr.sizelo, cbuf, copy_in3)) debug("Error: CopyFile->WriteFile");
error = WriteFile(CopyFile_atr.sizelo, cbuf, copy_in3);
if (error) debug("Error: CopyFile->WriteFile");
}
}
free(cbuf);
if (error) debug_error(copy_from3, error);
if (error) debug(copy_from3);
return error;
}
 
:int CopyFolder(dword from2, in2)
:void CopyFolder(dword from2, in2)
{
dword dirbuf, fcount, i, filename;
char copy_from2[4096], copy_in2[4096], error;
dword dirbuf, fcount, filename;
int i, error, isdir;
char copy_from2[4096], copy_in2[4096];
 
if (error = GetDir(#dirbuf, #fcount, from2, DIRS_ONLYREAL))
error = GetDir(#dirbuf, #fcount, from2);
if (error)
{
debug("Error: CopyFolder->GetDir");
debug_error(from2, error);
debug_error(in2, error);
free(dirbuf);
return error;
return;
}
if (chrnum(in2, '/')>2) && (error = CreateDir(in2))
if ((strcmp(in2, "/sys")!=0) && (strcmp(in2, "/tmp9/1")!=0))
{
debug("Error: CopyFolder->CreateDir");
debug_error(in2, error);
free(dirbuf);
return error;
error = CreateDir(in2);
if (error) debug_error(in2, error);
}
chrcat(in2, '/');
chrcat(from2, '/');
 
for (i=0; i<fcount; i++)
{
filename = i*304+dirbuf+72;
isdir = TestBit(ESDWORD[filename-40], 4);
if (isdir)
{
if ( (!strcmp(filename, ".")) || (!strcmp(filename, "..")) ) continue;
strcpy(#copy_from2, from2);
chrcat(#copy_from2, '/');
strcpy(#copy_in2, in2);
strcat(#copy_from2, filename);
strcpy(#copy_in2, in2);
chrcat(#copy_in2, '/');
strcat(#copy_in2, filename);
 
if ( TestBit(ESDWORD[filename-40], 4) ) //isdir?
{
if ( (!strcmp(filename, ".")) || (!strcmp(filename, "..")) ) continue;
CopyFolder(#copy_from2, #copy_in2);
}
else
{
strcpy(#copy_from2, from2);
strcat(#copy_from2, filename);
strcpy(#copy_in2, in2);
strcat(#copy_in2, filename);
 
copyf_Action(filename);
if (error=CopyFile(#copy_from2, #copy_in2))
{
if (fabs(error)==8) { debug("Stop copying."); break;} //TODO: may be need grobal var like stop_all
error=CopyFile(#copy_from2, #copy_in2); // #2 :)
 
if (CopyFile(#copy_from2, #copy_in2)!=0) CopyFile(#copy_from2, #copy_in2); // #2 :)
}
}
}
free(dirbuf);
return error;
}
 
 
/programs/cmm/lib/file_system.h
187,14 → 187,8
return 0;
}
 
enum
:int GetDir(dword dir_buf, file_count, path)
{
DIRS_ALL,
DIRS_NOROOT,
DIRS_ONLYREAL
};
:int GetDir(dword dir_buf, file_count, path, doptions)
{
dword buf, fcount, error;
buf = malloc(32);
error = ReadDir(0, buf, path);
204,17 → 198,8
buf = realloc(buf, fcount+1*304+32);
ReadDir(fcount, buf, path);
//fcount=EBX;
 
if (doptions == DIRS_ONLYREAL)
{
if (!strcmp(".",buf+72)) {fcount--; memmov(buf,buf+304,fcount*304);}
if (!strcmp("..",buf+72)) {fcount--; memmov(buf,buf+304,fcount*304);}
}
if (doptions == DIRS_NOROOT)
{
if (!strcmp(".",buf+72)) {fcount--; memmov(buf,buf+304,fcount*304);}
}
 
ESDWORD[dir_buf] = buf;
ESDWORD[file_count] = fcount;
}
/programs/cmm/lib/socket.h
21,7 → 21,7
$int 0x40
}
 
inline fastcall dword ReadSocket( ECX)
inline fastcall dword ReadSocket( ECX) //ecx - handle
{
$mov eax,53
$mov ebx,3
/programs/cmm/lib/kolibri.h
240,13 → 240,6
$int 0x40
}
 
inline fastcall void SendWindowMessage( ECX, EDX)
{
$mov eax, 72
$mov ebx, 1
$int 0x40
}
 
inline fastcall int KillProcess( ECX)
{
$mov eax,18;
/programs/cmm/lib/strings.h
12,7 → 12,6
// strlwr( ESI) --- kyrillic symbols may not work
// strttl( EDX)
// strtok( ESI)
// chrnum(dword searchin, char symbol)
// strcpyb(dword searchin, copyin, startstr, endstr) --- copy string between strings
// strnumb(dword searchin, startstr, endstr) --- get number between strings
//------------------------------------------------------------------------------
/programs/cmm/lib/edit_box_lib.h
0,0 → 1,49
//BOX_LIB
dword boxlib = #aEdit_box_lib; //Asper
char aEdit_box_lib[22]="/sys/lib/box_lib.obj\0"; //Asper
 
dword edit_box_draw = #aEdit_box_draw;
dword edit_box_key = #aEdit_box_key;
dword edit_box_mouse = #aEdit_box_mouse;
dword version_ed = #aVersion_ed;
 
dword am__ = 0x0;
dword bm__ = 0x0;
 
char aEdit_box_draw[9] = "edit_box\0";
char aEdit_box_key[13] = "edit_box_key\0";
char aEdit_box_mouse[15] = "edit_box_mouse\0";
char aVersion_ed[11] = "version_ed\0";
 
char aCheck_box_draw [15] = "check_box_draw\0";
char aCheck_box_mouse [16] = "check_box_mouse\0";
char aVersion_ch [11] = "version_ch\0";
 
char aOption_box_draw [16] = "option_box_draw\0";
char aOption_box_mouse[17] = "option_box_mouse\0";
char aVersion_op [11] = "version_op\0" ;
 
 
struct edit_box{
dword width, left, top, color, shift_color, focus_border_color, blur_border_color,
text_color, max, text, mouse_variable, flags, size, pos, offset, cl_curs_x, cl_curs_y, shift, shift_old;
};
 
//ed_width equ [edi] ;è¨à¨­  ª®¬¯®­¥­â 
//ed_left equ [edi+4] ;¯®«®¦¥­¨¥ ¯® ®á¨ å
//ed_top equ [edi+8] ;¯®«®¦¥­¨¥ ¯® ®á¨ ã
//ed_color equ [edi+12] ;梥â ä®­  ª®¬¯®­¥­â 
//shift_color equ [edi+16] ;=0x6a9480
//ed_focus_border_color equ [edi+20] ;梥â à ¬ª¨ ª®¬¯®­¥­â 
//ed_blur_border_color equ [edi+24] ;梥⠭¥  ªâ¨¢­®£® ª®¬¯®­¥­â 
//ed_text_color equ [edi+28] ;梥â ⥪áâ 
//ed_max equ [edi+32] ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥áâ¨
//ed_text equ [edi+36] ;㪠§ â¥«ì ­  ¡ãä¥à
//ed_flags equ [edi+40] ;ä« £¨
//ed_size equ [edi+42] ;ª®«-¢® ᨬ¢®«®¢
//ed_pos equ [edi+46] ;¯®§¨æ¨ï ªãàá®à 
//ed_offset equ [edi+50] ;ᬥ饭¨¥
//cl_curs_x equ [edi+54] ;¯à¥¤ë¤ãé ï ª®®à¤¨­ â  ªãàá®à  ¯® å
//cl_curs_y equ [edi+58] ;¯à¥¤ë¤ãé ï ª®®à¤¨­ â  ªãàá®à  ¯® ã
//ed_shift_pos equ [edi+62] ;¯®«®¦¥­¨¥ ªãàá®à 
//ed_shift_pos_old equ [edi+66] ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 
/programs/cmm/liza/liza.c
4,13 → 4,13
#define MEMSIZE 0xA0000
#include "..\lib\kolibri.h"
#include "..\lib\strings.h"
#include "..\lib\mem.h"
#include "..\lib\dll.h"
#include "..\lib\encoding.h"
#include "..\lib\file_system.h"
#include "..\lib\figures.h"
#include "..\lib\file_system.h"
#include "..\lib\list_box.h"
#include "..\lib\socket.h"
#include "..\lib\mem.h"
#include "..\lib\dll.h"
//*.obj libraries
#include "..\lib\lib.obj\box_lib.h"
#include "..\lib\lib.obj\network.h"
/programs/cmm/dicty/dicty.c
9,7 → 9,7
 
 
unsigned char speaker[23*40*3]= FROM "speaker.raw";
char title[]= "Dictionary v1.31";
char title[]= "Dictionary v1.3";
char direction[] = "Translate direction:";
char translate_caption[] = "Translate";
char dict_not_found[] = "Dictionary not found";
62,7 → 62,7
 
case evButton:
id=GetButtonID();
if (id==1) {KillProcess(speaker_id); ExitProcess();}
if (id==1) ExitProcess();
if (id==10) { Translate(); DrawTranslation(); }
if (id==11) ShowDictList();
if (id==12) DrawWindowContent();
229,7 → 229,7
int j, fcount, error;
free(dir_buf);
error = GetDir(#dir_buf, #fcount, #dict_folder, DIRS_ONLYREAL);
error = GetDir(#dir_buf, #fcount, #dict_folder);
if (!error)
{
DefineButton(0,0, Form.width,Form.height, 12+BT_HIDE+BT_NOFRAME, sc.work_button);
/programs/cmm/kolibrin/kolibrin.c
14,7 → 14,7
signed int result;
 
mem_Init();
GetDir(#dirbuf, #fcount, "/", DIRS_ONLYREAL);
GetDir(#dirbuf, #fcount, "/");
 
for (i=0; i<fcount; i++)
{
24,7 → 24,7
strcpy(#cd_path, "/");
strcat(#cd_path, filename);
free(dirbuf2);
GetDir(#dirbuf2, #fcount2, #cd_path, DIRS_ONLYREAL);
GetDir(#dirbuf2, #fcount2, #cd_path);
 
for (j=0; j<fcount2; j++)
{