annotate qt/core/QMetaObject.d @ 337:5896535a03cd

moved enums back to classes
author maxter <spambox@d-coding.com>
date Sat, 13 Mar 2010 00:38:42 +0200
parents b0a7819153bb
children
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 }
323
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
54
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
55 string name() const
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
56 {
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
57 int openBracket = indexOf(signature, '(');
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
58 return signature[0..openBracket];
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
59 }
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
60 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
61
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
62 class QMetaSignal : QMetaMethod
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
63 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
64 this(string signature_, int indexOfMethod_)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
65 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
66 super(signature_, 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 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
69
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
70 class QMetaSlot : QMetaMethod
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
71 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
72 this(string signature_, int indexOfMethod_)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
73 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
74 super(signature_, indexOfMethod_);
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
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
78 class MetaObject : MetaType
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
79 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
80 MetaObject _base;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
81 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
82
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
83 struct QMetaObjectNative
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
84 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
85 QMetaObjectNative *superdata;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
86 immutable(char) *stringdata;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
87 const(uint) *data;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
88 void *extradata;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
89 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
90
323
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
91 class QMetaException : Exception { this(string msg) { super(msg); } }
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
92
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
93 final class QMetaObject
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
94 {
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
95 enum Call
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
96 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
97 InvokeMetaMethod,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
98 ReadProperty,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
99 WriteProperty,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
100 ResetProperty,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
101 QueryPropertyDesignable,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
102 QueryPropertyScriptable,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
103 QueryPropertyStored,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
104 QueryPropertyEditable,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
105 QueryPropertyUser,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
106 CreateInstance
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
107 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
108
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
109 private
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
110 {
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
111 QMetaObjectNative* _nativeId;
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
112 QMetaObject _base; // super class
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
113 QMetaObject _firstDerived; // head of the linked list of derived classes
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
114 QMetaObject _next; // next sibling on this derivation level
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
115 QMetaMethod[] _methods;
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
116 ClassInfo _classInfo;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
117
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
118 QObject function(void* nativeId) _createWrapper;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
119 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
120
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
121 private void addDerived(QMetaObject mo)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
122 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
123 mo._next = _firstDerived;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
124 _firstDerived = mo;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
125 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
126
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
127 // 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
128 this(QMetaObjectNative* nativeId, QMetaObject base)
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
129 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
130 _nativeId = nativeId;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
131 if (base)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
132 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
133 base.addDerived(this);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
134 _base = base;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
135 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
136 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
137
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
138 // TODO: remove when D acquires templated constructors
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
139 void construct(T : QObject, Concrete = T)()
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
140 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
141 _classInfo = T.classinfo;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
142
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
143 _createWrapper = function QObject(void* nativeId) {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
144 // COMPILER BUG: cast is should not be needed
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
145 auto obj = new Concrete(nativeId, cast(QtdObjectFlags)(QtdObjectFlags.nativeOwnership | QtdObjectFlags.dynamicEntity));
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
146 // TODO: Probably this should be a virtual call from T's constructor
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
147 T.__createEntity(nativeId, cast(void*)obj);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
148 return obj;
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 /++
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
153 +/
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
154 QMetaObject base()
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
155 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
156 return _base;
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 +/
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
161 QMetaObjectNative* nativeId()
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
162 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
163 return _nativeId;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
164 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
165
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
166 /++
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
167 +/
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
168 ClassInfo classInfo()
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
169 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
170 return _classInfo;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
171 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
172
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
173 const (QMetaMethod[]) methods()
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
174 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
175 return _methods;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
176 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
177
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
178 void addMethod(QMetaMethod method_)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
179 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
180 _methods ~= method_;
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
181 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
182
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 QMetaMethod lookUpMethod(string slot)
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 foreach (method; _methods)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
186 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
187 return method;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
188 if (_base)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
189 return _base.lookUpMethod(slot);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
190 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
191 return null;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
192 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
193
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 QMetaSignal lookUpSignal(string signal)
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
195 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
196 foreach (method; _methods)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
197 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
198 return cast(QMetaSignal)method;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
199 if (_base)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
200 return _base.lookUpSignal(signal);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
201 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
202 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
203 }
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
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 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
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 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
208 foreach (method; _methods)
323
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
209 if (method.name == methodName)
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
210 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
211 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
212 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
213 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
214 }
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
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 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
217 {
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
218 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
219 foreach (method; _methods)
323
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
220 if (method.name == signalName && 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
221 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
222 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
223 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
224 return result;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
225 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
226
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
227 private QMetaObject lookupDerived(void*[] moIds)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
228 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
229 assert (moIds.length >= 1);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
230
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
231 for (auto mo = _firstDerived; mo !is null; mo = mo._next)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
232 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
233 if (mo._nativeId == moIds[0])
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
234 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
235 if (moIds.length == 1) // exact match found
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
236 return mo;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
237 else // look deeper
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
238 return mo.lookupDerived(moIds[1..$]);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
239 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
240 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
241
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
242 // no initialized wrapper that matches the native object.
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
243 // use the base class wrapper
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
244 return this;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
245 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
246
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
247 QObject getObject(void* nativeObjId)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
248 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
249 QObject result;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
250
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
251 if (nativeObjId)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
252 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
253 result = cast(QObject)qtd_get_d_qobject(nativeObjId);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
254 if (!result)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
255 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
256 auto moId = qtd_QObject_metaObject(nativeObjId);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
257 if (_nativeId == moId)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
258 result = _createWrapper(nativeObjId);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
259 else
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
260 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
261 // get native metaobjects for the entire derivation lattice
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
262 // up to, but not including, the current metaobject.
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
263 size_t moCount = 1;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
264
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
265 for (void* tmp = moId;;)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
266 {
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
267 tmp = qtd_QMetaObject_superClass(tmp);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
268 assert(tmp);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
269 if (tmp == _nativeId)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
270 break;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
271 moCount++;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
272 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
273
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
274 void*[] moIds = (cast(void**)alloca(moCount * (void*).sizeof))[0..moCount];
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
275
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
276 moIds[--moCount] = moId;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
277 while (moCount > 0)
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
278 moIds[--moCount] = moId = qtd_QMetaObject_superClass(moId);
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
279
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
280 result = lookupDerived(moIds)._createWrapper(nativeObjId);
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
281 }
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
282 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
283 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
284
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
285 return result;
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
286 }
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
287
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
288 static void activate(QObject sender, QMetaObject m, int local_signal_index, void **argv)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
289 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
290 qtd_QMetaObject_activate_3(sender.__nativeId, m.nativeId, local_signal_index, argv);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
291 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
292
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
293 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
294 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
295 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
296 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
297
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
298 static bool connect(const QObject sender, int signal_index,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
299 const QObject receiver, int method_index,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
300 int type = 0, int *types = null)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
301 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
302 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
303 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
304
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
305 int indexOfMethod_Cpp(string method)
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
306 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
307 return qtd_QMetaObject_indexOfMethod(_nativeId, toStringz(method));
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
308 }
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
309
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
310 int methodCount()
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
311 {
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
312 return qtd_QMetaObject_methodCount(_nativeId);
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
337
5896535a03cd moved enums back to classes
maxter <spambox@d-coding.com>
parents: 336
diff changeset
315 static void connectImpl(QObject sender, string signalString, QObject receiver, string methodString, int type)
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
316 {
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 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
318 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
319 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
320 QMetaMethod method;
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
321
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
322 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
323 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
324 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
325 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
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 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
328 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
329 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
330 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
331
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 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
333 {
323
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
334 Top:
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
335 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
336 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
337 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
338 {
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 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
340 method = meth;
323
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
341 break Top;
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
342 }
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 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
345 {
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 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
347 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
348 {
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 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
350 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
351 }
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 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
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 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
356 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
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 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
359 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
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 }
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
323
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
363 bool success = false;
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
364
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
365 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
366 {
323
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
367 success = false;
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
368 }
323
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
369 else
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
370 {
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
371 int signalIndex = signal.indexOfMethod;
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
372 int methodIndex = method.indexOfMethod;
337
5896535a03cd moved enums back to classes
maxter <spambox@d-coding.com>
parents: 336
diff changeset
373 success = QMetaObject.connect(sender, signalIndex, receiver, methodIndex, type);
323
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
374 }
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
375
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
376 if(!success)
7a3c43424dca make all examples compile with new signals/slots
eldar_ins@eldar-laptop
parents: 322
diff changeset
377 throw new QMetaException("QMetaObject: Signal " ~ signalString ~ " and slot " ~ methodString ~ " cannot be found");
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
378 }
253
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
379 }
073b9153ed8a Rev. 264 done right.
maxter
parents:
diff changeset
380
288
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
381 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
382 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
383 extern(C) bool qtd_QMetaObject_connect(const void* sender, int signal_index,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
384 const void* receiver, int method_index,
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
385 int type, int *types);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
386
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
387 extern(C) int qtd_QMetaObject_indexOfMethod(void *nativeId, const(char) *method);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
388 extern(C) int qtd_QMetaObject_methodCount(void *nativeId);
f9559a957be9 new signals and slots implementation
eldar
parents: 253
diff changeset
389
337
5896535a03cd moved enums back to classes
maxter <spambox@d-coding.com>
parents: 336
diff changeset
390 extern(C) void* qtd_QMetaObject_superClass(void* nativeId);