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  [[nodiscard]] Display& getDisplay() const { return display; }
19  [[nodiscard]] const OSDTopWidget& getTopWidget() const { return topWidget; }
20  [[nodiscard]] OSDTopWidget& getTopWidget() { return topWidget; }
21  void refresh() const;
22 
23  void setOpenGL(bool openGL_) { openGL = openGL_; }
24  [[nodiscard]] 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  [[nodiscard]] 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  [[nodiscard]] 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  [[nodiscard]] 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:18
openmsx::OSDGUI::getTopWidget
OSDTopWidget & getTopWidget()
Definition: OSDGUI.hh:20
OSDTopWidget.hh
openmsx::OSDWidget
Definition: OSDWidget.hh:17
span
Definition: span.hh:126
openmsx::IDEDeviceFactory::create
std::unique_ptr< IDEDevice > create(const DeviceConfig &config)
Definition: IDEDeviceFactory.cc:11
openmsx::OSDGUI
Definition: OSDGUI.hh:14
openmsx::OSDGUI::isOpenGL
bool isOpenGL() const
Definition: OSDGUI.hh:24
openmsx::OSDGUI::getTopWidget
const OSDTopWidget & getTopWidget() const
Definition: OSDGUI.hh:19
openmsx::OSDTopWidget
Definition: OSDTopWidget.hh:14
openmsx::Display
Represents the output window/screen of openMSX.
Definition: Display.hh:33
Command.hh
openmsx::OSDGUI::setOpenGL
void setOpenGL(bool openGL_)
Definition: OSDGUI.hh:23
openmsx::Command
Definition: Command.hh:41
openmsx::TclObject
Definition: TclObject.hh:22
openmsx::OSDGUI::OSDGUI
OSDGUI(CommandController &commandController, Display &display)
Definition: OSDGUI.cc:23
openmsx::FileOperations::exists
bool exists(const std::string &filename)
Does this file (directory) exists?
Definition: FileOperations.cc:665
openmsx::OSDGUI::refresh
void refresh() const
Definition: OSDGUI.cc:30
openmsx::OSDGUI::getDisplay
Display & getDisplay() const
Definition: OSDGUI.hh:18
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5