/programs/cmm/eolite/Eolite.c |
---|
117,7 → 117,6 |
PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; |
byte cmd_free=0; |
#include "include\translations.h" |
#include "include\fs.h" |
#include "include\settings.h" |
#include "include\progress_dialog.h" |
/programs/cmm/eolite/include/fs.h |
---|
File deleted |
/programs/cmm/eolite/include/copy.h |
---|
78,7 → 78,10 |
int paste_elements_count = 0; |
dword buf; |
dword path_offset; |
file_count_copy = 0; |
dword file_count_paste = 0; |
_dir_size paste_dir_size; |
BDVK file_info_count; |
copy_bar.value = 0; |
buf = Clipboard__GetSlotData(Clipboard__GetSlotCount()-1); |
88,11 → 91,14 |
//calculate copy files count for progress bar |
for (j = 0; j < paste_elements_count; j++) { |
GetFileInfo(path_offset, #file_info_count); |
if ( file_info_count.isfolder ) DirFileCount(path_offset); |
else file_count_copy++; |
if ( file_info_count.isfolder ) { |
paste_dir_size.get(path_offset); |
file_count_paste += paste_dir_size.files; |
} |
else file_count_paste++; |
path_offset += strlen(path_offset) + 1; |
} |
copy_bar.max = file_count_copy; |
copy_bar.max = file_count_paste; |
if (cut_active) operation_flag = MOVE_FLAG; |
else operation_flag = COPY_FLAG; |
/programs/cmm/eolite/include/delete.h |
---|
31,7 → 31,9 |
byte del_from[4096]; |
int tst, count, i; |
file_count_copy = 0; |
BDVK file_info_count; |
_dir_size delete_dir_size; |
dword file_count_delete = 0; |
copy_bar.value = 0; |
operation_flag = DELETE_FLAG; |
42,18 → 44,24 |
if (getElementSelectedFlag(i) == true) { |
sprintf(#del_from,"%s/%s",#path,file_mas[i]*304+buf+72); |
GetFileInfo(#del_from, #file_info_count); |
if ( file_info_count.isfolder ) DirFileCount(#del_from); |
else file_count_copy++; |
if ( file_info_count.isfolder ) { |
delete_dir_size.get(#del_from); |
file_count_delete += delete_dir_size.files; |
} |
else file_count_delete++; |
} |
} |
} |
else |
{ |
if (itdir) DirFileCount(#file_path); |
else file_count_copy++; |
if (itdir) { |
delete_dir_size.get(#file_path); |
file_count_delete += delete_dir_size.files; |
} |
else file_count_delete++; |
} |
copy_bar.max = file_count_copy; |
copy_bar.max = file_count_delete; |
del_error = 0; |
DisplayOperationForm(); |
/programs/cmm/eolite/include/properties.h |
---|
36,22 → 36,18 |
?define SET_BYTE_LANG "byte" |
#endif |
dword mouse_2; |
char path_to_file[4096]; |
char file_name2[4096]; |
edit_box file_name_ed = {230,59,32,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2),#file_name2,#mouse_2, 1000000000000000b,2,2}; |
edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,sizeof(path_to_file),#path_to_file,#mouse_2, 1000000000000000b,2,2}; |
edit_box file_name_ed = {230,59,32,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2),#file_name2,NULL, 1000000000000000b,2,2}; |
edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,sizeof(path_to_file),#path_to_file,NULL, 1000000000000000b,2,2}; |
int file_count, dir_count, size_dir; |
char folder_info[200]; |
dword element_size; |
char element_size_label[32]; |
BDVK file_info_general; |
BDVK file_info_dirsize; |
proc_info settings_form; |
bool quest_active; |
_dir_size more_files_count; |
checkbox ch_read_only = { PR_T_ONLY_READ, NULL }; |
checkbox ch_hidden = { PR_T_HIDDEN, NULL }; |
checkbox ch_system = { PR_T_SYSTEM, NULL }; |
147,38 → 143,6 |
DrawStandartCaptButton(155,138,302,T_NO); |
} |
void GetSizeDir(dword way) |
{ |
dword dirbuf, fcount, i, filename; |
dword cur_file; |
if (dir_exists(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) ) |
{ |
dir_count++; |
GetSizeDir(cur_file); |
} |
else |
{ |
GetFileInfo(cur_file, #file_info_dirsize); |
size_dir += file_info_dirsize.sizelo; |
file_count++; |
} |
} |
free(cur_file); |
free(dirbuf); |
} |
} |
void GetSizeMoreFiles(dword way) |
{ |
char cur_file[4096]; |
190,14 → 154,14 |
sprintf(#cur_file,"%s/%s",way,file_mas[i]*304+buf+72); |
if (TestBit(ESDWORD[file_mas[i]*304+buf+32], 4) ) |
{ |
GetSizeDir(#cur_file); |
dir_count++; |
more_files_count.calculate_loop(#cur_file); |
more_files_count.folders++; |
} |
else |
{ |
GetFileInfo(#cur_file, #file_info_dirsize); |
size_dir += file_info_dirsize.sizelo; |
file_count++; |
more_files_count.bytes += file_info_dirsize.sizelo; |
more_files_count.files++; |
} |
} |
} |
207,13 → 171,9 |
{ |
int id; |
DSBYTE[#folder_info]=0; |
file_count = 0; |
dir_count = 0; |
size_dir = 0; |
if (selected_count) |
{ |
more_files_count.get(NULL); |
GetSizeMoreFiles(#path); |
ch_read_only.checked = 0; |
ch_hidden.checked = 0; |
224,7 → 184,7 |
GetFileInfo(#file_path, #file_info_general); |
strcpy(#file_name2, #file_name); |
file_name_ed.size = strlen(#file_name2); |
if(itdir) GetSizeDir(#file_path); |
if(itdir) dir_size.get(#file_path); |
ch_read_only.checked = file_info_general.readonly; |
ch_hidden.checked = file_info_general.hidden; |
ch_system.checked = file_info_general.system; |
309,7 → 269,11 |
void DrawPropertiesWindow() |
{ |
proc_info settings_form; |
char element_size_label[32]; |
char folder_info[200]; |
dword ext1; |
dword element_size; |
incn y; |
char temp_path[sizeof(file_path)]; |
DefineAndDrawWindow(Form.left + 150,150,315,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0); |
326,9 → 290,9 |
if (selected_count) |
{ |
PropertiesDrawIcon(NULL, "<lot>"); |
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); |
sprintf(#folder_info,"%s%d%s%d",SET_6,more_files_count.files,SET_7,more_files_count.folders); |
WriteText(file_name_ed.left+4, 30, 0x90, system.color.work_text, #folder_info); |
sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(size_dir, NULL),size_dir,SET_BYTE_LANG); |
sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(more_files_count.bytes, NULL),more_files_count.bytes,SET_BYTE_LANG); |
WriteText(120, 97, 0x90, system.color.work_text, #element_size_label); |
} |
else |
348,9 → 312,9 |
else |
{ |
WriteText(10,116, 0x90, system.color.work_text, PR_T_CONTAINS); |
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); |
sprintf(#folder_info,"%s%d%s%d",SET_6,dir_size.files,SET_7,dir_size.folders); |
WriteText(120, 116, 0x90, system.color.work_text, #folder_info); |
element_size = size_dir; |
element_size = dir_size.bytes; |
} |
WriteTextLines(10, 136, 0x90, system.color.work_text, CREATED_OPENED_MODIFIED, 20); |
DrawDate(120, 136, system.color.work_text, #file_info_general.datecreate); |
/programs/cmm/eolite/include/translations.h |
---|
1,5 → 1,5 |
#define TITLE "Eolite File Manager v3.91" |
#define ABOUT_TITLE "EOLITE 3.91" |
#define TITLE "Eolite File Manager v3.92" |
#define ABOUT_TITLE "EOLITE 3.92" |
#ifdef LANG_RUS |
?define T_FILE " ©«" |
/programs/cmm/lib/fs.h |
---|
6,6 → 6,12 |
#include "../lib/date.h" |
#endif |
//===================================================// |
// // |
// Basic System Functions // |
// // |
//===================================================// |
:struct f70{ |
dword func; |
dword param1; |
156,7 → 162,6 |
$int 0x40 |
} |
:f70 read_dir_70; |
:int ReadDir(dword file_count, read_buffer, dir_path) |
{ |
172,6 → 177,12 |
$int 0x40 |
} |
//===================================================// |
// // |
// Misc // |
// // |
//===================================================// |
:bool dir_exists(dword fpath) |
{ |
char buf[32]; |
180,7 → 191,6 |
} |
/* |
// This implementation of dir_exists() is faster than |
// previous but here virtual folders like |
// '/' and '/tmp' are not recognised as FOLDERS |
194,7 → 204,6 |
} |
*/ |
:bool file_exists(dword fpath) |
{ |
BDVK ReadFile_atr; |
202,7 → 211,6 |
return false; |
} |
enum |
{ |
DIRS_ALL, |
269,6 → 277,23 |
return ini_path; |
} |
:dword notify(dword notify_param) |
{ |
return RunProgram("/sys/@notify", notify_param); |
} |
:void die(dword _last_msg) |
{ |
notify(_last_msg); |
ExitProcess(); |
} |
//===================================================// |
// // |
// Convert Size // |
// // |
//===================================================// |
:byte ConvertSize_size_prefix[8]; |
:dword ConvertSize(dword bytes) |
{ |
292,18 → 317,7 |
else return ConvertSize(bytes_lo); |
} |
:dword notify(dword notify_param) |
{ |
return RunProgram("/sys/@notify", notify_param); |
} |
:void die(dword _last_msg) |
{ |
notify(_last_msg); |
ExitProcess(); |
} |
:unsigned char size[25]=0; |
:unsigned char size[25]; |
:dword ConvertSizeToKb(unsigned int bytes) |
{ |
unsigned int kb; |
324,6 → 338,12 |
return #size; |
} |
//===================================================// |
// // |
// Copy // |
// // |
//===================================================// |
:int CopyFileAtOnce(dword size, copyFrom, copyTo) |
dword cbuf; |
int error; |
379,5 → 399,58 |
return error; |
} |
//===================================================// |
// // |
// Directory Size // |
// // |
//===================================================// |
:struct _dir_size |
{ |
BDVK dir_info; |
dword folders; |
dword files; |
dword bytes; |
void get(); |
void calculate_loop(); |
} dir_size; |
:void _dir_size::get(dword way) |
{ |
folders = files = bytes = 0; |
if (way) calculate_loop(way); |
} |
:void _dir_size::calculate_loop(dword way) |
{ |
dword dirbuf, fcount, i, filename; |
dword cur_file; |
if (dir_exists(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) ) |
{ |
folders++; |
calculate_loop(cur_file); |
} |
else |
{ |
GetFileInfo(cur_file, #dir_info); |
bytes += dir_info.sizelo; |
files++; |
} |
} |
free(cur_file); |
free(dirbuf); |
} |
} |
#endif |
/programs/cmm/lib/obj/libini.h |
---|
41,7 → 41,7 |
// // |
//===================================================// |
struct _ini |
:struct _ini |
{ |
dword path; |
dword section; |
53,23 → 53,23 |
void SetString(); |
}; |
int _ini::GetInt(dword key, default_value) |
:int _ini::GetInt(dword key, default_value) |
{ |
ini_get_int stdcall (path, section, key, default_value); |
return EAX; |
} |
void _ini::SetInt(dword key, value) |
:void _ini::SetInt(dword key, value) |
{ |
ini_set_int stdcall (path, section, key, value); |
} |
void _ini::GetString(dword key, dst, len, default_value) |
:void _ini::GetString(dword key, dst, len, default_value) |
{ |
ini_get_str stdcall (path, section, key, dst, len, default_value); |
} |
void _ini::SetString(dword key, value, len) |
:void _ini::SetString(dword key, value, len) |
{ |
ini_set_str stdcall (path, section, key, value, len); |
} |
/programs/cmm/sysmon/sysmon.c |
---|
1,6 → 1,6 |
/* |
* System Monitor |
* version 0.7 |
* version 0.85 |
* Author: Leency |
*/ |
8,6 → 8,7 |
#include "../lib/io.h" |
#include "../lib/gui.h" |
#include "../lib/fs.h" |
#include "../lib/obj/libio.h" |
#include "../lib/obj/libimg.h" |
21,7 → 22,7 |
#define MIN_PB_BLOCK_W 19 |
#define LOAD_BG 0xFFFfff |
#define LOAD_ACTIVE 0x4C52FF |
#define LOAD_ACTIVE 0x3887EE |
struct sensor { |
int x,y,w,h; |
36,6 → 37,7 |
y=_y; |
w=_w; |
h=_h; |
draw_wrapper(); |
} |
void sensor::draw_wrapper() |
60,57 → 62,6 |
//===================================================// |
// // |
// GetSizeDir // |
// // |
//===================================================// |
BDVK file_info_dirsize; |
dword dir_count; |
dword file_count; |
dword size_dir; |
void GetDirSizeAndCountFiles(dword way) |
{ |
dir_count=0; |
file_count=0; |
size_dir=0; |
GetDirSizeAndCountFiles_loop(way); |
} |
void GetDirSizeAndCountFiles_loop(dword way) |
{ |
dword dirbuf, fcount, i, filename; |
dword cur_file; |
if (dir_exists(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) ) |
{ |
dir_count++; |
GetDirSizeAndCountFiles_loop(cur_file); |
} |
else |
{ |
GetFileInfo(cur_file, #file_info_dirsize); |
size_dir += file_info_dirsize.sizelo; |
file_count++; |
} |
} |
free(cur_file); |
free(dirbuf); |
} |
} |
//===================================================// |
// // |
// DATA // |
// // |
//===================================================// |
123,6 → 74,8 |
sensor rd; |
sensor tmp[10]; |
dword tmp_size[10]; |
//===================================================// |
// // |
// CODE // |
141,6 → 94,8 |
load_dll(libimg, #libimg_init,1); |
load_dll(libini, #lib_init,1); |
GetTmpDiskSizesFromIni(); |
loop() |
{ |
WaitEventTimeout(25); |
163,33 → 118,21 |
GetProcessInfo(#Form, SelfInfo); |
y.n = 0; |
WriteTextB(LEFT+ICONGAP, y.inc(20), 0x90, system.color.work_text, "CPU load"); |
DrawIcon32(LEFT, y.n, system.color.work, 37); |
if (cpu_frequency < 1000) sprintf(#param, "CPU frequency: %i Hz", cpu_frequency); |
else sprintf(#param, "CPU frequency: %i MHz", cpu_frequency/1000); |
WriteText(LEFT+ICONGAP, y.inc(20), 0x90, system.color.work_text, #param); |
cpu.set_size(LEFT, y.inc(25), CPU_STACK, 100); |
cpu.draw_wrapper(); |
DrawBlockHeader(LEFT, y.inc(20), 37, "CPU load", #param); |
cpu.set_size(LEFT, y.inc(45), CPU_STACK, 100); |
WriteTextB(LEFT+ICONGAP, y.inc(cpu.h + 25), 0x90, system.color.work_text, "RAM usage"); |
DrawIcon32(LEFT, y.n, system.color.work, 36); |
sprintf(#param, "Total RAM: %i MiB", GetTotalRAM()/1024); |
WriteText(LEFT+ICONGAP, y.inc(20), 0x90, system.color.work_text, #param); |
ram.set_size(LEFT, y.inc(25), CPU_STACK, 25); |
ram.draw_wrapper(); |
DrawBlockHeader(LEFT, y.inc(cpu.h + 25), 36, "RAM usage", #param); |
ram.set_size(LEFT, y.inc(45), CPU_STACK, 23); |
WriteTextB(LEFT+ICONGAP, y.inc(ram.h + 25), 0x90, system.color.work_text, "System RAM Disk usage"); |
DrawIcon32(LEFT, y.n, system.color.work, 3); |
WriteText(LEFT+ICONGAP, y.inc(20), 0x90, system.color.work_text, "Fixed size: 1.44 MiB"); |
rd.set_size(LEFT, y.inc(25), CPU_STACK, 25); |
rd.draw_wrapper(); |
DrawBlockHeader(LEFT, y.inc(ram.h + 25), 3, "System RAM Disk usage", "Fixed size: 1.44 MiB"); |
rd.set_size(LEFT, y.inc(45), CPU_STACK, 23); |
WriteTextB(LEFT+ICONGAP, y.inc(ram.h + 25), 0x90, system.color.work_text, "Virtual drive usage"); |
DrawIcon32(LEFT, y.n, system.color.work, 50); |
WriteText(LEFT+ICONGAP, y.inc(20), 0x90, system.color.work_text, "TMP Disk 0 size: 49 MiB"); |
tmp[0].set_size(LEFT, y.inc(25), CPU_STACK, 25); |
tmp[0].draw_wrapper(); |
sprintf(#param, "TMP Disk 0 size: %i MiB", tmp_size[0]); |
DrawBlockHeader(LEFT, y.inc(rd.h + 25), 50, "Virtual drive usage", #param); |
tmp[0].set_size(LEFT, y.inc(45), CPU_STACK, 23); |
default: |
MonitorCpu(); |
201,33 → 144,41 |
"M" |
); |
GetDirSizeAndCountFiles("/rd/1"); |
size_dir += 32*512; //add FAT table size |
size_dir += file_count*512/2; //add MAGIC NUMBER |
size_dir /= 1024; //convert to KiB |
size_dir= 1440 - size_dir; |
dir_size.get("/rd/1"); |
dir_size.bytes += dir_size.files/2 + 32 * 512; //file attr size + FAT table size |
dir_size.bytes /= 1024; //convert to KiB |
dir_size.bytes = 1440 - dir_size.bytes; |
rd.draw_progress( |
size_dir*rd.w/1440, |
1440-size_dir, |
size_dir, |
dir_size.bytes*rd.w/1440, |
1440 - dir_size.bytes, |
dir_size.bytes, |
"K" |
); |
GetDirSizeAndCountFiles("/tmp0/1"); |
size_dir += 32*512; //add FAT table size |
size_dir += file_count*512/2; //add MAGIC NUMBER |
size_dir /= 1024*1024; //convert to MiB |
size_dir= 49 - size_dir; |
if (tmp_size[0]) { |
dir_size.get("/tmp0/1"); |
dir_size.bytes += dir_size.files/2 + 32 * 512; //file attr size + FAT table size |
dir_size.bytes /= 1024*1024; //convert to MiB |
dir_size.bytes= tmp_size[0] - dir_size.bytes; |
tmp[0].draw_progress( |
size_dir*tmp[0].w/49, |
49-size_dir, |
size_dir, |
dir_size.bytes*tmp[0].w/tmp_size[0], |
tmp_size[0] - dir_size.bytes, |
dir_size.bytes, |
"M" |
); |
} |
} |
} |
} |
void DrawBlockHeader(dword _x, _y, _icon, _title, _subtitle) |
{ |
WriteTextB(_x+ICONGAP, _y, 0x90, system.color.work_text, _title); |
DrawIcon32(_x, _y, system.color.work, _icon); |
WriteText(_x+ICONGAP, _y+20, 0x90, system.color.work_text, _subtitle); |
} |
dword GetCpuLoad(dword max_h) |
{ |
dword idle; |
243,6 → 194,18 |
return max_h - idle; |
} |
_ini ini = { "/sys/settings/system.ini", "DiskSizes" }; |
void GetTmpDiskSizesFromIni() |
{ |
char i, key[2]; |
key[1]=0; |
for (i=0; i<=9; i++) |
{ |
key[0]=i+'0'; |
tmp_size[i] = ini.GetInt(#key, 0) / 1024 / 1024; |
} |
} |
//===================================================// |
// // |
// MONITORS // |