aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativedata_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qdeclarativedata_p.h')
-rw-r--r--src/declarative/qml/qdeclarativedata_p.h49
1 files changed, 44 insertions, 5 deletions
diff --git a/src/declarative/qml/qdeclarativedata_p.h b/src/declarative/qml/qdeclarativedata_p.h
index b987ffd6ea..3229c5e878 100644
--- a/src/declarative/qml/qdeclarativedata_p.h
+++ b/src/declarative/qml/qdeclarativedata_p.h
@@ -68,6 +68,7 @@ class QDeclarativePropertyCache;
class QDeclarativeContextData;
class QDeclarativeNotifier;
class QDeclarativeDataExtended;
+class QDeclarativeNotifierEndpoint;
// This class is structured in such a way, that simply zero'ing it is the
// default state for elemental object allocations. This is crucial in the
// workings of the QDeclarativeInstruction::CreateSimpleObject instruction.
@@ -77,22 +78,24 @@ class Q_DECLARATIVE_EXPORT QDeclarativeData : public QAbstractDeclarativeData
public:
QDeclarativeData()
: ownMemory(true), ownContext(false), indestructible(true), explicitIndestructibleSet(false),
- hasTaintedV8Object(false), context(0), outerContext(0), bindings(0), nextContextObject(0),
- prevContextObject(0), bindingBitsSize(0), bindingBits(0), lineNumber(0), columnNumber(0),
- deferredComponent(0), deferredIdx(0), v8objectid(0), propertyCache(0), guards(0),
- extendedData(0) {
+ hasTaintedV8Object(false), notifyList(0), context(0), outerContext(0), bindings(0),
+ nextContextObject(0), prevContextObject(0), bindingBitsSize(0), bindingBits(0),
+ lineNumber(0), columnNumber(0), deferredComponent(0), deferredIdx(0), v8objectid(0),
+ propertyCache(0), guards(0), extendedData(0) {
init();
- }
+ }
static inline void init() {
QAbstractDeclarativeData::destroyed = destroyed;
QAbstractDeclarativeData::parentChanged = parentChanged;
QAbstractDeclarativeData::objectNameChanged = objectNameChanged;
+ QAbstractDeclarativeData::signalEmitted = signalEmitted;
}
static void destroyed(QAbstractDeclarativeData *, QObject *);
static void parentChanged(QAbstractDeclarativeData *, QObject *, QObject *);
static void objectNameChanged(QAbstractDeclarativeData *, QObject *);
+ static void signalEmitted(QAbstractDeclarativeData *, QObject *, int, void **);
void destroyed(QObject *);
void parentChanged(QObject *, QObject *);
@@ -109,6 +112,23 @@ public:
quint32 hasTaintedV8Object:1;
quint32 dummy:27;
+ struct NotifyList {
+ quint64 connectionMask;
+
+ quint16 maximumTodoIndex;
+ quint16 notifiesSize;
+
+ QDeclarativeNotifierEndpoint *todo;
+ QDeclarativeNotifierEndpoint**notifies;
+ void layout();
+ private:
+ void layout(QDeclarativeNotifierEndpoint*);
+ };
+ NotifyList *notifyList;
+
+ inline QDeclarativeNotifierEndpoint *notify(int index);
+ void addNotify(int index, QDeclarativeNotifierEndpoint *);
+
// The context that created the C++ object
QDeclarativeContextData *context;
// The outermost context in which this object lives
@@ -163,6 +183,25 @@ private:
mutable QDeclarativeDataExtended *extendedData;
};
+QDeclarativeNotifierEndpoint *QDeclarativeData::notify(int index)
+{
+ Q_ASSERT(index <= 0xFFFF);
+
+ if (!notifyList || !(notifyList->connectionMask & (1 << (index % 64)))) {
+ return 0;
+ } else if (index < notifyList->notifiesSize) {
+ return notifyList->notifies[index];
+ } else if (index <= notifyList->maximumTodoIndex) {
+ notifyList->layout();
+ }
+
+ if (index < notifyList->notifiesSize) {
+ return notifyList->notifies[index];
+ } else {
+ return 0;
+ }
+}
+
QT_END_NAMESPACE
#endif // QDECLARATIVEDATA_P_H