yoga 0.0.0.3 → 0.0.0.4
raw patch · 2 files changed
+51/−3 lines, 2 files
Files
- yoga.cabal +4/−3
- yoga/YGStyle.h +47/−0
yoga.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/ name: yoga-version: 0.0.0.3+version: 0.0.0.4 synopsis: Bindings to Facebook's Yoga layout library description: The <https://facebook.github.com/yoga Yoga> library from <https://facebook.github.com/ Facebook> is a fast layout engine@@ -48,12 +48,13 @@ install-includes: YGEnums.h YGMacros.h YGNodePrint.h- Yoga.h- Yoga-internal.h YGConfig.h YGFloatOptional.h YGLayout.h YGNode.h+ YGStyle.h+ Yoga.h+ Yoga-internal.h Utils.h c-sources: yoga/YGNodePrint.cpp
+ yoga/YGStyle.h view
@@ -0,0 +1,47 @@+/*+ * Copyright (c) Facebook, Inc. and its affiliates.+ *+ * This source code is licensed under the MIT license found in the LICENSE+ * file in the root directory of this source tree.+ *+ */+#pragma once+#include "YGFloatOptional.h"+#include "Yoga-internal.h"+#include "Yoga.h"++struct YGStyle {+ using Dimensions = std::array<YGValue, 2>;++ YGDirection direction;+ YGFlexDirection flexDirection;+ YGJustify justifyContent;+ YGAlign alignContent;+ YGAlign alignItems;+ YGAlign alignSelf;+ YGPositionType positionType;+ YGWrap flexWrap;+ YGOverflow overflow;+ YGDisplay display;+ YGFloatOptional flex;+ YGFloatOptional flexGrow;+ YGFloatOptional flexShrink;+ YGValue flexBasis;+ std::array<YGValue, YGEdgeCount> margin;+ std::array<YGValue, YGEdgeCount> position;+ std::array<YGValue, YGEdgeCount> padding;+ std::array<YGValue, YGEdgeCount> border;+ Dimensions dimensions;+ Dimensions minDimensions;+ Dimensions maxDimensions;+ // Yoga specific properties, not compatible with flexbox specification+ YGFloatOptional aspectRatio;++ YGStyle();+ bool operator==(const YGStyle& style);++ bool operator!=(YGStyle style) {+ return !(*this == style);+ }+ ~YGStyle() = default;+};