Mercurial > projects > qtd
comparison generator/dgenerator.cpp @ 284:1f6923c8cba0
consistent emit syntax.
author | eldar |
---|---|
date | Fri, 16 Oct 2009 12:23:12 +0000 |
parents | 519befd5a5d1 |
children | f9559a957be9 |
comparison
equal
deleted
inserted
replaced
283:b61a413fc2f5 | 284:1f6923c8cba0 |
---|---|
981 QString functionName = d_function->isConstructor() ? "this" : d_function->name(); // qtd | 981 QString functionName = d_function->isConstructor() ? "this" : d_function->name(); // qtd |
982 // The actual function | 982 // The actual function |
983 if (!(d_function->isEmptyFunction() || d_function->isNormal() || d_function->isSignal())) | 983 if (!(d_function->isEmptyFunction() || d_function->isNormal() || d_function->isSignal())) |
984 option = Option(option | SkipReturnType); | 984 option = Option(option | SkipReturnType); |
985 writeFunctionAttributes(s, d_function, included_attributes, excluded_attributes, option); | 985 writeFunctionAttributes(s, d_function, included_attributes, excluded_attributes, option); |
986 | 986 /* |
987 if(d_function->isSignal()) | 987 if(d_function->isSignal()) |
988 functionName += "_emit"; | 988 functionName += "_emit"; |
989 | 989 */ |
990 s << functionName << "("; | 990 s << functionName << "("; |
991 writeFunctionArguments(s, d_function, argument_count, option); | 991 writeFunctionArguments(s, d_function, argument_count, option); |
992 s << ")"; | 992 s << ")"; |
993 | 993 |
994 return result; | 994 return result; |
1769 << "(cast(void*)(" << arg_ptr << "), QtdObjectFlags.nativeOwnership);" << endl; | 1769 << "(cast(void*)(" << arg_ptr << "), QtdObjectFlags.nativeOwnership);" << endl; |
1770 } | 1770 } |
1771 s << endl; | 1771 s << endl; |
1772 } | 1772 } |
1773 // s << INDENT << "Stdout(\"" << d_class->name() << "\", \"" << signal->name() << "\").newline;" << endl; | 1773 // s << INDENT << "Stdout(\"" << d_class->name() << "\", \"" << signal->name() << "\").newline;" << endl; |
1774 s << INDENT << "d_object." << signal->name() << ".emit("; | 1774 s << INDENT << "d_object." << signal->name() << "_emit("; |
1775 for (int j = 0; j<sz; ++j) { | 1775 for (int j = 0; j<sz; ++j) { |
1776 AbstractMetaArgument *argument = arguments.at(j); | 1776 AbstractMetaArgument *argument = arguments.at(j); |
1777 QString arg_name = argument->indexedName(); | 1777 QString arg_name = argument->indexedName(); |
1778 if (j != 0) | 1778 if (j != 0) |
1779 s << ", "; | 1779 s << ", "; |
2815 Q_ASSERT(d_function->isSignal()); | 2815 Q_ASSERT(d_function->isSignal()); |
2816 | 2816 |
2817 AbstractMetaArgumentList arguments = d_function->arguments(); | 2817 AbstractMetaArgumentList arguments = d_function->arguments(); |
2818 int sz = arguments.count(); | 2818 int sz = arguments.count(); |
2819 | 2819 |
2820 s << INDENT << "mixin Signal!(\"" << d_function->name() << "\""; | 2820 s << INDENT << "mixin BindQtSignal!(\"" << d_function->name() << "\""; |
2821 | 2821 |
2822 if (sz > 0) { | 2822 if (sz > 0) { |
2823 for (int i=0; i<sz; ++i) { | 2823 for (int i=0; i<sz; ++i) { |
2824 s << ", "; | 2824 s << ", "; |
2825 | 2825 |