|
| 1 | +/** |
| 2 | + * Copyright (c) Facebook, Inc. and its affiliates. |
| 3 | + * |
| 4 | + * This source code is licensed under the MIT license found in the LICENSE |
| 5 | + * file in the root directory of this source tree. |
| 6 | + */ |
| 7 | +package com.facebook.yoga; |
| 8 | + |
| 9 | +import com.facebook.proguard.annotations.DoNotStrip; |
| 10 | +import com.facebook.soloader.SoLoader; |
| 11 | + |
| 12 | +@DoNotStrip |
| 13 | +public class YogaNative { |
| 14 | + static { |
| 15 | + SoLoader.loadLibrary("yoga"); |
| 16 | + } |
| 17 | + |
| 18 | + // YGConfig related |
| 19 | + static native long jni_YGConfigNew(); |
| 20 | + static native void jni_YGConfigFree(long nativePointer); |
| 21 | + static native void jni_YGConfigSetExperimentalFeatureEnabled(long nativePointer, int feature, boolean enabled); |
| 22 | + static native void jni_YGConfigSetUseWebDefaults(long nativePointer, boolean useWebDefaults); |
| 23 | + static native void jni_YGConfigSetPrintTreeFlag(long nativePointer, boolean enable); |
| 24 | + static native void jni_YGConfigSetPointScaleFactor(long nativePointer, float pixelsInPoint); |
| 25 | + static native void jni_YGConfigSetUseLegacyStretchBehaviour(long nativePointer, boolean useLegacyStretchBehaviour); |
| 26 | + static native void jni_YGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour(long nativePointer, boolean shouldDiffLayoutWithoutLegacyStretchBehaviour); |
| 27 | + static native void jni_YGConfigSetLogger(long nativePointer, Object logger); |
| 28 | + |
| 29 | + |
| 30 | + // YGNode related |
| 31 | + static native int jni_YGNodeGetInstanceCount(); |
| 32 | + static native long jni_YGNodeNew(); |
| 33 | + static native long jni_YGNodeNewWithConfig(long configPointer); |
| 34 | + static native void jni_YGNodeFree(long nativePointer); |
| 35 | + static native void jni_YGNodeReset(long nativePointer); |
| 36 | + static native void jni_YGNodeInsertChild(long nativePointer, long childPointer, int index); |
| 37 | + static native void jni_YGNodeSetIsReferenceBaseline(long nativePointer, boolean isReferenceBaseline); |
| 38 | + static native boolean jni_YGNodeIsReferenceBaseline(long nativePointer); |
| 39 | + static native void jni_YGNodeClearChildren(long nativePointer); |
| 40 | + static native void jni_YGNodeRemoveChild(long nativePointer, long childPointer); |
| 41 | + static native void jni_YGNodeCalculateLayout(long nativePointer, float width, float height, long[] nativePointers, YogaNodeJNIBase[] nodes); |
| 42 | + static native void jni_YGNodeMarkDirty(long nativePointer); |
| 43 | + static native void jni_YGNodeMarkDirtyAndPropogateToDescendants(long nativePointer); |
| 44 | + static native boolean jni_YGNodeIsDirty(long nativePointer); |
| 45 | + static native void jni_YGNodeCopyStyle(long dstNativePointer, long srcNativePointer); |
| 46 | + static native int jni_YGNodeStyleGetDirection(long nativePointer); |
| 47 | + static native void jni_YGNodeStyleSetDirection(long nativePointer, int direction); |
| 48 | + static native int jni_YGNodeStyleGetFlexDirection(long nativePointer); |
| 49 | + static native void jni_YGNodeStyleSetFlexDirection(long nativePointer, int flexDirection); |
| 50 | + static native int jni_YGNodeStyleGetJustifyContent(long nativePointer); |
| 51 | + static native void jni_YGNodeStyleSetJustifyContent(long nativePointer, int justifyContent); |
| 52 | + static native int jni_YGNodeStyleGetAlignItems(long nativePointer); |
| 53 | + static native void jni_YGNodeStyleSetAlignItems(long nativePointer, int alignItems); |
| 54 | + static native int jni_YGNodeStyleGetAlignSelf(long nativePointer); |
| 55 | + static native void jni_YGNodeStyleSetAlignSelf(long nativePointer, int alignSelf); |
| 56 | + static native int jni_YGNodeStyleGetAlignContent(long nativePointer); |
| 57 | + static native void jni_YGNodeStyleSetAlignContent(long nativePointer, int alignContent); |
| 58 | + static native int jni_YGNodeStyleGetPositionType(long nativePointer); |
| 59 | + static native void jni_YGNodeStyleSetPositionType(long nativePointer, int positionType); |
| 60 | + static native int jni_YGNodeStyleGetFlexWrap(long nativePointer); |
| 61 | + static native void jni_YGNodeStyleSetFlexWrap(long nativePointer, int wrapType); |
| 62 | + static native int jni_YGNodeStyleGetOverflow(long nativePointer); |
| 63 | + static native void jni_YGNodeStyleSetOverflow(long nativePointer, int overflow); |
| 64 | + static native int jni_YGNodeStyleGetDisplay(long nativePointer); |
| 65 | + static native void jni_YGNodeStyleSetDisplay(long nativePointer, int display); |
| 66 | + static native float jni_YGNodeStyleGetFlex(long nativePointer); |
| 67 | + static native void jni_YGNodeStyleSetFlex(long nativePointer, float flex); |
| 68 | + static native float jni_YGNodeStyleGetFlexGrow(long nativePointer); |
| 69 | + static native void jni_YGNodeStyleSetFlexGrow(long nativePointer, float flexGrow); |
| 70 | + static native float jni_YGNodeStyleGetFlexShrink(long nativePointer); |
| 71 | + static native void jni_YGNodeStyleSetFlexShrink(long nativePointer, float flexShrink); |
| 72 | + static native Object jni_YGNodeStyleGetFlexBasis(long nativePointer); |
| 73 | + static native void jni_YGNodeStyleSetFlexBasis(long nativePointer, float flexBasis); |
| 74 | + static native void jni_YGNodeStyleSetFlexBasisPercent(long nativePointer, float percent); |
| 75 | + static native void jni_YGNodeStyleSetFlexBasisAuto(long nativePointer); |
| 76 | + static native Object jni_YGNodeStyleGetMargin(long nativePointer, int edge); |
| 77 | + static native void jni_YGNodeStyleSetMargin(long nativePointer, int edge, float margin); |
| 78 | + static native void jni_YGNodeStyleSetMarginPercent(long nativePointer, int edge, float percent); |
| 79 | + static native void jni_YGNodeStyleSetMarginAuto(long nativePointer, int edge); |
| 80 | + static native Object jni_YGNodeStyleGetPadding(long nativePointer, int edge); |
| 81 | + static native void jni_YGNodeStyleSetPadding(long nativePointer, int edge, float padding); |
| 82 | + static native void jni_YGNodeStyleSetPaddingPercent(long nativePointer, int edge, float percent); |
| 83 | + static native float jni_YGNodeStyleGetBorder(long nativePointer, int edge); |
| 84 | + static native void jni_YGNodeStyleSetBorder(long nativePointer, int edge, float border); |
| 85 | + static native Object jni_YGNodeStyleGetPosition(long nativePointer, int edge); |
| 86 | + static native void jni_YGNodeStyleSetPosition(long nativePointer, int edge, float position); |
| 87 | + static native void jni_YGNodeStyleSetPositionPercent(long nativePointer, int edge, float percent); |
| 88 | + static native Object jni_YGNodeStyleGetWidth(long nativePointer); |
| 89 | + static native void jni_YGNodeStyleSetWidth(long nativePointer, float width); |
| 90 | + static native void jni_YGNodeStyleSetWidthPercent(long nativePointer, float percent); |
| 91 | + static native void jni_YGNodeStyleSetWidthAuto(long nativePointer); |
| 92 | + static native Object jni_YGNodeStyleGetHeight(long nativePointer); |
| 93 | + static native void jni_YGNodeStyleSetHeight(long nativePointer, float height); |
| 94 | + static native void jni_YGNodeStyleSetHeightPercent(long nativePointer, float percent); |
| 95 | + static native void jni_YGNodeStyleSetHeightAuto(long nativePointer); |
| 96 | + static native Object jni_YGNodeStyleGetMinWidth(long nativePointer); |
| 97 | + static native void jni_YGNodeStyleSetMinWidth(long nativePointer, float minWidth); |
| 98 | + static native void jni_YGNodeStyleSetMinWidthPercent(long nativePointer, float percent); |
| 99 | + static native Object jni_YGNodeStyleGetMinHeight(long nativePointer); |
| 100 | + static native void jni_YGNodeStyleSetMinHeight(long nativePointer, float minHeight); |
| 101 | + static native void jni_YGNodeStyleSetMinHeightPercent(long nativePointer, float percent); |
| 102 | + static native Object jni_YGNodeStyleGetMaxWidth(long nativePointer); |
| 103 | + static native void jni_YGNodeStyleSetMaxWidth(long nativePointer, float maxWidth); |
| 104 | + static native void jni_YGNodeStyleSetMaxWidthPercent(long nativePointer, float percent); |
| 105 | + static native Object jni_YGNodeStyleGetMaxHeight(long nativePointer); |
| 106 | + static native void jni_YGNodeStyleSetMaxHeight(long nativePointer, float maxheight); |
| 107 | + static native void jni_YGNodeStyleSetMaxHeightPercent(long nativePointer, float percent); |
| 108 | + static native float jni_YGNodeStyleGetAspectRatio(long nativePointer); |
| 109 | + static native void jni_YGNodeStyleSetAspectRatio(long nativePointer, float aspectRatio); |
| 110 | + static native void jni_YGNodeSetHasMeasureFunc(long nativePointer, boolean hasMeasureFunc); |
| 111 | + static native void jni_YGNodeSetHasBaselineFunc(long nativePointer, boolean hasMeasureFunc); |
| 112 | + static native void jni_YGNodePrint(long nativePointer); |
| 113 | + static native void jni_YGNodeSetStyleInputs(long nativePointer, float[] styleInputsArray, int size); |
| 114 | +} |
0 commit comments