openMSX
OSDGUI.hh
Go to the documentation of this file.
1 #ifndef OSDGUI_HH
2 #define OSDGUI_HH
3 
4 #include "OSDTopWidget.hh"
5 #include "Command.hh"
6 #include <memory>
7 
8 namespace openmsx {
9 
10 class Display;
11 class CommandController;
12 
13 class OSDGUI
14 {
15 public:
16  OSDGUI(CommandController& commandController, Display& display);
17 
18  Display& getDisplay() const { return display; }
19  const OSDTopWidget& getTopWidget() const { return topWidget; }
20  OSDTopWidget& getTopWidget() { return topWidget; }
21  void refresh() const;
22 
23  void setOpenGL(bool openGL_) { openGL = openGL_; }
24  bool isOpenGL() const { return openGL; }
25 
26 private:
27  Display& display;
28 
29  class OSDCommand final : public Command {
30  public:
31  explicit OSDCommand(CommandController& commandController);
32  void execute(span<const TclObject> tokens, TclObject& result) override;
33  std::string help(const std::vector<std::string>& tokens) const override;
34  void tabCompletion(std::vector<std::string>& tokens) const override;
35 
36  private:
37  void create (span<const TclObject> tokens, TclObject& result);
38  void destroy (span<const TclObject> tokens, TclObject& result);
39  void info (span<const TclObject> tokens, TclObject& result);
40  void exists (span<const TclObject> tokens, TclObject& result);
41  void configure(span<const TclObject> tokens, TclObject& result);
42  std::unique_ptr<OSDWidget> create(
43  std::string_view type, const TclObject& name) const;
44  void configure(OSDWidget& widget, span<const TclObject> tokens);
45 
46  OSDWidget& getWidget(std::string_view name) const;
47  } osdCommand;
48 
49  OSDTopWidget topWidget;
50  bool openGL;
51 };
52 
53 } // namespace openmsx
54 
55 #endif
openmsx::CommandController
Definition: CommandController.hh:17
openmsx::OSDGUI::getTopWidget
OSDTopWidget & getTopWidget()
Definition: OSDGUI.hh:20
OSDTopWidget.hh
openmsx::OSDWidget
Definition: OSDWidget.hh:16
span
Definition: span.hh:34
openmsx::IDEDeviceFactory::create
std::unique_ptr< IDEDevice > create(const DeviceConfig &config)
Definition: IDEDeviceFactory.cc:11
openmsx::OSDGUI
Definition: OSDGUI.hh:13
openmsx::OSDGUI::isOpenGL
bool isOpenGL() const
Definition: OSDGUI.hh:24
openmsx::FileOperations::exists
bool exists(string_view filename)
Definition: FileOperations.cc:675
openmsx::OSDGUI::getTopWidget
const OSDTopWidget & getTopWidget() const
Definition: OSDGUI.hh:19
openmsx::OSDTopWidget
Definition: OSDTopWidget.hh:13
openmsx::Display
Represents the output window/screen of openMSX.
Definition: Display.hh:31
Command.hh
openmsx::OSDGUI::setOpenGL
void setOpenGL(bool openGL_)
Definition: OSDGUI.hh:23
openmsx::Command
Definition: Command.hh:40
openmsx::TclObject
Definition: TclObject.hh:21
openmsx::OSDGUI::OSDGUI
OSDGUI(CommandController &commandController, Display &display)
Definition: OSDGUI.cc:22
openmsx::OSDGUI::refresh
void refresh() const
Definition: OSDGUI.cc:29
openmsx::OSDGUI::getDisplay
Display & getDisplay() const
Definition: OSDGUI.hh:18
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5