openMSX
VisibleSurface.hh
Go to the documentation of this file.
1 #ifndef VISIBLESURFACE_HH
2 #define VISIBLESURFACE_HH
3 
4 #include "Observer.hh"
5 #include "EventListener.hh"
6 #include "RTSchedulable.hh"
7 #include <memory>
8 
9 namespace openmsx {
10 
11 class Layer;
12 class OutputSurface;
13 class Reactor;
14 class CommandConsole;
15 class EventDistributor;
16 class InputEventGenerator;
17 class Setting;
18 class Display;
19 class OSDGUI;
20 class CliComm;
21 class VideoSystem;
22 
26 class VisibleSurface : public EventListener, private Observer<Setting>
27  , private RTSchedulable
28 {
29 public:
30  virtual ~VisibleSurface();
31  virtual void updateWindowTitle() = 0;
32  virtual bool setFullScreen(bool fullscreen) = 0;
33 
38  virtual void finish() = 0;
39 
40  virtual std::unique_ptr<Layer> createSnowLayer() = 0;
41  virtual std::unique_ptr<Layer> createConsoleLayer(
42  Reactor& reactor, CommandConsole& console) = 0;
43  virtual std::unique_ptr<Layer> createOSDGUILayer(OSDGUI& gui) = 0;
44 
49  virtual std::unique_ptr<OutputSurface> createOffScreenSurface() = 0;
50 
51  CliComm& getCliComm() const { return cliComm; }
52  Display& getDisplay() const { return display; }
53 
54 protected:
55  VisibleSurface(Display& display,
56  RTScheduler& rtScheduler,
57  EventDistributor& eventDistributor,
58  InputEventGenerator& inputEventGenerator,
59  CliComm& cliComm,
60  VideoSystem& videoSystem);
61 
62 private:
63  void updateCursor();
64 
65  // Observer
66  void update(const Setting& setting) override;
67  // EventListener
68  int signalEvent(const std::shared_ptr<const Event>& event) override;
69  // RTSchedulable
70  void executeRT() override;
71 
72  Display& display;
73  EventDistributor& eventDistributor;
74  InputEventGenerator& inputEventGenerator;
75  CliComm& cliComm;
76  VideoSystem& videoSystem;
77 };
78 
79 } // namespace openmsx
80 
81 #endif
openmsx::RTSchedulable
Definition: RTSchedulable.hh:10
openmsx::VisibleSurface::VisibleSurface
VisibleSurface(Display &display, RTScheduler &rtScheduler, EventDistributor &eventDistributor, InputEventGenerator &inputEventGenerator, CliComm &cliComm, VideoSystem &videoSystem)
Definition: VisibleSurface.cc:14
openmsx::VisibleSurface::updateWindowTitle
virtual void updateWindowTitle()=0
openmsx::InputEventGenerator
Definition: InputEventGenerator.hh:18
EventListener.hh
openmsx::VisibleSurface::createConsoleLayer
virtual std::unique_ptr< Layer > createConsoleLayer(Reactor &reactor, CommandConsole &console)=0
openmsx::VisibleSurface::createSnowLayer
virtual std::unique_ptr< Layer > createSnowLayer()=0
RTSchedulable.hh
openmsx::RTScheduler
Definition: RTScheduler.hh:19
openmsx::VideoSystem
Video back-end system.
Definition: VideoSystem.hh:20
openmsx::VisibleSurface
An OutputSurface which is visible to the user, such as a window or a full screen display.
Definition: VisibleSurface.hh:26
openmsx::Setting
Definition: Setting.hh:119
openmsx::EventDistributor
Definition: EventDistributor.hh:16
openmsx::Reactor
Contains the main loop of openMSX.
Definition: Reactor.hh:66
openmsx::OSDGUI
Definition: OSDGUI.hh:13
Observer.hh
openmsx::VisibleSurface::finish
virtual void finish()=0
When a complete frame is finished, call this method.
openmsx::EventListener
Definition: EventListener.hh:10
openmsx::Display
Represents the output window/screen of openMSX.
Definition: Display.hh:31
openmsx::CliComm
Definition: CliComm.hh:10
openmsx::VisibleSurface::createOffScreenSurface
virtual std::unique_ptr< OutputSurface > createOffScreenSurface()=0
Create an off-screen OutputSurface which has similar properties as this VisibleSurface.
openmsx::VisibleSurface::createOSDGUILayer
virtual std::unique_ptr< Layer > createOSDGUILayer(OSDGUI &gui)=0
openmsx::VisibleSurface::getDisplay
Display & getDisplay() const
Definition: VisibleSurface.hh:52
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::VisibleSurface::getCliComm
CliComm & getCliComm() const
Definition: VisibleSurface.hh:51
openmsx::Observer
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:9
openmsx::VisibleSurface::~VisibleSurface
virtual ~VisibleSurface()
Definition: VisibleSurface.cc:43
openmsx::CommandConsole
Definition: CommandConsole.hh:64
openmsx::VisibleSurface::setFullScreen
virtual bool setFullScreen(bool fullscreen)=0