111 const unsigned thickness = 1,
218 const std::string& img_path);
263 static void dimension_validation(
unsigned value,
const std::string& name,
const std::string& key);
282 const std::string& align,
283 const unsigned wrap_width);
289 const std::string& attr_name,
290 const std::string& extra_data =
"",
291 std::size_t
start = PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING,
292 std::size_t end = PANGO_ATTR_INDEX_TO_TEXT_END);
This file contains the canvas object which is the part where the widgets draw (temporally) images on.
Variant for storing WML attributes.
A config object defines a single node in a WML file, with access to child nodes.
Helper class to encapsulate the management of a PangoAttrList.
Abstract base class for all other shapes.
typed_formula< color_t > border_color_
The border color of the circle.
typed_formula< unsigned > x_
The center x coordinate of the circle.
typed_formula< unsigned > radius_
The radius of the circle.
unsigned int border_thickness_
The border thickness of the circle.
circle_shape(const config &cfg)
Constructor.
typed_formula< color_t > fill_color_
The fill color of the circle.
typed_formula< unsigned > y_
The center y coordinate of the circle.
void draw(wfl::map_formula_callable &variables) override
Draws the canvas.
typed_formula< std::string > image_name_
Image path from which the image will be loaded.
resize_mode
Determines the way an image will be resized.
bool failure_logged_
Prevents duplicate error logs when an image can't be loaded.
typed_formula< unsigned > w_
The width of the image.
resize_mode get_resize_mode(const std::string &resize_mode)
Converts a string to a resize mode.
typed_formula< unsigned > x_
The x coordinate of the image.
static void dimension_validation(unsigned value, const std::string &name, const std::string &key)
typed_formula< unsigned > y_
The y coordinate of the image.
typed_formula< unsigned > h_
The height of the image.
resize_mode resize_mode_
The resize mode for an image.
wfl::formula actions_formula_
typed_formula< bool > mirror_
Mirror the image over the vertical axis.
void draw(wfl::map_formula_callable &variables) override
Draws the canvas.
image_shape(const config &cfg, wfl::action_function_symbol_table &functions)
Constructor.
typed_formula< color_t > color_
The color of the line.
typed_formula< unsigned > x1_
The start x coordinate of the line.
typed_formula< unsigned > y1_
The start y coordinate of the line.
unsigned thickness_
The thickness of the line.
typed_formula< unsigned > x2_
The end x coordinate of the line.
line_shape(const config &cfg)
Constructor.
typed_formula< unsigned > y2_
The end y coordinate of the line.
void draw(wfl::map_formula_callable &variables) override
Draws the canvas.
rect_bounded_shape(const point &origin, const std::string &w_f, const std::string &h_f)
typed_formula< int > x_
The x coordinate of the rectangle.
rect_bounded_shape(const rect &bounds)
typed_formula< int > w_
The width of the rectangle.
typed_formula< int > y_
The y coordinate of the rectangle.
rect_bounded_shape(const config &cfg)
Constructor.
typed_formula< int > h_
The height of the rectangle.
rectangle_shape(const config &cfg)
Constructor.
int border_thickness_
Border thickness.
typed_formula< color_t > fill_color_
The border color of the rectangle.
void draw(wfl::map_formula_callable &variables) override
Draws the canvas.
typed_formula< color_t > border_color_
The border color of the rectangle.
typed_formula< color_t > border_color_
The border color of the rounded rectangle.
void draw(wfl::map_formula_callable &variables) override
Draws the canvas.
typed_formula< int > r_
The radius of the corners.
round_rectangle_shape(const config &cfg)
Constructor.
int border_thickness_
Border thickness.
typed_formula< color_t > fill_color_
The border color of the rounded rectangle.
font::pango_text::FONT_STYLE font_style_
The style of the text.
typed_formula< bool > outline_
Whether to apply a text outline.
typed_formula< color_t > color_
The color of the text.
typed_formula< int > maximum_height_
The maximum height for the text.
bool parse_text_as_formula_
Whether to parse text_ as WFL formula.
t_string get_text() const
typed_formula< bool > link_aware_
The link aware switch of the text.
typed_formula< PangoAlignment > text_alignment_
The alignment of the text.
void set_text(const t_string &text)
void add_attributes_from(text_shape &tshape2, const unsigned attr_start)
typed_formula< color_t > highlight_color_
The color to be used for highlighting.
font::family_class font_family_
The text font family.
typed_formula< color_t > link_color_
The link color of the text.
typed_formula< int > maximum_width_
The maximum width for the text.
void draw(wfl::map_formula_callable &variables) override
Draws the canvas.
text_shape(const config &cfg, wfl::action_function_symbol_table &functions)
Constructor.
std::pair< std::size_t, std::size_t > add_text(const t_string &text)
config::attribute_value text_
The text to draw.
typed_formula< int > highlight_end_
End offset for highlight.
void add_attributes(font::attribute_list &&other_attrs)
void set_wrap_width(const unsigned wrap_width)
float line_spacing_
Spacing between lines.
void add_attribute(const std::string &attr_name, const std::string &extra_data="", std::size_t start=PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING, std::size_t end=PANGO_ATTR_INDEX_TO_TEXT_END)
typed_formula< int > highlight_start_
Start offset for highlight.
typed_formula< unsigned > font_size_
The font size of the text.
unsigned characters_per_line_
The number of characters per line.
wfl::formula actions_formula_
Any extra WFL actions to execute.
font::attribute_list text_attributes_
Any custom Pango text attributes.
typed_formula< bool > text_markup_
The text markup switch of the text.
EXIT_STATUS start(bool clear_id, const std::string &filename, bool take_screenshot, const std::string &screenshot_filename)
Main interface for launching the editor from the title screen.
std::size_t size(std::string_view str)
Length in characters of a UTF-8 string.
The basic class for representing 8-bit RGB or RGBA colour values.
static constexpr color_t null_color()
Definition of a 'null' color - fully transparent black.
An abstract description of a rectangle with integer coordinates.