22 std::shared_ptr<component_base_t> child, std::optional<std::shared_ptr<component_base_t>> prev
26 ctx.
set_parameter(
"self_x", child->get_dimensional_relations().x);
27 ctx.
set_parameter(
"self_y", child->get_dimensional_relations().y);
28 ctx.
set_parameter(
"self_width", child->get_dimensional_relations().width);
29 ctx.
set_parameter(
"self_height", child->get_dimensional_relations().height);
30 ctx.
set_parameter(
"self_screen_x", child->get_internal_relations().cx);
31 ctx.
set_parameter(
"self_screen_y", child->get_internal_relations().cy);
32 ctx.
set_parameter(
"self_content_width", child->get_internal_relations().cw);
33 ctx.
set_parameter(
"self_content_height", child->get_internal_relations().ch);
35#define TO_STRING(...) #__VA_ARGS__
36#define DIMENSIONAL_PARAM(PREFIX, NAME, ...) \
37 ctx.set_parameter(TO_STRING(PREFIX##_##NAME), __VA_ARGS__)
38#define PARENT_PARAM(NAME, ...) DIMENSIONAL_PARAM(parent, NAME, __VA_ARGS__ + 0_px)
39#define SELF_PARAM(NAME, ...) DIMENSIONAL_PARAM(self, NAME, __VA_ARGS__ + 0_px)
43 if (child->parent.has_value()) {
44 auto& [cx, cy, cw, ch] = child->parent.value()->get_internal_relations();
97#define PREV_PARAM(NAME, ...) DIMENSIONAL_PARAM(prev, NAME, __VA_ARGS__ + 0_px)
99 if (prev.has_value()) {
100 auto dims = prev.value()->get_dimensional_relations();
103 auto& w = dims.width;
104 auto& h = dims.height;
void set_parameter(const std::string &name, V &&getter)