Subversion Repositories Kolibri OS

Rev

Rev 5814 | Rev 5833 | 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
5814 pavelyakov 9
#define MEMSIZE 540000
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"
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
word settings_window;
5753 leency 37
byte active_settings=0;
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
 
5719 leency 61
char active_path[4096], inactive_path[4096];
5698 leency 62
 
5441 leency 63
dword eolite_ini_path;
64
 
5698 leency 65
char scroll_used=false;
5695 leency 66
 
5804 punk_joker 67
dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak,delete_stak;
5608 leency 68
 
3363 leency 69
proc_info Form;
5733 leency 70
int mouse_dd, sc_slider_h, kolibrios_drive;
3434 leency 71
int j, i;
4028 leency 72
int action_buf;
4863 leency 73
int rand_n;
5591 pavelyakov 74
byte CMD_REFRESH;
3363 leency 75
 
5748 leency 76
//struct t_settings {
5753 leency 77
byte sort_num=2,
5748 leency 78
	show_dev_name=true,
79
	real_files_names_case=false,
80
	info_after_copy=false,
81
	two_panels=false,
82
	active_panel=1;
83
//} settings;
5549 punk_joker 84
 
5581 leency 85
edit_box new_file_ed = {171,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0};
3434 leency 86
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
3363 leency 87
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
5694 leency 88
byte cmd_free=0;
5698 leency 89
#include "include\translations.h"
5804 punk_joker 90
#include "include\fs.h"
5748 leency 91
#include "include\settings.h"
5804 punk_joker 92
#include "include\progress_dialog.h"
93
#include "..\lib\copyf.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"
5447 punk_joker 102
#include "include\properties.h"
3363 leency 103
 
5576 pavelyakov 104
 
3363 leency 105
void main()
106
{
5706 leency 107
	word id;
5748 leency 108
	signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
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];
4863 leency 113
	rand_n = random(40);
5651 pavelyakov 114
 
5626 leency 115
	load_dll(boxlib, #box_lib_init,0);
116
    load_dll(libini, #lib_init,1);
5743 leency 117
	eolite_ini_path = abspath("Eolite.ini");
5441 leency 118
	LoadIniSettings();
119
	GetSystemDiscs();
4076 leency 120
	SetAppColors();
3363 leency 121
	if (param)
122
	{
5743 leency 123
		strcpy(#path, #param);
124
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string
3363 leency 125
	}
126
	else
3695 leency 127
	{
5657 pavelyakov 128
		strlcpy(#path, "/rd/1/", 6);
3695 leency 129
	}
5733 leency 130
	Open_Dir(#path,ONLY_OPEN);
5719 leency 131
	strcpy(#inactive_path, #path);
5733 leency 132
	llist_copy(#files_inactive, #files);
5753 leency 133
	font.no_bg_copy = true;
5765 leency 134
	font.load("/sys/fonts/tahoma.kf");
5606 pavelyakov 135
	SetEventMask(1100111b);
5591 pavelyakov 136
	loop(){
137
		switch(WaitEvent())
138
		{
139
			case evMouse:
140
				if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
141
				if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2)
142
				{
143
					edit_box_mouse stdcall(#new_file_ed);
144
					break;
145
				}
5549 punk_joker 146
 
5640 pavelyakov 147
				mouse.get();
5591 pavelyakov 148
 
5640 pavelyakov 149
				if (!mouse.mkm) && (stats>0) stats = 0;
5657 pavelyakov 150
				if (mouse.mkm) && (!stats)
5549 punk_joker 151
				{
5640 pavelyakov 152
					x_old = mouse.x;
153
					y_old = mouse.y;
5591 pavelyakov 154
					stats = 1;
155
				}
5640 pavelyakov 156
				if (mouse.mkm) && (stats==1)
5591 pavelyakov 157
				{
5640 pavelyakov 158
					dif_x = mouse.x-x_old;
159
					dif_y = mouse.y-y_old;
5591 pavelyakov 160
					adif_x = fabs(dif_x);
161
					adif_y = fabs(dif_y);
162
 
163
					if (adif_x>adif_y)
5549 punk_joker 164
					{
5591 pavelyakov 165
						if (dif_x > 150)
166
						{
167
							if (HistoryPath(GO_FORWARD))
168
								{
5694 leency 169
									files.KeyHome();
5591 pavelyakov 170
									Open_Dir(#path,WITH_REDRAW);
171
								}
172
							stats = 0;
173
						}
174
						if (dif_x < -150)
175
						{
176
							GoBack();
177
							stats = 0;
178
						}
5549 punk_joker 179
					}