OpenCoverage

qqmlbuiltinfunctions_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/v8/qqmlbuiltinfunctions_p.h
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQml module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#ifndef QQMLBUILTINFUNCTIONS_P_H-
41#define QQMLBUILTINFUNCTIONS_P_H-
42-
43//-
44// W A R N I N G-
45// --------------
46//-
47// This file is not part of the Qt API. It exists purely as an-
48// implementation detail. This header file may change from version to-
49// version without notice, or even be removed.-
50//-
51// We mean it.-
52//-
53-
54#include <private/qqmlglobal_p.h>-
55#include <private/qv4functionobject_p.h>-
56#include <private/qjsengine_p.h>-
57-
58QT_BEGIN_NAMESPACE-
59-
60class QQmlEngine;-
61-
62namespace QV4 {-
63-
64namespace Heap {-
65-
66struct QtObject : Object {-
67 void init(QQmlEngine *qmlEngine);-
68 QObject *platform;-
69 QObject *application;-
70-
71 enum { Finished = -1 };-
72 int enumeratorIterator;-
73 int keyIterator;-
74-
75 bool isComplete() const-
76 { return enumeratorIterator == Finished; }
never executed: return enumeratorIterator == Finished;
0
77};-
78-
79struct ConsoleObject : Object {-
80 void init();-
81};-
82-
83#define QQmlBindingFunctionMembers(class, Member) \-
84 Member(class, Pointer, FunctionObject *, bindingFunction)-
85DECLARE_HEAP_OBJECT(QQmlBindingFunction, FunctionObject) {-
86 DECLARE_MARKOBJECTS(QQmlBindingFunction)
never executed: end of block
never executed: o->bindingFunction.heapObject()->mark(stack);
o->bindingFunctionDescription
TRUEnever evaluated
FALSEnever evaluated
0
87 void init(const QV4::FunctionObject *bindingFunction);-
88};-
89-
90}-
91-
92struct QtObject : Object-
93{-
94 V4_OBJECT2(QtObject, Object)
never executed: end of block
never executed: end of block
executed 26352 times by 148 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • ...
executed 17568 times by 148 tests: return static_cast<QV4::Heap::QtObject *>(m());
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • ...
executed 8784 times by 148 tests: return dptr;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • ...
0-26352
95-
96 static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty);-
97 static void virtualAdvanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes);-
98-
99 static ReturnedValue method_isQtObject(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
100 static ReturnedValue method_rgba(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
101 static ReturnedValue method_hsla(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
102 static ReturnedValue method_hsva(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
103 static ReturnedValue method_colorEqual(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
104 static ReturnedValue method_font(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
105 static ReturnedValue method_rect(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
106 static ReturnedValue method_point(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
107 static ReturnedValue method_size(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
108 static ReturnedValue method_vector2d(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
109 static ReturnedValue method_vector3d(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
110 static ReturnedValue method_vector4d(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
111 static ReturnedValue method_quaternion(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
112 static ReturnedValue method_matrix4x4(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
113 static ReturnedValue method_lighter(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
114 static ReturnedValue method_darker(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
115 static ReturnedValue method_tint(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
116 static ReturnedValue method_formatDate(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
117 static ReturnedValue method_formatTime(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
118 static ReturnedValue method_formatDateTime(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
119 static ReturnedValue method_openUrlExternally(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
120 static ReturnedValue method_fontFamilies(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
121 static ReturnedValue method_md5(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
122 static ReturnedValue method_btoa(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
123 static ReturnedValue method_atob(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
124 static ReturnedValue method_quit(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
125 static ReturnedValue method_exit(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
126 static ReturnedValue method_resolvedUrl(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
127 static ReturnedValue method_createQmlObject(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
128 static ReturnedValue method_createComponent(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
129#if QT_CONFIG(qml_locale)-
130 static ReturnedValue method_locale(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
131#endif-
132 static ReturnedValue method_binding(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
133-
134 static ReturnedValue method_get_platform(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
135 static ReturnedValue method_get_application(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
136 static ReturnedValue method_get_inputMethod(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
137 static ReturnedValue method_get_styleHints(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
138-
139 static ReturnedValue method_callLater(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);-
140-
141private:-
142 void addAll();-
143 ReturnedValue findAndAdd(const QString *name, bool &foundProperty) const;-
144};-
145-
146struct ConsoleObject : Object-
147{-
148 V4_OBJECT2(ConsoleObject, Object)
never executed: end of block
never executed: end of block
never executed: return &static_vtbl;
never executed: return static_cast<QV4::Heap::ConsoleObject *>(m());
never executed: return dptr;
0
149-
150 static ReturnedValue method_error(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
151 static ReturnedValue method_log(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
152 static ReturnedValue method_info(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
153 static ReturnedValue method_profile(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
154 static ReturnedValue method_profileEnd(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
155 static ReturnedValue method_time(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
156 static ReturnedValue method_timeEnd(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
157 static ReturnedValue method_count(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
158 static ReturnedValue method_trace(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
159 static ReturnedValue method_warn(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
160 static ReturnedValue method_assert(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
161 static ReturnedValue method_exception(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
162-
163};-
164-
165struct Q_QML_PRIVATE_EXPORT GlobalExtensions {-
166 static void init(Object *globalObject, QJSEngine::Extensions extensions);-
167-
168#if QT_CONFIG(translation)-
169 static ReturnedValue method_qsTranslate(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
170 static ReturnedValue method_qsTranslateNoOp(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
171 static ReturnedValue method_qsTr(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
172 static ReturnedValue method_qsTrNoOp(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
173 static ReturnedValue method_qsTrId(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
174 static ReturnedValue method_qsTrIdNoOp(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
175#endif-
176 static ReturnedValue method_gc(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
177-
178 // on String:prototype-
179 static ReturnedValue method_string_arg(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);-
180-
181};-
182-
183struct QQmlBindingFunction : public QV4::FunctionObject-
184{-
185 V4_OBJECT2(QQmlBindingFunction, FunctionObject)
executed 80 times by 8 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
never executed: end of block
executed 820 times by 13 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlstatemachine
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
executed 80 times by 8 tests: return static_cast<QV4::Heap::QQmlBindingFunction *>(m());
Executed by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
executed 80 times by 8 tests: return dptr;
Executed by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
0-820
186-
187 Heap::FunctionObject *bindingFunction() const { return d()->bindingFunction; }
executed 80 times by 8 tests: return d()->bindingFunction;
Executed by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
80
188 QQmlSourceLocation currentLocation() const; // from caller stack trace-
189};-
190-
191}-
192-
193QT_END_NAMESPACE-
194-
195#endif // QQMLBUILTINFUNCTIONS_P_H-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0