~loic.molinari/+junk/qtdeclarative-opensource-src-qtquickitem-theme-pointer

« back to all changes in this revision

Viewing changes to src/qml/jsruntime/qv4variantobject_p.h

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2015-02-13 06:17:15 UTC
  • mfrom: (0.1.24 experimental)
  • Revision ID: package-import@ubuntu.com-20150213061715-rlmavkexpjqk7pqp
Tags: 5.4.0-4ubuntu1
* New upstream release.
* Switch to using xvfb-run for tests
* Bump dependencies
* Drop patches:
  - freebsd_registers.diff
  - Avoid-race-condition-in-QQmlEngine-on-shutdown.patch
  - Fix-crashes-when-calling-Array.sort-with-imperfect-s.patch
* Update symbols and mark private ones
* Sync with Debian 5.4.0-4
  - Keep gles packages support, transitional packages, tests enablement 
    and additional patches
* debian/patches/Fix-regression-where-QQuickScreenAttached-overwrites.patch:
  - Fix orientation not working (LP: #1418370)
* debian/patches/QML-Compilation-unit-caching-and-JIT-changes.patch:
  - Comment out, needs rebasing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
2
**
3
 
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 
3
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4
4
** Contact: http://www.qt-project.org/legal
5
5
**
6
6
** This file is part of the QtQml module of the Qt Toolkit.
7
7
**
8
 
** $QT_BEGIN_LICENSE:LGPL$
 
8
** $QT_BEGIN_LICENSE:LGPL21$
9
9
** Commercial License Usage
10
10
** Licensees holding valid commercial Qt licenses may use this file in
11
11
** accordance with the commercial license agreement provided with the
12
12
** Software or, alternatively, in accordance with the terms contained in
13
 
** a written agreement between you and Digia.  For licensing terms and
14
 
** conditions see http://qt.digia.com/licensing.  For further information
 
13
** a written agreement between you and Digia. For licensing terms and
 
14
** conditions see http://qt.digia.com/licensing. For further information
15
15
** use the contact form at http://qt.digia.com/contact-us.
16
16
**
17
17
** GNU Lesser General Public License Usage
18
18
** Alternatively, this file may be used under the terms of the GNU Lesser
19
 
** General Public License version 2.1 as published by the Free Software
20
 
** Foundation and appearing in the file LICENSE.LGPL included in the
21
 
** packaging of this file.  Please review the following information to
22
 
** ensure the GNU Lesser General Public License version 2.1 requirements
23
 
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 
19
** General Public License version 2.1 or version 3 as published by the Free
 
20
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
 
21
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
 
22
** following information to ensure the GNU Lesser General Public License
 
23
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
 
24
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
25
**
25
26
** In addition, as a special exception, Digia gives you certain additional
26
 
** rights.  These rights are described in the Digia Qt LGPL Exception
 
27
** rights. These rights are described in the Digia Qt LGPL Exception
27
28
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
29
**
29
 
** GNU General Public License Usage
30
 
** Alternatively, this file may be used under the terms of the GNU
31
 
** General Public License version 3.0 as published by the Free Software
32
 
** Foundation and appearing in the file LICENSE.GPL included in the
33
 
** packaging of this file.  Please review the following information to
34
 
** ensure the GNU General Public License version 3.0 requirements will be
35
 
** met: http://www.gnu.org/copyleft/gpl.html.
36
 
**
37
 
**
38
30
** $QT_END_LICENSE$
39
31
**
40
32
****************************************************************************/
64
56
 
65
57
namespace QV4 {
66
58
 
67
 
struct VariantObject : Object, public ExecutionEngine::ScarceResourceData
 
59
struct VariantObject : Object
68
60
{
69
 
    V4_OBJECT
70
 
public:
71
 
    VariantObject(InternalClass *ic);
72
 
    VariantObject(ExecutionEngine *engine, const QVariant &value);
 
61
    struct Data : Object::Data, public ExecutionEngine::ScarceResourceData
 
62
    {
 
63
        Data(InternalClass *ic);
 
64
        Data(ExecutionEngine *engine, const QVariant &value);
 
65
        ~Data() {
 
66
            if (isScarce())
 
67
                node.remove();
 
68
        }
 
69
        bool isScarce() const;
 
70
        int vmePropertyReferenceCount;
 
71
    };
 
72
    V4_OBJECT(Object)
73
73
 
74
74
    static QVariant toVariant(const ValueRef v);
75
75
 
76
76
    void addVmePropertyReference();
77
77
    void removeVmePropertyReference();
78
 
    bool isScarce() const;
79
 
    int m_vmePropertyReferenceCount;
80
78
 
81
79
    static void destroy(Managed *that);
82
80
    static bool isEqualTo(Managed *m, Managed *other);
83
81
};
84
82
 
85
 
DEFINE_REF(VariantObject, Object);
86
 
 
87
83
struct VariantPrototype : VariantObject
88
84
{
89
85
public:
90
 
    VariantPrototype(InternalClass *ic);
91
 
 
92
86
    void init();
93
87
 
94
88
    static ReturnedValue method_preserve(CallContext *ctx);