Revert D48710796: C++ Cleanup 2/N: Reorganize YGConfig
Differential Revision: D48710796 Original commit changeset: d548553f7ce8 Original Phabricator Diff: D48710796 fbshipit-source-id: c8b2de245f3894f6a87c262ec70d313020aa228e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ea7f61a3db
commit
13c5ce2234
@@ -9,13 +9,15 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <stdio.h>
|
||||
#include <yoga/config/Config.h>
|
||||
#include "YGConfig.h"
|
||||
#include "YGLayout.h"
|
||||
#include <yoga/Yoga-internal.h>
|
||||
|
||||
#include <yoga/style/CompactValue.h>
|
||||
#include <yoga/style/Style.h>
|
||||
|
||||
YGConfigRef YGConfigGetDefault();
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
struct YGNodeFlags {
|
||||
@@ -56,7 +58,7 @@ private:
|
||||
uint32_t lineIndex_ = 0;
|
||||
YGNodeRef owner_ = nullptr;
|
||||
YGVector children_ = {};
|
||||
facebook::yoga::Config* config_;
|
||||
YGConfigRef config_;
|
||||
std::array<YGValue, 2> resolvedDimensions_ = {
|
||||
{YGValueUndefined, YGValueUndefined}};
|
||||
|
||||
@@ -82,11 +84,8 @@ private:
|
||||
using CompactValue = facebook::yoga::CompactValue;
|
||||
|
||||
public:
|
||||
YGNode()
|
||||
: YGNode{static_cast<facebook::yoga::Config*>(YGConfigGetDefault())} {
|
||||
flags_.hasNewLayout = true;
|
||||
}
|
||||
explicit YGNode(facebook::yoga::Config* config);
|
||||
YGNode() : YGNode{YGConfigGetDefault()} { flags_.hasNewLayout = true; }
|
||||
explicit YGNode(const YGConfigRef config);
|
||||
~YGNode() = default; // cleanup of owner/children relationships in YGNodeFree
|
||||
|
||||
YGNode(YGNode&&);
|
||||
@@ -167,7 +166,7 @@ public:
|
||||
|
||||
YGNodeRef getChild(uint32_t index) const { return children_.at(index); }
|
||||
|
||||
facebook::yoga::Config* getConfig() const { return config_; }
|
||||
YGConfigRef getConfig() const { return config_; }
|
||||
|
||||
bool isDirty() const { return flags_.isDirty; }
|
||||
|
||||
@@ -291,7 +290,7 @@ public:
|
||||
|
||||
// TODO: rvalue override for setChildren
|
||||
|
||||
void setConfig(facebook::yoga::Config* config);
|
||||
void setConfig(YGConfigRef config);
|
||||
|
||||
void setDirty(bool isDirty);
|
||||
void setLayoutLastOwnerDirection(YGDirection direction);
|
||||
|
Reference in New Issue
Block a user