Subversion Repositories Kolibri OS

Rev

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