Mercurial > projects > qtd
diff qt/d2/qt/Signal.d @ 289:c9d1aac290e9 signals
clean up of unneeded functionality
author | eldar |
---|---|
date | Mon, 09 Nov 2009 06:54:04 +0000 |
parents | f9559a957be9 |
children | 8627891e4556 |
line wrap: on
line diff
--- a/qt/d2/qt/Signal.d Sun Nov 08 19:28:01 2009 +0000 +++ b/qt/d2/qt/Signal.d Mon Nov 09 06:54:04 2009 +0000 @@ -120,14 +120,9 @@ */ -// need this to mark static metamethods-info whether it's generated by presence of default args -enum DefaultArgs -{ - None, Start, Continue -} // templates for extracting data from static meta-information of signals, slots or properties -// public alias TypeTuple!("name", index, OwnerClass, DefaultArgs.Start, ArgTypes) __signal +// public alias TypeTuple!("name", index, OwnerClass, ArgTypes) __signal template MetaEntryName(source...) { enum MetaEntryName = source[0]; // name of the metaentry is the first element @@ -141,7 +136,7 @@ template MetaEntryArgs(source...) { - alias source[4 .. $] MetaEntryArgs; // arguments-tuple starts from the fourth position + alias source[3 .. $] MetaEntryArgs; // arguments-tuple starts from the fourth position } template TupleWrapper(A...) { alias A at; } @@ -472,31 +467,16 @@ mixin (SignalEmitter!(ArgTypes)(SignalType.NewSignal, getFunc!_Name(fullName), defVals, localIndex)); } } - mixin InsertMetaMethod!(fullName, metaPrefix, index, defValsLength, DefaultArgs.Start, ArgTypes); + mixin InsertMetaMethod!(fullName, metaPrefix, index, defValsLength, ArgTypes); // pragma (msg, ctfe_meta_signal!(ArgTypes)(fullName, index, defValsLength)); } } -template InsertMetaMethod(string fullName, string metaPrefix, int index, int defValsCount, DefaultArgs defArgsInitFlag, ArgTypes...) +template InsertMetaMethod(string fullName, string metaPrefix, int index, int defValsCount, ArgTypes...) { - // this identifies if metamethod is was generated by the presence of default args or not + static if(defValsCount >= 0) + mixin("public alias TypeTuple!(\"" ~ getFunc!_Name(fullName) ~ "\", index, typeof(this), ArgTypes) " ~ metaPrefix ~ toStringNow!(index) ~ ";"); static if(defValsCount > 0) - { - static if (defArgsInitFlag == DefaultArgs.Start) - enum defValsFlag = DefaultArgs.Start; - else - enum defValsFlag = DefaultArgs.Continue; - } - else - { - static if (defArgsInitFlag == DefaultArgs.Start) - enum defValsFlag = DefaultArgs.None; - else - enum defValsFlag = DefaultArgs.Continue; - } - static if(defValsCount >= 0) - mixin("public alias TypeTuple!(\"" ~ getFunc!_Name(fullName) ~ "\", index, typeof(this), defValsFlag, ArgTypes) " ~ metaPrefix ~ toStringNow!(index) ~ ";"); - static if(defValsCount > 0) - mixin InsertMetaMethod!(fullName, metaPrefix, index+1, defValsCount-1, DefaultArgs.Continue, ArgTypes[0..$-1]); + mixin InsertMetaMethod!(fullName, metaPrefix, index+1, defValsCount-1, ArgTypes[0..$-1]); }