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 "view.hh"
8#include <vector>
9#include <string>
10
11namespace openmsx {
12
13class OSDTopWidget final : public OSDWidget
14{
15public:
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]] auto getAllWidgetNames() const {
30 return view::transform(widgetsByName,
31 [](auto* p) -> std::string_view { return p->getName(); });
32 }
33
34
35protected:
36 void invalidateLocal() override;
37 void paint(OutputSurface& output) override;
38
39private:
40 std::vector<std::string> errors;
41
42 struct NameFromWidget {
43 [[nodiscard]] std::string_view operator()(const OSDWidget* w) const {
44 return w->getName();
45 }
46 };
48};
49
50} // namespace openmsx
51
52#endif
Represents the output window/screen of openMSX.
Definition Display.hh:31
std::string_view getType() const override
OSDWidget * findByName(std::string_view name)
bool isRecursiveFading() const override
void addName(OSDWidget &widget)
void queueError(std::string message)
gl::vec2 getSize(const OutputSurface &output) const override
void paint(OutputSurface &output) override
void removeName(OSDWidget &widget)
bool isVisible() const override
void invalidateLocal() override
auto getAllWidgetNames() const
std::string_view getName() const
Definition OSDWidget.hh:36
A frame buffer where pixels can be written to.
This file implemented 3 utility functions:
Definition Autofire.cc:11
constexpr auto transform(Range &&range, UnaryOp op)
Definition view.hh:520