#include "global.hpp"
#include "about.hpp"
#include "cursor.hpp"
#include "display.hpp"
#include "events.hpp"
#include "game_config.hpp"
#include "game_preferences.hpp"
#include "gettext.hpp"
#include "help.hpp"
#include "image.hpp"
#include "language.hpp"
#include "marked-up_text.hpp"
#include "log.hpp"
#include "sdl_utils.hpp"
#include "sound.hpp"
#include "construct_dialog.hpp"
#include "unit.hpp"
#include "util.hpp"
#include "video.hpp"
#include "wml_separators.hpp"
#include "serialization/parser.hpp"
#include "serialization/string_utils.hpp"
#include "widgets/button.hpp"
#include "widgets/menu.hpp"
#include "widgets/scrollbar.hpp"
#include "widgets/widget.hpp"
#include <algorithm>
#include <iostream>
#include <list>
#include <locale>
#include <map>
#include <queue>
#include <set>
#include <sstream>
Go to the source code of this file.
Namespaces | |
namespace | help |
Classes | |
class | help::topic_generator |
Generate a topic text on the fly. More... | |
class | help::text_topic_generator |
class | help::topic_text |
The text displayed in a topic. More... | |
struct | help::topic |
A topic contains a title, an id and some text. More... | |
struct | help::section |
A section contains topics and sections along with title and ID. More... | |
class | help::has_id |
To be used as a function object to locate sections and topics with a specified ID. More... | |
class | help::title_less |
To be used as a function object when sorting topic lists on the title. More... | |
class | help::section_less |
To be used as a function object when sorting section lists on the title. More... | |
struct | help::delete_section |
struct | help::create_section |
class | help::help_menu |
The menu to the left in the help browser, where topics can be navigated through and chosen. More... | |
struct | help::help_menu::visible_item |
Information about an item that is visible in the menu. More... | |
struct | help::parse_error |
Thrown when the help system fails to parse something. More... | |
class | help::help_text_area |
The area where the content is shown in the help browser. More... | |
struct | help::help_text_area::item |
An item that is displayed in the text area. More... | |
class | help::help_text_area::item_at |
Function object to find an item at the specified coordinates. More... | |
class | help::help_browser |
A help browser widget. More... | |
class | help::unit_topic_generator |
Defines | |
#define | DBG_HELP LOG_STREAM(debug, help) |
#define | LOG_HELP LOG_STREAM(info, help) |
#define | ERR_HELP LOG_STREAM(err, help) |
Typedefs | |
typedef std::vector< section * > | help::section_list |
typedef std::list< topic > | help::topic_list |
typedef std::vector < std::vector< std::pair < std::string, unsigned int > > > | table_spec |
Enumerations | |
enum | help::UNIT_DESCRIPTION_TYPE { help::FULL_DESCRIPTION, help::NO_DESCRIPTION, help::NON_REVEALING_DESCRIPTION } |
Functions | |
static void | help::generate_contents () |
Generate the help contents from the configurations given to the manager. | |
static void | help::generate_sections (const config *help_cfg, const std::string &generator, section &sec, int level) |
Dispatch generators to their appropriate functions. | |
static std::vector< topic > | help::generate_topics (const bool sort_topics, const std::string &generator) |
static std::string | help::generate_topic_text (const std::string &generator, const config *help_cfg, const section &sec, const std::vector< topic > &generated_topics) |
static std::string | help::generate_about_text () |
static std::string | help::generate_contents_links (const std::string §ion_name, config const *help_cfg) |
static std::string | help::generate_contents_links (const section &sec, const std::vector< topic > &topics) |
static void | help::generate_races_sections (const config *help_cfg, section &sec, int level) |
static std::vector< topic > | help::generate_unit_topics (const bool, const std::string &race) |
static 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. | |
static std::vector< topic > | help::generate_ability_topics (const bool) |
static std::vector< topic > | help::generate_weapon_special_topics (const bool) |
static section | help::parse_config (const config *cfg) |
Parse a help config, return the top level section. | |
static void | help::parse_config_internal (const config *help_cfg, const config *section_cfg, section &sec, int level=0) |
Recursive function used by parse_config. | |
static bool | help::section_is_referenced (const std::string §ion_id, const config &cfg) |
Return true if the section with id section_id is referenced from another section in the config, or the toplevel. | |
static 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. | |
static 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. | |
static 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. | |
static std::vector< std::string > | help::parse_text (const std::string &text) |
Parse a text string. | |
static 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]. | |
static bool | help::get_bool (const std::string &s) |
Return true if s is a representation of a truth value (yes/true/. | |
static SDL_Color | help::string_to_color (const std::string &s) |
Return the color the string represents. | |
static std::vector< std::string > | help::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. | |
static std::string | help::remove_first_space (const std::string &text) |
static std::string | help::to_lower (const std::string &s) |
Return a lowercase copy of s. | |
static std::string | help::escape (const std::string &s) |
Prepend all chars with meaning inside attributes with a backslash. | |
static 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. | |
static std::string | hidden_symbol (bool hidden=true) |
static bool | is_visible_id (const std::string &id) |
static bool | is_valid_id (const std::string &id) |
Return true if the id is valid for user defined topics and sections. | |
static std::string | jump_to (const unsigned pos) |
static std::string | jump (const unsigned amount) |
static std::string | bold (const std::string &s) |
static std::string | generate_table (const table_spec &tab, const unsigned int spacing=font::relative_size(20)) |
static unsigned | image_width (const std::string &filename) |
static void | push_tab_pair (std::vector< std::pair< std::string, unsigned int > > &v, const std::string &s) |
void | help::show_help (display &disp, const std::string &show_topic, int xloc, int yloc) |
Open the help browser, show topic with id show_topic. | |
void | help::show_unit_help (display &disp, const std::string &show_topic, bool hidden, int xloc, int yloc) |
Open the help browser, show unit with id unit_id. | |
void | help::show_help (display &disp, const section &toplevel_sec, const std::string &show_topic, int xloc, int yloc) |
Open a help dialog using a toplevel other than the default. | |
Variables | |
const config * | game_cfg = NULL |
gamemap * | map = NULL |
help::section | toplevel |
help::section | hidden_sections |
int | last_num_encountered_units = -1 |
int | last_num_encountered_terrains = -1 |
bool | last_debug_state = game_config::debug |
config | dummy_cfg |
std::vector< std::string > | empty_string_vector |
const int | max_section_level = 15 |
const int | menu_font_size = font::SIZE_NORMAL |
const int | title_size = font::SIZE_LARGE |
const int | title2_size = font::SIZE_15 |
const int | box_width = 2 |
const int | normal_font_size = font::SIZE_SMALL |
const unsigned | max_history = 100 |
const std::string | topic_img = "help/topic.png" |
const std::string | closed_section_img = "help/closed_section.png" |
const std::string | open_section_img = "help/open_section.png" |
const std::string | indentation_img = "help/indentation.png" |
const std::string | default_show_topic = "introduction_topic" |
const std::string | unknown_unit_topic = ".unknown_unit" |
const std::string | unit_prefix = "unit_" |
const std::string | race_prefix = "race_" |
Definition in file help.cpp.
typedef std::vector<std::vector<std::pair<std::string, unsigned int > > > table_spec |
static std::string bold | ( | const std::string & | s | ) | [static] |
Definition at line 654 of file help.cpp.
References help::escape().
Referenced by help::help_text_area::handle_format_cfg(), and help::unit_topic_generator::push_header().
static std::string generate_table | ( | const table_spec & | tab, | |
const unsigned int | spacing = font::relative_size(20) | |||
) | [static] |
Definition at line 666 of file help.cpp.
References jump_to().
Referenced by help::unit_topic_generator::operator()().
static std::string @92::hidden_symbol | ( | bool | hidden = true |
) | [static] |
Definition at line 591 of file help.cpp.
References gui::widget::hidden().
Referenced by help::generate_races_sections(), help::generate_unit_topics(), is_valid_id(), help::help_browser::show_topic(), and help::show_unit_help().
static unsigned image_width | ( | const std::string & | filename | ) | [static] |
Definition at line 709 of file help.cpp.
References image::get_image(), and loc.
Referenced by gui::dialog::layout(), and help::unit_topic_generator::operator()().
static bool @92::is_valid_id | ( | const std::string & | id | ) | [static] |
Return true if the id is valid for user defined topics and sections.
Some IDs are special, such as toplevel and may not be be defined in the config.
Definition at line 602 of file help.cpp.
References hidden_symbol().
Referenced by help::parse_config_internal().
static bool @92::is_visible_id | ( | const std::string & | id | ) | [static] |
Definition at line 595 of file help.cpp.
Referenced by help::generate_contents_links(), and help::help_menu::update_visible_items().
static std::string jump | ( | const unsigned | amount | ) | [static] |
static std::string jump_to | ( | const unsigned | pos | ) | [static] |
Definition at line 640 of file help.cpp.
Referenced by generate_table(), and help::help_text_area::handle_jump_cfg().
static void push_tab_pair | ( | std::vector< std::pair< std::string, unsigned int > > & | v, | |
const std::string & | s | |||
) | [static] |
Definition at line 719 of file help.cpp.
References font::line_width().
Referenced by help::unit_topic_generator::operator()().
const std::string closed_section_img = "help/closed_section.png" [static] |
const std::string default_show_topic = "introduction_topic" [static] |
Definition at line 571 of file help.cpp.
Referenced by main(), terrain_filter::match_internal(), map_editor::new_map_dialog(), and parse_times().
std::vector<std::string> empty_string_vector [static] |
help::section hidden_sections [static] |
const std::string indentation_img = "help/indentation.png" [static] |
bool last_debug_state = game_config::debug [static] |
int last_num_encountered_terrains = -1 [static] |
int last_num_encountered_units = -1 [static] |
Definition at line 561 of file help.cpp.
Referenced by ai::analyze_potential_recruit_movements(), config::clear(), dispatch_village_simple(), sample_ai::do_attacks(), display::drawing_buffer_commit(), map_editor::edit_new_map(), formula_ai::execute_variant(), default_map_generator::generate_map(), reports::generate_report(), formula_ai::get_keeps(), mp::create::hide_children(), main(), ai::move_leader_to_goals(), map_editor::new_map(), map_editor::new_map_dialog(), output_map(), unit::overlaps(), terrain_builder::parse_mapstring(), mp::create::process_event(), gamemap::read(), unit::redraw_unit(), and mp::gamebrowser::set_game_items().
const unsigned max_history = 100 [static] |
const int max_section_level = 15 [static] |
const int menu_font_size = font::SIZE_NORMAL [static] |
Definition at line 574 of file help.cpp.
Referenced by gui::file_menu::display_current_files(), and dialogs::file_dialog::format_dirname().
const int normal_font_size = font::SIZE_SMALL [static] |
const std::string open_section_img = "help/open_section.png" [static] |
const std::string race_prefix = "race_" [static] |
const int title2_size = font::SIZE_15 [static] |
const int title_size = font::SIZE_LARGE [static] |
help::section toplevel [static] |
const std::string unit_prefix = "unit_" [static] |
const std::string unknown_unit_topic = ".unknown_unit" [static] |
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |