Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5605 → Rev 5606

/programs/cmm/eolite/Eolite.c
122,7 → 122,7
word about_window;
byte active_settings=0;
word settings_window;
 
dword _not_draw = false;
byte menu_call_mouse=0;
 
llist files;
208,7 → 208,7
strncpy(#path, "/rd/1/", 6);
}
Open_Dir(#path,ONLY_OPEN);
SetEventMask(0x27);
SetEventMask(1100111b);
loop(){
switch(WaitEvent())
{
558,14 → 558,10
action_buf=0;
}
break;
/*default:
if(CMD_REFRESH)
{
CMD_REFRESH = false;
case evIPC:
goto DRAW_WINDOW;
break;
}
*/
}
if(cmd_free)
{
769,7 → 765,7
}
else
{
if (strcmp("..",file_name_off)==0) ext1=".."; else ext1="<DIR>";
if (!strncmp(file_name_off,"..",3)) ext1=".."; else ext1="<DIR>";
Put_icon(ext1, files.x+3, files.line_h/2-7+y, color, 0);
}
 
778,8 → 774,7
{
itdir = TestBit(attr, 4);
strcpy(#file_name, file_name_off);
strcpy(#file_path, #path);
strcat(#file_path, #file_name);
sprintf(#file_path,"%s%s",#path,file_name_off);
if (text_col==0xA6A6B7) text_col=0xFFFFFF;
}
if (file.selected) text_col=0xFF0000;
820,7 → 815,7
}
if (files.count!=-1)
{
KEdit();
if(!_not_draw)KEdit();
HistoryPath(ADD_NEW_PATH);
files.visible = files.h / files.line_h;
if (files.count < files.visible) files.visible = files.count;
829,9 → 824,9
if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
WriteText(sorting_arrow_x,45,0x80,sc.work_graph,"\x19");
if (redraw!=ONLY_SHOW) Sorting();
if (redraw!=ONLY_OPEN) List_ReDraw();
if (redraw!=ONLY_OPEN)&&(!_not_draw) 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; if(!_not_draw)List_ReDraw();}
}
 
 
840,7 → 835,7
dword k=0, l=1;
dword file_off;
int i;
if (!strcmp(#path,"/")) //do not sort
if (!strncmp(#path,"/",2)) //do not sort
{
for(k=1;k<files.count;k++;) file_mas[k]=k;
return;
865,8 → 860,8
if (sort_num==2) Sort_by_Type(k,files.count-1);
if (sort_num==3) Sort_by_Size(k,files.count-1);
//make ".." first item in list
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) && (!strncmp(file_mas[0]*304+buf+72,"..",3))
for(k--; k>0; k--;) if (!strncmp(file_mas[k]*304+buf+72,"..",3)) {file_mas[k]><file_mas[0]; break;}
}
 
 
876,7 → 871,7
int cont = 0;
byte f_count[128];
int dform_x = files.w - 220 / 2 + files.x;
if (!strncmp(#file_name,".",1)) || (!strncmp(#file_name,"..",2)) return;
if (!strncmp(#file_name,".",2)) || (!strncmp(#file_name,"..",2)) return;
if (del_active==2)
{
if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
929,9 → 924,6
{
if (CheckEvent()==evReDraw) draw_window();
filename = i*304+dirbuf+72;
/*strcpy(#del_from, way);
chrcat(#del_from, '/');
strcat(#del_from, filename);*/
sprintf(#del_from,"%s/%s",way,filename);
if ( TestBit(ESDWORD[filename-40], 4) )
{
965,8 → 957,6
{
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) {
/*strcpy(#del_from, #path);
strcat(#del_from, file_mas[i]*304+buf+72);*/
sprintf(#del_from,"%s%s",#path,file_mas[i]*304+buf+72);
Del_File2(#del_from);
}
1015,7 → 1005,7
selected_count = 0;
if (rez)
{
if (!strncmp(#file_name,"..",2)) return;
if (!strncmp(#file_name,"..",3)) return;
strcpy(#temp, #file_path);
if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end
RunProgram("/sys/File Managers/Eolite", #temp);
1028,7 → 1018,7
}
else
{
if (!strncmp(#file_name,"..",2)) { Dir_Up(); return; }
if (!strncmp(#file_name,"..",3)) { Dir_Up(); return; }
strcpy(#path, #file_path);
if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
files.first=files.current=0;
1047,9 → 1037,6
void ShowOpenWithDialog()
{
byte param[4097];
/*param[0] = '~';
param[1] = '\0';
strcat(#param, #file_path);*/
sprintf(#param,"~%s",#file_path);
RunProgram("/sys/@open", #param);
}
1060,8 → 1047,6
byte del_rezult, copy_rezult, info_result;
if (newf)
{
/*strcpy(#temp, #path);
strcat(#temp, new_file_ed.text);*/
sprintf(#temp,"%s%s",#path,new_file_ed.text);
info_result = GetFileInfo(#temp, #element_info);
switch(new_element_active)
/programs/cmm/eolite/include/properties.h
161,8 → 161,16
ExitProcess();
}
if (id==20) SetProperties(id);
if (id==21) SetProperties(id);
if (id==21)
{
SetProperties(id);
_not_draw = true;
Open_Dir(#path,WITH_REDRAW);
_not_draw = false;
EventRedrawWindow(Form.left,Form.top);
}
if (id==22) SetProperties(id);
DrawPropertiesCheckBoxes();
break;
235,7 → 243,6
flags_frame.font_backgr_color = sc.work;
flags_frame.ext_col = sc.work_graph;
frame_draw stdcall (#flags_frame);
 
DrawPropertiesCheckBoxes();
}
}
/programs/cmm/eolite/include/settings.h
39,6 → 39,7
if (active_settings){
EXIT_SETTING:
show_dev_name = save_show_dev_name;
real_files_names_case = save_real_files_names_case;
info_after_copy = save_info_after_copy;
45,7 → 46,9
use_big_fonts = save_use_big_fonts;
files.line_h = save_files_h;
MOUSE_TIME = save_DBLTime;
cmd_free = 4;
ExitProcess();
}
active_settings=1;
64,7 → 67,7
id=GetButtonID();
if (id==10)
{
SaveIniSettings();
//SaveIniSettings();
active_settings=0;
action_buf = 300;
cmd_free = 4;
88,9 → 91,7
else if (id==26) && (files.line_h>14) files.line_h--;
else if (id==27) MOUSE_TIME++;
else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--;
//CMD_REFRESH = true;
MoveSize(-1,-1,-1,settings_form.height+1);
MoveSize(-1,-1,-1,settings_form.height);
EventRedrawWindow(Form.left,Form.top);
DrawSettingsCheckBoxes();
break;
/programs/cmm/eolite/include/sorting.h
3,9 → 3,9
void Sort_by_Size(int a, b) // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1
{
int iss = a;
IF (a >= b) return;
FOR (j = a; j <= b; j++)
IF (ESDWORD[file_mas[j]*304 + buf+64] <= ESDWORD[file_mas[b]*304 + buf+64]) { file_mas[iss] >< file_mas[j]; iss++;}
if (a >= b) return;
for (j = a; j <= b; j++)
if (ESDWORD[file_mas[j]*304 + buf+64] <= ESDWORD[file_mas[b]*304 + buf+64]) { file_mas[iss] >< file_mas[j]; iss++;}
Sort_by_Size (a, iss-2);
Sort_by_Size (iss, b);
}
14,9 → 14,9
void Sort_by_Name(int a, b) // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1
{
int isn = a;
IF (a >= b) return;
FOR (j = a; j <= b; j++)
IF (strcmp(file_mas[j]*304 + buf+72, file_mas[b]*304 + buf+72)<=0) { file_mas[isn] >< file_mas[j]; isn++;}
if (a >= b) return;
for (j = a; j <= b; j++)
if (strcmp(file_mas[j]*304 + buf+72, file_mas[b]*304 + buf+72)<=0) { file_mas[isn] >< file_mas[j]; isn++;}
Sort_by_Name(a, isn-2);
Sort_by_Name(isn, b);
}
26,7 → 26,7
{
dword filename1, filename2, ext1, ext2;
int n, isn = a;
IF (a >= b) return;
if (a >= b) return;
for (j = a; j <= b; j++)
{
filename1 = file_mas[j]*304 + buf+72;
34,14 → 34,14
 
n=strlen(filename1)-1;
WHILE (n>0) && (ESBYTE[filename1+n]<>'.') n--;
IF (n) ext1 = filename1+n+1; else ext1=0;
if (n) ext1 = filename1+n+1; else ext1=0;
n=strlen(filename2)-1;
WHILE (n>0) && (ESBYTE[filename2+n]<>'.') n--;
IF (n) ext2 = filename2+n+1; else ext2=0;
if (n) ext2 = filename2+n+1; else ext2=0;
 
n=strcmp(ext1, ext2);
IF (n<0) { file_mas[isn] >< file_mas[j]; isn++;}
IF (n==0) && (strcmp(filename1, filename2)<=0) { file_mas[isn] >< file_mas[j]; isn++;}
if (n<0) { file_mas[isn] >< file_mas[j]; isn++;}
if (n==0) && (strcmp(filename1, filename2)<=0) { file_mas[isn] >< file_mas[j]; isn++;}
}
Sort_by_Type(a, isn-2);
Sort_by_Type(isn, b);
/programs/cmm/lib/kolibri.h
251,6 → 251,8
vert = EBX;
}
 
 
 
:void mouse::slider()
{
signed _x,_y;
824,6 → 826,27
$int 0x40
}
 
 
:dword X_EventRedrawWindow,Y_EventRedrawWindow;
:void _EventRedrawWindow()
{
loop()switch(WaitEvent())
{
case evReDraw:
DefineAndDrawWindow(X_EventRedrawWindow,Y_EventRedrawWindow,100,1,1,0x34,0xFFFFFF,"");
pause(10);
ExitProcess();
break;
}
}
:void EventRedrawWindow(dword x,y)
{
dword mem = malloc(4096);
X_EventRedrawWindow = x;
Y_EventRedrawWindow = y;
CreateThread(#_EventRedrawWindow,mem+4092);
}
 
:dword ALERT_TEXT;
:void dialog_alert()
{
841,7 → 864,6
break;
}
}
 
:dword alert(dword text)
{
dword mem = malloc(4096);
/programs/cmm/lib/mem.h
1,6 → 1,10
#ifndef INCLUDE_MEM_H
#define INCLUDE_MEM_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
dword mem_init()
{
$push ebx
/programs/cmm/lib/strings.h
116,7 → 116,18
}
}
 
/*
inline signed int strncmp(dword text1,text2,len)
{
 
loop()
{
if(DSBYTE[text1]!=DSBYTE[text2])return text1-text2;
$dec len
if(!len)return 0;
}
}
*/
inline fastcall unsigned int strlen( EDI)
{
$xor eax, eax