mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 13:38:48 +00:00
For signals without parameters use the generic SignalHandler instead of defining a lot of empty types
This commit is contained in:
parent
0d98c86ad6
commit
cd3bf3502c
1 changed files with 16 additions and 12 deletions
|
@ -334,6 +334,7 @@ public class ElementGen {
|
|||
foreach (SignalInfo si in ei.signals) {
|
||||
string managed_name = (si.managed_name != null) ? si.managed_name : PropToCamelCase (si.name);
|
||||
|
||||
if (si.parameters.Count > 0) {
|
||||
writer.WriteLine ("\t\tpublic delegate void " + managed_name + "Handler (object o, " + managed_name + "Args args);\n");
|
||||
|
||||
writer.WriteLine ("\t\tpublic class " + managed_name + "Args : GLib.SignalArgs {");
|
||||
|
@ -345,11 +346,14 @@ public class ElementGen {
|
|||
writer.WriteLine ("\t\t\t\t\treturn (" + managed_type + ") Args[" + i + "];");
|
||||
writer.WriteLine ("\t\t\t\t}");
|
||||
writer.WriteLine ("\t\t\t}\n");
|
||||
|
||||
}
|
||||
writer.WriteLine ("\t\t}\n");
|
||||
|
||||
writer.WriteLine ("\t\tpublic event " + managed_name + "Handler " + managed_name + " {");
|
||||
} else {
|
||||
writer.WriteLine ("\t\tpublic event SignalHandler " + managed_name + " {");
|
||||
}
|
||||
|
||||
writer.WriteLine ("\t\t\tadd {");
|
||||
writer.WriteLine ("\t\t\t\tDynamicSignal.Connect (this, \"" + si.name + "\", value);");
|
||||
writer.WriteLine ("\t\t\t}\n");
|
||||
|
|
Loading…
Reference in a new issue