27 #include <SDL2/SDL_rect.h> 50 virtual SDL_Rect& location(
const SDL_Rect& screen)
const;
52 const std::string&
get_id()
const {
return id_; }
56 void modify_location(
const _rect& rect);
57 void modify_location(std::string rect_str, SDL_Rect rect_ref);
79 static ANCHORING read_anchor(
const std::string& str);
102 explicit label(std::size_t
sw, std::size_t sh,
const config& cfg);
104 using object::location;
106 const std::string&
text()
const {
return text_; }
107 void set_text(
const std::string& text) { text_ = text; }
108 const std::string&
icon()
const {
return icon_; }
110 bool empty()
const {
return text_.empty() && icon_.empty(); }
128 using object::location;
130 const std::string&
prefix()
const {
return prefix_; }
131 const std::string&
postfix()
const {
return postfix_; }
151 explicit panel(std::size_t
sw, std::size_t sh,
const config& cfg);
153 using object::location;
155 const std::string&
image()
const {
return image_; }
165 explicit action(std::size_t
sw, std::size_t sh,
const config& cfg);
167 using object::location;
171 const std::string&
title()
const {
return title_; }
173 const std::string tooltip(std::size_t
index)
const;
175 const std::string&
type()
const {
return type_; }
177 const std::string&
image()
const {
return image_; }
179 const std::string&
overlay()
const {
return overlay_; }
181 const std::vector<std::string>&
items()
const {
return items_; }
183 void set_title(
const std::string& new_title) { title_ = new_title; }
186 std::string title_, tooltip_, image_, overlay_,
type_;
194 explicit slider(std::size_t
sw, std::size_t sh,
const config& cfg);
196 using object::location;
198 const std::string&
title()
const {
return title_; }
200 const std::string&
tooltip()
const {
return tooltip_; }
202 const std::string&
image()
const {
return image_; }
204 const std::string&
overlay()
const {
return overlay_; }
208 void set_title(
const std::string& new_title) { title_ = new_title; }
218 explicit menu(std::size_t
sw, std::size_t sh,
const config& cfg);
220 using object::location;
226 const std::string&
title()
const {
return title_; }
228 const std::string&
tooltip()
const {
return tooltip_; }
230 const std::string&
image()
const {
return image_; }
232 const std::string&
overlay()
const {
return overlay_; }
234 const std::vector<config>&
items()
const {
return items_; }
236 void set_title(
const std::string& new_title) { title_ = new_title; }
244 explicit theme(
const config& cfg,
const SDL_Rect& screen);
249 bool set_resolution(
const SDL_Rect& screen);
250 void modify(
const config &cfg);
252 const std::vector<panel>&
panels()
const {
return panels_; }
253 const std::vector<label>&
labels()
const {
return labels_; }
254 const std::vector<menu>&
menus()
const {
return menus_; }
255 const std::vector<slider>&
sliders()
const {
return sliders_; }
256 const std::vector<action>&
actions()
const {
return actions_; }
259 {
return context_.
is_context() ? &context_ :
nullptr; }
263 object* refresh_title(
const std::string&
id,
const std::string& new_title);
264 object* refresh_title2(
const std::string&
id,
const std::string& title_tag);
265 void modify_label(
const std::string&
id,
const std::string& text);
268 const menu *get_menu_item(
const std::string &key)
const;
269 const action* get_action_item(
const std::string &key)
const;
272 {
return main_map_.location(screen); }
274 {
return mini_map_.location(screen); }
276 {
return unit_image_.location(screen); }
278 {
return palette_.location(screen); }
281 static std::vector<theme_info> get_known_themes();
289 void add_object(std::size_t
sw, std::size_t sh,
const config& cfg);
290 void remove_object(
const std::string&
id);
291 void set_object_location(
theme::object& element, std::string rect_str, std::string ref_id);
309 std::map<std::string, std::unique_ptr<status_item>>
status_;
std::vector< label > labels_
std::size_t font_size() const
std::map< std::string, std::unique_ptr< status_item > > status_
events::generic_event theme_reset_event_
const std::string & icon() const
void set_title(const std::string &new_title)
const std::string & overlay() const
const SDL_Rect & get_location() const
std::vector< action > actions_
void set_title(const std::string &new_title)
const SDL_Rect & unit_image_location(const SDL_Rect &screen) const
std::vector< panel > panels_
const label * get_label() const
const std::string & tooltip() const
std::vector< slider > sliders_
const SDL_Rect & main_map_location(const SDL_Rect &screen) const
const std::vector< label > & labels() const
Definitions for the interface to Wesnoth Markup Language (WML).
static std::map< std::string, config > known_themes
const std::string & text() const
const std::string & prefix() const
std::vector< menu > menus_
bool font_rgb_set() const
const std::string & type() const
const std::string & image() const
std::string background_image
events::generic_event & theme_reset_event()
bool font_rgb_set() const
const std::vector< std::string > & items() const
const std::string & get_id() const
const std::string & title() const
const border_t & border() const
const std::string & postfix() const
SDL_Rect screen_dimensions_
const std::string & image() const
const std::vector< action > & actions() const
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.
static map_location::DIRECTION sw
const std::vector< slider > & sliders() const
std::size_t cur_spec_width_
const std::string & image() const
bool tooltip_name_prepend_
const SDL_Rect & mini_map_location(const SDL_Rect &screen) const
void set_text(const std::string &text)
const std::string & overlay() const
const SDL_Rect & palette_location(const SDL_Rect &screen) const
const std::string & title() const
std::vector< std::string > items_
const menu * context_menu() const
std::size_t font_size() const
const std::vector< menu > & menus() const
A config object defines a single node in a WML file, with access to child nodes.
const std::vector< panel > & panels() const
std::pair< std::string, unsigned > item