clang-format the JS directory
This commit is contained in:
2
.github/actions/clang-format/action.yml
vendored
2
.github/actions/clang-format/action.yml
vendored
@@ -21,4 +21,4 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.h **/*.m **/*.mm
|
clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.cc **/*.h **/*.hh **/*.m **/*.mm
|
||||||
|
5
.github/workflows/validate-cpp.yml
vendored
5
.github/workflows/validate-cpp.yml
vendored
@@ -19,3 +19,8 @@ jobs:
|
|||||||
uses: ./.github/actions/clang-format
|
uses: ./.github/actions/clang-format
|
||||||
with:
|
with:
|
||||||
directory: ./yoga
|
directory: ./yoga
|
||||||
|
|
||||||
|
- name: clang-format (JavaScript Bindings)
|
||||||
|
uses: ./.github/actions/clang-format
|
||||||
|
with:
|
||||||
|
directory: ./javascript
|
||||||
|
@@ -20,7 +20,8 @@
|
|||||||
class MeasureCallback {
|
class MeasureCallback {
|
||||||
public:
|
public:
|
||||||
virtual ~MeasureCallback() {}
|
virtual ~MeasureCallback() {}
|
||||||
virtual Size measure(float width,
|
virtual Size measure(
|
||||||
|
float width,
|
||||||
int widthMode,
|
int widthMode,
|
||||||
float height,
|
float height,
|
||||||
int heightMode) = 0;
|
int heightMode) = 0;
|
||||||
@@ -29,8 +30,7 @@ public:
|
|||||||
class MeasureCallbackWrapper : public emscripten::wrapper<MeasureCallback> {
|
class MeasureCallbackWrapper : public emscripten::wrapper<MeasureCallback> {
|
||||||
public:
|
public:
|
||||||
EMSCRIPTEN_WRAPPER(MeasureCallbackWrapper);
|
EMSCRIPTEN_WRAPPER(MeasureCallbackWrapper);
|
||||||
Size measure(float width, int widthMode, float height, int heightMode)
|
Size measure(float width, int widthMode, float height, int heightMode) {
|
||||||
{
|
|
||||||
return call<Size>("measure", width, widthMode, height, heightMode);
|
return call<Size>("measure", width, widthMode, height, heightMode);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -44,10 +44,7 @@ public:
|
|||||||
class DirtiedCallbackWrapper : public emscripten::wrapper<DirtiedCallback> {
|
class DirtiedCallbackWrapper : public emscripten::wrapper<DirtiedCallback> {
|
||||||
public:
|
public:
|
||||||
EMSCRIPTEN_WRAPPER(DirtiedCallbackWrapper);
|
EMSCRIPTEN_WRAPPER(DirtiedCallbackWrapper);
|
||||||
void dirtied()
|
void dirtied() { return call<void>("dirtied"); }
|
||||||
{
|
|
||||||
return call<void>("dirtied");
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Node {
|
class Node {
|
||||||
|
@@ -19,21 +19,22 @@ using namespace emscripten;
|
|||||||
EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
|
EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
|
||||||
class_<MeasureCallback>("MeasureCallback")
|
class_<MeasureCallback>("MeasureCallback")
|
||||||
.function("measure", &MeasureCallback::measure, pure_virtual())
|
.function("measure", &MeasureCallback::measure, pure_virtual())
|
||||||
.allow_subclass<MeasureCallbackWrapper>("MeasureCallbackWrapper")
|
.allow_subclass<MeasureCallbackWrapper>("MeasureCallbackWrapper");
|
||||||
;
|
|
||||||
class_<DirtiedCallback>("DirtiedCallback")
|
class_<DirtiedCallback>("DirtiedCallback")
|
||||||
.function("dirtied", &DirtiedCallback::dirtied, pure_virtual())
|
.function("dirtied", &DirtiedCallback::dirtied, pure_virtual())
|
||||||
.allow_subclass<DirtiedCallbackWrapper>("DirtiedCallbackWrapper")
|
.allow_subclass<DirtiedCallbackWrapper>("DirtiedCallbackWrapper");
|
||||||
;
|
|
||||||
|
|
||||||
class_<Config>("Config")
|
class_<Config>("Config")
|
||||||
.constructor<>(&Config::create, allow_raw_pointers())
|
.constructor<>(&Config::create, allow_raw_pointers())
|
||||||
.class_function<>("create", &Config::create, allow_raw_pointers())
|
.class_function<>("create", &Config::create, allow_raw_pointers())
|
||||||
.class_function<>("destroy", &Config::destroy, allow_raw_pointers())
|
.class_function<>("destroy", &Config::destroy, allow_raw_pointers())
|
||||||
.function("setExperimentalFeatureEnabled", &Config::setExperimentalFeatureEnabled)
|
.function(
|
||||||
|
"setExperimentalFeatureEnabled",
|
||||||
|
&Config::setExperimentalFeatureEnabled)
|
||||||
.function("setPointScaleFactor", &Config::setPointScaleFactor)
|
.function("setPointScaleFactor", &Config::setPointScaleFactor)
|
||||||
.function("isExperimentalFeatureEnabled", &Config::isExperimentalFeatureEnabled)
|
.function(
|
||||||
;
|
"isExperimentalFeatureEnabled",
|
||||||
|
&Config::isExperimentalFeatureEnabled);
|
||||||
|
|
||||||
value_object<Layout>("Layout")
|
value_object<Layout>("Layout")
|
||||||
.field("left", &Layout::left)
|
.field("left", &Layout::left)
|
||||||
@@ -41,24 +42,23 @@ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
|
|||||||
.field("top", &Layout::top)
|
.field("top", &Layout::top)
|
||||||
.field("bottom", &Layout::bottom)
|
.field("bottom", &Layout::bottom)
|
||||||
.field("width", &Layout::width)
|
.field("width", &Layout::width)
|
||||||
.field("height", &Layout::height)
|
.field("height", &Layout::height);
|
||||||
;
|
|
||||||
|
|
||||||
value_object<Size>("Size")
|
value_object<Size>("Size")
|
||||||
.field("width", &Size::width)
|
.field("width", &Size::width)
|
||||||
.field("height", &Size::height)
|
.field("height", &Size::height);
|
||||||
;
|
|
||||||
|
|
||||||
value_object<Value>("Value")
|
value_object<Value>("Value")
|
||||||
.field("value", &Value::value)
|
.field("value", &Value::value)
|
||||||
.field("unit", &Value::unit)
|
.field("unit", &Value::unit);
|
||||||
;
|
|
||||||
|
|
||||||
class_<Node>("Node")
|
class_<Node>("Node")
|
||||||
.constructor<>(&Node::createDefault, allow_raw_pointers())
|
.constructor<>(&Node::createDefault, allow_raw_pointers())
|
||||||
|
|
||||||
.class_function<>("createDefault", &Node::createDefault, allow_raw_pointers())
|
.class_function<>(
|
||||||
.class_function<>("createWithConfig", &Node::createWithConfig, allow_raw_pointers())
|
"createDefault", &Node::createDefault, allow_raw_pointers())
|
||||||
|
.class_function<>(
|
||||||
|
"createWithConfig", &Node::createWithConfig, allow_raw_pointers())
|
||||||
.class_function<>("destroy", &Node::destroy, allow_raw_pointers())
|
.class_function<>("destroy", &Node::destroy, allow_raw_pointers())
|
||||||
.function("reset", &Node::reset)
|
.function("reset", &Node::reset)
|
||||||
|
|
||||||
@@ -183,6 +183,5 @@ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
|
|||||||
|
|
||||||
.function("getComputedMargin", &Node::getComputedMargin)
|
.function("getComputedMargin", &Node::getComputedMargin)
|
||||||
.function("getComputedBorder", &Node::getComputedBorder)
|
.function("getComputedBorder", &Node::getComputedBorder)
|
||||||
.function("getComputedPadding", &Node::getComputedPadding)
|
.function("getComputedPadding", &Node::getComputedPadding);
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user