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  string_view getType() const override;
18  gl::vec2 getSize(const OutputSurface& output) const override;
19 
20  void queueError(std::string message);
21  void showAllErrors();
22 
24  const OSDWidget* findByName(string_view name) const;
25  void addName(OSDWidget& widget);
26  void removeName(OSDWidget& widget);
27  std::vector<string_view> getAllWidgetNames() const;
28 
29 protected:
30  void invalidateLocal() override;
31  void paintSDL(OutputSurface& output) override;
32  void paintGL (OutputSurface& output) override;
33 
34 private:
35  std::vector<std::string> errors;
36 
37  struct NameFromWidget {
38  string_view operator()(const OSDWidget* w) const {
39  return w->getName();
40  }
41  };
43 };
44 
45 } // namespace openmsx
46 
47 #endif
OSDWidget * findByName(string_view name)
Definition: OSDTopWidget.cc:54
Represents the output window/screen of openMSX.
Definition: Display.hh:31
void removeName(OSDWidget &widget)
Definition: OSDTopWidget.cc:71
std::vector< string_view > getAllWidgetNames() const
Definition: OSDTopWidget.cc:81
void queueError(std::string message)
Definition: OSDTopWidget.cc:40
A frame buffer where pixels can be written to.
gl::vec2 getSize(const OutputSurface &output) const override
Definition: OSDTopWidget.cc:20
string_view getType() const override
Definition: OSDTopWidget.cc:15
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
void paintGL(OutputSurface &output) override
Definition: OSDTopWidget.cc:35
string_view getName() const
Definition: OSDWidget.hh:22
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
void addName(OSDWidget &widget)
Definition: OSDTopWidget.cc:65
void paintSDL(OutputSurface &output) override
Definition: OSDTopWidget.cc:30
void invalidateLocal() override
Definition: OSDTopWidget.cc:25
OSDTopWidget(Display &display)
Definition: OSDTopWidget.cc:9