// ***** AUTOGENERATED CODE, DO NOT EDIT *****
            // ***** This class is not copyable.
        
        #include "REcmaSharedPointerBlock.h"
        #include "RMetaTypes.h"
        #include "../REcmaHelper.h"

        // forwards declarations mapped to includes
        
                #include "RDocument.h"
            
                #include "RTransaction.h"
            
            
        // includes for base ecma wrapper classes
        
                  #include "REcmaSharedPointerObject.h"
                 void REcmaSharedPointerBlock::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RBlockPointer*) 0)));
        protoCreated = true;
    }

    
        // primary base class RObject:
        
            proto->setPrototype(engine.defaultPrototype(
            qMetaTypeId<RObjectPointer>()));
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    
        // shared pointer support:
        REcmaHelper::registerFunction(&engine, proto, data, "data");
        

        REcmaHelper::registerFunction(&engine, proto, isNull, "isNull");
        

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class RObject
        REcmaHelper::registerFunction(&engine, proto, getRObject, "getRObject");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, getType, "getType");
            
            REcmaHelper::registerFunction(&engine, proto, clone, "clone");
            
            REcmaHelper::registerFunction(&engine, proto, getName, "getName");
            
            REcmaHelper::registerFunction(&engine, proto, setName, "setName");
            
            REcmaHelper::registerFunction(&engine, proto, isFrozen, "isFrozen");
            
            REcmaHelper::registerFunction(&engine, proto, setFrozen, "setFrozen");
            
            REcmaHelper::registerFunction(&engine, proto, isAnonymous, "isAnonymous");
            
            REcmaHelper::registerFunction(&engine, proto, setAnonymous, "setAnonymous");
            
            REcmaHelper::registerFunction(&engine, proto, isPixelUnit, "isPixelUnit");
            
            REcmaHelper::registerFunction(&engine, proto, setPixelUnit, "setPixelUnit");
            
            REcmaHelper::registerFunction(&engine, proto, setOrigin, "setOrigin");
            
            REcmaHelper::registerFunction(&engine, proto, getOrigin, "getOrigin");
            
            REcmaHelper::registerFunction(&engine, proto, isModelSpace, "isModelSpace");
            
            REcmaHelper::registerFunction(&engine, proto, hasLayout, "hasLayout");
            
            REcmaHelper::registerFunction(&engine, proto, setLayoutId, "setLayoutId");
            
            REcmaHelper::registerFunction(&engine, proto, getLayoutId, "getLayoutId");
            
            REcmaHelper::registerFunction(&engine, proto, getLayoutName, "getLayoutName");
            
            REcmaHelper::registerFunction(&engine, proto, getProperty, "getProperty");
            
            REcmaHelper::registerFunction(&engine, proto, setProperty, "setProperty");
            
            REcmaHelper::registerFunction(&engine, proto, setCustomProperty, "setCustomProperty");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RBlockPointer>(), *proto);
      
    

    QScriptValue ctor = engine.newFunction(createEcma, *proto, 2);
    
    // static methods:
    
            REcmaHelper::registerFunction(&engine, &ctor, init, "init");
            

    // static properties:
    
            ctor.setProperty("PropertyCustom",
                qScriptValueFromValue(&engine, RBlock::PropertyCustom),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyType",
                qScriptValueFromValue(&engine, RBlock::PropertyType),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyHandle",
                qScriptValueFromValue(&engine, RBlock::PropertyHandle),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyName",
                qScriptValueFromValue(&engine, RBlock::PropertyName),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyFrozen",
                qScriptValueFromValue(&engine, RBlock::PropertyFrozen),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyPixelUnit",
                qScriptValueFromValue(&engine, RBlock::PropertyPixelUnit),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyOriginX",
                qScriptValueFromValue(&engine, RBlock::PropertyOriginX),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyOriginY",
                qScriptValueFromValue(&engine, RBlock::PropertyOriginY),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyOriginZ",
                qScriptValueFromValue(&engine, RBlock::PropertyOriginZ),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyLayout",
                qScriptValueFromValue(&engine, RBlock::PropertyLayout),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("modelSpaceName",
                qScriptValueFromValue(&engine, RBlock::modelSpaceName),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("paperSpaceName",
                qScriptValueFromValue(&engine, RBlock::paperSpaceName),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RBlockPointer",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
     QScriptValue REcmaSharedPointerBlock::createEcma(QScriptContext* context, QScriptEngine* engine) 
    
    {
    if (context->thisObject().strictlyEquals(
       engine->globalObject())) {
       return REcmaHelper::throwError(
       QString::fromLatin1("RBlock(): Did you forget to construct with 'new'?"),
           context);
    }

    QScriptValue result;
        
            // generate constructor variants:
            
    if( context->argumentCount() ==
        0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ constructor:
    
            // non-copyable class:
            RBlock
                    * cppResult =
                    new
                    RBlock
                    ();
                
                    // TODO: triggers: Warning: QScriptEngine::newVariant(): changing class of non-QScriptObject not supported:
                    result = engine->newVariant(context->thisObject(), qVariantFromValue(cppResult));
                
    } else 

    if( context->argumentCount() ==
        3
                && (
                
                        context->argument(
                        0
                        ).isVariant()
                        ||
                    
                        context->argument(
                        0
                        ).isQObject()
                        ||
                    
                        context->argument(
                        0
                        ).isNull()
                ) /* type: RDocument * */
            
                && (
                
                        context->argument(
                        1
                        ).isString()
                ) /* type: QString */
            
                && (
                
                        context->argument(
                        2
                        ).isVariant()
                        ||
                    
                        context->argument(
                        2
                        ).isQObject()
                        ||
                    
                        context->argument(
                        2
                        ).isNull()
                ) /* type: RVector */
            
    ){
    // prepare arguments:
    
                    // argument is pointer
                    RDocument * a0 = NULL;

                    a0 = 
                        REcmaHelper::scriptValueTo<RDocument >(
                            context->argument(0)
                        );
                    
                    if (a0==NULL && 
                        !context->argument(0).isNull()) {
                        return REcmaHelper::throwError("RBlock: Argument 0 is not of type RDocument *RDocument *.", context);                    
                    }
                
                    // argument isStandardType
                    QString
                    a1 =
                    (QString)
                    
                    context->argument( 1 ).
                    toString();
                
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RVector*
                    ap2 =
                    qscriptvalue_cast<
                    RVector*
                        >(
                        context->argument(
                        2
                        )
                    );
                    if (ap2 == NULL) {
                           return REcmaHelper::throwError("RBlock: Argument 2 is not of type RVector.",
                               context);                    
                    }
                    RVector 
                    a2 = 
                    *ap2;
                
    // end of arguments

    // call C++ constructor:
    
            // non-copyable class:
            RBlock
                    * cppResult =
                    new
                    RBlock
                    (
                    a0
        ,
    a1
        ,
    a2
                    );
                
                    // TODO: triggers: Warning: QScriptEngine::newVariant(): changing class of non-QScriptObject not supported:
                    result = engine->newVariant(context->thisObject(), qVariantFromValue(cppResult));
                
    } else 

    {
       return REcmaHelper::throwError(
       QString::fromLatin1("RBlock(): no matching constructor found."),
           context);
    }
    
    return result;
    }
    

    // conversion functions for base classes:
     QScriptValue REcmaSharedPointerBlock::getRObject(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                RObject* cppResult =
                    qscriptvalue_cast<RBlock*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

    // returns class name:
     QScriptValue REcmaSharedPointerBlock::getClassName(QScriptContext *context, QScriptEngine *engine) 
        
    {
        return qScriptValueFromValue(engine, QString("RBlock"));
    }
    

    // returns all base classes (in case of multiple inheritance):
     QScriptValue REcmaSharedPointerBlock::getBaseClasses(QScriptContext *context, QScriptEngine *engine) 
        
    {
        QStringList list;
        
        list.append("RObject");
    

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

    // public methods:
     QScriptValue
        REcmaSharedPointerBlock::init
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::init", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::init";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'void'
    RBlock::
       init();
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.init().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::init", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::getType
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::getType", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::getType";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("getType", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'RS::EntityType'
    RS::EntityType cppResult =
        
               self->getType();
        // return type: RS::EntityType
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.getType().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::getType", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::clone
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::clone", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::clone";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("clone", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'RBlock *'
    RBlock * cppResult =
        
               self->clone();
        // return type: RBlock *
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.clone().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::clone", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::getName
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::getName", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::getName";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("getName", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'QString'
    QString cppResult =
        
               self->getName();
        // return type: QString
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.getName().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::getName", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::setName
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::setName", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::setName";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("setName", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isString()
        ) /* type: QString */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    QString
                    a0 =
                    (QString)
                    
                    context->argument( 0 ).
                    toString();
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->setName(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.setName().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::setName", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::isFrozen
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::isFrozen", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::isFrozen";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("isFrozen", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'bool'
    bool cppResult =
        
               self->isFrozen();
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.isFrozen().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::isFrozen", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::setFrozen
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::setFrozen", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::setFrozen";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("setFrozen", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    bool
                    a0 =
                    (bool)
                    
                    context->argument( 0 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->setFrozen(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.setFrozen().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::setFrozen", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::isAnonymous
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::isAnonymous", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::isAnonymous";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("isAnonymous", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'bool'
    bool cppResult =
        
               self->isAnonymous();
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.isAnonymous().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::isAnonymous", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::setAnonymous
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::setAnonymous", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::setAnonymous";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("setAnonymous", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    bool
                    a0 =
                    (bool)
                    
                    context->argument( 0 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->setAnonymous(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.setAnonymous().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::setAnonymous", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::isPixelUnit
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::isPixelUnit", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::isPixelUnit";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("isPixelUnit", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'bool'
    bool cppResult =
        
               self->isPixelUnit();
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.isPixelUnit().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::isPixelUnit", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::setPixelUnit
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::setPixelUnit", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::setPixelUnit";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("setPixelUnit", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    bool
                    a0 =
                    (bool)
                    
                    context->argument( 0 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->setPixelUnit(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.setPixelUnit().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::setPixelUnit", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::setOrigin
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::setOrigin", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::setOrigin";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("setOrigin", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RVector */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RVector*
                    ap0 =
                    qscriptvalue_cast<
                    RVector*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RBlock: Argument 0 is not of type RVector.",
                               context);                    
                    }
                    RVector 
                    a0 = 
                    *ap0;
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->setOrigin(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.setOrigin().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::setOrigin", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::getOrigin
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::getOrigin", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::getOrigin";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("getOrigin", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'RVector'
    RVector cppResult =
        
               self->getOrigin();
        // return type: RVector
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.getOrigin().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::getOrigin", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::isModelSpace
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::isModelSpace", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::isModelSpace";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("isModelSpace", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'bool'
    bool cppResult =
        
               self->isModelSpace();
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.isModelSpace().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::isModelSpace", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::hasLayout
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::hasLayout", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::hasLayout";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("hasLayout", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'bool'
    bool cppResult =
        
               self->hasLayout();
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.hasLayout().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::hasLayout", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::setLayoutId
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::setLayoutId", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::setLayoutId";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("setLayoutId", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isNumber()
        ) /* type: RLayout::Id */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    RLayout::Id
                    a0 =
                    (RLayout::Id)
                    (int)
                    context->argument( 0 ).
                    toNumber();
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->setLayoutId(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.setLayoutId().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::setLayoutId", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::getLayoutId
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::getLayoutId", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::getLayoutId";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("getLayoutId", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'RLayout::Id'
    RLayout::Id cppResult =
        
               self->getLayoutId();
        // return type: RLayout::Id
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.getLayoutId().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::getLayoutId", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::getLayoutName
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::getLayoutName", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::getLayoutName";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("getLayoutName", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'QString'
    QString cppResult =
        
               self->getLayoutName();
        // return type: QString
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.getLayoutName().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::getLayoutName", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::getProperty
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::getProperty", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::getProperty";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("getProperty", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RBlock: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
    // end of arguments

    // call C++ function:
    // return type 'QPair < QVariant , RPropertyAttributes >'
    QPair < QVariant , RPropertyAttributes > cppResult =
        
               self->getProperty(a0);
        // return type: QPair < QVariant , RPropertyAttributes >
                // Pair of ...:
                //result = REcmaHelper::pairToScriptValue(engine, cppResult);
                QVariantList vl;
                QVariant v;
                
                    // first type of pair is variant:
                    if (QString(cppResult.first.typeName())=="RLineweight::Lineweight") {
                        v.setValue((int)cppResult.first.value<RLineweight::Lineweight>());
                    }
                    else {
                        v.setValue(cppResult.first);
                    }
                  

                vl.append(v);
                v.setValue(cppResult.second);
                vl.append(v);
                result = qScriptValueFromValue(engine, vl);
            
    } else


        
    
    if( context->argumentCount() ==
    2 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
     && (
            context->argument(1).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RBlock: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
                    // argument isStandardType
                    bool
                    a1 =
                    (bool)
                    
                    context->argument( 1 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'QPair < QVariant , RPropertyAttributes >'
    QPair < QVariant , RPropertyAttributes > cppResult =
        
               self->getProperty(a0
        ,
    a1);
        // return type: QPair < QVariant , RPropertyAttributes >
                // Pair of ...:
                //result = REcmaHelper::pairToScriptValue(engine, cppResult);
                QVariantList vl;
                QVariant v;
                
                    // first type of pair is variant:
                    if (QString(cppResult.first.typeName())=="RLineweight::Lineweight") {
                        v.setValue((int)cppResult.first.value<RLineweight::Lineweight>());
                    }
                    else {
                        v.setValue(cppResult.first);
                    }
                  

                vl.append(v);
                v.setValue(cppResult.second);
                vl.append(v);
                result = qScriptValueFromValue(engine, vl);
            
    } else


        
    
    if( context->argumentCount() ==
    3 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
     && (
            context->argument(1).isBool()
        ) /* type: bool */
     && (
            context->argument(2).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RBlock: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
                    // argument isStandardType
                    bool
                    a1 =
                    (bool)
                    
                    context->argument( 1 ).
                    toBool();
                
                    // argument isStandardType
                    bool
                    a2 =
                    (bool)
                    
                    context->argument( 2 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'QPair < QVariant , RPropertyAttributes >'
    QPair < QVariant , RPropertyAttributes > cppResult =
        
               self->getProperty(a0
        ,
    a1
        ,
    a2);
        // return type: QPair < QVariant , RPropertyAttributes >
                // Pair of ...:
                //result = REcmaHelper::pairToScriptValue(engine, cppResult);
                QVariantList vl;
                QVariant v;
                
                    // first type of pair is variant:
                    if (QString(cppResult.first.typeName())=="RLineweight::Lineweight") {
                        v.setValue((int)cppResult.first.value<RLineweight::Lineweight>());
                    }
                    else {
                        v.setValue(cppResult.first);
                    }
                  

                vl.append(v);
                v.setValue(cppResult.second);
                vl.append(v);
                result = qScriptValueFromValue(engine, vl);
            
    } else


        
    
    if( context->argumentCount() ==
    4 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
     && (
            context->argument(1).isBool()
        ) /* type: bool */
     && (
            context->argument(2).isBool()
        ) /* type: bool */
     && (
            context->argument(3).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RBlock: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
                    // argument isStandardType
                    bool
                    a1 =
                    (bool)
                    
                    context->argument( 1 ).
                    toBool();
                
                    // argument isStandardType
                    bool
                    a2 =
                    (bool)
                    
                    context->argument( 2 ).
                    toBool();
                
                    // argument isStandardType
                    bool
                    a3 =
                    (bool)
                    
                    context->argument( 3 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'QPair < QVariant , RPropertyAttributes >'
    QPair < QVariant , RPropertyAttributes > cppResult =
        
               self->getProperty(a0
        ,
    a1
        ,
    a2
        ,
    a3);
        // return type: QPair < QVariant , RPropertyAttributes >
                // Pair of ...:
                //result = REcmaHelper::pairToScriptValue(engine, cppResult);
                QVariantList vl;
                QVariant v;
                
                    // first type of pair is variant:
                    if (QString(cppResult.first.typeName())=="RLineweight::Lineweight") {
                        v.setValue((int)cppResult.first.value<RLineweight::Lineweight>());
                    }
                    else {
                        v.setValue(cppResult.first);
                    }
                  

                vl.append(v);
                v.setValue(cppResult.second);
                vl.append(v);
                result = qScriptValueFromValue(engine, vl);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.getProperty().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::getProperty", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::setProperty
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::setProperty", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::setProperty";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("setProperty", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    2 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
     && (
            context->argument(1).isVariant() || 
            context->argument(1).isQObject() || 
            context->argument(1).isNumber() || 
            context->argument(1).isString() || 
            context->argument(1).isBool() || 
            context->argument(1).isArray() || 
            context->argument(1).isNull() || 
            context->argument(1).isUndefined()
        ) /* type: QVariant */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RBlock: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
                    // argument isCopyable or pointer
                    QVariant
                    a1 =
                    qscriptvalue_cast<
                    QVariant
                        >(
                        context->argument(
                        1
                        )
                    );
                
    // end of arguments

    // call C++ function:
    // return type 'bool'
    bool cppResult =
        
               self->setProperty(a0
        ,
    a1);
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
    
    if( context->argumentCount() ==
    3 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
     && (
            context->argument(1).isVariant() || 
            context->argument(1).isQObject() || 
            context->argument(1).isNumber() || 
            context->argument(1).isString() || 
            context->argument(1).isBool() || 
            context->argument(1).isArray() || 
            context->argument(1).isNull() || 
            context->argument(1).isUndefined()
        ) /* type: QVariant */
     && (
            context->argument(2).isVariant() || 
            context->argument(2).isQObject() || 
            context->argument(2).isNull()
        ) /* type: RTransaction * */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RBlock: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
                    // argument isCopyable or pointer
                    QVariant
                    a1 =
                    qscriptvalue_cast<
                    QVariant
                        >(
                        context->argument(
                        1
                        )
                    );
                
                    // argument is pointer
                    RTransaction * a2 = NULL;

                    a2 = 
                        REcmaHelper::scriptValueTo<RTransaction >(
                            context->argument(2)
                        );
                    
                    if (a2==NULL && 
                        !context->argument(2).isNull()) {
                        return REcmaHelper::throwError("RBlock: Argument 2 is not of type RTransaction *RTransaction *.", context);                    
                    }
                
    // end of arguments

    // call C++ function:
    // return type 'bool'
    bool cppResult =
        
               self->setProperty(a0
        ,
    a1
        ,
    a2);
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.setProperty().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::setProperty", context, engine);
            return result;
        }
         QScriptValue
        REcmaSharedPointerBlock::setCustomProperty
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaSharedPointerBlock::setCustomProperty", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerBlock::setCustomProperty";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RBlock* self = 
                        getSelf("setCustomProperty", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    3 && (
            context->argument(0).isString()
        ) /* type: QString */
     && (
            context->argument(1).isString()
        ) /* type: QString */
     && (
            context->argument(2).isVariant() || 
            context->argument(2).isQObject() || 
            context->argument(2).isNumber() || 
            context->argument(2).isString() || 
            context->argument(2).isBool() || 
            context->argument(2).isArray() || 
            context->argument(2).isNull() || 
            context->argument(2).isUndefined()
        ) /* type: QVariant */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    QString
                    a0 =
                    (QString)
                    
                    context->argument( 0 ).
                    toString();
                
                    // argument isStandardType
                    QString
                    a1 =
                    (QString)
                    
                    context->argument( 1 ).
                    toString();
                
                    // argument isCopyable or pointer
                    QVariant
                    a2 =
                    qscriptvalue_cast<
                    QVariant
                        >(
                        context->argument(
                        2
                        )
                    );
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->setCustomProperty(a0
        ,
    a1
        ,
    a2);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RBlock.setCustomProperty().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaSharedPointerBlock::setCustomProperty", context, engine);
            return result;
        }
         QScriptValue REcmaSharedPointerBlock::toString
    (QScriptContext *context, QScriptEngine *engine)
    
    {

    RBlock* self = getSelf("toString", context);
    
    QString result;
    
            result = QString("RBlockPointer(0x%1)").arg((unsigned long int)self, 0, 16);
        
    return QScriptValue(result);
    }
     QScriptValue REcmaSharedPointerBlock::destroy(QScriptContext *context, QScriptEngine *engine)
    
    {

        RBlock* self = getSelf("RBlock", context);
        //Q_ASSERT(self!=NULL);
        if (self==NULL) {
            return REcmaHelper::throwError("self is NULL", context);
        }
        
    
        delete self;
        context->thisObject().setData(engine->nullValue());
        context->thisObject().prototype().setData(engine->nullValue());
        context->thisObject().setPrototype(engine->nullValue());
        context->thisObject().setScriptClass(NULL);
        return engine->undefinedValue();
    }
    RBlock* REcmaSharedPointerBlock::getSelf(const QString& fName, QScriptContext* context)
    
        {
            RBlock* 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<RBlockPointer >(context->thisObject())
                
                    ->data()
                
                ;
            //}

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

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

            return self;
            


        }
         QScriptValue REcmaSharedPointerBlock::data
    (QScriptContext *context, QScriptEngine *engine)
    
    {

    RBlock* self = getSelf("data", context);
    return qScriptValueFromValue(engine, self);
    }
     QScriptValue REcmaSharedPointerBlock::isNull
    (QScriptContext *context, QScriptEngine *engine)
    
    {

    RBlockPointer* self = REcmaHelper::scriptValueTo<RBlockPointer >(context->thisObject());

    //RBlock* self = getSelf("isNull", context);
    //Q_ASSERT(self!=NULL);
    if (self==NULL) {
        return REcmaHelper::throwError("self is NULL", context);
    }
    return qScriptValueFromValue(engine, self->isNull());
    }
    