Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
5401 leency 1
//Leency & Veliant 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
4049 leency 9
#define MEMSIZE 0xD0000
3363 leency 10
#include "..\lib\kolibri.h"
4427 punk_joker 11
#include "..\lib\clipboard.h"
3363 leency 12
#include "..\lib\strings.h"
13
#include "..\lib\mem.h"
14
#include "..\lib\dll.h"
5399 punk_joker 15
#include "..\lib\lib.obj\libini.h"
3363 leency 16
#include "..\lib\lib.obj\box_lib.h"
17
#include "..\lib\file_system.h"
18
#include "..\lib\figures.h"
3412 leency 19
#include "..\lib\encoding.h"
3434 leency 20
#include "..\lib\list_box.h"
21
#include "..\lib\copyf.h"
4863 leency 22
#include "..\lib\random.h"
3363 leency 23
//images
24
#include "imgs\toolbar.txt"
25
#include "imgs\left_p.txt"
4846 leency 26
#include "imgs\icons.txt"
3363 leency 27
 
3848 punk_joker 28
#ifdef LANG_RUS
29
	?define T_FILE "Файл"
30
	?define T_TYPE "Тип"
31
	?define T_SIZE "Размер"
32
	?define T_NEW_FOLDER "Новая папка"
33
	?define T_NEW_FILE "Новый файл"
34
	?define T_DELETE_FILE "Вы действительно хотите удалить"
35
	?define T_YES "Да"
36
	?define T_NO "Нет"
37
	?define T_DEL_ERROR_1 "Ошибка. Папка не пустая."
3997 leency 38
	?define WAIT_DELETING_FOLDER "Удаляется папка. Подожите..."
3848 punk_joker 39
	?define NOT_CREATE_FOLDER "Не удалось создать папку."
40
	?define NOT_CREATE_FILE "Не удалось создать файл."
41
	?define ERROR_1 "Ошибка при загрузке библиотеки /rd/1/lib/box_lib.obj"
3883 leency 42
	?define T_PASTE_WINDOW "Копирую..."
43
	?define T_PASTE_WINDOW_TEXT "Копируется файл:"
4022 leency 44
	?define T_CANCEL_PASTE "Копирование прекращено. Папка скопирована не полностью."
4049 leency 45
	?define T_SELECT_APP_TO_OPEN_WITH "Выберите программу для открытия файла"
3933 kaitz 46
#elif LANG_EST
47
	?define T_FILE "Fail"
48
	?define T_TYPE "T№№p"
49
	?define T_SIZE "Suurus"
50
	?define T_NEW_FOLDER "Uus kataloog"
51
	?define T_NEW_FILE "Uus fail"
52
	?define T_DELETE_FILE "Kas sa tahad tїesti kustutada"
53
	?define T_YES "Jah"
54
	?define T_NO "Ei"
55
	?define T_DEL_ERROR_1 "Viga. Kataloog ei ole t№hi."
3997 leency 56
	?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..."
3933 kaitz 57
	?define NOT_CREATE_FOLDER "Kataloogi ei saa luua."
58
	?define NOT_CREATE_FILE "Faili ei saa luua."
59
	?define ERROR_1 "Viga teegi laadimisel /rd/1/lib/box_lib.obj"
60
	?define T_PASTE_WINDOW "Kopeerin..."
61
	?define T_PASTE_WINDOW_TEXT "Kopeerin faili:"
4022 leency 62
	?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely."
4049 leency 63
	?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
3848 punk_joker 64
#else
65
	?define T_FILE "File"
66
	?define T_TYPE "Type"
67
	?define T_SIZE "Size"
68
	?define T_NEW_FOLDER "New folder"
69
	?define T_NEW_FILE "New file"
70
	?define T_DELETE_FILE "Do you really want to delete"
71
	?define T_YES "Yes"
72
	?define T_NO "No"
73
	?define T_DEL_ERROR_1 "Error. Folder isn't empty."
3997 leency 74
	?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..."
3848 punk_joker 75
	?define NOT_CREATE_FOLDER "Folder can not be created."
76
	?define NOT_CREATE_FILE "File can not be created."
77
	?define ERROR_1 "Error while loading library /rd/1/lib/box_lib.obj"
3883 leency 78
	?define T_PASTE_WINDOW "Copying..."
79
	?define T_PASTE_WINDOW_TEXT "Copying file:"
