3bef6d9ada2c5da70b22909308cfb3acf0d59a1b
[dcpomatic.git] / src / tools / dcpomatic.cc
1 #include "wx/film_editor.h"
2 #include "wx/film_viewer.h"
3 #include <wx/wx.h>
4
5 class DOMFrame : public wxFrame
6 {
7 public:
8         explicit DOMFrame (wxString const& title)
9                 : wxFrame (nullptr, -1, title)
10         {
11                 /* Use a panel as the only child of the Frame so that we avoid
12                    the dark-grey background on Windows.
13                 */
14                 auto overall_panel = new wxPanel (this, wxID_ANY);
15
16                 _film_viewer.reset (new FilmViewer (overall_panel));
17
18                 auto right_sizer = new wxBoxSizer (wxVERTICAL);
19                 right_sizer->Add (_film_viewer->panel(), 2, wxEXPAND | wxALL, 6);
20
21                 wxBoxSizer* main_sizer = new wxBoxSizer (wxHORIZONTAL);
22                 main_sizer->Add (right_sizer, 1, wxEXPAND | wxALL, 6);
23
24                 overall_panel->SetSizer (main_sizer);
25         }
26
27 private:
28
29         FilmEditor* _film_editor;
30         std::shared_ptr<FilmViewer> _film_viewer;
31 };
32
33
34 /** @class App
35  *  @brief The magic App class for wxWidgets.
36  */
37 class App : public wxApp
38 {
39 private:
40
41         bool OnInit () override
42         {
43                 if (!wxApp::OnInit()) {
44                         return false;
45                 }
46
47                 _frame = new DOMFrame (_("DCP-o-matic"));
48                 SetTopWindow (_frame);
49                 _frame->Maximize ();
50                 _frame->Show ();
51
52                 return true;
53         }
54
55         DOMFrame* _frame = nullptr;
56 };
57
58
59 IMPLEMENT_APP (App)