The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
theme Class Reference

#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 menucontext_menu () const
 
objectrefresh_title (const std::string &id, const std::string &new_title)
 
objectrefresh_title2 (const std::string &id, const std::string &title_tag)
 
void modify_label (const std::string &id, const std::string &text)
 
const status_itemget_status_item (const std::string &item) const
 
const menuget_menu_item (const std::string &key) const
 
const actionget_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 tborderborder () const
 
events::generic_eventtheme_reset_event ()
 

Static Public Member Functions

static void set_known_themes (const config *cfg)
 
static std::vector< theme_infoget_known_themes ()
 

Private Member Functions

theme::objectfind_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< panelpanels_
 
std::vector< labellabels_
 
std::vector< menumenus_
 
std::vector< actionactions_
 
std::vector< slidersliders_
 
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
 

Detailed Description

Definition at line 37 of file theme.hpp.

Constructor & Destructor Documentation

theme::theme ( const config cfg,
const SDL_Rect &  screen 
)
explicit

Definition at line 613 of file theme.cpp.

References cfg_, do_resolve_rects(), expand_partialresolution(), and set_resolution().

Member Function Documentation

const std::vector<action>& theme::actions ( ) const
inline
void theme::add_object ( const config cfg)
private
const tborder& theme::border ( ) const
inline
const menu* theme::context_menu ( ) const
inline

Definition at line 267 of file theme.hpp.

References context_, and theme::menu::is_context().

Referenced by events::mouse_handler_base::right_click().

theme::object & theme::find_element ( std::string  id)
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().

std::vector< theme_info > theme::get_known_themes ( )
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
const theme::status_item * theme::get_status_item ( const std::string item) const

Definition at line 900 of file theme.cpp.

References i, and status_.

Referenced by display::refresh_report().

const std::vector<label>& theme::labels ( ) const
inline

Definition at line 262 of file theme.hpp.

References labels_.

Referenced by display::draw_all_panels().

const SDL_Rect& theme::main_map_location ( const SDL_Rect &  screen) const
inline

Definition at line 280 of file theme.hpp.

References theme::object::location(), and main_map_.

Referenced by display::map_outside_area().

const std::vector<menu>& theme::menus ( ) const
inline
const SDL_Rect& theme::mini_map_location ( const SDL_Rect &  screen) const
inline

Definition at line 282 of file theme.hpp.

References theme::object::location(), and mini_map_.

Referenced by display::minimap_area().

void theme::modify ( const config cfg)
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().

const SDL_Rect& theme::palette_location ( const SDL_Rect &  screen) const
inline

Definition at line 286 of file theme.hpp.

References theme::object::location(), and palette_.

Referenced by display::palette_area().

const std::vector<panel>& theme::panels ( ) const
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().

void theme::remove_object ( std::string  id)
private

Definition at line 786 of file theme.cpp.

References actions_, labels_, menus_, panels_, and sliders_.

Referenced by modify().

void theme::set_known_themes ( const config cfg)
static

Definition at line 912 of file theme.cpp.

References config::child_range(), and known_themes.

Referenced by game_config_manager::load_game_config().

void theme::set_object_location ( theme::object element,
std::string  rect_str,
std::string  ref_id 
)
private
bool theme::set_resolution ( const SDL_Rect &  screen)
const std::vector<slider>& theme::sliders ( ) const
inline

Definition at line 264 of file theme.hpp.

References sliders_.

Referenced by display::create_buttons(), and display::layout_buttons().

events::generic_event& theme::theme_reset_event ( )
inline
const SDL_Rect& theme::unit_image_location ( const SDL_Rect &  screen) const
inline

Definition at line 284 of file theme.hpp.

References theme::object::location(), and unit_image_.

Referenced by display::unit_image_area().

Member Data Documentation

action theme::action_context_
private

Definition at line 316 of file theme.hpp.

Referenced by add_object().

std::vector<action> theme::actions_
private
tborder theme::border_
private

Definition at line 322 of file theme.hpp.

Referenced by add_object(), and border().

config theme::cfg_
private

Definition at line 308 of file theme.hpp.

Referenced by refresh_title2(), set_resolution(), and theme().

menu theme::context_
private

Definition at line 315 of file theme.hpp.

Referenced by add_object(), and context_menu().

std::string theme::cur_theme
private

Definition at line 307 of file theme.hpp.

known_themes_map theme::known_themes
staticprivate

Definition at line 306 of file theme.hpp.

Referenced by get_known_themes(), and set_known_themes().

std::vector<label> theme::labels_
private

Definition at line 310 of file theme.hpp.

Referenced by add_object(), find_element(), labels(), remove_object(), and set_resolution().

object theme::main_map_
private

Definition at line 320 of file theme.hpp.

Referenced by add_object(), find_element(), and main_map_location().

std::vector<menu> theme::menus_
private
object theme::mini_map_
private

Definition at line 320 of file theme.hpp.

Referenced by add_object(), find_element(), and mini_map_location().

object theme::palette_
private

Definition at line 320 of file theme.hpp.

Referenced by add_object(), find_element(), and palette_location().

std::vector<panel> theme::panels_
private

Definition at line 309 of file theme.hpp.

Referenced by add_object(), find_element(), panels(), remove_object(), and set_resolution().

std::vector<slider> theme::sliders_
private

Definition at line 313 of file theme.hpp.

Referenced by add_object(), remove_object(), set_resolution(), and sliders().

std::map<std::string,status_item> theme::status_
private

Definition at line 318 of file theme.hpp.

Referenced by add_object(), get_status_item(), and set_resolution().

events::generic_event theme::theme_reset_event_
private

Definition at line 304 of file theme.hpp.

Referenced by set_resolution(), and theme_reset_event().

object theme::unit_image_
private

Definition at line 320 of file theme.hpp.

Referenced by add_object(), find_element(), and unit_image_location().


The documentation for this class was generated from the following files: