openMSX
OSDTopWidget.hh
Go to the documentation of this file.
1 #ifndef OSDTOPWIDGET_HH
2 #define OSDTOPWIDGET_HH
3 
4 #include "OSDWidget.hh"
5 #include "TclObject.hh"
6 #include "hash_set.hh"
7 #include "xxhash.hh"
8 #include <vector>
9 #include <string>
10 
11 namespace openmsx {
12 
13 class OSDTopWidget final : public OSDWidget
14 {
15 public:
16  explicit OSDTopWidget(Display& display);
17  [[nodiscard]] std::string_view getType() const override;
18  [[nodiscard]] gl::vec2 getSize(const OutputSurface& output) const override;
19  [[nodiscard]] bool isVisible() const override;
20  [[nodiscard]] bool isRecursiveFading() const override;
21 
22  void queueError(std::string message);
23  void showAllErrors();
24 
25  [[nodiscard]] OSDWidget* findByName(std::string_view name);
26  [[nodiscard]] const OSDWidget* findByName(std::string_view name) const;
27  void addName(OSDWidget& widget);
28  void removeName(OSDWidget& widget);
29  [[nodiscard]] std::vector<std::string_view> getAllWidgetNames() const;
30 
31 protected:
32  void invalidateLocal() override;
33  void paintSDL(OutputSurface& output) override;
34  void paintGL (OutputSurface& output) override;
35 
36 private:
37  std::vector<std::string> errors;
38 
39  struct NameFromWidget {
40  [[nodiscard]] std::string_view operator()(const OSDWidget* w) const {
41  return w->getName();
42  }
43  };
45 };
46 
47 } // namespace openmsx
48 
49 #endif
Represents the output window/screen of openMSX.
Definition: Display.hh:33
std::string_view getType() const override
Definition: OSDTopWidget.cc:15
OSDWidget * findByName(std::string_view name)
Definition: OSDTopWidget.cc:64
std::vector< std::string_view > getAllWidgetNames() const
Definition: OSDTopWidget.cc:91
bool isRecursiveFading() const override
Definition: OSDTopWidget.cc:30
void addName(OSDWidget &widget)
Definition: OSDTopWidget.cc:75
void queueError(std::string message)
Definition: OSDTopWidget.cc:50
gl::vec2 getSize(const OutputSurface &output) const override
Definition: OSDTopWidget.cc:20
void removeName(OSDWidget &widget)
Definition: OSDTopWidget.cc:81
void paintGL(OutputSurface &output) override
Definition: OSDTopWidget.cc:45
bool isVisible() const override
Definition: OSDTopWidget.cc:25
void invalidateLocal() override
Definition: OSDTopWidget.cc:35
OSDTopWidget(Display &display)
Definition: OSDTopWidget.cc:9
void paintSDL(OutputSurface &output) override
Definition: OSDTopWidget.cc:40
std::string_view getName() const
Definition: OSDWidget.hh:22
A frame buffer where pixels can be written to.
This file implemented 3 utility functions:
Definition: Autofire.cc:9