Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlprivate.h |
Switch to Source code | Preprocessed file |
Line | Source | Count |
---|---|---|
1 | - | |
2 | - | |
3 | - | |
4 | - | |
5 | namespace QQmlPrivate { | - |
6 | struct CachedQmlUnit; | - |
7 | } | - |
8 | - | |
9 | namespace QV4 { | - |
10 | struct ExecutionEngine; | - |
11 | namespace CompiledData { | - |
12 | struct Unit; | - |
13 | struct CompilationUnit; | - |
14 | } | - |
15 | } | - |
16 | namespace QmlIR { | - |
17 | struct Document; | - |
18 | typedef void (*IRLoaderFunction)(Document *, const QQmlPrivate::CachedQmlUnit *); | - |
19 | } | - |
20 | - | |
21 | typedef QObject *(*QQmlAttachedPropertiesFunc)(QObject *); | - |
22 | - | |
23 | template <typename TYPE> | - |
24 | class QQmlTypeInfo | - |
25 | { | - |
26 | public: | - |
27 | enum { | - |
28 | hasAttachedProperties = 0 | - |
29 | }; | - |
30 | }; | - |
31 | - | |
32 | - | |
33 | class QJSValue; | - |
34 | class QJSEngine; | - |
35 | class QQmlEngine; | - |
36 | class QQmlCustomParser; | - |
37 | namespace QQmlPrivate | - |
38 | { | - |
39 | void __attribute__((visibility("default"))) qdeclarativeelement_destructor(QObject *); | - |
40 | template<typename T> | - |
41 | class QQmlElement : public T | - |
42 | { | - |
43 | public: | - |
44 | ~QQmlElement() override { | - |
45 | QQmlPrivate::qdeclarativeelement_destructor(this); | - |
46 | } executed 472648 times by 129 tests: end of block Executed by:
| 472648 |
47 | }; | - |
48 | - | |
49 | template<typename T> | - |
50 | void createInto(void *memory) { new (memory) QQmlElement<T>; } executed 516464 times by 135 tests: end of block Executed by:
| 516464 |
51 | - | |
52 | template<typename T> | - |
53 | QObject *createParent(QObject *p) { return executed 16 times by 1 test: new T(p);return new T(p); Executed by:
executed 16 times by 1 test: }return new T(p); Executed by:
| 16 |
54 | - | |
55 | template<class From, class To, int N> | - |
56 | struct StaticCastSelectorClass | - |
57 | { | - |
58 | static inline int cast() { return executed 179798 times by 138 tests: -1;return -1; Executed by:
executed 179798 times by 138 tests: }return -1; Executed by:
| 179798 |
59 | }; | - |
60 | - | |
61 | template<class From, class To> | - |
62 | struct StaticCastSelectorClass<From, To, sizeof(int)> | - |
63 | { | - |
64 | static inline int cast() { return executed 52708 times by 137 tests: int(reinterpret_cast<quintptr>(static_cast<To *>(reinterpret_cast<From *>(0x10000000)))) - 0x10000000;return int(reinterpret_cast<quintptr>(static_cast<To *>(reinterpret_cast<From *>(0x10000000)))) - 0x10000000; Executed by:
executed 52708 times by 137 tests: }return int(reinterpret_cast<quintptr>(static_cast<To *>(reinterpret_cast<From *>(0x10000000)))) - 0x10000000; Executed by:
| 52708 |
65 | }; | - |
66 | - | |
67 | template<class From, class To> | - |
68 | struct StaticCastSelector | - |
69 | { | - |
70 | typedef int yes_type; | - |
71 | typedef char no_type; | - |
72 | - | |
73 | static yes_type checkType(To *); | - |
74 | static no_type checkType(...); | - |
75 | - | |
76 | static inline int cast() | - |
77 | { | - |
78 | return executed 232506 times by 138 tests: StaticCastSelectorClass<From, To, sizeof(checkType(reinterpret_cast<From *>(0)))>::cast();return StaticCastSelectorClass<From, To, sizeof(checkType(reinterpret_cast<From *>(0)))>::cast(); Executed by:
executed 232506 times by 138 tests: return StaticCastSelectorClass<From, To, sizeof(checkType(reinterpret_cast<From *>(0)))>::cast(); Executed by:
| 232506 |
79 | } | - |
80 | }; | - |
81 | - | |
82 | template <typename T> | - |
83 | struct has_attachedPropertiesMember | - |
84 | { | - |
85 | static bool const value = QQmlTypeInfo<T>::hasAttachedProperties; | - |
86 | }; | - |
87 | - | |
88 | template <typename T, bool hasMember> | - |
89 | class has_attachedPropertiesMethod | - |
90 | { | - |
91 | public: | - |
92 | typedef int yes_type; | - |
93 | typedef char no_type; | - |
94 | - | |
95 | template<typename ReturnType> | - |
96 | static yes_type checkType(ReturnType *(*)(QObject *)); | - |
97 | static no_type checkType(...); | - |
98 | - | |
99 | static bool const value = sizeof(checkType(&T::qmlAttachedProperties)) == sizeof(yes_type); | - |
100 | }; | - |
101 | - | |
102 | template <typename T> | - |
103 | class has_attachedPropertiesMethod<T, false> | - |
104 | { | - |
105 | public: | - |
106 | static bool const value = false; | - |
107 | }; | - |
108 | - | |
109 | template<typename T, int N> | - |
110 | class AttachedPropertySelector | - |
111 | { | - |
112 | public: | - |
113 | static inline QQmlAttachedPropertiesFunc func() { return executed 69184 times by 138 tests: nullptr;return nullptr; Executed by:
executed 69184 times by 138 tests: }return nullptr; Executed by:
| 69184 |
114 | static inline const QMetaObject *metaObject() { return nullptr; } | - |
115 | }; | - |
116 | template<typename T> | - |
117 | class AttachedPropertySelector<T, 1> | - |
118 | { | - |
119 | static inline QObject *attachedProperties(QObject *obj) { | - |
120 | return executed 89777 times by 31 tests: T::qmlAttachedProperties(obj);return T::qmlAttachedProperties(obj); Executed by:
executed 89777 times by 31 tests: return T::qmlAttachedProperties(obj); Executed by:
| 89777 |
121 | } | - |
122 | template<typename ReturnType> | - |
123 | static inline const QMetaObject *attachedPropertiesMetaObject(ReturnType *(*)(QObject *)) { | - |
124 | return executed 8328 times by 135 tests: &ReturnType::staticMetaObject;return &ReturnType::staticMetaObject; Executed by:
executed 8328 times by 135 tests: return &ReturnType::staticMetaObject; Executed by:
| 8328 |
125 | } | - |
126 | public: | - |
127 | static inline QQmlAttachedPropertiesFunc func() { | - |
128 | return executed 8328 times by 135 tests: &attachedProperties;return &attachedProperties; Executed by:
executed 8328 times by 135 tests: return &attachedProperties; Executed by:
| 8328 |
129 | } | - |
130 | static inline const QMetaObject *metaObject() { | - |
131 | return attachedPropertiesMetaObject(&T::qmlAttachedProperties); | - |
132 | } | - |
133 | }; | - |
134 | - | |
135 | template<typename T> | - |
136 | inline QQmlAttachedPropertiesFunc attachedPropertiesFunc() | - |
137 | { | - |
138 | return executed 77512 times by 138 tests: AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::func();return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::func(); Executed by:
executed 77512 times by 138 tests: return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::func(); Executed by:
| 77512 |
139 | } | - |
140 | - | |
141 | template<typename T> | - |
142 | inline const QMetaObject *attachedPropertiesMetaObject() | - |
143 | { | - |
144 | return executed 77512 times by 138 tests: AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::metaObject();return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::metaObject(); Executed by:
executed 77512 times by 138 tests: return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::metaObject(); Executed by:
| 77512 |
145 | } | - |
146 | - | |
147 | enum AutoParentResult { Parented, IncompatibleObject, IncompatibleParent }; | - |
148 | typedef AutoParentResult (*AutoParentFunction)(QObject *object, QObject *parent); | - |
149 | - | |
150 | struct RegisterType { | - |
151 | int version; | - |
152 | - | |
153 | int typeId; | - |
154 | int listId; | - |
155 | int objectSize; | - |
156 | void (*create)(void *); | - |
157 | QString noCreationReason; | - |
158 | - | |
159 | const char *uri; | - |
160 | int versionMajor; | - |
161 | int versionMinor; | - |
162 | const char *elementName; | - |
163 | const QMetaObject *metaObject; | - |
164 | - | |
165 | QQmlAttachedPropertiesFunc attachedPropertiesFunction; | - |
166 | const QMetaObject *attachedPropertiesMetaObject; | - |
167 | - | |
168 | int parserStatusCast; | - |
169 | int valueSourceCast; | - |
170 | int valueInterceptorCast; | - |
171 | - | |
172 | QObject *(*extensionObjectCreate)(QObject *); | - |
173 | const QMetaObject *extensionMetaObject; | - |
174 | - | |
175 | QQmlCustomParser *customParser; | - |
176 | int revision; | - |
177 | - | |
178 | }; | - |
179 | - | |
180 | struct RegisterInterface { | - |
181 | int version; | - |
182 | - | |
183 | int typeId; | - |
184 | int listId; | - |
185 | - | |
186 | const char *iid; | - |
187 | }; | - |
188 | - | |
189 | struct RegisterAutoParent { | - |
190 | int version; | - |
191 | - | |
192 | AutoParentFunction function; | - |
193 | }; | - |
194 | - | |
195 | struct RegisterSingletonType { | - |
196 | int version; | - |
197 | - | |
198 | const char *uri; | - |
199 | int versionMajor; | - |
200 | int versionMinor; | - |
201 | const char *typeName; | - |
202 | - | |
203 | QJSValue (*scriptApi)(QQmlEngine *, QJSEngine *); | - |
204 | QObject *(*qobjectApi)(QQmlEngine *, QJSEngine *); | - |
205 | const QMetaObject *instanceMetaObject; | - |
206 | int typeId; | - |
207 | int revision; | - |
208 | - | |
209 | }; | - |
210 | - | |
211 | struct RegisterCompositeType { | - |
212 | QUrl url; | - |
213 | const char *uri; | - |
214 | int versionMajor; | - |
215 | int versionMinor; | - |
216 | const char *typeName; | - |
217 | }; | - |
218 | - | |
219 | struct RegisterCompositeSingletonType { | - |
220 | QUrl url; | - |
221 | const char *uri; | - |
222 | int versionMajor; | - |
223 | int versionMinor; | - |
224 | const char *typeName; | - |
225 | }; | - |
226 | - | |
227 | struct CachedQmlUnit { | - |
228 | const QV4::CompiledData::Unit *qmlData; | - |
229 | void *unused1; | - |
230 | void *unused2; | - |
231 | }; | - |
232 | - | |
233 | typedef const CachedQmlUnit *(*QmlUnitCacheLookupFunction)(const QUrl &url); | - |
234 | struct RegisterQmlUnitCacheHook { | - |
235 | int version; | - |
236 | QmlUnitCacheLookupFunction lookupCachedQmlUnit; | - |
237 | }; | - |
238 | - | |
239 | enum RegistrationType { | - |
240 | TypeRegistration = 0, | - |
241 | InterfaceRegistration = 1, | - |
242 | AutoParentRegistration = 2, | - |
243 | SingletonRegistration = 3, | - |
244 | CompositeRegistration = 4, | - |
245 | CompositeSingletonRegistration = 5, | - |
246 | QmlUnitCacheHookRegistration = 6 | - |
247 | }; | - |
248 | - | |
249 | int __attribute__((visibility("default"))) qmlregister(RegistrationType, void *); | - |
250 | } | - |
251 | - | |
252 | - | |
Switch to Source code | Preprocessed file |