File: backportglobal.h

package info (click to toggle)
analizo 1.25.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,916 kB
  • sloc: perl: 3,325; cpp: 1,780; ansic: 663; cs: 378; java: 265; sh: 104; makefile: 89
file content (74 lines) | stat: -rw-r--r-- 2,325 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*

**ANALIZO NOTE**

This file was copied from kdelibs project for testing analizo features.

The original file was modified and some code was deleted to keep only what is
needed to create automated tests on analizo side fixing the bug below.

- https://github.com/analizo/analizo/issues/173

GitHub kdelibs repository:

- https://github.com/KDE/kdelibs.git

Original file was copied from the commit 0f4cf41b22 from kdelibs git repository
and it is located inside kdelibs repository on the path below.

- experimental/libkdeclarative/bindings/backportglobal.h

Link to the original file on GitHub:

- https://github.com/KDE/kdelibs/blob/9941ebff54bd9d4349c0384dfa0cca2ace9549c4/experimental/libkdeclarative/bindings/backportglobal.h

*/

/****************************************************************************
**
** This file is part of the Qt Script Generator.
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact:  Nokia Corporation info@qt.nokia.com
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging of
** this file.  Please review the following information to ensure the GNU
** Lesser General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** Copyright (C)  2011 Nokia. All rights reserved
****************************************************************************/
#ifndef QTSCRIPTEXTENSIONS_GLOBAL_H
#define QTSCRIPTEXTENSIONS_GLOBAL_H

#include <QtCore/QSharedData>

#define DECLARE_GET_METHOD(Class, __get__) \
BEGIN_DECLARE_METHOD(Class, __get__) { \
    return qScriptValueFromValue(eng, self->__get__()); \
} END_DECLARE_METHOD

#define DECLARE_SET_METHOD(Class, T, __set__) \
BEGIN_DECLARE_METHOD(Class, __set__) { \
    self->__set__(qscriptvalue_cast<T>(ctx->argument(0))); \
    return eng->undefinedValue(); \
} END_DECLARE_METHOD

#define DECLARE_GET_SET_METHODS(Class, T, __get__, __set__) \
DECLARE_GET_METHOD(Class, /*T,*/ __get__) \
DECLARE_SET_METHOD(Class, T, __set__)

namespace QScript
{

enum {
    UserOwnership = 1
};

} // namespace QScript

#endif // QTSCRIPTEXTENSIONS_GLOBAL_H