2015-12-04 20:25:45 +00:00
|
|
|
#ifndef slic3r_GUI_hpp_
|
|
|
|
#define slic3r_GUI_hpp_
|
|
|
|
|
2017-11-02 15:21:34 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2018-01-07 17:41:40 +00:00
|
|
|
#include "Config.hpp"
|
2017-11-02 15:21:34 +00:00
|
|
|
|
2017-12-04 09:48:40 +00:00
|
|
|
class wxApp;
|
|
|
|
class wxFrame;
|
2017-12-22 10:50:28 +00:00
|
|
|
class wxWindow;
|
2017-12-04 09:48:40 +00:00
|
|
|
class wxMenuBar;
|
|
|
|
class wxNotebook;
|
2018-02-07 16:13:52 +00:00
|
|
|
class wxString;
|
2018-02-08 09:58:13 +00:00
|
|
|
class wxArrayString;
|
|
|
|
class wxArrayLong;
|
2017-12-04 09:48:40 +00:00
|
|
|
|
2017-12-22 10:50:28 +00:00
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
class PresetBundle;
|
2018-01-05 14:11:33 +00:00
|
|
|
class PresetCollection;
|
2018-01-03 09:12:42 +00:00
|
|
|
class AppConfig;
|
2018-01-07 17:41:40 +00:00
|
|
|
class DynamicPrintConfig;
|
2018-01-23 10:37:19 +00:00
|
|
|
class TabIface;
|
2017-12-22 10:50:28 +00:00
|
|
|
|
2018-02-07 16:13:52 +00:00
|
|
|
//! macro used to localization, return wxString
|
|
|
|
#define _L(s) wxGetTranslation(s)
|
|
|
|
//! macro used to localization, return const CharType *
|
|
|
|
#define _LU8(s) wxGetTranslation(s).ToUTF8().data()
|
|
|
|
|
2017-12-22 10:50:28 +00:00
|
|
|
namespace GUI {
|
|
|
|
|
2018-01-05 14:11:33 +00:00
|
|
|
class Tab;
|
2018-01-30 11:13:55 +00:00
|
|
|
// Map from an file_type name to full file wildcard name.
|
|
|
|
typedef std::map<std::string, std::string> t_file_wild_card;
|
|
|
|
inline t_file_wild_card& get_file_wild_card() {
|
|
|
|
static t_file_wild_card FILE_WILDCARDS;
|
|
|
|
if (FILE_WILDCARDS.empty()){
|
|
|
|
FILE_WILDCARDS["known"] = "Known files (*.stl, *.obj, *.amf, *.xml, *.prusa)|*.stl;*.STL;*.obj;*.OBJ;*.amf;*.AMF;*.xml;*.XML;*.prusa;*.PRUSA";
|
|
|
|
FILE_WILDCARDS["stl"] = "STL files (*.stl)|*.stl;*.STL";
|
|
|
|
FILE_WILDCARDS["obj"] = "OBJ files (*.obj)|*.obj;*.OBJ";
|
|
|
|
FILE_WILDCARDS["amf"] = "AMF files (*.amf)|*.amf;*.AMF;*.xml;*.XML";
|
|
|
|
FILE_WILDCARDS["prusa"] = "Prusa Control files (*.prusa)|*.prusa;*.PRUSA";
|
|
|
|
FILE_WILDCARDS["ini"] = "INI files *.ini|*.ini;*.INI";
|
|
|
|
FILE_WILDCARDS["gcode"] = "G-code files (*.gcode, *.gco, *.g, *.ngc)|*.gcode;*.GCODE;*.gco;*.GCO;*.g;*.G;*.ngc;*.NGC";
|
|
|
|
FILE_WILDCARDS["svg"] = "SVG files *.svg|*.svg;*.SVG";
|
|
|
|
}
|
|
|
|
return FILE_WILDCARDS;
|
|
|
|
}
|
2015-12-04 20:25:45 +00:00
|
|
|
|
|
|
|
void disable_screensaver();
|
|
|
|
void enable_screensaver();
|
2017-11-02 15:21:34 +00:00
|
|
|
std::vector<std::string> scan_serial_ports();
|
2016-04-13 18:45:44 +00:00
|
|
|
bool debugged();
|
|
|
|
void break_to_debugger();
|
2015-12-04 20:25:45 +00:00
|
|
|
|
2017-12-04 09:48:40 +00:00
|
|
|
// Passing the wxWidgets GUI classes instantiated by the Perl part to C++.
|
|
|
|
void set_wxapp(wxApp *app);
|
|
|
|
void set_main_frame(wxFrame *main_frame);
|
|
|
|
void set_tab_panel(wxNotebook *tab_panel);
|
|
|
|
|
2018-02-09 10:04:34 +00:00
|
|
|
void add_debug_menu(wxMenuBar *menu, int event_language_change);
|
2017-12-22 10:50:28 +00:00
|
|
|
// Create a new preset tab (print, filament and printer),
|
2018-01-25 20:44:22 +00:00
|
|
|
void create_preset_tabs(PresetBundle *preset_bundle, AppConfig *app_config,
|
2018-01-26 00:44:34 +00:00
|
|
|
bool no_controller, bool is_disabled_button_browse, bool is_user_agent,
|
|
|
|
int event_value_change, int event_presets_changed,
|
|
|
|
int event_button_browse, int event_button_test);
|
2018-01-23 10:37:19 +00:00
|
|
|
TabIface* get_preset_tab_iface(char *name);
|
|
|
|
|
2017-12-04 09:48:40 +00:00
|
|
|
// add it at the end of the tab panel.
|
2018-01-26 00:44:34 +00:00
|
|
|
void add_created_tab(Tab* panel, PresetBundle *preset_bundle, AppConfig *app_config);
|
2018-01-07 17:41:40 +00:00
|
|
|
// Change option value in config
|
2018-02-15 16:30:33 +00:00
|
|
|
void change_opt_value(DynamicPrintConfig& config, t_config_option_key opt_key, boost::any value, int opt_index = 0);
|
2017-12-22 10:50:28 +00:00
|
|
|
|
2018-02-07 16:13:52 +00:00
|
|
|
void show_error(wxWindow* parent, wxString message);
|
|
|
|
void show_info(wxWindow* parent, wxString message, wxString title);
|
2017-12-22 10:50:28 +00:00
|
|
|
|
2018-02-08 09:58:13 +00:00
|
|
|
// load language saved at application config
|
|
|
|
bool load_language();
|
|
|
|
// save language at application config
|
2018-02-12 07:57:32 +00:00
|
|
|
void save_language();
|
2018-02-08 09:58:13 +00:00
|
|
|
// get list of installed languages
|
|
|
|
void get_installed_languages(wxArrayString & names, wxArrayLong & identifiers);
|
|
|
|
// select language from the list of installed languages
|
|
|
|
bool select_language(wxArrayString & names, wxArrayLong & identifiers);
|
2017-12-04 09:48:40 +00:00
|
|
|
|
2018-02-09 10:04:34 +00:00
|
|
|
std::vector<Tab *>& get_tabs_list();
|
|
|
|
bool checked_tab(Tab* tab);
|
|
|
|
void delete_tab_from_list(Tab* tab);
|
|
|
|
|
2015-12-04 20:25:45 +00:00
|
|
|
} }
|
|
|
|
|
|
|
|
#endif
|