summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMokosha <>2018-10-10 07:05:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-10-10 07:05:00 (GMT)
commit5643f279ab531a74daa25c0aa2cf49b57e78d5ce (patch)
tree2036d857db70d5ae0fe1215afafff758de60ebe7
parentbb31a06382842cba022ecf7f3ccf05ef4b3e437d (diff)
version 0.0.0.40.0.0.4
-rw-r--r--yoga.cabal7
-rwxr-xr-xyoga/YGStyle.h47
2 files changed, 51 insertions, 3 deletions
diff --git a/yoga.cabal b/yoga.cabal
index 62adbab..cf94ce2 100644
--- a/yoga.cabal
+++ b/yoga.cabal
@@ -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 @@ library
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
diff --git a/yoga/YGStyle.h b/yoga/YGStyle.h
new file mode 100755
index 0000000..efd52ff
--- /dev/null
+++ b/yoga/YGStyle.h
@@ -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;
+};