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
8namespace openmsx {
9
10class Display;
11class CommandController;
12
13class OSDGUI
14{
15public:
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
26private:
27 Display& display;
28
29 class OSDCommand final : public Command {
30 public:
31 explicit OSDCommand(CommandController& commandController);
32 void execute(std::span<const TclObject> tokens, TclObject& result) override;
33 [[nodiscard]] std::string help(std::span<const TclObject> tokens) const override;
34 void tabCompletion(std::vector<std::string>& tokens) const override;
35
36 private:
37 void create (std::span<const TclObject> tokens, TclObject& result);
38 void destroy (std::span<const TclObject> tokens, TclObject& result);
39 void info (std::span<const TclObject> tokens, TclObject& result);
40 void exists (std::span<const TclObject> tokens, TclObject& result);
41 void configure(std::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, std::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
OSDTopWidget & getTopWidget()
Definition: OSDGUI.hh:20
OSDGUI(CommandController &commandController, Display &display)
Definition: OSDGUI.cc:19
Display & getDisplay() const
Definition: OSDGUI.hh:18
void setOpenGL(bool openGL_)
Definition: OSDGUI.hh:23
bool isOpenGL() const
Definition: OSDGUI.hh:24
void refresh() const
Definition: OSDGUI.cc:26
const OSDTopWidget & getTopWidget() const
Definition: OSDGUI.hh:19
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