new bindings

This commit is contained in:
PwLDev 2026-05-04 11:39:15 -07:00
commit c4a3c14caf
7 changed files with 480 additions and 105 deletions

View file

@ -0,0 +1,32 @@
#include "classes.hpp"
#include <Mw/Milsko.h>
#define NAPI_MWCLASS(env, cls) \
Napi::External<_MwClass>::New(env, cls)
Napi::Object ClassesInit(Napi::Env env, Napi::Object exports) {
Napi::Object classes = Napi::Object::New(env);
classes.Set("Box", NAPI_MWCLASS(env, MwBoxClass));
classes.Set("Button", NAPI_MWCLASS(env, MwButtonClass));
classes.Set("CheckBox", NAPI_MWCLASS(env, MwCheckBoxClass));
classes.Set("Entry", NAPI_MWCLASS(env, MwEntryClass));
classes.Set("Frame", NAPI_MWCLASS(env, MwFrameClass));
classes.Set("Image", NAPI_MWCLASS(env, MwImageClass));
classes.Set("Label", NAPI_MWCLASS(env, MwLabelClass));
classes.Set("ListBox", NAPI_MWCLASS(env, MwListBoxClass));
classes.Set("Menu", NAPI_MWCLASS(env, MwMenuClass));
classes.Set("NumberEntry", NAPI_MWCLASS(env, MwNumberEntryClass));
classes.Set("ScrollBar", NAPI_MWCLASS(env, MwScrollBarClass));
classes.Set("SubMenu", NAPI_MWCLASS(env, MwSubMenuClass));
classes.Set("SubWindow", NAPI_MWCLASS(env, MwSubWindowClass));
classes.Set("Viewport", NAPI_MWCLASS(env, MwViewportClass));
classes.Set("Window", NAPI_MWCLASS(env, MwWindowClass));
classes.Set("ProgressBar", NAPI_MWCLASS(env, MwProgressBarClass));
classes.Set("RadioBox", NAPI_MWCLASS(env, MwRadioBoxClass));
classes.Set("ComboBox", NAPI_MWCLASS(env, MwComboBoxClass));
classes.Set("TreeView", NAPI_MWCLASS(env, MwTreeViewClass));
exports.Set("NativeClasses", classes);
return exports;
};

View file

@ -1,13 +1,17 @@
#include "classes.hpp"
#include "pixmap.hpp"
#include "widget.hpp" #include "widget.hpp"
#include <Mw/Milsko.h> #include <Mw/Milsko.h>
#include <napi.h> #include <napi.h>
Napi::Object Init(Napi::Env env, Napi::Object exports) { Napi::Object Init(Napi::Env env, Napi::Object exports) {
MwLibraryInit(); MwLibraryInit();
MwBaseWidget::Init(env, exports); MwBaseWidget::Init(env, exports);
MwPixmap::Init(env, exports);
ClassesInit(env, exports);
return exports; return exports;
} }
NODE_API_MODULE(milsko, Init); NODE_API_MODULE(milsko, Init);

153
src/pixmap.cpp Normal file
View file

