comparison generator/containergenerator.cpp @ 270:49bfc86ff583

true emit of Qt signals.
author eldar
date Thu, 24 Sep 2009 12:59:48 +0000
parents 34a37904ff77
children 08c1ca7975ab
comparison
equal deleted inserted replaced
269:cc9080066035 270:49bfc86ff583
273 273
274 m_cpp_impl_generator->writeQtToJavaContainer(s, arg_type, "container", "__d_container", 0, -1); 274 m_cpp_impl_generator->writeQtToJavaContainer(s, arg_type, "container", "__d_container", 0, -1);
275 s << "}" << endl; 275 s << "}" << endl;
276 }*/ 276 }*/
277 277
278 s << "// signal conversion functions" << endl;
279
278 foreach(AbstractMetaType* arg_type, signalEntries[cls->package()]) { 280 foreach(AbstractMetaType* arg_type, signalEntries[cls->package()]) {
279 const TypeEntry *te = arg_type->instantiations().first()->typeEntry(); 281 const TypeEntry *te = arg_type->instantiations().first()->typeEntry();
280 s << "// " << te->targetLangName() << endl 282 s << "// " << te->targetLangName() << endl
281 << "extern \"C\" DLL_PUBLIC void " << fromCppContainerName(cls, arg_type) << "(void *cpp_ptr, DArray* __d_container) {" << endl; 283 << "extern \"C\" DLL_PUBLIC void " << cppContainerConversionName(cls, arg_type, FromCpp) << "(void *cpp_ptr, DArray* __d_container) {" << endl;
282 284
283 m_cpp_impl_generator->writeTypeInfo(s, arg_type, NoOption); 285 m_cpp_impl_generator->writeTypeInfo(s, arg_type, NoOption);
284 s << "container = (*reinterpret_cast< "; 286 s << "container = (*reinterpret_cast< ";
285 m_cpp_impl_generator->writeTypeInfo(s, arg_type, ExcludeReference); 287 m_cpp_impl_generator->writeTypeInfo(s, arg_type, ExcludeReference);
286 s << "(*)>(cpp_ptr));" << endl; 288 s << "(*)>(cpp_ptr));" << endl;
405 407
406 foreach(AbstractMetaType* arg_type, signalEntries[cls->package()]) { 408 foreach(AbstractMetaType* arg_type, signalEntries[cls->package()]) {
407 const TypeEntry *te = arg_type->instantiations().first()->typeEntry(); 409 const TypeEntry *te = arg_type->instantiations().first()->typeEntry();
408 if(!te->isPrimitive() && !te->isString()) 410 if(!te->isPrimitive() && !te->isString())
409 writeImportString(s, te); 411 writeImportString(s, te);
410 s << "extern (C) void " << fromCppContainerName(cls, arg_type) << "(void *cpp_ptr, " << te->targetLangName() << "[]* __d_container);" << endl; 412 s << "extern (C) void " << cppContainerConversionName(cls, arg_type, FromCpp) << "(void *cpp_ptr, " << te->targetLangName() << "[]* __d_container);" << endl;
411 } 413 }
412 } 414 }
413 415
414 void ContainerGenerator::writeNotice(QTextStream &s) 416 void ContainerGenerator::writeNotice(QTextStream &s)
415 { 417 {