HaX.
[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                 wxBoxSizer* main_sizer = new wxBoxSizer (wxHORIZONTAL);
19                 main_sizer->Add (_film_viewer->panel(), 1, wxEXPAND);
20
21                 overall_panel->SetSizer (main_sizer);
22         }
23
24 private:
25
26         FilmEditor* _film_editor;
27         std::shared_ptr<FilmViewer> _film_viewer;
28 };
29
30
31 /** @class App
32  *  @brief The magic App class for wxWidgets.
33  */
34 class App : public wxApp
35 {
36 private:
37
38         bool OnInit () override
39         {
40                 if (!wxApp::OnInit()) {
41                         return false;
42                 }
43
44                 _frame = new DOMFrame (_("DCP-o-matic"));
45                 SetTopWindow (_frame);
46                 _frame->Maximize ();
47                 _frame->Show ();
48
49                 return true;
50         }
51
52         DOMFrame* _frame = nullptr;
53 };
54
55
56 IMPLEMENT_APP (App)