Mercurial > projects > qtd
annotate include/qtd_core.h @ 242:f2f4c9cbadc2
Fix #28.
You cannot build in the sources folder by default but can override this behavior using ALLOW_IN_SOURCE_BUILDS option. However, in this case you'll have to use 'cmake . && make' instead of make. Otherwise, the generator won't start.
author | SokoL_SD |
---|---|
date | Mon, 20 Jul 2009 09:33:10 +0000 |
parents | 3aa118a9ae71 |
children | 7664de4a55e5 |
rev | line source |
---|---|
1 | 1 /** |
2 * | |
3 * Copyright: Copyright QtD Team, 2008-2009 | |
4 * License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a> | |
5 * | |
6 * Copyright QtD Team, 2008-2009 | |
7 * Distributed under the Boost Software License, Version 1.0. | |
8 * (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
9 * | |
10 */ | |
11 | |
12 #ifndef QTD_CORE_H | |
13 #define QTD_CORE_H | |
14 | |
15 #include <QAbstractItemModel> | |
16 | |
17 #if defined WIN32 | |
18 #define DLL_PUBLIC __declspec(dllexport) | |
19 #else | |
20 #define DLL_PUBLIC | |
21 #endif | |
22 | |
23 #ifdef CPP_SHARED | |
24 #define QTD_EXPORT(TYPE, NAME, ARGS) \ | |
25 extern "C" typedef TYPE (*pf_##NAME)ARGS; \ | |
26 extern "C" pf_##NAME qtd_get_##NAME(); | |
27 #define QTD_EXPORT_VAR(NAME) \ | |
28 pf_##NAME m_##NAME; \ | |
29 extern "C" DLL_PUBLIC pf_##NAME qtd_get_##NAME() { return m_##NAME; } | |
30 #define QTD_EXPORT_VAR_SET(NAME, VALUE) \ | |
31 m_##NAME = (pf_##NAME) VALUE | |
32 #else | |
33 #define QTD_EXPORT(TYPE, NAME, ARGS) \ | |
34 extern "C" TYPE NAME ARGS; | |
35 #endif | |
36 | |
37 struct QModelIndexAccessor { | |
38 int row; | |
39 int col; | |
40 void *ptr; | |
41 QAbstractItemModel *model; | |
42 }; | |
43 | |
44 struct DArray { | |
45 size_t length; | |
46 void* ptr; | |
47 }; | |
48 | |
105
3aa118a9ae71
each QObject now has associated child QObject for handling signals. fixes #15
eldar
parents:
35
diff
changeset
|
49 const uint USER_DATA_ID = 0; |
3aa118a9ae71
each QObject now has associated child QObject for handling signals. fixes #15
eldar
parents:
35
diff
changeset
|
50 |
33
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
51 #define Array DArray |
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
52 |
1 | 53 #ifdef CPP_SHARED |
54 typedef void (*pfunc_abstr)(); | |
55 #endif | |
56 | |
57 QTD_EXPORT(void, _d_toUtf8, (const unsigned short* arr, uint size, void* str)) | |
58 QTD_EXPORT(void, __qtd_dummy, ()) | |
59 | |
60 #ifdef CPP_SHARED | |
61 #define _d_toUtf8 qtd_get__d_toUtf8() | |
62 #define __qtd_dummy qtd_get___qtd_dummy() | |
63 #endif | |
64 | |
65 extern "C" QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia); | |
66 extern "C" QModelIndexAccessor qtd_from_QModelIndex(const QModelIndex &index); | |
67 | |
68 #endif // QTD_CORE_H |