2010-05-21 03:13:36 +02:00
|
|
|
#include "compat.h"
|
2013-01-04 16:01:50 +01:00
|
|
|
|
2013-01-07 02:50:09 +01:00
|
|
|
#include "options.h"
|
2010-05-21 03:13:36 +02:00
|
|
|
|
2011-07-26 21:51:56 +02:00
|
|
|
#include <algorithm>
|
|
|
|
|
2014-07-05 06:21:35 +02:00
|
|
|
wxArrayString lagi_MRU_wxAS(const char *list) {
|
2013-01-04 16:01:50 +01:00
|
|
|
auto const& vec = *config::mru->Get(list);
|
2012-12-23 00:18:38 +01:00
|
|
|
wxArrayString ret;
|
2013-01-04 16:01:50 +01:00
|
|
|
ret.reserve(vec.size());
|
|
|
|
transform(vec.begin(), vec.end(), std::back_inserter(ret),
|
|
|
|
[](agi::fs::path const& p) { return p.wstring(); });
|
2012-12-23 00:18:38 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2012-10-30 16:59:47 +01:00
|
|
|
wxArrayString to_wx(std::vector<std::string> const& vec) {
|
2013-01-04 16:01:50 +01:00
|
|
|
wxArrayString ret;
|
|
|
|
ret.reserve(vec.size());
|
|
|
|
transform(vec.begin(), vec.end(), std::back_inserter(ret), (wxString (*)(std::string const&))to_wx);
|
|
|
|
return ret;
|
2012-10-30 16:59:47 +01:00
|
|
|
}
|
2014-12-31 02:31:10 +01:00
|
|
|
|
|
|
|
wxColour to_wx(agi::Color color) {
|
|
|
|
return wxColour(color.r, color.g, color.b, 255 - color.a);
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString to_wx(std::string const& str) {
|
|
|
|
return wxString(str.c_str(), wxConvUTF8);
|
|
|
|
}
|
|
|
|
|
|
|
|
agi::Color from_wx(wxColour color) {
|
|
|
|
return agi::Color(color.Red(), color.Green(), color.Blue(), 255 - color.Alpha());
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string from_wx(wxString const& str) {
|
|
|
|
return std::string(str.utf8_str());
|
|
|
|
}
|