Skip to content

Commit

Permalink
wasm: export a few symbols
Browse files Browse the repository at this point in the history
These are needed for dynamic linking/ shared library

Change-Id: Ibd01d2b70ecf4afca273d07fafb2a5bd0650cf94
Reviewed-by: David Skoland <[email protected]>
  • Loading branch information
lpotter committed Jun 1, 2022
1 parent 0c59723 commit cfa4478
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions src/corelib/platform/wasm/qstdweb_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <emscripten/val.h>
#include <cstdint>
#include <functional>
#include <QtCore/qglobal.h>


QT_BEGIN_NAMESPACE

Expand All @@ -37,7 +39,7 @@ namespace qstdweb {
class Uint8Array;
class EventCallback;

class ArrayBuffer {
class Q_CORE_EXPORT ArrayBuffer {
public:
explicit ArrayBuffer(uint32_t size);
explicit ArrayBuffer(const emscripten::val &arrayBuffer);
Expand All @@ -49,7 +51,7 @@ namespace qstdweb {
emscripten::val m_arrayBuffer = emscripten::val::undefined();
};

class Blob {
class Q_CORE_EXPORT Blob {
public:
explicit Blob(const emscripten::val &blob);
uint32_t size() const;
Expand All @@ -62,7 +64,7 @@ namespace qstdweb {
emscripten::val m_blob = emscripten::val::undefined();
};

class File {
class Q_CORE_EXPORT File {
public:
File() = default;
explicit File(const emscripten::val &file);
Expand All @@ -79,7 +81,7 @@ namespace qstdweb {
emscripten::val m_file = emscripten::val::undefined();
};

class FileList {
class Q_CORE_EXPORT FileList {
public:
FileList() = default;
explicit FileList(const emscripten::val &fileList);
Expand All @@ -93,7 +95,7 @@ namespace qstdweb {
emscripten::val m_fileList = emscripten::val::undefined();
};

class FileReader {
class Q_CORE_EXPORT FileReader {
public:
ArrayBuffer result() const;
void readAsArrayBuffer(const Blob &blob) const;
Expand All @@ -110,7 +112,7 @@ namespace qstdweb {
std::unique_ptr<EventCallback> m_onAbort;
};

class Uint8Array {
class Q_CORE_EXPORT Uint8Array {
public:
static Uint8Array heap();
explicit Uint8Array(const emscripten::val &uint8Array);
Expand All @@ -134,7 +136,7 @@ namespace qstdweb {
emscripten::val m_uint8Array = emscripten::val::undefined();
};

class EventCallback
class Q_CORE_EXPORT EventCallback
{
public:
EventCallback() = default;
Expand Down
6 changes: 3 additions & 3 deletions src/gui/platform/wasm/qwasmlocalfileaccess_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ namespace QWasmLocalFileAccess {

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<char *(uint64_t size, const std::string name)> &acceptFile,
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<char *(uint64_t size, const std::string name)> &acceptFile,
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

Expand Down

0 comments on commit cfa4478

Please sign in to comment.