@ -0,0 +1,153 @@
#include "classes.hpp"
#include "widget.hpp"
#include <stdlib.h>
Napi::FunctionReference MwPixmap::constructor;
Napi::Object MwPixmap::Init(Napi::Env env, Napi::Object exports) {
Napi::Function func = DefineClass(env, "Pixmap",
{
InstanceMethod("getRaw", &MwPixmap::GetRaw),
InstanceMethod("reloadRaw", &MwPixmap::ReloadRaw),
InstanceAccessor("size", &MwPixmap::GetSize, nullptr),
});
constructor = Napi::Persistent(func);
constructor.SuppressDestruct();
exports.Set("Pixmap", func);
return exports;
}
MwPixmap::MwPixmap(const Napi::CallbackInfo &info): Napi::ObjectWrap<MwPixmap>(info) {
Napi::Env env = info.Env();
Napi::HandleScope scope(env);
if (info.Length() < 1 || !info[0].IsObject()) {
Napi::TypeError::New(env, "Expected an instance of widget as first argument")
.ThrowAsJavaScriptException();
return;
}
Napi::Object obj = info[0].As<Napi::Object>();
MwBaseWidget *widget = MwBaseWidget::Unwrap(obj);
unsigned char *data = 0;
int width = 0;
int height = 0;
if (!widget) {
Napi::TypeError::New(env, "First argument is not an instance of a widget")
.ThrowAsJavaScriptException();
return;
}
if (info.Length() > 1 && info[1].IsObject()) {
Napi::Object params = info[1].As<Napi::Object>();
if (params.Has("data")) {
Napi::Value dataParam = params.Get("data");
if (dataParam.IsBuffer()) {
data = dataParam.As<Napi::Buffer<unsigned char>>().Data();
} else if (dataParam.IsArrayBuffer()) {
data = reinterpret_cast<unsigned char*>(
dataParam.As<Napi::ArrayBuffer>().Data()
);
} else {
Napi::TypeError::New(env, "The data parameter must be of type Buffer or ArrayBuffer")
.ThrowAsJavaScriptException();
return;
}
}
if (params.Has("width")) {
Napi::Value widthParam = params.Get("width");
if (widthParam.IsNumber()) {
width = widthParam.As<Napi::Number>().Int32Value();
} else {
Napi::TypeError::New(env, "The width parameter must be a number")
.ThrowAsJavaScriptException();
return;
}
}
if (params.Has("height")) {
Napi::Value heightParam = params.Get("height");
if (heightParam.IsNumber()) {
height = heightParam.As<Napi::Number>().Int32Value();
} else {
Napi::TypeError::New(env, "The height parameter must be a number")
.ThrowAsJavaScriptException();
return;
}
}
}
handle = MwLoadRaw(
widget->handle,
data,
width,
height
);
};
MwPixmap::~MwPixmap() {
if (handle)
MwLLDestroyPixmap(handle);
}
Napi::Value MwPixmap::GetRaw(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
unsigned char *data = MwPixmapGetRaw(handle);
Napi::Buffer<unsigned char> buffer = Napi::Buffer<unsigned char>::New(
env,
data,
sizeof(data),
[](Napi::Env env, unsigned char* finalized) {
free(finalized);
}
);
return buffer;
}
Napi::Value MwPixmap::GetSize(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
Napi::Object size = Napi::Object::New(env);
MwRect rect;
MwPixmapGetSize(handle, &rect);
size.Set("x", Napi::Number::New(env, rect.x));
size.Set("y", Napi::Number::New(env, rect.y));
size.Set("width", Napi::Number::New(env, rect.width));
size.Set("height", Napi::Number::New(env, rect.height));
return size;
}
Napi::Value MwPixmap::ReloadRaw(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
if (info.Length() < 1 || !info[0].IsBuffer() || !info[0].IsArrayBuffer()) {
Napi::TypeError::New(env, "Expected a buffer or array buffer as argument")
.ThrowAsJavaScriptException();
return env.Null();
}
unsigned char *data = 0;
if (info[0].IsBuffer()) {
data = info[0].As<Napi::Buffer<unsigned char>>().Data();
} else if (info[0].IsArrayBuffer()) {
data = reinterpret_cast<unsigned char*>(
info[0].As<Napi::ArrayBuffer>().Data()
);
}
MwPixmapReloadRaw(handle, data);
return env.Undefined();
}

19
src/pixmap.hpp Normal file
View file

@ -0,0 +1,19 @@
#pragma once
#include <napi.h>
#include <Mw/Milsko.h>
class MwPixmap : public Napi::ObjectWrap<MwPixmap> {
public:
static Napi::FunctionReference constructor;
static Napi::Object Init(Napi::Env env, Napi::Object exports);
static Napi::Object From(Napi::Env env, MwLLPixmap &pixmap);
MwPixmap(const Napi::CallbackInfo &info);
~MwPixmap();
MwLLPixmap handle;
protected:
Napi::Value GetRaw(const Napi::CallbackInfo &info);
Napi::Value GetSize(const Napi::CallbackInfo &info);
Napi::Value ReloadRaw(const Napi::CallbackInfo &info);
};

