27#define HIX_GETSET(TYPE, NAME, MODIFY_MASK) \
28 [[nodiscard]] TYPE NAME() const noexcept \
32 style_modify_mask set_##NAME(TYPE NAME, bool important = false) noexcept \
34 auto r = style_modify_mask{}; \
35 if (important or not _##NAME##_important) { \
36 _##NAME##_important |= static_cast<uint64_t>(important); \
37 _##NAME##_valid = 1; \
38 r |= _##NAME == NAME ? style_modify_mask::none : MODIFY_MASK; \
69 r |= set_margin_left(
margin, important);
70 r |= set_margin_bottom(
margin, important);
71 r |= set_margin_right(
margin, important);
72 r |= set_margin_top(
margin, important);
76 style_modify_mask set_padding(unit::length_f padding,
bool important =
false)
noexcept
79 r |= set_padding_left(padding, important);
80 r |= set_padding_bottom(padding, important);
81 r |= set_padding_right(padding, important);
82 r |= set_padding_top(padding, important);
86 style_modify_mask set_border_radius(unit::length_f border_radius,
bool important =
false)
noexcept
89 r |= set_border_bottom_left_radius(border_radius, important);
90 r |= set_border_bottom_right_radius(border_radius, important);
91 r |= set_border_top_left_radius(border_radius, important);
92 r |= set_border_top_right_radius(border_radius, important);
108#define HIX_COMPARE(NAME, MODIFY_MASK) \
109 r |= lhs._##NAME != rhs._##NAME ? MODIFY_MASK : style_modify_mask{};
143#define HIX_APPLY(NAME) \
144 if (other._##NAME##_valid) { \
145 r |= set_##NAME(other._##NAME, static_cast<bool>(other._##NAME##_important)); \
151 HIX_APPLY(margin_left)
152 HIX_APPLY(margin_bottom)
153 HIX_APPLY(margin_right)
154 HIX_APPLY(margin_top)
155 HIX_APPLY(padding_left)
156 HIX_APPLY(padding_bottom)
157 HIX_APPLY(padding_right)
158 HIX_APPLY(padding_top)
159 HIX_APPLY(border_width)
160 HIX_APPLY(border_bottom_left_radius)
161 HIX_APPLY(border_bottom_right_radius)
162 HIX_APPLY(border_top_left_radius)
163 HIX_APPLY(border_top_right_radius)
164 HIX_APPLY(foreground_color)
165 HIX_APPLY(background_color)
166 HIX_APPLY(border_color)
174 hi::unit::length_f _width = unit::points(0.0f);
175 hi::unit::length_f _height = unit::points(0.0f);
176 hi::unit::length_f _margin_left = unit::points(0.0f);
177 hi::unit::length_f _margin_bottom = unit::points(0.0f);
178 hi::unit::length_f _margin_right = unit::points(0.0f);
179 hi::unit::length_f _margin_top = unit::points(0.0f);
180 hi::unit::length_f _padding_left = unit::points(0.0f);
181 hi::unit::length_f _padding_bottom = unit::points(0.0f);
182 hi::unit::length_f _padding_right = unit::points(0.0f);
183 hi::unit::length_f _padding_top = unit::points(0.0f);
184 hi::unit::length_f _border_width = unit::points(0.0f);
185 hi::unit::length_f _border_bottom_left_radius = unit::points(0.0f);
186 hi::unit::length_f _border_bottom_right_radius = unit::points(0.0f);
187 hi::unit::length_f _border_top_left_radius = unit::points(0.0f);
188 hi::unit::length_f _border_top_right_radius = unit::points(0.0f);
195 uint64_t _width_valid : 1 = 0;
196 uint64_t _height_valid : 1 = 0;
197 uint64_t _margin_left_valid : 1 = 0;
198 uint64_t _margin_bottom_valid : 1 = 0;
199 uint64_t _margin_right_valid : 1 = 0;
200 uint64_t _margin_top_valid : 1 = 0;
201 uint64_t _padding_left_valid : 1 = 0;
202 uint64_t _padding_bottom_valid : 1 = 0;
203 uint64_t _padding_right_valid : 1 = 0;
204 uint64_t _padding_top_valid : 1 = 0;
205 uint64_t _border_width_valid : 1 = 0;
206 uint64_t _border_bottom_left_radius_valid : 1 = 0;
207 uint64_t _border_bottom_right_radius_valid : 1 = 0;
208 uint64_t _border_top_left_radius_valid : 1 = 0;
209 uint64_t _border_top_right_radius_valid : 1 = 0;
210 uint64_t _foreground_color_valid : 1 = 0;
211 uint64_t _background_color_valid : 1 = 0;
212 uint64_t _border_color_valid : 1 = 0;
213 uint64_t _horizontal_alignment_valid : 1 = 0;
214 uint64_t _vertical_alignment_valid : 1 = 0;
216 uint64_t _width_important : 1 = 0;
217 uint64_t _height_important : 1 = 0;
218 uint64_t _margin_left_important : 1 = 0;
219 uint64_t _margin_bottom_important : 1 = 0;
220 uint64_t _margin_right_important : 1 = 0;
221 uint64_t _margin_top_important : 1 = 0;
222 uint64_t _padding_left_important : 1 = 0;
223 uint64_t _padding_bottom_important : 1 = 0;
224 uint64_t _padding_right_important : 1 = 0;
225 uint64_t _padding_top_important : 1 = 0;
226 uint64_t _border_width_important : 1 = 0;
227 uint64_t _border_bottom_left_radius_important : 1 = 0;
228 uint64_t _border_bottom_right_radius_important : 1 = 0;
229 uint64_t _border_top_left_radius_important : 1 = 0;
230 uint64_t _border_top_right_radius_important : 1 = 0;
231 uint64_t _foreground_color_important : 1 = 0;
232 uint64_t _background_color_important : 1 = 0;
233 uint64_t _border_color_important : 1 = 0;
234 uint64_t _horizontal_alignment_important : 1 = 0;
235 uint64_t _vertical_alignment_important : 1 = 0;