Base class for the placement helper. More...
#include <placer.hpp>
Public Member Functions | |
virtual | ~placer_base () |
virtual void | initialize ()=0 |
Initialises the placer. More... | |
virtual void | add_item (const point &size)=0 |
Adds a item to be placed. More... | |
virtual point | get_size () const =0 |
Gets the required size of all items. More... | |
virtual point | get_origin (const unsigned index) const =0 |
Gets the origin for an item. More... | |
Static Public Member Functions | |
static placer_base * | build (const grow_direction::type grow_dir, const unsigned parallel_items) |
Builder function. More... | |
Base class for the placement helper.
The normal operation for the usage of the class is:
index
parameter is an increasing counter.Definition at line 51 of file placer.hpp.
|
virtual |
Definition at line 39 of file placer.cpp.
|
pure virtual |
Adds a item to be placed.
size | The required size for the item. |
Implemented in gui2::implementation::placer_vertical_list, and gui2::implementation::placer_horizontal_list.
|
static |
Builder function.
parallel_items
> 0grow_dir | The direction in which the items will be added. |
parallel_items | The direction perpendicular towards the grow direction has a fixed number of items. This value sets that limit. For a list containing only horizontally or vertically placed items the value should be 1. |
Definition at line 27 of file placer.cpp.
|
pure virtual |
Gets the origin for an item.
index | The index of the item whose origin to return. The index is the index of the call to add_item(). |
Implemented in gui2::implementation::placer_vertical_list, and gui2::implementation::placer_horizontal_list.
|
pure virtual |
Gets the required size of all items.
Implemented in gui2::implementation::placer_vertical_list, and gui2::implementation::placer_horizontal_list.
|
pure virtual |
Initialises the placer.
When the placement needs to be calculated the state often needs to be reset, items are placed, removed or changed visibility causing the old placement to be invalid.
Implemented in gui2::implementation::placer_vertical_list, and gui2::implementation::placer_horizontal_list.