2015-12-04 20:25:45 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
2015-12-07 23:39:54 +00:00
|
|
|
#include <xsinit.h>
|
2015-12-06 11:54:01 +00:00
|
|
|
#include "slic3r/GUI/GUI.hpp"
|
2018-03-16 17:20:47 +00:00
|
|
|
#include "slic3r/Utils/ASCIIFolding.hpp"
|
2018-05-21 14:14:20 +00:00
|
|
|
#include "slic3r/Utils/Serial.hpp"
|
2015-12-04 20:25:45 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
|
|
%package{Slic3r::GUI};
|
|
|
|
|
2018-04-09 15:03:37 +00:00
|
|
|
void about()
|
|
|
|
%code{% Slic3r::GUI::about(); %};
|
|
|
|
|
2015-12-04 20:25:45 +00:00
|
|
|
void disable_screensaver()
|
|
|
|
%code{% Slic3r::GUI::disable_screensaver(); %};
|
|
|
|
|
|
|
|
void enable_screensaver()
|
|
|
|
%code{% Slic3r::GUI::enable_screensaver(); %};
|
2016-04-13 18:45:44 +00:00
|
|
|
|
2017-11-02 15:21:34 +00:00
|
|
|
std::vector<std::string> scan_serial_ports()
|
2018-05-21 14:14:20 +00:00
|
|
|
%code{% RETVAL=Slic3r::Utils::scan_serial_ports(); %};
|
2017-11-02 15:21:34 +00:00
|
|
|
|
2016-04-13 18:45:44 +00:00
|
|
|
bool debugged()
|
|
|
|
%code{% RETVAL=Slic3r::GUI::debugged(); %};
|
|
|
|
|
|
|
|
void break_to_debugger()
|
|
|
|
%code{% Slic3r::GUI::break_to_debugger(); %};
|
2017-12-04 09:48:40 +00:00
|
|
|
|
|
|
|
void set_wxapp(SV *ui)
|
|
|
|
%code%{ Slic3r::GUI::set_wxapp((wxApp*)wxPli_sv_2_object(aTHX_ ui, "Wx::App")); %};
|
|
|
|
|
|
|
|
void set_main_frame(SV *ui)
|
|
|
|
%code%{ Slic3r::GUI::set_main_frame((wxFrame*)wxPli_sv_2_object(aTHX_ ui, "Wx::Frame")); %};
|
|
|
|
|
|
|
|
void set_tab_panel(SV *ui)
|
|
|
|
%code%{ Slic3r::GUI::set_tab_panel((wxNotebook*)wxPli_sv_2_object(aTHX_ ui, "Wx::Notebook")); %};
|
2018-04-09 15:03:37 +00:00
|
|
|
|
2018-05-04 14:04:43 +00:00
|
|
|
void add_menus(SV *ui, int event_preferences_changed, int event_language_change)
|
|
|
|
%code%{ Slic3r::GUI::add_menus((wxMenuBar*)wxPli_sv_2_object(aTHX_ ui, "Wx::MenuBar"), event_preferences_changed, event_language_change); %};
|
2017-12-04 09:48:40 +00:00
|
|
|
|
2018-03-15 17:06:26 +00:00
|
|
|
void create_preset_tabs(bool no_controller, int event_value_change, int event_presets_changed)
|
|
|
|
%code%{ Slic3r::GUI::create_preset_tabs(no_controller, event_value_change, event_presets_changed); %};
|
2017-12-04 09:48:40 +00:00
|
|
|
|
2018-04-30 12:31:57 +00:00
|
|
|
void show_error_id(int id, std::string msg)
|
|
|
|
%code%{ Slic3r::GUI::show_error_id(id, msg); %};
|
|
|
|
|
2018-04-18 16:06:07 +00:00
|
|
|
TabIface* get_preset_tab(char *name)
|
2018-01-23 10:37:19 +00:00
|
|
|
%code%{ RETVAL=Slic3r::GUI::get_preset_tab_iface(name); %};
|
2018-02-09 10:04:34 +00:00
|
|
|
|
|
|
|
bool load_language()
|
|
|
|
%code%{ RETVAL=Slic3r::GUI::load_language(); %};
|
2018-02-02 11:38:35 +00:00
|
|
|
|
|
|
|
void create_combochecklist(SV *ui, std::string text, std::string items, bool initial_value)
|
|
|
|
%code%{ Slic3r::GUI::create_combochecklist((wxComboCtrl*)wxPli_sv_2_object(aTHX_ ui, "Wx::ComboCtrl"), text, items, initial_value); %};
|
|
|
|
|
|
|
|
int combochecklist_get_flags(SV *ui)
|
|
|
|
%code%{ RETVAL=Slic3r::GUI::combochecklist_get_flags((wxComboCtrl*)wxPli_sv_2_object(aTHX_ ui, "Wx::ComboCtrl")); %};
|
2018-02-20 07:58:46 +00:00
|
|
|
|
|
|
|
void set_app_config(AppConfig *app_config)
|
|
|
|
%code%{ Slic3r::GUI::set_app_config(app_config); %};
|
2018-02-22 10:12:29 +00:00
|
|
|
|
2018-04-11 10:21:15 +00:00
|
|
|
bool check_unsaved_changes()
|
|
|
|
%code%{ RETVAL=Slic3r::GUI::check_unsaved_changes(); %};
|
|
|
|
|
2018-04-24 16:06:42 +00:00
|
|
|
bool config_wizard_startup(int app_config_exists)
|
2018-04-11 11:12:08 +00:00
|
|
|
%code%{
|
|
|
|
try {
|
2018-04-24 16:06:42 +00:00
|
|
|
RETVAL=Slic3r::GUI::config_wizard_startup(app_config_exists != 0);
|
2018-04-11 11:12:08 +00:00
|
|
|
} catch (std::exception& e) {
|
|
|
|
croak("%s\n", e.what());
|
|
|
|
}
|
|
|
|
%};
|
2018-03-13 11:39:57 +00:00
|
|
|
|
2018-02-22 10:12:29 +00:00
|
|
|
void open_preferences_dialog(int preferences_event)
|
|
|
|
%code%{ Slic3r::GUI::open_preferences_dialog(preferences_event); %};
|
2018-03-09 16:17:51 +00:00
|
|
|
|
|
|
|
void set_preset_bundle(PresetBundle *preset_bundle)
|
|
|
|
%code%{ Slic3r::GUI::set_preset_bundle(preset_bundle); %};
|
2018-03-09 17:34:30 +00:00
|
|
|
|
2018-04-16 14:52:11 +00:00
|
|
|
void set_preset_updater(PresetUpdater* updater)
|
|
|
|
%code%{ Slic3r::GUI::set_preset_updater(updater); %};
|
|
|
|
|
2018-03-09 17:34:30 +00:00
|
|
|
void add_frequently_changed_parameters(SV *ui_parent, SV *ui_sizer, SV *ui_p_sizer)
|
|
|
|
%code%{ Slic3r::GUI::add_frequently_changed_parameters((wxWindow*)wxPli_sv_2_object(aTHX_ ui_parent, "Wx::Window"),
|
|
|
|
(wxBoxSizer*)wxPli_sv_2_object(aTHX_ ui_sizer, "Wx::BoxSizer"),
|
|
|
|
(wxFlexGridSizer*)wxPli_sv_2_object(aTHX_ ui_p_sizer, "Wx::FlexGridSizer")); %};
|
2018-03-16 17:20:47 +00:00
|
|
|
|
2018-05-17 08:46:32 +00:00
|
|
|
void add_expert_mode_part(SV *ui_parent, SV *ui_sizer)
|
|
|
|
%code%{ Slic3r::GUI::add_expert_mode_part((wxWindow*)wxPli_sv_2_object(aTHX_ ui_parent, "Wx::Window"),
|
|
|
|
(wxBoxSizer*)wxPli_sv_2_object(aTHX_ ui_sizer, "Wx::BoxSizer")); %};
|
|
|
|
|
2018-05-17 12:07:50 +00:00
|
|
|
void set_objects_from_perl( SV *ui_parent,
|
|
|
|
SV *frequently_changed_parameters_sizer,
|
2018-05-17 08:46:32 +00:00
|
|
|
SV *expert_mode_part_sizer,
|
|
|
|
SV *scrolled_window_sizer,
|
2018-05-27 20:12:01 +00:00
|
|
|
SV *btn_export_gcode,
|
2018-05-17 08:46:32 +00:00
|
|
|
SV *btn_export_stl,
|
|
|
|
SV *btn_reslice,
|
|
|
|
SV *btn_print,
|
2018-05-18 09:39:49 +00:00
|
|
|
SV *btn_send_gcode,
|
|
|
|
SV *manifold_warning_icon)
|
2018-05-17 12:07:50 +00:00
|
|
|
%code%{ Slic3r::GUI::set_objects_from_perl(
|
|
|
|
(wxWindow *)wxPli_sv_2_object(aTHX_ ui_parent, "Wx::Window"),
|
2018-05-17 08:46:32 +00:00
|
|
|
(wxBoxSizer *)wxPli_sv_2_object(aTHX_ frequently_changed_parameters_sizer, "Wx::BoxSizer"),
|
|
|
|
(wxBoxSizer *)wxPli_sv_2_object(aTHX_ expert_mode_part_sizer, "Wx::BoxSizer"),
|
|
|
|
(wxBoxSizer *)wxPli_sv_2_object(aTHX_ scrolled_window_sizer, "Wx::BoxSizer"),
|
2018-05-27 20:12:01 +00:00
|
|
|
(wxButton *)wxPli_sv_2_object(aTHX_ btn_export_gcode, "Wx::Button"),
|
2018-05-17 08:46:32 +00:00
|
|
|
(wxButton *)wxPli_sv_2_object(aTHX_ btn_export_stl, "Wx::Button"),
|
|
|
|
(wxButton *)wxPli_sv_2_object(aTHX_ btn_reslice, "Wx::Button"),
|
|
|
|
(wxButton *)wxPli_sv_2_object(aTHX_ btn_print, "Wx::Button"),
|
2018-05-18 09:39:49 +00:00
|
|
|
(wxButton *)wxPli_sv_2_object(aTHX_ btn_send_gcode, "Wx::Button"),
|
|
|
|
(wxStaticBitmap *)wxPli_sv_2_object(aTHX_ manifold_warning_icon, "Wx::StaticBitmap")); %};
|
2018-05-17 08:46:32 +00:00
|
|
|
|
2018-05-17 12:07:50 +00:00
|
|
|
void set_show_print_info(bool show)
|
|
|
|
%code%{ Slic3r::GUI::set_show_print_info(show); %};
|
2018-05-17 08:46:32 +00:00
|
|
|
|
2018-05-18 09:39:49 +00:00
|
|
|
void set_show_manifold_warning_icon(bool show)
|
|
|
|
%code%{ Slic3r::GUI::set_show_manifold_warning_icon(show); %};
|
|
|
|
|
2018-05-21 12:49:31 +00:00
|
|
|
void update_mode()
|
|
|
|
%code%{ Slic3r::GUI::update_mode(); %};
|
|
|
|
|
2018-05-30 15:52:28 +00:00
|
|
|
void add_object(const char *name)
|
|
|
|
%code%{ Slic3r::GUI::add_object(name); %};
|
|
|
|
|
|
|
|
void del_object()
|
|
|
|
%code%{ Slic3r::GUI::del_object(); %};
|
|
|
|
|
2018-03-16 17:20:47 +00:00
|
|
|
std::string fold_utf8_to_ascii(const char *src)
|
|
|
|
%code%{ RETVAL = Slic3r::fold_utf8_to_ascii(src); %};
|
2018-03-22 12:49:48 +00:00
|
|
|
|
|
|
|
void add_export_option(SV *ui, std::string format)
|
|
|
|
%code%{ Slic3r::GUI::add_export_option((wxFileDialog*)wxPli_sv_2_object(aTHX_ ui, "Wx::FileDialog"), format); %};
|
|
|
|
|
|
|
|
int get_export_option(SV *ui)
|
|
|
|
%code%{ RETVAL = Slic3r::GUI::get_export_option((wxFileDialog*)wxPli_sv_2_object(aTHX_ ui, "Wx::FileDialog")); %};
|
2018-05-21 19:04:03 +00:00
|
|
|
|
|
|
|
void desktop_open_datadir_folder()
|
|
|
|
%code%{ Slic3r::GUI::desktop_open_datadir_folder(); %};
|