GUI_AppConfig.xsp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. %module{Slic3r::XS};
  2. %{
  3. #include <xsinit.h>
  4. #include "slic3r/GUI/AppConfig.hpp"
  5. %}
  6. %name{Slic3r::GUI::AppConfig} class AppConfig {
  7. AppConfig();
  8. ~AppConfig();
  9. void reset();
  10. void set_defaults();
  11. void load()
  12. %code%{
  13. try {
  14. THIS->load();
  15. } catch (std::exception& e) {
  16. croak("Loading an application config file failed:\n%s\n", e.what());
  17. }
  18. %};
  19. void save()
  20. %code%{
  21. try {
  22. THIS->save();
  23. } catch (std::exception& e) {
  24. croak("Saving an application config file failed:\n%s\n", e.what());
  25. }
  26. %};
  27. bool exists();
  28. bool dirty();
  29. std::string get(char *name);
  30. void set(char *name, char *value);
  31. bool has(char *section);
  32. std::string get_last_dir();
  33. void update_config_dir(char *dir);
  34. void update_skein_dir(char *dir);
  35. std::string get_last_output_dir(const char *alt = "");
  36. void update_last_output_dir(char *dir);
  37. void reset_selections();
  38. };