summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmdom.h
blob: 3f2e4242ef37325060379e8889af3a882962e874 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef QWASMDOM_H
#define QWASMDOM_H

#include <QtCore/qtconfigmacros.h>
#include <QtCore/QPointF>

#include <emscripten/val.h>

#include <functional>
#include <memory>
#include <string>

QT_BEGIN_NAMESPACE

class QPoint;

namespace dom {
inline emscripten::val document()
{
    return emscripten::val::global("document");
}

void syncCSSClassWith(emscripten::val element, std::string cssClassName, bool flag);

QPointF mapPoint(emscripten::val source, emscripten::val target, const QPointF &point);
} // namespace dom

QT_END_NAMESPACE
#endif // QWASMDOM_H