Code: Select all
wxIconBundle
art_provider::CreateIconBundle(
wxArtID const& art_id,
wxArtClient const& WXUNUSED(art_client)
) {
wxIconBundle icon_bundle;
if (auto const file_type = get_file_type(art_id); !file_type)
;
else {
create_icon_bundle(icon_bundle, *file_type);
delete file_type;
}
return icon_bundle;
}
Code: Select all
static wxFileType*
get_file_type(
wxString const& key
) {
if (auto const file_type = wxTheMimeTypesManager->GetFileTypeFromMimeType(key))
return file_type;
if (auto const file_type = wxTheMimeTypesManager->GetFileTypeFromExtension(key))
return file_type;
return nullptr;
}
static void
create_icon_bundle(
wxIconBundle& icon_bundle,
wxFileType const& file_type
) {
if (wxIconLocation icon_loc; file_type.GetIcon(&icon_loc)) {
/*
* icon_loc denotes the path name of an icon with one *particular*
* size; we now need to collect all other sizes of that icon as well
* in order to build our icon bundle
*/
// ???
}
}