main_window.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * main_window.h - main window
  3. * Copyright (C) 2017 caryoscelus
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __STUDIO__MAIN_WINDOW_H__D1BD80BA
  19. #define __STUDIO__MAIN_WINDOW_H__D1BD80BA
  20. #include <memory>
  21. #include <thread>
  22. #include <QMainWindow>
  23. #include <core/context.h>
  24. #include <core/node.h>
  25. namespace Ui {
  26. class MainWindow;
  27. }
  28. class QErrorMessage;
  29. namespace studio {
  30. class MainWindow : public QMainWindow {
  31. Q_OBJECT
  32. public:
  33. explicit MainWindow(QWidget *parent = 0);
  34. ~MainWindow();
  35. private:
  36. void set_mainarea_image(std::string const& fname);
  37. private Q_SLOTS:
  38. void new_document();
  39. void open();
  40. void reload();
  41. void save();
  42. void save_as();
  43. void about();
  44. void quit();
  45. void tool_mouse();
  46. void tool_zoom();
  47. void render();
  48. void redraw();
  49. void toggle_extra_style(bool checked);
  50. void set_context(std::shared_ptr<core::Context> context_);
  51. void activate(std::shared_ptr<core::AbstractValue> node);
  52. void add_time_dock();
  53. void add_playback_dock();
  54. void add_node_tree_dock();
  55. void add_node_edit_dock();
  56. private:
  57. std::unique_ptr<Ui::MainWindow> ui;
  58. std::unique_ptr<QErrorMessage> error_box;
  59. std::shared_ptr<core::Document> document;
  60. std::shared_ptr<core::Context> context;
  61. std::shared_ptr<core::AbstractValue> active_node;
  62. std::thread render_thread;
  63. std::string fname;
  64. bool extra_style = true;
  65. };
  66. }
  67. #endif