2015-12-04 21:25:45 +01:00
|
|
|
#ifndef slic3r_GUI_hpp_
|
|
|
|
|
#define slic3r_GUI_hpp_
|
|
|
|
|
|
2019-01-02 15:11:05 +01:00
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
|
|
|
|
|
|
#include <wx/string.h>
|
|
|
|
|
|
2018-11-26 14:41:58 +01:00
|
|
|
#include "libslic3r/Config.hpp"
|
2017-11-02 16:21:34 +01:00
|
|
|
|
2018-02-07 11:37:15 +01:00
|
|
|
class wxWindow;
|
2017-12-04 10:48:40 +01:00
|
|
|
class wxMenuBar;
|
|
|
|
|
class wxNotebook;
|
2018-02-02 12:38:35 +01:00
|
|
|
class wxComboCtrl;
|
2018-03-22 13:49:48 +01:00
|
|
|
class wxFileDialog;
|
2018-09-17 15:12:13 +02:00
|
|
|
class wxTopLevelWindow;
|
2017-12-04 10:48:40 +01:00
|
|
|
|
2017-12-22 11:50:28 +01:00
|
|
|
namespace Slic3r {
|
|
|
|
|
|
2018-01-03 10:12:42 +01:00
|
|
|
class AppConfig;
|
2018-01-07 18:41:40 +01:00
|
|
|
class DynamicPrintConfig;
|
2018-09-19 11:02:24 +02:00
|
|
|
class Print;
|
2018-02-28 15:39:20 +01:00
|
|
|
|
2017-12-22 11:50:28 +01:00
|
|
|
namespace GUI {
|
|
|
|
|
|
2015-12-04 21:25:45 +01:00
|
|
|
void disable_screensaver();
|
|
|
|
|
void enable_screensaver();
|
2016-04-13 20:45:44 +02:00
|
|
|
bool debugged();
|
|
|
|
|
void break_to_debugger();
|
2015-12-04 21:25:45 +01:00
|
|
|
|
2019-02-03 11:10:25 +01:00
|
|
|
// Platform specific Ctrl+/Alt+ (Windows, Linux) vs. ⌘/⌥ (OSX) prefixes
|
|
|
|
|
extern const std::string& shortkey_ctrl_prefix();
|
|
|
|
|
extern const std::string& shortkey_alt_prefix();
|
|
|
|
|
|
|
|
|
|
extern AppConfig* get_app_config();
|
2017-12-04 10:48:40 +01:00
|
|
|
|
2018-05-04 16:04:43 +02:00
|
|
|
extern void add_menus(wxMenuBar *menu, int event_preferences_changed, int event_language_change);
|
2018-04-11 12:21:15 +02:00
|
|
|
|
2018-04-24 18:06:42 +02:00
|
|
|
// Checks if configuration wizard needs to run, calls config_wizard if so.
|
|
|
|
|
// Returns whether the Wizard ran.
|
|
|
|
|
extern bool config_wizard_startup(bool app_config_exists);
|
2018-04-16 16:52:11 +02:00
|
|
|
|
|
|
|
|
// Opens the configuration wizard, returns true if wizard is finished & accepted.
|
2018-04-24 18:06:42 +02:00
|
|
|
// The run_reason argument is actually ConfigWizard::RunReason, but int is used here because of Perl.
|
|
|
|
|
extern void config_wizard(int run_reason);
|
2018-02-22 11:12:29 +01:00
|
|
|
|
2018-01-07 18:41:40 +01:00
|
|
|
// Change option value in config
|
2018-04-13 12:35:04 +02:00
|
|
|
void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt_key, const boost::any& value, int opt_index = 0);
|
2017-12-22 11:50:28 +01:00
|
|
|
|
2018-04-13 12:35:04 +02:00
|
|
|
void show_error(wxWindow* parent, const wxString& message);
|
2018-04-30 14:31:57 +02:00
|
|
|
void show_error_id(int id, const std::string& message); // For Perl
|
2018-04-13 12:35:04 +02:00
|
|
|
void show_info(wxWindow* parent, const wxString& message, const wxString& title);
|
|
|
|
|
void warning_catcher(wxWindow* parent, const wxString& message);
|
2017-12-22 11:50:28 +01:00
|
|
|
|
2018-02-02 12:38:35 +01:00
|
|
|
// Creates a wxCheckListBoxComboPopup inside the given wxComboCtrl, filled with the given text and items.
|
|
|
|
|
// Items are all initialized to the given value.
|
|
|
|
|
// Items must be separated by '|', for example "Item1|Item2|Item3", and so on.
|
|
|
|
|
void create_combochecklist(wxComboCtrl* comboCtrl, std::string text, std::string items, bool initial_value);
|
|
|
|
|
|
|
|
|
|
// Returns the current state of the items listed in the wxCheckListBoxComboPopup contained in the given wxComboCtrl,
|
|
|
|
|
// encoded inside an int.
|
|
|
|
|
int combochecklist_get_flags(wxComboCtrl* comboCtrl);
|
|
|
|
|
|
2019-01-02 15:11:05 +01:00
|
|
|
// wxString conversions:
|
|
|
|
|
|
|
|
|
|
// wxString from std::string in UTF8
|
2018-03-06 09:44:53 +01:00
|
|
|
wxString from_u8(const std::string &str);
|
2019-01-02 15:11:05 +01:00
|
|
|
// std::string in UTF8 from wxString
|
2018-09-19 10:34:21 +02:00
|
|
|
std::string into_u8(const wxString &str);
|
2019-01-02 15:11:05 +01:00
|
|
|
// wxString from boost path
|
|
|
|
|
wxString from_path(const boost::filesystem::path &path);
|
|
|
|
|
// boost path from wxString
|
|
|
|
|
boost::filesystem::path into_path(const wxString &str);
|
2018-02-22 11:34:41 +01:00
|
|
|
|
2018-04-09 17:03:37 +02:00
|
|
|
// Display an About dialog
|
2018-05-21 21:04:03 +02:00
|
|
|
extern void about();
|
|
|
|
|
// Ask the destop to open the datadir using the default file explorer.
|
|
|
|
|
extern void desktop_open_datadir_folder();
|
2018-04-09 17:03:37 +02:00
|
|
|
|
|
|
|
|
} // namespace GUI
|
|
|
|
|
} // namespace Slic3r
|
2015-12-04 21:25:45 +01:00
|
|
|
|
|
|
|
|
#endif
|