openMSX
OSDRectangle.hh
Go to the documentation of this file.
1 #ifndef OSDRECTANGLE_HH
2 #define OSDRECTANGLE_HH
3 
4 #include "OSDImageBasedWidget.hh"
5 #include <memory>
6 
7 namespace openmsx {
8 
9 class BaseImage;
10 
11 class OSDRectangle final : public OSDImageBasedWidget
12 {
13 public:
14  OSDRectangle(Display& display, const TclObject& name);
15 
16  [[nodiscard]] std::vector<std::string_view> getProperties() const override;
17  void setProperty(Interpreter& interp,
18  std::string_view name, const TclObject& value) override;
19  void getProperty(std::string_view name, TclObject& result) const override;
20  [[nodiscard]] std::string_view getType() const override;
21 
22 private:
23  [[nodiscard]] bool takeImageDimensions() const;
24 
25  [[nodiscard]] gl::vec2 getSize(const OutputSurface& output) const override;
26  [[nodiscard]] uint8_t getFadedAlpha() const override;
27  [[nodiscard]] std::unique_ptr<BaseImage> createSDL(OutputSurface& output) override;
28  [[nodiscard]] std::unique_ptr<BaseImage> createGL (OutputSurface& output) override;
29  template<typename IMAGE> [[nodiscard]] std::unique_ptr<BaseImage> create(
30  OutputSurface& output);
31 
32 private:
33  std::string imageName;
34  gl::vec2 size, relSize;
35  float scale, borderSize, relBorderSize;
36  unsigned borderRGBA;
37 };
38 
39 } // namespace openmsx
40 
41 #endif
openmsx::OSDRectangle::getProperty
void getProperty(std::string_view name, TclObject &result) const override
Definition: OSDRectangle.cc:108
openmsx::OSDRectangle::setProperty
void setProperty(Interpreter &interp, std::string_view name, const TclObject &value) override
Definition: OSDRectangle.cc:40
openmsx::OSDRectangle::OSDRectangle
OSDRectangle(Display &display, const TclObject &name)
Definition: OSDRectangle.cc:22
openmsx::OSDImageBasedWidget
Definition: OSDImageBasedWidget.hh:14
openmsx::OSDRectangle::getProperties
std::vector< std::string_view > getProperties() const override
Definition: OSDRectangle.cc:29
gl::vecN
Definition: gl_vec.hh:31
openmsx::Display
Represents the output window/screen of openMSX.
Definition: Display.hh:33
OSDImageBasedWidget.hh
openmsx::OutputSurface
A frame buffer where pixels can be written to.
Definition: OutputSurface.hh:20
openmsx::TclObject
Definition: TclObject.hh:24
openmsx::Interpreter
Definition: Interpreter.hh:19
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::OSDRectangle
Definition: OSDRectangle.hh:12
openmsx::OSDRectangle::getType
std::string_view getType() const override
Definition: OSDRectangle.cc:133