The Battle for Wesnoth  1.19.5+dev
Public Member Functions | Private Attributes | List of all members
gui2::canvas::shape Class Referenceabstract

Abstract base class for all other shapes. More...

#include <canvas.hpp>

Inheritance diagram for gui2::canvas::shape:

Public Member Functions

 shape (const config &cfg)
 
virtual ~shape ()
 
virtual void draw (wfl::map_formula_callable &variables)=0
 Draws the canvas. More...
 
bool immutable () const
 

Private Attributes

bool immutable_
 If this is true, this shape will not be removed from the canvas even if the canvas's content is reset. More...
 

Detailed Description

Abstract base class for all other shapes.

The other shapes are declared and defined in canvas_private.hpp, since the implementation details are not interesting for users of the canvas.

Definition at line 53 of file canvas.hpp.

Constructor & Destructor Documentation

◆ shape()

gui2::canvas::shape::shape ( const config cfg)
inlineexplicit

Definition at line 56 of file canvas.hpp.

◆ ~shape()

virtual gui2::canvas::shape::~shape ( )
inlinevirtual

Definition at line 60 of file canvas.hpp.

Member Function Documentation

◆ draw()

virtual void gui2::canvas::shape::draw ( wfl::map_formula_callable variables)
pure virtual

Draws the canvas.

Parameters
variablesThe canvas can have formulas in it's definition, this parameter contains the values for these formulas.

Implemented in gui2::text_shape, gui2::image_shape, gui2::circle_shape, gui2::round_rectangle_shape, gui2::rectangle_shape, and gui2::line_shape.

Referenced by gui2::canvas::draw().

◆ immutable()

bool gui2::canvas::shape::immutable ( ) const
inline

Definition at line 73 of file canvas.hpp.

References immutable_.

Member Data Documentation

◆ immutable_

bool gui2::canvas::shape::immutable_
private

If this is true, this shape will not be removed from the canvas even if the canvas's content is reset.

Definition at line 83 of file canvas.hpp.

Referenced by immutable().


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