Subversion Repositories Kolibri OS

Rev

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