2 #include <QtGui/QBrush>
7 using namespace KJSEmbed;
10 class QColorBinding {
public:
static const KJS::ClassInfo info; };
11 class QPixmapBinding {
public:
static const KJS::ClassInfo info; };
12 class QGradientBinding {
public:
static const KJS::ClassInfo info; };
30 KJS::JSValue *
style( KJS::ExecState *exec, KJS::JSObject *
self,
const KJS::List &args )
33 KJS::JSValue *
result = KJS::jsNull();
36 return KJS::throwError(exec, KJS::GeneralError,
"No implementation? Huh?");
39 if (args.size() == 0 )
41 Qt::BrushStyle tmp = value.style();
42 result = KJS::jsNumber( tmp );
43 imp->
setValue(qVariantFromValue(value));
47 return KJS::throwError(exec, KJS::SyntaxError,
"Syntax error in parameter list for QBrush.style");
54 KJS::JSValue *
result = KJS::jsNull();
57 return KJS::throwError(exec, KJS::GeneralError,
"No implementation? Huh?");
60 if (args.size() == 1 )
62 KJS::JSValue* value0=args[0];
63 KJS::JSObject* object0=value0->toObject(exec);
64 if(object0 && object0->isNumber())
66 Qt::BrushStyle
arg0 = KJSEmbed::extractInteger<Qt::BrushStyle>(exec, args, 0);
68 imp->
setValue(qVariantFromValue(value));
73 return KJS::throwError(exec, KJS::SyntaxError,
"Syntax error in parameter list for QBrush.setStyle");
77 KJS::JSValue *
texture( KJS::ExecState *exec, KJS::JSObject *
self,
const KJS::List &args )
80 KJS::JSValue *
result = KJS::jsNull();
83 return KJS::throwError(exec, KJS::GeneralError,
"No implementation? Huh?");
86 if (args.size() == 0 )
88 QPixmap tmp = value.texture();
90 imp->
setValue(qVariantFromValue(value));
94 return KJS::throwError(exec, KJS::SyntaxError,
"Syntax error in parameter list for QBrush.texture");
101 KJS::JSValue *
result = KJS::jsNull();
104 return KJS::throwError(exec, KJS::GeneralError,
"No implementation? Huh?");
107 if (args.size() == 1 )
109 KJS::JSValue* value0=args[0];
110 KJS::JSObject* object0=value0->toObject(exec);
111 if(object0 && object0->inherits(&QPixmapBinding::info))
113 QPixmap pixmap = KJSEmbed::extractVariant<QPixmap>(exec, args, 0);
114 value.setTexture(pixmap);
115 imp->
setValue(qVariantFromValue(value));
120 return KJS::throwError(exec, KJS::SyntaxError,
"Syntax error in parameter list for QBrush.setTexture");
124 KJS::JSValue *
color( KJS::ExecState *exec, KJS::JSObject *
self,
const KJS::List &args )
127 KJS::JSValue *
result = KJS::jsNull();
130 return KJS::throwError(exec, KJS::GeneralError,
"No implementation? Huh?");
133 if (args.size() == 0 )
135 const QColor & tmp = value.color();
137 imp->
setValue(qVariantFromValue(value));
141 return KJS::throwError(exec, KJS::SyntaxError,
"Syntax error in parameter list for QBrush.color");
148 KJS::JSValue *
result = KJS::jsNull();
151 return KJS::throwError(exec, KJS::GeneralError,
"No implementation? Huh?");
154 if (args.size() == 1 )
156 KJS::JSValue* value0=args[0];
157 KJS::JSObject* object0=value0->toObject(exec);
158 if(object0 && object0->inherits(&QColorBinding::info))
160 QColor
color = KJSEmbed::extractVariant<QColor>(exec, args, 0);
161 value.setColor(color);
162 imp->
setValue(qVariantFromValue(value));
165 if(object0 && object0->isNumber())
167 Qt::GlobalColor
color = KJSEmbed::extractInteger<Qt::GlobalColor>(exec, args, 0);
168 value.setColor(color);
169 imp->
setValue(qVariantFromValue(value));
174 return KJS::throwError(exec, KJS::SyntaxError,
"Syntax error in parameter list for QBrush.setColor");
181 KJS::JSValue *
result = KJS::jsNull();
184 return KJS::throwError(exec, KJS::GeneralError,
"No implementation? Huh?");
187 if (args.size() == 0 )
189 const QGradient * tmp = value.gradient();
191 imp->
setValue(qVariantFromValue(value));
195 return KJS::throwError(exec, KJS::SyntaxError,
"Syntax error in parameter list for QBrush.gradient");
202 KJS::JSValue *
result = KJS::jsNull();
205 return KJS::throwError(exec, KJS::GeneralError,
"No implementation? Huh?");
208 if (args.size() == 0 )
210 bool tmp = value.isOpaque();
212 imp->
setValue(qVariantFromValue(value));
216 return KJS::throwError(exec, KJS::SyntaxError,
"Syntax error in parameter list for QBrush.isOpaque");
228 if (args.size() == 0 )
232 if (args.size() == 1 )
234 KJS::JSValue* value0=args[0];
235 KJS::JSObject* object0=value0->toObject(exec);
236 if(object0 && object0->isNumber())
238 Qt::BrushStyle bs = KJSEmbed::extractInteger<Qt::BrushStyle>(exec, args, 0);
241 if(object0 && object0->inherits(&QPixmapBinding::info))
243 QPixmap pixmap = KJSEmbed::extractVariant<QPixmap>(exec, args, 0);
248 QBrush brush = KJSEmbed::extractVariant<QBrush>(exec, args, 0);
251 if(object0 && object0->inherits(&QGradientBinding::info))
253 QGradient
gradient = KJSEmbed::extractValue<QGradient>(exec, args, 0);
257 if (args.size() == 2 )
259 KJS::JSValue* value0=args[0];
260 KJS::JSObject* object0=value0->toObject(exec);
261 KJS::JSValue* value1=args[1];
262 KJS::JSObject* object1=value1->toObject(exec);
263 if(object0 && object0->inherits(&QColorBinding::info) && ( ( object1 && object1->isNumber() ) || !object1 ))
265 QColor
color = KJSEmbed::extractVariant<QColor>(exec, args, 0);
266 Qt::BrushStyle bs = KJSEmbed::extractInteger<Qt::BrushStyle>(exec, args, 1, Qt::SolidPattern);
269 if(object0 && object0->isNumber() && ( ( object1 && object1->isNumber() ) || !object1 ))
271 Qt::GlobalColor
color = KJSEmbed::extractInteger<Qt::GlobalColor>(exec, args, 0);
272 Qt::BrushStyle bs = KJSEmbed::extractInteger<Qt::BrushStyle>(exec, args, 1, Qt::SolidPattern);
275 if(object0 && object0->inherits(&QColorBinding::info) && object1 && object1->inherits(&QPixmapBinding::info))
277 QColor
color = KJSEmbed::extractVariant<QColor>(exec, args, 0);
278 QPixmap pixmap = KJSEmbed::extractVariant<QPixmap>(exec, args, 1);
281 if(object0 && object0->isNumber() && object1 && object1->inherits(&QPixmapBinding::info))
283 Qt::GlobalColor
color = KJSEmbed::extractInteger<Qt::GlobalColor>(exec, args, 0);
284 QPixmap pixmap = KJSEmbed::extractVariant<QPixmap>(exec, args, 1);
288 return KJS::throwError(exec, KJS::SyntaxError,
"Syntax error in parameter list for QBrush");