wasm: export a few symbols
These are needed for dynamic linking/ shared library Change-Id: Ibd01d2b70ecf4afca273d07fafb2a5bd0650cf94 Reviewed-by: David Skoland <david.skoland@qt.io>
This commit is contained in:
parent
0c59723e58
commit
cfa44787de
@ -19,6 +19,8 @@
|
|||||||
#include <emscripten/val.h>
|
#include <emscripten/val.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -37,7 +39,7 @@ namespace qstdweb {
|
|||||||
class Uint8Array;
|
class Uint8Array;
|
||||||
class EventCallback;
|
class EventCallback;
|
||||||
|
|
||||||
class ArrayBuffer {
|
class Q_CORE_EXPORT ArrayBuffer {
|
||||||
public:
|
public:
|
||||||
explicit ArrayBuffer(uint32_t size);
|
explicit ArrayBuffer(uint32_t size);
|
||||||
explicit ArrayBuffer(const emscripten::val &arrayBuffer);
|
explicit ArrayBuffer(const emscripten::val &arrayBuffer);
|
||||||
@ -49,7 +51,7 @@ namespace qstdweb {
|
|||||||
emscripten::val m_arrayBuffer = emscripten::val::undefined();
|
emscripten::val m_arrayBuffer = emscripten::val::undefined();
|
||||||
};
|
};
|
||||||
|
|
||||||
class Blob {
|
class Q_CORE_EXPORT Blob {
|
||||||
public:
|
public:
|
||||||
explicit Blob(const emscripten::val &blob);
|
explicit Blob(const emscripten::val &blob);
|
||||||
uint32_t size() const;
|
uint32_t size() const;
|
||||||
@ -62,7 +64,7 @@ namespace qstdweb {
|
|||||||
emscripten::val m_blob = emscripten::val::undefined();
|
emscripten::val m_blob = emscripten::val::undefined();
|
||||||
};
|
};
|
||||||
|
|
||||||
class File {
|
class Q_CORE_EXPORT File {
|
||||||
public:
|
public:
|
||||||
File() = default;
|
File() = default;
|
||||||
explicit File(const emscripten::val &file);
|
explicit File(const emscripten::val &file);
|
||||||
@ -79,7 +81,7 @@ namespace qstdweb {
|
|||||||
emscripten::val m_file = emscripten::val::undefined();
|
emscripten::val m_file = emscripten::val::undefined();
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileList {
|
class Q_CORE_EXPORT FileList {
|
||||||
public:
|
public:
|
||||||
FileList() = default;
|
FileList() = default;
|
||||||
explicit FileList(const emscripten::val &fileList);
|
explicit FileList(const emscripten::val &fileList);
|
||||||
@ -93,7 +95,7 @@ namespace qstdweb {
|
|||||||
emscripten::val m_fileList = emscripten::val::undefined();
|
emscripten::val m_fileList = emscripten::val::undefined();
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileReader {
|
class Q_CORE_EXPORT FileReader {
|
||||||
public:
|
public:
|
||||||
ArrayBuffer result() const;
|
ArrayBuffer result() const;
|
||||||
void readAsArrayBuffer(const Blob &blob) const;
|
void readAsArrayBuffer(const Blob &blob) const;
|
||||||
@ -110,7 +112,7 @@ namespace qstdweb {
|
|||||||
std::unique_ptr<EventCallback> m_onAbort;
|
std::unique_ptr<EventCallback> m_onAbort;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Uint8Array {
|
class Q_CORE_EXPORT Uint8Array {
|
||||||
public:
|
public:
|
||||||
static Uint8Array heap();
|
static Uint8Array heap();
|
||||||
explicit Uint8Array(const emscripten::val &uint8Array);
|
explicit Uint8Array(const emscripten::val &uint8Array);
|
||||||
@ -134,7 +136,7 @@ namespace qstdweb {
|
|||||||
emscripten::val m_uint8Array = emscripten::val::undefined();
|
emscripten::val m_uint8Array = emscripten::val::undefined();
|
||||||
};
|
};
|
||||||
|
|
||||||
class EventCallback
|
class Q_CORE_EXPORT EventCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EventCallback() = default;
|
EventCallback() = default;
|
||||||
|
@ -25,17 +25,17 @@ namespace QWasmLocalFileAccess {
|
|||||||
|
|
||||||
enum FileSelectMode { SingleFile, MultipleFiles };
|
enum FileSelectMode { SingleFile, MultipleFiles };
|
||||||
|
|
||||||
void openFiles(const std::string &accept, FileSelectMode fileSelectMode,
|
Q_CORE_EXPORT void openFiles(const std::string &accept, FileSelectMode fileSelectMode,
|
||||||
const std::function<void (int fileCount)> &fileDialogClosed,
|
const std::function<void (int fileCount)> &fileDialogClosed,
|
||||||
const std::function<char *(uint64_t size, const std::string name)> &acceptFile,
|
const std::function<char *(uint64_t size, const std::string name)> &acceptFile,
|
||||||
const std::function<void()> &fileDataReady);
|
const std::function<void()> &fileDataReady);
|
||||||
|
|
||||||
void openFile(const std::string &accept,
|
Q_CORE_EXPORT void openFile(const std::string &accept,
|
||||||
const std::function<void (bool fileSelected)> &fileDialogClosed,
|
const std::function<void (bool fileSelected)> &fileDialogClosed,
|
||||||
const std::function<char *(uint64_t size, const std::string name)> &acceptFile,
|
const std::function<char *(uint64_t size, const std::string name)> &acceptFile,
|
||||||
const std::function<void()> &fileDataReady);
|
const std::function<void()> &fileDataReady);
|
||||||
|
|
||||||
void saveFile(const char *content, size_t size, const std::string &fileNameHint);
|
Q_CORE_EXPORT void saveFile(const char *content, size_t size, const std::string &fileNameHint);
|
||||||
|
|
||||||
} // namespace QWasmLocalFileAccess
|
} // namespace QWasmLocalFileAccess
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user