mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-08 18:39:54 +00:00
The MiniObject.CreateNativeObject method does not and can't have parameters
This commit is contained in:
parent
74756f2c2a
commit
0efb6ed587
1 changed files with 8 additions and 1 deletions
|
@ -32,6 +32,7 @@ namespace GtkSharp.Generation {
|
|||
private bool preferred;
|
||||
private string name;
|
||||
private bool needs_chaining = false;
|
||||
private bool mini_object = false;
|
||||
|
||||
public Ctor (XmlElement elem, ClassBase implementor) : base (elem, implementor)
|
||||
{
|
||||
|
@ -40,6 +41,7 @@ namespace GtkSharp.Generation {
|
|||
if (implementor is ObjectGen || implementor is MiniObjectGen)
|
||||
needs_chaining = true;
|
||||
name = implementor.Name;
|
||||
mini_object = implementor is MiniObjectGen;
|
||||
}
|
||||
|
||||
public bool Preferred {
|
||||
|
@ -110,9 +112,14 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine ("\t\t\tif (GetType () != typeof (" + name + ")) {");
|
||||
|
||||
if (Parameters.Count == 0) {
|
||||
sw.WriteLine ("\t\t\t\tCreateNativeObject (new string [0], new GLib.Value[0]);");
|
||||
if (mini_object)
|
||||
sw.WriteLine ("\t\t\t\tCreateNativeObject ();");
|
||||
else
|
||||
sw.WriteLine ("\t\t\t\tCreateNativeObject (new string [0], new GLib.Value[0]);");
|
||||
sw.WriteLine ("\t\t\t\treturn;");
|
||||
} else {
|
||||
if (mini_object)
|
||||
throw new Exception ("MiniObject subclasses can't have ctors with parameters");
|
||||
ArrayList names = new ArrayList ();
|
||||
ArrayList values = new ArrayList ();
|
||||
for (int i = 0; i < Parameters.Count; i++) {
|
||||
|
|
Loading…
Reference in a new issue