1 // Copyright (c) 2014, Thomas Goyne <plorkyeran@aegisub.org>
2 //
3 // Permission to use, copy, modify, and distribute this software for any
4 // purpose with or without fee is hereby granted, provided that the above
5 // copyright notice and this permission notice appear in all copies.
6 //
7 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 //
15 // Aegisub Project http://www.aegisub.org/
16 
17 #include <memory>
18 
19 class AssFile;
20 class AudioBox;
21 class AudioController;
22 class AssDialogue;
23 class AudioKaraoke;
24 class DialogManager;
25 class FrameMain;
26 class Project;
27 class SearchReplaceEngine;
28 class InitialLineState;
29 class SelectionController;
30 class SubsController;
31 class BaseGrid;
32 class TextSelectionController;
33 class VideoController;
34 class VideoDisplay;
35 class wxWindow;
36 namespace Automation4 { class ScriptManager; }
37 
38 namespace agi {
39 
40 struct Context {
41 	// Note: order here matters quite a bit, as things need to be set up and
42     // torn down in the correct order
43 	std::unique_ptr<AssFile> ass;
44 	std::unique_ptr<TextSelectionController> textSelectionController;
45 	std::unique_ptr<SubsController> subsController;
46 	std::unique_ptr<Project> project;
47 	std::unique_ptr<Automation4::ScriptManager> local_scripts;
48 	std::unique_ptr<SelectionController> selectionController;
49 	std::unique_ptr<VideoController> videoController;
50 	std::unique_ptr<AudioController> audioController;
51 	std::unique_ptr<InitialLineState> initialLineState;
52 	std::unique_ptr<SearchReplaceEngine> search;
53 
54 	// Things that should probably be in some sort of UI-context-model
55 	wxWindow *parent = nullptr;
56 	wxWindow *previousFocus = nullptr;
57 	wxWindow *videoSlider = nullptr;
58 
59 	// Views (i.e. things that should eventually not be here at all)
60 	AudioBox *audioBox = nullptr;
61 	AudioKaraoke *karaoke = nullptr;
62 	BaseGrid *subsGrid = nullptr;
63 	std::unique_ptr<DialogManager> dialog;
64 	FrameMain *frame = nullptr;
65 	VideoDisplay *videoDisplay = nullptr;
66 
67 	Context();
68 	~Context();
69 };
70 
71 }
72