openMSX
Classes | Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
openmsx::OSDWidget Class Referenceabstract

#include <OSDWidget.hh>

Inheritance diagram for openmsx::OSDWidget:
Inheritance graph
[legend]

Classes

struct  BoundingBox
 

Public Member Functions

virtual ~OSDWidget ()=default
 
std::string_view getName () const
 
virtual gl::vec2 getPos () const
 
gl::vec2 getRelPos () const
 
float getZ () const
 
OSDWidgetgetParent ()
 
const OSDWidgetgetParent () const
 
const SubWidgets & getChildren () const
 
void addWidget (std::unique_ptr< OSDWidget > widget)
 
void deleteWidget (OSDWidget &widget)
 
virtual std::span< const std::string_view > getProperties () const
 
virtual void setProperty (Interpreter &interp, std::string_view name, const TclObject &value)
 
virtual void getProperty (std::string_view name, TclObject &result) const
 
virtual float getRecursiveFadeValue () const
 
virtual bool isRecursiveFading () const =0
 
virtual std::string_view getType () const =0
 
void invalidateRecursive ()
 
void paintRecursive (OutputSurface &output)
 
int getScaleFactor (const OutputSurface &output) const
 
gl::vec2 transformPos (const OutputSurface &output, gl::vec2 pos, gl::vec2 relPos) const
 
BoundingBox getBoundingBox (const OutputSurface &output) const
 
virtual gl::vec2 getSize (const OutputSurface &output) const =0
 
virtual bool isVisible () const =0
 
DisplaygetDisplay () const
 

Protected Member Functions

 OSDWidget (Display &display, TclObject name)
 
void invalidateChildren () const
 
bool needSuppressErrors () const
 
virtual void invalidateLocal ()=0
 
virtual void paint (OutputSurface &output)=0
 

Static Protected Attributes

static constexpr auto widgetProperties
 

Detailed Description

Definition at line 20 of file OSDWidget.hh.

Constructor & Destructor Documentation

◆ ~OSDWidget()

virtual openmsx::OSDWidget::~OSDWidget ( )
virtualdefault

◆ OSDWidget()

openmsx::OSDWidget::OSDWidget ( Display display,
TclObject  name 
)
protected

Definition at line 98 of file OSDWidget.cc.

Member Function Documentation

◆ addWidget()

void openmsx::OSDWidget::addWidget ( std::unique_ptr< OSDWidget widget)

Definition at line 104 of file OSDWidget.cc.

References begin().

◆ deleteWidget()

void openmsx::OSDWidget::deleteWidget ( OSDWidget widget)

Definition at line 127 of file OSDWidget.cc.

References rfind_unguarded().

◆ getBoundingBox()

OSDWidget::BoundingBox openmsx::OSDWidget::getBoundingBox ( const OutputSurface output) const

Definition at line 357 of file OSDWidget.cc.

References transformPos().

Referenced by openmsx::OSDImageBasedWidget::getRenderedSize(), and paintRecursive().

◆ getChildren()

const SubWidgets & openmsx::OSDWidget::getChildren ( ) const
inline

Definition at line 43 of file OSDWidget.hh.

◆ getDisplay()

Display & openmsx::OSDWidget::getDisplay ( ) const
inline

◆ getName()

std::string_view openmsx::OSDWidget::getName ( ) const
inline

◆ getParent() [1/2]

OSDWidget * openmsx::OSDWidget::getParent ( )
inline

◆ getParent() [2/2]

const OSDWidget * openmsx::OSDWidget::getParent ( ) const
inline

Definition at line 42 of file OSDWidget.hh.

◆ getPos()

virtual gl::vec2 openmsx::OSDWidget::getPos ( ) const
inlinevirtual

Reimplemented in openmsx::OSDImageBasedWidget.

Definition at line 37 of file OSDWidget.hh.

Referenced by openmsx::OSDImageBasedWidget::getPos(), and transformPos().

