This commit is contained in:
2023-03-13 08:41:32 -07:00
parent f6a368eed5
commit 20575f17b4
9 changed files with 223 additions and 212 deletions

View File

@ -7,10 +7,6 @@
#include "label.hpp"
namespace Dawn {
enum ChildType {
CHILD_TYPE_LABEL
};
struct ChildInfo;
struct ChildrenInfo {
@ -19,8 +15,10 @@ namespace Dawn {
struct ChildInfo {
enum ChildType type;
struct LabelInfo label;
struct ChildrenInfo children;
std::string ref;
bool_t hasRef = false;
struct LabelInfo label;
};
class ChildrenParser : public XmlParser<struct ChildrenInfo> {
@ -48,6 +46,7 @@ namespace Dawn {
if(c->node == "label") {
child.type = CHILD_TYPE_LABEL;
ret = (LabelParser()).parse(c, &child.label, error);
} else {
*error = "Unrecognized UI Element " + c->node;

View File

@ -0,0 +1,31 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "util/XmlParser.hpp"
#include "util/CodeGen.hpp"
namespace Dawn {
enum AlignType {
UI_COMPONENT_ALIGN_START,
UI_COMPONENT_ALIGN_MIDDLE,
UI_COMPONENT_ALIGN_END,
UI_COMPONENT_ALIGN_STRETCH
};
struct Alignment {
float_t x0 = 0;
float_t y0 = 0;
float_t x1 = 0;
float_t y1 = 0;
enum AlignType xAlign = UI_COMPONENT_ALIGN_START;
enum AlignType yAlign = UI_COMPONENT_ALIGN_START;
};
enum ChildType {
CHILD_TYPE_LABEL
};
}

View File

@ -4,7 +4,7 @@
// https://opensource.org/licenses/MIT
#pragma once
#include "util/XmlParser.hpp"
#include "common.hpp"
namespace Dawn {
struct LabelInfo {