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