16 #define GETTEXT_DOMAIN "wesnoth-lib"
32 : maximum_rows_(maximum_rows)
33 , rows_(maximum_rows, 0)
34 , columns_(1, std::pair(0, 0))
73 const int height = std::accumulate(
rows_.begin(),
rows_.end(), 0);
74 return point(width, height);
84 : std::accumulate(
rows_.begin(),
rows_.begin() + row, 0);
virtual void initialize()
Initialises the placer.
std::vector< std::pair< int, int > > columns_
Holds the column sizes.
virtual point get_origin(const unsigned index) const
Gets the origin for an item.
std::vector< int > rows_
Holds the heights of the rows.
placer_horizontal_list(const unsigned maximum_rows)
virtual void add_item(const point &size)
Adds a item to be placed.
unsigned row_
The row to add an item to.
virtual point get_size() const
Gets the required size of all items.
unsigned column_
The column to add an item to.
unsigned maximum_rows_
The maximum number of rows to use.
Placement helper for the horizontal list.
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 index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.