Horizon
step_export_window.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include <array>
4 #include <set>
5 #include "util/export_file_chooser.hpp"
6 #include "util/changeable.hpp"
7 
8 namespace horizon {
9 
10 class StepExportWindow : public Gtk::Window, public Changeable {
11 public:
12  StepExportWindow(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, class CoreBoard *c,
13  const std::string &project_dir);
14  static StepExportWindow *create(Gtk::Window *p, class CoreBoard *c, const std::string &project_dir);
15 
16  void set_can_export(bool v);
17  void generate();
18 
19 private:
20  class CoreBoard *core;
21  class STEPExportSettings &settings;
22  Gtk::HeaderBar *header = nullptr;
23  Gtk::Entry *filename_entry = nullptr;
24  Gtk::Button *filename_button = nullptr;
25  Gtk::Button *export_button = nullptr;
26  Gtk::Switch *include_3d_models_switch = nullptr;
27  Gtk::Entry *prefix_entry = nullptr;
28 
29  Gtk::TextView *log_textview = nullptr;
30  Gtk::Spinner *spinner = nullptr;
31 
32  class MyExportFileChooser : public ExportFileChooser {
33  protected:
34  void prepare_chooser(Glib::RefPtr<Gtk::FileChooser> chooser) override;
35  void prepare_filename(std::string &filename) override;
36  };
37  MyExportFileChooser export_filechooser;
38 
39  Glib::Dispatcher export_dispatcher;
40  std::mutex msg_queue_mutex;
41  std::deque<std::string> msg_queue;
42  bool export_running = false;
43 
44  void set_is_busy(bool v);
45 
46  void export_thread(STEPExportSettings settings);
47 };
48 } // namespace horizon
horizon::ExportFileChooser
Definition: export_file_chooser.hpp:7
horizon::Changeable
Definition: changeable.hpp:5
horizon::CoreBoard
Definition: core_board.hpp:11
horizon::StepExportWindow
Definition: step_export_window.hpp:10
horizon::STEPExportSettings
Definition: step_export_settings.hpp:10