Skip to content

Commit

Permalink
Add function to set marker callbacks
Browse files Browse the repository at this point in the history
Summary:
@public

Adds a function to allow to configure markers. The function is declared in `YGMarker.h`

Reviewed By: SidharthGuglani

Differential Revision: D13819111

fbshipit-source-id: f9158b3d4e5727da4e151c84b523c7c7e8158620
  • Loading branch information
davidaurelio authored and facebook-github-bot committed Jan 29, 2019
1 parent 1db5580 commit 43601f1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions React/React.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,9 @@
A2440AA21DF8D854006E7BFC /* RCTReloadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; };
A2440AA31DF8D854006E7BFC /* RCTReloadCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = A2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */; };
A2440AA41DF8D865006E7BFC /* RCTReloadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; };
AC4A6AF921FB4EA900FBEC39 /* YGMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */; };
AC4A6AFA21FB4EBF00FBEC39 /* YGMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */; };
AC4A6AFB21FB4ECA00FBEC39 /* YGMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */; };
AC6B69E321B1467C00B2B68A /* YGValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC6B69E121B1467C00B2B68A /* YGValue.cpp */; };
AC6B69E421B1467C00B2B68A /* YGValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6B69E221B1467C00B2B68A /* YGValue.h */; };
AC6B69E521B1469A00B2B68A /* YGValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6B69E221B1467C00B2B68A /* YGValue.h */; };
Expand Down Expand Up @@ -2232,6 +2235,7 @@
91076A881F743AB00081B4FA /* RCTModalManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTModalManager.h; sourceTree = "<group>"; };
A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTReloadCommand.h; sourceTree = "<group>"; };
A2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTReloadCommand.m; sourceTree = "<group>"; };
AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGMarker.cpp; sourceTree = "<group>"; };
AC6B69E121B1467C00B2B68A /* YGValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGValue.cpp; sourceTree = "<group>"; };
AC6B69E221B1467C00B2B68A /* YGValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGValue.h; sourceTree = "<group>"; };
AC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJavaScriptLoader.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2360,6 +2364,7 @@
130A77021DF767AF001F9587 /* yoga */ = {
isa = PBXGroup;
children = (
AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */,
AC90463D21C91CC2005B24B3 /* CompactValue.h */,
AC6B69E121B1467C00B2B68A /* YGValue.cpp */,
AC6B69E221B1467C00B2B68A /* YGValue.h */,
Expand Down Expand Up @@ -4391,6 +4396,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AC4A6AFA21FB4EBF00FBEC39 /* YGMarker.cpp in Sources */,
AC6B69E721B146B400B2B68A /* YGValue.cpp in Sources */,
AC8360D121B025BC00FC46B9 /* YGConfig.cpp in Sources */,
53D123A01FBF1EFF001B8A10 /* Yoga.cpp in Sources */,
Expand All @@ -4407,6 +4413,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AC4A6AFB21FB4ECA00FBEC39 /* YGMarker.cpp in Sources */,
AC6B69EA21B146E700B2B68A /* YGValue.cpp in Sources */,
BA0501B02109DD1800A6BBC4 /* YGConfig.cpp in Sources */,
53D123A11FBF1EFF001B8A10 /* Yoga.cpp in Sources */,
Expand Down Expand Up @@ -4475,6 +4482,7 @@
352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */,
66CD94B71F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */,
008341F61D1DB34400876D9A /* RCTJSStackFrame.m in Sources */,
AC4A6AF921FB4EA900FBEC39 /* YGMarker.cpp in Sources */,
13134C961E296B2A00B9F3CB /* RCTObjcExecutor.mm in Sources */,
59D031FB1F8353D3008361F0 /* RCTSafeAreaViewManager.m in Sources */,
83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */,
Expand Down
14 changes: 14 additions & 0 deletions ReactCommon/yoga/yoga/YGMarker.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*/
#include "YGMarker.h"
#include "YGConfig.h"

void YGConfigSetMarkerCallbacks(
YGConfigRef config,
YGMarkerCallbacks markerCallbacks) {
config->markerCallbacks = markerCallbacks;
}
3 changes: 3 additions & 0 deletions ReactCommon/yoga/yoga/YGMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
YG_EXTERN_C_BEGIN

typedef struct YGNode* YGNodeRef;
typedef struct YGConfig* YGConfigRef;

typedef YG_ENUM_BEGIN(YGMarker){
YGMarkerLayout,
Expand All @@ -33,4 +34,6 @@ typedef struct {
void (*endMarker)(YGMarker, YGNodeRef, YGMarkerData, void* id);
} YGMarkerCallbacks;

void YGConfigSetMarkerCallbacks(YGConfigRef, YGMarkerCallbacks);

YG_EXTERN_C_END

0 comments on commit 43601f1

Please sign in to comment.