00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <QtScript/QScriptEngine>
00023 #include <QtScript/QScriptContext>
00024 #include <QtScript/QScriptValue>
00025 #include <QtCore/QStringList>
00026 #include <QtCore/QDebug>
00027 #include <qmetaobject.h>
00028
00029 #include <QVariant>
00030 #include <qcolor.h>
00031 #include <qdatastream.h>
00032 #include <qstringlist.h>
00033
00034 static const char* const qtscript_QColor_function_names[] =
00035 {
00036 "QColor"
00037
00038 , "colorNames"
00039 , "fromCmyk"
00040 , "fromCmykF"
00041 , "fromHsl"
00042 , "fromHslF"
00043 , "fromHsv"
00044 , "fromHsvF"
00045 , "fromRgb"
00046 , "fromRgbF"
00047 , "fromRgba"
00048
00049 , "alpha"
00050 , "alphaF"
00051 , "black"
00052 , "blackF"
00053 , "blue"
00054 , "blueF"
00055 , "convertTo"
00056 , "cyan"
00057 , "cyanF"
00058 , "darker"
00059 , "getHsl"
00060 , "getHslF"
00061 , "green"
00062 , "greenF"
00063 , "hslHue"
00064 , "hslHueF"
00065 , "hslSaturation"
00066 , "hslSaturationF"
00067 , "hsvHue"
00068 , "hsvHueF"
00069 , "hsvSaturation"
00070 , "hsvSaturationF"
00071 , "hue"
00072 , "hueF"
00073 , "isValid"
00074 , "lighter"
00075 , "lightness"
00076 , "lightnessF"
00077 , "magenta"
00078 , "magentaF"
00079 , "name"
00080 , "equals"
00081 , "readFrom"
00082 , "red"
00083 , "redF"
00084 , "rgb"
00085 , "rgba"
00086 , "saturation"
00087 , "saturationF"
00088 , "setAlpha"
00089 , "setAlphaF"
00090 , "setBlue"
00091 , "setBlueF"
00092 , "setCmyk"
00093 , "setCmykF"
00094 , "setGreen"
00095 , "setGreenF"
00096 , "setHsl"
00097 , "setHslF"
00098 , "setHsv"
00099 , "setHsvF"
00100 , "setNamedColor"
00101 , "setRed"
00102 , "setRedF"
00103 , "setRgb"
00104 , "setRgbF"
00105 , "setRgba"
00106 , "spec"
00107 , "toCmyk"
00108 , "toHsl"
00109 , "toHsv"
00110 , "toRgb"
00111 , "value"
00112 , "valueF"
00113 , "writeTo"
00114 , "yellow"
00115 , "yellowF"
00116 , "toString"
00117 };
00118
00119 static const char* const qtscript_QColor_function_signatures[] =
00120 {
00121 "\nGlobalColor color\nQColor color\nString name\nint r, int g, int b, int a\nunsigned int rgb"
00122
00123 , ""
00124 , "int c, int m, int y, int k, int a"
00125 , "qreal c, qreal m, qreal y, qreal k, qreal a"
00126 , "int h, int s, int l, int a"
00127 , "qreal h, qreal s, qreal l, qreal a"
00128 , "int h, int s, int v, int a"
00129 , "qreal h, qreal s, qreal v, qreal a"
00130 , "int r, int g, int b, int a\nunsigned int rgb"
00131 , "qreal r, qreal g, qreal b, qreal a"
00132 , "unsigned int rgba"
00133
00134 , ""
00135 , ""
00136 , ""
00137 , ""
00138 , ""
00139 , ""
00140 , "Spec colorSpec"
00141 , ""
00142 , ""
00143 , "int f"
00144 , "int h, int s, int l, int a"
00145 , "qreal h, qreal s, qreal l, qreal a"
00146 , ""
00147 , ""
00148 , ""
00149 , ""
00150 , ""
00151 , ""
00152 , ""
00153 , ""
00154 , ""
00155 , ""
00156 , ""
00157 , ""
00158 , ""
00159 , "int f"
00160 , ""
00161 , ""
00162 , ""
00163 , ""
00164 , ""
00165 , "QColor c"
00166 , "QDataStream arg__1"
00167 , ""
00168 , ""
00169 , ""
00170 , ""
00171 , ""
00172 , ""
00173 , "int alpha"
00174 , "qreal alpha"
00175 , "int blue"
00176 , "qreal blue"
00177 , "int c, int m, int y, int k, int a"
00178 , "qreal c, qreal m, qreal y, qreal k, qreal a"
00179 , "int green"
00180 , "qreal green"
00181 , "int h, int s, int l, int a"
00182 , "qreal h, qreal s, qreal l, qreal a"
00183 , "int h, int s, int v, int a"
00184 , "qreal h, qreal s, qreal v, qreal a"
00185 , "String name"
00186 , "int red"
00187 , "qreal red"
00188 , "int r, int g, int b, int a\nunsigned int rgb"
00189 , "qreal r, qreal g, qreal b, qreal a"
00190 , "unsigned int rgba"
00191 , ""
00192 , ""
00193 , ""
00194 , ""
00195 , ""
00196 , ""
00197 , ""
00198 , "QDataStream arg__1"
00199 , ""
00200 , ""
00201 ""
00202 };
00203
00204 static const int qtscript_QColor_function_lengths[] =
00205 {
00206 4
00207
00208 , 0
00209 , 5
00210 , 5
00211 , 4
00212 , 4
00213 , 4
00214 , 4
00215 , 4
00216 , 4
00217 , 1
00218
00219 , 0
00220 , 0
00221 , 0
00222 , 0
00223 , 0
00224 , 0
00225 , 1
00226 , 0
00227 , 0
00228 , 1
00229 , 4
00230 , 4
00231 , 0
00232 , 0
00233 , 0
00234 , 0
00235 , 0
00236 , 0
00237 , 0
00238 , 0
00239 , 0
00240 , 0
00241 , 0
00242 , 0
00243 , 0
00244 , 1
00245 , 0
00246 , 0
00247 , 0
00248 , 0
00249 , 0
00250 , 1
00251 , 1
00252 , 0
00253 , 0
00254 , 0
00255 , 0
00256 , 0
00257 , 0
00258 , 1
00259 , 1
00260 , 1
00261 , 1
00262 , 5
00263 , 5
00264 , 1
00265 , 1
00266 , 4
00267 , 4
00268 , 4
00269 , 4
00270 , 1
00271 , 1
00272 , 1
00273 , 4
00274 , 4
00275 , 1
00276 , 0
00277 , 0
00278 , 0
00279 , 0
00280 , 0
00281 , 0
00282 , 0
00283 , 1
00284 , 0
00285 , 0
00286 , 0
00287 };
00288
00289 static QScriptValue qtscript_QColor_throw_ambiguity_error_helper(
00290 QScriptContext* context, const char* functionName, const char* signatures )
00291 {
00292 QStringList lines = QString::fromLatin1( signatures ).split( QLatin1Char( '\n' ) );
00293 QStringList fullSignatures;
00294 for( int i = 0; i < lines.size(); ++i )
00295 fullSignatures.append( QString::fromLatin1( "%0(%1)" ).arg( functionName ).arg( lines.at( i ) ) );
00296 return context->throwError( QString::fromLatin1( "QColor::%0(): could not find a function match; candidates are:\n%1" )
00297 .arg( functionName ).arg( fullSignatures.join( QLatin1String( "\n" ) ) ) );
00298 }
00299
00300 Q_DECLARE_METATYPE( QColor* )
00301 Q_DECLARE_METATYPE( QColor::Spec )
00302 Q_DECLARE_METATYPE( int* )
00303 Q_DECLARE_METATYPE( qreal* )
00304 Q_DECLARE_METATYPE( QDataStream* )
00305 Q_DECLARE_METATYPE( Qt::GlobalColor )
00306
00307 static QScriptValue qtscript_create_enum_class_helper(
00308 QScriptEngine* engine,
00309 QScriptEngine::FunctionSignature construct,
00310 QScriptEngine::FunctionSignature valueOf,
00311 QScriptEngine::FunctionSignature toString )
00312 {
00313 QScriptValue proto = engine->newObject();
00314 proto.setProperty( QString::fromLatin1( "valueOf" ),
00315 engine->newFunction( valueOf ), QScriptValue::SkipInEnumeration );
00316 proto.setProperty( QString::fromLatin1( "toString" ),
00317 engine->newFunction( toString ), QScriptValue::SkipInEnumeration );
00318 return engine->newFunction( construct, proto, 1 );
00319 }
00320
00321
00322
00323
00324
00325 static const QColor::Spec qtscript_QColor_Spec_values[] =
00326 {
00327 QColor::Invalid
00328 , QColor::Rgb
00329 , QColor::Hsv
00330 , QColor::Cmyk
00331 , QColor::Hsl
00332 };
00333
00334 static const char* const qtscript_QColor_Spec_keys[] =
00335 {
00336 "Invalid"
00337 , "Rgb"
00338 , "Hsv"
00339 , "Cmyk"
00340 , "Hsl"
00341 };
00342
00343 static QString qtscript_QColor_Spec_toStringHelper( QColor::Spec value )
00344 {
00345 if(( value >= QColor::Invalid ) && ( value <= QColor::Hsl ) )
00346 return qtscript_QColor_Spec_keys[static_cast<int>( value )-static_cast<int>( QColor::Invalid )];
00347 return QString();
00348 }
00349
00350 static QScriptValue qtscript_QColor_Spec_toScriptValue( QScriptEngine* engine, const QColor::Spec& value )
00351 {
00352 QScriptValue clazz = engine->globalObject().property( QString::fromLatin1( "QColor" ) );
00353 return clazz.property( qtscript_QColor_Spec_toStringHelper( value ) );
00354 }
00355
00356 static void qtscript_QColor_Spec_fromScriptValue( const QScriptValue& value, QColor::Spec& out )
00357 {
00358 out = qvariant_cast<QColor::Spec>( value.toVariant() );
00359 }
00360
00361 static QScriptValue qtscript_construct_QColor_Spec( QScriptContext* context, QScriptEngine* engine )
00362 {
00363 int arg = context->argument( 0 ).toInt32();
00364 if(( arg >= QColor::Invalid ) && ( arg <= QColor::Hsl ) )
00365 return qScriptValueFromValue( engine, static_cast<QColor::Spec>( arg ) );
00366 return context->throwError( QString::fromLatin1( "Spec(): invalid enum value (%0)" ).arg( arg ) );
00367 }
00368
00369 static QScriptValue qtscript_QColor_Spec_valueOf( QScriptContext* context, QScriptEngine* engine )
00370 {
00371 QColor::Spec value = qscriptvalue_cast<QColor::Spec>( context->thisObject() );
00372 return QScriptValue( engine, static_cast<int>( value ) );
00373 }
00374
00375 static QScriptValue qtscript_QColor_Spec_toString( QScriptContext* context, QScriptEngine* engine )
00376 {
00377 QColor::Spec value = qscriptvalue_cast<QColor::Spec>( context->thisObject() );
00378 return QScriptValue( engine, qtscript_QColor_Spec_toStringHelper( value ) );
00379 }
00380
00381 static QScriptValue qtscript_create_QColor_Spec_class( QScriptEngine* engine, QScriptValue& clazz )
00382 {
00383 QScriptValue ctor = qtscript_create_enum_class_helper(
00384 engine, qtscript_construct_QColor_Spec,
00385 qtscript_QColor_Spec_valueOf, qtscript_QColor_Spec_toString );
00386 qScriptRegisterMetaType<QColor::Spec>( engine, qtscript_QColor_Spec_toScriptValue,
00387 qtscript_QColor_Spec_fromScriptValue, ctor.property( QString::fromLatin1( "prototype" ) ) );
00388 for( int i = 0; i < 5; ++i )
00389 {
00390 clazz.setProperty( QString::fromLatin1( qtscript_QColor_Spec_keys[i] ),
00391 engine->newVariant( qVariantFromValue( qtscript_QColor_Spec_values[i] ) ),
00392 QScriptValue::ReadOnly | QScriptValue::Undeletable );
00393 }
00394 return ctor;
00395 }
00396
00397
00398
00399
00400
00401 static QScriptValue qtscript_QColor_prototype_call( QScriptContext* context, QScriptEngine* )
00402 {
00403 #if QT_VERSION > 0x040400
00404 Q_ASSERT( context->callee().isFunction() );
00405 uint _id = context->callee().data().toUInt32();
00406 #else
00407 uint _id;
00408 if( context->callee().isFunction() )
00409 _id = context->callee().data().toUInt32();
00410 else
00411 _id = 0xBABE0000 + 67;
00412 #endif
00413 Q_ASSERT(( _id & 0xFFFF0000 ) == 0xBABE0000 );
00414 _id &= 0x0000FFFF;
00415 QColor* _q_self = qscriptvalue_cast<QColor*>( context->thisObject() );
00416 if( !_q_self )
00417 {
00418 return context->throwError( QScriptContext::TypeError,
00419 QString::fromLatin1( "QColor.%0(): this object is not a QColor" )
00420 .arg( qtscript_QColor_function_names[_id+11] ) );
00421 }
00422
00423 switch( _id )
00424 {
00425 case 0:
00426 if( context->argumentCount() == 0 )
00427 {
00428 int _q_result = _q_self->alpha();
00429 return QScriptValue( context->engine(), _q_result );
00430 }
00431 break;
00432
00433 case 1:
00434 if( context->argumentCount() == 0 )
00435 {
00436 qreal _q_result = _q_self->alphaF();
00437 return qScriptValueFromValue( context->engine(), _q_result );
00438 }
00439 break;
00440
00441 case 2:
00442 if( context->argumentCount() == 0 )
00443 {
00444 int _q_result = _q_self->black();
00445 return QScriptValue( context->engine(), _q_result );
00446 }
00447 break;
00448
00449 case 3:
00450 if( context->argumentCount() == 0 )
00451 {
00452 qreal _q_result = _q_self->blackF();
00453 return qScriptValueFromValue( context->engine(), _q_result );
00454 }
00455 break;
00456
00457 case 4:
00458 if( context->argumentCount() == 0 )
00459 {
00460 int _q_result = _q_self->blue();
00461 return QScriptValue( context->engine(), _q_result );
00462 }
00463 break;
00464
00465 case 5:
00466 if( context->argumentCount() == 0 )
00467 {
00468 qreal _q_result = _q_self->blueF();
00469 return qScriptValueFromValue( context->engine(), _q_result );
00470 }
00471 break;
00472
00473 case 6:
00474 if( context->argumentCount() == 1 )
00475 {
00476 QColor::Spec _q_arg0 = qscriptvalue_cast<QColor::Spec>( context->argument( 0 ) );
00477 QColor _q_result = _q_self->convertTo( _q_arg0 );
00478 return qScriptValueFromValue( context->engine(), _q_result );
00479 }
00480 break;
00481
00482 case 7:
00483 if( context->argumentCount() == 0 )
00484 {
00485 int _q_result = _q_self->cyan();
00486 return QScriptValue( context->engine(), _q_result );
00487 }
00488 break;
00489
00490 case 8:
00491 if( context->argumentCount() == 0 )
00492 {
00493 qreal _q_result = _q_self->cyanF();
00494 return qScriptValueFromValue( context->engine(), _q_result );
00495 }
00496 break;
00497
00498 case 9:
00499 if( context->argumentCount() == 0 )
00500 {
00501 QColor _q_result = _q_self->darker();
00502 return qScriptValueFromValue( context->engine(), _q_result );
00503 }
00504 if( context->argumentCount() == 1 )
00505 {
00506 int _q_arg0 = context->argument( 0 ).toInt32();
00507 QColor _q_result = _q_self->darker( _q_arg0 );
00508 return qScriptValueFromValue( context->engine(), _q_result );
00509 }
00510 break;
00511
00512 case 10:
00513 if( context->argumentCount() == 3 )
00514 {
00515 int* _q_arg0 = qscriptvalue_cast<int*>( context->argument( 0 ) );
00516 int* _q_arg1 = qscriptvalue_cast<int*>( context->argument( 1 ) );
00517 int* _q_arg2 = qscriptvalue_cast<int*>( context->argument( 2 ) );
00518 _q_self->getHsl( _q_arg0, _q_arg1, _q_arg2 );
00519 return context->engine()->undefinedValue();
00520 }
00521 if( context->argumentCount() == 4 )
00522 {
00523 int* _q_arg0 = qscriptvalue_cast<int*>( context->argument( 0 ) );
00524 int* _q_arg1 = qscriptvalue_cast<int*>( context->argument( 1 ) );
00525 int* _q_arg2 = qscriptvalue_cast<int*>( context->argument( 2 ) );
00526 int* _q_arg3 = qscriptvalue_cast<int*>( context->argument( 3 ) );
00527 _q_self->getHsl( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
00528 return context->engine()->undefinedValue();
00529 }
00530 break;
00531
00532 case 11:
00533 if( context->argumentCount() == 3 )
00534 {
00535 qreal* _q_arg0 = qscriptvalue_cast<qreal*>( context->argument( 0 ) );
00536 qreal* _q_arg1 = qscriptvalue_cast<qreal*>( context->argument( 1 ) );
00537 qreal* _q_arg2 = qscriptvalue_cast<qreal*>( context->argument( 2 ) );
00538 _q_self->getHslF( _q_arg0, _q_arg1, _q_arg2 );
00539 return context->engine()->undefinedValue();
00540 }
00541 if( context->argumentCount() == 4 )
00542 {
00543 qreal* _q_arg0 = qscriptvalue_cast<qreal*>( context->argument( 0 ) );
00544 qreal* _q_arg1 = qscriptvalue_cast<qreal*>( context->argument( 1 ) );
00545 qreal* _q_arg2 = qscriptvalue_cast<qreal*>( context->argument( 2 ) );
00546 qreal* _q_arg3 = qscriptvalue_cast<qreal*>( context->argument( 3 ) );
00547 _q_self->getHslF( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
00548 return context->engine()->undefinedValue();
00549 }
00550 break;
00551
00552 case 12:
00553 if( context->argumentCount() == 0 )
00554 {
00555 int _q_result = _q_self->green();
00556 return QScriptValue( context->engine(), _q_result );
00557 }
00558 break;
00559
00560 case 13:
00561 if( context->argumentCount() == 0 )
00562 {
00563 qreal _q_result = _q_self->greenF();
00564 return qScriptValueFromValue( context->engine(), _q_result );
00565 }
00566 break;
00567
00568 case 14:
00569 if( context->argumentCount() == 0 )
00570 {
00571 int _q_result = _q_self->hslHue();
00572 return QScriptValue( context->engine(), _q_result );
00573 }
00574 break;
00575
00576 case 15:
00577 if( context->argumentCount() == 0 )
00578 {
00579 qreal _q_result = _q_self->hslHueF();
00580 return qScriptValueFromValue( context->engine(), _q_result );
00581 }
00582 break;
00583
00584 case 16:
00585 if( context->argumentCount() == 0 )
00586 {
00587 int _q_result = _q_self->hslSaturation();
00588 return QScriptValue( context->engine(), _q_result );
00589 }
00590 break;
00591
00592 case 17:
00593 if( context->argumentCount() == 0 )
00594 {
00595 qreal _q_result = _q_self->hslSaturationF();
00596 return qScriptValueFromValue( context->engine(), _q_result );
00597 }
00598 break;
00599
00600 case 18:
00601 if( context->argumentCount() == 0 )
00602 {
00603 int _q_result = _q_self->hsvHue();
00604 return QScriptValue( context->engine(), _q_result );
00605 }
00606 break;
00607
00608 case 19:
00609 if( context->argumentCount() == 0 )
00610 {
00611 qreal _q_result = _q_self->hsvHueF();
00612 return qScriptValueFromValue( context->engine(), _q_result );
00613 }
00614 break;
00615
00616 case 20:
00617 if( context->argumentCount() == 0 )
00618 {
00619 int _q_result = _q_self->hsvSaturation();
00620 return QScriptValue( context->engine(), _q_result );
00621 }
00622 break;
00623
00624 case 21:
00625 if( context->argumentCount() == 0 )
00626 {
00627 qreal _q_result = _q_self->hsvSaturationF();
00628 return qScriptValueFromValue( context->engine(), _q_result );
00629 }
00630 break;
00631
00632 case 22:
00633 if( context->argumentCount() == 0 )
00634 {
00635 int _q_result = _q_self->hue();
00636 return QScriptValue( context->engine(), _q_result );
00637 }
00638 break;
00639
00640 case 23:
00641 if( context->argumentCount() == 0 )
00642 {
00643 qreal _q_result = _q_self->hueF();
00644 return qScriptValueFromValue( context->engine(), _q_result );
00645 }
00646 break;
00647
00648 case 24:
00649 if( context->argumentCount() == 0 )
00650 {
00651 bool _q_result = _q_self->isValid();
00652 return QScriptValue( context->engine(), _q_result );
00653 }
00654 break;
00655
00656 case 25:
00657 if( context->argumentCount() == 0 )
00658 {
00659 QColor _q_result = _q_self->lighter();
00660 return qScriptValueFromValue( context->engine(), _q_result );
00661 }
00662 if( context->argumentCount() == 1 )
00663 {
00664 int _q_arg0 = context->argument( 0 ).toInt32();
00665 QColor _q_result = _q_self->lighter( _q_arg0 );
00666 return qScriptValueFromValue( context->engine(), _q_result );
00667 }
00668 break;
00669
00670 case 26:
00671 if( context->argumentCount() == 0 )
00672 {
00673 int _q_result = _q_self->lightness();
00674 return QScriptValue( context->engine(), _q_result );
00675 }
00676 break;
00677
00678 case 27:
00679 if( context->argumentCount() == 0 )
00680 {
00681 qreal _q_result = _q_self->lightnessF();
00682 return qScriptValueFromValue( context->engine(), _q_result );
00683 }
00684 break;
00685
00686 case 28:
00687 if( context->argumentCount() == 0 )
00688 {
00689 int _q_result = _q_self->magenta();
00690 return QScriptValue( context->engine(), _q_result );
00691 }
00692 break;
00693
00694 case 29:
00695 if( context->argumentCount() == 0 )
00696 {
00697 qreal _q_result = _q_self->magentaF();
00698 return qScriptValueFromValue( context->engine(), _q_result );
00699 }
00700 break;
00701
00702 case 30:
00703 if( context->argumentCount() == 0 )
00704 {
00705 QString _q_result = _q_self->name();
00706 return QScriptValue( context->engine(), _q_result );
00707 }
00708 break;
00709
00710 case 31:
00711 if( context->argumentCount() == 1 )
00712 {
00713 QColor _q_arg0 = qscriptvalue_cast<QColor>( context->argument( 0 ) );
00714 bool _q_result = _q_self->operator==( _q_arg0 );
00715 return QScriptValue( context->engine(), _q_result );
00716 }
00717 break;
00718
00719 case 32:
00720 if( context->argumentCount() == 1 )
00721 {
00722 QDataStream* _q_arg0 = qscriptvalue_cast<QDataStream*>( context->argument( 0 ) );
00723 operator>>( *_q_arg0, *_q_self );
00724 return context->engine()->undefinedValue();
00725 }
00726 break;
00727
00728 case 33:
00729 if( context->argumentCount() == 0 )
00730 {
00731 int _q_result = _q_self->red();
00732 return QScriptValue( context->engine(), _q_result );
00733 }
00734 break;
00735
00736 case 34:
00737 if( context->argumentCount() == 0 )
00738 {
00739 qreal _q_result = _q_self->redF();
00740 return qScriptValueFromValue( context->engine(), _q_result );
00741 }
00742 break;
00743
00744 case 35:
00745 if( context->argumentCount() == 0 )
00746 {
00747 uint _q_result = _q_self->rgb();
00748 return QScriptValue( context->engine(), _q_result );
00749 }
00750 break;
00751
00752 case 36:
00753 if( context->argumentCount() == 0 )
00754 {
00755 uint _q_result = _q_self->rgba();
00756 return QScriptValue( context->engine(), _q_result );
00757 }
00758 break;
00759
00760 case 37:
00761 if( context->argumentCount() == 0 )
00762 {
00763 int _q_result = _q_self->saturation();
00764 return QScriptValue( context->engine(), _q_result );
00765 }
00766 break;
00767
00768 case 38:
00769 if( context->argumentCount() == 0 )
00770 {
00771 qreal _q_result = _q_self->saturationF();
00772 return qScriptValueFromValue( context->engine(), _q_result );
00773 }
00774 break;
00775
00776 case 39:
00777 if( context->argumentCount() == 1 )
00778 {
00779 int _q_arg0 = context->argument( 0 ).toInt32();
00780 _q_self->setAlpha( _q_arg0 );
00781 return context->engine()->undefinedValue();
00782 }
00783 break;
00784
00785 case 40:
00786 if( context->argumentCount() == 1 )
00787 {
00788 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
00789 _q_self->setAlphaF( _q_arg0 );
00790 return context->engine()->undefinedValue();
00791 }
00792 break;
00793
00794 case 41:
00795 if( context->argumentCount() == 1 )
00796 {
00797 int _q_arg0 = context->argument( 0 ).toInt32();
00798 _q_self->setBlue( _q_arg0 );
00799 return context->engine()->undefinedValue();
00800 }
00801 break;
00802
00803 case 42:
00804 if( context->argumentCount() == 1 )
00805 {
00806 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
00807 _q_self->setBlueF( _q_arg0 );
00808 return context->engine()->undefinedValue();
00809 }
00810 break;
00811
00812 case 43:
00813 if( context->argumentCount() == 4 )
00814 {
00815 int _q_arg0 = context->argument( 0 ).toInt32();
00816 int _q_arg1 = context->argument( 1 ).toInt32();
00817 int _q_arg2 = context->argument( 2 ).toInt32();
00818 int _q_arg3 = context->argument( 3 ).toInt32();
00819 _q_self->setCmyk( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
00820 return context->engine()->undefinedValue();
00821 }
00822 if( context->argumentCount() == 5 )
00823 {
00824 int _q_arg0 = context->argument( 0 ).toInt32();
00825 int _q_arg1 = context->argument( 1 ).toInt32();
00826 int _q_arg2 = context->argument( 2 ).toInt32();
00827 int _q_arg3 = context->argument( 3 ).toInt32();
00828 int _q_arg4 = context->argument( 4 ).toInt32();
00829 _q_self->setCmyk( _q_arg0, _q_arg1, _q_arg2, _q_arg3, _q_arg4 );
00830 return context->engine()->undefinedValue();
00831 }
00832 break;
00833
00834 case 44:
00835 if( context->argumentCount() == 4 )
00836 {
00837 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
00838 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
00839 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
00840 qreal _q_arg3 = qscriptvalue_cast<qreal>( context->argument( 3 ) );
00841 _q_self->setCmykF( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
00842 return context->engine()->undefinedValue();
00843 }
00844 if( context->argumentCount() == 5 )
00845 {
00846 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
00847 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
00848 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
00849 qreal _q_arg3 = qscriptvalue_cast<qreal>( context->argument( 3 ) );
00850 qreal _q_arg4 = qscriptvalue_cast<qreal>( context->argument( 4 ) );
00851 _q_self->setCmykF( _q_arg0, _q_arg1, _q_arg2, _q_arg3, _q_arg4 );
00852 return context->engine()->undefinedValue();
00853 }
00854 break;
00855
00856 case 45:
00857 if( context->argumentCount() == 1 )
00858 {
00859 int _q_arg0 = context->argument( 0 ).toInt32();
00860 _q_self->setGreen( _q_arg0 );
00861 return context->engine()->undefinedValue();
00862 }
00863 break;
00864
00865 case 46:
00866 if( context->argumentCount() == 1 )
00867 {
00868 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
00869 _q_self->setGreenF( _q_arg0 );
00870 return context->engine()->undefinedValue();
00871 }
00872 break;
00873
00874 case 47:
00875 if( context->argumentCount() == 3 )
00876 {
00877 int _q_arg0 = context->argument( 0 ).toInt32();
00878 int _q_arg1 = context->argument( 1 ).toInt32();
00879 int _q_arg2 = context->argument( 2 ).toInt32();
00880 _q_self->setHsl( _q_arg0, _q_arg1, _q_arg2 );
00881 return context->engine()->undefinedValue();
00882 }
00883 if( context->argumentCount() == 4 )
00884 {
00885 int _q_arg0 = context->argument( 0 ).toInt32();
00886 int _q_arg1 = context->argument( 1 ).toInt32();
00887 int _q_arg2 = context->argument( 2 ).toInt32();
00888 int _q_arg3 = context->argument( 3 ).toInt32();
00889 _q_self->setHsl( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
00890 return context->engine()->undefinedValue();
00891 }
00892 break;
00893
00894 case 48:
00895 if( context->argumentCount() == 3 )
00896 {
00897 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
00898 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
00899 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
00900 _q_self->setHslF( _q_arg0, _q_arg1, _q_arg2 );
00901 return context->engine()->undefinedValue();
00902 }
00903 if( context->argumentCount() == 4 )
00904 {
00905 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
00906 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
00907 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
00908 qreal _q_arg3 = qscriptvalue_cast<qreal>( context->argument( 3 ) );
00909 _q_self->setHslF( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
00910 return context->engine()->undefinedValue();
00911 }
00912 break;
00913
00914 case 49:
00915 if( context->argumentCount() == 3 )
00916 {
00917 int _q_arg0 = context->argument( 0 ).toInt32();
00918 int _q_arg1 = context->argument( 1 ).toInt32();
00919 int _q_arg2 = context->argument( 2 ).toInt32();
00920 _q_self->setHsv( _q_arg0, _q_arg1, _q_arg2 );
00921 return context->engine()->undefinedValue();
00922 }
00923 if( context->argumentCount() == 4 )
00924 {
00925 int _q_arg0 = context->argument( 0 ).toInt32();
00926 int _q_arg1 = context->argument( 1 ).toInt32();
00927 int _q_arg2 = context->argument( 2 ).toInt32();
00928 int _q_arg3 = context->argument( 3 ).toInt32();
00929 _q_self->setHsv( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
00930 return context->engine()->undefinedValue();
00931 }
00932 break;
00933
00934 case 50:
00935 if( context->argumentCount() == 3 )
00936 {
00937 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
00938 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
00939 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
00940 _q_self->setHsvF( _q_arg0, _q_arg1, _q_arg2 );
00941 return context->engine()->undefinedValue();
00942 }
00943 if( context->argumentCount() == 4 )
00944 {
00945 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
00946 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
00947 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
00948 qreal _q_arg3 = qscriptvalue_cast<qreal>( context->argument( 3 ) );
00949 _q_self->setHsvF( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
00950 return context->engine()->undefinedValue();
00951 }
00952 break;
00953
00954 case 51:
00955 if( context->argumentCount() == 1 )
00956 {
00957 QString _q_arg0 = context->argument( 0 ).toString();
00958 _q_self->setNamedColor( _q_arg0 );
00959 return context->engine()->undefinedValue();
00960 }
00961 break;
00962
00963 case 52:
00964 if( context->argumentCount() == 1 )
00965 {
00966 int _q_arg0 = context->argument( 0 ).toInt32();
00967 _q_self->setRed( _q_arg0 );
00968 return context->engine()->undefinedValue();
00969 }
00970 break;
00971
00972 case 53:
00973 if( context->argumentCount() == 1 )
00974 {
00975 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
00976 _q_self->setRedF( _q_arg0 );
00977 return context->engine()->undefinedValue();
00978 }
00979 break;
00980
00981 case 54:
00982 if( context->argumentCount() == 1 )
00983 {
00984 uint _q_arg0 = context->argument( 0 ).toUInt32();
00985 _q_self->setRgb( _q_arg0 );
00986 return context->engine()->undefinedValue();
00987 }
00988 if( context->argumentCount() == 3 )
00989 {
00990 int _q_arg0 = context->argument( 0 ).toInt32();
00991 int _q_arg1 = context->argument( 1 ).toInt32();
00992 int _q_arg2 = context->argument( 2 ).toInt32();
00993 _q_self->setRgb( _q_arg0, _q_arg1, _q_arg2 );
00994 return context->engine()->undefinedValue();
00995 }
00996 if( context->argumentCount() == 4 )
00997 {
00998 int _q_arg0 = context->argument( 0 ).toInt32();
00999 int _q_arg1 = context->argument( 1 ).toInt32();
01000 int _q_arg2 = context->argument( 2 ).toInt32();
01001 int _q_arg3 = context->argument( 3 ).toInt32();
01002 _q_self->setRgb( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01003 return context->engine()->undefinedValue();
01004 }
01005 break;
01006
01007 case 55:
01008 if( context->argumentCount() == 3 )
01009 {
01010 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
01011 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
01012 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
01013 _q_self->setRgbF( _q_arg0, _q_arg1, _q_arg2 );
01014 return context->engine()->undefinedValue();
01015 }
01016 if( context->argumentCount() == 4 )
01017 {
01018 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
01019 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
01020 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
01021 qreal _q_arg3 = qscriptvalue_cast<qreal>( context->argument( 3 ) );
01022 _q_self->setRgbF( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01023 return context->engine()->undefinedValue();
01024 }
01025 break;
01026
01027 case 56:
01028 if( context->argumentCount() == 1 )
01029 {
01030 uint _q_arg0 = context->argument( 0 ).toUInt32();
01031 _q_self->setRgba( _q_arg0 );
01032 return context->engine()->undefinedValue();
01033 }
01034 break;
01035
01036 case 57:
01037 if( context->argumentCount() == 0 )
01038 {
01039 QColor::Spec _q_result = _q_self->spec();
01040 return qScriptValueFromValue( context->engine(), _q_result );
01041 }
01042 break;
01043
01044 case 58:
01045 if( context->argumentCount() == 0 )
01046 {
01047 QColor _q_result = _q_self->toCmyk();
01048 return qScriptValueFromValue( context->engine(), _q_result );
01049 }
01050 break;
01051
01052 case 59:
01053 if( context->argumentCount() == 0 )
01054 {
01055 QColor _q_result = _q_self->toHsl();
01056 return qScriptValueFromValue( context->engine(), _q_result );
01057 }
01058 break;
01059
01060 case 60:
01061 if( context->argumentCount() == 0 )
01062 {
01063 QColor _q_result = _q_self->toHsv();
01064 return qScriptValueFromValue( context->engine(), _q_result );
01065 }
01066 break;
01067
01068 case 61:
01069 if( context->argumentCount() == 0 )
01070 {
01071 QColor _q_result = _q_self->toRgb();
01072 return qScriptValueFromValue( context->engine(), _q_result );
01073 }
01074 break;
01075
01076 case 62:
01077 if( context->argumentCount() == 0 )
01078 {
01079 int _q_result = _q_self->value();
01080 return QScriptValue( context->engine(), _q_result );
01081 }
01082 break;
01083
01084 case 63:
01085 if( context->argumentCount() == 0 )
01086 {
01087 qreal _q_result = _q_self->valueF();
01088 return qScriptValueFromValue( context->engine(), _q_result );
01089 }
01090 break;
01091
01092 case 64:
01093 if( context->argumentCount() == 1 )
01094 {
01095 QDataStream* _q_arg0 = qscriptvalue_cast<QDataStream*>( context->argument( 0 ) );
01096 operator<<( *_q_arg0, *_q_self );
01097 return context->engine()->undefinedValue();
01098 }
01099 break;
01100
01101 case 65:
01102 if( context->argumentCount() == 0 )
01103 {
01104 int _q_result = _q_self->yellow();
01105 return QScriptValue( context->engine(), _q_result );
01106 }
01107 break;
01108
01109 case 66:
01110 if( context->argumentCount() == 0 )
01111 {
01112 qreal _q_result = _q_self->yellowF();
01113 return qScriptValueFromValue( context->engine(), _q_result );
01114 }
01115 break;
01116
01117 case 67:
01118 {
01119 QString result;
01120 QDebug d( &result );
01121 d << *_q_self;
01122 return QScriptValue( context->engine(), result );
01123 }
01124
01125 default:
01126 Q_ASSERT( false );
01127 }
01128 return qtscript_QColor_throw_ambiguity_error_helper( context,
01129 qtscript_QColor_function_names[_id+11],
01130 qtscript_QColor_function_signatures[_id+11] );
01131 }
01132
01133 static QScriptValue qtscript_QColor_static_call( QScriptContext* context, QScriptEngine* )
01134 {
01135 uint _id = context->callee().data().toUInt32();
01136 Q_ASSERT(( _id & 0xFFFF0000 ) == 0xBABE0000 );
01137 _id &= 0x0000FFFF;
01138 switch( _id )
01139 {
01140 case 0:
01141 if( context->thisObject().strictlyEquals( context->engine()->globalObject() ) )
01142 {
01143 return context->throwError( QString::fromLatin1( "QColor(): Did you forget to construct with 'new'?" ) );
01144 }
01145 if( context->argumentCount() == 0 )
01146 {
01147 QColor _q_cpp_result;
01148 QScriptValue _q_result = context->engine()->newVariant( context->thisObject(), qVariantFromValue( _q_cpp_result ) );
01149 return _q_result;
01150 }
01151 else if( context->argumentCount() == 1 )
01152 {
01153 if(( qMetaTypeId<Qt::GlobalColor>() == context->argument( 0 ).toVariant().userType() ) )
01154 {
01155 Qt::GlobalColor _q_arg0 = qscriptvalue_cast<Qt::GlobalColor>( context->argument( 0 ) );
01156 QColor _q_cpp_result( _q_arg0 );
01157 QScriptValue _q_result = context->engine()->newVariant( context->thisObject(), qVariantFromValue( _q_cpp_result ) );
01158 return _q_result;
01159 }
01160 else if(( qMetaTypeId<QColor>() == context->argument( 0 ).toVariant().userType() ) )
01161 {
01162 QColor _q_arg0 = qscriptvalue_cast<QColor>( context->argument( 0 ) );
01163 QColor _q_cpp_result( _q_arg0 );
01164 QScriptValue _q_result = context->engine()->newVariant( context->thisObject(), qVariantFromValue( _q_cpp_result ) );
01165 return _q_result;
01166 }
01167 else if( context->argument( 0 ).isString() )
01168 {
01169 QString _q_arg0 = context->argument( 0 ).toString();
01170 QColor _q_cpp_result( _q_arg0 );
01171 QScriptValue _q_result = context->engine()->newVariant( context->thisObject(), qVariantFromValue( _q_cpp_result ) );
01172 return _q_result;
01173 }
01174 else if( context->argument( 0 ).isNumber() )
01175 {
01176 uint _q_arg0 = context->argument( 0 ).toUInt32();
01177 QColor _q_cpp_result( _q_arg0 );
01178 QScriptValue _q_result = context->engine()->newVariant( context->thisObject(), qVariantFromValue( _q_cpp_result ) );
01179 return _q_result;
01180 }
01181 }
01182 else if( context->argumentCount() == 3 )
01183 {
01184 int _q_arg0 = context->argument( 0 ).toInt32();
01185 int _q_arg1 = context->argument( 1 ).toInt32();
01186 int _q_arg2 = context->argument( 2 ).toInt32();
01187 QColor _q_cpp_result( _q_arg0, _q_arg1, _q_arg2 );
01188 QScriptValue _q_result = context->engine()->newVariant( context->thisObject(), qVariantFromValue( _q_cpp_result ) );
01189 return _q_result;
01190 }
01191 else if( context->argumentCount() == 4 )
01192 {
01193 int _q_arg0 = context->argument( 0 ).toInt32();
01194 int _q_arg1 = context->argument( 1 ).toInt32();
01195 int _q_arg2 = context->argument( 2 ).toInt32();
01196 int _q_arg3 = context->argument( 3 ).toInt32();
01197 QColor _q_cpp_result( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01198 QScriptValue _q_result = context->engine()->newVariant( context->thisObject(), qVariantFromValue( _q_cpp_result ) );
01199 return _q_result;
01200 }
01201 break;
01202
01203 case 1:
01204 if( context->argumentCount() == 0 )
01205 {
01206 QStringList _q_result = QColor::colorNames();
01207 return qScriptValueFromSequence( context->engine(), _q_result );
01208 }
01209 break;
01210
01211 case 2:
01212 if( context->argumentCount() == 4 )
01213 {
01214 int _q_arg0 = context->argument( 0 ).toInt32();
01215 int _q_arg1 = context->argument( 1 ).toInt32();
01216 int _q_arg2 = context->argument( 2 ).toInt32();
01217 int _q_arg3 = context->argument( 3 ).toInt32();
01218 QColor _q_result = QColor::fromCmyk( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01219 return qScriptValueFromValue( context->engine(), _q_result );
01220 }
01221 if( context->argumentCount() == 5 )
01222 {
01223 int _q_arg0 = context->argument( 0 ).toInt32();
01224 int _q_arg1 = context->argument( 1 ).toInt32();
01225 int _q_arg2 = context->argument( 2 ).toInt32();
01226 int _q_arg3 = context->argument( 3 ).toInt32();
01227 int _q_arg4 = context->argument( 4 ).toInt32();
01228 QColor _q_result = QColor::fromCmyk( _q_arg0, _q_arg1, _q_arg2, _q_arg3, _q_arg4 );
01229 return qScriptValueFromValue( context->engine(), _q_result );
01230 }
01231 break;
01232
01233 case 3:
01234 if( context->argumentCount() == 4 )
01235 {
01236 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
01237 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
01238 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
01239 qreal _q_arg3 = qscriptvalue_cast<qreal>( context->argument( 3 ) );
01240 QColor _q_result = QColor::fromCmykF( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01241 return qScriptValueFromValue( context->engine(), _q_result );
01242 }
01243 if( context->argumentCount() == 5 )
01244 {
01245 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
01246 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
01247 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
01248 qreal _q_arg3 = qscriptvalue_cast<qreal>( context->argument( 3 ) );
01249 qreal _q_arg4 = qscriptvalue_cast<qreal>( context->argument( 4 ) );
01250 QColor _q_result = QColor::fromCmykF( _q_arg0, _q_arg1, _q_arg2, _q_arg3, _q_arg4 );
01251 return qScriptValueFromValue( context->engine(), _q_result );
01252 }
01253 break;
01254
01255 case 4:
01256 if( context->argumentCount() == 3 )
01257 {
01258 int _q_arg0 = context->argument( 0 ).toInt32();
01259 int _q_arg1 = context->argument( 1 ).toInt32();
01260 int _q_arg2 = context->argument( 2 ).toInt32();
01261 QColor _q_result = QColor::fromHsl( _q_arg0, _q_arg1, _q_arg2 );
01262 return qScriptValueFromValue( context->engine(), _q_result );
01263 }
01264 if( context->argumentCount() == 4 )
01265 {
01266 int _q_arg0 = context->argument( 0 ).toInt32();
01267 int _q_arg1 = context->argument( 1 ).toInt32();
01268 int _q_arg2 = context->argument( 2 ).toInt32();
01269 int _q_arg3 = context->argument( 3 ).toInt32();
01270 QColor _q_result = QColor::fromHsl( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01271 return qScriptValueFromValue( context->engine(), _q_result );
01272 }
01273 break;
01274
01275 case 5:
01276 if( context->argumentCount() == 3 )
01277 {
01278 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
01279 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
01280 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
01281 QColor _q_result = QColor::fromHslF( _q_arg0, _q_arg1, _q_arg2 );
01282 return qScriptValueFromValue( context->engine(), _q_result );
01283 }
01284 if( context->argumentCount() == 4 )
01285 {
01286 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
01287 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
01288 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
01289 qreal _q_arg3 = qscriptvalue_cast<qreal>( context->argument( 3 ) );
01290 QColor _q_result = QColor::fromHslF( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01291 return qScriptValueFromValue( context->engine(), _q_result );
01292 }
01293 break;
01294
01295 case 6:
01296 if( context->argumentCount() == 3 )
01297 {
01298 int _q_arg0 = context->argument( 0 ).toInt32();
01299 int _q_arg1 = context->argument( 1 ).toInt32();
01300 int _q_arg2 = context->argument( 2 ).toInt32();
01301 QColor _q_result = QColor::fromHsv( _q_arg0, _q_arg1, _q_arg2 );
01302 return qScriptValueFromValue( context->engine(), _q_result );
01303 }
01304 if( context->argumentCount() == 4 )
01305 {
01306 int _q_arg0 = context->argument( 0 ).toInt32();
01307 int _q_arg1 = context->argument( 1 ).toInt32();
01308 int _q_arg2 = context->argument( 2 ).toInt32();
01309 int _q_arg3 = context->argument( 3 ).toInt32();
01310 QColor _q_result = QColor::fromHsv( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01311 return qScriptValueFromValue( context->engine(), _q_result );
01312 }
01313 break;
01314
01315 case 7:
01316 if( context->argumentCount() == 3 )
01317 {
01318 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
01319 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
01320 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
01321 QColor _q_result = QColor::fromHsvF( _q_arg0, _q_arg1, _q_arg2 );
01322 return qScriptValueFromValue( context->engine(), _q_result );
01323 }
01324 if( context->argumentCount() == 4 )
01325 {
01326 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
01327 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
01328 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
01329 qreal _q_arg3 = qscriptvalue_cast<qreal>( context->argument( 3 ) );
01330 QColor _q_result = QColor::fromHsvF( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01331 return qScriptValueFromValue( context->engine(), _q_result );
01332 }
01333 break;
01334
01335 case 8:
01336 if( context->argumentCount() == 1 )
01337 {
01338 uint _q_arg0 = context->argument( 0 ).toUInt32();
01339 QColor _q_result = QColor::fromRgb( _q_arg0 );
01340 return qScriptValueFromValue( context->engine(), _q_result );
01341 }
01342 if( context->argumentCount() == 3 )
01343 {
01344 int _q_arg0 = context->argument( 0 ).toInt32();
01345 int _q_arg1 = context->argument( 1 ).toInt32();
01346 int _q_arg2 = context->argument( 2 ).toInt32();
01347 QColor _q_result = QColor::fromRgb( _q_arg0, _q_arg1, _q_arg2 );
01348 return qScriptValueFromValue( context->engine(), _q_result );
01349 }
01350 if( context->argumentCount() == 4 )
01351 {
01352 int _q_arg0 = context->argument( 0 ).toInt32();
01353 int _q_arg1 = context->argument( 1 ).toInt32();
01354 int _q_arg2 = context->argument( 2 ).toInt32();
01355 int _q_arg3 = context->argument( 3 ).toInt32();
01356 QColor _q_result = QColor::fromRgb( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01357 return qScriptValueFromValue( context->engine(), _q_result );
01358 }
01359 break;
01360
01361 case 9:
01362 if( context->argumentCount() == 3 )
01363 {
01364 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
01365 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
01366 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
01367 QColor _q_result = QColor::fromRgbF( _q_arg0, _q_arg1, _q_arg2 );
01368 return qScriptValueFromValue( context->engine(), _q_result );
01369 }
01370 if( context->argumentCount() == 4 )
01371 {
01372 qreal _q_arg0 = qscriptvalue_cast<qreal>( context->argument( 0 ) );
01373 qreal _q_arg1 = qscriptvalue_cast<qreal>( context->argument( 1 ) );
01374 qreal _q_arg2 = qscriptvalue_cast<qreal>( context->argument( 2 ) );
01375 qreal _q_arg3 = qscriptvalue_cast<qreal>( context->argument( 3 ) );
01376 QColor _q_result = QColor::fromRgbF( _q_arg0, _q_arg1, _q_arg2, _q_arg3 );
01377 return qScriptValueFromValue( context->engine(), _q_result );
01378 }
01379 break;
01380
01381 case 10:
01382 if( context->argumentCount() == 1 )
01383 {
01384 uint _q_arg0 = context->argument( 0 ).toUInt32();
01385 QColor _q_result = QColor::fromRgba( _q_arg0 );
01386 return qScriptValueFromValue( context->engine(), _q_result );
01387 }
01388 break;
01389
01390 default:
01391 Q_ASSERT( false );
01392 }
01393 return qtscript_QColor_throw_ambiguity_error_helper( context,
01394 qtscript_QColor_function_names[_id],
01395 qtscript_QColor_function_signatures[_id] );
01396 }
01397
01398 QScriptValue qtscript_create_QColor_class( QScriptEngine* engine )
01399 {
01400 engine->setDefaultPrototype( qMetaTypeId<QColor*>(), QScriptValue() );
01401 QScriptValue proto = engine->newVariant( qVariantFromValue(( QColor* )0 ) );
01402 for( int i = 0; i < 68; ++i )
01403 {
01404 QScriptValue fun = engine->newFunction( qtscript_QColor_prototype_call, qtscript_QColor_function_lengths[i+11] );
01405 fun.setData( QScriptValue( engine, uint( 0xBABE0000 + i ) ) );
01406 proto.setProperty( QString::fromLatin1( qtscript_QColor_function_names[i+11] ),
01407 fun, QScriptValue::SkipInEnumeration );
01408 }
01409
01410 engine->setDefaultPrototype( qMetaTypeId<QColor>(), proto );
01411 engine->setDefaultPrototype( qMetaTypeId<QColor*>(), proto );
01412
01413 QScriptValue ctor = engine->newFunction( qtscript_QColor_static_call, proto, qtscript_QColor_function_lengths[0] );
01414 ctor.setData( QScriptValue( engine, uint( 0xBABE0000 + 0 ) ) );
01415 for( int i = 0; i < 10; ++i )
01416 {
01417 QScriptValue fun = engine->newFunction( qtscript_QColor_static_call,
01418 qtscript_QColor_function_lengths[i+1] );
01419 fun.setData( QScriptValue( engine, uint( 0xBABE0000 + i + 1 ) ) );
01420 ctor.setProperty( QString::fromLatin1( qtscript_QColor_function_names[i+1] ),
01421 fun, QScriptValue::SkipInEnumeration );
01422 }
01423
01424 ctor.setProperty( QString::fromLatin1( "Spec" ),
01425 qtscript_create_QColor_Spec_class( engine, ctor ) );
01426 return ctor;
01427 }