summaryrefslogtreecommitdiffstats
path: root/src/script/bridge/qscriptqobject_p.h
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-24 16:07:23 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-24 16:07:23 (GMT)
commitf4bc67386bc77aae33469c01d0ac0fd09aa438c3 (patch)
treeec2984e8bf943b75d10e1774cf6d93cd04ac3493 /src/script/bridge/qscriptqobject_p.h
parente9d1f93c5a2c8a0d800dd83190fd3060abe4850b (diff)
downloadQt-f4bc67386bc77aae33469c01d0ac0fd09aa438c3.zip
Qt-f4bc67386bc77aae33469c01d0ac0fd09aa438c3.tar.gz
Qt-f4bc67386bc77aae33469c01d0ac0fd09aa438c3.tar.bz2
work on signal bindings (connect, disconnect, signal emission)
Diffstat (limited to 'src/script/bridge/qscriptqobject_p.h')
-rw-r--r--src/script/bridge/qscriptqobject_p.h45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/script/bridge/qscriptqobject_p.h b/src/script/bridge/qscriptqobject_p.h
index ba7a4b4..d99ea3d 100644
--- a/src/script/bridge/qscriptqobject_p.h
+++ b/src/script/bridge/qscriptqobject_p.h
@@ -31,6 +31,7 @@
#include <QtCore/qpointer.h>
#include "JSObject.h"
+#include "InternalFunction.h"
QT_BEGIN_NAMESPACE
@@ -108,12 +109,12 @@ public:
~QObjectData();
bool addSignalHandler(QObject *sender,
- const char *signal,
+ int signalIndex,
JSC::JSValue receiver,
JSC::JSValue slot,
JSC::JSValue senderWrapper = 0);
bool removeSignalHandler(QObject *sender,
- const char *signal,
+ int signalIndex,
JSC::JSValue receiver,
JSC::JSValue slot);
@@ -125,6 +126,46 @@ private:
// QList<QScriptQObjectWrapperInfo> wrappers;
};
+class QtFunction: public JSC::InternalFunction
+{
+public:
+ // work around CELL_SIZE limitation
+ struct Data
+ {
+ JSC::JSValue object;
+ int initialIndex;
+ bool maybeOverloaded;
+
+ Data(JSC::JSValue o, int ii, bool mo)
+ : object(o), initialIndex(ii), maybeOverloaded(mo) {}
+ };
+
+ QtFunction(JSC::JSValue object, int initialIndex, bool maybeOverloaded,
+ JSC::JSGlobalData*, WTF::PassRefPtr<JSC::Structure>, const JSC::Identifier&);
+ virtual ~QtFunction();
+
+ virtual JSC::CallType getCallData(JSC::CallData&);
+ virtual void mark();
+
+ virtual const JSC::ClassInfo* classInfo() const { return &info; }
+ static const JSC::ClassInfo info;
+
+ JSC::JSValue call(JSC::ExecState *exec, JSC::JSValue thisValue,
+ const JSC::ArgList &args);
+
+ QObjectWrapperObject *wrapperObject() const;
+ QObject *qobject() const;
+ const QMetaObject *metaObject() const;
+ int initialIndex() const;
+ bool maybeOverloaded() const;
+ int mostGeneralMethod(QMetaMethod *out = 0) const;
+ QList<int> overloadedIndexes() const;
+ QString functionName() const;
+
+private:
+ Data *data;
+};
+
} // namespace QScript
QT_END_NAMESPACE