24 #include <QtCore/QDebug>
25 #include <QtCore/QRect>
26 #include <QtCore/QPoint>
27 #include <QtCore/QSize>
29 using namespace KJSEmbed;
50 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
51 int arg1 = KJSEmbed::
extractInt(exec, args, 1);
52 int arg2 = KJSEmbed::
extractInt(exec, args, 2);
53 int arg3 = KJSEmbed::
extractInt(exec, args, 3);
59 int cppValue =
value.bottom();
60 result = KJS::jsNumber(cppValue);
69 QPoint cppValue =
value.bottomRight();
74 QPoint cppValue =
value.center();
80 if( args.size() == 2 )
82 QPoint arg0 = KJSEmbed::extractVariant<QPoint>(exec,args, 0);
84 bool cppValue =
value.contains(arg0, arg1);
85 result = KJS::jsBoolean(cppValue);
88 else if( args.size() == 3 )
94 result = KJS::jsBoolean(cppValue);
101 bool cppValue =
value.contains(arg0, arg1);
102 result = KJS::jsBoolean(cppValue);
107 int cppValue =
value.height();
108 result = KJS::jsNumber(cppValue);
119 bool cppValue =
value.intersects(arg0);
120 result = KJS::jsBoolean(cppValue);
124 bool cppValue =
value.isEmpty();
125 result = KJS::jsBoolean(cppValue);
129 bool cppValue =
value.isNull();
130 result = KJS::jsBoolean(cppValue);
134 bool cppValue =
value.isValid();
135 result = KJS::jsBoolean(cppValue);
139 int cppValue =
value.left();
140 result = KJS::jsNumber(cppValue);
144 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
164 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
169 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
174 if( args.size() == 1)
176 QPoint arg0 = KJSEmbed::extractVariant<QPoint>(exec,args, 0);
183 value.moveTo(arg0, arg1);
188 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
203 QRect cppValue =
value.normalized();
208 int cppValue =
value.right();
209 result = KJS::jsNumber(cppValue);
213 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
228 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
229 int arg1 = KJSEmbed::
extractInt(exec, args, 1);
230 int arg2 = KJSEmbed::
extractInt(exec, args, 2);
236 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
241 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
246 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
247 int arg1 = KJSEmbed::
extractInt(exec, args, 1);
248 int arg2 = KJSEmbed::
extractInt(exec, args, 2);
249 int arg3 = KJSEmbed::
extractInt(exec, args, 3);
254 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
264 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
279 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
284 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
289 int arg0 = KJSEmbed::
extractInt(exec, args, 0);
299 int cppValue =
value.top();
300 result = KJS::jsNumber(cppValue);
309 QPoint cppValue =
value.topRight();
314 if( args.size() == 1)
316 QPoint arg0 = KJSEmbed::extractVariant<QPoint>(exec,args, 0);
317 value.translate(arg0);
323 value.translate(arg0, arg1);
328 if( args.size() == 1 )
330 QPoint arg0 = KJSEmbed::extractVariant<QPoint>(exec,args, 0);
331 QRect cppValue =
value.translated(arg0);
338 QRect cppValue =
value.translated(arg0, arg1);
345 QRect cppValue =
value.unite(arg0);
351 result = KJS::jsNumber(cppValue);
356 result = KJS::jsNumber(cppValue);
361 result = KJS::jsNumber(cppValue);
366 {
"adjust", 3, KJS::DontDelete|KJS::ReadOnly, &RectNS::calladjust},
367 {
"adjusted", 3, KJS::DontDelete|KJS::ReadOnly, &RectNS::calladjusted},
368 {
"bottom", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callbottom},
369 {
"bottomLeft", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callbottomLeft},
370 {
"bottomRight", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callbottomRight},
371 {
"center", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callcenter},
372 {
"contains", 2, KJS::DontDelete|KJS::ReadOnly, &RectNS::callcontains},
373 {
"height", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callheight},
374 {
"intersect", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callintersect},
375 {
"intersects", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callintersects},
376 {
"isEmpty", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callisEmpty},
377 {
"isNull", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callisNull},
378 {
"isValid", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callisValid},
379 {
"left", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callleft},
380 {
"moveBottom", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callmoveBottom},
381 {
"moveBottomLeft", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callmoveBottomLeft},
382 {
"moveBottomRight", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callmoveBottomRight},
383 {
"moveCenter", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callmoveCenter},
384 {
"moveLeft", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callmoveLeft},
385 {
"moveRight", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callmoveRight},
386 {
"moveTo", 1, KJS::DontDelete|KJS::ReadOnly, &RectNS::callmoveTo},
387 {
"moveTop", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callmoveTop},
388 {
"moveTopLeft", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callmoveTopLeft},
389 {
"moveTopRight", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callmoveTopRight},
390 {
"normalized", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callnormalized},
391 {
"right", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callright},
392 {
"setBottom", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetBottom},
393 {
"setBottomLeft", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetBottomLeft},
394 {
"setBottomRight", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetBottomRight},
395 {
"setCoords", 3, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetCoords},
396 {
"setHeight", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetHeight},
397 {
"setLeft", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetLeft},
398 {
"setRect", 3, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetRect},
399 {
"setRight", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetRight},
400 {
"setSize", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetSize},
401 {
"setTop", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetTop},
402 {
"setTopLeft", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetTopLeft},
403 {
"setTopRight", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetTopRight},
404 {
"setWidth", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetWidth},
405 {
"setX", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetX},
406 {
"setY", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsetY},
407 {
"size", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callsize},
408 {
"top", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::calltop},
409 {
"topLeft", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::calltopLeft},
410 {
"topRight", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::calltopRight},
411 {
"translate", 1, KJS::DontDelete|KJS::ReadOnly, &RectNS::calltranslate},
412 {
"translated", 1, KJS::DontDelete|KJS::ReadOnly, &RectNS::calltranslated},
413 {
"unite", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callunite},
414 {
"width", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callwidth},
415 {
"x", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::callx},
416 {
"y", 0, KJS::DontDelete|KJS::ReadOnly, &RectNS::cally}
423 if( args.size() == 2 )
430 else if( args.size() == 4 )
END_VARIANT_METHOD if(args.size()==2)
static void publish(KJS::ExecState *exec, KJS::JSObject *object, const Method *methods)
Publishes an array of Methods to an object.
value moveBottomLeft(arg0)
value moveBottomRight(arg0)
KJS::JSValue * createVariant(KJS::ExecState *exec, const KJS::UString &className, const T &value)
Can create any known KJSEmbed::VariantBinding object and set the value.
bool KJSEMBED_EXPORT extractBool(KJS::ExecState *exec, const KJS::List &args, int idx, bool defaultValue=false)
Extracts a bool from an argument list.
value setBottomRight(arg0)
int KJSEMBED_EXPORT extractInt(KJS::ExecState *exec, const KJS::List &args, int idx, int defaultValue=0)
Extracts an integer from an argument list.
#define START_CTOR(TYPE, JSNAME, ARGS)
value setBottomLeft(arg0)
value adjust(arg0, arg1, arg2, arg3)
value setCoords(arg0, arg1, arg2, arg3)
value setRect(arg0, arg1, arg2, arg3)
RectBinding(KJS::ExecState *exec, const QRect &value)
static const Method * methods()
END_OBJECT_METHOD QBrush cppValue
#define END_VARIANT_METHOD
End a variant method started by START_VARIANT_METHOD.
END_OBJECT_METHOD QPolygon arg0
#define START_VARIANT_METHOD(METHODNAME, TYPE)
A simple variant syle method.
QVariant KJSEMBED_EXPORT extractVariant(KJS::ExecState *exec, KJS::JSValue *value)
Extracts a QVariant from a KJS::JSValue if the conversion fails a QVariant::Null is returned...