mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Utility functions to pass wxWidgets pointers from Perl to C++ code.
C++ var_dir / set_var_dir() interface to access the UI resources from the C++ code.
This commit is contained in:
parent
af51220f34
commit
d9d6d996e9
9 changed files with 157 additions and 3 deletions
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include <boost/locale.hpp>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include <boost/nowide/integration/filesystem.hpp>
|
||||
#include <boost/nowide/convert.hpp>
|
||||
|
||||
|
@ -67,6 +69,24 @@ void trace(unsigned int level, const char *message)
|
|||
(::boost::log::keywords::severity = severity)) << message;
|
||||
}
|
||||
|
||||
static std::string g_var_dir;
|
||||
|
||||
void set_var_dir(const std::string &dir)
|
||||
{
|
||||
g_var_dir = dir;
|
||||
}
|
||||
|
||||
const std::string& var_dir()
|
||||
{
|
||||
return g_var_dir;
|
||||
}
|
||||
|
||||
std::string var(const std::string &file_name)
|
||||
{
|
||||
auto file = boost::filesystem::canonical(boost::filesystem::path(g_var_dir) / file_name).make_preferred();
|
||||
return file.string();
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
||||
#ifdef SLIC3R_HAS_BROKEN_CROAK
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue