26 namespace help {
struct section; }
27 namespace help {
struct topic; }
45 std::string
ref_at(
const int x,
const int y);
48 virtual void scroll(
unsigned int pos);
63 const std::string& reference_to=
"",
bool floating=
false,
123 void add_text_item(
const std::string& text,
const std::string& ref_dst=
"",
124 bool broken_link =
false,
125 int font_size=-1,
bool bold=
false,
bool italic=
false,
129 void add_img_item(
const std::string&
path,
const std::string& alignment,
const bool floating,
A config object defines a single node in a WML file, with access to child nodes.
Function object to find an item at the specified coordinates.
item_at(const int x, const int y)
bool operator()(const item &) const
The area where the content is shown in the help browser.
const section & toplevel_
const unsigned min_row_height_
void handle_italic_cfg(const config &cfg)
void handle_img_cfg(const config &cfg)
void add_img_item(const std::string &path, const std::string &alignment, const bool floating, const bool box)
Add an image item with the specified attributes.
int get_min_x(const int y, const int height=0)
Return the least x coordinate at which something of the specified height can be drawn at the specifie...
std::string ref_at(const int x, const int y)
Return the ID that is cross-referenced at the (screen) coordinates x, y.
help_text_area(const section &toplevel)
std::list< item * > last_row_
std::pair< int, int > curr_loc_
The current input location when creating items.
int get_remaining_width()
Return the width that remain on the line the current input point is at.
virtual void set_inner_location(const SDL_Rect &rect)
void show_topic(const topic &t)
Display the topic.
void handle_format_cfg(const config &cfg)
void adjust_last_row()
Adjust the heights of the items in the last row to make it look good.
virtual void scroll(unsigned int pos)
void set_items()
Update the vector with the items of the shown topic, creating surfaces for everything and putting thi...
void handle_bold_cfg(const config &cfg)
void handle_ref_cfg(const config &cfg)
unsigned curr_row_height_
void down_one_line()
Move the current input point to the next line.
ALIGNMENT str_to_align(const std::string &s)
Convert a string to an alignment.
void handle_jump_cfg(const config &cfg)
int get_max_x(const int y, const int height=0)
Analogous with get_min_x but return the maximum X.
void add_item(const item &itm)
Add an item to the internal list, update the locations and row height.
void add_text_item(const std::string &text, const std::string &ref_dst="", bool broken_link=false, int font_size=-1, bool bold=false, bool italic=false, color_t color=font::NORMAL_COLOR)
Add an item with text.
void handle_header_cfg(const config &cfg)
int contents_height_
The height of all items in total.
topic const * shown_topic_
int get_y_for_floating_img(const int width, const int x, const int desired_y)
Find the lowest y coordinate where a floating img of the specified width and at the specified x coord...
Wrapper class to encapsulate creation and management of an SDL_Texture.
const color_t NORMAL_COLOR
std::string bold(const std::string &s)
The basic class for representing 8-bit RGB or RGBA colour values.
An item that is displayed in the text area.
item(const texture &tex, int x, int y, const std::string &text="", const std::string &reference_to="", bool floating=false, bool box=false, ALIGNMENT alignment=HERE)
rect rect_
Relative coordinates of this item.
A section contains topics and sections along with title and ID.
A topic contains a title, an id and some text.
An abstract description of a rectangle with integer coordinates.
static map_location::DIRECTION s