16 #define GETTEXT_DOMAIN "wesnoth-lib"
32 : maximum_columns_(maximum_columns)
33 , rows_(1, std::pair(0, 0))
34 , columns_(maximum_columns, 0)
44 rows_.emplace_back(0, 0);
65 const int origin =
rows_.back().first +
rows_.back().second;
66 rows_.emplace_back(origin, 0);
73 const int height =
rows_.back().first +
rows_.back().second;
74 return point(width, height);
82 const int width = column == 0 ? 0
std::vector< std::pair< int, int > > rows_
Holds the row sizes.
std::vector< int > columns_
Holds the widths of the columns.
unsigned row_
The row to add an item to.
virtual void add_item(const point &size)
Adds a item to be placed.
virtual point get_origin(const unsigned index) const
Gets the origin for an item.
virtual void initialize()
Initialises the placer.
unsigned column_
The column to add an item to.
unsigned maximum_columns_
The maximum number of columns to use.
virtual point get_size() const
Gets the required size of all items.
placer_vertical_list(const unsigned maximum_columns)
void fill(const SDL_Rect &rect, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Fill an area with the given colour.
void point(int x, int y)
Draw a single point.
Contains the implementation details for lexical_cast and shouldn't be used directly.
std::size_t size(std::string_view str)
Length in characters of a UTF-8 string.
std::size_t index(std::string_view str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
Placement helper for the vertical list.