The Battle for Wesnoth  1.15.2+dev
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
 
struct  border_t
 
class  label
 
class  menu
 
class  object
 
class  panel
 
class  slider
 
class  status_item
 

Public Member Functions

 theme (const config &cfg, const SDL_Rect &screen)
 
 theme (const theme &)=delete
 
themeoperator= (const theme &)=delete
 
themeoperator= (theme &&)
 
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 border_tborder () 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 (const std::string &id)
 
void add_object (const config &cfg)
 
void remove_object (const 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, std::unique_ptr< status_item > > status_
 
object main_map_
 
object mini_map_
 
object unit_image_
 
object palette_
 
border_t border_
 
SDL_Rect screen_dimensions_
 

Static Private Attributes

static std::map< std::string, configknown_themes
 

Detailed Description

Definition at line 38 of file theme.hpp.

Constructor & Destructor Documentation

◆ theme() [1/2]

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

Definition at line 571 of file theme.cpp.

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

◆ theme() [2/2]

theme::theme ( const theme )
delete

Member Function Documentation

◆ actions()

const std::vector<action>& theme::actions ( ) const
inline

◆ add_object()

void theme::add_object ( const config cfg)
private

◆ border()

const border_t& theme::border ( ) const
inline

◆ context_menu()

const menu* theme::context_menu ( ) const
inline

◆ find_element()

theme::object & theme::find_element ( const std::string &  id)
private

Definition at line 871 of file theme.cpp.

References a, actions_, labels_, main_map_, menus_, mini_map_, p, palette_, panels_, status_, and unit_image_.

Referenced by modify(), modify_label(), and set_object_location().

◆ get_action_item()

const theme::action * theme::get_action_item ( const std::string &  key) const

Definition at line 966 of file theme.cpp.

References a, and actions_.

Referenced by hotkey::command_executor::get_menu_images().

◆ get_known_themes()

std::vector< theme_info > theme::get_known_themes ( )
static

Definition at line 943 of file theme.cpp.

References i, and known_themes.

Referenced by preferences::show_theme_dialog().

◆ get_menu_item()

const theme::menu * theme::get_menu_item ( const std::string &  key) const

◆ get_status_item()

const theme::status_item * theme::get_status_item ( const std::string &  item) const

Definition at line 916 of file theme.cpp.

References i, and status_.

Referenced by display::refresh_report().

◆ labels()

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

Definition at line 250 of file theme.hpp.

Referenced by display::draw_all_panels().

◆ main_map_location()

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

Definition at line 268 of file theme.hpp.

◆ menus()

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

◆ mini_map_location()

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

Definition at line 270 of file theme.hpp.

◆ modify()

void theme::modify ( const config cfg)

◆ modify_label()

void theme::modify_label ( const std::string &  id,
const std::string &  text 
)

Definition at line 1007 of file theme.cpp.

References find_element(), LOG_DP, and theme::label::set_text().

◆ operator=() [1/2]

theme& theme::operator= ( const theme )
delete

◆ operator=() [2/2]

theme & theme::operator= ( theme &&  other)

◆ palette_location()

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

Definition at line 274 of file theme.hpp.

◆ panels()

const std::vector<panel>& theme::panels ( ) const
inline

Definition at line 249 of file theme.hpp.

Referenced by display::draw_all_panels().

◆ refresh_title()

theme::object * theme::refresh_title ( const std::string &  id,
const std::string &  new_title 
)

Definition at line 975 of file theme.cpp.

References a, actions_, and menus_.

Referenced by refresh_title2().

◆ refresh_title2()

theme::object * theme::refresh_title2 ( const std::string &  id,
const std::string &  title_tag 
)

Definition at line 996 of file theme.cpp.

References cfg_, find_ref(), and refresh_title().

◆ remove_object()

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

Definition at line 771 of file theme.cpp.

References a, actions_, error(), labels_, menus_, p, panels_, s, sliders_, and status_.

Referenced by modify().

◆ set_known_themes()

void theme::set_known_themes ( const config cfg)
static

Definition at line 928 of file theme.cpp.

References config::child_range(), and known_themes.

Referenced by game_config_manager::load_game_config().

◆ set_object_location()

void theme::set_object_location ( theme::object element,
std::string  rect_str,
std::string  ref_id 
)
private

◆ set_resolution()

bool theme::set_resolution ( const SDL_Rect &  screen)

◆ sliders()

const std::vector<slider>& theme::sliders ( ) const
inline

Definition at line 252 of file theme.hpp.

◆ theme_reset_event()

events::generic_event& theme::theme_reset_event ( )
inline

◆ unit_image_location()

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

Definition at line 272 of file theme.hpp.

Member Data Documentation

◆ action_context_

action theme::action_context_
private

Definition at line 304 of file theme.hpp.

Referenced by add_object(), and operator=().

◆ actions_

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

◆ border_

border_t theme::border_
private

Definition at line 310 of file theme.hpp.

Referenced by add_object(), and operator=().

◆ cfg_

config theme::cfg_
private

Definition at line 296 of file theme.hpp.

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

◆ context_

menu theme::context_
private

Definition at line 303 of file theme.hpp.

Referenced by add_object(), and operator=().

◆ cur_theme

std::string theme::cur_theme
private

Definition at line 295 of file theme.hpp.

Referenced by operator=().

◆ known_themes

known_themes_map theme::known_themes
staticprivate

Definition at line 294 of file theme.hpp.

Referenced by get_known_themes(), and set_known_themes().

◆ labels_

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

Definition at line 298 of file theme.hpp.

Referenced by add_object(), find_element(), operator=(), remove_object(), and set_resolution().

◆ main_map_

object theme::main_map_
private

Definition at line 308 of file theme.hpp.

Referenced by add_object(), find_element(), and operator=().

◆ menus_

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

◆ mini_map_

object theme::mini_map_
private

Definition at line 308 of file theme.hpp.

Referenced by add_object(), find_element(), and operator=().

◆ palette_

object theme::palette_
private

Definition at line 308 of file theme.hpp.

Referenced by add_object(), find_element(), and operator=().

◆ panels_

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

Definition at line 297 of file theme.hpp.

Referenced by add_object(), find_element(), operator=(), remove_object(), and set_resolution().

◆ screen_dimensions_

SDL_Rect theme::screen_dimensions_
private

Definition at line 312 of file theme.hpp.

Referenced by add_object(), and set_resolution().

◆ sliders_

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

Definition at line 301 of file theme.hpp.

Referenced by add_object(), operator=(), remove_object(), and set_resolution().

◆ status_

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

◆ theme_reset_event_

events::generic_event theme::theme_reset_event_
private

Definition at line 292 of file theme.hpp.

Referenced by operator=(), and set_resolution().

◆ unit_image_

object theme::unit_image_
private

Definition at line 308 of file theme.hpp.

Referenced by add_object(), find_element(), and operator=().


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