16 #define GETTEXT_DOMAIN "wesnoth-lib"
32 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__
33 #define LOG_HEADER LOG_SCOPE_HEADER + ':'
51 if(image_size.x == 0 || image_size.y == 0) {
59 point result {image_size.x, image_size.y};
61 if(minimum.x > 0 && result.x < minimum.x) {
64 }
else if(maximum.x > 0 && result.x > maximum.x) {
69 if(minimum.y > 0 && result.y < minimum.y) {
72 }
else if(maximum.y > 0 && result.y > maximum.y) {
108 load_resolutions<resolution>(cfg);
129 auto widget = std::make_unique<image>(*
this);
131 DBG_GUI_G <<
"Window builder: placed image '" <<
id <<
"' with definition '"
A config object defines a single node in a WML file, with access to child nodes.
virtual void set_active(const bool active) override
See styled_widget::set_active.
virtual bool get_active() const override
See styled_widget::get_active.
virtual point calculate_best_size() const override
See widget::calculate_best_size.
bool disable_click_dismiss() const override
See widget::disable_click_dismiss.
virtual unsigned get_state() const override
See styled_widget::get_state.
Generic locator abstracting the location of an image.
static std::string _(const char *str)
Define the common log macros for the gui toolkit.
Functions to load and save images from/to disk.
point get_size(const locator &i_locator, bool skip_cache)
Returns the width and height of an image.
Contains the implementation details for lexical_cast and shouldn't be used directly.
This file contains the settings handling of the widget library.
resolution(const config &cfg)
image_definition(const config &cfg)
virtual std::unique_ptr< widget > build() const override
Base class of a resolution, contains the common keys for a resolution.
std::vector< state_definition > state
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...
#define VALIDATE_WML_CHILD(cfg, key, message)