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
Represents the output window/screen of openMSX.
Definition: Display.hh:33
const OSDTopWidget & getTopWidget() const
Definition: OSDGUI.hh:19
OSDGUI(CommandController &commandController, Display &display)
Definition: OSDGUI.cc:23
void setOpenGL(bool openGL_)
Definition: OSDGUI.hh:23
OSDTopWidget & getTopWidget()
Definition: OSDGUI.hh:20
bool isOpenGL() const
Definition: OSDGUI.hh:24
Display & getDisplay() const
Definition: OSDGUI.hh:18
void refresh() const
Definition: OSDGUI.cc:30
Definition: span.hh:126
bool exists(zstring_view filename)
Does this file (directory) exists?
std::unique_ptr< IDEDevice > create(const DeviceConfig &config)
This file implemented 3 utility functions:
Definition: Autofire.cc:9