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 #include "qtd_core.h"
|
|
13 #include <iostream>
|
|
14
|
253
|
15
|
|
16 extern "C" DLL_PUBLIC void* qtd_qobject(void* parent)
|
|
17 {
|
|
18 return new QObject((QObject*)parent);
|
|
19 }
|
|
20
|
1
|
21 extern "C" DLL_PUBLIC QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia)
|
|
22 {
|
|
23 return * (QModelIndex *) (&mia) ;
|
|
24 }
|
|
25
|
|
26 extern "C" DLL_PUBLIC QModelIndexAccessor qtd_from_QModelIndex(const QModelIndex &index)
|
|
27 {
|
|
28 QModelIndexAccessor mia = {
|
|
29 index.row(),
|
|
30 index.column(),
|
|
31 index.internalPointer(),
|
|
32 (QAbstractItemModel *) index.model()
|
|
33 };
|
|
34
|
|
35 return mia;
|
|
36 }
|
|
37
|
247
|
38 extern "C" DLL_PUBLIC const char* qtd_qVersion()
|
|
39 {
|
|
40 return qVersion();
|
|
41 }
|
|
42
|
|
43 extern "C" DLL_PUBLIC bool qtd_qSharedBuild()
|
|
44 {
|
|
45 return qSharedBuild();
|
|
46 }
|
|
47
|
1
|
48 #ifdef CPP_SHARED
|
253
|
49 QTD_EXPORT_VAR(qtd_toUtf8);
|
|
50 QTD_EXPORT_VAR(qtd_dummy);
|
1
|
51
|
253
|
52 extern "C" DLL_PUBLIC void qtd_core_initCallBacks(pfunc_abstr d_func, pfunc_abstr dummy) {
|
|
53 QTD_EXPORT_VAR_SET(qtd_toUtf8, d_func);
|
|
54 QTD_EXPORT_VAR_SET(qtd_dummy, dummy);
|
|
55 //std::cout << "qtd_core initialized" << std::endl;
|
1
|
56 }
|
|
57 #endif
|
57
|
58
|
|
59 extern bool qRegisterResourceData
|
|
60 (int, const unsigned char *, const unsigned char *, const unsigned char *);
|
|
61
|
|
62 extern bool qUnregisterResourceData
|
|
63 (int, const unsigned char *, const unsigned char *, const unsigned char *);
|
|
64
|
|
65 extern "C" DLL_PUBLIC bool qtd_register_resource_data(int version, const unsigned char *tree,
|
|
66 const unsigned char *name, const unsigned char *data)
|
|
67 {
|
|
68 return qRegisterResourceData(version, tree, name, data);
|
|
69 }
|
|
70
|
|
71 extern "C" DLL_PUBLIC bool qtd_unregister_resource_data(int version, const unsigned char *tree,
|
|
72 const unsigned char *name, const unsigned char *data)
|
|
73 {
|
|
74 return qUnregisterResourceData(version, tree, name, data);
|
|
75 }
|