


	// ***** AUTOGENERATED CODE, DO NOT EDIT *****
    
        #include "REcmaShellRunner.h"
        #include "RMetaTypes.h"
        #include "../REcmaHelper.h"

        // forwards declarations mapped to includes
        
            
        // includes for base ecma wrapper classes
        

            #define QTSCRIPT_IS_GENERATED_FUNCTION(fun) ((fun.data().toUInt32() & 0xFFFF0000) == 0xBABE0000)
            #define QTSCRIPT_IS_FUNCTION_IN_CALL(fun) ((fun.data().toUInt32() & 0x0000F000) == 0x0000B000)

        
    // Destructor:
    REcmaShellRunner::~REcmaShellRunner() {}
        RRunner* REcmaShellRunner::getSelf(const QString& fName, QScriptContext* context)
    
        {
            RRunner* self = NULL;

            
                // self could be a normal object (e.g. from an UI file) or
                // an ECMA shell object (made from an ECMA script):
                //self = getSelfShell(fName, context);
                

            //if (self==NULL) {
                self = REcmaHelper::scriptValueTo<RRunner >(context->thisObject())
                
                ;
            //}

            if (self == NULL){
                // avoid recursion (toString is used by the backtrace):
                if (fName!="toString") {
                    REcmaHelper::throwError(QString("RRunner.%1(): "
                        "This object is not a RRunner").arg(fName),
                        context);
                }
                return NULL;
            }

            return self;
        }
        REcmaShellRunner* REcmaShellRunner::getSelfShell(const QString& fName, QScriptContext* context)
    
        {
          RRunner* selfBase = getSelf(fName, context);
                REcmaShellRunner* self = dynamic_cast<REcmaShellRunner*>(selfBase);
                //return REcmaHelper::scriptValueTo<REcmaShellRunner >(context->thisObject());
            if(self == NULL){
                REcmaHelper::throwError(QString("RRunner.%1(): "
                    "This object is not a RRunner").arg(fName),
                    context);
            }

            return self;
            


        }
        
    
    
      void REcmaShellRunner::doWork(
                
            ) {
                QScriptEngine* engine = __qtscript_self.engine();
                //REcmaHelper::shellFunctionStart("REcmaShellRunner::doWork", engine);
                QScriptValue _q_function = __qtscript_self.property("doWork");



                if (!_q_function.isFunction() || 
                    QTSCRIPT_IS_GENERATED_FUNCTION(_q_function) ||
                    QTSCRIPT_IS_FUNCTION_IN_CALL(_q_function)
                    
                    /* function might have more arguments than expected:
                    || _q_function.property("length").toInt32()!=0*/
                    /*|| (__qtscript_self.propertyFlags("atEnd") & QScriptValue::QObjectMember)*/
                    ) {
                    //QString cppSig = "RRunner::doWork";
                    
                        // re-enable recursion for calls from C++ into ECMAScript functions
                        // leave it marked as generated though if appropriate:
                        
                        quint32 prev = _q_function.data().toUInt32();
                        //if (cppSig!="RGraphicsViewQt::event") {
                            _q_function.setData(QScriptValue(engine, prev & 0xFFFF0000));
                        //}
                        RRunner::doWork(
                            
                        );

                        // block recursion again:
                        _q_function.setData(QScriptValue(engine, prev));

                        //REcmaHelper::shellFunctionEnd("REcmaShellRunner::doWork", engine);

                        
                            return;
                          
                }
                    // prevent recursion if script implementation calls base implementation
                    // mark function as 'in call':
                    quint32 prev = _q_function.data().toUInt32();
                    _q_function.setData(QScriptValue(engine, uint(prev | 0x0000B000)));
                    
                            _q_function.call(__qtscript_self)
                        
                    ;
                    _q_function.setData(QScriptValue(engine, prev));

                    //REcmaHelper::shellFunctionEnd("REcmaShellRunner::doWork", engine);

                    
            }
        
    
  

    // protected methods (only available for ECMA shell classes) (generated by xsl2xpp.xsl):
	