Cogs.Core
GuiComponent.cpp
1#include "GuiComponent.h"
2
3#include "Types.h"
4
5#include "Foundation/Reflection/Type.h"
6
7using namespace Cogs::Reflection;
8
9void Cogs::Core::GuiComponent::registerType()
10{
11 static constexpr EnumeratorDef enums[] = {
12 { "Auto", GuiPointerSource::Auto },
13 { "Mouse", GuiPointerSource::Mouse },
14 { "ProjectedMouse", GuiPointerSource::ProjectedMouse },
15 { "ProjectedCenter", GuiPointerSource::ProjectedCenter },
16 { "Projector", GuiPointerSource::Projector },
17 };
18
19 TypeDatabase::createType<GuiPointerSource>().setEnumerators(enums);
20
21
22 Field fields[] = {
23 { "document", &GuiComponent::document },
24 { "planeSize", &GuiComponent::planeSize },
25 { "pointerSource", &GuiComponent::pointerSource },
26 { "pointerAction", &GuiComponent::pointerAction },
27 { "projector", &GuiComponent::projector },
28 { "alwaysInvalidate", &GuiComponent::alwaysInvalidate },
29 };
30
31 TypeDatabase::createType<GuiComponent>()
32 .setBase<Component>()
33 .setFields(fields);
34}
Field definition describing a single data member of a data structure.
Definition: Field.h:68
Contains reflection support.
Definition: Component.h:11