/** * Stream operator for QDebug */ QDebug operator<<(QDebug dbg, const RView& v) { dbg.nospace() << "RView(" << (RObject&) v << ", name: " << v.getName() << ", centerPoint: " << v.getCenterPoint() << ", width: " << v.getWidth() << ", height: " << v.getHeight() << ")"; return dbg.space(); }
QScriptValue REcmaSharedPointerView::getCenterPoint (QScriptContext* context, QScriptEngine* engine) { //REcmaHelper::functionStart("REcmaSharedPointerView::getCenterPoint", context, engine); //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerView::getCenterPoint"; //QCoreApplication::processEvents(); QScriptValue result = engine->undefinedValue(); // public function: can be called from ECMA wrapper of ECMA shell: RView* self = getSelf("getCenterPoint", 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->getCenterPoint(); // return type: RVector // not standard type nor reference result = qScriptValueFromValue(engine, cppResult); } else { return REcmaHelper::throwError("Wrong number/types of arguments for RView.getCenterPoint().", context); } //REcmaHelper::functionEnd("REcmaSharedPointerView::getCenterPoint", context, engine); return result; }