improved the objective-c and swift api
This commit is contained in:
121
yoga/YGEnums.h
121
yoga/YGEnums.h
@@ -14,28 +14,54 @@
|
||||
YG_EXTERN_C_BEGIN
|
||||
|
||||
#define YGFlexDirectionCount 4
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGFlexDirection {
|
||||
YGFlexDirectionColumn,
|
||||
YGFlexDirectionColumnReverse,
|
||||
YGFlexDirectionRow,
|
||||
YGFlexDirectionRowReverse,
|
||||
} YGFlexDirection;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGFlexDirection) {
|
||||
YGFlexDirectionColumn,
|
||||
YGFlexDirectionColumnReverse,
|
||||
YGFlexDirectionRow,
|
||||
YGFlexDirectionRowReverse,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGMeasureModeCount 3
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGMeasureMode {
|
||||
YGMeasureModeUndefined,
|
||||
YGMeasureModeExactly,
|
||||
YGMeasureModeAtMost,
|
||||
} YGMeasureMode;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGMeasureMode) {
|
||||
YGMeasureModeUndefined,
|
||||
YGMeasureModeExactly,
|
||||
YGMeasureModeAtMost,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGPrintOptionsCount 3
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGPrintOptions {
|
||||
YGPrintOptionsLayout = 1,
|
||||
YGPrintOptionsStyle = 2,
|
||||
YGPrintOptionsChildren = 4,
|
||||
} YGPrintOptions;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGPrintOptions) {
|
||||
YGPrintOptionsLayout = 1,
|
||||
YGPrintOptionsStyle = 2,
|
||||
YGPrintOptionsChildren = 4,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGEdgeCount 9
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGEdge {
|
||||
YGEdgeLeft,
|
||||
YGEdgeTop,
|
||||
@@ -47,20 +73,48 @@ typedef enum YGEdge {
|
||||
YGEdgeVertical,
|
||||
YGEdgeAll,
|
||||
} YGEdge;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGEdge) {
|
||||
YGEdgeLeft,
|
||||
YGEdgeTop,
|
||||
YGEdgeRight,
|
||||
YGEdgeBottom,
|
||||
YGEdgeStart,
|
||||
YGEdgeEnd,
|
||||
YGEdgeHorizontal,
|
||||
YGEdgeVertical,
|
||||
YGEdgeAll,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGPositionTypeCount 2
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGPositionType {
|
||||
YGPositionTypeRelative,
|
||||
YGPositionTypeAbsolute,
|
||||
} YGPositionType;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGPositionType) {
|
||||
YGPositionTypeRelative,
|
||||
YGPositionTypeAbsolute,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGDimensionCount 2
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGDimension {
|
||||
YGDimensionWidth,
|
||||
YGDimensionHeight,
|
||||
} YGDimension;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGDimension) {
|
||||
YGDimensionWidth,
|
||||
YGDimensionHeight,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGJustifyCount 5
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGJustify {
|
||||
YGJustifyFlexStart,
|
||||
YGJustifyCenter,
|
||||
@@ -68,15 +122,33 @@ typedef enum YGJustify {
|
||||
YGJustifySpaceBetween,
|
||||
YGJustifySpaceAround,
|
||||
} YGJustify;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGJustify) {
|
||||
YGJustifyFlexStart,
|
||||
YGJustifyCenter,
|
||||
YGJustifyFlexEnd,
|
||||
YGJustifySpaceBetween,
|
||||
YGJustifySpaceAround,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGDirectionCount 3
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGDirection {
|
||||
YGDirectionInherit,
|
||||
YGDirectionLTR,
|
||||
YGDirectionRTL,
|
||||
} YGDirection;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGDirection) {
|
||||
YGDirectionInherit,
|
||||
YGDirectionLTR,
|
||||
YGDirectionRTL,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGLogLevelCount 5
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGLogLevel {
|
||||
YGLogLevelError,
|
||||
YGLogLevelWarn,
|
||||
@@ -84,27 +156,59 @@ typedef enum YGLogLevel {
|
||||
YGLogLevelDebug,
|
||||
YGLogLevelVerbose,
|
||||
} YGLogLevel;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGLogLevel) {
|
||||
YGLogLevelError,
|
||||
YGLogLevelWarn,
|
||||
YGLogLevelInfo,
|
||||
YGLogLevelDebug,
|
||||
YGLogLevelVerbose,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGWrapCount 2
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGWrap {
|
||||
YGWrapNoWrap,
|
||||
YGWrapWrap,
|
||||
} YGWrap;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGWrap) {
|
||||
YGWrapNoWrap,
|
||||
YGWrapWrap,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGOverflowCount 3
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGOverflow {
|
||||
YGOverflowVisible,
|
||||
YGOverflowHidden,
|
||||
YGOverflowScroll,
|
||||
} YGOverflow;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGOverflow) {
|
||||
YGOverflowVisible,
|
||||
YGOverflowHidden,
|
||||
YGOverflowScroll,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGExperimentalFeatureCount 2
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGExperimentalFeature {
|
||||
YGExperimentalFeatureRounding,
|
||||
YGExperimentalFeatureWebFlexBasis,
|
||||
} YGExperimentalFeature;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGExperimentalFeature) {
|
||||
YGExperimentalFeatureRounding,
|
||||
YGExperimentalFeatureWebFlexBasis,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGAlignCount 5
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGAlign {
|
||||
YGAlignAuto,
|
||||
YGAlignFlexStart,
|
||||
@@ -112,12 +216,29 @@ typedef enum YGAlign {
|
||||
YGAlignFlexEnd,
|
||||
YGAlignStretch,
|
||||
} YGAlign;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGAlign) {
|
||||
YGAlignAuto,
|
||||
YGAlignFlexStart,
|
||||
YGAlignCenter,
|
||||
YGAlignFlexEnd,
|
||||
YGAlignStretch,
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YGUnitCount 3
|
||||
#ifndef NS_ENUM
|
||||
typedef enum YGUnit {
|
||||
YGUnitUndefined,
|
||||
YGUnitPixel,
|
||||
YGUnitPercent,
|
||||
} YGUnit;
|
||||
#else
|
||||
typedef NS_ENUM(NSInteger, YGUnit) {
|
||||
YGUnitUndefined,
|
||||
YGUnitPixel,
|
||||
YGUnitPercent,
|
||||
};
|
||||
#endif
|
||||
|
||||
YG_EXTERN_C_END
|
||||
|
Reference in New Issue
Block a user