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
|
|
49 #ifdef CPP_SHARED
|
|
50 typedef void (*pfunc_abstr)();
|
|
51 #endif
|
|
52
|
|
53 QTD_EXPORT(void, _d_toUtf8, (const unsigned short* arr, uint size, void* str))
|
|
54 QTD_EXPORT(void, __qtd_dummy, ())
|
|
55
|
|
56 #ifdef CPP_SHARED
|
|
57 #define _d_toUtf8 qtd_get__d_toUtf8()
|
|
58 #define __qtd_dummy qtd_get___qtd_dummy()
|
|
59 #endif
|
|
60
|
|
61 extern "C" QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia);
|
|
62 extern "C" QModelIndexAccessor qtd_from_QModelIndex(const QModelIndex &index);
|
|
63
|
|
64 #endif // QTD_CORE_H
|