Breaking: Fix callback const-correctness (#1369)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1369 X-link: https://github.com/facebook/react-native/pull/39370 This fixes const-correctness of callbacks (e.g. not letting a logger function modify nodes during layout). This helps us to continue to fix const-correctness issues inside of Yoga. This change is breaking to the public API, since it requires a change in signature passed to Yoga. Changelog: [Internal] Reviewed By: rshest Differential Revision: D49130714 fbshipit-source-id: 4305f8882d89f296e45b78497a51716a0dbb3b2d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b12a6a340c
commit
26f2b28eca
22
yoga/Yoga.h
22
yoga/Yoga.h
@@ -29,28 +29,30 @@ typedef struct YGNode* YGNodeRef;
|
||||
typedef const struct YGNode* YGNodeConstRef;
|
||||
|
||||
typedef YGSize (*YGMeasureFunc)(
|
||||
YGNodeRef node,
|
||||
YGNodeConstRef node,
|
||||
float width,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
YGMeasureMode heightMode);
|
||||
typedef float (*YGBaselineFunc)(YGNodeRef node, float width, float height);
|
||||
typedef void (*YGDirtiedFunc)(YGNodeRef node);
|
||||
typedef void (*YGPrintFunc)(YGNodeRef node);
|
||||
typedef void (*YGNodeCleanupFunc)(YGNodeRef node);
|
||||
typedef float (*YGBaselineFunc)(YGNodeConstRef node, float width, float height);
|
||||
typedef void (*YGDirtiedFunc)(YGNodeConstRef node);
|
||||
typedef void (*YGPrintFunc)(YGNodeConstRef node);
|
||||
typedef void (*YGNodeCleanupFunc)(YGNodeConstRef node);
|
||||
typedef int (*YGLogger)(
|
||||
YGConfigRef config,
|
||||
YGNodeRef node,
|
||||
YGConfigConstRef config,
|
||||
YGNodeConstRef node,
|
||||
YGLogLevel level,
|
||||
const char* format,
|
||||
va_list args);
|
||||
typedef YGNodeRef (
|
||||
*YGCloneNodeFunc)(YGNodeRef oldNode, YGNodeRef owner, int childIndex);
|
||||
typedef YGNodeRef (*YGCloneNodeFunc)(
|
||||
YGNodeConstRef oldNode,
|
||||
YGNodeConstRef owner,
|
||||
int childIndex);
|
||||
|
||||
// YGNode
|
||||
WIN_EXPORT YGNodeRef YGNodeNew(void);
|
||||
WIN_EXPORT YGNodeRef YGNodeNewWithConfig(YGConfigRef config);
|
||||
WIN_EXPORT YGNodeRef YGNodeClone(YGNodeRef node);
|
||||
WIN_EXPORT YGNodeRef YGNodeClone(YGNodeConstRef node);
|
||||
WIN_EXPORT void YGNodeFree(YGNodeRef node);
|
||||
WIN_EXPORT void YGNodeFreeRecursiveWithCleanupFunc(
|
||||
YGNodeRef node,
|
||||
|
Reference in New Issue
Block a user