Mercurial > projects > qtd
annotate include/qtd_core.h @ 334:ed7018b63aa7 signals
merge 2
author | eldar1@eldar1-laptop |
---|---|
date | Sun, 07 Feb 2010 15:46:06 +0000 |
parents | 98b211f3ee34 |
children | 18bd68f586c6 |
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 | |
254 | 24 #define QTD_EXPORT(TYPE, NAME, ARGS) \ |
1 | 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; } | |
254 | 30 #define QTD_EXPORT_VAR_SET(NAME, VALUE) \ |
1 | 31 m_##NAME = (pf_##NAME) VALUE |
32 #else | |
254 | 33 #define QTD_EXPORT(TYPE, NAME, ARGS) \ |
1 | 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 | |
254 | 49 enum QtdObjectFlags |
50 { | |
51 qNone, | |
52 qNativeOwnership = 0x01, | |
53 qDOwnership = 0x02 | |
54 //gcManaged = 0x04 | |
55 }; | |
56 | |
57 class QtD_Entity | |
58 { | |
59 public: | |
60 void* dId; | |
61 | |
62 QtD_Entity(void* id) : dId(id) | |
63 { | |
64 } | |
65 }; | |
105
3aa118a9ae71
each QObject now has associated child QObject for handling signals. fixes #15
eldar
parents:
35
diff
changeset
|
66 |
33
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
67 #define Array DArray |
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
68 |
1 | 69 #ifdef CPP_SHARED |
70 typedef void (*pfunc_abstr)(); | |
71 #endif | |
72 | |
254 | 73 QTD_EXPORT(void, qtd_toUtf8, (const unsigned short* arr, uint size, void* str)) |
74 QTD_EXPORT(void, qtd_dummy, ()) | |
1 | 75 |
76 #ifdef CPP_SHARED | |
254 | 77 #define qtd_toUtf8 qtd_get_qtd_toUtf8() |
78 #define qtd_dummy qtd_get_qtd_dummy() | |
1 | 79 #endif |
80 | |
81 extern "C" QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia); | |
82 extern "C" QModelIndexAccessor qtd_from_QModelIndex(const QModelIndex &index); | |
83 | |
301 | 84 extern "C" typedef void (*EmitCallback)(void*, void**); |
85 extern "C" typedef int (*QtMetacallCallback)(void *d_entity, QMetaObject::Call _c, int _id, void **_a); | |
303 | 86 extern "C" typedef const QMetaObject* (*MetaObjectCallback)(void *d_entity); |
301 | 87 |
298
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
254
diff
changeset
|
88 template <class T> |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
254
diff
changeset
|
89 void call_destructor(T *a) |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
254
diff
changeset
|
90 { |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
254
diff
changeset
|
91 a->~T(); |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
254
diff
changeset
|
92 } |
1 | 93 #endif // QTD_CORE_H |