HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
style_modify_mask.hpp
1// Copyright Take Vos 2024.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "../macros.hpp"
8#include <utility>
9#include <cstdint>
10
11hi_export_module(hikogui.theme : style_modify_mask);
12
13hi_export namespace hi {
14inline namespace v1 {
15
16enum class style_modify_mask : uint8_t {
19 none = 0b0000'0000,
20
23 all = 0b1'11111'11,
24
27 color = 0b0'00000'01,
28
31 weight = 0b0'00000'10,
32
35 size = 0b0'00001'00,
36
39 margin = 0b0'00010'00,
40
43 alignment = 0b0'00100'00,
44
47 font = 0b0'10000'00,
48
52
56
60};
61
62[[nodiscard]] constexpr style_modify_mask operator|(style_modify_mask const& lhs, style_modify_mask const& rhs) noexcept
63{
64 return static_cast<style_modify_mask>(std::to_underlying(lhs) | std::to_underlying(rhs));
65}
66
67[[nodiscard]] constexpr style_modify_mask operator&(style_modify_mask const& lhs, style_modify_mask const& rhs) noexcept
68{
69 return static_cast<style_modify_mask>(std::to_underlying(lhs) & std::to_underlying(rhs));
70}
71
72constexpr style_modify_mask& operator|=(style_modify_mask& lhs, style_modify_mask const& rhs) noexcept
73{
74 return lhs = lhs | rhs;
75}
76
77constexpr style_modify_mask& operator&=(style_modify_mask& lhs, style_modify_mask const& rhs) noexcept
78{
79 return lhs = lhs & rhs;
80}
81
82[[nodiscard]] constexpr bool to_bool(style_modify_mask const& rhs) noexcept
83{
84 return static_cast<bool>(std::to_underlying(rhs));
85}
86
87} // namespace v1
88}
The HikoGUI namespace.
Definition array_generic.hpp:21
The HikoGUI API version 1.
Definition array_generic.hpp:22
style_modify_mask
Definition style_modify_mask.hpp:16
@ font
A font or font-size has changed.
Definition style_modify_mask.hpp:47
@ weight
A border-width or border-radius was modified.
Definition style_modify_mask.hpp:31
@ layout
A layout (size, alignment) value was modified.
Definition style_modify_mask.hpp:55
@ pixel_density
The attributes that need to be modified when the pixel density changes.
Definition style_modify_mask.hpp:59
@ margin
A margin or padding value was modified.
Definition style_modify_mask.hpp:39
@ redraw
Only visual changes.
Definition style_modify_mask.hpp:51
This is a RGBA floating point color.
Definition color_intf.hpp:49
Horizontal/Vertical alignment combination.
Definition alignment.hpp:244