nodeguy/src/cpp/include/nodegui/QtGui/QPixmap/qpixmap_wrap.h
Atul R 6e6495f948
Load image from buffer, QMovie and QRect (#232)
* Adds qpixmap load from data

* Adds basic qrect and qmovie

* Adds more methods to QMovie and QLabel

* Adds QMovie, QRect and qlabel methods

* Adds custom method load from data to load from buffer easily

* Adds loading from buffer for qmovie
2019-11-29 00:39:35 +01:00

33 lines
970 B
C++

#pragma once
#include <napi.h>
#include <stdlib.h>
#include <QPixmap>
#include "core/Component/component_macro.h"
class QPixmapWrap : public Napi::ObjectWrap<QPixmapWrap> {
private:
std::unique_ptr<QPixmap> instance;
public:
static Napi::FunctionReference constructor;
static Napi::Object init(Napi::Env env, Napi::Object exports);
QPixmapWrap(const Napi::CallbackInfo& info);
~QPixmapWrap();
QPixmap* getInternalInstance();
// Wrapped methods
Napi::Value load(const Napi::CallbackInfo& info);
Napi::Value loadFromData(const Napi::CallbackInfo& info);
Napi::Value save(const Napi::CallbackInfo& info);
Napi::Value scaled(const Napi::CallbackInfo& info);
Napi::Value height(const Napi::CallbackInfo& info);
Napi::Value width(const Napi::CallbackInfo& info);
COMPONENT_WRAPPED_METHODS_DECLARATION
};
namespace StaticQPixmapWrapMethods {
Napi::Value fromQVariant(const Napi::CallbackInfo& info);
} // namespace StaticQPixmapWrapMethods