![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Abstraction for city bars of various styles. More...
#include <citybar.h>
Inheritance diagram for citybar_painter:
Collaboration diagram for citybar_painter:Public Member Functions | |
| virtual | ~citybar_painter ()=default |
| virtual QRect | paint (QPainter &painter, const QPointF &position, const city *pcity) const =0 |
Draws a city bar under the given position. More... | |
| virtual bool | has_flag () const |
| Returns whether the flag is shown in the bar. More... | |
| virtual bool | has_units () const |
| Returns whether the units inside are shown in the bar. More... | |
| virtual bool | has_size () const |
| Returns whether the city size is shown in the bar. More... | |
Static Public Member Functions | |
| static QStringList | available () |
| Returns the list of all available city bar styles. More... | |
| static const QVector< QString > * | available_vector (const option *) |
| Returns the list of all available city bar styles. More... | |
| static void | option_changed (option *opt) |
| Called by the option code when the option has changed. More... | |
| static citybar_painter * | current () |
| Returns the current painter (never null). More... | |
Static Private Member Functions | |
| static void | set_current (const QString &name) |
| Sets the current city bar style. More... | |
Static Private Attributes | |
| static std::unique_ptr< citybar_painter > | s_current = nullptr |
| Pointer to the city bar painter currently in use. More... | |
|
virtualdefault |
|
static |
Returns the list of all available city bar styles.
The strings are not translated.
Definition at line 261 of file citybar.cpp.
Referenced by available_vector(), and set_current().
Returns the list of all available city bar styles.
For compatibility with the option code.
Definition at line 271 of file citybar.cpp.
Referenced by init_client_options(), and mr_menu::setup_menus().
|
static |
Returns the current painter (never null).
Definition at line 295 of file citybar.cpp.
Referenced by freeciv::layer_city::fill_sprite_array(), freeciv::layer_city_size::fill_sprite_array(), polished_citybar_painter::paint(), and show_city_desc().
|
inlinevirtual |
Returns whether the flag is shown in the bar.
Reimplemented in simple_citybar_painter.
|
inlinevirtual |
Returns whether the city size is shown in the bar.
Reimplemented in simple_citybar_painter.
Definition at line 56 of file citybar.h.
Referenced by freeciv::layer_city_size::fill_sprite_array().
|
inlinevirtual |
Returns whether the units inside are shown in the bar.
Reimplemented in simple_citybar_painter.
|
static |
Called by the option code when the option has changed.
Sets the current painter and refreshes the map.
Definition at line 286 of file citybar.cpp.
Referenced by init_client_options(), and mr_menu::slot_set_citybar().
|
pure virtual |
Draws a city bar under the given position.
Returns the bounding box of the touched area.
Implemented in polished_citybar_painter, traditional_citybar_painter, and simple_citybar_painter.
|
staticprivate |
Sets the current city bar style.
The name should not be translated. Returns true on success.
Definition at line 307 of file citybar.cpp.
Referenced by current(), and option_changed().
|
staticprivate |
Pointer to the city bar painter currently in use.
Definition at line 66 of file citybar.h.
Referenced by current(), and set_current().