summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/qscriptengine_p.h')
-rw-r--r--src/script/api/qscriptengine_p.h58
1 files changed, 57 insertions, 1 deletions
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 8a81fd3..b1b0d2d 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -48,6 +48,7 @@ namespace QScript
class QObjectPrototype;
class QMetaObjectPrototype;
class QVariantPrototype;
+ class ClassObjectPrototype;
#ifndef QT_NO_QOBJECT
class QObjectData;
#endif
@@ -142,11 +143,16 @@ public:
QScript::QObjectPrototype *qobjectPrototype;
WTF::RefPtr<JSC::Structure> qobjectWrapperObjectStructure;
+
QScript::QMetaObjectPrototype *qmetaobjectPrototype;
WTF::RefPtr<JSC::Structure> qmetaobjectWrapperObjectStructure;
+
QScript::QVariantPrototype *variantPrototype;
WTF::RefPtr<JSC::Structure> variantWrapperObjectStructure;
+ QScript::ClassObjectPrototype *classObjectPrototype;
+ WTF::RefPtr<JSC::Structure> classObjectStructure;
+
QScriptEngineAgent *agent;
QHash<JSC::JSCell*, QBasicAtomicInt> keepAliveValues;
QHash<int, QScriptTypeInfo*> m_typeInfos;
@@ -176,7 +182,57 @@ public:
QScriptEnginePrivate *engine;
};
-}
+// ### move
+class ClassObject : public JSC::JSObject
+{
+public:
+ // work around CELL_SIZE limitation
+ struct Data
+ {
+ QScriptClass *scriptClass;
+
+ Data(QScriptClass *sc)
+ : scriptClass(sc) {}
+ };
+
+ explicit ClassObject(QScriptClass *scriptClass,
+ WTF::PassRefPtr<JSC::Structure> sid);
+ ~ClassObject();
+
+ virtual bool getOwnPropertySlot(JSC::ExecState*,
+ const JSC::Identifier& propertyName,
+ JSC::PropertySlot&);
+ virtual void put(JSC::ExecState* exec, const JSC::Identifier& propertyName,
+ JSC::JSValue, JSC::PutPropertySlot&);
+ virtual bool deleteProperty(JSC::ExecState*,
+ const JSC::Identifier& propertyName);
+ virtual bool getPropertyAttributes(JSC::ExecState*, const JSC::Identifier&,
+ unsigned&) const;
+ virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&);
+
+ virtual const JSC::ClassInfo* classInfo() const;
+ static const JSC::ClassInfo info;
+
+ static WTF::PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType));
+ }
+
+ QScriptClass *scriptClass() const;
+ void setScriptClass(QScriptClass *scriptClass);
+
+private:
+ Data *data;
+};
+
+class ClassObjectPrototype : public ClassObject
+{
+public:
+ ClassObjectPrototype(JSC::ExecState*, WTF::PassRefPtr<JSC::Structure>,
+ JSC::Structure* prototypeFunctionStructure);
+};
+
+} // namespace QScript
QT_END_NAMESPACE