The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Macros | Functions | Variables
help_impl.cpp File Reference
#include "help_impl.hpp"
#include "about.hpp"
#include "display.hpp"
#include "display_context.hpp"
#include "game_config.hpp"
#include "game_config_manager.hpp"
#include "game_preferences.hpp"
#include "gettext.hpp"
#include "help_topic_generators.hpp"
#include "hotkey/hotkey_command.hpp"
#include "image.hpp"
#include "log.hpp"
#include "utils/make_enum.hpp"
#include "map/map.hpp"
#include "marked-up_text.hpp"
#include "units/race.hpp"
#include "resources.hpp"
#include "sdl/utils.hpp"
#include "serialization/string_utils.hpp"
#include "serialization/unicode_cast.hpp"
#include "serialization/unicode_types.hpp"
#include "terrain/terrain.hpp"
#include "terrain/translation.hpp"
#include "terrain/type_data.hpp"
#include "time_of_day.hpp"
#include "tod_manager.hpp"
#include "tstring.hpp"
#include "units/types.hpp"
#include "serialization/unicode.hpp"
#include <assert.h>
#include <algorithm>
#include <boost/shared_ptr.hpp>
#include <iostream>
#include <iterator>
#include <map>
#include <set>
#include <SDL.h>
Include dependency graph for help_impl.cpp:

Go to the source code of this file.

Namespaces

 help
 

Macros

#define WRN_DP   LOG_STREAM(warn, log_display)
 
#define WRN_HP   LOG_STREAM(warn, log_help)
 
#define DBG_HP   LOG_STREAM(debug, log_help)
 

Functions

bool help::section_is_referenced (const std::string &section_id, const config &cfg)
 Return true if the section with id section_id is referenced from another section in the config, or the toplevel. More...
 
bool help::topic_is_referenced (const std::string &topic_id, const config &cfg)
 Return true if the topic with id topic_id is referenced from another section in the config, or the toplevel. More...
 
void help::parse_config_internal (const config *help_cfg, const config *section_cfg, section &sec, int level=0)
 Recursive function used by parse_config. More...
 
section help::parse_config (const config *cfg)
 Parse a help config, return the top level section. More...
 
std::vector< topic > help::generate_topics (const bool sort_generated, const std::string &generator)
 
void help::generate_sections (const config *help_cfg, const std::string &generator, section &sec, int level)
 Dispatch generators to their appropriate functions. More...
 
std::string help::generate_topic_text (const std::string &generator, const config *help_cfg, const section &sec, const std::vector< topic > &generated_topics)
 
std::vector< topic > help::generate_time_of_day_topics (const bool)
 
std::vector< topic > help::generate_weapon_special_topics (const bool sort_generated)
 
std::vector< topic > help::generate_ability_topics (const bool sort_generated)
 
std::vector< topic > help::generate_era_topics (const bool sort_generated, const std::string &era_id)
 
std::vector< topic > help::generate_faction_topics (const config &era, const bool sort_generated)
 
std::string help::make_unit_link (const std::string &type_id)
 return a hyperlink with the unit's name and pointing to the unit page return empty string if this unit is hidden. More...
 
std::vector< std::stringhelp::make_unit_links_list (const std::vector< std::string > &type_id_list, bool ordered=false)
 return a list of hyperlinks to unit's pages (ordered or not) More...
 
void help::generate_races_sections (const config *help_cfg, section &sec, int level)
 
void help::generate_era_sections (const config *help_cfg, section &sec, int level)
 
void help::generate_terrain_sections (const config *, section &sec, int)
 
void help::generate_unit_sections (const config *, section &sec, int level, const bool, const std::string &race)
 
std::vector< topic > help::generate_unit_topics (const bool sort_generated, const std::string &race)
 
UNIT_DESCRIPTION_TYPE help::description_type (const unit_type &type)
 Return the type of description that should be shown for a unit of the given kind. More...
 
std::string help::generate_about_text ()
 
std::string help::generate_contents_links (const std::string &section_name, config const *help_cfg)
 
std::string help::generate_contents_links (const section &sec, const std::vector< topic > &topics)
 
const topic * help::find_topic (const section &sec, const std::string &id)
 Search for the topic with the specified identifier in the section and its subsections. More...
 
const section * help::find_section (const section &sec, const std::string &id)
 Search for the section with the specified identifier in the section and its subsections. More...
 
std::vector< std::stringhelp::parse_text (const std::string &text)
 Parse a text string. More...
 
std::string help::convert_to_wml (const std::string &element_name, const std::string &contents)
 Convert the contents to wml attributes, surrounded within [element_name]...[/element_name]. More...
 
SDL_Color help::string_to_color (const std::string &s)
 Return the color the string represents. More...
 
std::vector< std::stringhelp::split_in_width (const std::string &s, const int font_size, const unsigned width)
 Make a best effort to word wrap s. All parts are less than width. More...
 
std::string help::remove_first_space (const std::string &text)
 
std::string help::get_first_word (const std::string &s)
 Return the first word in s, not removing any spaces in the start of it. More...
 
void help::generate_contents ()
 Generate the help contents from the configurations given to the manager. More...
 
std::string help::hidden_symbol (bool hidden)
 
bool help::is_visible_id (const std::string &id)
 
bool help::is_valid_id (const std::string &id)
 Return true if the id is valid for user defined topics and sections. More...
 
unsigned help::image_width (const std::string &filename)
 
void help::push_tab_pair (std::vector< std::pair< std::string, unsigned int > > &v, const std::string &s)
 
std::string help::generate_table (const table_spec &tab, const unsigned int spacing)
 
std::string help::escape (const std::string &s)
 Prepend all chars with meaning inside attributes with a backslash. More...
 
tdata_cache help::load_terrain_types_data ()
 Load the appropriate terrain types data to use. More...
 

Variables

static lg::log_domain log_display ("display")
 
static lg::log_domain log_help ("help")
 
const confighelp::game_cfg = nullptr
 
help::section help::toplevel
 
help::section help::hidden_sections
 
int help::last_num_encountered_units = -1
 
int help::last_num_encountered_terrains = -1
 
bool help::last_debug_state = game_config::debug
 
std::vector< std::stringhelp::empty_string_vector
 
const int help::max_section_level = 15
 
const int help::title_size = font::SIZE_LARGE
 
const int help::title2_size = font::SIZE_15
 
const int help::box_width = 2
 
const int help::normal_font_size = font::SIZE_NORMAL
 
const unsigned help::max_history = 100
 
const std::string help::topic_img = "help/topic.png"
 
const std::string help::closed_section_img = "help/closed_section.png"
 
const std::string help::open_section_img = "help/open_section.png"
 
const std::string help::default_show_topic = "..introduction"
 
const std::string help::unknown_unit_topic = ".unknown_unit"
 
const std::string help::unit_prefix = "unit_"
 
const std::string help::terrain_prefix = "terrain_"
 
const std::string help::race_prefix = "race_"
 
const std::string help::faction_prefix = "faction_"
 
const std::string help::era_prefix = "era_"
 
const std::string help::variation_prefix = "variation_"
 

Macro Definition Documentation

#define DBG_HP   LOG_STREAM(debug, log_help)
#define WRN_DP   LOG_STREAM(warn, log_display)

Definition at line 56 of file help_impl.cpp.

#define WRN_HP   LOG_STREAM(warn, log_help)

Variable Documentation

lg::log_domain log_display("display")
static
lg::log_domain log_help("help")
static