2018-04-18 17:07:12 +03:00
|
|
|
_ini icons_ini = { "/sys/File managers/icons.ini", NULL };
|
2013-03-11 22:16:24 +04:00
|
|
|
|
2016-11-25 17:15:30 +03:00
|
|
|
void DrawIconByExtension(dword file_path, extension, xx, yy, fairing_color)
|
2013-11-14 04:22:55 +04:00
|
|
|
{
|
2016-11-25 17:15:30 +03:00
|
|
|
char BYTE_HEAD_FILE[4];
|
2017-10-06 00:38:09 +03:00
|
|
|
char ext[512];
|
2015-08-20 13:06:51 +03:00
|
|
|
int i;
|
2018-05-13 19:06:20 +03:00
|
|
|
dword icon_n = 2;
|
2018-04-18 17:07:12 +03:00
|
|
|
dword selected_image;
|
|
|
|
dword default_image;
|
2018-04-23 17:08:39 +03:00
|
|
|
dword default_icon;
|
2018-04-18 17:07:12 +03:00
|
|
|
|
2018-04-19 23:12:07 +03:00
|
|
|
if (big_icons.checked) {
|
2018-04-18 17:07:12 +03:00
|
|
|
icons_ini.section = "icons32";
|
|
|
|
selected_image = icons32_selected.image;
|
|
|
|
default_image = icons32_default.image;
|
2018-04-23 17:08:39 +03:00
|
|
|
default_icon=95;
|
2018-04-18 17:07:12 +03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
icons_ini.section = "icons16";
|
|
|
|
selected_image = icons16_selected.image;
|
|
|
|
default_image = icons16_default.image;
|
2018-04-23 17:08:39 +03:00
|
|
|
default_icon=2;
|
2018-04-18 17:07:12 +03:00
|
|
|
}
|
2017-10-06 00:38:09 +03:00
|
|
|
|
|
|
|
if (extension)
|
2013-11-14 04:22:55 +04:00
|
|
|
{
|
2017-10-06 00:38:09 +03:00
|
|
|
strcpy(#ext, extension);
|
|
|
|
strlwr(#ext);
|
2018-04-23 17:08:39 +03:00
|
|
|
icon_n = icons_ini.GetInt(#ext, default_icon);
|
2016-11-25 17:15:30 +03:00
|
|
|
}
|
|
|
|
else if (file_path)
|
|
|
|
{
|
|
|
|
ReadFile(0,4,#BYTE_HEAD_FILE,file_path);
|
2018-04-18 17:07:12 +03:00
|
|
|
IF(DSDWORD[#BYTE_HEAD_FILE]=='KCPK')||(DSDWORD[#BYTE_HEAD_FILE]=='UNEM')
|
|
|
|
icon_n = icons_ini.GetInt("kex", 2);
|
2017-10-06 00:38:09 +03:00
|
|
|
}
|
2019-04-17 15:11:31 +03:00
|
|
|
if (fairing_color==col.selec)
|
2017-10-06 00:38:09 +03:00
|
|
|
{
|
2018-04-18 17:07:12 +03:00
|
|
|
img_draw stdcall(selected_image, xx, yy, icon_size, icon_size, 0, icon_n*icon_size);
|
2017-10-06 00:38:09 +03:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-04-18 17:07:12 +03:00
|
|
|
img_draw stdcall(default_image, xx, yy, icon_size, icon_size, 0, icon_n*icon_size);
|
2013-11-14 04:22:55 +04:00
|
|
|
}
|
2013-03-11 22:16:24 +04:00
|
|
|
}
|
|
|
|
|