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