-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathqsize_implement.h
More file actions
38 lines (34 loc) · 1.27 KB
/
Copy pathqsize_implement.h
File metadata and controls
38 lines (34 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include "framework.h"
#include <qsize.h>
#include "qsize_p.h"
#include "qsize_wrapper.h"
namespace shelllet {
namespace core {
class Size : public QSizeWrapper<QSize, Size, true>
{
public:
using ReturnType = QSizePrivate<QSize, true>;
using ReturnType2 = QSizePrivate<QSize, false>;
ReturnType* Private(const v8::FunctionCallbackInfo<v8::Value>& args) {
auto w = args[0]->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust();
auto h = args[1]->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust();
return new ReturnType(args.GetIsolate(), args.This(), w, h);
}
Size(const v8::FunctionCallbackInfo<v8::Value>& args) :QSizeWrapper(*Private(args), args)
{
}
Size(QSize* p, const v8::FunctionCallbackInfo<v8::Value>& args) : QSizeWrapper(*new ReturnType2(args.GetIsolate(), args.This(), p), args)
{
}
Size(v8::Isolate* isolate, const v8::Local<v8::FunctionTemplate>& tpl) : QSizeWrapper(isolate, tpl) {}
Size(v8::Isolate* isolate, const v8::Local<v8::ObjectTemplate>& proto) : QSizeWrapper(isolate, proto)
{}
static const char* Name() { return "Size"; }
protected:
virtual void toString(std::stringstream& ss) const {
//ss << "(" << (*this)->x() << ", " << (*this)->y() << ")";
}
};
}
}