The Battle for Wesnoth  1.15.12+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 (surface &canvas, SDL_Renderer *renderer, const SDL_Rect &view_bounds, 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 50 of file canvas.hpp.

Constructor & Destructor Documentation

◆ shape()

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

Definition at line 53 of file canvas.hpp.

◆ ~shape()

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

Definition at line 57 of file canvas.hpp.

Member Function Documentation

◆ draw()

virtual void gui2::canvas::shape::draw ( surface canvas,
SDL_Renderer *  renderer,
const SDL_Rect &  view_bounds,
wfl::map_formula_callable variables 
pure virtual

Draws the canvas.

canvasThe resulting image will be blitted upon this canvas.
rendererThe SDL_Renderer to use.
view_boundsPart of the shape to render - this is the location of canvas within the coordinates of the shape.
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

Definition at line 77 of file canvas.hpp.

Member Data Documentation

◆ immutable_

bool gui2::canvas::shape::immutable_

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

Definition at line 87 of file canvas.hpp.

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