Massive C++ wrapper update
This commit is contained in:
parent
f3d7d73acc
commit
6aa3f00fa3
@ -13,8 +13,7 @@ namespace extrautils {
|
||||
DLL_EXPORT QVariant* convertToQVariant(Napi::Env& env, Napi::Value& value);
|
||||
DLL_EXPORT bool isNapiValueInt(Napi::Env& env, Napi::Value& num);
|
||||
DLL_EXPORT std::string getNapiObjectClassName(Napi::Object& object);
|
||||
DLL_EXPORT void* configureQWidget(QWidget* widget, YGNodeRef node,
|
||||
bool isLeafNode = false);
|
||||
DLL_EXPORT void* configureQWidget(QWidget* widget, bool isLeafNode = false);
|
||||
DLL_EXPORT void* configureQObject(QObject* object);
|
||||
DLL_EXPORT void* configureComponent(void* component);
|
||||
DLL_EXPORT uint64_t hashPointerTo53bit(const void* input);
|
||||
|
||||
@ -14,7 +14,6 @@ class DLL_EXPORT QItemSelectionModelWrap
|
||||
|
||||
private:
|
||||
QPointer<QItemSelectionModel> instance;
|
||||
bool disableDeletion;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
|
||||
@ -5,13 +5,13 @@
|
||||
#include <QMimeData>
|
||||
|
||||
#include "Extras/Export/export.h"
|
||||
#include "core/Component/component_macro.h"
|
||||
#include "QtCore/QObject/qobject_macro.h"
|
||||
|
||||
class DLL_EXPORT QMimeDataWrap : public Napi::ObjectWrap<QMimeDataWrap> {
|
||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||
|
||||
private:
|
||||
std::unique_ptr<QMimeData> instance;
|
||||
QPointer<QMimeData> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QObjectWrap : public Napi::ObjectWrap<QObjectWrap> {
|
||||
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NObject> instance;
|
||||
QPointer<QObject> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QObjectWrap(const Napi::CallbackInfo& info);
|
||||
~QObjectWrap();
|
||||
NObject* getInternalInstance();
|
||||
QObject* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
static Napi::Object wrapFunc(Napi::Env env, QObject* qobject);
|
||||
|
||||
@ -22,13 +22,13 @@ class DLL_EXPORT QDragWrap : public Napi::ObjectWrap<QDragWrap> {
|
||||
// except that it is automatically cleared when the referenced object is
|
||||
// destroyed (unlike normal C++ pointers, which become "dangling pointers" in
|
||||
// such cases). T must be a subclass of QObject.
|
||||
QPointer<NDrag> instance;
|
||||
QPointer<QDrag> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QDragWrap(const Napi::CallbackInfo& info);
|
||||
~QDragWrap();
|
||||
NDrag* getInternalInstance();
|
||||
QDrag* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
|
||||
|
||||
@ -145,9 +145,7 @@
|
||||
Napi::Value selectionModel(const Napi::CallbackInfo& info) { \
|
||||
Napi::Env env = info.Env(); \
|
||||
QItemSelectionModel* model = this->instance->selectionModel(); \
|
||||
auto modelExt = Napi::External<QItemSelectionModel>::New(env, model); \
|
||||
auto instance = QItemSelectionModelWrap::constructor.New({modelExt}); \
|
||||
return instance; \
|
||||
return WrapperCache::instance.getWrapper(env, model); \
|
||||
} \
|
||||
Napi::Value isPersistentEditorOpen(const Napi::CallbackInfo& info) { \
|
||||
Napi::Env env = info.Env(); \
|
||||
|
||||
@ -58,9 +58,7 @@
|
||||
Napi::Value viewport(const Napi::CallbackInfo& info) { \
|
||||
Napi::Env env = info.Env(); \
|
||||
QWidget* viewPort = this->instance->viewport(); \
|
||||
NWidget* nviewPort = reinterpret_cast<NWidget*>(viewPort); \
|
||||
auto instance = QWidgetWrap::constructor.New( \
|
||||
{Napi::External<NWidget>::New(env, nviewPort)}); \
|
||||
auto instance = WrapperCache::instance.getWrapper(env, viewPort); \
|
||||
return instance; \
|
||||
}
|
||||
|
||||
|
||||
@ -11,14 +11,13 @@ class DLL_EXPORT QActionWrap : public Napi::ObjectWrap<QActionWrap> {
|
||||
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||
|
||||
private:
|
||||
QPointer<NAction> instance;
|
||||
bool disableDeletion;
|
||||
QPointer<QAction> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QActionWrap(const Napi::CallbackInfo& info);
|
||||
~QActionWrap();
|
||||
NAction* getInternalInstance();
|
||||
QAction* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@
|
||||
class DLL_EXPORT QBoxLayoutWrap : public Napi::ObjectWrap<QBoxLayoutWrap> {
|
||||
QLAYOUT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NBoxLayout> instance;
|
||||
QPointer<QBoxLayout> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QBoxLayoutWrap(const Napi::CallbackInfo& info);
|
||||
~QBoxLayoutWrap();
|
||||
NBoxLayout* getInternalInstance();
|
||||
QBoxLayout* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -9,13 +9,13 @@
|
||||
#include "nbuttongroup.hpp"
|
||||
class DLL_EXPORT QButtonGroupWrap : public Napi::ObjectWrap<QButtonGroupWrap> {
|
||||
private:
|
||||
QPointer<NButtonGroup> instance;
|
||||
QPointer<QButtonGroup> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QButtonGroupWrap(const Napi::CallbackInfo& info);
|
||||
~QButtonGroupWrap();
|
||||
NButtonGroup* getInternalInstance();
|
||||
QButtonGroup* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QCalendarWidgetWrap
|
||||
: public Napi::ObjectWrap<QCalendarWidgetWrap> {
|
||||
private:
|
||||
QPointer<NCalendarWidget> instance;
|
||||
QPointer<QCalendarWidget> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QCalendarWidgetWrap(const Napi::CallbackInfo &info);
|
||||
~QCalendarWidgetWrap();
|
||||
NCalendarWidget *getInternalInstance();
|
||||
QCalendarWidget *getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,14 +12,13 @@
|
||||
class DLL_EXPORT QCheckBoxWrap : public Napi::ObjectWrap<QCheckBoxWrap> {
|
||||
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NCheckBox> instance;
|
||||
bool disableDeletion;
|
||||
QPointer<QCheckBox> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QCheckBoxWrap(const Napi::CallbackInfo& info);
|
||||
~QCheckBoxWrap();
|
||||
NCheckBox* getInternalInstance();
|
||||
QCheckBox* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QColorDialogWrap : public Napi::ObjectWrap<QColorDialogWrap> {
|
||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NColorDialog> instance;
|
||||
QPointer<QColorDialog> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QColorDialogWrap(const Napi::CallbackInfo& info);
|
||||
~QColorDialogWrap();
|
||||
NColorDialog* getInternalInstance();
|
||||
QColorDialog* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QComboBoxWrap : public Napi::ObjectWrap<QComboBoxWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NComboBox> instance;
|
||||
QPointer<QComboBox> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QComboBoxWrap(const Napi::CallbackInfo& info);
|
||||
~QComboBoxWrap();
|
||||
NComboBox* getInternalInstance();
|
||||
QComboBox* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QDateEditWrap : public Napi::ObjectWrap<QDateEditWrap> {
|
||||
QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NDateEdit> instance;
|
||||
QPointer<QDateEdit> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QDateEditWrap(const Napi::CallbackInfo &info);
|
||||
~QDateEditWrap();
|
||||
NDateEdit *getInternalInstance();
|
||||
QDateEdit *getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@ class DLL_EXPORT QDateTimeEditWrap
|
||||
: public Napi::ObjectWrap<QDateTimeEditWrap> {
|
||||
QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NDateTimeEdit> instance;
|
||||
QPointer<QDateTimeEdit> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QDateTimeEditWrap(const Napi::CallbackInfo &info);
|
||||
~QDateTimeEditWrap();
|
||||
NDateTimeEdit *getInternalInstance();
|
||||
QDateTimeEdit *getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@
|
||||
class DLL_EXPORT QDialWrap : public Napi::ObjectWrap<QDialWrap> {
|
||||
QABSTRACTSLIDER_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NDial> instance;
|
||||
QPointer<QDial> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QDialWrap(const Napi::CallbackInfo& info);
|
||||
~QDialWrap();
|
||||
NDial* getInternalInstance();
|
||||
QDial* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QDialogWrap : public Napi::ObjectWrap<QDialogWrap> {
|
||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NDialog> instance;
|
||||
QPointer<QDialog> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QDialogWrap(const Napi::CallbackInfo& info);
|
||||
~QDialogWrap();
|
||||
NDialog* getInternalInstance();
|
||||
QDialog* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@ class DLL_EXPORT QDoubleSpinBoxWrap
|
||||
: public Napi::ObjectWrap<QDoubleSpinBoxWrap> {
|
||||
QABSTRACTSPINBOX_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NDoubleSpinBox> instance;
|
||||
QPointer<QDoubleSpinBox> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QDoubleSpinBoxWrap(const Napi::CallbackInfo& info);
|
||||
~QDoubleSpinBoxWrap();
|
||||
NDoubleSpinBox* getInternalInstance();
|
||||
QDoubleSpinBox* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@ class DLL_EXPORT QErrorMessageWrap
|
||||
: public Napi::ObjectWrap<QErrorMessageWrap> {
|
||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NErrorMessage> instance;
|
||||
QPointer<QErrorMessage> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QErrorMessageWrap(const Napi::CallbackInfo& info);
|
||||
~QErrorMessageWrap();
|
||||
NErrorMessage* getInternalInstance();
|
||||
QErrorMessage* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QFileDialogWrap : public Napi::ObjectWrap<QFileDialogWrap> {
|
||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NFileDialog> instance;
|
||||
QPointer<QFileDialog> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QFileDialogWrap(const Napi::CallbackInfo& info);
|
||||
~QFileDialogWrap();
|
||||
NFileDialog* getInternalInstance();
|
||||
QFileDialog* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QFontDialogWrap : public Napi::ObjectWrap<QFontDialogWrap> {
|
||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NFontDialog> instance;
|
||||
QPointer<QFontDialog> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QFontDialogWrap(const Napi::CallbackInfo& info);
|
||||
~QFontDialogWrap();
|
||||
NFontDialog* getInternalInstance();
|
||||
QFontDialog* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QFrameWrap : public Napi::ObjectWrap<QFrameWrap> {
|
||||
QFRAME_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NFrame> instance;
|
||||
QPointer<QFrame> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QFrameWrap(const Napi::CallbackInfo& info);
|
||||
~QFrameWrap();
|
||||
NFrame* getInternalInstance();
|
||||
QFrame* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#include <QPointer>
|
||||
|
||||
#include "Extras/Export/export.h"
|
||||
#include "Extras/Utils/nutils.h"
|
||||
#include "QtWidgets/QGraphicsEffect/qgraphicseffect_macro.h"
|
||||
#include "ngraphicsblureffect.hpp"
|
||||
|
||||
@ -12,13 +13,13 @@ class DLL_EXPORT QGraphicsBlurEffectWrap
|
||||
: public Napi::ObjectWrap<QGraphicsBlurEffectWrap> {
|
||||
QGRAPHICSEFFECT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NGraphicsBlurEffect> instance;
|
||||
QPointer<QGraphicsBlurEffect> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QGraphicsBlurEffectWrap(const Napi::CallbackInfo& info);
|
||||
~QGraphicsBlurEffectWrap();
|
||||
NGraphicsBlurEffect* getInternalInstance();
|
||||
QGraphicsBlurEffect* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@ class DLL_EXPORT QGraphicsDropShadowEffectWrap
|
||||
: public Napi::ObjectWrap<QGraphicsDropShadowEffectWrap> {
|
||||
QGRAPHICSEFFECT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NGraphicsDropShadowEffect> instance;
|
||||
QPointer<QGraphicsDropShadowEffect> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QGraphicsDropShadowEffectWrap(const Napi::CallbackInfo& info);
|
||||
~QGraphicsDropShadowEffectWrap();
|
||||
NGraphicsDropShadowEffect* getInternalInstance();
|
||||
QGraphicsDropShadowEffect* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@
|
||||
class DLL_EXPORT QGridLayoutWrap : public Napi::ObjectWrap<QGridLayoutWrap> {
|
||||
QLAYOUT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NGridLayout> instance;
|
||||
QPointer<QGridLayout> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QGridLayoutWrap(const Napi::CallbackInfo& info);
|
||||
~QGridLayoutWrap();
|
||||
NGridLayout* getInternalInstance();
|
||||
QGridLayout* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QGroupBoxWrap : public Napi::ObjectWrap<QGroupBoxWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NGroupBox> instance;
|
||||
QPointer<QGroupBox> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QGroupBoxWrap(const Napi::CallbackInfo& info);
|
||||
~QGroupBoxWrap();
|
||||
NGroupBox* getInternalInstance();
|
||||
QGroupBox* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -45,7 +45,6 @@ class DLL_EXPORT QHeaderViewWrap : public Napi::ObjectWrap<QHeaderViewWrap> {
|
||||
|
||||
private:
|
||||
QPointer<QHeaderView> instance;
|
||||
bool disableDeletion;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QInputDialogWrap : public Napi::ObjectWrap<QInputDialogWrap> {
|
||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NInputDialog> instance;
|
||||
QPointer<QInputDialog> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QInputDialogWrap(const Napi::CallbackInfo& info);
|
||||
~QInputDialogWrap();
|
||||
NInputDialog* getInternalInstance();
|
||||
QInputDialog* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// members
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QLCDNumberWrap : public Napi::ObjectWrap<QLCDNumberWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NLCDNumber> instance;
|
||||
QPointer<QLCDNumber> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QLCDNumberWrap(const Napi::CallbackInfo& info);
|
||||
~QLCDNumberWrap();
|
||||
NLCDNumber* getInternalInstance();
|
||||
QLCDNumber* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@
|
||||
class DLL_EXPORT QLabelWrap : public Napi::ObjectWrap<QLabelWrap> {
|
||||
QFRAME_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NLabel> instance;
|
||||
QPointer<QLabel> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QLabelWrap(const Napi::CallbackInfo& info);
|
||||
~QLabelWrap();
|
||||
NLabel* getInternalInstance();
|
||||
QLabel* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -13,13 +13,13 @@
|
||||
class DLL_EXPORT QLayoutWrap : public Napi::ObjectWrap<QLayoutWrap> {
|
||||
QLAYOUT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NLayout> instance;
|
||||
QPointer<QLayout> instance;
|
||||
|
||||
public:
|
||||
static void init(Napi::Env env);
|
||||
static void init(Napi::Env env, Napi::Object exports);
|
||||
QLayoutWrap(const Napi::CallbackInfo& info);
|
||||
~QLayoutWrap();
|
||||
NLayout* getInternalInstance();
|
||||
QLayout* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QLineEditWrap : public Napi::ObjectWrap<QLineEditWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NLineEdit> instance;
|
||||
QPointer<QLineEdit> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QLineEditWrap(const Napi::CallbackInfo& info);
|
||||
~QLineEditWrap();
|
||||
NLineEdit* getInternalInstance();
|
||||
QLineEdit* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,14 +11,13 @@
|
||||
class DLL_EXPORT QListViewWrap : public Napi::ObjectWrap<QListViewWrap> {
|
||||
QLISTVIEW_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NListView> instance;
|
||||
bool disableDeletion;
|
||||
QPointer<QListView> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QListViewWrap(const Napi::CallbackInfo& info);
|
||||
~QListViewWrap();
|
||||
NListView* getInternalInstance();
|
||||
QListView* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@
|
||||
class DLL_EXPORT QListWidgetWrap : public Napi::ObjectWrap<QListWidgetWrap> {
|
||||
QLISTVIEW_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NListWidget> instance;
|
||||
QPointer<QListWidget> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QListWidgetWrap(const Napi::CallbackInfo& info);
|
||||
~QListWidgetWrap();
|
||||
NListWidget* getInternalInstance();
|
||||
QListWidget* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@ class DLL_EXPORT QMainWindowWrap : public Napi::ObjectWrap<QMainWindowWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
|
||||
private:
|
||||
QPointer<NMainWindow> instance;
|
||||
QPointer<QMainWindow> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QMainWindowWrap(const Napi::CallbackInfo& info);
|
||||
~QMainWindowWrap();
|
||||
NMainWindow* getInternalInstance();
|
||||
QMainWindow* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -17,10 +17,8 @@ class DLL_EXPORT NMenu : public QMenu, public NodeWidget {
|
||||
QObject::connect(this, &QMenu::triggered, [=](QAction* action) {
|
||||
Napi::Env env = this->emitOnNode.Env();
|
||||
Napi::HandleScope scope(env);
|
||||
auto actionInstance = QActionWrap::constructor.New(
|
||||
{Napi::External<QAction>::New(env, action)});
|
||||
this->emitOnNode.Call(
|
||||
{Napi::String::New(env, "triggered"), actionInstance});
|
||||
auto instance = WrapperCache::instance.getWrapper(env, action);
|
||||
this->emitOnNode.Call({Napi::String::New(env, "triggered"), instance});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@ -10,13 +10,13 @@
|
||||
class DLL_EXPORT QMenuWrap : public Napi::ObjectWrap<QMenuWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NMenu> instance;
|
||||
QPointer<QMenu> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QMenuWrap(const Napi::CallbackInfo& info);
|
||||
~QMenuWrap();
|
||||
NMenu* getInternalInstance();
|
||||
QMenu* getInternalInstance();
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||
|
||||
@ -10,13 +10,13 @@
|
||||
class DLL_EXPORT QMenuBarWrap : public Napi::ObjectWrap<QMenuBarWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NMenuBar> instance;
|
||||
QPointer<QMenuBar> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QMenuBarWrap(const Napi::CallbackInfo& info);
|
||||
~QMenuBarWrap();
|
||||
NMenuBar* getInternalInstance();
|
||||
QMenuBar* getInternalInstance();
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
Napi::Value addMenu(const Napi::CallbackInfo& info);
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QMessageBoxWrap : public Napi::ObjectWrap<QMessageBoxWrap> {
|
||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NMessageBox> instance;
|
||||
QPointer<QMessageBox> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QMessageBoxWrap(const Napi::CallbackInfo& info);
|
||||
~QMessageBoxWrap();
|
||||
NMessageBox* getInternalInstance();
|
||||
QMessageBox* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -13,13 +13,13 @@ class DLL_EXPORT QPlainTextEditWrap
|
||||
: public Napi::ObjectWrap<QPlainTextEditWrap> {
|
||||
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NPlainTextEdit> instance;
|
||||
QPointer<QPlainTextEdit> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QPlainTextEditWrap(const Napi::CallbackInfo &info);
|
||||
~QPlainTextEditWrap();
|
||||
NPlainTextEdit *getInternalInstance();
|
||||
QPlainTextEdit *getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QProgressBarWrap : public Napi::ObjectWrap<QProgressBarWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NProgressBar> instance;
|
||||
QPointer<QProgressBar> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QProgressBarWrap(const Napi::CallbackInfo& info);
|
||||
~QProgressBarWrap();
|
||||
NProgressBar* getInternalInstance();
|
||||
QProgressBar* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@ class DLL_EXPORT QProgressDialogWrap
|
||||
: public Napi::ObjectWrap<QProgressDialogWrap> {
|
||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NProgressDialog> instance;
|
||||
QPointer<QProgressDialog> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QProgressDialogWrap(const Napi::CallbackInfo& info);
|
||||
~QProgressDialogWrap();
|
||||
NProgressDialog* getInternalInstance();
|
||||
QProgressDialog* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,14 +12,13 @@
|
||||
class DLL_EXPORT QPushButtonWrap : public Napi::ObjectWrap<QPushButtonWrap> {
|
||||
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NPushButton> instance;
|
||||
bool disableDeletion;
|
||||
QPointer<QPushButton> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QPushButtonWrap(const Napi::CallbackInfo& info);
|
||||
~QPushButtonWrap();
|
||||
NPushButton* getInternalInstance();
|
||||
QPushButton* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -13,14 +13,13 @@ class DLL_EXPORT QRadioButtonWrap : public Napi::ObjectWrap<QRadioButtonWrap> {
|
||||
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
||||
|
||||
private:
|
||||
QPointer<NRadioButton> instance;
|
||||
bool disableDeletion;
|
||||
QPointer<QRadioButton> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QRadioButtonWrap(const Napi::CallbackInfo& info);
|
||||
~QRadioButtonWrap();
|
||||
NRadioButton* getInternalInstance();
|
||||
QRadioButton* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,20 +11,20 @@
|
||||
class DLL_EXPORT QScrollAreaWrap : public Napi::ObjectWrap<QScrollAreaWrap> {
|
||||
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NScrollArea> instance;
|
||||
YGNodeRef scrollNode;
|
||||
QPointer<QScrollArea> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QScrollAreaWrap(const Napi::CallbackInfo& info);
|
||||
~QScrollAreaWrap();
|
||||
NScrollArea* getInternalInstance();
|
||||
QScrollArea* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
Napi::Value ensureVisible(const Napi::CallbackInfo& info);
|
||||
Napi::Value ensureWidgetVisible(const Napi::CallbackInfo& info);
|
||||
Napi::Value setWidget(const Napi::CallbackInfo& info);
|
||||
Napi::Value widget(const Napi::CallbackInfo& info);
|
||||
Napi::Value takeWidget(const Napi::CallbackInfo& info);
|
||||
Napi::Value setViewportMargins(const Napi::CallbackInfo& info);
|
||||
Napi::Value viewportMargins(const Napi::CallbackInfo& info);
|
||||
|
||||
@ -12,13 +12,13 @@
|
||||
class DLL_EXPORT QScrollBarWrap : public Napi::ObjectWrap<QScrollBarWrap> {
|
||||
QABSTRACTSLIDER_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NScrollBar> instance;
|
||||
QPointer<QScrollBar> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QScrollBarWrap(const Napi::CallbackInfo& info);
|
||||
~QScrollBarWrap();
|
||||
NScrollBar* getInternalInstance();
|
||||
QScrollBar* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QShortcutWrap : public Napi::ObjectWrap<QShortcutWrap> {
|
||||
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NShortcut> instance;
|
||||
QPointer<QShortcut> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QShortcutWrap(const Napi::CallbackInfo& info);
|
||||
~QShortcutWrap();
|
||||
NShortcut* getInternalInstance();
|
||||
QShortcut* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@
|
||||
class DLL_EXPORT QSliderWrap : public Napi::ObjectWrap<QSliderWrap> {
|
||||
QABSTRACTSLIDER_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NSlider> instance;
|
||||
QPointer<QSlider> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QSliderWrap(const Napi::CallbackInfo& info);
|
||||
~QSliderWrap();
|
||||
NSlider* getInternalInstance();
|
||||
QSlider* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QSpinBoxWrap : public Napi::ObjectWrap<QSpinBoxWrap> {
|
||||
QABSTRACTSPINBOX_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NSpinBox> instance;
|
||||
QPointer<QSpinBox> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QSpinBoxWrap(const Napi::CallbackInfo &info);
|
||||
~QSpinBoxWrap();
|
||||
NSpinBox *getInternalInstance();
|
||||
QSpinBox *getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QSplitterWrap : public Napi::ObjectWrap<QSplitterWrap> {
|
||||
QFRAME_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NSplitter> instance;
|
||||
QPointer<QSplitter> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QSplitterWrap(const Napi::CallbackInfo& info);
|
||||
~QSplitterWrap();
|
||||
NSplitter* getInternalInstance();
|
||||
QSplitter* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@ class DLL_EXPORT QStackedWidgetWrap
|
||||
: public Napi::ObjectWrap<QStackedWidgetWrap> {
|
||||
QFRAME_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NStackedWidget> instance;
|
||||
QPointer<QStackedWidget> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QStackedWidgetWrap(const Napi::CallbackInfo &info);
|
||||
~QStackedWidgetWrap();
|
||||
NStackedWidget *getInternalInstance();
|
||||
QStackedWidget *getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -10,13 +10,13 @@
|
||||
class DLL_EXPORT QStandardItemModelWrap
|
||||
: public Napi::ObjectWrap<QStandardItemModelWrap> {
|
||||
private:
|
||||
QPointer<NStandardItemModel> instance;
|
||||
QPointer<QStandardItemModel> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QStandardItemModelWrap(const Napi::CallbackInfo& info);
|
||||
~QStandardItemModelWrap();
|
||||
NStandardItemModel* getInternalInstance();
|
||||
QStandardItemModel* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,7 +12,7 @@ class DLL_EXPORT QStatusBarWrap : public Napi::ObjectWrap<QStatusBarWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
|
||||
private:
|
||||
QPointer<NStatusBar> instance;
|
||||
QPointer<QStatusBar> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
@ -22,7 +22,7 @@ class DLL_EXPORT QStatusBarWrap : public Napi::ObjectWrap<QStatusBarWrap> {
|
||||
QStatusBarWrap(const Napi::CallbackInfo &info);
|
||||
~QStatusBarWrap();
|
||||
|
||||
NStatusBar *getInternalInstance();
|
||||
QStatusBar *getInternalInstance();
|
||||
|
||||
// Wrapped methods
|
||||
Napi::Value addPermanentWidget(const Napi::CallbackInfo &info);
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QSvgWidgetWrap : public Napi::ObjectWrap<QSvgWidgetWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NSvgWidget> instance;
|
||||
QPointer<QSvgWidget> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QSvgWidgetWrap(const Napi::CallbackInfo& info);
|
||||
~QSvgWidgetWrap();
|
||||
NSvgWidget* getInternalInstance();
|
||||
QSvgWidget* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@ class DLL_EXPORT QSystemTrayIconWrap
|
||||
: public Napi::ObjectWrap<QSystemTrayIconWrap> {
|
||||
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NSystemTrayIcon> instance;
|
||||
QPointer<QSystemTrayIcon> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QSystemTrayIconWrap(const Napi::CallbackInfo& info);
|
||||
~QSystemTrayIconWrap();
|
||||
NSystemTrayIcon* getInternalInstance();
|
||||
QSystemTrayIcon* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,14 +11,13 @@
|
||||
class DLL_EXPORT QTabBarWrap : public Napi::ObjectWrap<QTabBarWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NTabBar> instance;
|
||||
bool disableDeletion;
|
||||
QPointer<QTabBar> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QTabBarWrap(const Napi::CallbackInfo& info);
|
||||
~QTabBarWrap();
|
||||
NTabBar* getInternalInstance();
|
||||
QTabBar* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QTabWidgetWrap : public Napi::ObjectWrap<QTabWidgetWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NTabWidget> instance;
|
||||
QPointer<QTabWidget> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QTabWidgetWrap(const Napi::CallbackInfo &info);
|
||||
~QTabWidgetWrap();
|
||||
NTabWidget *getInternalInstance();
|
||||
QTabWidget *getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -181,15 +181,13 @@
|
||||
Napi::Value horizontalHeader(const Napi::CallbackInfo& info) { \
|
||||
Napi::Env env = info.Env(); \
|
||||
auto header = this->instance->horizontalHeader(); \
|
||||
auto instance = QHeaderViewWrap::constructor.New( \
|
||||
{Napi::External<QHeaderView>::New(env, header)}); \
|
||||
auto instance = WrapperCache::instance.getWrapper(env, header); \
|
||||
return instance; \
|
||||
} \
|
||||
Napi::Value verticalHeader(const Napi::CallbackInfo& info) { \
|
||||
Napi::Env env = info.Env(); \
|
||||
auto header = this->instance->verticalHeader(); \
|
||||
auto instance = QHeaderViewWrap::constructor.New( \
|
||||
{Napi::External<QHeaderView>::New(env, header)}); \
|
||||
auto instance = WrapperCache::instance.getWrapper(env, header); \
|
||||
return instance; \
|
||||
}
|
||||
|
||||
|
||||
@ -11,14 +11,13 @@
|
||||
class DLL_EXPORT QTableViewWrap : public Napi::ObjectWrap<QTableViewWrap> {
|
||||
QTABLEVIEW_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NTableView> instance;
|
||||
bool disableDeletion;
|
||||
QPointer<QTableView> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QTableViewWrap(const Napi::CallbackInfo& info);
|
||||
~QTableViewWrap();
|
||||
NTableView* getInternalInstance();
|
||||
QTableView* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QTableWidgetWrap : public Napi::ObjectWrap<QTableWidgetWrap> {
|
||||
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NTableWidget> instance;
|
||||
QPointer<QTableWidget> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QTableWidgetWrap(const Napi::CallbackInfo& info);
|
||||
~QTableWidgetWrap();
|
||||
NTableWidget* getInternalInstance();
|
||||
QTableWidget* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QTextBrowserWrap : public Napi::ObjectWrap<QTextBrowserWrap> {
|
||||
QTEXTEDIT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NTextBrowser> instance;
|
||||
QPointer<QTextBrowser> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QTextBrowserWrap(const Napi::CallbackInfo& info);
|
||||
~QTextBrowserWrap();
|
||||
NTextBrowser* getInternalInstance();
|
||||
QTextBrowser* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
class DLL_EXPORT QTextEditWrap : public Napi::ObjectWrap<QTextEditWrap> {
|
||||
QTEXTEDIT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NTextEdit> instance;
|
||||
QPointer<QTextEdit> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QTextEditWrap(const Napi::CallbackInfo& info);
|
||||
~QTextEditWrap();
|
||||
NTextEdit* getInternalInstance();
|
||||
QTextEdit* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -12,13 +12,13 @@
|
||||
class DLL_EXPORT QTimeEditWrap : public Napi::ObjectWrap<QTimeEditWrap> {
|
||||
QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NTimeEdit> instance;
|
||||
QPointer<QTimeEdit> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QTimeEditWrap(const Napi::CallbackInfo &info);
|
||||
~QTimeEditWrap();
|
||||
NTimeEdit *getInternalInstance();
|
||||
QTimeEdit *getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -21,11 +21,7 @@ class DLL_EXPORT NToolButton : public QToolButton, public NodeWidget {
|
||||
QObject::connect(this, &QToolButton::triggered, [=](QAction* action) {
|
||||
Napi::Env env = this->emitOnNode.Env();
|
||||
Napi::HandleScope scope(env);
|
||||
|
||||
// disable deletion of the native instance for these by passing true
|
||||
auto instance = QActionWrap::constructor.New(
|
||||
{Napi::External<QAction>::New(env, action),
|
||||
Napi::Boolean::New(env, true)});
|
||||
auto instance = WrapperCache::instance.getWrapper(env, action);
|
||||
this->emitOnNode.Call({Napi::String::New(env, "triggered"), instance});
|
||||
});
|
||||
}
|
||||
|
||||
@ -12,14 +12,13 @@
|
||||
class DLL_EXPORT QToolButtonWrap : public Napi::ObjectWrap<QToolButtonWrap> {
|
||||
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NToolButton> instance;
|
||||
bool disableDeletion;
|
||||
QPointer<QToolButton> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QToolButtonWrap(const Napi::CallbackInfo& info);
|
||||
~QToolButtonWrap();
|
||||
NToolButton* getInternalInstance();
|
||||
QToolButton* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
class DLL_EXPORT QTreeWidgetWrap : public Napi::ObjectWrap<QTreeWidgetWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NTreeWidget> instance;
|
||||
QPointer<QTreeWidget> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
@ -20,7 +20,7 @@ class DLL_EXPORT QTreeWidgetWrap : public Napi::ObjectWrap<QTreeWidgetWrap> {
|
||||
|
||||
~QTreeWidgetWrap();
|
||||
|
||||
NTreeWidget *getInternalInstance();
|
||||
QTreeWidget *getInternalInstance();
|
||||
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
|
||||
@ -27,13 +27,13 @@ class DLL_EXPORT NodeWidgetWrap : public Napi::ObjectWrap<NodeWidgetWrap> {
|
||||
class DLL_EXPORT QWidgetWrap : public Napi::ObjectWrap<QWidgetWrap> {
|
||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
private:
|
||||
QPointer<NWidget> instance;
|
||||
QPointer<QWidget> instance;
|
||||
|
||||
public:
|
||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||
QWidgetWrap(const Napi::CallbackInfo& info);
|
||||
~QWidgetWrap();
|
||||
NWidget* getInternalInstance();
|
||||
QWidget* getInternalInstance();
|
||||
// class constructor
|
||||
static Napi::FunctionReference constructor;
|
||||
// wrapped methods
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QMapIterator>
|
||||
#include <QtCore/QObject>
|
||||
|
||||
#include "Extras/Export/export.h"
|
||||
@ -75,16 +76,33 @@ class DLL_EXPORT WrapperCache : public QObject {
|
||||
}
|
||||
}
|
||||
|
||||
QString className(qobject->metaObject()->className());
|
||||
if (this->wrapperRegistry.contains(className)) {
|
||||
Napi::Object wrapper = this->wrapperRegistry[className](env, qobject);
|
||||
store(env, ptrHash, qobject, wrapper, !keepAlive);
|
||||
return wrapper;
|
||||
} else {
|
||||
qDebug() << "NodeGui: Unable to find wrapper for instance of class "
|
||||
<< className << ".\n\n";
|
||||
// Might have to climb up the class hierarchy looking for a wrapper type we
|
||||
// support. This makes us immune to internal Qt subclasses, i.e.
|
||||
// `QWidgetWindow` when `QWindow` was expected.
|
||||
const QMetaObject* meta = qobject->metaObject();
|
||||
while (meta != nullptr) {
|
||||
QString className(meta->className());
|
||||
if (this->wrapperRegistry.contains(className)) {
|
||||
Napi::Object wrapper = this->wrapperRegistry[className](env, qobject);
|
||||
store(env, ptrHash, qobject, wrapper, !keepAlive);
|
||||
return wrapper;
|
||||
}
|
||||
meta = meta->superClass();
|
||||
}
|
||||
|
||||
QMapIterator<QString, WrapFunc> i(this->wrapperRegistry);
|
||||
QString allQWrapperNames;
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
allQWrapperNames.append(i.key());
|
||||
allQWrapperNames.append(", ");
|
||||
}
|
||||
|
||||
qDebug() << "NodeGui: Unable to find wrapper for instance of C++ class "
|
||||
<< qobject->metaObject()->className()
|
||||
<< ". (The following C++ classes are recognized: "
|
||||
<< allQWrapperNames << ")";
|
||||
|
||||
return env.Null();
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
|
||||
#include "core/Component/component_wrap.h"
|
||||
#include "core/FlexLayout/flexutils.h"
|
||||
#include "core/YogaWidget/yogawidget.h"
|
||||
|
||||
bool extrautils::isNapiValueInt(Napi::Env& env, Napi::Value& num) {
|
||||
return env.Global()
|
||||
@ -101,12 +102,16 @@ QVariant* extrautils::convertToQVariant(Napi::Env& env, Napi::Value& value) {
|
||||
}
|
||||
|
||||
void* extrautils::configureComponent(void* component) { return component; }
|
||||
|
||||
void* extrautils::configureQObject(QObject* object) {
|
||||
return configureComponent(object);
|
||||
}
|
||||
void* extrautils::configureQWidget(QWidget* widget, YGNodeRef node,
|
||||
bool isLeafNode) {
|
||||
flexutils::configureFlexNode(widget, node, isLeafNode);
|
||||
|
||||
void* extrautils::configureQWidget(QWidget* widget, bool isLeafNode) {
|
||||
YogaWidget* yogaWidget = dynamic_cast<YogaWidget*>(widget);
|
||||
if (yogaWidget) {
|
||||
flexutils::configureFlexNode(widget, yogaWidget->getFlexNode(), isLeafNode);
|
||||
}
|
||||
return configureQObject(widget);
|
||||
}
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ Napi::Object QAbstractItemModelWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(QAbstractItemModelWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(NAbstractItemModel, QAbstractItemModelWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
@ -58,7 +59,21 @@ QAbstractItemModelWrap::~QAbstractItemModelWrap() {
|
||||
QAbstractItemModelWrap::QAbstractItemModelWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QAbstractItemModelWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
this->instance = new NAbstractItemModel();
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NAbstractItemModel();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<NAbstractItemModel>>().Data();
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env,
|
||||
"NodeGui: QAbstractItemModelWrap: Wrong number of "
|
||||
"arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
}
|
||||
|
||||
Napi::Value QAbstractItemModelWrap::initNodeDispatcher(
|
||||
|
||||
@ -38,6 +38,7 @@ Napi::Object QItemSelectionModelWrap::init(Napi::Env env,
|
||||
QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(QItemSelectionModelWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QItemSelectionModel, QItemSelectionModelWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
@ -46,20 +47,33 @@ QItemSelectionModel* QItemSelectionModelWrap::getInternalInstance() {
|
||||
}
|
||||
|
||||
QItemSelectionModelWrap::~QItemSelectionModelWrap() {
|
||||
if (!this->disableDeletion) {
|
||||
extrautils::safeDelete(this->instance);
|
||||
}
|
||||
extrautils::safeDelete(this->instance);
|
||||
}
|
||||
|
||||
QItemSelectionModelWrap::QItemSelectionModelWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QItemSelectionModelWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NItemSelectionModel();
|
||||
this->disableDeletion = false;
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QItemSelectionModel>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
// Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
// QObjectWrap* parentObjectWrap =
|
||||
// Napi::ObjectWrap<QObjectWrap>::Unwrap(parentObject);
|
||||
// this->instance = new
|
||||
// NItemSelectionModel(parentObjectWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
this->instance = info[0].As<Napi::External<QItemSelectionModel>>().Data();
|
||||
this->disableDeletion = true;
|
||||
Napi::TypeError::New(env,
|
||||
"NodeGui: QItemSelectionModelWrap: Wrong number of "
|
||||
"arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
}
|
||||
Napi::Value QItemSelectionModelWrap::columnIntersectsSelection(
|
||||
|
||||
@ -10,7 +10,6 @@ Napi::Object QMimeDataWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
char CLASSNAME[] = "QMimeData";
|
||||
Napi::Function func =
|
||||
DefineClass(env, CLASSNAME,
|
||||
|
||||
{InstanceMethod("clear", &QMimeDataWrap::clear),
|
||||
InstanceMethod("hasColor", &QMimeDataWrap::hasColor),
|
||||
InstanceMethod("hasHtml", &QMimeDataWrap::hasHtml),
|
||||
@ -25,43 +24,31 @@ Napi::Object QMimeDataWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
InstanceMethod("setUrls", &QMimeDataWrap::setUrls),
|
||||
InstanceMethod("text", &QMimeDataWrap::text),
|
||||
InstanceMethod("urls", &QMimeDataWrap::urls),
|
||||
|
||||
COMPONENT_WRAPPED_METHODS_EXPORT_DEFINE(QMimeDataWrap)});
|
||||
QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(QMimeDataWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QMimeData, QMimeDataWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
QMimeData* QMimeDataWrap::getInternalInstance() { return this->instance.get(); }
|
||||
QMimeData* QMimeDataWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QMimeDataWrap::~QMimeDataWrap() { this->instance.reset(); }
|
||||
QMimeDataWrap::~QMimeDataWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
QMimeDataWrap::QMimeDataWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QMimeDataWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::External<QMimeData> eventObject =
|
||||
info[0].As<Napi::External<QMimeData>>();
|
||||
this->instance = std::make_unique<QMimeData>();
|
||||
// Copy data to our instance
|
||||
QMimeData* mimeReference = eventObject.Data();
|
||||
this->cloneFromMimeData(mimeReference);
|
||||
// foreach(QString format, mimeReference->formats())
|
||||
// {
|
||||
// // Retrieving data
|
||||
// QByteArray data = mimeReference->data(format);
|
||||
// // Checking for custom MIME types
|
||||
// if(format.startsWith("application/x-qt"))
|
||||
// {
|
||||
// // Retrieving true format name
|
||||
// int indexBegin = format.indexOf('"') + 1;
|
||||
// int indexEnd = format.indexOf('"', indexBegin);
|
||||
// format = format.mid(indexBegin, indexEnd - indexBegin);
|
||||
// }
|
||||
// this->instance->setData(format, data);
|
||||
// }
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new QMimeData();
|
||||
} else if (argCount == 1 && info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QMimeData>>().Data();
|
||||
} else {
|
||||
this->instance = std::make_unique<QMimeData>();
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QMimeDataWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureComponent(this->getInternalInstance());
|
||||
}
|
||||
|
||||
@ -12,30 +12,31 @@ Napi::Object QObjectWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
env, CLASSNAME, {QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(QObjectWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(NObject, QObjectWrap);
|
||||
QOBJECT_REGISTER_WRAPPER(QObject, QObjectWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NObject* QObjectWrap::getInternalInstance() { return this->instance; }
|
||||
QObject* QObjectWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QObjectWrap::~QObjectWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
QObjectWrap::QObjectWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QObjectWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
this->instance = info[0].As<Napi::External<NObject>>().Data();
|
||||
this->instance = info[0].As<Napi::External<QObject>>().Data();
|
||||
} else {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
QObjectWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<QObjectWrap>::Unwrap(parentObject);
|
||||
this->instance = new NObject(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else if (info.Length() == 0) {
|
||||
} else if (argCount == 0) {
|
||||
this->instance = new NObject();
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(env, "NodeGui: QObjectWrap: Wrong number of arguments")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQObject(this->getInternalInstance());
|
||||
|
||||
@ -41,13 +41,15 @@ Napi::Object QApplicationWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QApplicationWrap::QApplicationWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QApplicationWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 1) {
|
||||
this->instance = info[0].As<Napi::External<NApplication>>().Data();
|
||||
} else if (info.Length() == 0) {
|
||||
} else if (argCount == 0) {
|
||||
this->instance = new NApplication(qode::qode_argc, qode::qode_argv);
|
||||
this->_wasManuallyCreated = true;
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(env,
|
||||
"NodeGui: QApplicationWrap: Wrong number of arguments")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureComponent(this->getInternalInstance());
|
||||
|
||||
@ -32,21 +32,33 @@ Napi::Object QDragWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
COMPONENT_WRAPPED_METHODS_EXPORT_DEFINE(QDragWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QDrag, QDragWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NDrag* QDragWrap::getInternalInstance() { return this->instance; }
|
||||
QDrag* QDragWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QDragWrap::QDragWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QDragWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object wrap0_0 = info[0].As<Napi::Object>();
|
||||
QObjectWrap* wrap0_1 = Napi::ObjectWrap<QObjectWrap>::Unwrap(wrap0_0);
|
||||
QObject* dragSource = wrap0_1->getInternalInstance();
|
||||
this->instance = new NDrag(dragSource);
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NDrag(nullptr);
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QDrag>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object sourceObject = info[0].As<Napi::Object>();
|
||||
QObjectWrap* sourceObjectWrap =
|
||||
Napi::ObjectWrap<QObjectWrap>::Unwrap(sourceObject);
|
||||
this->instance = new NDrag(sourceObjectWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QDragWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureComponent(this->getInternalInstance());
|
||||
|
||||
@ -42,21 +42,27 @@ QMovieWrap::~QMovieWrap() { extrautils::safeDelete(this->instance); }
|
||||
QMovieWrap::QMovieWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QMovieWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
this->instance = new NMovie(info[0].As<Napi::External<NMovie>>().Data());
|
||||
} else {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
QMovieWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<QMovieWrap>::Unwrap(parentObject);
|
||||
this->instance = new NMovie(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NMovie();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<NMovie>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
QObjectWrap* parentObjectWrap =
|
||||
Napi::ObjectWrap<QObjectWrap>::Unwrap(parentObject);
|
||||
this->instance = new NMovie(parentObjectWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QMovieWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
QOBJECT_REGISTER_WRAPPER(QMovie, QMovieWrap);
|
||||
this->bufferDevice = QSharedPointer<QBuffer>(new QBuffer);
|
||||
this->rawData = extrautils::configureQObject(this->getInternalInstance());
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ QScreenWrap::QScreenWrap(const Napi::CallbackInfo& info)
|
||||
if (info[0].IsExternal()) {
|
||||
this->instance = info[0].As<Napi::External<QScreen>>().Data();
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Incorrect initialization of QScreenWrap")
|
||||
Napi::TypeError::New(env, "NodeGui: QScreenWrap: Incorrect initialization")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureComponent(this->getInternalInstance());
|
||||
|
||||
@ -25,7 +25,8 @@ QStyleWrap::QStyleWrap(const Napi::CallbackInfo& info)
|
||||
if (info[0].IsExternal()) {
|
||||
this->instance = info[0].As<Napi::External<QStyle>>().Data();
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Incorrect initialization of QStyleWrap")
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QStyleWrap: Incorrect initialization of QStyleWrap")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureComponent(this->getInternalInstance());
|
||||
|
||||
@ -25,6 +25,7 @@ Napi::Object QWindowWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(QWindowWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QWindow, QWindowWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
@ -36,7 +37,8 @@ QWindowWrap::QWindowWrap(const Napi::CallbackInfo& info)
|
||||
if (info.Length() == 1 && info[0].IsExternal()) {
|
||||
this->instance = info[0].As<Napi::External<QWindow>>().Data();
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments to QWindow.")
|
||||
Napi::TypeError::New(env,
|
||||
"NodeGui: QWindowWrap: Bad arguments to constructor.")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQObject(this->getInternalInstance());
|
||||
|
||||
@ -34,44 +34,40 @@ Napi::Object QActionWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(QActionWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QAction, QActionWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NAction* QActionWrap::getInternalInstance() { return this->instance; }
|
||||
QAction* QActionWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QActionWrap::QActionWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QActionWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
|
||||
this->disableDeletion = false;
|
||||
if (info.Length() > 0 && info[0].IsExternal()) {
|
||||
// --- if external ---
|
||||
this->instance = info[0].As<Napi::External<NAction>>().Data();
|
||||
if (info.Length() == 2) {
|
||||
this->disableDeletion = info[1].As<Napi::Boolean>().Value();
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NAction();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QAction>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
QObjectWrap* parentObjectWrap =
|
||||
Napi::ObjectWrap<QObjectWrap>::Unwrap(parentObject);
|
||||
this->instance = new NAction(parentObjectWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
// --- regular cases ---
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NAction(parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
this->instance = new NAction();
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QActionWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
|
||||
this->rawData = extrautils::configureQObject(this->getInternalInstance());
|
||||
}
|
||||
|
||||
QActionWrap::~QActionWrap() {
|
||||
if (!this->disableDeletion) {
|
||||
extrautils::safeDelete(this->instance);
|
||||
}
|
||||
}
|
||||
QActionWrap::~QActionWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
Napi::Value QActionWrap::setText(const Napi::CallbackInfo& info) {
|
||||
Napi::Env env = info.Env();
|
||||
|
||||
@ -27,16 +27,19 @@ Napi::Object QBoxLayoutWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QLAYOUT_WRAPPED_METHODS_EXPORT_DEFINE(QBoxLayoutWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QBoxLayout, QBoxLayoutWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NBoxLayout* QBoxLayoutWrap::getInternalInstance() { return this->instance; }
|
||||
QBoxLayout* QBoxLayoutWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QBoxLayoutWrap::~QBoxLayoutWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
QBoxLayoutWrap::QBoxLayoutWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QBoxLayoutWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 2) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 2) {
|
||||
QBoxLayout::Direction dir = static_cast<QBoxLayout::Direction>(
|
||||
info[0].As<Napi::Number>().Int32Value());
|
||||
Napi::Object parentObject = info[1].As<Napi::Object>();
|
||||
@ -44,12 +47,17 @@ QBoxLayoutWrap::QBoxLayoutWrap(const Napi::CallbackInfo& info)
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NBoxLayout(dir, parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 1) {
|
||||
QBoxLayout::Direction dir = static_cast<QBoxLayout::Direction>(
|
||||
info[0].As<Napi::Number>().Int32Value());
|
||||
this->instance = new NBoxLayout(dir);
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QBoxLayout>>().Data();
|
||||
} else {
|
||||
QBoxLayout::Direction dir = static_cast<QBoxLayout::Direction>(
|
||||
info[0].As<Napi::Number>().Int32Value());
|
||||
this->instance = new NBoxLayout(dir);
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(env, "QBoxLayoutWrap: Wrong number of arguments")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQObject(this->getInternalInstance());
|
||||
|
||||
@ -27,25 +27,34 @@ Napi::Object QButtonGroupWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(QButtonGroupWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QButtonGroup, QButtonGroupWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NButtonGroup* QButtonGroupWrap::getInternalInstance() { return this->instance; }
|
||||
QButtonGroup* QButtonGroupWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QButtonGroupWrap::QButtonGroupWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QButtonGroupWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NButtonGroup(
|
||||
parentWidgetWrap
|
||||
->getInternalInstance()); // this sets the parent to current widget
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NButtonGroup();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QButtonGroup>>().Data();
|
||||
} else {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NButtonGroup(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env,
|
||||
"NodeGui: QButtonGroupWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQObject(this->getInternalInstance());
|
||||
|
||||
@ -28,10 +28,11 @@ Napi::Object QCalendarWidgetWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE(QCalendarWidgetWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QCalendarWidget, QCalendarWidgetWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NCalendarWidget *QCalendarWidgetWrap::getInternalInstance() {
|
||||
QCalendarWidget *QCalendarWidgetWrap::getInternalInstance() {
|
||||
return this->instance;
|
||||
}
|
||||
|
||||
@ -42,22 +43,31 @@ QCalendarWidgetWrap::~QCalendarWidgetWrap() {
|
||||
QCalendarWidgetWrap::QCalendarWidgetWrap(const Napi::CallbackInfo &info)
|
||||
: Napi::ObjectWrap<QCalendarWidgetWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap *parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NCalendarWidget(
|
||||
parentWidgetWrap
|
||||
->getInternalInstance()); // this sets the parent to current widget
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NCalendarWidget();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QCalendarWidget>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap *parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NCalendarWidget(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(env,
|
||||
"NodeGui: QCalendarWidgetWrap: Wrong number of "
|
||||
"arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
true);
|
||||
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), true);
|
||||
}
|
||||
|
||||
Napi::Value QCalendarWidgetWrap::monthShown(const Napi::CallbackInfo &info) {
|
||||
|
||||
@ -17,44 +17,40 @@ Napi::Object QCheckBoxWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QABSTRACTBUTTON_WRAPPED_METHODS_EXPORT_DEFINE(QCheckBoxWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QCheckBox, QCheckBoxWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NCheckBox* QCheckBoxWrap::getInternalInstance() { return this->instance; }
|
||||
QCheckBox* QCheckBoxWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QCheckBoxWrap::QCheckBoxWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QCheckBoxWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
this->disableDeletion = false;
|
||||
if (info.Length() > 0 && info[0].IsExternal()) {
|
||||
// --- if external ---
|
||||
this->instance = info[0].As<Napi::External<NCheckBox>>().Data();
|
||||
if (info.Length() == 2) {
|
||||
this->disableDeletion = info[1].As<Napi::Boolean>().Value();
|
||||
}
|
||||
} else {
|
||||
if (info.Length() == 1) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NCheckBox();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QCheckBox>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NCheckBox(parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
this->instance = new NCheckBox();
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QCheckBoxWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
true);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), true);
|
||||
}
|
||||
|
||||
QCheckBoxWrap::~QCheckBoxWrap() {
|
||||
if (!this->disableDeletion) {
|
||||
extrautils::safeDelete(this->instance);
|
||||
}
|
||||
}
|
||||
QCheckBoxWrap::~QCheckBoxWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
Napi::Value QCheckBoxWrap::checkState(const Napi::CallbackInfo& info) {
|
||||
Napi::Env env = info.Env();
|
||||
|
||||
@ -27,10 +27,11 @@ Napi::Object QColorDialogWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QDIALOG_WRAPPED_METHODS_EXPORT_DEFINE(QColorDialogWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QColorDialog, QColorDialogWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NColorDialog* QColorDialogWrap::getInternalInstance() { return this->instance; }
|
||||
QColorDialog* QColorDialogWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QColorDialogWrap::~QColorDialogWrap() {
|
||||
extrautils::safeDelete(this->instance);
|
||||
@ -39,21 +40,30 @@ QColorDialogWrap::~QColorDialogWrap() {
|
||||
QColorDialogWrap::QColorDialogWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QColorDialogWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
QWidget* parent = parentWidgetWrap->getInternalInstance();
|
||||
this->instance = new NColorDialog(parent);
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NColorDialog();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QColorDialog>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NColorDialog(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env,
|
||||
"NodeGui: QColorDialogWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
false);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), false);
|
||||
}
|
||||
|
||||
Napi::Value QColorDialogWrap::selectedColor(const Napi::CallbackInfo& info) {
|
||||
|
||||
@ -66,30 +66,39 @@ Napi::Object QComboBoxWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE(QComboBoxWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QComboBox, QComboBoxWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NComboBox* QComboBoxWrap::getInternalInstance() { return this->instance; }
|
||||
QComboBox* QComboBoxWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QComboBoxWrap::~QComboBoxWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
QComboBoxWrap::QComboBoxWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QComboBoxWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
|
||||
this->instance = new NComboBox(parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NComboBox();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QComboBox>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NComboBox(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QComboBoxWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
true);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), true);
|
||||
}
|
||||
|
||||
Napi::Value QComboBoxWrap::addItem(const Napi::CallbackInfo& info) {
|
||||
|
||||
@ -12,28 +12,37 @@ Napi::Object QDateEditWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
{QDATETIMEEDIT_WRAPPED_METHODS_EXPORT_DEFINE(QDateEditWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QDateEdit, QDateEditWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NDateEdit* QDateEditWrap::getInternalInstance() { return this->instance; }
|
||||
QDateEdit* QDateEditWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QDateEditWrap::QDateEditWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QDateEditWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NDateEdit(parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NDateEdit();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QDateEdit>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NDateEdit(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QDateEditWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
true);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), true);
|
||||
}
|
||||
|
||||
QDateEditWrap::~QDateEditWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
@ -12,30 +12,41 @@ Napi::Object QDateTimeEditWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
{QDATETIMEEDIT_WRAPPED_METHODS_EXPORT_DEFINE(QDateTimeEditWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QDateTimeEdit, QDateTimeEditWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NDateTimeEdit* QDateTimeEditWrap::getInternalInstance() {
|
||||
QDateTimeEdit* QDateTimeEditWrap::getInternalInstance() {
|
||||
return this->instance;
|
||||
}
|
||||
|
||||
QDateTimeEditWrap::QDateTimeEditWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QDateTimeEditWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NDateTimeEdit(parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NDateTimeEdit();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QDateTimeEdit>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NDateTimeEdit(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env,
|
||||
"NodeGui: QDateTimeEditWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
true);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), true);
|
||||
}
|
||||
|
||||
QDateTimeEditWrap::~QDateTimeEditWrap() {
|
||||
|
||||
@ -16,29 +16,37 @@ Napi::Object QDialWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
{QABSTRACTSLIDER_WRAPPED_METHODS_EXPORT_DEFINE(QDialWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QDial, QDialWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NDial* QDialWrap::getInternalInstance() { return this->instance; }
|
||||
QDial* QDialWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QDialWrap::QDialWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QDialWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NDial(parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NDial();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QDial>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NDial(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QDialWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
true);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), true);
|
||||
}
|
||||
|
||||
QDialWrap::~QDialWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
@ -11,33 +11,37 @@ Napi::Object QDialogWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
env, CLASSNAME, {QDIALOG_WRAPPED_METHODS_EXPORT_DEFINE(QDialogWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QDialog, QDialogWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NDialog *QDialogWrap::getInternalInstance() { return this->instance; }
|
||||
QDialog *QDialogWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QDialogWrap::~QDialogWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
QDialogWrap::QDialogWrap(const Napi::CallbackInfo &info)
|
||||
: Napi::ObjectWrap<QDialogWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NDialog();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
this->instance =
|
||||
new NDialog(info[0].As<Napi::External<NDialog>>().Data());
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QDialog>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
QDialogWrap *parentWidgetWrap =
|
||||
Napi::ObjectWrap<QDialogWrap>::Unwrap(parentObject);
|
||||
NodeWidgetWrap *parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NDialog(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else if (info.Length() == 0) {
|
||||
this->instance = new NDialog();
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QDialogWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
false);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), false);
|
||||
}
|
||||
|
||||
@ -16,31 +16,41 @@ Napi::Object QDoubleSpinBoxWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QABSTRACTSPINBOX_WRAPPED_METHODS_EXPORT_DEFINE(QDoubleSpinBoxWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QDoubleSpinBox, QDoubleSpinBoxWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NDoubleSpinBox* QDoubleSpinBoxWrap::getInternalInstance() {
|
||||
QDoubleSpinBox* QDoubleSpinBoxWrap::getInternalInstance() {
|
||||
return this->instance;
|
||||
}
|
||||
|
||||
QDoubleSpinBoxWrap::QDoubleSpinBoxWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QDoubleSpinBoxWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NDoubleSpinBox(parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NDoubleSpinBox();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QDoubleSpinBox>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NDoubleSpinBox(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env,
|
||||
"NodeGui: QDoubleSpinBoxWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
true);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), true);
|
||||
}
|
||||
|
||||
QDoubleSpinBoxWrap::~QDoubleSpinBoxWrap() {
|
||||
|
||||
@ -16,10 +16,11 @@ Napi::Object QErrorMessageWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QDIALOG_WRAPPED_METHODS_EXPORT_DEFINE(QErrorMessageWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QErrorMessage, QErrorMessageWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NErrorMessage* QErrorMessageWrap::getInternalInstance() {
|
||||
QErrorMessage* QErrorMessageWrap::getInternalInstance() {
|
||||
return this->instance;
|
||||
}
|
||||
|
||||
@ -30,21 +31,30 @@ QErrorMessageWrap::~QErrorMessageWrap() {
|
||||
QErrorMessageWrap::QErrorMessageWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QErrorMessageWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
QWidget* parent = parentWidgetWrap->getInternalInstance();
|
||||
this->instance = new NErrorMessage(parent);
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NErrorMessage();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QErrorMessage>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NErrorMessage(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env,
|
||||
"NodeGui: QErrorMessageWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
false);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), false);
|
||||
}
|
||||
|
||||
Napi::Value QErrorMessageWrap::showMessage(const Napi::CallbackInfo& info) {
|
||||
|
||||
@ -24,16 +24,19 @@ Napi::Object QFileDialogWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QDIALOG_WRAPPED_METHODS_EXPORT_DEFINE(QFileDialogWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QFileDialog, QFileDialogWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NFileDialog* QFileDialogWrap::getInternalInstance() { return this->instance; }
|
||||
QFileDialog* QFileDialogWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QFileDialogWrap::~QFileDialogWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
QFileDialogWrap::QFileDialogWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QFileDialogWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 4) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 4) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
@ -45,15 +48,15 @@ QFileDialogWrap::QFileDialogWrap(const Napi::CallbackInfo& info)
|
||||
QString filter =
|
||||
QString::fromUtf8(info[3].As<Napi::String>().Utf8Value().c_str());
|
||||
this->instance = new NFileDialog(parent, caption, directory, filter);
|
||||
} else if (info.Length() == 0) {
|
||||
} else if (argCount == 0) {
|
||||
this->instance = new NFileDialog();
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(env,
|
||||
"NodeGui: QFileDialogWrap: Wrong number of arguments")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
false);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), false);
|
||||
}
|
||||
|
||||
Napi::Value QFileDialogWrap::supportedSchemes(const Napi::CallbackInfo& info) {
|
||||
|
||||
@ -18,31 +18,40 @@ Napi::Object QFontDialogWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QDIALOG_WRAPPED_METHODS_EXPORT_DEFINE(QFontDialogWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QFontDialog, QFontDialogWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NFontDialog* QFontDialogWrap::getInternalInstance() { return this->instance; }
|
||||
QFontDialog* QFontDialogWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QFontDialogWrap::~QFontDialogWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
QFontDialogWrap::QFontDialogWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QFontDialogWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
QWidget* parent = parentWidgetWrap->getInternalInstance();
|
||||
this->instance = new NFontDialog(parent);
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NFontDialog();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QFontDialog>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NFontDialog(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env,
|
||||
"NodeGui: QFontDialogWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
false);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), false);
|
||||
}
|
||||
|
||||
Napi::Value QFontDialogWrap::selectedFont(const Napi::CallbackInfo& info) {
|
||||
|
||||
@ -11,28 +11,37 @@ Napi::Object QFrameWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
env, CLASSNAME, {QFRAME_WRAPPED_METHODS_EXPORT_DEFINE(QFrameWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QFrame, QFrameWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NFrame* QFrameWrap::getInternalInstance() { return this->instance; }
|
||||
QFrame* QFrameWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QFrameWrap::~QFrameWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
QFrameWrap::QFrameWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QFrameWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NFrame(parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NFrame();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QFrame>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NFrame(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QFrameWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
false);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), false);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
#include "Extras/Utils/nutils.h"
|
||||
#include "QtCore/QObject/qobject_wrap.h"
|
||||
#include "QtWidgets/QWidget/qwidget_wrap.h"
|
||||
|
||||
Napi::FunctionReference QGraphicsBlurEffectWrap::constructor;
|
||||
|
||||
@ -14,10 +15,11 @@ Napi::Object QGraphicsBlurEffectWrap::init(Napi::Env env,
|
||||
{QGRAPHICSEFFECT_WRAPPED_METHODS_EXPORT_DEFINE(QGraphicsBlurEffectWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QGraphicsBlurEffect, QGraphicsBlurEffectWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NGraphicsBlurEffect* QGraphicsBlurEffectWrap::getInternalInstance() {
|
||||
QGraphicsBlurEffect* QGraphicsBlurEffectWrap::getInternalInstance() {
|
||||
return this->instance;
|
||||
}
|
||||
|
||||
@ -28,16 +30,26 @@ QGraphicsBlurEffectWrap::~QGraphicsBlurEffectWrap() {
|
||||
QGraphicsBlurEffectWrap::QGraphicsBlurEffectWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QGraphicsBlurEffectWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
QObjectWrap* parentObjectWrap =
|
||||
Napi::ObjectWrap<QObjectWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NGraphicsBlurEffect(parentObjectWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NGraphicsBlurEffect();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QGraphicsBlurEffect>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NGraphicsBlurEffect(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(env,
|
||||
"NodeGui: QGraphicsBlurEffectWrap: Wrong number of "
|
||||
"arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQObject(this->getInternalInstance());
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
#include "Extras/Utils/nutils.h"
|
||||
#include "QtCore/QObject/qobject_wrap.h"
|
||||
#include "QtWidgets/QWidget/qwidget_wrap.h"
|
||||
|
||||
Napi::FunctionReference QGraphicsDropShadowEffectWrap::constructor;
|
||||
|
||||
@ -15,10 +16,12 @@ Napi::Object QGraphicsDropShadowEffectWrap::init(Napi::Env env,
|
||||
QGraphicsDropShadowEffectWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QGraphicsDropShadowEffect,
|
||||
QGraphicsDropShadowEffectWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NGraphicsDropShadowEffect*
|
||||
QGraphicsDropShadowEffect*
|
||||
QGraphicsDropShadowEffectWrap::getInternalInstance() {
|
||||
return this->instance;
|
||||
}
|
||||
@ -31,16 +34,28 @@ QGraphicsDropShadowEffectWrap::QGraphicsDropShadowEffectWrap(
|
||||
const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QGraphicsDropShadowEffectWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
QObjectWrap* parentObjectWrap =
|
||||
Napi::ObjectWrap<QObjectWrap>::Unwrap(parentObject);
|
||||
this->instance =
|
||||
new NGraphicsDropShadowEffect(parentObjectWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NGraphicsDropShadowEffect();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance =
|
||||
info[0].As<Napi::External<QGraphicsDropShadowEffect>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NGraphicsDropShadowEffect(
|
||||
parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env,
|
||||
"NodeGui: QGraphicsDropShadowEffectWrap: Wrong number of "
|
||||
"arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQObject(this->getInternalInstance());
|
||||
|
||||
@ -35,24 +35,36 @@ Napi::Object QGridLayoutWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
QLAYOUT_WRAPPED_METHODS_EXPORT_DEFINE(QGridLayoutWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
exports.Set(CLASSNAME, func);
|
||||
QOBJECT_REGISTER_WRAPPER(QGridLayout, QGridLayoutWrap);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NGridLayout* QGridLayoutWrap::getInternalInstance() { return this->instance; }
|
||||
QGridLayout* QGridLayoutWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QGridLayoutWrap::~QGridLayoutWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
QGridLayoutWrap::QGridLayoutWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QGridLayoutWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NGridLayout(parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NGridLayout();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QGridLayout>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NGridLayout(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env,
|
||||
"NodeGui: QGridLayoutWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQObject(this->getInternalInstance());
|
||||
|
||||
@ -13,29 +13,38 @@ Napi::Object QGroupBoxWrap::init(Napi::Env env, Napi::Object exports) {
|
||||
Napi::Function func = DefineClass(
|
||||
env, CLASSNAME, {QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE(QGroupBoxWrap)});
|
||||
constructor = Napi::Persistent(func);
|
||||
QOBJECT_REGISTER_WRAPPER(QGroupBox, QGroupBoxWrap);
|
||||
exports.Set(CLASSNAME, func);
|
||||
return exports;
|
||||
}
|
||||
|
||||
NGroupBox* QGroupBoxWrap::getInternalInstance() { return this->instance; }
|
||||
QGroupBox* QGroupBoxWrap::getInternalInstance() { return this->instance; }
|
||||
|
||||
QGroupBoxWrap::QGroupBoxWrap(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<QGroupBoxWrap>(info) {
|
||||
Napi::Env env = info.Env();
|
||||
if (info.Length() == 1) {
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NGroupBox(parentWidgetWrap->getInternalInstance());
|
||||
} else if (info.Length() == 0) {
|
||||
size_t argCount = info.Length();
|
||||
if (argCount == 0) {
|
||||
// --- Construct a new instance
|
||||
this->instance = new NGroupBox();
|
||||
} else if (argCount == 1) {
|
||||
if (info[0].IsExternal()) {
|
||||
// --- Wrap a given C++ instance
|
||||
this->instance = info[0].As<Napi::External<QGroupBox>>().Data();
|
||||
} else {
|
||||
// --- Construct a new instance and pass a parent
|
||||
Napi::Object parentObject = info[0].As<Napi::Object>();
|
||||
NodeWidgetWrap* parentWidgetWrap =
|
||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(parentObject);
|
||||
this->instance = new NGroupBox(parentWidgetWrap->getInternalInstance());
|
||||
}
|
||||
} else {
|
||||
Napi::TypeError::New(env, "Wrong number of arguments")
|
||||
Napi::TypeError::New(
|
||||
env, "NodeGui: QGroupBoxWrap: Wrong number of arguments to constructor")
|
||||
.ThrowAsJavaScriptException();
|
||||
}
|
||||
this->rawData = extrautils::configureQWidget(
|
||||
this->getInternalInstance(), this->getInternalInstance()->getFlexNode(),
|
||||
false);
|
||||
this->rawData =
|
||||
extrautils::configureQWidget(this->getInternalInstance(), false);
|
||||
}
|
||||
|
||||
QGroupBoxWrap::~QGroupBoxWrap() { extrautils::safeDelete(this->instance); }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user