summaryrefslogtreecommitdiff
path: root/src/tools/dcpomatic.cc
blob: 3bef6d9ada2c5da70b22909308cfb3acf0d59a1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "wx/film_editor.h"
#include "wx/film_viewer.h"
#include <wx/wx.h>

class DOMFrame : public wxFrame
{
public:
	explicit DOMFrame (wxString const& title)
		: wxFrame (nullptr, -1, title)
	{
		/* Use a panel as the only child of the Frame so that we avoid
		   the dark-grey background on Windows.
		*/
		auto overall_panel = new wxPanel (this, wxID_ANY);

		_film_viewer.reset (new FilmViewer (overall_panel));

		auto right_sizer = new wxBoxSizer (wxVERTICAL);
		right_sizer->Add (_film_viewer->panel(), 2, wxEXPAND | wxALL, 6);

		wxBoxSizer* main_sizer = new wxBoxSizer (wxHORIZONTAL);
		main_sizer->Add (right_sizer, 1, wxEXPAND | wxALL, 6);

		overall_panel->SetSizer (main_sizer);
	}

private:

	FilmEditor* _film_editor;
	std::shared_ptr<FilmViewer> _film_viewer;
};


/** @class App
 *  @brief The magic App class for wxWidgets.
 */
class App : public wxApp
{
private:

	bool OnInit () override
	{
		if (!wxApp::OnInit()) {
			return false;
		}

		_frame = new DOMFrame (_("DCP-o-matic"));
		SetTopWindow (_frame);
		_frame->Maximize ();
		_frame->Show ();

		return true;
	}

	DOMFrame* _frame = nullptr;
};


IMPLEMENT_APP (App)