95 #define FT_OFFSET_UNSET ((ft_offset_t) -1)
101 #define SPECLIST_TAG text_tag
102 #define SPECLIST_TYPE struct text_tag
105 #define text_tag_list_iterate(tags, ptag) \
106 TYPED_LIST_ITERATE(struct text_tag, tags, ptag)
107 #define text_tag_list_iterate_end LIST_ITERATE_END
131 #define MAX_LEN_LINK 128
138 #define FT_COLOR(fg, bg) \
197 char *plain_text,
size_t plain_text_len,
198 struct text_tag_list **tags,
199 bool replace_link_text);
201 size_t featured_text_len,
207 #define text_tag_list_new() text_tag_list_new_full(text_tag_destroy)
208 #define text_tag_list_copy(tags) \
209 text_tag_list_copy_full(tags, text_tag_copy, text_tag_destroy)
struct text_tag * text_tag_copy(const struct text_tag *ptag)
This function returns a new pointer to a text_tag which is similar to the 'ptag' argument.
const struct ft_color ftc_chat_private
size_t featured_text_apply_tag(const char *text_source, char *featured_text, size_t featured_text_len, enum text_tag_type tag_type, ft_offset_t start_offset, ft_offset_t stop_offset,...)
Apply a tag to a text.
const char * unit_firepower_if_not_one(int firepower)
Get string of unit's firepower text, i.e.
const char * unit_veteran_level_and_bonus(const struct unit *punit)
const char * city_tile_link(const struct city *pcity)
Get a text link to a city tile (make a clickable link to a tile with the city name as text).
const struct ft_color ftc_vote_abstain
enum text_link_type text_tag_link_type(const struct text_tag *ptag)
Return the link target type suggested by this text tag.
static bool ft_color_requested(const struct ft_color color)
const struct ft_color ftc_log
const struct ft_color ftc_player_lost
size_t featured_text_to_plain_text(const char *featured_text, char *plain_text, size_t plain_text_len, struct text_tag_list **tags, bool replace_link_text)
Separate the text from the text features.
const struct ft_color ftc_luaconsole_verbose
const char * tile_link(const struct tile *ptile)
Get a text link to a tile.
struct text_tag * text_tag_new(enum text_tag_type tag_type, ft_offset_t start_offset, ft_offset_t stop_offset,...)
Returns a new text_tag or nullptr on error.
const struct ft_color ftc_command
QString text_tag_color_background(const struct text_tag *ptag)
Return the background color suggested by this text tag.
const char * unit_tired_attack_string(const struct unit *punit)
Get string of unit's attack would be a tired attack or not.
QString text_tag_color_foreground(const struct text_tag *ptag)
Return the foreground color suggested by this text tag.
const char * unit_tile_link(const struct unit *punit)
Get a text link to a unit tile (make a clickable link to a tile with the unit type name as text).
ft_offset_t text_tag_stop_offset(const struct text_tag *ptag)
Return the stop offset (in bytes) of this text tag.
const char * unit_veteran_level_string(const struct unit *punit)
Get a text of a unit's vet level.
const struct ft_color ftc_server
const struct ft_color ftc_vote_failed
void text_tag_destroy(struct text_tag *ptag)
Free a text_tag structure.
const struct ft_color ftc_vote_yes
const struct ft_color ftc_luaconsole_error
const struct ft_color ftc_warning
const struct ft_color ftc_client
const struct ft_color ftc_luaconsole_normal
const struct ft_color ftc_editor
const char * unit_achieved_rank_string(const struct unit *punit)
Get string of when unit gets upgraded to new veteran level.
const struct ft_color ftc_any
const struct ft_color ftc_vote_no
const char * city_link(const struct city *pcity)
Get a text link to a city.
const struct ft_color ftc_vote_passed
const struct ft_color ftc_luaconsole_warn
int text_tag_link_id(const struct text_tag *ptag)
Return the link target id suggested by this text tag (city id, tile index or unit id).
const struct ft_color ftc_chat_luaconsole
ft_offset_t text_tag_start_offset(const struct text_tag *ptag)
Return the start offset (in bytes) of this text tag.
const struct ft_color ftc_vote_team
const char * unit_link(const struct unit *punit)
Get a text link to an unit.
const struct ft_color ftc_game_start
const struct ft_color ftc_server_prompt
struct ft_color ftc_changed
const struct ft_color ftc_vote_public
static struct ft_color ft_color_construct(const char *foreground, const char *background)
const struct ft_color ftc_luaconsole_input
const struct ft_color ftc_chat_public
const struct ft_color ftc_chat_ally