Start UI core layout value tests
This commit is contained in:
24
src/ui_core/layout_value.h
Normal file
24
src/ui_core/layout_value.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "foundation/result.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
|
||||
namespace pp::ui {
|
||||
|
||||
enum class LayoutLengthKind : std::uint8_t {
|
||||
auto_value,
|
||||
pixels,
|
||||
percent,
|
||||
};
|
||||
|
||||
struct LayoutLength {
|
||||
LayoutLengthKind kind = LayoutLengthKind::auto_value;
|
||||
std::uint32_t value = 0;
|
||||
};
|
||||
|
||||
[[nodiscard]] pp::foundation::Result<LayoutLength> parse_layout_length(std::string_view text) noexcept;
|
||||
[[nodiscard]] const char* layout_length_kind_name(LayoutLengthKind kind) noexcept;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user