Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5803 → Rev 5804

/programs/cmm/eolite/include/copy.h
3,10 → 3,8
byte copy_from[4096];
byte cut_active=0;
 
progress_bar copy_bar = {0,16,49,50,20,0,0,1,0xFFFFFF,0x00FF00,0x000000};
enum {NOCUT, CUT};
 
enum {NOCUT, CUT, COPY_PASTE_END};
 
Clipboard clipboard;
 
void Copy(dword pcth, char cut)
52,37 → 50,6
CreateThread(#PasteThread,copy_stak+20000-4);
}
 
BDVK file_info_count;
int file_count_copy;
 
void DirFileCount(dword way)
{
dword dirbuf, fcount, i, filename;
dword cur_file;
if (isdir(way))
{
cur_file = malloc(4096);
// In the process of recursive descent, memory must be allocated dynamically, because the static memory -> was a bug !!! But unfortunately pass away to sacrifice speed.
GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL);
for (i=0; i<fcount; i++)
{
filename = i*304+dirbuf+72;
sprintf(cur_file,"%s/%s",way,filename);
if (TestBit(ESDWORD[filename-40], 4) )
{
file_count_copy++;
DirFileCount(cur_file);
}
else
{
file_count_copy++;
}
}
free(cur_file);
}
}
 
void PasteThread()
{
char copy_rezult;
102,10 → 69,14
else file_count_copy++;
}
copy_bar.max = file_count_copy;
DisplayCopyfForm();
if (cut_active) operation_flag = MOVE_FLAG;
else operation_flag = COPY_FLAG;
DisplayOperationForm();
for (j = 0; j < cnt; j++) {
strlcpy(#copy_from, j*4096+buf+10, 4096);
if (!copy_from) CopyExit();
if (!copy_from) DialogExit();
strcpy(#copy_to, #path);
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
if (!strcmp(#copy_from,#copy_to))
117,7 → 88,7
if (strstr(#copy_to, #copy_from))
{
notify("Copy directory into itself is a bad idea...");
CopyExit();
DialogExit();
}
 
if (copy_rezult = copyf(#copy_from,#copy_to))
126,8 → 97,8
}
else if (cut_active)
{
strcpy(#file_path, #copy_from);
Del_File(true);
//strcpy(#file_path, #copy_from);
Del_File2(#copy_from, 0);
}
}
136,52 → 107,5
cut_active=false;
}
if (info_after_copy) notify(INFO_AFTER_COPY);
CopyExit();
}
 
#define WIN_COPY_W 345
#define WIN_COPY_H 110
proc_info Copy_Form;
 
void DisplayCopyfForm()
{
switch(CheckEvent())
{
case evButton:
notify(T_CANCEL_PASTE);
CopyExit();
break;
case evReDraw:
DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_COPY_W,GetSkinHeight()+WIN_COPY_H,0x34,0xFFFFFF,T_PASTE_WINDOW_TITLE);
GetProcessInfo(#Copy_Form, SelfInfo);
WriteText(45, 11, 0x80, system.color.work_text, T_PASTE_WINDOW_TEXT);
DrawFlatButton(Copy_Form.cwidth - 96, Copy_Form.cheight - 32, 80, 22, 10, system.color.work_button, T_PASTE_WINDOW_BUTTON);
DrawBar(8, 10, 32, 32, 0xFFFfff);
break;
}
}
 
void CopyExit() {
action_buf = COPY_PASTE_END;
ActivateWindow(GetProcessSlot(Form.ID));
ExitProcess();
}
 
 
void copyf_Draw_Progress(dword copying_filename) {
if (Copy_Form.cwidth==0)
{
copy_bar.value++;
return;
}
copy_bar.width = Copy_Form.cwidth-32;
DisplayCopyfForm();
Put_icon(copying_filename+strrchr(copying_filename,'.'), 16, 19, 0xFFFfff, 0);
DrawBar(45, 29, Copy_Form.cwidth-45, 10, 0xFFFFFF);
WriteText(45, 29, 0x80, 0x000000, copying_filename);
progressbar_draw stdcall (#copy_bar);
progressbar_progress stdcall (#copy_bar);
//copy_bar.value++;
//pause(10);
DialogExit();
}