annotate qt/core/QMetaObject.d @ 322:7c2cf27391c4 signals

A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
author eldar_ins@eldar-laptop
date Sun, 27 Dec 2009 21:13:38 +0500
parents f9559a957be9
children 7a3c43424dca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
1 module qt.core.QMetaObject;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
2
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
3 import qt.QGlobal;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
4 import qt.core.QObject;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
5 import qt.QtdObject;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
6
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
7 import std.algorithm;
322
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
8 import std.string;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
9 import std.stdio;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
10
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
11 class Meta
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
12 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
13 string name;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
14 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
15
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
16 class MetaType : Meta
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
17 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
18 this()
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
19 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
20 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
21 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
22
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
23 class MetaVariable : Meta
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
24 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
25 MetaType type;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
26 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
27
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
28 class MetaCallable : Meta { }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
29
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
30 class MetaMethod : Meta { }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
31
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
32 class QMetaArgument : MetaVariable { }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
33
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
34 class QMetaMethod : MetaMethod
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
35 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
36 // QMetaArgument[] arguments;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
37 string signature;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
38 int indexOfMethod;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
39
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
40 this(string signature_, int indexOfMethod_)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
41 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
42 signature = signature_;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
43 indexOfMethod = indexOfMethod_;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
44 }
322
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
45
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
46 string args() const
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
47 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
48 int openBracket = indexOf(signature, '(');
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
49 if(signature.length - openBracket - 2 > 0)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
50 return signature[openBracket + 1 .. $-1];
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
51 else
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
52 return "";
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
53 }
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
54 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
55
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
56 class QMetaSignal : QMetaMethod
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
57 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
58 this(string signature_, int indexOfMethod_)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
59 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
60 super(signature_, indexOfMethod_);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
61 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
62 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
63
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
64 class QMetaSlot : QMetaMethod
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
65 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
66 this(string signature_, int indexOfMethod_)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
67 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
68 super(signature_, indexOfMethod_);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
69 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
70 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
71
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
72 class MetaObject : MetaType
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
73 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
74 MetaObject _base;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
75 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
76
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
77 struct QMetaObjectNative
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
78 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
79 QMetaObjectNative *superdata;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
80 immutable(char) *stringdata;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
81 const(uint) *data;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
82 void *extradata;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
83 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
84
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
85 final class QMetaObject
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
86 {
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
87 enum Call
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
88 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
89 InvokeMetaMethod,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
90 ReadProperty,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
91 WriteProperty,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
92 ResetProperty,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
93 QueryPropertyDesignable,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
94 QueryPropertyScriptable,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
95 QueryPropertyStored,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
96 QueryPropertyEditable,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
97 QueryPropertyUser,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
98 CreateInstance
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
99 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
100
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
101 private
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
102 {
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
103 QMetaObjectNative* _nativeId;
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
104 QMetaObject _base; // super class
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
105 QMetaObject _firstDerived; // head of the linked list of derived classes
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
106 QMetaObject _next; // next sibling on this derivation level
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
107 QMetaMethod[] _methods;
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
108 ClassInfo _classInfo;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
109
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
110 QObject function(void* nativeId) _createWrapper;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
111 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
112
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
113 private void addDerived(QMetaObject mo)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
114 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
115 mo._next = _firstDerived;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
116 _firstDerived = mo;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
117 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
118
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
119 // NOTE: construction is split between this non-templated constructor and 'construct' function below.
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
120 this(QMetaObjectNative* nativeId, QMetaObject base)
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
121 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
122 _nativeId = nativeId;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
123 if (base)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
124 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
125 base.addDerived(this);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
126 _base = base;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
127 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
128 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
129
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
130 // TODO: remove when D acquires templated constructors
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
131 void construct(T : QObject, Concrete = T)()
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
132 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
133 _classInfo = T.classinfo;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
134
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
135 _createWrapper = function QObject(void* nativeId) {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
136 // COMPILER BUG: cast is should not be needed
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
137 auto obj = new Concrete(nativeId, cast(QtdObjectFlags)(QtdObjectFlags.nativeOwnership | QtdObjectFlags.dynamicEntity));
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
138 // TODO: Probably this should be a virtual call from T's constructor
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
139 T.__createEntity(nativeId, cast(void*)obj);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
140 return obj;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
141 };
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
142 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
143
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
144 /++
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
145 +/
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
146 QMetaObject base()
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
147 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
148 return _base;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
149 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
150
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
151 /++
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
152 +/
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
153 QMetaObjectNative* nativeId()
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
154 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
155 return _nativeId;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
156 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
157
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
158 /++
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
159 +/
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
160 ClassInfo classInfo()
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
161 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
162 return _classInfo;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
163 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
164
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
165 const (QMetaMethod[]) methods()
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
166 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
167 return _methods;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
168 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
169
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
170 void addMethod(QMetaMethod method_)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
171 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
172 _methods ~= method_;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
173 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
174
322
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
175 QMetaMethod lookUpMethod(string slot)
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
176 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
177 foreach (method; _methods)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
178 if (method.signature == slot)
322
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
179 return method;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
180 if (_base)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
181 return _base.lookUpMethod(slot);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
182 else
322
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
183 return null;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
184 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
185
322
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
186 QMetaSignal lookUpSignal(string signal)
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
187 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
188 foreach (method; _methods)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
189 if (method.signature == signal && cast(QMetaSignal)method)
322
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
190 return cast(QMetaSignal)method;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
191 if (_base)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
192 return _base.lookUpSignal(signal);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
193 else
322
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
194 return null;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
195 }
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
196
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
197 QMetaMethod[] lookUpMethodOverloads(string methodName)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
198 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
199 typeof(return) result;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
200 foreach (method; _methods)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
201 if (startsWith(method.signature, methodName))
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
202 result ~= method;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
203 if (_base)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
204 result ~= _base.lookUpMethodOverloads(methodName);
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
205 return result;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
206 }
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
207
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
208 QMetaSignal[] lookUpSignalOverloads(string signalName)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
209 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
210 typeof(return) result;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
211 foreach (method; _methods)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
212 if (startsWith(method.signature, signalName) && cast(QMetaSignal)method)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
213 result ~= cast(QMetaSignal)method;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
214 if (_base)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
215 result ~= _base.lookUpSignalOverloads(signalName);
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
216 return result;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
217 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
218
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
219 private QMetaObject lookupDerived(void*[] moIds)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
220 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
221 assert (moIds.length >= 1);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
222
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
223 for (auto mo = _firstDerived; mo !is null; mo = mo._next)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
224 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
225 if (mo._nativeId == moIds[0])
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
226 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
227 if (moIds.length == 1) // exact match found
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
228 return mo;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
229 else // look deeper
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
230 return mo.lookupDerived(moIds[1..$]);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
231 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
232 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
233
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
234 // no initialized wrapper that matches the native object.
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
235 // use the base class wrapper
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
236 return this;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
237 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
238
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
239 QObject getObject(void* nativeObjId)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
240 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
241 QObject result;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
242
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
243 if (nativeObjId)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
244 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
245 result = cast(QObject)qtd_get_d_qobject(nativeObjId);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
246 if (!result)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
247 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
248 auto moId = qtd_QObject_metaObject(nativeObjId);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
249 if (_nativeId == moId)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
250 result = _createWrapper(nativeObjId);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
251 else
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
252 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
253 // get native metaobjects for the entire derivation lattice
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
254 // up to, but not including, the current metaobject.
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
255 size_t moCount = 1;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
256
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
257 for (void* tmp = moId;;)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
258 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
259 tmp = qtd_QMetaObject_superClass(tmp);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
260 assert(tmp);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
261 if (tmp == _nativeId)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
262 break;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
263 moCount++;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
264 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
265
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
266 void*[] moIds = (cast(void**)alloca(moCount * (void*).sizeof))[0..moCount];
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
267
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
268 moIds[--moCount] = moId;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
269 while (moCount > 0)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
270 moIds[--moCount] = moId = qtd_QMetaObject_superClass(moId);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
271
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
272 result = lookupDerived(moIds)._createWrapper(nativeObjId);
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
273 }
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
274 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
275 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
276
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
277 return result;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
278 }
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
279
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
280 static void activate(QObject sender, QMetaObject m, int local_signal_index, void **argv)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
281 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
282 qtd_QMetaObject_activate_3(sender.__nativeId, m.nativeId, local_signal_index, argv);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
283 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
284
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
285 static void activate(QObject sender, QMetaObject m, int from_local_signal_index, int to_local_signal_index, void **argv)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
286 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
287 qtd_QMetaObject_activate_4(sender.__nativeId, m.nativeId, from_local_signal_index, to_local_signal_index, argv);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
288 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
289
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
290 static bool connect(const QObject sender, int signal_index,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
291 const QObject receiver, int method_index,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
292 int type = 0, int *types = null)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
293 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
294 return qtd_QMetaObject_connect(sender.__nativeId, signal_index, receiver.__nativeId, method_index, type, types);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
295 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
296
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
297 int indexOfMethod_Cpp(string method)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
298 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
299 return qtd_QMetaObject_indexOfMethod(_nativeId, toStringz(method));
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
300 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
301
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
302 int methodCount()
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
303 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
304 return qtd_QMetaObject_methodCount(_nativeId);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
305 }
322
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
306
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
307 static bool connectImpl(QObject sender, string signalString, QObject receiver, string methodString)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
308 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
309 QMetaSignal[] signals;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
310 QMetaMethod[] methods;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
311 QMetaSignal signal;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
312 QMetaMethod method;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
313
322
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
314
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
315 if(indexOf(signalString, '(') > 0)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
316 signal = sender.metaObject.lookUpSignal(signalString);
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
317 else
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
318 signals = sender.metaObject.lookUpSignalOverloads(signalString); // parameters not specified. Looking for a match
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
319
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
320 if(indexOf(methodString, '(') > 0)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
321 method = receiver.metaObject.lookUpMethod(methodString);
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
322 else
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
323 methods = receiver.metaObject.lookUpMethodOverloads(methodString); // parameters not specified. Looking for a match
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
324
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
325 if(!signal && !method)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
326 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
327 foreach(sig; signals)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
328 foreach(meth; methods)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
329 if(startsWith(sig.args, meth.args))
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
330 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
331 signal = sig;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
332 method = meth;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
333 goto doConnect;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
334 }
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
335 }
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
336 else if (!signal)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
337 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
338 foreach(sig; signals)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
339 if(startsWith(sig.args, method.args))
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
340 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
341 signal = sig;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
342 break;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
343 }
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
344 }
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
345 else if (!method)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
346 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
347 foreach(meth; methods)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
348 if(startsWith(signal.args, meth.args))
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
349 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
350 method = meth;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
351 break;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
352 }
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
353 }
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
354
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
355 doConnect:
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
356 if(!signal && !method)
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
357 {
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
358 writeln(stderr, "QMetaObject: Signal and slots cannot be found");
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
359 return false;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
360 }
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
361 int signalIndex = signal.indexOfMethod;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
362 int methodIndex = method.indexOfMethod;
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
363 return QMetaObject.connect(sender, signalIndex, receiver, methodIndex);
7c2cf27391c4 A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
eldar_ins@eldar-laptop
parents: 288
diff changeset
364 }
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
365 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
366
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
367 extern(C) void qtd_QMetaObject_activate_3(void* sender, void* m, int local_signal_index, void **argv);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
368 extern(C) void qtd_QMetaObject_activate_4(void *sender, void* m, int from_local_signal_index, int to_local_signal_index, void **argv);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
369 extern(C) bool qtd_QMetaObject_connect(const void* sender, int signal_index,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
370 const void* receiver, int method_index,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
371 int type, int *types);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
372
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
373 extern(C) int qtd_QMetaObject_indexOfMethod(void *nativeId, const(char) *method);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
374 extern(C) int qtd_QMetaObject_methodCount(void *nativeId);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
375
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
376 extern(C) void* qtd_QMetaObject_superClass(void* nativeId);