diff options
| author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-09 19:55:28 +0800 |
|---|---|---|
| committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-09 19:55:28 +0800 |
| commit | a1e538564d4b2a60be70a32ec39afdba249ce37d (patch) | |
| tree | 98ff5e3531bf8c70369dc846c0d653e4ea878128 /client.cxx | |
| parent | 982495a8ee6932f4a1586faf0c853ebaf951000f (diff) | |
Add support for Emscripten
Diffstat (limited to 'client.cxx')
| -rw-r--r-- | client.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -1,10 +1,12 @@ #include <cstddef> #include <memory> #include <QObject> +#include <icclient/typedefs.h> #include <icclient/client.h> -#include <icclient/member.h> #include "qicclient/catalog.hxx" +#ifndef __EMSCRIPTEN__ #include "qicclient/ord.hxx" +#endif #include "qicclient/client.hxx" namespace QICClient { @@ -19,29 +21,28 @@ namespace QICClient { icclient_cleanup(); } - void Client::results(QString const& prodGroup, - size_t (*handler)(void*, size_t, size_t, void*)) + void Client::results(QString const& prodGroup, icclient_handler handler) { icclient_catalog* catalog = nullptr; icclient_results(prodGroup.toLatin1().constData(), handler, &catalog); if (catalog) emit gotResults(new Catalog{catalog}); } - void Client::allProducts(size_t (*handler)(void*, size_t, size_t, void*)) + void Client::allProducts(icclient_handler handler) { icclient_catalog* catalog = nullptr; icclient_allproducts(handler, &catalog); if (catalog) emit gotResults(new Catalog{catalog}); } - void Client::flyPage(QString const& sku, - size_t (*handler)(void*, size_t, size_t, void*)) + void Client::flyPage(QString const& sku,icclient_handler handler) { icclient_product* product = nullptr; icclient_flypage(sku.toLatin1().constData(), handler, &product); if (product) emit gotFlyPage(shared_ptr<Product>{new Product{product}}); } +#ifndef __EMSCRIPTEN__ void Client::order(QString const& sku, Catalog const& catalog, Ord& order) { auto c_order = order.data(); @@ -49,5 +50,6 @@ namespace QICClient { &c_order); order.setData(c_order); } +#endif } |