Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
7778 leency 1
//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2020
7490 leency 2
//GNU GPL license.
3363 leency 3
 
7361 leency 4
// 70.5 - get volume info and label
5
 
4022 leency 6
#ifndef AUTOBUILD
7
#include "lang.h--"
8
#endif
9
 
3363 leency 10
//libraries
7220 leency 11
#define MEMSIZE 1024 * 720
7054 leency 12
#include "../lib/clipboard.h"
13
#include "../lib/strings.h"
14
#include "../lib/mem.h"
7219 leency 15
#include "../lib/fs.h"
7054 leency 16
#include "../lib/gui.h"
17
#include "../lib/list_box.h"
18
#include "../lib/random.h"
19
#include "../lib/kfont.h"
20
#include "../lib/collection.h"
21
#include "../lib/copyf.h"
5834 pavelyakov 22
 
7054 leency 23
#include "../lib/obj/libini.h"
24
#include "../lib/obj/box_lib.h"
7230 leency 25
#include "../lib/obj/libimg.h"
7054 leency 26
 
27
#include "../lib/patterns/history.h"
28
 
7462 leency 29
#include "imgs/images.h"
3363 leency 30
 
6278 leency 31
//Button IDs
32
enum {
7422 leency 33
	PATH_BTN = 10,
6278 leency 34
	POPUP_BTN1 = 201,
6289 leency 35
	POPUP_BTN2 = 202,
36
	BREADCRUMB_ID = 300
6278 leency 37
};
3444 leency 38
 
6278 leency 39
//NewElement options
40
enum {
41
	CREATE_FILE=1,
42
	CREATE_FOLDER,
43
	RENAME_ITEM
44
};
45
 
46
//OpenDir options
47
enum {
48
	ONLY_SHOW,
49
	WITH_REDRAW,
50
	ONLY_OPEN
51
};
52
 
7757 leency 53
_history history;
54
 
7634 leency 55
struct Eolite_colors
56
{
7647 leency 57
	bool  def;
7634 leency 58
	dword lpanel;
59
	dword list_vert_line; //vertical line between columns in list
60
	dword selec;
61
	dword selec_active;
62
	dword selec_inactive;
63
	dword selec_text;
64
	dword list_bg;
65
	dword list_gb_text;
66
	dword list_text_hidden;
67
	dword work_gradient[24];
68
	dword slider_bg_big;
69
	dword slider_bg_left;
70
	dword odd_line;
71
} col;
3363 leency 72
 
3434 leency 73
int toolbar_buttons_x[7]={9,46,85,134,167,203};
3363 leency 74
 
7628 leency 75
bool active_about = false;
76
bool active_settings = false;
77
bool _not_draw = false;
78
bool exif_load = false;
79
bool dir_at_fat16 = NULL;
80
 
81
word about_thread_id;
5416 punk_joker 82
word settings_window;
4136 punk_joker 83
 
5733 leency 84
byte del_active=0;
85
byte new_element_active=0;
5698 leency 86
 
5733 leency 87
llist files, files_active, files_inactive;
3434 leency 88
 
5694 leency 89
byte list_full_redraw;
90
 
5698 leency 91
dword buf;
92
dword file_mas[6898];
93
int selected_count;
6406 punk_joker 94
int count_dir;
5698 leency 95
 
7628 leency 96
byte path[4096];
97
byte file_path[4096];
98
byte file_name[256];
99
byte new_element_name[256];
100
byte temp[4096];
101
bool itdir;
3363 leency 102
 
5719 leency 103
char active_path[4096], inactive_path[4096];
5698 leency 104
 
7202 leency 105
dword eolite_ini_path[4096];
106
_ini ini;
5441 leency 107
 
5698 leency 108
char scroll_used=false;
5695 leency 109
 
7878 leency 110
dword about_stak=0,properties_stak=0,settings_stak=0,delete_stak=0;
5608 leency 111
 
3363 leency 112
proc_info Form;
7252 leency 113
int sc_slider_h;
4028 leency 114
int action_buf;
4863 leency 115
int rand_n;
3363 leency 116
 
7490 leency 117
char sort_type=2;
118
bool sort_desc=false;
7244 leency 119
int active_panel=1;
5549 punk_joker 120
 
7054 leency 121
libimg_image icons16_default;
122
libimg_image icons16_selected;
123
 
7242 leency 124
libimg_image icons32_default;
125
libimg_image icons32_selected;
7197 leency 126
 
6564 leency 127
#define STATUS_BAR_H 16;
128
int status_bar_h = 0;
129
 
7197 leency 130
int icon_size = 16;
131
 
7252 leency 132
edit_box new_file_ed = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x10000000,
133
	248,#new_element_name,0,100000000000010b,6,0};
7004 leency 134
PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
5694 leency 135
byte cmd_free=0;
5698 leency 136
#include "include\translations.h"
5834 pavelyakov 137
 
7462 leency 138
#include "include\gui.h"
5748 leency 139
#include "include\settings.h"
5804 punk_joker 140
#include "include\progress_dialog.h"
7878 leency 141
#include "include\copy_and_delete.h"
3363 leency 142
#include "include\sorting.h"
4042 leency 143
#include "include\icons.h"
3363 leency 144
#include "include\left_panel.h"
4042 leency 145
#include "include\menu.h"
146
#include "include\about.h"
5447 punk_joker 147
#include "include\properties.h"
6289 leency 148
#include "include\breadcrumbs.h"
3363 leency 149
 
7786 leency 150
void load_libraries()
151
{
152
	load_dll(boxlib, #box_lib_init,0);
153
	load_dll(libini, #lib_init,1);
154
	load_dll(libio,  #libio_init,1);
155
	load_dll(libimg, #libimg_init,1);
156
}
157
 
7878 leency 158
void handle_param()
159
{
7879 leency 160
	//-p  : just show file/folder properties dialog
161
	//-d  : delete file/folder
162
	//-v : paste files/folder from clipboard
7878 leency 163
	if (param) && (param[0]=='-') switch (param[1])
164
	{
165
		case 'p':
166
			strcpy(#file_path, #param + 3);
167
			strcpy(#file_name, #param + strrchr(#param, '/'));
168
			itdir = dir_exists(#file_path);
169
			properties_dialog();
170
			return;
171
		case 'd':
172
			strcpy(#file_path, #param + 3);
173
			itdir = dir_exists(#file_path);
174
			DisplayOperationForm(DELETE_FLAG);
175
			DeleteSingleElement();
176
			return;
7879 leency 177
		case 'v':
178
			cut_active = param[2] - '0';
179
			strcpy(#path, #param + 4);
180
			PasteThread();
181
			return;
7878 leency 182
	}
183
}
184
 
3363 leency 185
void main()
186
{
6289 leency 187
	dword id;
5834 pavelyakov 188
	byte count_sl = 0;
7786 leency 189
 
7816 leency 190
	rand_n = random(80);
5651 pavelyakov 191
 
7786 leency 192
	load_libraries();
5834 pavelyakov 193
 
7375 leency 194
	SetAppColors();
5441 leency 195
	LoadIniSettings();
6034 leency 196
	SystemDiscs.Get();
7041 leency 197
 
7878 leency 198
	handle_param();
7041 leency 199