@vidocsecurity/cli 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/index.js +4115 -0
  2. package/dist/markdown.css +132 -0
  3. package/dist/node_modules/@node-rs/crc32/LICENSE +21 -0
  4. package/dist/node_modules/@node-rs/crc32/README.md +61 -0
  5. package/dist/node_modules/@node-rs/crc32/browser.js +1 -0
  6. package/dist/node_modules/@node-rs/crc32/index.d.ts +5 -0
  7. package/dist/node_modules/@node-rs/crc32/index.js +368 -0
  8. package/dist/node_modules/@node-rs/crc32/package.json +97 -0
  9. package/dist/node_modules/@vidocsecurity/code-context/languages.yaml +8332 -0
  10. package/dist/node_modules/@vidocsecurity/code-context/package.json +83 -0
  11. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-c-sharp.wasm +0 -0
  12. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-c.wasm +0 -0
  13. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-cpp.wasm +0 -0
  14. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-css.wasm +0 -0
  15. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-go.wasm +0 -0
  16. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-hcl.wasm +0 -0
  17. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-ini.wasm +0 -0
  18. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-java.wasm +0 -0
  19. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-javascript.wasm +0 -0
  20. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-python.wasm +0 -0
  21. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-regex.wasm +0 -0
  22. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-ruby.wasm +0 -0
  23. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-rust.wasm +0 -0
  24. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-tsx.wasm +0 -0
  25. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-typescript.wasm +0 -0
  26. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter.js +4074 -0
  27. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter.wasm +0 -0
  28. package/dist/node_modules/@vidocsecurity/code-context/wasm/web-tree-sitter.d.ts +1027 -0
  29. package/dist/node_modules/yoga-layout/README.md +40 -0
  30. package/dist/node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js +75 -0
  31. package/dist/node_modules/yoga-layout/dist/src/generated/YGEnums.d.ts +189 -0
  32. package/dist/node_modules/yoga-layout/dist/src/generated/YGEnums.js +211 -0
  33. package/dist/node_modules/yoga-layout/dist/src/generated/YGEnums.js.map +1 -0
  34. package/dist/node_modules/yoga-layout/dist/src/index.d.ts +12 -0
  35. package/dist/node_modules/yoga-layout/dist/src/index.js +16 -0
  36. package/dist/node_modules/yoga-layout/dist/src/index.js.map +1 -0
  37. package/dist/node_modules/yoga-layout/dist/src/load.d.ts +11 -0
  38. package/dist/node_modules/yoga-layout/dist/src/load.js +17 -0
  39. package/dist/node_modules/yoga-layout/dist/src/load.js.map +1 -0
  40. package/dist/node_modules/yoga-layout/dist/src/wrapAssembly.d.ts +155 -0
  41. package/dist/node_modules/yoga-layout/dist/src/wrapAssembly.js +125 -0
  42. package/dist/node_modules/yoga-layout/dist/src/wrapAssembly.js.map +1 -0
  43. package/dist/node_modules/yoga-layout/package.json +53 -0
  44. package/dist/node_modules/yoga-layout/src/Config.cpp +54 -0
  45. package/dist/node_modules/yoga-layout/src/Config.h +44 -0
  46. package/dist/node_modules/yoga-layout/src/Layout.h +19 -0
  47. package/dist/node_modules/yoga-layout/src/Node.cpp +507 -0
  48. package/dist/node_modules/yoga-layout/src/Node.h +239 -0
  49. package/dist/node_modules/yoga-layout/src/Size.h +17 -0
  50. package/dist/node_modules/yoga-layout/src/Value.h +23 -0
  51. package/dist/node_modules/yoga-layout/src/embind.cpp +207 -0
  52. package/dist/node_modules/yoga-layout/src/generated/YGEnums.ts +210 -0
  53. package/dist/node_modules/yoga-layout/src/index.ts +23 -0
  54. package/dist/node_modules/yoga-layout/src/load.ts +25 -0
  55. package/dist/node_modules/yoga-layout/src/wrapAssembly.ts +336 -0
  56. package/dist/prebuilds/android-arm/classic-level.armv7.node +0 -0
  57. package/dist/prebuilds/android-arm64/classic-level.armv8.node +0 -0
  58. package/dist/prebuilds/darwin-x64+arm64/classic-level.node +0 -0
  59. package/dist/prebuilds/linux-arm/classic-level.armv6.node +0 -0
  60. package/dist/prebuilds/linux-arm/classic-level.armv7.node +0 -0
  61. package/dist/prebuilds/linux-arm64/classic-level.armv8.node +0 -0
  62. package/dist/prebuilds/linux-x64/classic-level.musl.node +0 -0
  63. package/dist/prebuilds/linux-x64/classic-level.node +0 -0
  64. package/dist/prebuilds/win32-ia32/classic-level.node +0 -0
  65. package/dist/prebuilds/win32-x64/classic-level.node +0 -0
  66. package/dist/version.txt +1 -0
  67. package/package.json +23 -0
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "yoga-layout",
3
+ "version": "3.2.1",
4
+ "description": "An embeddable and performant flexbox layout engine with bindings for multiple languages",
5
+ "license": "MIT",
6
+ "author": "Meta Open Source",
7
+ "homepage": "https://yogalayout.dev/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git@github.com:facebook/yoga.git"
11
+ },
12
+ "type": "module",
13
+ "main": "./dist/src/index.js",
14
+ "types": "./dist/src/index.d.ts",
15
+ "exports": {
16
+ ".": "./dist/src/index.js",
17
+ "./load": "./dist/src/load.js"
18
+ },
19
+ "files": [
20
+ "dist/binaries/**",
21
+ "dist/src/**",
22
+ "src/**"
23
+ ],
24
+ "scripts": {
25
+ "benchmark": "just benchmark --config just.config.cjs",
26
+ "build": "just build --config just.config.cjs",
27
+ "clang-format": "just clang-format --config just.config.cjs",
28
+ "clang-format:fix": "just clang-format --fix --config just.config.cjs",
29
+ "clean": "just clean --config just.config.cjs",
30
+ "lint": "eslint .",
31
+ "lint:fix": "eslint . --fix",
32
+ "prepack": "just prepack --config just.config.cjs",
33
+ "test": "just test --config just.config.cjs",
34
+ "tsc": "tsc --noEmit"
35
+ },
36
+ "devDependencies": {
37
+ "@babel/cli": "^7.23.0",
38
+ "@babel/core": "^7.23.0",
39
+ "@babel/preset-env": "^7.23.0",
40
+ "@babel/preset-typescript": "^7.23.0",
41
+ "@types/jest": "^29.5.1",
42
+ "@types/node": "^16.18.25",
43
+ "@types/which": "^3.0.0",
44
+ "@yogalayout/cmake-bin": "3.28.0-1",
45
+ "babel-register-esm": "^1.2.5",
46
+ "clang-format": "^1.8.0",
47
+ "glob": "^10.4.2",
48
+ "jest": "^29.3.1",
49
+ "just-scripts": "^2.1.0",
50
+ "ninja-binaries": "^1.11.1",
51
+ "which": "^3.0.0"
52
+ }
53
+ }
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #include <yoga/Yoga.h>
9
+
10
+ #include "./Config.h"
11
+
12
+ /* static */ Config* Config::create(void) {
13
+ return new Config();
14
+ }
15
+
16
+ /* static */ void Config::destroy(Config* node) {
17
+ delete node;
18
+ }
19
+
20
+ Config::Config(void) : m_config(YGConfigNew()) {}
21
+
22
+ Config::~Config(void) {
23
+ YGConfigFree(m_config);
24
+ }
25
+
26
+ void Config::setExperimentalFeatureEnabled(int feature, bool enabled) {
27
+ YGConfigSetExperimentalFeatureEnabled(
28
+ m_config, static_cast<YGExperimentalFeature>(feature), enabled);
29
+ }
30
+
31
+ void Config::setPointScaleFactor(float pixelsInPoint) {
32
+ YGConfigSetPointScaleFactor(m_config, pixelsInPoint);
33
+ }
34
+
35
+ void Config::setErrata(int errata) {
36
+ YGConfigSetErrata(m_config, static_cast<YGErrata>(errata));
37
+ }
38
+
39
+ void Config::setUseWebDefaults(bool useWebDefaults) {
40
+ YGConfigSetUseWebDefaults(m_config, useWebDefaults);
41
+ }
42
+
43
+ bool Config::isExperimentalFeatureEnabled(int feature) const {
44
+ return YGConfigIsExperimentalFeatureEnabled(
45
+ m_config, static_cast<YGExperimentalFeature>(feature));
46
+ }
47
+
48
+ int Config::getErrata() const {
49
+ return static_cast<int>(YGConfigGetErrata(m_config));
50
+ }
51
+
52
+ bool Config::useWebDefaults() const {
53
+ return YGConfigGetUseWebDefaults(m_config);
54
+ }
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include <yoga/Yoga.h>
11
+
12
+ class Config {
13
+ friend class Node;
14
+
15
+ public:
16
+ static Config* create(void);
17
+
18
+ static void destroy(Config* config);
19
+
20
+ private:
21
+ Config(void);
22
+
23
+ public:
24
+ ~Config(void);
25
+
26
+ public: // Prevent accidental copy
27
+ Config(Config const&) = delete;
28
+
29
+ Config const& operator=(Config const&) = delete;
30
+
31
+ public: // Setters
32
+ void setExperimentalFeatureEnabled(int feature, bool enabled);
33
+ void setPointScaleFactor(float pixelsInPoint);
34
+ void setErrata(int errata);
35
+ void setUseWebDefaults(bool useWebDefaults);
36
+
37
+ public: // Getters
38
+ bool isExperimentalFeatureEnabled(int feature) const;
39
+ int getErrata() const;
40
+ bool useWebDefaults() const;
41
+
42
+ private:
43
+ YGConfigRef m_config;
44
+ };
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ struct Layout {
11
+ double left;
12
+ double right;
13
+
14
+ double top;
15
+ double bottom;
16
+
17
+ double width;
18
+ double height;
19
+ };
@@ -0,0 +1,507 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #include <algorithm>
9
+
10
+ #include <yoga/Yoga.h>
11
+
12
+ #include "./Config.h"
13
+ #include "./Layout.h"
14
+ #include "./Node.h"
15
+ #include "./Size.h"
16
+
17
+ static YGSize globalMeasureFunc(
18
+ YGNodeConstRef nodeRef,
19
+ float width,
20
+ YGMeasureMode widthMode,
21
+ float height,
22
+ YGMeasureMode heightMode) {
23
+ Node const& node = *reinterpret_cast<Node const*>(YGNodeGetContext(nodeRef));
24
+
25
+ Size size = node.callMeasureFunc(width, widthMode, height, heightMode);
26
+ YGSize ygSize = {
27
+ static_cast<float>(size.width), static_cast<float>(size.height)};
28
+
29
+ return ygSize;
30
+ }
31
+
32
+ static void globalDirtiedFunc(YGNodeConstRef nodeRef) {
33
+ Node const& node = *reinterpret_cast<Node const*>(YGNodeGetContext(nodeRef));
34
+
35
+ node.callDirtiedFunc();
36
+ }
37
+
38
+ /* static */ Node* Node::createDefault(void) {
39
+ return new Node(nullptr);
40
+ }
41
+
42
+ /* static */ Node* Node::createWithConfig(Config* config) {
43
+ return new Node(config);
44
+ }
45
+
46
+ /* static */ void Node::destroy(Node* node) {
47
+ delete node;
48
+ }
49
+
50
+ /* static */ Node* Node::fromYGNode(YGNodeRef nodeRef) {
51
+ return reinterpret_cast<Node*>(YGNodeGetContext(nodeRef));
52
+ }
53
+
54
+ Node::Node(Config* config)
55
+ : m_node(
56
+ config != nullptr ? YGNodeNewWithConfig(config->m_config)
57
+ : YGNodeNew()),
58
+ m_measureFunc(nullptr),
59
+ m_dirtiedFunc(nullptr) {
60
+ YGNodeSetContext(m_node, reinterpret_cast<void*>(this));
61
+ }
62
+
63
+ Node::~Node(void) {
64
+ YGNodeFree(m_node);
65
+ }
66
+
67
+ void Node::reset(void) {
68
+ m_measureFunc.reset(nullptr);
69
+ m_dirtiedFunc.reset(nullptr);
70
+
71
+ YGNodeReset(m_node);
72
+ }
73
+
74
+ void Node::copyStyle(Node const& other) {
75
+ YGNodeCopyStyle(m_node, other.m_node);
76
+ }
77
+
78
+ void Node::setBoxSizing(int boxSizing) {
79
+ YGNodeStyleSetBoxSizing(m_node, static_cast<YGBoxSizing>(boxSizing));
80
+ }
81
+
82
+ void Node::setPositionType(int positionType) {
83
+ YGNodeStyleSetPositionType(m_node, static_cast<YGPositionType>(positionType));
84
+ }
85
+
86
+ void Node::setPosition(int edge, double position) {
87
+ YGNodeStyleSetPosition(m_node, static_cast<YGEdge>(edge), position);
88
+ }
89
+
90
+ void Node::setPositionPercent(int edge, double position) {
91
+ YGNodeStyleSetPositionPercent(m_node, static_cast<YGEdge>(edge), position);
92
+ }
93
+
94
+ void Node::setPositionAuto(int edge) {
95
+ YGNodeStyleSetPositionAuto(m_node, static_cast<YGEdge>(edge));
96
+ }
97
+
98
+ void Node::setAlignContent(int alignContent) {
99
+ YGNodeStyleSetAlignContent(m_node, static_cast<YGAlign>(alignContent));
100
+ }
101
+
102
+ void Node::setAlignItems(int alignItems) {
103
+ YGNodeStyleSetAlignItems(m_node, static_cast<YGAlign>(alignItems));
104
+ }
105
+
106
+ void Node::setAlignSelf(int alignSelf) {
107
+ YGNodeStyleSetAlignSelf(m_node, static_cast<YGAlign>(alignSelf));
108
+ }
109
+
110
+ void Node::setFlexDirection(int flexDirection) {
111
+ YGNodeStyleSetFlexDirection(
112
+ m_node, static_cast<YGFlexDirection>(flexDirection));
113
+ }
114
+
115
+ void Node::setDirection(int direction) {
116
+ YGNodeStyleSetDirection(m_node, static_cast<YGDirection>(direction));
117
+ }
118
+
119
+ void Node::setFlexWrap(int flexWrap) {
120
+ YGNodeStyleSetFlexWrap(m_node, static_cast<YGWrap>(flexWrap));
121
+ }
122
+
123
+ void Node::setJustifyContent(int justifyContent) {
124
+ YGNodeStyleSetJustifyContent(m_node, static_cast<YGJustify>(justifyContent));
125
+ }
126
+
127
+ void Node::setMargin(int edge, double margin) {
128
+ YGNodeStyleSetMargin(m_node, static_cast<YGEdge>(edge), margin);
129
+ }
130
+
131
+ void Node::setMarginPercent(int edge, double margin) {
132
+ YGNodeStyleSetMarginPercent(m_node, static_cast<YGEdge>(edge), margin);
133
+ }
134
+
135
+ void Node::setMarginAuto(int edge) {
136
+ YGNodeStyleSetMarginAuto(m_node, static_cast<YGEdge>(edge));
137
+ }
138
+
139
+ void Node::setOverflow(int overflow) {
140
+ YGNodeStyleSetOverflow(m_node, static_cast<YGOverflow>(overflow));
141
+ }
142
+
143
+ void Node::setDisplay(int display) {
144
+ YGNodeStyleSetDisplay(m_node, static_cast<YGDisplay>(display));
145
+ }
146
+
147
+ void Node::setFlex(double flex) {
148
+ YGNodeStyleSetFlex(m_node, flex);
149
+ }
150
+
151
+ void Node::setFlexBasis(double flexBasis) {
152
+ YGNodeStyleSetFlexBasis(m_node, flexBasis);
153
+ }
154
+
155
+ void Node::setFlexBasisPercent(double flexBasis) {
156
+ YGNodeStyleSetFlexBasisPercent(m_node, flexBasis);
157
+ }
158
+
159
+ void Node::setFlexBasisAuto() {
160
+ YGNodeStyleSetFlexBasisAuto(m_node);
161
+ }
162
+
163
+ void Node::setFlexGrow(double flexGrow) {
164
+ YGNodeStyleSetFlexGrow(m_node, flexGrow);
165
+ }
166
+
167
+ void Node::setFlexShrink(double flexShrink) {
168
+ YGNodeStyleSetFlexShrink(m_node, flexShrink);
169
+ }
170
+
171
+ void Node::setWidth(double width) {
172
+ YGNodeStyleSetWidth(m_node, width);
173
+ }
174
+
175
+ void Node::setWidthPercent(double width) {
176
+ YGNodeStyleSetWidthPercent(m_node, width);
177
+ }
178
+
179
+ void Node::setWidthAuto() {
180
+ YGNodeStyleSetWidthAuto(m_node);
181
+ }
182
+
183
+ void Node::setHeight(double height) {
184
+ YGNodeStyleSetHeight(m_node, height);
185
+ }
186
+
187
+ void Node::setHeightPercent(double height) {
188
+ YGNodeStyleSetHeightPercent(m_node, height);
189
+ }
190
+
191
+ void Node::setHeightAuto() {
192
+ YGNodeStyleSetHeightAuto(m_node);
193
+ }
194
+
195
+ void Node::setMinWidth(double minWidth) {
196
+ YGNodeStyleSetMinWidth(m_node, minWidth);
197
+ }
198
+
199
+ void Node::setMinWidthPercent(double minWidth) {
200
+ YGNodeStyleSetMinWidthPercent(m_node, minWidth);
201
+ }
202
+
203
+ void Node::setMinHeight(double minHeight) {
204
+ YGNodeStyleSetMinHeight(m_node, minHeight);
205
+ }
206
+
207
+ void Node::setMinHeightPercent(double minHeight) {
208
+ YGNodeStyleSetMinHeightPercent(m_node, minHeight);
209
+ }
210
+
211
+ void Node::setMaxWidth(double maxWidth) {
212
+ YGNodeStyleSetMaxWidth(m_node, maxWidth);
213
+ }
214
+
215
+ void Node::setMaxWidthPercent(double maxWidth) {
216
+ YGNodeStyleSetMaxWidthPercent(m_node, maxWidth);
217
+ }
218
+
219
+ void Node::setMaxHeight(double maxHeight) {
220
+ YGNodeStyleSetMaxHeight(m_node, maxHeight);
221
+ }
222
+
223
+ void Node::setMaxHeightPercent(double maxHeight) {
224
+ YGNodeStyleSetMaxHeightPercent(m_node, maxHeight);
225
+ }
226
+
227
+ void Node::setAspectRatio(double aspectRatio) {
228
+ YGNodeStyleSetAspectRatio(m_node, aspectRatio);
229
+ }
230
+
231
+ void Node::setBorder(int edge, double border) {
232
+ YGNodeStyleSetBorder(m_node, static_cast<YGEdge>(edge), border);
233
+ }
234
+
235
+ void Node::setPadding(int edge, double padding) {
236
+ YGNodeStyleSetPadding(m_node, static_cast<YGEdge>(edge), padding);
237
+ }
238
+
239
+ void Node::setPaddingPercent(int edge, double padding) {
240
+ YGNodeStyleSetPaddingPercent(m_node, static_cast<YGEdge>(edge), padding);
241
+ }
242
+
243
+ void Node::setIsReferenceBaseline(bool isReferenceBaseline) {
244
+ YGNodeSetIsReferenceBaseline(m_node, isReferenceBaseline);
245
+ }
246
+
247
+ void Node::setGap(int gutter, double gapLength) {
248
+ YGNodeStyleSetGap(m_node, static_cast<YGGutter>(gutter), gapLength);
249
+ }
250
+
251
+ void Node::setGapPercent(int gutter, double gapLength) {
252
+ YGNodeStyleSetGapPercent(m_node, static_cast<YGGutter>(gutter), gapLength);
253
+ }
254
+
255
+ int Node::getBoxSizing(void) const {
256
+ return YGNodeStyleGetBoxSizing(m_node);
257
+ }
258
+
259
+ int Node::getPositionType(void) const {
260
+ return YGNodeStyleGetPositionType(m_node);
261
+ }
262
+
263
+ Value Node::getPosition(int edge) const {
264
+ return Value::fromYGValue(
265
+ YGNodeStyleGetPosition(m_node, static_cast<YGEdge>(edge)));
266
+ }
267
+
268
+ int Node::getAlignContent(void) const {
269
+ return YGNodeStyleGetAlignContent(m_node);
270
+ }
271
+
272
+ int Node::getAlignItems(void) const {
273
+ return YGNodeStyleGetAlignItems(m_node);
274
+ }
275
+
276
+ int Node::getAlignSelf(void) const {
277
+ return YGNodeStyleGetAlignSelf(m_node);
278
+ }
279
+
280
+ int Node::getFlexDirection(void) const {
281
+ return YGNodeStyleGetFlexDirection(m_node);
282
+ }
283
+
284
+ int Node::getDirection(void) const {
285
+ return YGNodeStyleGetDirection(m_node);
286
+ }
287
+
288
+ int Node::getFlexWrap(void) const {
289
+ return YGNodeStyleGetFlexWrap(m_node);
290
+ }
291
+
292
+ int Node::getJustifyContent(void) const {
293
+ return YGNodeStyleGetJustifyContent(m_node);
294
+ }
295
+
296
+ Value Node::getMargin(int edge) const {
297
+ return Value::fromYGValue(
298
+ YGNodeStyleGetMargin(m_node, static_cast<YGEdge>(edge)));
299
+ }
300
+
301
+ int Node::getOverflow(void) const {
302
+ return YGNodeStyleGetOverflow(m_node);
303
+ }
304
+
305
+ int Node::getDisplay(void) const {
306
+ return YGNodeStyleGetDisplay(m_node);
307
+ }
308
+
309
+ Value Node::getFlexBasis(void) const {
310
+ return Value::fromYGValue(YGNodeStyleGetFlexBasis(m_node));
311
+ }
312
+
313
+ double Node::getFlexGrow(void) const {
314
+ return YGNodeStyleGetFlexGrow(m_node);
315
+ }
316
+
317
+ double Node::getFlexShrink(void) const {
318
+ return YGNodeStyleGetFlexShrink(m_node);
319
+ }
320
+
321
+ Value Node::getWidth(void) const {
322
+ return Value::fromYGValue(YGNodeStyleGetWidth(m_node));
323
+ }
324
+
325
+ Value Node::getHeight(void) const {
326
+ return Value::fromYGValue(YGNodeStyleGetHeight(m_node));
327
+ }
328
+
329
+ Value Node::getMinWidth(void) const {
330
+ return Value::fromYGValue(YGNodeStyleGetMinWidth(m_node));
331
+ }
332
+
333
+ Value Node::getMinHeight(void) const {
334
+ return Value::fromYGValue(YGNodeStyleGetMinHeight(m_node));
335
+ }
336
+
337
+ Value Node::getMaxWidth(void) const {
338
+ return Value::fromYGValue(YGNodeStyleGetMaxWidth(m_node));
339
+ }
340
+
341
+ Value Node::getMaxHeight(void) const {
342
+ return Value::fromYGValue(YGNodeStyleGetMaxHeight(m_node));
343
+ }
344
+
345
+ double Node::getAspectRatio(void) const {
346
+ return YGNodeStyleGetAspectRatio(m_node);
347
+ }
348
+
349
+ double Node::getBorder(int edge) const {
350
+ return YGNodeStyleGetBorder(m_node, static_cast<YGEdge>(edge));
351
+ }
352
+
353
+ Value Node::getPadding(int edge) const {
354
+ return Value::fromYGValue(
355
+ YGNodeStyleGetPadding(m_node, static_cast<YGEdge>(edge)));
356
+ }
357
+
358
+ float Node::getGap(int gutter) {
359
+ return YGNodeStyleGetGap(m_node, static_cast<YGGutter>(gutter));
360
+ }
361
+
362
+ bool Node::isReferenceBaseline() {
363
+ return YGNodeIsReferenceBaseline(m_node);
364
+ }
365
+
366
+ void Node::insertChild(Node* child, unsigned index) {
367
+ YGNodeInsertChild(m_node, child->m_node, index);
368
+ }
369
+
370
+ void Node::removeChild(Node* child) {
371
+ YGNodeRemoveChild(m_node, child->m_node);
372
+ }
373
+
374
+ unsigned Node::getChildCount(void) const {
375
+ return YGNodeGetChildCount(m_node);
376
+ }
377
+
378
+ Node* Node::getParent(void) {
379
+ auto nodePtr = YGNodeGetParent(m_node);
380
+
381
+ if (nodePtr == nullptr)
382
+ return nullptr;
383
+
384
+ return Node::fromYGNode(nodePtr);
385
+ }
386
+
387
+ Node* Node::getChild(unsigned index) {
388
+ auto nodePtr = YGNodeGetChild(m_node, index);
389
+
390
+ if (nodePtr == nullptr)
391
+ return nullptr;
392
+
393
+ return Node::fromYGNode(nodePtr);
394
+ }
395
+
396
+ void Node::setMeasureFunc(MeasureCallback* measureFunc) {
397
+ m_measureFunc.reset(measureFunc);
398
+
399
+ YGNodeSetMeasureFunc(m_node, &globalMeasureFunc);
400
+ }
401
+
402
+ void Node::unsetMeasureFunc(void) {
403
+ m_measureFunc.reset(nullptr);
404
+
405
+ YGNodeSetMeasureFunc(m_node, nullptr);
406
+ }
407
+
408
+ Size Node::callMeasureFunc(
409
+ double width,
410
+ int widthMode,
411
+ double height,
412
+ int heightMode) const {
413
+ return m_measureFunc->measure(width, widthMode, height, heightMode);
414
+ }
415
+
416
+ void Node::setDirtiedFunc(DirtiedCallback* dirtiedFunc) {
417
+ m_dirtiedFunc.reset(dirtiedFunc);
418
+
419
+ YGNodeSetDirtiedFunc(m_node, &globalDirtiedFunc);
420
+ }
421
+
422
+ void Node::unsetDirtiedFunc(void) {
423
+ m_dirtiedFunc.reset(nullptr);
424
+
425
+ YGNodeSetDirtiedFunc(m_node, nullptr);
426
+ }
427
+
428
+ void Node::callDirtiedFunc(void) const {
429
+ m_dirtiedFunc->dirtied();
430
+ }
431
+
432
+ void Node::markDirty(void) {
433
+ YGNodeMarkDirty(m_node);
434
+ }
435
+
436
+ bool Node::isDirty(void) const {
437
+ return YGNodeIsDirty(m_node);
438
+ }
439
+
440
+ void Node::markLayoutSeen() {
441
+ YGNodeSetHasNewLayout(m_node, false);
442
+ }
443
+
444
+ bool Node::hasNewLayout(void) const {
445
+ return YGNodeGetHasNewLayout(m_node);
446
+ }
447
+
448
+ void Node::calculateLayout(double width, double height, int direction) {
449
+ YGNodeCalculateLayout(
450
+ m_node, width, height, static_cast<YGDirection>(direction));
451
+ }
452
+
453
+ double Node::getComputedLeft(void) const {
454
+ return YGNodeLayoutGetLeft(m_node);
455
+ }
456
+
457
+ double Node::getComputedRight(void) const {
458
+ return YGNodeLayoutGetRight(m_node);
459
+ }
460
+
461
+ double Node::getComputedTop(void) const {
462
+ return YGNodeLayoutGetTop(m_node);
463
+ }
464
+
465
+ double Node::getComputedBottom(void) const {
466
+ return YGNodeLayoutGetBottom(m_node);
467
+ }
468
+
469
+ double Node::getComputedWidth(void) const {
470
+ return YGNodeLayoutGetWidth(m_node);
471
+ }
472
+
473
+ double Node::getComputedHeight(void) const {
474
+ return YGNodeLayoutGetHeight(m_node);
475
+ }
476
+
477
+ Layout Node::getComputedLayout(void) const {
478
+ Layout layout;
479
+
480
+ layout.left = YGNodeLayoutGetLeft(m_node);
481
+ layout.right = YGNodeLayoutGetRight(m_node);
482
+
483
+ layout.top = YGNodeLayoutGetTop(m_node);
484
+ layout.bottom = YGNodeLayoutGetBottom(m_node);
485
+
486
+ layout.width = YGNodeLayoutGetWidth(m_node);
487
+ layout.height = YGNodeLayoutGetHeight(m_node);
488
+
489
+ return layout;
490
+ }
491
+
492
+ double Node::getComputedMargin(int edge) const {
493
+ return YGNodeLayoutGetMargin(m_node, static_cast<YGEdge>(edge));
494
+ }
495
+
496
+ double Node::getComputedBorder(int edge) const {
497
+ return YGNodeLayoutGetBorder(m_node, static_cast<YGEdge>(edge));
498
+ }
499
+
500
+ double Node::getComputedPadding(int edge) const {
501
+ return YGNodeLayoutGetPadding(m_node, static_cast<YGEdge>(edge));
502
+ }
503
+
504
+ void Node::setAlwaysFormsContainingBlock(bool alwaysFormsContainingBlock) {
505
+ return YGNodeSetAlwaysFormsContainingBlock(
506
+ m_node, alwaysFormsContainingBlock);
507
+ }