Summary: Keeping enums in sync between all the different bindings is tedious and error prone. Getting one of the values in the incorrect order could lead to many hours of debugging as they are passed as ints to C. This diff adds a simple python script to generate these enums for all languages. This also makes it much easier to add support for more languages in the future Reviewed By: gkassabli Differential Revision: D4174263 fbshipit-source-id: 478961a8f683e196704d3c6ea1505a05c85fcb10
77 lines
2.0 KiB
Java
77 lines
2.0 KiB
Java
/**
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
package com.facebook.csslayout;
|
|
|
|
import java.util.Arrays;
|
|
|
|
/**
|
|
* The CSS style definition for a {@link CSSNodeDEPRECATED}.
|
|
*/
|
|
public class CSSStyle {
|
|
|
|
public CSSDirection direction;
|
|
public CSSFlexDirection flexDirection;
|
|
public CSSJustify justifyContent;
|
|
public CSSAlign alignContent;
|
|
public CSSAlign alignItems;
|
|
public CSSAlign alignSelf;
|
|
public CSSPositionType positionType;
|
|
public CSSWrap flexWrap;
|
|
public CSSOverflow overflow;
|
|
public float flexGrow;
|
|
public float flexShrink;
|
|
public float flexBasis;
|
|
|
|
public Spacing margin = new Spacing();
|
|
public Spacing padding = new Spacing();
|
|
public Spacing border = new Spacing();
|
|
public Spacing position = new Spacing(CSSConstants.UNDEFINED);
|
|
|
|
public float[] dimensions = new float[2];
|
|
|
|
public float minWidth = CSSConstants.UNDEFINED;
|
|
public float minHeight = CSSConstants.UNDEFINED;
|
|
|
|
public float maxWidth = CSSConstants.UNDEFINED;
|
|
public float maxHeight = CSSConstants.UNDEFINED;
|
|
|
|
CSSStyle() {
|
|
reset();
|
|
}
|
|
|
|
void reset() {
|
|
direction = CSSDirection.INHERIT;
|
|
flexDirection = CSSFlexDirection.COLUMN;
|
|
justifyContent = CSSJustify.FLEX_START;
|
|
alignContent = CSSAlign.FLEX_START;
|
|
alignItems = CSSAlign.STRETCH;
|
|
alignSelf = CSSAlign.AUTO;
|
|
positionType = CSSPositionType.RELATIVE;
|
|
flexWrap = CSSWrap.NO_WRAP;
|
|
overflow = CSSOverflow.VISIBLE;
|
|
flexGrow = 0;
|
|
flexShrink = 0;
|
|
flexBasis = CSSConstants.UNDEFINED;
|
|
|
|
margin.reset();
|
|
padding.reset();
|
|
border.reset();
|
|
position.reset();
|
|
|
|
Arrays.fill(dimensions, CSSConstants.UNDEFINED);
|
|
|
|
minWidth = CSSConstants.UNDEFINED;
|
|
minHeight = CSSConstants.UNDEFINED;
|
|
|
|
maxWidth = CSSConstants.UNDEFINED;
|
|
maxHeight = CSSConstants.UNDEFINED;
|
|
}
|
|
}
|