mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
![Mike Kestner](/assets/img/avatar_default.png)
* bootstrap-2.12: bump svn version * generator/CallbackGen.cs: add dnotify support to invoker. Store and respond with incoming UserData params. Start using __prefixed private vars to avoid collisions with parameters, like the 'result' params in gio. * generator/ManagedCallString.cs: use new data/dnotify invoker ctors. * generator/MethodBody.cs: * generator/Parameters.cs: don't link "out" length params to preceding strings. * generator/VMSignature.cs: don't require UserData to be last param, since it can have things like error after it. svn path=/trunk/gtk-sharp/; revision=98782
76 lines
1.9 KiB
C#
76 lines
1.9 KiB
C#
// GtkSharp.Generation.VMSignature.cs - The Virtual Method Signature Generation Class.
|
|
//
|
|
// Author: Mike Kestner <mkestner@ximian.com>
|
|
//
|
|
// Copyright (c) 2003-2004 Novell, Inc.
|
|
//
|
|
// This program is free software; you can redistribute it and/or
|
|
// modify it under the terms of version 2 of the GNU General Public
|
|
// License as published by the Free Software Foundation.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
// General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public
|
|
// License along with this program; if not, write to the
|
|
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
// Boston, MA 02111-1307, USA.
|
|
|
|
|
|
namespace GtkSharp.Generation {
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using System.Xml;
|
|
|
|
public class VMSignature {
|
|
|
|
private ArrayList parms = new ArrayList ();
|
|
|
|
public VMSignature (Parameters parms)
|
|
{
|
|
bool has_cb = parms.HideData;
|
|
for (int i = 1; i < parms.Count; i++) {
|
|
Parameter p = parms [i];
|
|
|
|
if (i > 1 && p.IsLength && parms [i - 1].IsString)
|
|
continue;
|
|
|
|
if (p.IsCount && ((i > 1 && parms [i - 1].IsArray) || (i < parms.Count - 1 && parms [i + 1].IsArray)))
|
|
continue;
|
|
|
|
has_cb = has_cb || p.Generatable is CallbackGen;
|
|
if (p.IsUserData && has_cb)
|
|
continue;
|
|
|
|
if (p.CType == "GError**")
|
|
continue;
|
|
|
|
if (p.Scope == "notified")
|
|
i += 2;
|
|
|
|
this.parms.Add (p);
|
|
}
|
|
}
|
|
|
|
public override string ToString ()
|
|
{
|
|
if (parms.Count == 0)
|
|
return "";
|
|
|
|
string[] result = new string [parms.Count];
|
|
int i = 0;
|
|
|
|
foreach (Parameter p in parms) {
|
|
result [i] = p.PassAs != "" ? p.PassAs + " " : "";
|
|
result [i++] += p.CSType + " " + p.Name;
|
|
}
|
|
|
|
return String.Join (", ", result);
|
|
}
|
|
}
|
|
}
|
|
|