2
src/utils.hpp Normal file
View file

@ -0,0 +1,2 @@
#include <napi.h>

View file

@ -4,36 +4,46 @@ Napi::FunctionReference MwBaseWidget::constructor;
Napi::Object MwBaseWidget::Init(Napi::Env env, Napi::Object exports) { Napi::Object MwBaseWidget::Init(Napi::Env env, Napi::Object exports) {
Napi::HandleScope scope(env); Napi::HandleScope scope(env);
Napi::Function func = DefineClass(env, "MwBaseWidget", Napi::Function func = DefineClass(env, "BaseWidget",
{ {
InstanceMethod("setArea", &SetArea), InstanceMethod("setArea", &MwBaseWidget::GetArea),
InstanceMethod("move", &Move), InstanceMethod("move", &MwBaseWidget::Move),
InstanceMethod("resize", &Resize), InstanceMethod("resize", &MwBaseWidget::Resize),
InstanceMethod("step", &Step), InstanceMethod("step", &MwBaseWidget::Step),
InstanceMethod("loop", &Loop), InstanceMethod("loop", &MwBaseWidget::Loop),
InstanceMethod("show", &Show), InstanceMethod("show", &MwBaseWidget::Show),
InstanceMethod("hideCursor", &HideCursor), InstanceMethod("hideCursor", &MwBaseWidget::HideCursor),
InstanceMethod("grabPointer", &GrabPointer), InstanceMethod("grabPointer", &MwBaseWidget::GrabPointer),
InstanceMethod("getClipboard", &GetClipboard), InstanceMethod("focus", &MwBaseWidget::Focus),
InstanceMethod("addTickList", &AddTickList), InstanceMethod("addTickList", &MwBaseWidget::AddTickList),
InstanceMethod("forceRender", &ForceRender), InstanceMethod("forceRender", &MwBaseWidget::ForceRender),
InstanceMethod("reparent", &Reparent), InstanceMethod("reparent", &MwBaseWidget::Reparent),
InstanceMethod("add", &Add), InstanceMethod("add", &MwBaseWidget::AddChild),
InstanceMethod("remove", &Remove), InstanceMethod("destroy", &MwBaseWidget::Destroy),
InstanceAccessor("area", &GetArea, nullptr), InstanceMethod("getClipboard", &MwBaseWidget::GetClipboard),
InstanceAccessor("isPending", &IsPending, nullptr),
InstanceAccessor("parent", &GetParent, nullptr), InstanceMethod("setInteger", &MwBaseWidget::SetInteger),
InstanceAccessor("children", &GetChildren, nullptr), InstanceMethod("setString", &MwBaseWidget::SetText),
InstanceAccessor("name", &GetName, nullptr), InstanceMethod("setVoid", &MwBaseWidget::SetVoid),
InstanceAccessor("cursorCoord", &GetCursorCoord, nullptr), InstanceMethod("getInteger", &MwBaseWidget::GetInteger),
InstanceAccessor("screenSize", &GetScreenSize, nullptr), InstanceMethod("getText", &MwBaseWidget::GetText),
InstanceAccessor("coordinateType", &GetCoordinateType, nullptr), InstanceMethod("getVoid", &MwBaseWidget::GetVoid),
InstanceAccessor("area", &MwBaseWidget::GetArea, nullptr),
InstanceAccessor("isPending", &MwBaseWidget::IsPending, nullptr),
InstanceAccessor("parent", &MwBaseWidget::GetParent, nullptr),
InstanceAccessor("children", &MwBaseWidget::GetChildren, nullptr),
InstanceAccessor("name", &MwBaseWidget::GetName, nullptr),
InstanceAccessor("cursorCoord", &MwBaseWidget::GetCursorCoord, nullptr),
InstanceAccessor("screenSize", &MwBaseWidget::GetScreenSize, nullptr),
InstanceAccessor("coordinateType", &MwBaseWidget::GetCoordinateType, nullptr),
InstanceAccessor("nativeClass", &MwBaseWidget::GetNativeClass, nullptr),
}); });
constructor = Napi::Persistent(func); constructor = Napi::Persistent(func);
constructor.SuppressDestruct(); constructor.SuppressDestruct();
exports.Set("MwBaseWidget", func); exports.Set("BaseWidget", func);
return exports; return exports;
}; };
@ -107,7 +117,7 @@ Napi::Value MwBaseWidget::Move(const Napi::CallbackInfo &info) {
.ThrowAsJavaScriptException(); .ThrowAsJavaScriptException();
} }
return Napi::Value(); return info.This();
} }
Napi::Value MwBaseWidget::Resize(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::Resize(const Napi::CallbackInfo &info) {
@ -127,7 +137,7 @@ Napi::Value MwBaseWidget::Resize(const Napi::CallbackInfo &info) {
.ThrowAsJavaScriptException(); .ThrowAsJavaScriptException();
} }
return Napi::Value(); return info.This();
} }
Napi::Value MwBaseWidget::Step(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::Step(const Napi::CallbackInfo &info) {
@ -146,11 +156,10 @@ Napi::Value MwBaseWidget::IsPending(const Napi::CallbackInfo &info) {
Napi::Value MwBaseWidget::Loop(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::Loop(const Napi::CallbackInfo &info) {
MwLoop(handle); MwLoop(handle);
return Napi::Value(); return info.This();
} }
Napi::Value MwBaseWidget::Show(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::Show(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
bool toggle = true; bool toggle = true;
if (info.Length() > 0 && info[0].IsBoolean()) { if (info.Length() > 0 && info[0].IsBoolean()) {
@ -158,16 +167,15 @@ Napi::Value MwBaseWidget::Show(const Napi::CallbackInfo &info) {
} }
MwShow(handle, static_cast<int>(toggle)); MwShow(handle, static_cast<int>(toggle));
return Napi::Value(); return info.This();
} }
Napi::Value MwBaseWidget::HideCursor(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::HideCursor(const Napi::CallbackInfo &info) {
MwHideCursor(handle); MwHideCursor(handle);
return Napi::Value(); return info.This();
} }
Napi::Value MwBaseWidget::GrabPointer(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::GrabPointer(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
bool toggle = true; bool toggle = true;
if (info.Length() > 0 && info[0].IsBoolean()) { if (info.Length() > 0 && info[0].IsBoolean()) {
@ -175,17 +183,22 @@ Napi::Value MwBaseWidget::GrabPointer(const Napi::CallbackInfo &info) {
} }
MwGrabPointer(handle, static_cast<int>(toggle)); MwGrabPointer(handle, static_cast<int>(toggle));
return Napi::Value(); return info.This();
}
Napi::Value MwBaseWidget::Focus(const Napi::CallbackInfo &info) {
MwFocus(handle);
return info.This();
} }
Napi::Value MwBaseWidget::AddTickList(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::AddTickList(const Napi::CallbackInfo &info) {
MwAddTickList(handle); MwAddTickList(handle);
return Napi::Value(); return info.This();
} }
Napi::Value MwBaseWidget::ForceRender(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::ForceRender(const Napi::CallbackInfo &info) {
MwForceRender(handle); MwForceRender(handle);
return Napi::Value(); return info.This();
} }
Napi::Value MwBaseWidget::Reparent(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::Reparent(const Napi::CallbackInfo &info) {
@ -230,68 +243,76 @@ Napi::Value MwBaseWidget::Reparent(const Napi::CallbackInfo &info) {
parent = newParent; parent = newParent;
newParent->children.push_back(this); newParent->children.push_back(this);
return Napi::Value(); return info.This();
} }
Napi::Value MwBaseWidget::Add(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::AddChild(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env(); Napi::Env env = info.Env();
if (info.Length() < 1 || !info[0].IsObject()) { if (info.Length() < 1 || !info[0].IsArray()) {
Napi::TypeError::New(env, "Expected an instance of a widget class as argument") Napi::TypeError::New(env, "Expected an instance of a widget class as argument")
.ThrowAsJavaScriptException(); .ThrowAsJavaScriptException();
return env.Undefined(); return env.Undefined();
} }
Napi::Object wrapped = info[0].As<Napi::Object>(); Napi::Array widgets = info[0].As<Napi::Array>();
const bool isInstance = wrapped.InstanceOf(constructor.Value());
if (isInstance) { for (uint32_t i = 0; i < widgets.Length(); i++) {
MwBaseWidget *child = MwBaseWidget::Unwrap(wrapped); const Napi::Value value = widgets.Get(i);
if (child == this) { if (!value.IsObject()) {
Napi::Error::New(env, "Cannot add widget as child of itself") Napi::TypeError::New(env,
"Expected argument " + std::to_string(i) + "to be instance of a widget"
)
.ThrowAsJavaScriptException(); .ThrowAsJavaScriptException();
return env.Null(); return env.Null();
} }
if (child->parent) { const Napi::Object wrapped = widgets.As<Napi::Object>();
// if the current parent has this widget as a child, disown :( const bool isInstance = wrapped.InstanceOf(constructor.Value());
for (int i = 0; i < child->parent->children.size(); i++) {
if (child->parent->children[i] == this) { if (isInstance) {
child->parent->children.erase(child->parent->children.begin() + i); MwBaseWidget *child = MwBaseWidget::Unwrap(wrapped);
break;
if (child == this) {
Napi::Error::New(env, "Cannot add widget as child of itself")
.ThrowAsJavaScriptException();
return env.Null();
}
if (child->parent) {
// if the current parent has this widget as a child, disown :(
for (size_t i = 0; i < child->parent->children.size(); i++) {
if (child->parent->children[i] == this) {
child->parent->children.erase(child->parent->children.begin() + i);
break;
}
} }
} }
MwReparent(
child->handle,
handle
);
child->parent = this;
children.push_back(child);
} else {
Napi::TypeError::New(env,"Argument " + std::to_string(i) + "is not an instance of a widget")
.ThrowAsJavaScriptException();
return env.Null();
} }
MwReparent(
child->handle,
handle
);
child->parent = this;
children.push_back(child);
} else {
Napi::TypeError::New(env, "Provided argument is not an instance of a widget")
.ThrowAsJavaScriptException();
return env.Null();
} }
return Napi::Value(); return info.This();
} }
Napi::Value MwBaseWidget::Remove(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::Destroy(const Napi::CallbackInfo &info) {
if (parent) { Napi::Env env = info.Env();
for (size_t i = 0; i < parent->children.size(); i++) { if (handle)
if (parent->children[i] == this) { MwDestroyWidget(handle);
parent->children.erase(parent->children.begin() + i);
break;
}
}
}
MwReparent(handle, nullptr); return env.Null();
return Napi::Value();
} }
Napi::Value MwBaseWidget::GetParent(const Napi::CallbackInfo &info) { Napi::Value MwBaseWidget::GetParent(const Napi::CallbackInfo &info) {
@ -366,3 +387,136 @@ Napi::Value MwBaseWidget::GetClipboard(const Napi::CallbackInfo &info) {
return env.Undefined(); return env.Undefined();
} }
Napi::Value MwBaseWidget::GetNativeClass(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
MwClass cls = MwGetClass(handle);
return Napi::External<_MwClass>::New(env, cls);
}
Napi::Value MwBaseWidget::SetInteger(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
if (info.Length() < 2) {
Napi::TypeError::New(env, "Expected two arguments for key and value")
.ThrowAsJavaScriptException();
return env.Null();
}
if (!info[0].IsString() || !info[1].IsNumber()) {
Napi::TypeError::New(env, "Expected key to be a string and value to be a number")
.ThrowAsJavaScriptException();
return env.Null();
}
const std::string key = info[0].As<Napi::String>().Utf8Value();
const int value = info[1].As<Napi::Number>().Int32Value();
MwSetInteger(handle, key.c_str(), value);
return info.This();
}
Napi::Value MwBaseWidget::SetText(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
if (info.Length() < 2) {
Napi::TypeError::New(env, "Expected two arguments for key and value")
.ThrowAsJavaScriptException();
return env.Null();
}
if (!info[0].IsString() || !info[1].IsString()) {
Napi::TypeError::New(env, "Expected key and value to be a string")
.ThrowAsJavaScriptException();
return env.Null();
}
const std::string key = info[0].As<Napi::String>().Utf8Value();
const std::string value = info[1].As<Napi::String>().Utf8Value();
MwSetText(handle, key.c_str(), value.c_str());
return info.This();
}
Napi::Value MwBaseWidget::SetVoid(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
if (info.Length() < 2) {
Napi::TypeError::New(env, "Expected two arguments for key and value")
.ThrowAsJavaScriptException();
return env.Null();
}
if (!info[0].IsString() || !info[1].IsObject()) {
Napi::TypeError::New(env, "Expected key to be a string and value to be a native object")
.ThrowAsJavaScriptException();
return env.Null();
}
const std::string key = info[0].As<Napi::String>().Utf8Value();
const Napi::Object obj = info[1].As<Napi::Object>();
MwPixmap *pixmap = MwPixmap::Unwrap(obj);
if (pixmap) {
MwSetVoid(handle, key.c_str(), pixmap->handle);
} else {
Napi::TypeError::New(env, "Expected second argument to be a valid native object")
.ThrowAsJavaScriptException();
return env.Null();
}
return info.This();
}
Napi::Value MwBaseWidget::GetInteger(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
if (info.Length() < 1 || !info[0].IsString()) {
Napi::TypeError::New(env, "Expected key to be an argument of type string")
.ThrowAsJavaScriptException();
return env.Null();
}
const std::string key = info[0].As<Napi::String>().Utf8Value();
const int value = MwGetInteger(handle, key.c_str());
return Napi::Number::New(env, static_cast<double>(value));
}
Napi::Value MwBaseWidget::GetText(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
if (info.Length() < 1 || !info[0].IsString()) {
Napi::TypeError::New(env, "Expected key to be an argument of type string")
.ThrowAsJavaScriptException();
return env.Null();
}
const std::string key = info[0].As<Napi::String>().Utf8Value();
const char *value = MwGetText(handle, key.c_str());
return Napi::String::New(env, value);
}
Napi::Value MwBaseWidget::GetVoid(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
if (info.Length() < 1 || !info[0].IsString()) {
Napi::TypeError::New(env, "Expected key to be an argument of type string")
.ThrowAsJavaScriptException();
return env.Null();
}
if (!info[0].IsString() || !info[1].IsObject()) {
Napi::TypeError::New(env, "Expected key to be a string and value to be a native object")
.ThrowAsJavaScriptException();
return env.Null();
}
const std::string key = info[0].As<Napi::String>().Utf8Value();
void *value = MwGetVoid(handle, key.c_str());
return Napi::External<void>::New(env, value);
}

View file

@ -1,42 +1,53 @@
#pragma once #pragma once
#include "pixmap.hpp"
#include <Mw/Milsko.h> #include <Mw/Milsko.h>
#include <napi.h> #include <napi.h>
#include <vector> #include <vector>
class MwBaseWidget : public Napi::ObjectWrap<MwBaseWidget> { class MwBaseWidget : public Napi::ObjectWrap<MwBaseWidget> {
public: public:
static Napi::Object Init(Napi::Env env, Napi::Object exports); static Napi::Object Init(Napi::Env env, Napi::Object exports);
MwBaseWidget(const Napi::CallbackInfo &info); MwBaseWidget(const Napi::CallbackInfo &info);
~MwBaseWidget(); ~MwBaseWidget();
protected: protected:
static Napi::FunctionReference constructor; static Napi::FunctionReference constructor;
friend class MwPixmap;
MwWidget handle; MwWidget handle;
MwBaseWidget *parent; MwBaseWidget *parent;
std::vector<MwBaseWidget *> children; std::vector<MwBaseWidget *> children;
Napi::Value SetArea(const Napi::CallbackInfo &info); Napi::Value SetArea(const Napi::CallbackInfo &info);
Napi::Value Move(const Napi::CallbackInfo &info); Napi::Value Move(const Napi::CallbackInfo &info);
Napi::Value Resize(const Napi::CallbackInfo &info); Napi::Value Resize(const Napi::CallbackInfo &info);
Napi::Value Step(const Napi::CallbackInfo &info); Napi::Value Step(const Napi::CallbackInfo &info);
Napi::Value Loop(const Napi::CallbackInfo &info); Napi::Value Loop(const Napi::CallbackInfo &info);
Napi::Value Show(const Napi::CallbackInfo &info); Napi::Value Show(const Napi::CallbackInfo &info);
Napi::Value HideCursor(const Napi::CallbackInfo &info); Napi::Value HideCursor(const Napi::CallbackInfo &info);
Napi::Value GrabPointer(const Napi::CallbackInfo &info); Napi::Value GrabPointer(const Napi::CallbackInfo &info);
Napi::Value AddTickList(const Napi::CallbackInfo &info); Napi::Value Focus(const Napi::CallbackInfo &info);
Napi::Value ForceRender(const Napi::CallbackInfo &info); Napi::Value AddTickList(const Napi::CallbackInfo &info);
Napi::Value Reparent(const Napi::CallbackInfo &info); Napi::Value ForceRender(const Napi::CallbackInfo &info);
Napi::Value Add(const Napi::CallbackInfo &info); Napi::Value Reparent(const Napi::CallbackInfo &info);
Napi::Value Remove(const Napi::CallbackInfo &info); Napi::Value AddChild(const Napi::CallbackInfo &info);
Napi::Value GetClipboard(const Napi::CallbackInfo &info); Napi::Value Destroy(const Napi::CallbackInfo &info);
Napi::Value GetClipboard(const Napi::CallbackInfo &info);
Napi::Value SetInteger(const Napi::CallbackInfo &info);
Napi::Value SetText(const Napi::CallbackInfo &info);
Napi::Value SetVoid(const Napi::CallbackInfo &info);
Napi::Value GetInteger(const Napi::CallbackInfo &info);
Napi::Value GetText(const Napi::CallbackInfo &info);
Napi::Value GetVoid(const Napi::CallbackInfo &info);
Napi::Value GetArea(const Napi::CallbackInfo &info); Napi::Value GetArea(const Napi::CallbackInfo &info);
Napi::Value IsPending(const Napi::CallbackInfo &info); Napi::Value IsPending(const Napi::CallbackInfo &info);
Napi::Value GetParent(const Napi::CallbackInfo &info); Napi::Value GetParent(const Napi::CallbackInfo &info);
Napi::Value GetChildren(const Napi::CallbackInfo &info); Napi::Value GetChildren(const Napi::CallbackInfo &info);
Napi::Value GetName(const Napi::CallbackInfo &info); Napi::Value GetName(const Napi::CallbackInfo &info);
Napi::Value GetCursorCoord(const Napi::CallbackInfo &info); Napi::Value GetCursorCoord(const Napi::CallbackInfo &info);
Napi::Value GetScreenSize(const Napi::CallbackInfo &info); Napi::Value GetScreenSize(const Napi::CallbackInfo &info);
Napi::Value GetCoordinateType(const Napi::CallbackInfo &info); Napi::Value GetCoordinateType(const Napi::CallbackInfo &info);
}; Napi::Value GetNativeClass(const Napi::CallbackInfo &info);
};