-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reviewed By: shergin Differential Revision: D7077312 fbshipit-source-id: e284c151438eb4d1f67a8386580ab54e3dce7c17
- Loading branch information
1 parent
d8bb990
commit 0ee0317
Showing
5 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
load("@xplat//configurations/buck/apple:flag_defs.bzl", "DEBUG_PREPROCESSOR_FLAGS") | ||
load("//ReactNative:DEFS.bzl", "IS_OSS_BUILD", "rn_xplat_cxx_library", "APPLE_INSPECTOR_FLAGS") | ||
|
||
CXX_LIBRARY_COMPILER_FLAGS = [ | ||
"-std=c++14", | ||
"-Wall", | ||
] | ||
|
||
APPLE_COMPILER_FLAGS = [] | ||
|
||
if not IS_OSS_BUILD: | ||
load("@xplat//configurations/buck/apple:flag_defs.bzl", "STATIC_LIBRARY_IOS_FLAGS", "flags") | ||
APPLE_COMPILER_FLAGS = flags.get_flag_value(STATIC_LIBRARY_IOS_FLAGS, 'compiler_flags') | ||
|
||
rn_xplat_cxx_library( | ||
name = "fabric", | ||
srcs = glob(["**/*.cpp"]), | ||
header_namespace = "", | ||
exported_headers = subdir_glob( | ||
[ | ||
("", "**/*.h"), | ||
], | ||
prefix = "fabric", | ||
), | ||
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [ | ||
"-fexceptions", | ||
"-frtti", | ||
], | ||
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, | ||
fbobjc_preprocessor_flags = DEBUG_PREPROCESSOR_FLAGS + APPLE_INSPECTOR_FLAGS, | ||
force_static = True, | ||
preprocessor_flags = [ | ||
"-DLOG_TAG=\"ReactNative\"", | ||
"-DWITH_FBSYSTRACE=1", | ||
], | ||
visibility = [ | ||
"PUBLIC", | ||
], | ||
deps = [ | ||
"xplat//fbsystrace:fbsystrace", | ||
"xplat//folly:headers_only", | ||
"xplat//folly:memory", | ||
"xplat//folly:molly", | ||
"xplat//third-party/glog:glog", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
#include "FabricUIManager.h" | ||
#include "ShadowNode.h" | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
FabricUIManager::FabricUIManager() {} | ||
|
||
ShadowNodeRef FabricUIManager::createNode(int reactTag, std::string viewName, int rootTag, folly::dynamic props, void *instanceHandle) { | ||
return std::make_shared<ShadowNode>(reactTag, viewName, rootTag, props, instanceHandle); | ||
} | ||
|
||
ShadowNodeRef FabricUIManager::cloneNode(const ShadowNodeRef &node) { | ||
return nullptr; | ||
} | ||
|
||
ShadowNodeRef FabricUIManager::cloneNodeWithNewChildren(const ShadowNodeRef &node) { | ||
return nullptr; | ||
} | ||
|
||
ShadowNodeRef FabricUIManager::cloneNodeWithNewProps(const ShadowNodeRef &node, folly::dynamic props) { | ||
return nullptr; | ||
} | ||
|
||
ShadowNodeRef FabricUIManager::cloneNodeWithNewChildrenAndProps(const ShadowNodeRef &node, folly::dynamic newProps) { | ||
return nullptr; | ||
} | ||
|
||
void FabricUIManager::appendChild(const ShadowNodeRef &parentNode, const ShadowNodeRef &childNode) { | ||
} | ||
|
||
ShadowNodeSetRef FabricUIManager::createChildSet(int rootTag) { | ||
return nullptr; | ||
} | ||
|
||
void FabricUIManager::appendChildToSet(const ShadowNodeSetRef &childSet, const ShadowNodeRef &childNode) { | ||
} | ||
|
||
void FabricUIManager::completeRoot(int rootTag) { | ||
} | ||
|
||
}} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
#pragma once | ||
|
||
#include <folly/dynamic.h> | ||
#include <folly/FBVector.h> | ||
#include <memory> | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
class ShadowNode; | ||
|
||
typedef std::shared_ptr<const ShadowNode> ShadowNodeRef; | ||
typedef folly::fbvector<const ShadowNodeRef> ShadowNodeSet; | ||
typedef std::shared_ptr<const ShadowNodeSet> ShadowNodeSetRef; | ||
|
||
class FabricUIManager { | ||
public: | ||
FabricUIManager(); | ||
|
||
ShadowNodeRef createNode(int reactTag, std::string viewName, int rootTag, folly::dynamic props, void *instanceHandle); | ||
ShadowNodeRef cloneNode(const ShadowNodeRef &node); | ||
ShadowNodeRef cloneNodeWithNewChildren(const ShadowNodeRef &node); | ||
ShadowNodeRef cloneNodeWithNewProps(const ShadowNodeRef &node, folly::dynamic props); | ||
ShadowNodeRef cloneNodeWithNewChildrenAndProps(const ShadowNodeRef &node, folly::dynamic newProps); | ||
void appendChild(const ShadowNodeRef &parentNode, const ShadowNodeRef &childNode); | ||
ShadowNodeSetRef createChildSet(int rootTag); | ||
void appendChildToSet(const ShadowNodeSetRef &childSet, const ShadowNodeRef &childNode); | ||
void completeRoot(int rootTag); | ||
}; | ||
|
||
}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
#include "ShadowNode.h" | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
ShadowNode::ShadowNode(int reactTag, std::string viewName, int rootTag, folly::dynamic props, void *instanceHandle) : | ||
reactTag_(reactTag), | ||
viewName_(viewName), | ||
rootTag_(rootTag), | ||
props_(props), | ||
instanceHandle_(instanceHandle) {} | ||
|
||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
#pragma once | ||
|
||
#include <folly/dynamic.h> | ||
#include <memory> | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
class ShadowNode { | ||
public: | ||
int reactTag_; | ||
std::string viewName_; | ||
int rootTag_; | ||
folly::dynamic props_; | ||
void *instanceHandle_; | ||
|
||
ShadowNode(int reactTag, std::string viewName, int rootTag, folly::dynamic props, void *instanceHandle); | ||
}; | ||
|
||
}} |