25 QGraphicsItem* layout{};
26 std::vector<score::GraphicsLayout*> createdLayouts{};
31 std::pair<Process::ControlInlet*, Process::ControlLayout> makeInlet(
Process::Inlet*);
32 std::pair<Process::ControlOutlet*, Process::ControlLayout>
34 std::vector<std::pair<Process::ControlInlet*, Process::ControlLayout>>
35 makeInlets(std::span<Process::Inlet*>);
36 std::vector<std::pair<Process::ControlOutlet*, Process::ControlLayout>>
37 makeOutlets(std::span<Process::Outlet*>);
38 QGraphicsItem* makeLabel(std::string_view item);
40 void finalizeLayout(QGraphicsItem* rootItem);
45 auto& skin = score::Skin::instance();
47 if constexpr(
requires { T::background_darker; })
48 if(cur == T::background_darker)
49 return skin.Background2.darker300;
52 if constexpr(
requires { T::background_dark; })
53 if(cur == T::background_dark)
54 return skin.Background2.darker;
57 if constexpr(
requires { T::background_mid; })
58 if(cur == T::background_mid)
59 return skin.Background2.main;
62 if constexpr(
requires { T::background_light; })
63 if(cur == T::background_light)
64 return skin.Background2.lighter;
67 if constexpr(
requires { T::background_lighter; })
68 if(cur == T::background_lighter)
69 return skin.Background2.lighter180;
71 return skin.Background2.main;
74 template <
typename Item>
77 if constexpr(
requires { Item::background(); })
79 if constexpr(
requires { std::string_view{Item::background()}; })
80 item.setBackground(Item::background());
82 item.setBrush(get_brush(Item::background()));
86 requires { Item::width(); } &&
requires { Item::height(); })
88 item.setRect({0., 0., (qreal)Item::width(), (qreal)Item::height()});
91 requires { Item::width; } &&
requires { Item::height; })
93 item.setRect({0., 0., (qreal)it.width, (qreal)it.height});
97 template <
typename Item>
98 void setupItem(
const Item& it, QGraphicsItem& item)
100 item.setParentItem(layout);
102 requires { Item::x(); } &&
requires { Item::y(); })
104 item.setPos(Item::x(), Item::y());
107 requires { Item::x; } &&
requires { Item::y; })
109 item.setPos(it.x, it.y);
112 if constexpr(
requires { Item::scale(); })
114 item.setScale(Item::scale());
116 else if constexpr(
requires { Item::scale; })
118 item.setScale(it.scale);
Definition ProcessContext.hpp:12