Lysa  0.0
Lysa 3D Engine
Style Class Referenceabstract

Detailed Description

UI Widget drawing style base class

+ Inheritance diagram for Style:

Public Member Functions

 Style ()
 
 ~Style () override = default
 
virtual void addResource (Widget &widget, const std::string &resources) = 0
 
virtual void setOption (const std::string &name, const std::string &value)
 
std::string getOption (const std::string &name) const
 
virtual void draw (const Widget &widget, Resource &resources, UIRenderer &render, bool when) const = 0
 
virtual void resize (Widget &widget, Rect &rect, Resource &resources) = 0
 
std::shared_ptr< FontgetFont () const
 
- Public Member Functions inherited from Object
void connect (const Signal::signal &name, const Signal::Handler &handler)
 
void connect (const Signal::signal &name, const std::function< void ()> &handler)
 
void emit (const Signal::signal &name, void *params=nullptr)
 
virtual std::string toString () const
 
 Object () = default
 
virtual ~Object () = default
 

Static Public Member Functions

static std::shared_ptr< Style > create (const std::string &name="vector")
 

Protected Member Functions

virtual void init ()
 
virtual void updateOptions () = 0
 

Protected Attributes

std::shared_ptr< Fontfont
 

Constructor & Destructor Documentation

Style ( )
~Style ( )
overridedefault

Member Function Documentation

virtual void addResource ( Widget widget,
const std::string &  resources 
)
pure virtual

Create a resource from a resources description string.

Parameters
widget: widget to ass resources string to
resources: string that describe the resources of a widget

Implemented in lysa::ui::StyleClassic::addResource()

static std::shared_ptr<Style> create ( const std::string &  name = "vector")
static

Creates a new UI drawing style renderer.

Parameters
name: style name
virtual void draw ( const Widget widget,
Resource resources,
UIRenderer render,
bool  when 
) const
pure virtual
std::shared_ptr<Font> getFont ( ) const
inline

Returns the default font for the style.

std::string getOption ( const std::string &  name) const

Returns a style-specific option value

virtual void init ( )
inlineprotectedvirtual
virtual void resize ( Widget widget,
Rect rect,
Resource resources 
)
pure virtual

Adjusts a widget size to style specific constraints

Implemented in lysa::ui::StyleClassic::resize()

virtual void setOption ( const std::string &  name,
const std::string &  value 
)
virtual

Sets a style-specific option

virtual void updateOptions ( )
protectedpure virtual

Member Data Documentation

std::shared_ptr<Font> font
protected