Subversion Repositories Kolibri OS

Rev

Rev 5974 | Rev 5981 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5481 leency 1
//Leency, Veliant, Punk_Joker & KolibriOS Team 2008-2015
3363 leency 2
//GNU GPL licence.
3
 
4022 leency 4
#ifndef AUTOBUILD
5
#include "lang.h--"
6
#endif
7
 
3363 leency 8
//libraries
5974 leency 9
#define MEMSIZE 4096 * 180
4427 punk_joker 10
#include "..\lib\clipboard.h"
3363 leency 11
#include "..\lib\strings.h"
12
#include "..\lib\mem.h"
13
#include "..\lib\file_system.h"
5499 leency 14
#include "..\lib\gui.h"
3434 leency 15
#include "..\lib\list_box.h"
4863 leency 16
#include "..\lib\random.h"
5743 leency 17
#include "..\lib\font.h"
5960 leency 18
#include "..\lib\collection.h"
5487 leency 19
//obj
5499 leency 20
#include "..\lib\obj\libini.h"
21
#include "..\lib\obj\box_lib.h"
5977 leency 22
//patterns
23
#include "..\lib\patterns\history.h"
5834 pavelyakov 24
 
25
byte CMD_ENABLE_SAVE_IMG = false;
26
 
3363 leency 27
//images
28
#include "imgs\toolbar.txt"
29
#include "imgs\left_p.txt"
4846 leency 30
#include "imgs\icons.txt"
3363 leency 31
 
3444 leency 32
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
5698 leency 33
enum {CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement
3444 leency 34
 
4076 leency 35
dword col_padding, col_selec, col_lpanel;
3363 leency 36
 
3434 leency 37
int toolbar_buttons_x[7]={9,46,85,134,167,203};
3363 leency 38
 
5846 pavelyakov 39
byte smooth_font=false;
4136 punk_joker 40
byte active_about=0;
4070 punk_joker 41
word about_window;
5416 punk_joker 42
word settings_window;
5753 leency 43
byte active_settings=0;
5606 pavelyakov 44
dword _not_draw = false;
4136 punk_joker 45
byte menu_call_mouse=0;
46
 
5733 leency 47
byte del_active=0;
48
byte new_element_active=0;
5698 leency 49
 
5733 leency 50
llist files, files_active, files_inactive;
3434 leency 51
 
5694 leency 52
byte list_full_redraw;
53
 
5698 leency 54
dword buf;
55
dword file_mas[6898];
56
int selected_count;
57
 
58
 
3434 leency 59
byte
3363 leency 60
	path[4096],
5833 pavelyakov 61
	DefaultPath[4096],
3363 leency 62
	file_path[4096],
3404 leency 63
	file_name[256],
5555 punk_joker 64
	new_element_name[256],
5698 leency 65
	temp[4096],
3441 leency 66
	itdir;
3363 leency 67
 
5719 leency 68
char active_path[4096], inactive_path[4096];
5698 leency 69
 
5441 leency 70
dword eolite_ini_path;
71
 
5698 leency 72
char scroll_used=false;
5695 leency 73
 
5804 punk_joker 74
dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak,delete_stak;
5608 leency 75
 
3363 leency 76
proc_info Form;
5960 leency 77
int mouse_dd, sc_slider_h;
3434 leency 78
int j, i;
4028 leency 79
int action_buf;
4863 leency 80
int rand_n;
5591 pavelyakov 81
byte CMD_REFRESH;
3363 leency 82
 
5748 leency 83
//struct t_settings {
5753 leency 84
byte sort_num=2,
5748 leency 85
	show_dev_name=true,
86
	real_files_names_case=false,
87
	info_after_copy=false,
88
	two_panels=false,
89
	active_panel=1;
90
//} settings;
5549 punk_joker 91
 
5581 leency 92
edit_box new_file_ed = {171,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0};
3434 leency 93
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
3363 leency 94
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
5694 leency 95
byte cmd_free=0;
5698 leency 96
#include "include\translations.h"
5804 punk_joker 97
#include "include\fs.h"
5834 pavelyakov 98
 
99
char *fd_path_eolite_ini_path;
100
 
5748 leency 101
#include "include\settings.h"
5804 punk_joker 102
#include "include\progress_dialog.h"
103
#include "..\lib\copyf.h"
4042 leency 104
#include "include\copy.h"
5435 leency 105
#include "include\gui.h"
3363 leency 106
#include "include\sorting.h"
4042 leency 107
#include "include\icons.h"
3363 leency 108
#include "include\left_panel.h"
4042 leency 109
#include "include\menu.h"
110
#include "include\about.h"
5447 punk_joker 111
#include "include\properties.h"
3363 leency 112
 
113
void main()
114
{
5706 leency 115
	word id;
5834 pavelyakov 116
	byte count_sl = 0;
5748 leency 117
	signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
5695 leency 118
	char can_show, can_select, stats;
4897 leency 119
	dword selected_offset;
5591 pavelyakov 120
	dword IPC_LEN,IPC_ID;
121
	char IPC_BUF[10];
4863 leency 122
	rand_n = random(40);
5651 pavelyakov 123
 
5626 leency 124
	load_dll(boxlib, #box_lib_init,0);
125
    load_dll(libini, #lib_init,1);
5974 leency 126
 
5743 leency 127
	eolite_ini_path = abspath("Eolite.ini");
5834 pavelyakov 128
	fd_path_eolite_ini_path = "/fd/1/File Managers/Eolite.ini";
129
 
5441 leency 130
	LoadIniSettings();
131
	GetSystemDiscs();
4076 leency 132
	SetAppColors();
3363 leency 133
	if (param)
134
	{
5743 leency 135
		strcpy(#path, #param);
136
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string
5833 pavelyakov 137
	}
138
 
5733 leency 139
	Open_Dir(#path,ONLY_OPEN);
5719 leency 140
	strcpy(#inactive_path, #path);
5733 leency 141
	llist_copy(#files_inactive, #files);
5606 pavelyakov 142
	SetEventMask(1100111b);
5591 pavelyakov 143
	loop(){
144
		switch(WaitEvent())
145
		{
146
			case evMouse:
147
				if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
148
				if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2)
149
				{
150
					edit_box_mouse stdcall(#new_file_ed);
151
					break;
152
				}
5549 punk_joker 153
 
5640 pavelyakov 154
				mouse.get();
5591 pavelyakov 155
 
5640 pavelyakov 156
				if (!mouse.mkm) && (stats>0) stats = 0;
5657 pavelyakov 157
				if (mouse.mkm) && (!stats)
5549 punk_joker 158
				{
5640 pavelyakov 159
					x_old = mouse.x;
160
					y_old = mouse.y;
5591 pavelyakov 161
					stats = 1;
162
				}
5640 pavelyakov 163
				if (mouse.mkm) && (stats==1)
5591 pavelyakov 164
				{
5640 pavelyakov 165
					dif_x = mouse.x-x_old;
166
					dif_y = mouse.y-y_old;
5591 pavelyakov 167
					adif_x = fabs(dif_x);
168
					adif_y = fabs(dif_y);
169
 
170
					if (adif_x>adif_y)
5549 punk_joker 171
					{
5591 pavelyakov 172
						if (dif_x > 150)
173
						{
5977 leency 174
							if (History.forward())
5591 pavelyakov 175
								{
5977 leency 176
									strcpy(#path, History.current());
5694