Revert D4386906: [YogaKit] Improved the objective-c and swift api

Differential Revision: D4386906

fbshipit-source-id: adac0d8e71ce9f3442f3bfd14b5157f88367c998
This commit is contained in:
Ben Holcomb 2017-01-07 10:23:02 -08:00 committed by Facebook Github Bot
parent e0cb6dff76
commit 23819dd8b5
2 changed files with 28 additions and 44 deletions

View File

@ -14,29 +14,29 @@
YG_EXTERN_C_BEGIN YG_EXTERN_C_BEGIN
#define YGFlexDirectionCount 4 #define YGFlexDirectionCount 4
typedef YG_ENUM_BEGIN(YGFlexDirection) { typedef enum YGFlexDirection {
YGFlexDirectionColumn, YGFlexDirectionColumn,
YGFlexDirectionColumnReverse, YGFlexDirectionColumnReverse,
YGFlexDirectionRow, YGFlexDirectionRow,
YGFlexDirectionRowReverse, YGFlexDirectionRowReverse,
} YG_ENUM_END(YGFlexDirection); } YGFlexDirection;
#define YGMeasureModeCount 3 #define YGMeasureModeCount 3
typedef YG_ENUM_BEGIN(YGMeasureMode) { typedef enum YGMeasureMode {
YGMeasureModeUndefined, YGMeasureModeUndefined,
YGMeasureModeExactly, YGMeasureModeExactly,
YGMeasureModeAtMost, YGMeasureModeAtMost,
} YG_ENUM_END(YGMeasureMode); } YGMeasureMode;
#define YGPrintOptionsCount 3 #define YGPrintOptionsCount 3
typedef YG_ENUM_BEGIN(YGPrintOptions) { typedef enum YGPrintOptions {
YGPrintOptionsLayout = 1, YGPrintOptionsLayout = 1,
YGPrintOptionsStyle = 2, YGPrintOptionsStyle = 2,
YGPrintOptionsChildren = 4, YGPrintOptionsChildren = 4,
} YG_ENUM_END(YGPrintOptions); } YGPrintOptions;
#define YGEdgeCount 9 #define YGEdgeCount 9
typedef YG_ENUM_BEGIN(YGEdge) { typedef enum YGEdge {
YGEdgeLeft, YGEdgeLeft,
YGEdgeTop, YGEdgeTop,
YGEdgeRight, YGEdgeRight,
@ -46,79 +46,79 @@ typedef YG_ENUM_BEGIN(YGEdge) {
YGEdgeHorizontal, YGEdgeHorizontal,
YGEdgeVertical, YGEdgeVertical,
YGEdgeAll, YGEdgeAll,
} YG_ENUM_END(YGEdge); } YGEdge;
#define YGPositionTypeCount 2 #define YGPositionTypeCount 2
typedef YG_ENUM_BEGIN(YGPositionType) { typedef enum YGPositionType {
YGPositionTypeRelative, YGPositionTypeRelative,
YGPositionTypeAbsolute, YGPositionTypeAbsolute,
} YG_ENUM_END(YGPositionType); } YGPositionType;
#define YGDimensionCount 2 #define YGDimensionCount 2
typedef YG_ENUM_BEGIN(YGDimension) { typedef enum YGDimension {
YGDimensionWidth, YGDimensionWidth,
YGDimensionHeight, YGDimensionHeight,
} YG_ENUM_END(YGDimension); } YGDimension;
#define YGJustifyCount 5 #define YGJustifyCount 5
typedef YG_ENUM_BEGIN(YGJustify) { typedef enum YGJustify {
YGJustifyFlexStart, YGJustifyFlexStart,
YGJustifyCenter, YGJustifyCenter,
YGJustifyFlexEnd, YGJustifyFlexEnd,
YGJustifySpaceBetween, YGJustifySpaceBetween,
YGJustifySpaceAround, YGJustifySpaceAround,
} YG_ENUM_END(YGJustify); } YGJustify;
#define YGDirectionCount 3 #define YGDirectionCount 3
typedef YG_ENUM_BEGIN(YGDirection) { typedef enum YGDirection {
YGDirectionInherit, YGDirectionInherit,
YGDirectionLTR, YGDirectionLTR,
YGDirectionRTL, YGDirectionRTL,
} YG_ENUM_END(YGDirection); } YGDirection;
#define YGLogLevelCount 5 #define YGLogLevelCount 5
typedef YG_ENUM_BEGIN(YGLogLevel) { typedef enum YGLogLevel {
YGLogLevelError, YGLogLevelError,
YGLogLevelWarn, YGLogLevelWarn,
YGLogLevelInfo, YGLogLevelInfo,
YGLogLevelDebug, YGLogLevelDebug,
YGLogLevelVerbose, YGLogLevelVerbose,
} YG_ENUM_END(YGLogLevel); } YGLogLevel;
#define YGWrapCount 2 #define YGWrapCount 2
typedef YG_ENUM_BEGIN(YGWrap) { typedef enum YGWrap {
YGWrapNoWrap, YGWrapNoWrap,
YGWrapWrap, YGWrapWrap,
} YG_ENUM_END(YGWrap); } YGWrap;
#define YGOverflowCount 3 #define YGOverflowCount 3
typedef YG_ENUM_BEGIN(YGOverflow) { typedef enum YGOverflow {
YGOverflowVisible, YGOverflowVisible,
YGOverflowHidden, YGOverflowHidden,
YGOverflowScroll, YGOverflowScroll,
} YG_ENUM_END(YGOverflow); } YGOverflow;
#define YGExperimentalFeatureCount 2 #define YGExperimentalFeatureCount 2
typedef YG_ENUM_BEGIN(YGExperimentalFeature) { typedef enum YGExperimentalFeature {
YGExperimentalFeatureRounding, YGExperimentalFeatureRounding,
YGExperimentalFeatureWebFlexBasis, YGExperimentalFeatureWebFlexBasis,
} YG_ENUM_END(YGExperimentalFeature); } YGExperimentalFeature;
#define YGAlignCount 6 #define YGAlignCount 6
typedef YG_ENUM_BEGIN(YGAlign) { typedef enum YGAlign {
YGAlignAuto, YGAlignAuto,
YGAlignFlexStart, YGAlignFlexStart,
YGAlignCenter, YGAlignCenter,
YGAlignFlexEnd, YGAlignFlexEnd,
YGAlignStretch, YGAlignStretch,
YGAlignBaseline, YGAlignBaseline,
} YG_ENUM_END(YGAlign); } YGAlign;
#define YGUnitCount 3 #define YGUnitCount 3
typedef YG_ENUM_BEGIN(YGUnit) { typedef enum YGUnit {
YGUnitUndefined, YGUnitUndefined,
YGUnitPixel, YGUnitPixel,
YGUnitPercent, YGUnitPercent,
} YG_ENUM_END(YGUnit); } YGUnit;
YG_EXTERN_C_END YG_EXTERN_C_END

View File

@ -40,19 +40,3 @@
YG_ABORT(); \ YG_ABORT(); \
} }
#endif #endif
#ifndef YG_ENUM_BEGIN
#ifndef NS_ENUM
#define YG_ENUM_BEGIN(name) enum name
#else
#define YG_ENUM_BEGIN(name) NS_ENUM(NSInteger, name)
#endif
#endif
#ifndef YG_ENUM_END
#ifndef NS_ENUM
#define YG_ENUM_END(name) name
#else
#define YG_ENUM_END(name)
#endif
#endif