From 390fade8c01bdf9f6181cf4eb81752e204aa5535 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Tue, 29 Jan 2019 03:48:31 -0800 Subject: [PATCH] Add function to set marker callbacks 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 --- yoga/YGMarker.cpp | 14 ++++++++++++++ yoga/YGMarker.h | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 yoga/YGMarker.cpp diff --git a/yoga/YGMarker.cpp b/yoga/YGMarker.cpp new file mode 100644 index 00000000..21a8d1f6 --- /dev/null +++ b/yoga/YGMarker.cpp @@ -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; +} diff --git a/yoga/YGMarker.h b/yoga/YGMarker.h index b7904ef1..28fc3fff 100644 --- a/yoga/YGMarker.h +++ b/yoga/YGMarker.h @@ -11,6 +11,7 @@ YG_EXTERN_C_BEGIN typedef struct YGNode* YGNodeRef; +typedef struct YGConfig* YGConfigRef; typedef YG_ENUM_BEGIN(YGMarker){ YGMarkerLayout, @@ -33,4 +34,6 @@ typedef struct { void (*endMarker)(YGMarker, YGNodeRef, YGMarkerData, void* id); } YGMarkerCallbacks; +void YGConfigSetMarkerCallbacks(YGConfigRef, YGMarkerCallbacks); + YG_EXTERN_C_END