mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 04:45:13 +00:00

Make the anonymous struct for the LineTo variant in the PathElement enum as separate structure, which can be introspected using rtto::FieldInfo.
35 lines
857 B
C++
35 lines
857 B
C++
#pragma once
|
|
#include <initializer_list>
|
|
#include <string_view>
|
|
#include "sixtyfps_pathelements_internal.h"
|
|
|
|
namespace sixtyfps {
|
|
|
|
using internal::types::PathElement;
|
|
using internal::types::PathLineTo;
|
|
|
|
struct PathElements
|
|
{
|
|
public:
|
|
using Tag = internal::types::PathElements::Tag;
|
|
|
|
PathElements() : data(Data::None()) { }
|
|
PathElements(const PathElement *firstElement, size_t count)
|
|
: data(Data::SharedElements(elements_from_array(firstElement, count)))
|
|
{
|
|
}
|
|
|
|
private:
|
|
static SharedArray<PathElement> elements_from_array(const PathElement *firstElement,
|
|
size_t count)
|
|
{
|
|
SharedArray<PathElement> tmp;
|
|
sixtyfps_new_path_elements(&tmp, firstElement, count);
|
|
return tmp;
|
|
}
|
|
|
|
using Data = internal::types::PathElements;
|
|
Data data;
|
|
};
|
|
|
|
}
|