1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation (qt-info@nokia.com)
|
---|
6 | **
|
---|
7 | ** This file is part of the QtDeclarative module of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Lesser General Public License Usage
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
18 | ** General Public License version 2.1 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
20 | ** packaging of this file. Please review the following information to
|
---|
21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
23 | **
|
---|
24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at qt-info@nokia.com.
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #ifndef QDECLARATIVEINSTRUCTION_P_H
|
---|
43 | #define QDECLARATIVEINSTRUCTION_P_H
|
---|
44 |
|
---|
45 | //
|
---|
46 | // W A R N I N G
|
---|
47 | // -------------
|
---|
48 | //
|
---|
49 | // This file is not part of the Qt API. It exists purely as an
|
---|
50 | // implementation detail. This header file may change from version to
|
---|
51 | // version without notice, or even be removed.
|
---|
52 | //
|
---|
53 | // We mean it.
|
---|
54 | //
|
---|
55 |
|
---|
56 | #include <QtCore/qglobal.h>
|
---|
57 |
|
---|
58 | QT_BEGIN_NAMESPACE
|
---|
59 |
|
---|
60 | class QDeclarativeCompiledData;
|
---|
61 | class Q_AUTOTEST_EXPORT QDeclarativeInstruction
|
---|
62 | {
|
---|
63 | public:
|
---|
64 | enum Type {
|
---|
65 | //
|
---|
66 | // Object Creation
|
---|
67 | //
|
---|
68 | // CreateObject - Create a new object instance and push it on the
|
---|
69 | // object stack
|
---|
70 | // SetId - Set the id of the object on the top of the object stack
|
---|
71 | // SetDefault - Sets the instance on the top of the object stack to
|
---|
72 | // be the context's default object.
|
---|
73 | // StoreMetaObject - Assign the dynamic metaobject to object on the
|
---|
74 | // top of the stack.
|
---|
75 | Init, /* init */
|
---|
76 | CreateObject, /* create */
|
---|
77 | CreateSimpleObject, /* createSimple */
|
---|
78 | SetId, /* setId */
|
---|
79 | SetDefault,
|
---|
80 | CreateComponent, /* createComponent */
|
---|
81 | StoreMetaObject, /* storeMeta */
|
---|
82 |
|
---|
83 | //
|
---|
84 | // Precomputed single assignment
|
---|
85 | //
|
---|
86 | // StoreFloat - Store a float in a core property
|
---|
87 | // StoreDouble - Store a double in a core property
|
---|
88 | // StoreInteger - Store a int or uint in a core property
|
---|
89 | // StoreBool - Store a bool in a core property
|
---|
90 | // StoreString - Store a QString in a core property
|
---|
91 | // StoreUrl - Store a QUrl in a core property
|
---|
92 | // StoreColor - Store a QColor in a core property
|
---|
93 | // StoreDate - Store a QDate in a core property
|
---|
94 | // StoreTime - Store a QTime in a core property
|
---|
95 | // StoreDateTime - Store a QDateTime in a core property
|
---|
96 | // StoreVariant - Store a QVariant in a core property
|
---|
97 | // StoreObject - Pop the object on the top of the object stack and
|
---|
98 | // store it in a core property
|
---|
99 | StoreFloat, /* storeFloat */
|
---|
100 | StoreDouble, /* storeDouble */
|
---|
101 | StoreInteger, /* storeInteger */
|
---|
102 | StoreBool, /* storeBool */
|
---|
103 | StoreString, /* storeString */
|
---|
104 | StoreUrl, /* storeUrl */
|
---|
105 | StoreColor, /* storeColor */
|
---|
106 | StoreDate, /* storeDate */
|
---|
107 | StoreTime, /* storeTime */
|
---|
108 | StoreDateTime, /* storeDateTime */
|
---|
109 | StorePoint, /* storeRealPair */
|
---|
110 | StorePointF, /* storeRealPair */
|
---|
111 | StoreSize, /* storeRealPair */
|
---|
112 | StoreSizeF, /* storeRealPair */
|
---|
113 | StoreRect, /* storeRect */
|
---|
114 | StoreRectF, /* storeRect */
|
---|
115 | StoreVector3D, /* storeVector3D */
|
---|
116 | StoreVariant, /* storeString */
|
---|
117 | StoreVariantInteger, /* storeInteger */
|
---|
118 | StoreVariantDouble, /* storeDouble */
|
---|
119 | StoreVariantBool, /* storeBool */
|
---|
120 | StoreObject, /* storeObject */
|
---|
121 | StoreVariantObject, /* storeObject */
|
---|
122 | StoreInterface, /* storeObject */
|
---|
123 |
|
---|
124 | StoreSignal, /* storeSignal */
|
---|
125 | StoreImportedScript, /* storeScript */
|
---|
126 | StoreScriptString, /* storeScriptString */
|
---|
127 |
|
---|
128 | //
|
---|
129 | // Unresolved single assignment
|
---|
130 | //
|
---|
131 | AssignSignalObject, /* assignSignalObject */
|
---|
132 | AssignCustomType, /* assignCustomType */
|
---|
133 |
|
---|
134 | StoreBinding, /* assignBinding */
|
---|
135 | StoreBindingOnAlias, /* assignBinding */
|
---|
136 | StoreCompiledBinding, /* assignBinding */
|
---|
137 | StoreValueSource, /* assignValueSource */
|
---|
138 | StoreValueInterceptor, /* assignValueInterceptor */
|
---|
139 |
|
---|
140 | BeginObject, /* begin */
|
---|
141 |
|
---|
142 | StoreObjectQList, /* NA */
|
---|
143 | AssignObjectList, /* NA */
|
---|
144 |
|
---|
145 | FetchAttached, /* fetchAttached */
|
---|
146 | FetchQList, /* fetch */
|
---|
147 | FetchObject, /* fetch */
|
---|
148 | FetchValueType, /* fetchValue */
|
---|
149 |
|
---|
150 | //
|
---|
151 | // Stack manipulation
|
---|
152 | //
|
---|
153 | // PopFetchedObject - Remove an object from the object stack
|
---|
154 | // PopQList - Remove a list from the list stack
|
---|
155 | PopFetchedObject,
|
---|
156 | PopQList,
|
---|
157 | PopValueType, /* fetchValue */
|
---|
158 |
|
---|
159 | //
|
---|
160 | // Deferred creation
|
---|
161 | //
|
---|
162 | Defer /* defer */
|
---|
163 | };
|
---|
164 | QDeclarativeInstruction()
|
---|
165 | : line(0) {}
|
---|
166 |
|
---|
167 | Type type;
|
---|
168 | unsigned short line;
|
---|
169 |
|
---|
170 | struct InitInstruction {
|
---|
171 | int bindingsSize;
|
---|
172 | int parserStatusSize;
|
---|
173 | int contextCache;
|
---|
174 | int compiledBinding;
|
---|
175 | };
|
---|
176 | struct CreateInstruction {
|
---|
177 | int type;
|
---|
178 | int data;
|
---|
179 | int bindingBits;
|
---|
180 | ushort column;
|
---|
181 | };
|
---|
182 | struct CreateSimpleInstruction {
|
---|
183 | void (*create)(void *);
|
---|
184 | int typeSize;
|
---|
185 | ushort column;
|
---|
186 | };
|
---|
187 | struct StoreMetaInstruction {
|
---|
188 | int data;
|
---|
189 | int aliasData;
|
---|
190 | int propertyCache;
|
---|
191 | };
|
---|
192 | struct SetIdInstruction {
|
---|
193 | int value;
|
---|
194 | int index;
|
---|
195 | };
|
---|
196 | struct AssignValueSourceInstruction {
|
---|
197 | int property;
|
---|
198 | int owner;
|
---|
199 | int castValue;
|
---|
200 | };
|
---|
201 | struct AssignValueInterceptorInstruction {
|
---|
202 | int property;
|
---|
203 | int owner;
|
---|
204 | int castValue;
|
---|
205 | };
|
---|
206 | struct AssignBindingInstruction {
|
---|
207 | unsigned int property;
|
---|
208 | int value;
|
---|
209 | short context;
|
---|
210 | short owner;
|
---|
211 | };
|
---|
212 | struct FetchInstruction {
|
---|
213 | int property;
|
---|
214 | };
|
---|
215 | struct FetchValueInstruction {
|
---|
216 | int property;
|
---|
217 | int type;
|
---|
218 | quint32 bindingSkipList;
|
---|
219 | };
|
---|
220 | struct FetchQmlListInstruction {
|
---|
221 | int property;
|
---|
222 | int type;
|
---|
223 | };
|
---|
224 | struct BeginInstruction {
|
---|
225 | int castValue;
|
---|
226 | };
|
---|
227 | struct StoreFloatInstruction {
|
---|
228 | int propertyIndex;
|
---|
229 | float value;
|
---|
230 | };
|
---|
231 | struct StoreDoubleInstruction {
|
---|
232 | int propertyIndex;
|
---|
233 | double value;
|
---|
234 | };
|
---|
235 | struct StoreIntegerInstruction {
|
---|
236 | int propertyIndex;
|
---|
237 | int value;
|
---|
238 | };
|
---|
239 | struct StoreBoolInstruction {
|
---|
240 | int propertyIndex;
|
---|
241 | bool value;
|
---|
242 | };
|
---|
243 | struct StoreStringInstruction {
|
---|
244 | int propertyIndex;
|
---|
245 | int value;
|
---|
246 | };
|
---|
247 | struct StoreScriptStringInstruction {
|
---|
248 | int propertyIndex;
|
---|
249 | int value;
|
---|
250 | int scope;
|
---|
251 | };
|
---|
252 | struct StoreScriptInstruction {
|
---|
253 | int value;
|
---|
254 | };
|
---|
255 | struct StoreUrlInstruction {
|
---|
256 | int propertyIndex;
|
---|
257 | int value;
|
---|
258 | };
|
---|
259 | struct StoreColorInstruction {
|
---|
260 | int propertyIndex;
|
---|
261 | unsigned int value;
|
---|
262 | };
|
---|
263 | struct StoreDateInstruction {
|
---|
264 | int propertyIndex;
|
---|
265 | int value;
|
---|
266 | };
|
---|
267 | struct StoreTimeInstruction {
|
---|
268 | int propertyIndex;
|
---|
269 | int valueIndex;
|
---|
270 | };
|
---|
271 | struct StoreDateTimeInstruction {
|
---|
272 | int propertyIndex;
|
---|
273 | int valueIndex;
|
---|
274 | };
|
---|
275 | struct StoreRealPairInstruction {
|
---|
276 | int propertyIndex;
|
---|
277 | int valueIndex;
|
---|
278 | };
|
---|
279 | struct StoreRectInstruction {
|
---|
280 | int propertyIndex;
|
---|
281 | int valueIndex;
|
---|
282 | };
|
---|
283 | struct StoreVector3DInstruction {
|
---|
284 | int propertyIndex;
|
---|
285 | int valueIndex;
|
---|
286 | };
|
---|
287 | struct StoreObjectInstruction {
|
---|
288 | int propertyIndex;
|
---|
289 | };
|
---|
290 | struct AssignCustomTypeInstruction {
|
---|
291 | int propertyIndex;
|
---|
292 | int valueIndex;
|
---|
293 | };
|
---|
294 | struct StoreSignalInstruction {
|
---|
295 | int signalIndex;
|
---|
296 | int value;
|
---|
297 | short context;
|
---|
298 | int name;
|
---|
299 | };
|
---|
300 | struct AssignSignalObjectInstruction {
|
---|
301 | int signal;
|
---|
302 | };
|
---|
303 | struct CreateComponentInstruction {
|
---|
304 | int count;
|
---|
305 | ushort column;
|
---|
306 | int endLine;
|
---|
307 | int metaObject;
|
---|
308 | };
|
---|
309 | struct FetchAttachedInstruction {
|
---|
310 | int id;
|
---|
311 | };
|
---|
312 | struct DeferInstruction {
|
---|
313 | int deferCount;
|
---|
314 | };
|
---|
315 |
|
---|
316 | union {
|
---|
317 | InitInstruction init;
|
---|
318 | CreateInstruction create;
|
---|
319 | CreateSimpleInstruction createSimple;
|
---|
320 | StoreMetaInstruction storeMeta;
|
---|
321 | SetIdInstruction setId;
|
---|
322 | AssignValueSourceInstruction assignValueSource;
|
---|
323 | AssignValueInterceptorInstruction assignValueInterceptor;
|
---|
324 | AssignBindingInstruction assignBinding;
|
---|
325 | FetchInstruction fetch;
|
---|
326 | FetchValueInstruction fetchValue;
|
---|
327 | FetchQmlListInstruction fetchQmlList;
|
---|
328 | BeginInstruction begin;
|
---|
329 | StoreFloatInstruction storeFloat;
|
---|
330 | StoreDoubleInstruction storeDouble;
|
---|
331 | StoreIntegerInstruction storeInteger;
|
---|
332 | StoreBoolInstruction storeBool;
|
---|
333 | StoreStringInstruction storeString;
|
---|
334 | StoreScriptStringInstruction storeScriptString;
|
---|
335 | StoreScriptInstruction storeScript;
|
---|
336 | StoreUrlInstruction storeUrl;
|
---|
337 | StoreColorInstruction storeColor;
|
---|
338 | StoreDateInstruction storeDate;
|
---|
339 | StoreTimeInstruction storeTime;
|
---|
340 | StoreDateTimeInstruction storeDateTime;
|
---|
341 | StoreRealPairInstruction storeRealPair;
|
---|
342 | StoreRectInstruction storeRect;
|
---|
343 | StoreVector3DInstruction storeVector3D;
|
---|
344 | StoreObjectInstruction storeObject;
|
---|
345 | AssignCustomTypeInstruction assignCustomType;
|
---|
346 | StoreSignalInstruction storeSignal;
|
---|
347 | AssignSignalObjectInstruction assignSignalObject;
|
---|
348 | CreateComponentInstruction createComponent;
|
---|
349 | FetchAttachedInstruction fetchAttached;
|
---|
350 | DeferInstruction defer;
|
---|
351 | };
|
---|
352 |
|
---|
353 | void dump(QDeclarativeCompiledData *);
|
---|
354 | };
|
---|
355 |
|
---|
356 | QT_END_NAMESPACE
|
---|
357 |
|
---|
358 | #endif // QDECLARATIVEINSTRUCTION_P_H
|
---|