comparison generator/cppimplgenerator.cpp @ 39:a5cba313c924

network and webkit are wrapped now
author eldar
date Sun, 17 May 2009 01:44:06 +0000
parents 8022ef40f110
children a5cc4ada07f5
comparison
equal deleted inserted replaced
38:08631ce8e46a 39:a5cba313c924
941 { 941 {
942 QString d_name = d_type->typeEntry()->qualifiedCppName(); 942 QString d_name = d_type->typeEntry()->qualifiedCppName();
943 s << d_name + "_ConcreteWrapper" + QString(d_type->indirections(),'*'); 943 s << d_name + "_ConcreteWrapper" + QString(d_type->indirections(),'*');
944 } 944 }
945 else 945 else
946 s << translateType(d_type, EnumAsInts); 946 s << translateType(d_type, EnumAsInts, d_export);
947 } 947 }
948 else 948 else
949 s << "void*"; 949 s << "void*";
950 s << " " << argument->indexedName(); 950 s << " " << argument->indexedName();
951 } 951 }
3188 3188
3189 QString cls_name = getTypeName(targ->typeEntry(), EnumAsInts); 3189 QString cls_name = getTypeName(targ->typeEntry(), EnumAsInts);
3190 cls_name.remove("_ConcreteWrapper"); 3190 cls_name.remove("_ConcreteWrapper");
3191 3191
3192 s << endl 3192 s << endl
3193 << INDENT << "{" << endl // qtd2 hack, additional scope for avoiding duplicating of "i"
3193 << INDENT; 3194 << INDENT;
3194 3195
3195 switch (type->type()) { 3196 switch (type->type()) {
3196 case ContainerTypeEntry::LinkedListContainer: 3197 case ContainerTypeEntry::LinkedListContainer:
3197 case ContainerTypeEntry::QueueContainer: 3198 case ContainerTypeEntry::QueueContainer:
3233 writeQtToJava(s, targ, "__qt_tmp", "__java_tmp", 0, -1, BoxedPrimitive); 3234 writeQtToJava(s, targ, "__qt_tmp", "__java_tmp", 0, -1, BoxedPrimitive);
3234 3235
3235 s << INDENT << "qtd_assign_" << cls_name << "_array_element(" << java_name << ", i, __java_tmp);" << endl; 3236 s << INDENT << "qtd_assign_" << cls_name << "_array_element(" << java_name << ", i, __java_tmp);" << endl;
3236 s << INDENT << "++i;" << endl; 3237 s << INDENT << "++i;" << endl;
3237 } 3238 }
3238 s << INDENT << "}" << endl; 3239 s << INDENT << "}" << endl
3240 << INDENT << "}" << endl;
3239 3241
3240 } else if (type->type() == ContainerTypeEntry::PairContainer) { 3242 } else if (type->type() == ContainerTypeEntry::PairContainer) {
3241 QList<AbstractMetaType *> args = java_type->instantiations(); 3243 QList<AbstractMetaType *> args = java_type->instantiations();
3242 Q_ASSERT(args.size() == 2); 3244 Q_ASSERT(args.size() == 2);
3243 3245
3649 || java_type->isVariant() 3651 || java_type->isVariant()
3650 || java_type->isJObjectWrapper() 3652 || java_type->isJObjectWrapper()
3651 || java_type->isTargetLangChar()) { 3653 || java_type->isTargetLangChar()) {
3652 return d_name; 3654 return d_name;
3653 } else if (java_type->isArray()) { 3655 } else if (java_type->isArray()) {
3654 return java_type->arrayElementType()->name() + "*"; 3656 if (d_export)
3657 return java_type->arrayElementType()->name() + "*";
3658 else
3659 return java_type->arrayElementType()->typeEntry()->qualifiedCppName() + "*";
3655 } else if (java_type->isIntegerEnum() || java_type->isIntegerFlags() 3660 } else if (java_type->isIntegerEnum() || java_type->isIntegerFlags()
3656 || ((option & EnumAsInts) && (java_type->isEnum() || java_type->isFlags()))) { 3661 || ((option & EnumAsInts) && (java_type->isEnum() || java_type->isFlags()))) {
3657 return "int"; 3662 return "int";
3658 } else if (java_type->isReference()) { 3663 } else if (java_type->isReference()) {
3659 if (java_type->typeEntry()->isValue()) 3664 if (java_type->typeEntry()->isValue())