GUI.xsp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. %module{Slic3r::XS};
  2. %{
  3. #include <xsinit.h>
  4. #include "slic3r/GUI/GUI.hpp"
  5. #include "slic3r/Utils/ASCIIFolding.hpp"
  6. #include "slic3r/Utils/FixModelByWin10.hpp"
  7. #include "slic3r/Utils/Serial.hpp"
  8. %}
  9. %package{Slic3r::GUI};
  10. void about()
  11. %code{% Slic3r::GUI::about(); %};
  12. void disable_screensaver()
  13. %code{% Slic3r::GUI::disable_screensaver(); %};
  14. void enable_screensaver()
  15. %code{% Slic3r::GUI::enable_screensaver(); %};
  16. std::vector<std::string> scan_serial_ports()
  17. %code{% RETVAL=Slic3r::Utils::scan_serial_ports(); %};
  18. bool debugged()
  19. %code{% RETVAL=Slic3r::GUI::debugged(); %};
  20. void break_to_debugger()
  21. %code{% Slic3r::GUI::break_to_debugger(); %};
  22. bool is_windows10()
  23. %code{% RETVAL=Slic3r::is_windows10(); %};
  24. void set_wxapp(SV *ui)
  25. %code%{ Slic3r::GUI::set_wxapp((wxApp*)wxPli_sv_2_object(aTHX_ ui, "Wx::App")); %};
  26. void set_main_frame(SV *ui)
  27. %code%{ Slic3r::GUI::set_main_frame((wxFrame*)wxPli_sv_2_object(aTHX_ ui, "Wx::Frame")); %};
  28. void set_tab_panel(SV *ui)
  29. %code%{ Slic3r::GUI::set_tab_panel((wxNotebook*)wxPli_sv_2_object(aTHX_ ui, "Wx::Notebook")); %};
  30. void add_menus(SV *ui, int event_preferences_changed, int event_language_change)
  31. %code%{ Slic3r::GUI::add_menus((wxMenuBar*)wxPli_sv_2_object(aTHX_ ui, "Wx::MenuBar"), event_preferences_changed, event_language_change); %};
  32. void create_preset_tabs(bool no_controller, int event_value_change, int event_presets_changed)
  33. %code%{ Slic3r::GUI::create_preset_tabs(no_controller, event_value_change, event_presets_changed); %};
  34. void show_error_id(int id, std::string msg)
  35. %code%{ Slic3r::GUI::show_error_id(id, msg); %};
  36. TabIface* get_preset_tab(char *name)
  37. %code%{ RETVAL=Slic3r::GUI::get_preset_tab_iface(name); %};
  38. bool load_language()
  39. %code%{ RETVAL=Slic3r::GUI::load_language(); %};
  40. void create_combochecklist(SV *ui, std::string text, std::string items, bool initial_value)
  41. %code%{ Slic3r::GUI::create_combochecklist((wxComboCtrl*)wxPli_sv_2_object(aTHX_ ui, "Wx::ComboCtrl"), text, items, initial_value); %};
  42. int combochecklist_get_flags(SV *ui)
  43. %code%{ RETVAL=Slic3r::GUI::combochecklist_get_flags((wxComboCtrl*)wxPli_sv_2_object(aTHX_ ui, "Wx::ComboCtrl")); %};
  44. void set_app_config(AppConfig *app_config)
  45. %code%{ Slic3r::GUI::set_app_config(app_config); %};
  46. bool check_unsaved_changes()
  47. %code%{ RETVAL=Slic3r::GUI::check_unsaved_changes(); %};
  48. bool config_wizard_startup(int app_config_exists)
  49. %code%{
  50. RETVAL=Slic3r::GUI::config_wizard_startup(app_config_exists != 0);
  51. %};
  52. void open_preferences_dialog(int preferences_event)
  53. %code%{ Slic3r::GUI::open_preferences_dialog(preferences_event); %};
  54. void set_preset_bundle(PresetBundle *preset_bundle)
  55. %code%{ Slic3r::GUI::set_preset_bundle(preset_bundle); %};
  56. void set_preset_updater(PresetUpdater* updater)
  57. %code%{ Slic3r::GUI::set_preset_updater(updater); %};
  58. void add_frequently_changed_parameters(SV *ui_parent, SV *ui_sizer, SV *ui_p_sizer)
  59. %code%{ Slic3r::GUI::add_frequently_changed_parameters((wxWindow*)wxPli_sv_2_object(aTHX_ ui_parent, "Wx::Window"),
  60. (wxBoxSizer*)wxPli_sv_2_object(aTHX_ ui_sizer, "Wx::BoxSizer"),
  61. (wxFlexGridSizer*)wxPli_sv_2_object(aTHX_ ui_p_sizer, "Wx::FlexGridSizer")); %};
  62. std::string fold_utf8_to_ascii(const char *src)
  63. %code%{ RETVAL = Slic3r::fold_utf8_to_ascii(src); %};
  64. void add_export_option(SV *ui, std::string format)
  65. %code%{ Slic3r::GUI::add_export_option((wxFileDialog*)wxPli_sv_2_object(aTHX_ ui, "Wx::FileDialog"), format); %};
  66. int get_export_option(SV *ui)
  67. %code%{ RETVAL = Slic3r::GUI::get_export_option((wxFileDialog*)wxPli_sv_2_object(aTHX_ ui, "Wx::FileDialog")); %};
  68. void desktop_open_datadir_folder()
  69. %code%{ Slic3r::GUI::desktop_open_datadir_folder(); %};
  70. void fix_model_by_win10_sdk_gui(ModelObject *model_object_src, Print *print, Model *model_dst)
  71. %code%{ Slic3r::fix_model_by_win10_sdk_gui(*model_object_src, *print, *model_dst); %};
  72. void set_3DScene(SV *scene)
  73. %code%{ Slic3r::GUI::set_3DScene((_3DScene *)wxPli_sv_2_object(aTHX_ scene, "Slic3r::Model::3DScene") ); %};