/programs/cmm/eolite/Eolite.c |
---|
164,7 → 164,7 |
edit_box new_file_ed = {150,213,80,0xFFFFFF,0x94AECE,0x000000,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0}; |
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0}; |
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; |
byte cmd_free; |
#include "include\copy.h" |
#include "include\gui.h" |
#include "include\sorting.h" |
176,6 → 176,8 |
#include "include\settings.h" |
#include "include\properties.h" |
dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak; |
void main() |
{ |
word key, id, can_show, can_select, m_selected; |
202,7 → 204,7 |
} |
Open_Dir(#path,ONLY_OPEN); |
SetEventMask(0x27); |
loop() switch(WaitEvent()) |
loop(){ switch(WaitEvent()) |
{ |
case evMouse: |
if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break; |
256,66 → 258,17 |
} |
} |
} |
/* |
if (files.MouseOver(m.x, m.y)) && (!can_select) |
if (files.MouseOver(m.x, m.y))&&((m.up)||(m.down)||(m.dblclick)) |
{ |
m_selected = m.y - files.y / files.line_h; |
if (m.lkm) can_select = 1; |
if (m.pkm) |
{ |
can_show = 1; |
if (m.y - files.y / files.line_h != files.current) can_select = 1; |
} |
} |
//select/open file { |
if (!m.lkm) && (!m.pkm) && (can_select) |
if (m.key&MOUSE_LEFT)&&((m.down)||(m.dblclick)) |
{ |
can_select = 0; |
if (m.y>=files.y) |
{ |
id = m.y - files.y / files.line_h; |
if (id!=m_selected) |
{ |
can_show=0; |
break; |
} |
if (files.current!=id) |
{ |
if (id<files.visible) List_Current(id-files.current); |
} |
else |
Open(0); |
} |
}; |
// } select/open file |
//file menu { |
if (!m.pkm) && (!m.lkm) && (can_show) |
{ |
can_show = 0; |
menu_call_mouse = 1; |
if (m.y>=files.y) |
{ |
SwitchToAnotherThread(); |
CreateThread(#FileMenu,#menu_stak+4092); |
} |
break; |
} |
// } file menu |
*/ |
if (files.MouseOver(m.x, m.y))&&(m.up) |
{ |
//select/open file { |
if (m.key&MOUSE_LEFT) |
{ |
if (m.y>=files.y)//&&(m.click) |
{ |
id = m.y - files.y / files.line_h; |
if (files.current!=id) |
{ |
m.clearTime(); |
if (id<files.visible) List_Current(id-files.current); |
} |
else if(m.dblclick)Open(0); |
324,15 → 277,16 |
// } select/open file |
else |
//file menu { |
if (m.key&MOUSE_RIGHT) |
if (m.key&MOUSE_RIGHT)&&(m.up) |
{ |
menu_call_mouse = 1; |
if (m.y>=files.y)&&(m.click) |
if (m.y>=files.y)//&&(m.click) |
{ |
id = m.y - files.y / files.line_h; |
if (files.current!=id) List_Current(id-files.current); |
SwitchToAnotherThread(); |
CreateThread(#FileMenu,#menu_stak+4092); |
//SwitchToAnotherThread(); |
menu_stak = malloc(4096); |
CreateThread(#FileMenu,menu_stak+4092); |
} |
break; |
} |
427,7 → 381,8 |
Copy(#file_path, NOCUT); |
break; |
case 26: //paste |
CreateThread(#Paste,#copy_stak+4092); |
copy_stak = malloc(4096); |
CreateThread(#Paste,copy_stak+4092); |
break; |
case 31...33: //sort |
IF(sort_num==1) DrawFilledBar(sorting_arrow_x,42,6,10); |
500,7 → 455,8 |
Copy(#file_path, NOCUT); |
break; |
case 022: //Ctrl+V |
CreateThread(#Paste,#copy_stak+4092); |
copy_stak = malloc(4096); |
CreateThread(#Paste,copy_stak+4092); |
break; |
case 001: //Ctrl+A |
debugln("press Ctrl+A"); |
530,8 → 486,9 |
break; |
case 074: //menu |
menu_call_mouse=0; |
SwitchToAnotherThread(); |
CreateThread(#FileMenu,#menu_stak+4092); |
//SwitchToAnotherThread(); |
menu_stak = malloc(4096); |
CreateThread(#FileMenu,menu_stak+4092); |
break; |
case 173: //Ctrl+Enter |
if (!itdir) ShowOpenWithDialog(); |
591,7 → 548,16 |
draw_window(); |
if (action_buf) { menu_action(action_buf); action_buf=0;} |
} |
if(cmd_free){ |
if(cmd_free==1) free(menu_stak); |
else if(cmd_free==2)free(about_stak); |
else if(cmd_free==3)free(properties_stak); |
else if(cmd_free==4)free(settings_stak); |
else if(cmd_free==5)free(copy_stak); |
cmd_free = 0; |
} |
} |
} |
inline fastcall signed int _strrchr( ESI,BL) |
619,7 → 585,7 |
if (id==203) FnProcess(4); //F4 |
if (id==104) Copy(#file_path, NOCUT); |
if (id==105) Copy(#file_path, CUT); |
if (id==106) CreateThread(#Paste,#copy_stak+4092); |
if (id==106) { copy_stak = malloc(4096); CreateThread(#Paste,copy_stak+4092);} |
if (id==207) FnProcess(2); |
if (id==108) Del_Form(); |
if (id==109) FnProcess(5); |
645,7 → 611,7 |
DrawBar(246,0,Form.cwidth - 297,12, sc.work); //upper editbox |
DrawBar(246,29,Form.cwidth - 297,5,sc.work); //under editbox |
DrawRectangle(246,12,Form.cwidth - 303,16,sc.work_graph); |
DefineButton(Form.cwidth - 25,6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about |
DefineButton(Form.cwidth - 32,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 |
DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),sc.work_graph); |
899,9 → 865,10 |
} |
if (cont) |
{ |
strcpy(#f_count, DEL_MORE_FILES_1); |
/*strcpy(#f_count, DEL_MORE_FILES_1); |
strcat(#f_count, itoa(cont)); |
strcat(#f_count, DEL_MORE_FILES_2); |
strcat(#f_count, DEL_MORE_FILES_2);*/ |
sprintf(#f_count,"%s%d%s",DEL_MORE_FILES_1,cont,DEL_MORE_FILES_2); |
WriteText(-strlen(#f_count)*3+110+dform_x,190,0x80,sc.work_text,#f_count); |
} |
else |
1157,7 → 1124,7 |
DrawFlatButton(dform_x+120,208,70,20,302,0xC6DFC6,T_CANCEL); |
} |
void FnProcess(char N) |
void FnProcess(byte N) |
{ |
switch(N) |
{ |
1164,8 → 1131,9 |
case 1: |
if (!active_about) |
{ |
SwitchToAnotherThread(); |
about_window=CreateThread(#about_dialog,#about_stak+4092); |
//SwitchToAnotherThread(); |
about_stak = malloc(4096); |
about_window = CreateThread(#about_dialog,about_stak+4092); |
break; |
} |
else |
1231,14 → 1199,16 |
NewElement_Form(1, T_NEW_FILE); |
break; |
case 8: |
SwitchToAnotherThread(); |
CreateThread(#properties_dialog, #properties_stak+4092); |
//SwitchToAnotherThread(); |
properties_stak = malloc(8096); |
CreateThread(#properties_dialog, properties_stak+8092); |
break; |
case 10: //F10 |
if (!active_settings) |
{ |
SwitchToAnotherThread(); |
settings_window=CreateThread(#settings_dialog, #settings_stak+4092); |
//SwitchToAnotherThread(); |
settings_stak = malloc(4096); |
settings_window = CreateThread(#settings_dialog, settings_stak+4092); |
break; |
} |
else |
1254,10 → 1224,3 |
stop: |
char menu_stak[4096]; |
char copy_stak[4096]; |
char open_with_stak[4096]; |
char about_stak[4096]; |
char properties_stak[4096]; |
char settings_stak[4096]; |
/programs/cmm/eolite/include/about.h |
---|
25,7 → 25,7 |
byte id; |
proc_info about_form; |
IF (active_about) ExitProcess(); |
IF (active_about){cmd_free = 2;ExitProcess();} |
active_about=1; |
loop() switch(WaitEvent()) |
{ |
34,6 → 34,7 |
IF (id==1) || (id==10) |
{ |
active_about=0; |
cmd_free = 2; |
ExitProcess(); |
} |
IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK); |
43,23 → 44,24 |
IF (GetKey()==27) |
{ |
active_about=0; |
cmd_free = 2; |
ExitProcess(); |
} |
break; |
case evReDraw: |
DefineAndDrawWindow(Form.left + 200,150,181,228+GetSkinHeight(),0x34,sc.work,INTRO_TEXT_1); |
DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,300,228+GetSkinHeight(),0x34,sc.work,INTRO_TEXT_1); |
GetProcessInfo(#about_form, SelfInfo); |
if (Form.status_window>2) break; |
DrawBar(0,0,about_form.cwidth,50,0x8494C4); |
PutPaletteImage(#logo,85,85,43,7,8,#logo_pal); |
WriteTextB(46,100,0x90,0xBF40BF,ABOUT_TITLE); |
PutPaletteImage(#logo,85,85,about_form.width/2-43,7,8,#logo_pal); |
WriteTextB(about_form.width/2-46,100,0x90,0xBF40BF,ABOUT_TITLE); |
WriteTextCenter(0,120,about_form.cwidth,0,INTRO_TEXT_2); |
WriteTextCenter(0,130,about_form.cwidth,0,"Leency Veliant PunkJoker"); |
WriteTextCenter(0,130,about_form.cwidth,0,"Leency Veliant PunkJoker Pavelyakov"); |
WriteTextCenter(0,140,about_form.cwidth,0,"KolibriOS Team"); |
WriteTextCenter(0,150,about_form.cwidth,0,"2008-2015"); |
WriteTextCenter(10,170,70,0,INTRO_TEXT_3); |
DrawLink(71,170,0x80,23, "kolibri-n.org"); |
DrawFlatButton(85,190,70,22,10,0xE4DFE1, INTRO_TEXT_4); |
WriteTextCenter(10,170,about_form.width-125,0,INTRO_TEXT_3); |
DrawLink(about_form.width/2-15,170,0x80,23, "kolibri-n.org"); |
DrawFlatButton(about_form.width/2-35,about_form.height-60,70,22,10,0xE4DFE1, INTRO_TEXT_4); |
} |
} |
/programs/cmm/eolite/include/left_panel.h |
---|
9,6 → 9,15 |
60, " áâனª¨", "F10", |
0,0,0 |
}; |
?define T_PROG "à®£à ¬¬ë " |
?define T_SYS "¨á⥬ " |
?define T_UNC "¥¨§¢¥áâ® " |
?define T_CD "CD-ROM " |
?define T_FD "¨áª¥â " |
?define T_HD "¥á⪨© ¤¨áª " |
?define T_SATA "SATA ¤¨áª " |
?define T_USB "USB ¤¨áª " |
?define T_RAM "RAM ¤¨áª " |
#elif LANG_EST |
?define T_DEVICES "Seadmed" |
?define T_ACTIONS "Toimingud" |
18,6 → 27,15 |
60, "Seaded", "F10", |
0,0,0 |
}; |
?define T_PROG "Programs " |
?define T_SYS "System " |
?define T_UNC "Unknown " |
?define T_CD "CD-ROM " |
?define T_FD "Floppy disk " |
?define T_HD "Hard disk " |
?define T_SATA "SATA disk" |
?define T_USB "USB disk" |
?define T_RAM "RAM disk" |
#else |
?define T_DEVICES "Devices" |
?define T_ACTIONS "Actions" |
27,6 → 45,15 |
60, "Settings", "F10", |
0,0,0 |
}; |
?define T_PROG "Programs " |
?define T_SYS "System " |
?define T_UNC "Unknown " |
?define T_CD "CD-ROM " |
?define T_FD "Floppy disk " |
?define T_HD "Hard disk " |
?define T_SATA "SATA disk" |
?define T_USB "USB disk" |
?define T_RAM "RAM disk" |
#endif |
50,7 → 77,7 |
void GetSystemDiscs() |
{ |
char dev_name[10], sys_discs[10]; |
int i1, j1, dev_num, dev_disc_num; |
int i1, j1, dev_num, dev_disc_num,l; |
disc_num=0; |
if (devbuf) free(devbuf); |
devbuf = malloc(10000); //áóôåð ãäå-òî íà 10 äåâàéñîâ â ëåâîé ïàíåëè |
58,31 → 85,28 |
dev_num = EBX; |
for (i1=0; i1<dev_num; i1++) |
{ |
strcpy(#dev_name, "/"); // / |
strcat(#dev_name, i1*304+ devbuf+72); // /rd |
strcat(#dev_name, "/"); // /rd/ |
sprintf(#dev_name,"/%s/",i1*304+ devbuf+72); |
Open_Dir(#dev_name, ONLY_OPEN); |
dev_disc_num = files.count; |
//if (files.count<=0) copystr(#dev_name,#disk_list[disc_num].Item); else |
for (j1=0; j1<dev_disc_num; j1++;) |
{ |
strcpy(#sys_discs, #dev_name); // /rd/ |
strcat(#sys_discs, j1*304+ buf+72); // /rd/1 |
strcat(#sys_discs, "/"); // /rd/1/ |
strcpy(#disk_list[disc_num].Item, #sys_discs); |
l=sprintf(#sys_discs,"%s%s/",#dev_name,j1*304+ buf+72); |
strncpy(#disk_list[disc_num].Item, #sys_discs,l); |
disc_num++; |
} |
if (strcmp(#sys_discs, "/rd/1/")==0) |
if (strncmp(#sys_discs, "/rd/1/",6)==0) |
{ |
if (isdir("/kolibrios")) |
{ |
strcpy(#disk_list[disc_num].Item, "/kolibrios/"); |
strncpy(#disk_list[disc_num].Item, "/kolibrios/",11); |
kolibrios_drive = true; |
disc_num++; |
} else kolibrios_drive = false; |
} |
else kolibrios_drive = false; |
} |
} |
} |
void DrawSystemDiscs() |
102,40 → 126,40 |
{ |
case 'k': |
dev_icon=0; |
strcpy(#disc_name, "Programs "); |
strcpy(#disc_name, T_PROG); |
break; |
case 'r': |
dev_icon=0; |
strcpy(#disc_name, "System "); |
strcpy(#disc_name, T_SYS); |
break; |
case 'c': |
dev_icon=1; |
strcpy(#disc_name, "CD-ROM "); |
strcpy(#disc_name, T_CD); |
break; |
case 'f': |
dev_icon=2; |
strcpy(#disc_name, "Floppy disk "); |
strcpy(#disc_name, T_FD); |
break; |
case 'h': |
case 'b': |
dev_icon=3; |
strcpy(#disc_name, "Hard disk "); |
strcpy(#disc_name, T_HD); |
break; |
case 's': |
dev_icon=3; |
strcpy(#disc_name, "SATA disk "); |
strcpy(#disc_name, T_SATA); |
break; |
case 'u': |
dev_icon=5; |
strcpy(#disc_name, "USB flash "); |
strcpy(#disc_name, T_USB); |
break; |
case 't': |
dev_icon=4; |
strcpy(#disc_name, "RAM disk "); |
strcpy(#disc_name, T_RAM); |
break; |
default: |
dev_icon=3; //ïî-óìîë÷àíèþ óñòðîéñòâî âûãëÿäèò êàê æåñòÿê íî ýòî íåïðàâèëüíî |
strcpy(#disc_name, "Unknown "); |
strcpy(#disc_name, T_UNC); |
} |
strcat(#disc_name, #dev_name); |
if (show_dev_name) WriteText(45,i*16+79,0x80,0,#disc_name); else WriteText(45,i*16+79,0x80,0,#dev_name); |
/programs/cmm/eolite/include/menu.h |
---|
72,16 → 72,16 |
loop() switch(WaitEvent()) |
{ |
case evMouse: |
if (!CheckActiveProcess(MenuForm.ID)) ExitProcess(); |
mm.get(); |
if (menu.ProcessMouse(mm.x, mm.y)) MenuListRedraw(); |
if (mm.key&MOUSE_LEFT)&&(m.click) {action_buf = cur_action_buf; pause(5); ExitProcess(); } |
if (!CheckActiveProcess(MenuForm.ID)){ cmd_free=1; ExitProcess();} |
else if (mm.move)&&(menu.ProcessMouse(mm.x, mm.y)) MenuListRedraw(); |
else if (mm.key&MOUSE_LEFT)&&(mm.down) {action_buf = cur_action_buf; pause(5); cmd_free=1; ExitProcess(); } |
break; |
case evKey: |
key = GetKey(); |
if (key==27) ExitProcess(); |
if (key == 13) {action_buf = cur_action_buf; ExitProcess(); } |
if (key==27){cmd_free=1;ExitProcess();} |
else if (key == 13) {action_buf = cur_action_buf; cmd_free=1; ExitProcess(); } |
if (menu.ProcessKey(key)) MenuListRedraw(); |
break; |
/programs/cmm/eolite/include/properties.h |
---|
66,9 → 66,7 |
for (i=0; i<fcount; i++) |
{ |
filename = i*304+dirbuf+72; |
strcpy(#cur_file, way); |
chrcat(#cur_file, '/'); |
strcat(#cur_file, filename); |
sprintf(#cur_file,"%s/%s",way,filename); |
if ( TestBit(ESDWORD[filename-40], 4) ) |
{ |
dir_count++; |
98,8 → 96,7 |
{ |
selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
if (ESBYTE[selected_offset2]) { |
strcpy(#cur_file, way); |
strcat(#cur_file, file_mas[i]*304+buf+72); |
sprintf(#cur_file,way,file_mas[i]*304+buf+72); |
GetFileInfo(#cur_file, #file_info_general); |
if ( file_info_general.isfolder ) |
128,10 → 125,10 |
dword file_name_off; |
dword element_size; |
dword selected_offset2; |
char element_size_label[32]; |
char element_size_label[32],tmp; |
proc_info settings_form; |
strcpy(#folder_info, "\0"); |
DSBYTE[#folder_info]=0; |
file_count = 0; |
dir_count = 0; |
size_dir = 0; |
152,7 → 149,7 |
{ |
case evButton: |
id=GetButtonID(); |
IF (id==1) || (id==10) ExitProcess(); |
IF (id==1) || (id==10){cmd_free=3;ExitProcess();} |
if (id==20) SetProperties(id); |
if (id==21) SetProperties(id); |
if (id==22) SetProperties(id); |
166,7 → 163,7 |
case evKey: |
key = GetKey(); |
IF (key==27) ExitProcess(); |
IF (key==27){cmd_free=3;ExitProcess();} |
EAX=key<<8; |
edit_box_key stdcall(#file_name_ed); |
edit_box_key stdcall(#path_to_file_ed); |
186,10 → 183,7 |
if (selected_count) |
{ |
Put_icon('', 18, 19, 0xFFFfff, 0); |
strcpy(#folder_info, SET_6); |
strcat(#folder_info, itoa(file_count)); |
strcat(#folder_info, SET_7); |
strcat(#folder_info, itoa(dir_count)); |
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); |
WriteText(50, 23, 0x80, 0x000000, #folder_info); |
EAX = ConvertSize(size_dir); |
strcpy(#element_size_label, EAX); |
196,6 → 190,8 |
strcat(#element_size_label, " ("); |
strcat(#element_size_label, itoa(size_dir)); |
strcat(#element_size_label, " b)"); |
//tmp = ConvertSize(size_dir); |
//sprintf(#element_size_label," ( byte)"); |
WriteText(100, 65, 0x80, 0x000000, #element_size_label); |
} |
else |
215,10 → 211,7 |
else |
{ |
WriteText(10, 80, 0x80, 0x000000, PR_T_CONTAINS); |
strcpy(#folder_info, SET_6); |
strcat(#folder_info, itoa(file_count)); |
strcat(#folder_info, SET_7); |
strcat(#folder_info, itoa(dir_count)); |
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); |
WriteText(100, 80, 0x80, 0x000000, #folder_info); |
element_size = size_dir; |
} |
235,6 → 228,9 |
strcat(#element_size_label, " ("); |
strcat(#element_size_label, itoa(element_size)); |
strcat(#element_size_label, " b)"); |
//sprintf(#element_size_label,"%s (%d byte)","",element_size); |
//tmp = ConvertSize(element_size); |
//sprintf(#element_size_label,"%s (%d byte)",tmp,element_size); |
WriteText(100, 65, 0x80, 0x000000, #element_size_label); |
flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2; |
/programs/cmm/eolite/include/settings.h |
---|
12,6 → 12,7 |
?define NOTIFY_COPY_END "¢¥¤®¬«ïâì ® § ¢¥à襨¨ ª®¯¨à®¢ ¨ï" |
?define CANCEL_T "⬥ " |
?define APPLY_T "ਬ¥¨âì" |
?define T_DOUBLE_CLICK "à¥¬ï ¤¢®©®£® ª«¨ª (¢ á®âëå)" |
#else |
?define EDIT_FILE_ASSOCIATIONS "Edit file associations" |
?define TITLE_SETT "Settings" |
22,6 → 23,7 |
?define NOTIFY_COPY_END "Notify when copying finished" |
?define CANCEL_T "Cancel" |
?define APPLY_T "Apply" |
?define T_DOUBLE_CLICK "Time double click (in hundredths)" |
#endif |
char confir_section = "Config"; |
33,11 → 35,16 |
unsigned int key; |
proc_info settings_form; |
if (active_settings) ExitProcess(); |
if (active_settings){cmd_free = 4;ExitProcess();} |
active_settings=1; |
SetEventMask(0x27); |
loop() switch(WaitEvent()) |
loop(){ |
switch(WaitEvent()) |
{ |
case evMouse: |
break; |
case evButton: |
id=GetButtonID(); |
if (id==10) |
45,11 → 52,13 |
SaveIniSettings(); |
active_settings=0; |
action_buf = 300; |
cmd_free = 4; |
ExitProcess(); |
} |
if (id==1) || (id==11) |
{ |
active_settings=0; |
cmd_free = 4; |
ExitProcess(); |
} |
if (id==5) |
63,6 → 72,8 |
if (id==23) use_big_fonts ^= 1; |
if (id==25) files.line_h++; |
if (id==26) && (files.line_h>8) files.line_h--; |
if (id==27) MOUSE_TIME++; |
if (id==28) && (MOUSE_TIME>30) MOUSE_TIME--; |
DrawSettingsCheckBoxes(); |
break; |
72,19 → 83,21 |
{ |
active_settings = 0; |
action_buf = 300; |
cmd_free = 4; |
ExitProcess(); |
} |
break; |
case evReDraw: |
DefineAndDrawWindow(Form.left + 100, 150, 300, 232+GetSkinHeight(),0x34,sc.work,TITLE_SETT); |
DefineAndDrawWindow(Form.left + Form.width/2, Form.top + Form.height/2 - 75, 300, 232+GetSkinHeight(),0x34,sc.work,TITLE_SETT); |
GetProcessInfo(#settings_form, SelfInfo); |
DrawSettingsCheckBoxes(); |
DrawFlatButton(9, 138, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS); |
DrawFlatButton(128, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, APPLY_T); |
DrawFlatButton(208, settings_form.cheight - 34, 70, 22, 11, 0xE4DFE1, CANCEL_T); |
DrawFlatButton(9, 168, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS); |
DrawFlatButton(128, settings_form.cheight - 30, 70, 22, 10, 0xE4DFE1, APPLY_T); |
DrawFlatButton(208, settings_form.cheight - 30, 70, 22, 11, 0xE4DFE1, CANCEL_T); |
} |
} |
} |
void DrawSettingsCheckBoxes() |
{ |
93,6 → 106,7 |
CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy); |
CheckBox2(10, 77, 23, USE_BIG_FONTS, use_big_fonts); |
MoreLessBox(10, 104, 18, 25, 26, #sc, files.line_h, LIST_LINE_HEIGHT); |
MoreLessBox(10, 134, 18, 27, 28, #sc, MOUSE_TIME, T_DOUBLE_CLICK); |
} |
127,6 → 141,7 |
ini_set_int stdcall (eolite_ini_path, #confir_section, "InfoAfterCopy", info_after_copy); |
ini_set_int stdcall (eolite_ini_path, #confir_section, "UseBigFonts", use_big_fonts); |
ini_set_int stdcall (eolite_ini_path, #confir_section, "LineHeight", files.line_h); |
ini_set_int stdcall (eolite_ini_path, #confir_section, "TimeDoubleClick", MOUSE_TIME); |
} |
137,11 → 152,9 |
dword ii; |
if (files.current>=0) Line_ReDraw(0xFF0000, files.current); |
pause(5); |
strcpy(#error_message, "\"Eolite\n"); |
ii = get_error(error_number); |
strcat(#error_message, ii); |
strcat(#error_message, "\" -tE"); |
sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE"); |
notify(#error_message); |
} |
/programs/cmm/lib/dll.h |
---|
1,5 → 1,25 |
char a_libdir[43] = "/sys/lib/\0"; |
:inline void error_init(dword text) |
{ |
dword l,ll; |
dword TEXT_ERROR = malloc(1024); |
#ifdef LANG_RUS |
strcpy(TEXT_ERROR,"'訡ª ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ `"); |
#elif LANG_EST |
strcpy(TEXT_ERROR,"'Viga teegi laadimisel `"); |
#else |
strcpy(TEXT_ERROR,"'Error while loading library `"); |
#endif |
ll = strlen(TEXT_ERROR); |
strcpy(TEXT_ERROR+ll,text); |
l = strlen(text); |
strncpy(TEXT_ERROR+ll+l,"`' -E",4); |
notify(TEXT_ERROR); |
free(TEXT_ERROR); |
ExitProcess(); |
} |
// stdcall with 1 parameter |
void dll_Load() { |
asm { |
213,4 → 233,5 |
return 0; |
@exit01: |
return -1; |
//error_init(dllname); |
} |
/programs/cmm/lib/file_system.h |
---|
31,8 → 31,9 |
}; |
:void DrawDate(dword x, y, color, dword in_date) |
:void DrawDate(dword x, y, color, in_date) |
{ |
//char text[10]; |
EDI = in_date; |
EAX = 47; |
EBX = 2<<16; |
47,6 → 48,9 |
EBX = 4<<16; |
ECX = EDI.date.year; |
$int 0x40; |
//sprintf(#text,"%d.%d.%d",EDI.date.day,EDI.date.month,EDI.date.year); |
//WriteText(x, y, 0x80, 0x80<<24+color, #text); |
} |
297,9 → 301,9 |
return #absolute_path; |
} |
:dword ConvertSize(unsigned int bytes) |
:dword ConvertSize(dword bytes) |
{ |
unsigned char size_prefix[8], size_nm[4]; |
byte size_prefix[8], size_nm[4]; |
if (bytes>=1073741824) strcpy(#size_nm, " Gb"); |
else if (bytes>=1048576) strcpy(#size_nm, " Mb"); |
else if (bytes>=1024) strcpy(#size_nm, " Kb"); |
307,6 → 311,7 |
while (bytes>1023) bytes/=1024; |
itoa_(#size_prefix, bytes); |
strcat(#size_prefix, #size_nm); |
//sprintf(#size_prefix,"%s","123"); |
return #size_prefix; |
} |
/programs/cmm/lib/kolibri.h |
---|
1,5 → 1,7 |
//CODED by Veliant, Leency, Nable. GNU GPL licence. |
#define LIB_KOLIBRI_H |
#startaddress 0 |
#code32 TRUE |
23,10 → 25,12 |
#define evReDraw 1 |
#define evKey 2 |
#define evButton 3 |
#define evDesktop 5 |
#define evMouse 6 |
#define evIPC 7 |
#define evNetwork 8 |
#define evDebug 9 |
//Button options |
#define BT_DEL 0x80000000 |
#define BT_HIDE 0x40000000 |
35,6 → 39,7 |
//Button mouse |
#define MOUSE_LEFT 001b |
#define MOUSE_RIGHT 010b |
#define MOUSE_LR 011b |
#define MOUSE_CENTER 100b |
//ASCII KEYS |
55,7 → 60,18 |
#define ASCII_KEY_PGDN 183 |
#define ASCII_KEY_PGUP 184 |
//allow event mask |
#define EVENT_MASK_REDRAW 000000001b |
#define EVENT_MASK_KEYBOARD 000000010b |
#define EVENT_MASK_BUTTONS 000000100b |
#define EVENT_MASK_DESKTOP 000010000b |
#define EVENT_MASK_MOUSE 000100000b |
#define EVENT_MASK_IPC 001000000b |
#define EVENT_MASK_NETWORK 010000000b |
#define EVENT_MASK_DEBUG 100000000b |
//ARGS FUNCTION |
#define END_ARGS 0xFF00FF |
//------------------------------------------------------------------------- |
:struct raw_image { |
82,10 → 98,82 |
dword __TMP_TIME,MOUSE_TIME; |
:struct mouse |
{ |
signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick; |
signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,left,top; |
dword handle,_; |
byte cmd; |
void clearTime(); |
void get(); |
void set(); |
void center(); |
dword hide(); |
void slider(); |
void show(); |
}; |
:void mouse::clearTime() |
{ |
tmp_time = GetStartTime()+MOUSE_TIME; |
} |
:void mouse::show() |
{ |
if(!handle)return; |
ECX = handle; |
EAX = 37; |
EBX = 5; |
$int 0x40; |
} |
:dword mouse::hide() |
{ |
if(!_) |
{ |
EAX = 68; |
EBX = 12; |
ECX = 32*32*4; |
$int 0x40 |
ECX = EAX; |
_ = EAX; |
} else ECX = _; |
EAX = 37; |
EBX = 4; |
DX = 2; |
$int 0x40; |
handle = EAX; |
ECX = EAX; |
EAX = 37; |
EBX = 5; |
$int 0x40; |
handle = EAX; |
} |
//set new attributes mouse |
:void mouse::set() |
{ |
if((xx!=x)||(yy!=y)) |
{ |
EAX = 18; |
EBX = 19; |
ECX = 4; |
EDX = (x<<16)+y; |
$int 0x40 |
//move = true; |
} |
if((key)||(lkm|mkm|pkm))&&(down|up|click|dblclick|move) |
{ |
if(lkm|mkm|pkm)key=(lkm)|(pkm<<1)|(2<<mkm); |
EAX = 18; |
EBX = 19; |
ECX = key; |
EDX = (x<<16)+y; |
$int 0x40 |
} |
} |
:void mouse::center() |
{ |
EAX = 18; |
EBX = 15; |
$int 0x40 |
} |
//get new attributes mouse |
:void mouse::get() |
{ |
115,12 → 203,14 |
mkm = ECX; |
//when you release the mouse button |
if((down)&&!(key)){ |
// Mouse Up Event |
if((cmd)&&!(key)){ |
up = true; |
down = false; |
if(!move) click = true; |
move = false; |
__TMP_TIME = GetStartTime(); |
if(__TMP_TIME-tmp_time<=MOUSE_TIME) dblclick = true; |
if(__TMP_TIME-tmp_time<=MOUSE_TIME){ dblclick = true;click = false; } |
tmp_time = __TMP_TIME; |
//returns the key code |
key = tmp; |
129,25 → 219,25 |
pkm >>= 1; |
mkm = 4&tmp; |
mkm >>= 2; |
cmd = false; |
} |
//when you press the mouse button |
// Mouse Down Event/Move Event |
else { |
up = false; |
click = false; |
dblclick = false; |
if(key) |
down = false; |
// Mouse Move Event |
if((xx!=x)||(yy!=y)) |
{ |
down = true; |
tmp = key; |
} |
else down = false; |
if((xx!=x)||(yy!=y)){ |
move = true; |
xx = x; |
yy = y; |
} |
else move = false; |
if(key)if(!cmd) {down = true;cmd = true;tmp=key;} |
} |
//scroll |
161,7 → 251,34 |
vert = EBX; |
} |
:void mouse::slider() |
{ |
signed _x,_y; |
if(!handle)hide(); |
get(); |
_x = x;_y = y; |
pause(5); |
get(); |
left = _x - x; |
top = _y - y; |
center(); |
get(); |
_x = x;_y = y; |
pause(5); |
} |
:struct keyboard |
{ |
signed key; |
byte down,up,press; |
void get(void); |
}; |
:void keyboard::get(void) |
{ |
} |
:struct system_colors |
{ |
dword frame,grab,grab_button,grab_button_text,grab_text, |
179,11 → 296,12 |
} |
//------------------------------------------------------------------------------ |
dword wait_event_code; |
inline fastcall dword WaitEvent() |
{ |
$mov eax,10 |
$int 0x40 |
wait_event_code = EAX; |
} |
inline fastcall dword CheckEvent() |
522,9 → 640,10 |
EBX = 1; |
$int 0x40 |
EAX = 0; |
$xor EAX,EAX |
EBX = x << 16 + size_w; |
ECX = y << 16 + size_h; |
EDX = WindowType << 24 | WindowAreaColor; |
$int 0x40 |
664,12 → 783,40 |
$int 0x40 |
} |
:dword ALERT_TEXT; |
:void dialog_alert() |
{ |
byte id; |
loop()switch(WaitEvent()) |
{ |
case evReDraw: |
DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Alert"); |
WriteTextB(5,5,0x90,0x0,ALERT_TEXT); |
break; |
case evButton: |
id=GetButtonID(); |
if (id==1) ExitProcess(); |
break; |
} |
} |
:dword alert(dword text) |
{ |
dword mem = malloc(4096); |
ALERT_TEXT = text; |
CreateThread(#dialog_alert,mem+4092); |
return mem; |
} |
dword __generator; // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë |
dword program_path_length; |
//The initialization of the initial data before running |
void load_init_main() |
{ |
MOUSE_TIME = 50; //Default 50 ms. |
//program_path_length = strlen(program_path); |
MOUSE_TIME = 50; //Default 500 ms. |
__generator = GetStartTime(); |
main(); |
} |
/programs/cmm/lib/obj/http.h |
---|
60,4 → 60,9 |
dword content_length; |
dword content_received; |
char http_header; |
}; |
}; |
:dword file_get_contents(dword url,...) |
{ |
http_get(url,FLAG_HTTP11,""); |
} |
/programs/cmm/lib/random.h |
---|
18,6 → 18,12 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*******************************************************************************/ |
#define MASK_RAND 123456789 |
#define IQ_RAND 12773 |
#define IA_RAND 16807 |
#define IR_RAND 2836 |
#define IM_RAND 2147483647 |
#define AM_RAND (1./2147483647) |
inline fastcall int random( ECX) |
// get pseudo-random number - ïîëó÷èòü ïñåâäîñëó÷àéíîå ÷èñëî |
40,6 → 46,40 |
$pop ebx |
} |
:inline long unirand0(void) |
{ |
long k,ans,tmp,save; |
save = __generator; |
__generator^=MASK_RAND; /* avoid __generator==0 */ |
k=__generator/IQ_RAND; |
tmp=__generator-k*IQ_RAND; |
__generator*=IA_RAND*tmp; |
__generator-=IR_RAND*k; |
if(__generator<0) __generator+=IM_RAND; |
if(save == __generator) return unirand0(); |
ans=__generator; |
__generator^=MASK_RAND; /* restore unmasked dummy */ |
return ans; |
} |
:long RAND_A,RAND_C,RAND_TMP; |
:inline long rand(signed long x1,x2) |
{ |
long tmp,xx; |
RAND_A = __generator; |
__generator = RAND_A*__generator+RAND_C; |
RAND_C = __generator^RAND_A; |
RAND_C>>=1; |
RAND_A<<=1; |
__generator^=RAND_A; |
xx=x2; |
if(x1<0)xx+=-x1; |
tmp = __generator%xx; |
if(tmp<0)tmp=-tmp; |
tmp+=x1; |
return tmp; |
} |
inline fastcall randomize() |
// initialize random number __generator - èíèöèàëèçèðîâàòü ãåíåðàòîð ñëó÷àéíûõ ÷èñåë |
{ |
49,6 → 89,7 |
int 0x40 |
ror eax,16 |
} |
//if(EAX == __generator)return randomize(); |
__generator = EAX; |
} |
/programs/cmm/lib/strings.h |
---|
178,24 → 178,31 |
$jnz L2 |
} |
inline dword strncpy(dword text1, text2, signed len) |
:inline dword strncpy(dword text1, text2, signed len) |
signed o1,o2; |
{ |
if(!text1)||(!len) return text1; |
if(len<4) |
{ |
o2 = len; |
goto RUN_BYTE; |
} |
o1 = len/4; |
o2 = len-4*o1; |
while(o1){ |
ESDWORD[text1] = ESDWORD[text2]; |
DSDWORD[text1] = DSDWORD[text2]; |
text1 += 4; |
text2 += 4; |
$dec o1 |
} |
RUN_BYTE: |
while(o2){ |
ESBYTE[text1] = ESBYTE[text2]; |
DSBYTE[text1] = DSBYTE[text2]; |
$inc text1 |
$inc text2 |
$dec o2 |
} |
ESBYTE[text1] = 0; |
DSBYTE[text1] = 0; |
return text1; |
} |
339,25 → 346,26 |
signed o1,o2; |
char s; |
{ |
s = ESBYTE[text1]; |
s = DSBYTE[text1]; |
while(s){ |
$inc text1 |
s = ESBYTE[text1]; |
s = DSBYTE[text1]; |
} |
o1 = len/4; |
o2 = len-4*o1; |
while(o1){ |
ESDWORD[text1] = ESDWORD[text2]; |
DSDWORD[text1] = DSDWORD[text2]; |
text1 += 4; |
text2 += 4; |
$dec o1 |
} |
while(o2){ |
ESBYTE[text1] = ESBYTE[text2]; |
DSBYTE[text1] = DSBYTE[text2]; |
$inc text1 |
$inc text2 |
$dec o2 |
} |
DSBYTE[text1] = 0; |
} |
inline fastcall void chrcat(ESI, BL) |
614,22 → 622,23 |
inline dword itoa(signed long number) |
{ |
unsigned char buf[11]; |
dword ret; |
dword ret,p; |
byte cmd; |
long mask,tmp; |
mask = 1000000000; |
cmd = true; |
p = #buf; |
if(!number){ |
ESBYTE[buf] = '0'; |
ESBYTE[buf+1] = 0; |
return buf; |
ESBYTE[p] = '0'; |
ESBYTE[p+1] = 0; |
return p; |
} |
ret = buf; |
ret = p; |
if(number<0) |
{ |
$neg number |
ESBYTE[buf] = '-'; |
$inc buf |
ESBYTE[p] = '-'; |
$inc p |
} |
while(mask) |
{ |
638,22 → 647,22 |
if(cmd){ |
if(tmp){ |
ESBYTE[buf] = tmp + '0'; |
$inc buf |
ESBYTE[p] = tmp + '0'; |
$inc p |
cmd = false; |
} |
} |
else { |
ESBYTE[buf] = tmp + '0'; |
$inc buf |
ESBYTE[p] = tmp + '0'; |
$inc p |
} |
mask /= 10; |
} |
ESBYTE[buf] = 0; |
ESBYTE[p] = 0; |
return ret; |
} |
inline fastcall itoa_(signed int EDI, ESI) |
:inline fastcall itoa_(signed int EDI, ESI) |
{ |
$pusha |
EBX = EDI; |
686,15 → 695,27 |
return EBX; |
} |
inline dword strdup(dword text) |
:inline dword memchr(dword s,int c,signed len) |
{ |
if(!len) return NULL; |
do { |
if(DSBYTE[s] == c) return s; |
$inc s |
$dec len |
} while(len); |
return NULL; |
} |
:inline dword strdup(dword text) |
{ |
dword l = strlen(text); |
dword ret = malloc(l+1); |
if(!ret) return NULL; |
strncpy(ret,text,l); |
return ret; |
} |
inline dword strndup(dword str, signed maxlen) |
:inline dword strndup(dword str, signed maxlen) |
{ |
dword copy,len; |
702,12 → 723,96 |
copy = malloc(len + 1); |
if (copy != NULL) |
{ |
memcpy(copy, str, len); |
strncpy(copy, str, len); |
DSBYTE[len+copy] = '\0'; |
} |
return copy; |
} |
:inline cdecl int sprintf(dword buf, format,...) |
{ |
byte s; |
char X[10]; |
dword ret, tmp, l; |
dword arg = #format; |
ret = buf; |
s = DSBYTE[format]; |
while(s){ |
if(s=='%'){ |
arg+=4; |
tmp = DSDWORD[arg]; |
if(tmp==END_ARGS)goto END_FUNC_SPRINTF; |
$inc format |
s = DSBYTE[format]; |
if(!s)goto END_FUNC_SPRINTF; |
switch(s) |
{ |
case 's': |
l = tmp; |
s = DSBYTE[tmp]; |
while(s) |
{ |
DSBYTE[buf] = s; |
$inc tmp |
$inc buf |
s = DSBYTE[tmp]; |
} |
break; |
case 'c': |
DSBYTE[buf] = tmp; |
$inc buf |
break; |
case 'u': //if(tmp<0)return ret; |
case 'd': |
case 'i': |
tmp = itoa(tmp); |
if(!DSBYTE[tmp])goto END_FUNC_SPRINTF; |
l = strlen(tmp); |
strncpy(buf,tmp,l); |
buf += l; |
break; |
case 'a': |
case 'A': |
strncpy(buf,"0x00000000",10); |
buf+=10; |
l=buf; |
while(tmp) |
{ |
$dec buf |
s=tmp&0xF; |
if(s>9)DSBYTE[buf]='A'+s-10; |
else DSBYTE[buf]='0'+s; |
tmp>>=4; |
} |
buf=l; |
break; |
case 'p': |
tmp = itoa(#tmp); |
if(!DSBYTE[tmp])goto END_FUNC_SPRINTF; |
l = strlen(tmp); |
strncpy(buf,tmp,l); |
buf += l; |
break; |
case '%': |
DSBYTE[buf] = '%'; |
$inc buf |
break; |
default: |
goto END_FUNC_SPRINTF; |
} |
} |
else { |
DSBYTE[buf] = s; |
$inc buf |
} |
$inc format |
s = DSBYTE[format]; |
} |
END_FUNC_SPRINTF: |
DSBYTE[buf] = 0; |
return buf-ret; |
} |
void debugi(dword d_int) |
{ |
char tmpch[12]; |