Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7786 → Rev 7785

/programs/cmm/eolite/Eolite.c
150,22 → 150,18
#include "include\properties.h"
#include "include\breadcrumbs.h"
 
void load_libraries()
{
load_dll(boxlib, #box_lib_init,0);
load_dll(libini, #lib_init,1);
load_dll(libio, #libio_init,1);
load_dll(libimg, #libimg_init,1);
}
 
void main()
{
dword id;
byte count_sl = 0;
 
signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
char stats;
rand_n = random(40);
 
load_libraries();
load_dll(boxlib, #box_lib_init,0);
load_dll(libini, #lib_init,1);
load_dll(libio, #libio_init,1);
load_dll(libimg, #libimg_init,1);
SetAppColors();
LoadIniSettings();
186,9 → 182,12
{
if (strlen(#param)>1) && (param[strlen(#param)-1]=='/') param[strlen(#param)-1]=NULL; //no "/" at the end
 
if (dir_exists(#param)) {
if (dir_exists(#param)==true)
{
strcpy(#path, #param);
} else {
}
else
{
notify(T_NOTIFY_APP_PARAM_WRONG);
}
}
197,7 → 196,8
strcpy(#inactive_path, #path);
llist_copy(#files_inactive, #files);
SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
loop() switch(WaitEventTimeout(50))
loop(){
switch(WaitEventTimeout(50))
{
case evMouse:
if (del_active) || (Form.status_window>2) break;
209,8 → 209,47
mouse.get();
 
ProceedMouseGestures();
if (!mouse.mkm) && (stats>0) stats = 0;
if (mouse.mkm) && (!stats)
{
x_old = mouse.x;
y_old = mouse.y;
stats = 1;
}
if (mouse.mkm) && (stats==1)
{
dif_x = mouse.x-x_old;
dif_y = mouse.y-y_old;
adif_x = fabs(dif_x);
adif_y = fabs(dif_y);
if (adif_x>adif_y)
{
if (dif_x > 150)
{
if (history.forward())
{
strcpy(#path, history.current());
files.KeyHome();
Open_Dir(#path,WITH_REDRAW);
}
stats = 0;
}
if (dif_x < -150)
{
GoBack();
stats = 0;
}
}
else
{
if (dif_y < -100)
{
Dir_Up();
stats = 0;
}
}
}
if (files.MouseOver(mouse.x, mouse.y))
{
//select file
322,10 → 361,15
Clipboard__CopyText(#path);
break;
case 21: //Back
EventHistoryGoBack();
GoBack();
break;
case 22: //Forward
EventHistoryGoForward();
if (history.forward())
{
strcpy(#path, history.current());
files.KeyHome();
Open_Dir(#path,WITH_REDRAW);
}
break;
case 23:
Dir_Up();
442,7 → 486,7
switch (key_scancode)
{
case SCAN_CODE_BS:
//EventHistoryGoBack();
//GoBack();
Dir_Up();
break;
case SCAN_CODE_ENTER:
502,6 → 546,7
cmd_free = false;
}
}
}
 
void draw_window()
{
772,7 → 817,7
if (errornum)
{
history.add(#path);
EventHistoryGoBack();
GoBack();
Write_Error(errornum);
return;
}
928,7 → 973,7
}
}
 
inline fastcall void EventHistoryGoBack()
inline fastcall void GoBack()
{
char cur_folder[4096];
strcpy(#cur_folder, #path);
1046,22 → 1091,26
switch(N)
{
case 1:
if (!active_about) {
if (!active_about)
{
about_stak = malloc(4096);
about_thread_id = CreateThread(#about_dialog,about_stak+4092);
break;
} else {
}
else
{
ActivateWindow(GetProcessSlot(about_thread_id));
}
break;
case 2:
if (files.count) NewElement_Form(RENAME_ITEM, #file_name);
if (!files.count) break;
NewElement_Form(RENAME_ITEM, #file_name);
break;
case 3:
if (files.count) && (!itdir) RunProgram("/sys/tinypad", #file_path);
if (!itdir) RunProgram("/sys/tinypad", #file_path);
break;
case 4:
if (files.count) && (!itdir) RunProgram("/sys/develop/heed", #file_path);
if (!itdir) RunProgram("/sys/develop/heed", #file_path);
break;
case 5: //refresh cur dir & devs
if (two_panels.checked)
1189,49 → 1238,4
SelectFileByName(#selected_filename);
}
 
void EventHistoryGoForward()
{
if (history.forward()) {
strcpy(#path, history.current());
files.KeyHome();
Open_Dir(#path,WITH_REDRAW);
}
}
 
void ProceedMouseGestures()
{
char stats;
signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
if (!mouse.mkm) && (stats>0) stats = 0;
if (mouse.mkm) && (!stats)
{
x_old = mouse.x;
y_old = mouse.y;
stats = 1;
}
if (mouse.mkm) && (stats==1)
{
dif_x = mouse.x-x_old;
dif_y = mouse.y-y_old;
adif_x = fabs(dif_x);
adif_y = fabs(dif_y);
if (adif_x>adif_y) {
if (dif_x > 150) {
EventHistoryGoForward();
stats = 0;
}
if (dif_x < -150) {
EventHistoryGoBack();
stats = 0;
}
} else {
if (dif_y < -100) {
Dir_Up();
stats = 0;
}
}
}
}
 
stop: