slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
TestUtil.h
浏览该文件的文档.
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/YGNode.h>
11#include <yoga/event/event.h>
12#include <functional>
13#include <string_view>
14
15namespace facebook::yoga::test {
16
17struct TestUtil {
18 static void startCountingNodes();
19 static int nodeCount();
20 static int stopCountingNodes();
21};
22
24 explicit ScopedEventSubscription(std::function<Event::Subscriber>&& s);
26};
27
29 YGNodeConstRef node,
30 float width,
31 YGMeasureMode widthMode,
32 float height,
33 YGMeasureMode heightMode);
34
35float longestWordWidth(std::string_view text, float widthPerChar);
36
37float calculateHeight(
38 std::string_view text,
39 float measuredWidth,
40 float widthPerChar,
41 float heightPerChar);
42
43} // namespace facebook::yoga::test
float YGMeasureMode heightMode
Definition YGNode.h:292
Definition EventsTest.cpp:20
YGSize IntrinsicSizeMeasure(YGNodeConstRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
Definition TestUtil.cpp:67
float longestWordWidth(std::string_view text, float widthPerChar)
Definition TestUtil.cpp:114
float calculateHeight(std::string_view text, float measuredWidth, float widthPerChar, float heightPerChar)
Definition TestUtil.cpp:128
Definition Node.h:29
Definition YGNode.h:183
~ScopedEventSubscription()
Definition TestUtil.cpp:63
ScopedEventSubscription(std::function< Event::Subscriber > &&s)
Definition TestUtil.cpp:58
Definition TestUtil.h:17
static int stopCountingNodes()
Definition TestUtil.cpp:51
static void startCountingNodes()
Definition TestUtil.cpp:42
static int nodeCount()
Definition TestUtil.cpp:47