Subversion Repositories Kolibri OS

Rev

Rev 7634 | Rev 8826 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7634 Rev 8821
Line 2... Line 2...
2
 
2
 
3
void DrawIconByExtension(dword file_path, extension, xx, yy, fairing_color)
3
void DrawIconByExtension(dword file_path, extension, xx, yy, fairing_color)
4
{
4
{
5
	char BYTE_HEAD_FILE[4];
5
	char BYTE_HEAD_FILE[4];
6
	char ext[512];
-
 
7
	int i;
6
	char ext[512];
8
	dword icon_n = 2;
7
	int icon_n = 2;
9
	dword selected_image;
8
	dword selected_image;
10
	dword default_image;
9
	dword default_image;
Line 11... Line 10...
11
	dword default_icon;
10
	dword default_icon;
12
 
11
 
13
	if (big_icons.checked) {
12
	if (big_icons.checked) {
14
		icons_ini.section = "icons32";
13
		icons_ini.section = "icons32";
15
		selected_image = icons32_selected.image;
14
		selected_image = icons32_selected.image;
16
		default_image = icons32_default.image;
-
 
17
		default_icon=95;
15
		default_image = icons32_default.image;
18
	}
16
		default_icon=95;
19
	else {
17
	} else {
20
		icons_ini.section = "icons16";
18
		icons_ini.section = "icons16";
21
		selected_image = icons16_selected.image;
19
		selected_image = icons16_selected.image;
22
		default_image = icons16_default.image;
20
		default_image = icons16_default.image;
Line -... Line 21...
-
 
21
		default_icon=2;
-
 
22
	}
-
 
23
 
-
 
24
	//KolibriNext
-
 
25
	/*
-
 
26
	if (chrnum(file_path, '/')==2) {
-
 
27
		if (ESBYTE[file_path+1]=='/') ext[0] = ESBYTE[file_path+2];
-
 
28
			else ext[0] = ESBYTE[file_path+1];
-
 
29
		ext[1] = '\0';
23
		default_icon=2;
30
		if (big_icons.checked) {
-
 
31
			icons_ini.section = "drives32";
-
 
32
			icon_n = icons_ini.GetInt(#ext, 50);
-
 
33
		} else {
-
 
34
			icons_ini.section = "drives16";
24
	}
35
			icon_n = icons_ini.GetInt(#ext, 50);
-
 
36
		}
25
 
37
	} else 
26
	if (extension)
38
	*/
27
	{
39
	if (extension) {
28
		strcpy(#ext, extension);
-
 
29
		strlwr(#ext);
40
		strcpy(#ext, extension);
30
		icon_n = icons_ini.GetInt(#ext, default_icon);
-
 
31
	} 
41
		strlwr(#ext);
32
	else if (file_path)
42
		icon_n = icons_ini.GetInt(#ext, default_icon);
33
	{
43
	} else if (file_path) {
34
			ReadFile(0,4,#BYTE_HEAD_FILE,file_path);
44
		ReadFile(0,4,#BYTE_HEAD_FILE,file_path);
-
 
45
		IF(DSDWORD[#BYTE_HEAD_FILE]=='KCPK')||(DSDWORD[#BYTE_HEAD_FILE]=='UNEM') 
35
			IF(DSDWORD[#BYTE_HEAD_FILE]=='KCPK')||(DSDWORD[#BYTE_HEAD_FILE]=='UNEM') 
46
			icon_n = icons_ini.GetInt("kex", 2);
36
				icon_n = icons_ini.GetInt("kex", 2);
-
 
37
	}
47
	}
38
	if (fairing_color==col.selec)
-
 
39
	{
48
 
40
		img_draw stdcall(selected_image, xx, yy, icon_size, icon_size, 0, icon_n*icon_size);
-
 
41
	}
49
	if (fairing_color==col.selec) {
42
	else 
50
		img_draw stdcall(selected_image, xx, yy, icon_size, icon_size, 0, icon_n*icon_size);
43
	{
51
	} else {