3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/ChildInsertPosition.h"
7#include "mc/client/gui/NameResolutionScope.h"
8#include "mc/client/gui/VisibilityFlag.h"
9#include "mc/deps/core/math/Vec2.h"
10#include "mc/platform/brstd/function_ref.h"
21class UIControl :
public ::std::enable_shared_from_this<::UIControl> {
33 ::ll::TypedStorage<8, 32, ::std::string> targetControlName;
34 ::ll::TypedStorage<4, 4, ::ui::NameResolutionScope> scope;
35 ::ll::TypedStorage<8, 64, ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)>> setter;
40 ControlResolutionInfo();
46 ::std::string
const& aTargetControlName,
47 ::ui::NameResolutionScope aScope,
48 ::std::function<
void(::UIControl&, ::std::shared_ptr<::UIControl>)> aSetter
56 ::std::string
const& aTargetControlName,
57 ::ui::NameResolutionScope aScope,
58 ::std::function<
void(::UIControl&, ::std::shared_ptr<::UIControl>)> aSetter
63 using CompIdType = uint64;
65 using NameResolverFunc = ::std::function<void(::UIControl&, ::std::shared_ptr<::UIControl>)>;
67 using PostCreateFunc = ::std::function<void(::UIControl&)>;
72 ::ll::TypedStorage<4, 8, ::glm::vec2> mCachedPosition;
73 bool mCachedPositionDirty : 1;
75 ::ui::VisibilityFlag mVisible : 2;
76 bool mIsVisibleInTree : 1;
78 bool mAllAncestorsEnabled : 1;
80 bool mClipsChildren : 1;
81 bool mAllowClipping : 1;
83 bool mEnableClippingScissorTest : 1;
85 bool mPropagateAlpha : 1;
86 bool mDelayCollectionUpdate : 1;
87 bool mTextToSpeechTriggered : 1;
88 ::ll::TypedStorage<2, 2, ushort> mControlCollectionFlag;
89 ::ll::TypedStorage<8, 32, ::std::string> mName;
90 ::ll::TypedStorage<4, 8, ::glm::vec2> mParentRelativePosition;
91 ::ll::TypedStorage<4, 8, ::glm::vec2> mSize;
92 ::ll::TypedStorage<4, 8, ::glm::vec2> mMinSize;
93 ::ll::TypedStorage<4, 8, ::glm::vec2> mMaxSize;
94 ::ll::TypedStorage<4, 4, float> mAlpha;
95 ::ll::TypedStorage<4, 4, int> mZOrder;
96 ::ll::TypedStorage<4, 4, int> mLayer;
97 ::ll::TypedStorage<4, 8, ::Vec2> mClipOffset;
98 ::ll::TypedStorage<4, 4, uint> mClipChangeEventId;
99 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UIPropertyBag>> mPropertyBag;
100 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UIPropertyBag>> mPropertyBagToPropagateToChildren;
101 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mParent;
102 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mChildren;
103 ::ll::TypedStorage<8, 8, uint64> mComponentsInUse;
104 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::UIComponent>>> mComponents;
105 ::ll::TypedStorage<8, 24, ::std::vector<::RenderableComponent*>> mRenderableComponentLookup;
106 ::ll::TypedStorage<8, 24, ::std::vector<::CustomFrameUpdateComponent*>> mCustomFrameUpdateComponentLookup;
107 ::ll::TypedStorage<8, 24, ::std::vector<::UIControl::ControlResolutionInfo>> mControlResolvers;
108 ::ll::TypedStorage<8, 24, ::std::vector<::std::function<void(::UIControl&)>>> mPostCreateVector;
109 ::ll::TypedStorage<8, 8, ::ControlScreenAction&> mControlScreenAction;
110 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mModalAncestor;
115 UIControl& operator=(UIControl
const&);
116 UIControl(UIControl
const&);
125 ::std::string
const& controlName,
126 ::ui::NameResolutionScope scope,
127 ::std::function<
void(::UIControl&, ::std::shared_ptr<::UIControl>)> setter
134 MCAPI
void _setCachedPosition()
const;
136 MCAPI
void _setPositionDirty();
139 _setVisible(::ui::VisibilityFlag visibleFlags,
bool setLayoutChangedFlag,
bool doLayout,
bool shrinkInvisible);
141 MCNAPI
void addChild(::std::shared_ptr<::UIControl> child, ::ui::ChildInsertPosition childInsertPosition);
143 MCNAPI ::std::shared_ptr<::UIControl>
clone(::UIControl* parent)
const;
145 MCAPI
void findAllCollectionIndices(
::brstd::function_ref<
void(::std::string
const&,
int)> callback);
147 MCAPI
int findCollectionIndex(::std::string
const& collectionName)
const;
157 MCNAPI ::std::shared_ptr<::UIControl>
moveChild(
int index,
bool notify);
160 ::std::vector<::std::string> controlList,
161 ::std::string propertyName,
171 ::std::unique_ptr<::UIPropertyBag> propertyBag,
172 ::std::unique_ptr<::UIPropertyBag> propertyBagForChildren
179 MCNAPI
void reset(
bool recursive,
bool shouldClearCollectionFlag);
Definition ControlScreenAction.h:5
Definition CustomFrameUpdateComponent.h:5
Definition RenderableComponent.h:5
Definition UIComponent.h:5
MCAPI ::std::shared_ptr<::UIControl > getAncestorWhere(::brstd::function_ref< bool(::UIControl const &)> predicate)
MCAPI void popFrontChild()
MCAPI::UIPropertyBag const & getPropertyBag() const
MCAPI void reloadFromControl(::UIControl const &control)
MCAPI void processPropertyBags(::std::unique_ptr<::UIPropertyBag > propertyBag, ::std::unique_ptr<::UIPropertyBag > propertyBagForChildren)
MCAPI bool removeChild(::std::shared_ptr<::UIControl > control)
MCAPI void _registerControlNameResolver(::std::string const &controlName, ::ui::NameResolutionScope scope, ::std::function< void(::UIControl &, ::std::shared_ptr<::UIControl >)> setter)
MCAPI void notifyBindingsUpdated(::std::vector<::std::string > controlList, ::std::string propertyName, bool value, bool siblingScope)
MCAPI void _resolvePostCreate()
MCAPI ::std::shared_ptr<::UIControl > moveChild(int index, bool notify)
MCAPI void reset(bool recursive, bool shouldClearCollectionFlag)
MCAPI ::std::shared_ptr<::UIControl > clone(::UIControl *parent) const
MCAPI void _propagateLockStateChange(bool broadcastEvent)
MCAPI void setIsTemplate(bool isTemplate)
MCAPI void setEnabled(bool enabled, bool broadcastEvent)
MCAPI void addChild(::std::shared_ptr<::UIControl > child, ::ui::ChildInsertPosition childInsertPosition)
MCAPI void _setVisible(::ui::VisibilityFlag visibleFlags, bool setLayoutChangedFlag, bool doLayout, bool shrinkInvisible)
MCAPI::std::string const getPathedName() const
MCAPI void _resolveControlNames(::UIControl &rootControl)
MCAPI void popBackChild()
Definition UIPropertyBag.h:5
Definition function_ref.h:60
Definition UIControl.h:13
MCAPI ControlResolutionInfo(::std::string const &aTargetControlName, ::ui::NameResolutionScope aScope, ::std::function< void(::UIControl &, ::std::shared_ptr<::UIControl >)> aSetter)
MCAPI void * $ctor(::std::string const &aTargetControlName, ::ui::NameResolutionScope aScope, ::std::function< void(::UIControl &, ::std::shared_ptr<::UIControl >)> aSetter)