Classes | |
struct | parse_error |
Thrown when the help system fails to parse something. More... | |
Functions | |
std::string | make_link (const std::string &text, const std::string &dst) |
Generates a Help markup tag corresponding to a reference or link. More... | |
std::string | img (const std::string &src, const std::string &align="left", bool floating=false) |
Generates a Help markup tag corresponding to an image. More... | |
static config | parse_entity (std::string::const_iterator &beg, std::string::const_iterator end) |
static char | parse_escape (std::string::const_iterator &beg, std::string::const_iterator end) |
static config | parse_text_until (std::string::const_iterator &beg, std::string::const_iterator end, char close) |
static std::string | parse_name (std::string::const_iterator &beg, std::string::const_iterator end) |
static std::pair< std::string, std::string > | parse_attribute (std::string::const_iterator &beg, std::string::const_iterator end, bool allow_empty) |
static void | check_closing_tag (std::string::const_iterator &beg, std::string::const_iterator end, std::string_view match) |
static std::pair< std::string, config > | parse_tag (std::string::const_iterator &beg, std::string::const_iterator end) |
static config | parse_tag_contents (std::string::const_iterator &beg, std::string::const_iterator end, std::string_view match, bool check_for_attributes) |
config | parse_text (const std::string &text) |
Parse a xml style marked up text string. More... | |
template<typename... Args> | |
std::string | tag (std::string_view tag, Args &&... data) |
Wraps the given data in the specified formatting tag. More... | |
template<typename Value , typename... Args> | |
std::string | span_attribute (std::string_view key, const Value &value, Args &&... data) |
Wraps the given data in a span tag with the specified attribute and value. More... | |
template<typename... Args> | |
std::string | span_color (const color_t &color, Args &&... data) |
Applies Pango markup to the input specifying its display color. More... | |
template<typename... Args> | |
std::string | span_color (std::string_view color, Args &&... data) |
Applies Pango markup to the input specifying its display color. More... | |
template<typename... Args> | |
std::string | span_size (std::string_view size, Args &&... data) |
Applies Pango markup to the input specifying its display size. More... | |
template<typename... Args> | |
std::string | bold (Args &&... data) |
Applies bold Pango markup to the input. More... | |
template<typename... Args> | |
std::string | italic (Args &&... data) |
Applies italic Pango markup to the input. More... | |
Variables | |
constexpr std::string_view | br {"<br/>"} |
A Help markup tag corresponding to a linebreak. More... | |
std::string markup::bold | ( | Args &&... | data | ) |
Applies bold Pango markup to the input.
data | Variable list of content to concatenate inside the bold tag. Each argument must be writable to a stringstream. |
Definition at line 138 of file markup.hpp.
Referenced by gui2::chatbox::add_active_window_message(), gui2::chatbox::add_active_window_whisper(), gui2::chatbox::add_chat_message(), gui2::chatbox::add_room_window_message(), gui2::chatbox::add_whisper_window_whisper(), attack_info(), unit_helper::format_level_string(), gui2::dialogs::mp_change_control::highlight_side_nick(), help::unit_topic_generator::operator()(), gui2::dialogs::unit_attack::pre_show(), gui2::unit_preview_pane::print_attack_details(), gui2::unit_preview_pane::set_display_data(), time_of_day_at(), tod_stats_at(), unit_abilities(), unit_alignment(), unit_defense(), unit_helper::unit_level_tooltip(), unit_name(), unit_race(), unit_traits(), unit_type(), and unit_weapons().
|
static |
Definition at line 292 of file markup.cpp.
Referenced by parse_tag_contents().
std::string markup::img | ( | const std::string & | src, |
const std::string & | align = "left" , |
||
bool | floating = false |
||
) |
Generates a Help markup tag corresponding to an image.
src | The WML path to the image (i.e., 'units/drakes/arbiter.png') |
align | Alignment of the image. Possible values: left, right, center. |
floating | Is the image a floating image or an inline image? |
Definition at line 31 of file markup.cpp.
References src.
Referenced by terrain_builder::add_images_from_config(), terrain_builder::apply_rule(), display::draw_hex(), display::draw_report(), unit_helper::format_cost_string(), help::generate_time_of_day_topics(), hotkey::command_executor::get_menu_images(), image::get_tod_colored(), intf_get_image_size(), help::terrain_topic_generator::operator()(), help::unit_topic_generator::operator()(), gui2::dialogs::drop_down_menu::pre_show(), gui2::dialogs::editor_edit_pbl::pre_show(), gui2::dialogs::terrain_layers::pre_show(), filesystem::read_file_as_data_uri(), terrain_builder::replace_rotate_tokens(), gui2::dialogs::achievements_dialog::set_sub_achievements(), gui2::dialogs::mp_create_game::update_details(), and gui2::dialogs::editor_edit_pbl::update_icon_preview().
std::string markup::italic | ( | Args &&... | data | ) |
Applies italic Pango markup to the input.
data | Variable list of content to enclose inside the italic tag. Each argument must be writable to a stringstream. |
Definition at line 153 of file markup.hpp.
Referenced by gui2::chatbox::add_chat_message(), attack_info(), editor::context_manager::expand_areas_menu(), editor::context_manager::expand_open_maps_menu(), editor::context_manager::expand_sides_menu(), gui2::dialogs::mp_lobby::make_game_row_data(), help::unit_topic_generator::operator()(), gui2::dialogs::game_version::pre_show(), gui2::dialogs::unit_attack::pre_show(), gui2::dialogs::attack_predictions::set_data(), unit_abilities(), and gui2::dialogs::mp_staging::update_leader_display().
std::string markup::make_link | ( | const std::string & | text, |
const std::string & | dst | ||
) |
Generates a Help markup tag corresponding to a reference or link.
text | User visible text/caption of the link. |
dst | Destination of the link. Can be any string depending on the link handler in the parsing gui2::rich_label. |
Definition at line 25 of file markup.cpp.
References dst.
Referenced by help::generate_ability_topics(), help::generate_contents_links(), help::generate_era_topics(), help::generate_faction_topics(), help::generate_time_of_day_topics(), help::generate_unit_topics(), help::generate_weapon_special_topics(), help::make_unit_link(), help::terrain_topic_generator::operator()(), help::unit_topic_generator::operator()(), and help::print_trait_list().
|
static |
Definition at line 230 of file markup.cpp.
References config::all_children_count(), config::has_child(), config::optional_child(), parse_entity(), parse_escape(), parse_name(), parse_text_until(), s, and t.
Referenced by parse_tag(), and parse_tag_contents().
|
static |
Definition at line 92 of file markup.cpp.
Referenced by parse_attribute(), and parse_text_until().
|
static |
Definition at line 161 of file markup.cpp.
Referenced by parse_attribute(), and parse_text_until().
|
static |
Definition at line 221 of file markup.cpp.
References s.
Referenced by parse_attribute(), and parse_tag().
|
static |
Definition at line 367 of file markup.cpp.
References config::all_children_count(), config::append(), config::attribute_count(), config::has_attribute(), parse_attribute(), parse_name(), and parse_tag_contents().
Referenced by parse_tag_contents(), and parse_text().
|
static |
Definition at line 311 of file markup.cpp.
References config::add_child(), config::all_children_count(), config::append_children(), config::attribute_count(), check_closing_tag(), config::has_attribute(), config::has_child(), config::mandatory_child(), parse_attribute(), parse_tag(), parse_text_until(), and tag().
Referenced by parse_tag().
config markup::parse_text | ( | const std::string & | text | ) |
Parse a xml style marked up text string.
Return a config with the different parts of the text. Each markup item is a separate part while the text between markups are separate parts.
Definition at line 403 of file markup.cpp.
References config::add_child(), config::append_children(), parse_tag(), parse_text_until(), and tag().
Referenced by BOOST_AUTO_TEST_CASE(), and help::topic_text::parsed_text().
|
static |
Definition at line 172 of file markup.cpp.
References config::add_child(), parse_entity(), parse_escape(), and s.
Referenced by parse_attribute(), parse_tag_contents(), and parse_text().
std::string markup::span_attribute | ( | std::string_view | key, |
const Value & | value, | ||
Args &&... | data | ||
) |
Wraps the given data in a span
tag with the specified attribute and value.
key | The span attribute ("color", "size", etc). |
value | The attribute value. |
data | The content to format. |
Definition at line 67 of file markup.hpp.
References data.
Referenced by span_color(), and span_size().
std::string markup::span_color | ( | const color_t & | color, |
Args &&... | data | ||
) |
Applies Pango markup to the input specifying its display color.
color | The color_t object from which to retrieve the color. |
data | Variable list of content to enclose inside the span tag. Each argument must be writable to a stringstream. |
Definition at line 87 of file markup.hpp.
References data, span_attribute(), and color_t::to_hex_string().
Referenced by gui2::dialogs::lua_interpreter::lua_model::add_dialog_message(), add_name(), gui2::dialogs::mp_staging::add_side_node(), gui2::dialogs::add_unit_entry(), gui2::dialogs::mp_lobby::adjust_game_row_contents(), gui2::chatbox::append_to_chatbox(), attack_info(), help::best_str(), gui2::dialogs::units_dialog::build_recall_dialog(), gui2::dialogs::units_dialog::build_unit_list_dialog(), gui2::dialogs::campaign_selection::campaign_selected(), gui2::addon_list::colorize_addon_state_string(), gui2::dialogs::controller_name(), gui2::dialogs::game_load::evaluate_summary_string(), unit_helper::format_cost_string(), unit_helper::format_level_string(), unit_helper::format_movement_string(), help::format_mp_entry(), gui2::dialogs::mp_join_game::generate_side_list(), gui2::get_hp_tooltip(), gui2::get_mp_tooltip(), gray_inactive(), mp::initial_level_config(), gui2::dialogs::preferences_dialog::initialize_callbacks(), editor::editor_palette< Item >::layout(), gui2::chatbox::load_log(), gui2::dialogs::mp_lobby::make_game_row_data(), unit_helper::maybe_inactive(), help::unit_topic_generator::operator()(), gui2::dialogs::campaign_difficulty::pre_show(), gui2::dialogs::formula_debugger::pre_show(), gui2::dialogs::game_stats::pre_show(), gui2::dialogs::label_settings::pre_show(), gui2::dialogs::language_selection::pre_show(), gui2::dialogs::mp_change_control::pre_show(), gui2::dialogs::unit_attack::pre_show(), gui2::unit_preview_pane::print_attack_details(), REPORT_GENERATOR(), gui2::dialogs::achievements_dialog::set_achievements_row(), gui2::addon_list::set_addons(), gui2::dialogs::attack_predictions::set_data(), gui2::unit_preview_pane::set_display_data(), gui2::dialogs::preferences_dialog::set_resolution_list(), gui2::dialogs::preferences_dialog::setup_hotkey_list(), gui2::dialogs::tally(), time_of_day_at(), help::time_of_day_bonus_colored(), unit_abilities(), unit_alignment(), unit_box_at(), unit_defense(), unit_hp(), unit_moves(), unit_weapons(), unit_xp(), gui2::lobby_player_list_helper::update(), gui2::dialogs::mp_match_history::update_display(), and attack_type::weapon_specials().
std::string markup::span_color | ( | std::string_view | color, |
Args &&... | data | ||
) |
Applies Pango markup to the input specifying its display color.
color | The hex color string. |
data | Variable list of content to enclose inside the span tag. Each argument must be writable to a stringstream. |
Definition at line 105 of file markup.hpp.
References data, and span_attribute().
std::string markup::span_size | ( | std::string_view | size, |
Args &&... | data | ||
) |
Applies Pango markup to the input specifying its display size.
size | A Pango string size specifier (large, small, x-large, etc). |
data | Variable list of content to concatenate inside the span tag. Each argument must be writable to a stringstream. |
Definition at line 123 of file markup.hpp.
References data, utf8::size(), and span_attribute().
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), gui2::dialogs::outro::outro(), gui2::dialogs::end_credits::pre_show(), gui2::unit_preview_pane::print_attack_details(), and gui2::unit_preview_pane::set_display_data().
std::string markup::tag | ( | std::string_view | tag, |
Args &&... | data | ||
) |
Wraps the given data in the specified formatting tag.
tag | The formatting tag ("b", "i", etc). |
data | The content to wrap with tag. Each argument must be writable to a stringstream. |
Definition at line 50 of file markup.hpp.
References data.
Referenced by schema_validation::wml_tag::add_tag(), gui2::dialogs::mp_lobby::adjust_game_row_contents(), bold(), schema_validation::schema_self_validator::check_for_duplicates(), gui2::dialogs::controller_name(), copy_persistent(), gui2::addon_list::display_title_full_shift(), events::console_handler::do_choose_level(), schema_validation::duplicate_key_error(), schema_validation::duplicate_tag_error(), schema_validation::wml_tag::expand_all(), schema_validation::extra_key_error(), schema_validation::schema_validator::find_mandatory_keys(), schema_validation::wml_tag::find_tag(), help::generate_era_topics(), help::generate_faction_topics(), help::generate_time_of_day_topics(), gui2::dialogs::preferences_dialog::get_friends_list_row_data(), gui2::get_hp_tooltip(), gui2::get_mp_tooltip(), schema_validation::inheritance_cycle_error(), schema_validation::inheritance_loop_error(), mp::initial_level_config(), intf_remove_modifications(), italic(), schema_validation::link_cycle_error(), config::merge_with(), schema_validation::missing_key_error(), missing_mandatory_wml_tag(), schema_validation::missing_super_error(), schema_validation::schema_validator::open_tag(), help::terrain_topic_generator::operator()(), help::unit_topic_generator::operator()(), parse_tag_contents(), parse_text(), gui2::dialogs::campaign_difficulty::pre_show(), gui2::dialogs::language_selection::pre_show(), schema_validation::wml_tag::printl(), schema_validation::wml_tag::iterator< T, Map >::push_new_tag_conditions(), schema_validation::wml_tag::push_new_tag_conditions(), schema_validation::wml_tag::remove_keys_by_type(), game_events::filter_dynamic::serialize(), saved_game::set_defaults(), gui2::unit_preview_pane::set_display_data(), gui2::dialogs::team_mode_controller::show_ai_components(), synced_command::synced_command(), tod_stats_at(), actions::undo_event::undo(), schema_validation::schema_validator::validate(), schema_validation::schema_validator::validate_mandatory_keys(), game_events::wml_action::wml_action(), schema_validation::wrong_path_error(), schema_validation::wrong_type_error(), and schema_validation::wrong_value_error().
|
constexpr |
A Help markup tag corresponding to a linebreak.
Definition at line 35 of file markup.hpp.
Referenced by help::terrain_topic_generator::operator()(), mp::user_info::operator<(), terrain_builder::parse_config(), terrain_builder::parse_mapstring(), and sdl::precise_subrect().