4022 leency 80
	?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely."
4049 leency 81
	?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
3848 punk_joker 82
#endif
83
 
3444 leency 84
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
85
 
5443 punk_joker 86
#define TITLE "Eolite File Manager v2.51"
87
#define ABOUT_TITLE "Eolite v2.51"
4076 leency 88
dword col_padding, col_selec, col_lpanel;
3363 leency 89
 
3434 leency 90
int toolbar_buttons_x[7]={9,46,85,134,167,203};
5150 leency 91
char tmp_disk_del_param[]="d0";
3434 leency 92
struct path_string { char Item[4096]; };
3363 leency 93
 
4136 punk_joker 94
byte active_about=0;
4070 punk_joker 95
word about_window;
5416 punk_joker 96
byte active_settings=0;
97
word settings_window;
4040 punk_joker 98
 
4136 punk_joker 99
byte menu_call_mouse=0;
100
 
3434 leency 101
llist files;
102
 
103
byte
3363 leency 104
	path[4096],
105
	file_path[4096],
3404 leency 106
	file_name[256],
3434 leency 107
	temp[4096];
108
byte
3439 leency 109
	rename_active=0,
110
	del_active=0,
4399 punk_joker 111
	show_dev_name=1,
4225 punk_joker 112
	real_files_names_case=0,
3434 leency 113
	sort_num=2,
3441 leency 114
	itdir;
3363 leency 115
 
5441 leency 116
dword eolite_ini_path;
117
 
3363 leency 118
proc_info Form;
4076 leency 119
system_colors sc;
3363 leency 120
mouse m;
4057 leency 121
int mouse_dd, scroll_used, scroll_size, sorting_arrow_x, kolibrios_drive;
4897 leency 122
dword buf;
3434 leency 123
dword file_mas[6898];
124
int j, i;
4028 leency 125
int action_buf;
4863 leency 126
int rand_n;
3363 leency 127
 
4028 leency 128
edit_box edit2 = {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,#mouse_dd,64,6,6};
3434 leency 129
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
3363 leency 130
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
131
 
4042 leency 132
#include "include\copy.h"
5435 leency 133
#include "include\gui.h"
3363 leency 134
#include "include\sorting.h"
4042 leency 135
#include "include\icons.h"
3363 leency 136
#include "include\left_panel.h"
137
#include "include\history.h"
4042 leency 138
#include "include\menu.h"
139
#include "include\about.h"
5416 punk_joker 140
#include "include\settings.h"
3363 leency 141
 
4076 leency 142
 
3363 leency 143
void main()
144
{
3444 leency 145
	word key, id, can_show, can_select, m_selected;
4897 leency 146
	dword selected_offset;
4863 leency 147
	rand_n = random(40);
3363 leency 148
 
3434 leency 149
	files.line_h=18;
3363 leency 150
	mem_Init();
3848 punk_joker 151
	if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
5399 punk_joker 152
    if (load_dll2(libini, #lib_init,1)!=0) notify("Error: library doesn't exists - libini");
5441 leency 153
	eolite_ini_path = abspath("Eolite.ini");
154
	LoadIniSettings();
155
	GetSystemDiscs();
4076 leency 156
	SetAppColors();
3363 leency 157
	if (param)
158
	{
159
		strcpy(#path, #param);
3434 leency 160
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string
3363 leency 161
	}
162
	else
3695 leency 163
	{
3432 leency 164
		strcpy(#path, "/rd/1/");
3695 leency 165
	}
3363 leency 166
	Open_Dir(#path,ONLY_OPEN);
3432 leency 167
	SetEventMask(0x27);
3434 leency 168
	loop() switch(WaitEvent())
3363 leency 169
	{
170
		case evMouse:
4081 leency 171
			if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
172
			if (rename_active) { edit_box_mouse stdcall(#edit2); break; }
3363 leency 173
 
174
			m.get();
175
 
4078 leency 176
			if (files.MouseOver(m.x, m.y)) && (!can_select)
3363 leency 177
			{
4042 leency 178
				m_selected = m.y - files.y / files.line_h;
3434 leency 179
				if (m.lkm) can_select = 1;
180
				if (m.pkm)
181
				{
182
					can_show = 1;
4042 leency 183
					if (m.y - files.y / files.line_h != files.current) can_select = 1;
3434 leency