◆ getProperties()

virtual std::span< const std::string_view > openmsx::OSDWidget::getProperties ( ) const
inlinevirtual

Reimplemented in openmsx::OSDImageBasedWidget, openmsx::OSDRectangle, and openmsx::OSDText.

Definition at line 47 of file OSDWidget.hh.

References widgetProperties.

◆ getProperty()

void openmsx::OSDWidget::getProperty ( std::string_view  name,
TclObject result 
) const
virtual

◆ getRecursiveFadeValue()

float openmsx::OSDWidget::getRecursiveFadeValue ( ) const
virtual

Reimplemented in openmsx::OSDImageBasedWidget.

Definition at line 242 of file OSDWidget.cc.

Referenced by openmsx::OSDImageBasedWidget::getRecursiveFadeValue().

◆ getRelPos()

gl::vec2 openmsx::OSDWidget::getRelPos ( ) const
inline

Definition at line 38 of file OSDWidget.hh.

Referenced by transformPos().

◆ getScaleFactor()

int openmsx::OSDWidget::getScaleFactor ( const OutputSurface output) const

◆ getSize()

virtual gl::vec2 openmsx::OSDWidget::getSize ( const OutputSurface output) const
pure virtual

Implemented in openmsx::OSDTopWidget.

Referenced by transformPos().

◆ getType()

virtual std::string_view openmsx::OSDWidget::getType ( ) const
pure virtual

◆ getZ()

float openmsx::OSDWidget::getZ ( ) const
inline

Definition at line 39 of file OSDWidget.hh.

◆ invalidateChildren()

void openmsx::OSDWidget::invalidateChildren ( ) const
protected

Definition at line 253 of file OSDWidget.cc.

Referenced by invalidateRecursive(), and openmsx::OSDText::setProperty().

◆ invalidateLocal()

virtual void openmsx::OSDWidget::invalidateLocal ( )
protectedpure virtual

◆ invalidateRecursive()

void openmsx::OSDWidget::invalidateRecursive ( )

◆ isRecursiveFading()

virtual bool openmsx::OSDWidget::isRecursiveFading ( ) const
pure virtual

◆ isVisible()

virtual bool openmsx::OSDWidget::isVisible ( ) const
pure virtual

◆ needSuppressErrors()

bool openmsx::OSDWidget::needSuppressErrors ( ) const
protected

Definition at line 260 of file OSDWidget.cc.

References getParent().

Referenced by openmsx::OSDImageBasedWidget::setError().

◆ paint()

virtual void openmsx::OSDWidget::paint ( OutputSurface output)
protectedpure virtual

◆ paintRecursive()

void openmsx::OSDWidget::paintRecursive ( OutputSurface output)

Definition at line 269 of file OSDWidget.cc.

References getBoundingBox(), and paint().

Referenced by openmsx::OSDGUILayer::paint().

◆ setProperty()

void openmsx::OSDWidget::setProperty ( Interpreter interp,
std::string_view  name,
const TclObject value 
)
virtual

◆ transformPos()

vec2 openmsx::OSDWidget::transformPos ( const OutputSurface output,
gl::vec2  pos,
gl::vec2  relPos 
) const

Definition at line 295 of file OSDWidget.cc.

References getParent(), getPos(), getRelPos(), getScaleFactor(), and getSize().

Referenced by getBoundingBox().

Member Data Documentation

◆ widgetProperties

constexpr auto openmsx::OSDWidget::widgetProperties
staticconstexprprotected
Initial value:
= [] {
using namespace std::literals;
return std::array{
"-type"sv, "-x"sv, "-y"sv, "-z"sv, "-relx"sv, "-rely"sv, "-scaled"sv,
"-clip"sv, "-mousecoord"sv, "-suppressErrors"sv,
};
}()

Definition at line 25 of file OSDWidget.hh.

Referenced by getProperties().


The documentation for this class was generated from the following files: