#include <theme.hpp>
Classes | |
class | action |
class | label |
class | menu |
class | object |
class | panel |
class | slider |
class | status_item |
struct | tborder |
Public Member Functions | |
theme (const config &cfg, const SDL_Rect &screen) | |
bool | set_resolution (const SDL_Rect &screen) |
void | modify (const config &cfg) |
const std::vector< panel > & | panels () const |
const std::vector< label > & | labels () const |
const std::vector< menu > & | menus () const |
const std::vector< slider > & | sliders () const |
const std::vector< action > & | actions () const |
const menu * | context_menu () const |
object * | refresh_title (const std::string &id, const std::string &new_title) |
object * | refresh_title2 (const std::string &id, const std::string &title_tag) |
void | modify_label (const std::string &id, const std::string &text) |
const status_item * | get_status_item (const std::string &item) const |
const menu * | get_menu_item (const std::string &key) const |
const action * | get_action_item (const std::string &key) const |
const SDL_Rect & | main_map_location (const SDL_Rect &screen) const |
const SDL_Rect & | mini_map_location (const SDL_Rect &screen) const |
const SDL_Rect & | unit_image_location (const SDL_Rect &screen) const |
const SDL_Rect & | palette_location (const SDL_Rect &screen) const |
const tborder & | border () const |
events::generic_event & | theme_reset_event () |
Static Public Member Functions | |
static void | set_known_themes (const config *cfg) |
static std::vector< theme_info > | get_known_themes () |
Private Member Functions | |
theme::object & | find_element (std::string id) |
void | add_object (const config &cfg) |
void | remove_object (std::string id) |
void | set_object_location (theme::object &element, std::string rect_str, std::string ref_id) |
Private Attributes | |
events::generic_event | theme_reset_event_ |
std::string | cur_theme |
config | cfg_ |
std::vector< panel > | panels_ |
std::vector< label > | labels_ |
std::vector< menu > | menus_ |
std::vector< action > | actions_ |
std::vector< slider > | sliders_ |
menu | context_ |
action | action_context_ |
std::map< std::string, status_item > | status_ |
object | main_map_ |
object | mini_map_ |
object | unit_image_ |
object | palette_ |
tborder | border_ |
Static Private Attributes | |
static std::map< std::string, config > | known_themes |
|
explicit |
Definition at line 613 of file theme.cpp.
References cfg_, do_resolve_rects(), expand_partialresolution(), and set_resolution().
|
inline |
Definition at line 265 of file theme.hpp.
References actions_.
Referenced by display::action_pressed(), display::create_buttons(), display::layout_buttons(), and hotkey::command_executor_default::set_button_state().
Definition at line 703 of file theme.cpp.
References action_context_, actions_, border_, config::child(), config::child_range(), context_, DBG_DP, i, theme::action::is_context(), theme::menu::is_context(), labels_, main_map_, menus_, mini_map_, palette_, panels_, set_object_location(), sliders_, status_, and unit_image_.
Referenced by modify(), and set_resolution().
|
inline |
Definition at line 292 of file theme.hpp.
References border_.
Referenced by display::bounds_check_position(), display::draw_border(), display::draw_init(), display::draw_minimap(), display::get_location_x(), display::get_location_y(), display::get_terrain_images(), display::hexes_under_rect(), display::max_map_area(), and display::pixel_position_to_hex().
|
inline |
Definition at line 267 of file theme.hpp.
References context_, and theme::menu::is_context().
Referenced by events::mouse_handler_base::right_click().
|
private |
Definition at line 878 of file theme.cpp.
References actions_, labels_, main_map_, menus_, mini_map_, palette_, panels_, and unit_image_.
Referenced by modify(), modify_label(), and set_object_location().
const theme::action * theme::get_action_item | ( | const std::string & | key | ) | const |
Definition at line 953 of file theme.cpp.
References actions_.
Referenced by hotkey::command_executor::get_menu_images().
|
static |
Definition at line 928 of file theme.cpp.
References i, and known_themes.
Referenced by preferences::show_theme_dialog().
const theme::menu * theme::get_menu_item | ( | const std::string & | key | ) | const |
Definition at line 945 of file theme.cpp.
References menus_.
Referenced by hotkey::command_executor::get_menu_image(), hotkey::command_executor::get_menu_images(), display::menu_pressed(), and hotkey::command_executor::show_menu().
const theme::status_item * theme::get_status_item | ( | const std::string & | item | ) | const |
Definition at line 900 of file theme.cpp.
Referenced by display::refresh_report().
|
inline |
Definition at line 262 of file theme.hpp.
References labels_.
Referenced by display::draw_all_panels().
|
inline |
Definition at line 280 of file theme.hpp.
References theme::object::location(), and main_map_.
Referenced by display::map_outside_area().
|
inline |
Definition at line 263 of file theme.hpp.
References menus_.
Referenced by display::create_buttons(), display::enable_menu(), controller_base::handle_scroll(), editor::editor_toolkit::init_mouse_actions(), display::layout_buttons(), display::menu_pressed(), and hotkey::command_executor_default::set_button_state().
|
inline |
Definition at line 282 of file theme.hpp.
References theme::object::location(), and mini_map_.
Referenced by display::minimap_area().
Definition at line 833 of file theme.cpp.
References actions_, add_object(), config::child_range(), find_element(), theme::object::get_id(), menus_, remove_object(), and set_object_location().
Referenced by replay_controller::add_replay_theme(), and replay_controller::rebuild_replay_theme().
void theme::modify_label | ( | const std::string & | id, |
const std::string & | text | ||
) |
Definition at line 992 of file theme.cpp.
References find_element(), LOG_DP, and theme::label::set_text().
Referenced by replay_controller::rebuild_replay_theme().
|
inline |
Definition at line 286 of file theme.hpp.
References theme::object::location(), and palette_.
Referenced by display::palette_area().
|
inline |
Definition at line 261 of file theme.hpp.
References panels_.
Referenced by display::draw_all_panels().
theme::object * theme::refresh_title | ( | const std::string & | id, |
const std::string & | new_title | ||
) |
Definition at line 961 of file theme.cpp.
References actions_, and menus_.
Referenced by refresh_title2().
theme::object * theme::refresh_title2 | ( | const std::string & | id, |
const std::string & | title_tag | ||
) |
Definition at line 982 of file theme.cpp.
References cfg_, find_ref(), and refresh_title().
|
private |
Definition at line 912 of file theme.cpp.
References config::child_range(), and known_themes.
Referenced by game_config_manager::load_game_config().
|
private |
Definition at line 819 of file theme.cpp.
References find_element(), theme::object::get_id(), theme::object::get_location(), and theme::object::modify_location().
Referenced by add_object(), and modify().
bool theme::set_resolution | ( | const SDL_Rect & | screen | ) |
Definition at line 633 of file theme.cpp.
References actions_, add_object(), cfg_, config::child_count(), config::child_range(), ERR_DP, i, labels_, LOG_DP, menus_, events::generic_event::notify_observers(), panels_, sliders_, status_, and theme_reset_event_.
Referenced by display::redraw_everything(), and theme().
|
inline |
Definition at line 264 of file theme.hpp.
References sliders_.
Referenced by display::create_buttons(), and display::layout_buttons().
|
inline |
Definition at line 294 of file theme.hpp.
References theme_reset_event_.
Referenced by replay_controller::replay_controller(), and replay_controller::~replay_controller().
|
inline |
Definition at line 284 of file theme.hpp.
References theme::object::location(), and unit_image_.
Referenced by display::unit_image_area().
|
private |
Definition at line 316 of file theme.hpp.
Referenced by add_object().
|
private |
Definition at line 312 of file theme.hpp.
Referenced by actions(), add_object(), find_element(), get_action_item(), modify(), refresh_title(), remove_object(), and set_resolution().
|
private |
Definition at line 322 of file theme.hpp.
Referenced by add_object(), and border().
|
private |
Definition at line 308 of file theme.hpp.
Referenced by refresh_title2(), set_resolution(), and theme().
|
private |
Definition at line 315 of file theme.hpp.
Referenced by add_object(), and context_menu().
|
private |
|
staticprivate |
Definition at line 306 of file theme.hpp.
Referenced by get_known_themes(), and set_known_themes().
|
private |
Definition at line 310 of file theme.hpp.
Referenced by add_object(), find_element(), labels(), remove_object(), and set_resolution().
|
private |
Definition at line 320 of file theme.hpp.
Referenced by add_object(), find_element(), and main_map_location().
|
private |
Definition at line 311 of file theme.hpp.
Referenced by add_object(), find_element(), get_menu_item(), menus(), modify(), refresh_title(), remove_object(), and set_resolution().
|
private |
Definition at line 320 of file theme.hpp.
Referenced by add_object(), find_element(), and mini_map_location().
|
private |
Definition at line 320 of file theme.hpp.
Referenced by add_object(), find_element(), and palette_location().
|
private |
Definition at line 309 of file theme.hpp.
Referenced by add_object(), find_element(), panels(), remove_object(), and set_resolution().
|
private |
Definition at line 313 of file theme.hpp.
Referenced by add_object(), remove_object(), set_resolution(), and sliders().
|
private |
Definition at line 318 of file theme.hpp.
Referenced by add_object(), get_status_item(), and set_resolution().
|
private |
Definition at line 304 of file theme.hpp.
Referenced by set_resolution(), and theme_reset_event().
|
private |
Definition at line 320 of file theme.hpp.
Referenced by add_object(), find_element(), and unit_image_location().