Subversion Repositories Kolibri OS

Rev

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