Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3443 → Rev 3444

/programs/cmm/dicty/dicty.c
9,7 → 9,7
 
 
unsigned char speaker[23*40*3]= FROM "speaker.raw";
char title[]= "Dictionary v1.3";
char title[]= "Dictionary v1.31";
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) ExitProcess();
if (id==1) {KillProcess(speaker_id); 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);
error = GetDir(#dir_buf, #fcount, #dict_folder, DIRS_ONLYREAL);
if (!error)
{
DefineButton(0,0, Form.width,Form.height, 12+BT_HIDE+BT_NOFRAME, sc.work_button);
/programs/cmm/eolite/Eolite.c
19,15 → 19,13
#include "imgs\toolbar.txt"
#include "imgs\left_p.txt"
 
//for OpenDir
#define ONLY_SHOW 0
#define WITH_REDRAW 1
#define ONLY_OPEN 2
 
#define TITLE "Eolite File Manager v1.81"
#define ABOUT_TITLE "Eolite v1.81"
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
 
#define TITLE "Eolite File Manager v1.88"
#define ABOUT_TITLE "Eolite v1.88"
dword col_work = 0xE4DFE1;
dword col_border = 0x819FC5;
dword col_border = 0x9098B0; //A0A0B8; //0x819FC5;
dword col_padding = 0xC8C9C9;
dword col_selec = 0x94AECE;
dword col_lpanel = 0x00699C;
42,10 → 40,8
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,
71,10 → 67,11
#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;
word key, id, can_show, can_select, m_selected;
 
files.line_h=18;
mem_Init();
95,13 → 92,14
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)
if (m.x > files.x) && (m.x < files.x + files.w) && (m.y > files.y) && (m.y < files.y+files.h) && (!can_select)
{
m_selected = m.y - 57 / files.line_h;
if (m.lkm) can_select = 1;
if (m.pkm)
{
116,7 → 114,8
can_select = 0;
if (m.y<57) break;
id = m.y - 57 / files.line_h;
if (files.current!=id) FileList_ReDraw(id-files.current);
if (id!=m_selected) {can_show=0; break;}
if (files.current!=id) List_Current(id-files.current);
else Open();
};
// } select/open file
127,7 → 126,7
can_show = 0;
if (m.y<57) break;
SwitchToAnotherThread();
CreateThread(#FileMenu,#stak2);
CreateThread(#FileMenu,#menu_stak);
break;
}
// } file menu
178,7 → 177,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-----------------------------------------------------------------------------
208,11 → 207,13
Dir_Up();
break;
case 24: //cut
key=24;
Copy(#file_path, NOCUT);
break;
case 25: //copy
goto CTRLC_MARK;
Copy(#file_path, CUT);
break;
case 26: //paste
Paste();
CreateThread(#Paste,#copy_stak);
break;
case 31...33: //sort
IF(sort_num==1) DrawFilledBar(onLeft(192,168)/2+210,42,6,10);
222,16 → 223,16
Open_Dir(#path,WITH_REDRAW);
break;
case 50...60: //Actions
ActionsProcess(id-50);
FnProcess(id-50);
break;
case 100...120:
DEVICE_MARK:
DrawRectangle3D(17,id-100*16+74,159,16, 0, 0); //auaaeaiea
DrawRectangle(17,id-100*16+74,159,16, 0); //auaaeaiea
strcpy(#path, #disk_list[id-100].Item);
files.first=files.current=0;
Open_Dir(#path,1);
Open_Dir(#path,WITH_REDRAW);
pause(5);
DrawRectangle3D(17,id-100*16+74,159,16, 0xFFFFFF, 0xFFFFFF);
DrawRectangle(17,id-100*16+74,159,16, 0xFFFFFF);
break;
case 130...160:
tmp_disk_del_param[1]=disk_list[id-130].Item[4];
253,7 → 254,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);
279,14 → 280,13
RunProgram("/sys/File Managers/Eolite", #path);
break;
case 024: //Ctrl+X
Copy(#file_path, CUT);
break;
case 003: //Ctrl+C
CTRLC_MARK:
IF (itdir) break;
strcpy(#copy_file, #file_path);
IF (key==24) cut_active=1; ELSE cut_active=0;
Copy(#file_path, NOCUT);
break;
case 022: //Ctrl+V
Paste();
CreateThread(#Paste,#copy_stak);
break;
case 027: //Esc
IF (rename_active==1) ReName(false);
296,10 → 296,10
Open();
break;
case 178: //up
FileList_ReDraw(-1);
List_Current(-1);
break;
case 177: //down
FileList_ReDraw(1);
List_Current(1);
break;
case 180: //home
files.first=0;
312,16 → 312,16
List_ReDraw();
break;
case 183: //Page Down
FileList_ReDraw(files.visible-1);
List_Current(files.visible-1);
break;
case 184: //Page Up
FileList_ReDraw(-files.visible+1);
List_Current(-files.visible+1);
break;
case 182: //del
Del_Form();
break;
case 050...059: //F1-F10
ActionsProcess(key-49);
FnProcess(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)
{
FileList_ReDraw(i-files.current-files.first);
List_Current(i-files.current-files.first);
break;
}
}
336,32 → 336,33
}
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) break;
if (Form.status_window>2) return;
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); //ôîí íàä ïîëîñîé àäðåñà
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
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
PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
//main rectangles
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
DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),col_border);
DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg
for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);
DrawLeftPanel();
//ListBox
373,7 → 374,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) ActionsProcess(2);
if (rename_active) FnProcess(2);
}
 
 
387,7 → 388,7
}
 
 
void FileList_ReDraw(int cur)
void List_Current(int cur)
{
if (cur<=0) //up
{
440,8 → 441,6
}
 
 
 
 
void List_ReDraw()
{
int paint_y;
450,7 → 449,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);
459,6 → 458,7
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,20 → 502,16
}
 
 
void Open_Dir(dword temp_, redraw){
int errornum, count;
char path_[4096],
somelen=strlen(temp_)-1;
void Open_Dir(dword dir_path, redraw){
int errornum, maxcount;
 
if (redraw<>ONLY_SHOW)
if (redraw!=ONLY_SHOW)
{
strcpy(#path_, temp_);
if (somelen) path_[somelen]=NULL;
if (ESBYTE[dir_path+1]!='\0') ESBYTE[dir_path+strlen(dir_path)-1] = '\0';
if (buf) free(buf);
buf = malloc(32);
errornum=ReadDir(0, buf, #path_);
if (errornum<>0)
errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT);
if (ESBYTE[dir_path+1]!='\0') chrcat(dir_path, '/');
if (errornum)
{
HistoryPath(ADD_NEW_PATH);
GoBack();
522,32 → 518,25
Write_Error(errornum);
return;
}
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;
maxcount = sizeof(file_mas)/sizeof(dword)-1;
if (files.count>maxcount) files.count = maxcount;
}
if (files.count<>-1)
if (files.count!=-1)
{
KEdit();
HistoryPath(ADD_NEW_PATH);
IF (!strcmp(".",buf+72)) {files.count--; memmov(buf,buf+304,files.count*304);} //oeeuo?oai yeaiaio "."
files.visible=onTop(6,57)/files.line_h;
files.visible = files.h / files.line_h;
IF (files.count<files.visible) files.visible=files.count;
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 (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 (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;
577,13 → 566,14
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];
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;}
}
 
 
void Del_Form()
{
int dform_x=Form.width/2-13;
int dform_x = files.w - 200 / 2 + files.x;
//oeia ieii
if (!files.count) return;
DrawFlatButton(dform_x,160,200,80,0,col_work, ""); //oi?ia
599,7 → 589,6
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;
612,7 → 601,7
IF (dodel==true)
{
del_rezult = DeleteFile(#file_path);
IF (del_rezult<>0)
IF (del_rezult)
{
Write_Error(del_rezult);
IF ( itdir) ShowMessage("Error. Folder isn't empty.");
621,40 → 610,10
}
del_active=0;
DeleteButton(301); DeleteButton(302);
Open_Dir(#path,1);
Open_Dir(#path,WITH_REDRAW);
}
 
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;
666,11 → 625,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.");
677,7 → 636,7
return;
}
ELSE CreateDir(#temp);
Open_Dir(#path,1);
Open_Dir(#path,WITH_REDRAW);
}
ELSE
{
697,7 → 656,7
strttl(that_file);
for (i=files.count-1; i>=0; i--;)
if (!strcmp(file_mas[i]*304+buf+72,that_file)) break;
FileList_ReDraw(i);
List_Current(i);
List_ReDraw();
}
 
716,6 → 675,7
 
void Open()
{
if (!files.count) return;
if (!itdir)
{
GetIni(0);
726,7 → 686,7
strcpy(#path, #file_path);
if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
files.first=files.current=0;
Open_Dir(#path,1);
Open_Dir(#path,WITH_REDRAW);
}
}
 
738,13 → 698,13
if (HistoryPath(GO_BACK)) SelectFile(#cur_folder);
}
 
void ActionsProcess(char N)
void FnProcess(char N)
{
switch(N)
{
case 1:
SwitchToAnotherThread();
CreateThread(#about_dialog,#stak1);
CreateThread(#about_dialog,#about_stak);
break;
case 2:
if (!files.count) break;
768,7 → 728,7
pause(10);
GetIni(1);
SystemDiscsGet();
Open_Dir(#path,1);
Open_Dir(#path,WITH_REDRAW);
DrawLeftPanel();
break;
case 6:
777,7 → 737,7
CreateDir(#temp);
if (!EAX){
SelectFile("New folder");
ActionsProcess(2);
FnProcess(2);
}
else
{
791,7 → 751,7
WriteFile(0, 0, #temp);
if (!EAX){
SelectFile("New file");
ActionsProcess(2);
FnProcess(2);
}
else
{
805,11 → 765,9
}
}
 
void copyf_Action() {
return;
}
 
stop:
 
char stak1[512];
char stak2[512];
char about_stak[512];
char menu_stak[512];
char copy_stak[4096];
/programs/cmm/eolite/include/copypaste.h
0,0 → 1,61
//Leency 2008-2013
 
 
byte copy_from[4096], cut_active=0;
enum {NOCUT, CUT};
#define WIN_W 300
#define WIN_H 20
 
 
void Copy(dword pcth, char cut)
{
strcpy(#copy_from, pcth);
cut_active = cut;
}
 
void copyf_Action(dword filename) {
DefineAndDrawWindow(5000,0,WIN_W,WIN_H-1,0x01,col_work,0);
DrawBar(WIN_W, 0, 1, WIN_H, 0x333333);
DrawBar(0, 0, WIN_W, WIN_H, 0xDDDddd);
WriteText(5,6, 0x80, 0, "Copying file:");
WriteText(90,6, 0x80, 0, filename);
pause(20);
}
 
 
void Paste()
{
char copy_to[4096], copy_rezult;
if (!copy_from) ExitProcess();
strcpy(#copy_to, #path);
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
if (!strcmp(#copy_from,#copy_to))
{
strcpy(#copy_to, #path);
strcat(#copy_to, "new_");
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
}
if (strstr(#copy_to, #copy_from))
{
notify("Copy directory into itself is a bad idea...");
ExitProcess();
}
copy_rezult = copyf(#copy_from,#copy_to);
if (copy_rezult)
{
Write_Error(copy_rezult);
ExitProcess();
}
if (cut_active)
{
strcpy(#file_path, #copy_from);
Del_File(true);
copy_from=NULL;
cut_active=false;
}
ActivateWindow(GetProcessSlot(Form.ID));
SendWindowMessage(evKey, 54);
SelectFile(#copy_to+strrchr(#copy_to,'/'));
ExitProcess();
}
/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) ActionsProcess(3);
if (id==103) ActionsProcess(4);
if (id==104) ActionsProcess(2);
if (id==102) FnProcess(3);
if (id==103) FnProcess(4);
if (id==104) FnProcess(2);
if (id==105) Del_Form();
if (id==106) ActionsProcess(5);
if (id==106) FnProcess(5);
ExitProcess();
break;
58,13 → 58,15
break;
case evReDraw: _MENU_DRAW:
DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+2,ccount*lineh+5,0x01, 0, 0, 0x01fffFFF);
DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+3,ccount*lineh+6,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,1);
PutShadow(1,ccount*lineh+3,linew+2,1,0,1);
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);
 
_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,0xE4DFE1); //êíîïà äëÿ ñòðåëêè
IF (id<>0) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //êíîïà äëÿ ñòðåëêè
WriteText(165,y+5,0x80,0,arrow); //ñòðåëêà âíèç
DrawBar(17,y+17,160,1,0x94AECE); //ïîä÷¸ðêèâàíèå
DrawBar(17,y+17,160,1,col_border); //ïîä÷¸ðêèâàíèå
}
 
 
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,2);
PutShadow(17,actions_y+75,160,1,1,4);
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,2);
PutShadow(17,start_y,160,1,1,4);
PutShadow(18,start_y+1,158,1,1,1);
}
 
/programs/cmm/eolite/txt/History.txt
1,3 → 1,8
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"), "/sys");
copyf(abspath("sys"), "/rd/1");
copyf(abspath("tmp"), "/tmp9/1");
ShowProgress("Post install actions...");
RunProgram("/sys/launcher", NULL);
/programs/cmm/kolibrin/kolibrin.c
14,7 → 14,7
signed int result;
 
mem_Init();
GetDir(#dirbuf, #fcount, "/");
GetDir(#dirbuf, #fcount, "/", DIRS_ONLYREAL);
 
for (i=0; i<fcount; i++)
{
24,7 → 24,7
strcpy(#cd_path, "/");
strcat(#cd_path, filename);
free(dirbuf2);
GetDir(#dirbuf2, #fcount2, #cd_path);
GetDir(#dirbuf2, #fcount2, #cd_path, DIRS_ONLYREAL);
 
for (j=0; j<fcount2; j++)
{
/programs/cmm/lib/edit_box_lib.h
File deleted
/programs/cmm/lib/copyf.h
1,15 → 1,24
// универсальность добавления /
 
:void copyf(dword from1, in1)
//copyf - copy file or folder with content
:int copyf(dword from1, in1)
{
dword error;
BDVK CopyFile_atr1;
if (!from1) || (!in1) { notify("Error: too less copyf params!"); notify(from1); notify(in1); return; }
error = GetFileInfo(from1, #CopyFile_atr1);
if (error)
if (!from1) || (!in1)
{
notify("Error: too less copyf params!");
notify(from1);
notify(in1);
return;
}
if (error = GetFileInfo(from1, #CopyFile_atr1))
{
debug("Error: copyf->GetFileInfo");
return error;
}
if (isdir(from1))
return CopyFolder(from1, in1);
else
if (isdir(from1)) CopyFolder(from1, in1); else CopyFile(from1, in1);
return CopyFile(from1, in1);
}
 
:int CopyFile(dword copy_from3, copy_in3)
16,78 → 25,71
{
BDVK CopyFile_atr;
dword error, cbuf;
debug(copy_from3);
error = GetFileInfo(copy_from3, #CopyFile_atr);
if (error)
{debug("Error: CopyFile->GetFileInfo"); debug(copy_from3);}
if (error = GetFileInfo(copy_from3, #CopyFile_atr))
debug("Error: CopyFile->GetFileInfo");
else
{
cbuf = malloc(CopyFile_atr.sizelo);
error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3);
if (error)
if (error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3))
debug("Error: CopyFile->ReadFile");
else
{
error = WriteFile(CopyFile_atr.sizelo, cbuf, copy_in3);
if (error) debug("Error: CopyFile->WriteFile");
if (error = WriteFile(CopyFile_atr.sizelo, cbuf, copy_in3)) debug("Error: CopyFile->WriteFile");
}
}
free(cbuf);
if (error) debug(copy_from3);
if (error) debug_error(copy_from3, error);
return error;
}
 
:void CopyFolder(dword from2, in2)
:int CopyFolder(dword from2, in2)
{
dword dirbuf, fcount, filename;
int i, error, isdir;
char copy_from2[4096], copy_in2[4096];
dword dirbuf, fcount, i, filename;
char copy_from2[4096], copy_in2[4096], error;
 
error = GetDir(#dirbuf, #fcount, from2);
if (error)
if (error = GetDir(#dirbuf, #fcount, from2, DIRS_ONLYREAL))
{
debug("Error: CopyFolder->GetDir");
debug_error(from2, error);
debug_error(in2, error);
free(dirbuf);
return;
return error;
}
if ((strcmp(in2, "/sys")!=0) && (strcmp(in2, "/tmp9/1")!=0))
if (chrnum(in2, '/')>2) && (error = CreateDir(in2))
{
error = CreateDir(in2);
if (error) debug_error(in2, error);
debug("Error: CopyFolder->CreateDir");
debug_error(in2, error);
free(dirbuf);
return 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, '/');
strcat(#copy_from2, filename);
strcpy(#copy_in2, in2);
strcat(#copy_from2, filename);
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 (CopyFile(#copy_from2, #copy_in2)!=0) CopyFile(#copy_from2, #copy_in2); // #2 :)
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 :)
}
}
}
free(dirbuf);
return error;
}
 
 
/programs/cmm/lib/file_system.h
187,8 → 187,14
return 0;
}
 
:int GetDir(dword dir_buf, file_count, path)
enum
{
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);
198,8 → 204,17
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/kolibri.h
240,6 → 240,13
$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/socket.h
21,7 → 21,7
$int 0x40
}
 
inline fastcall dword ReadSocket( ECX) //ecx - handle
inline fastcall dword ReadSocket( ECX)
{
$mov eax,53
$mov ebx,3
/programs/cmm/lib/strings.h
12,6 → 12,7
// 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/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\figures.h"
#include "..\lib\file_system.h"
#include "..\lib\figures.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"