2003-05-07 Mike Kestner <mkestner@speakeasy.net>
* generator/ClassBase.cs (GenSignals): remove doc comment param * generator/GenBase.cs (CreateWriter): alter generated file comment * generator/InterfaceGen.cs (CreateWriter): remove doc comments * generator/ObjectGen.cs (Generate): use new GenSignals sig * generator/Signal.cs : make signal marshalers internal and remove doc comments. * generator/SignalHandler.cs : make signal marshalers internal and remove doc comments. * gnome/CanvasProxy.cs : use Gnome.voidObjectSignal since the gtk one is inaccessible now. svn path=/trunk/gtk-sharp/; revision=14385
This commit is contained in:
parent
9f3f9f149a
commit
9e325bd283
8 changed files with 42 additions and 49 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2003-05-07 Mike Kestner <mkestner@speakeasy.net>
|
||||
|
||||
* generator/ClassBase.cs (GenSignals): remove doc comment param
|
||||
* generator/GenBase.cs (CreateWriter): alter generated file comment
|
||||
* generator/InterfaceGen.cs (CreateWriter): remove doc comments
|
||||
* generator/ObjectGen.cs (Generate): use new GenSignals sig
|
||||
* generator/Signal.cs : make signal marshalers internal and remove
|
||||
doc comments.
|
||||
* generator/SignalHandler.cs : make signal marshalers internal and remove
|
||||
doc comments.
|
||||
* gnome/CanvasProxy.cs : use Gnome.voidObjectSignal since the gtk one is
|
||||
inaccessible now.
|
||||
|
||||
2003-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
|
||||
|
||||
* rsvg/Makefile.in:
|
||||
|
|
|
@ -155,14 +155,14 @@ namespace GtkSharp.Generation {
|
|||
}
|
||||
}
|
||||
|
||||
public void GenSignals (StreamWriter sw, ClassBase implementor, bool gen_docs)
|
||||
public void GenSignals (StreamWriter sw, ClassBase implementor)
|
||||
{
|
||||
if (sigs == null)
|
||||
return;
|
||||
|
||||
foreach (Signal sig in sigs.Values) {
|
||||
if (sig.Validate ())
|
||||
sig.Generate (sw, implementor, gen_docs);
|
||||
sig.Generate (sw, implementor);
|
||||
else
|
||||
Console.WriteLine(" in Object " + Name);
|
||||
}
|
||||
|
|
|
@ -77,8 +77,8 @@ namespace GtkSharp.Generation {
|
|||
FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write);
|
||||
StreamWriter sw = new StreamWriter (stream);
|
||||
|
||||
sw.WriteLine ("// Generated File. Do not modify.");
|
||||
sw.WriteLine ("// <c> 2001-2002 Mike Kestner");
|
||||
sw.WriteLine ("// This file was generated by the Gtk# code generator.");
|
||||
sw.WriteLine ("// Any changes made will be lost if regenerated.");
|
||||
sw.WriteLine ();
|
||||
sw.WriteLine ("namespace " + NS + " {");
|
||||
sw.WriteLine ();
|
||||
|
|
|
@ -24,10 +24,6 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine ("\tusing System;");
|
||||
sw.WriteLine ();
|
||||
|
||||
sw.WriteLine("\t\t/// <summary> " + Name + " Interface</summary>");
|
||||
sw.WriteLine("\t\t/// <remarks>");
|
||||
sw.WriteLine("\t\t/// </remarks>");
|
||||
|
||||
sw.WriteLine ("#region Autogenerated code");
|
||||
sw.WriteLine ("\tpublic interface " + Name + " : GLib.IWrapper {");
|
||||
sw.WriteLine ();
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace GtkSharp.Generation {
|
|||
if (has_sigs && Elem.HasAttribute("parent"))
|
||||
{
|
||||
sw.WriteLine("\t\tprivate Hashtable Signals = new Hashtable();");
|
||||
GenSignals (sw, null, true);
|
||||
GenSignals (sw, null);
|
||||
}
|
||||
|
||||
GenMethods (sw, null, null, true);
|
||||
|
@ -122,7 +122,7 @@ namespace GtkSharp.Generation {
|
|||
continue;
|
||||
ClassBase igen = SymbolTable.GetClassGen (iface);
|
||||
igen.GenMethods (sw, collisions, this, false);
|
||||
igen.GenSignals (sw, this, false);
|
||||
igen.GenSignals (sw, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace GtkSharp.Generation {
|
|||
|
||||
public bool Validate ()
|
||||
{
|
||||
marsh = SignalHandler.GetName(elem, container_type.NS, container_type.DoGenerate);
|
||||
marsh = SignalHandler.GetName(elem, container_type.NS, false);
|
||||
if ((Name == "") || (marsh == "")) {
|
||||
Console.Write ("bad signal " + Name);
|
||||
Statistics.ThrottledCount++;
|
||||
|
@ -59,22 +59,12 @@ namespace GtkSharp.Generation {
|
|||
if (handler != "EventHandler")
|
||||
handler = container_type.NS + "Sharp." + handler;
|
||||
|
||||
GenComments (sw);
|
||||
if (elem.HasAttribute("new_flag") || (container_type != null && container_type.GetSignalRecursively (Name) != null))
|
||||
sw.Write("new ");
|
||||
|
||||
sw.WriteLine ("\t\tevent " + handler + " " + Name + ";");
|
||||
}
|
||||
|
||||
private void GenComments (StreamWriter sw)
|
||||
{
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("\t\t/// <summary> " + Name + " Event </summary>");
|
||||
sw.WriteLine("\t\t/// <remarks>");
|
||||
// FIXME: Generate some signal docs
|
||||
sw.WriteLine("\t\t/// </remarks>");
|
||||
}
|
||||
|
||||
private string GetHandlerName (out string argsname)
|
||||
{
|
||||
if (marsh.EndsWith (".voidObjectSignal")) {
|
||||
|
@ -92,37 +82,28 @@ namespace GtkSharp.Generation {
|
|||
if (handler == "EventHandler" || !container_type.DoGenerate)
|
||||
return handler;
|
||||
|
||||
string ns = container_type.NS;
|
||||
char sep = Path.DirectorySeparatorChar;
|
||||
string dir = ".." + sep + container_type.NS.ToLower() + sep + "generated";
|
||||
string dir = ".." + sep + ns.ToLower() + sep + "generated";
|
||||
|
||||
if (!Directory.Exists (dir))
|
||||
Directory.CreateDirectory (dir);
|
||||
|
||||
string filename = dir + sep + container_type.NS + "Sharp." + handler + ".cs";
|
||||
string filename = dir + sep + ns + "Sharp." + handler + ".cs";
|
||||
|
||||
FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write);
|
||||
StreamWriter sw = new StreamWriter (stream);
|
||||
|
||||
sw.WriteLine ("// Generated File. Do not modify.");
|
||||
sw.WriteLine ("// <c> 2001-2002 Mike Kestner");
|
||||
sw.WriteLine ("// This file was generated by the Gtk# Code generator.");
|
||||
sw.WriteLine ("// Any changes made will be lost if regenerated.");
|
||||
sw.WriteLine ();
|
||||
sw.WriteLine ("namespace " + container_type.NS + "Sharp {");
|
||||
sw.WriteLine ("namespace " + ns + "Sharp {");
|
||||
sw.WriteLine ();
|
||||
sw.WriteLine ("\tusing System;");
|
||||
|
||||
sw.WriteLine ();
|
||||
sw.WriteLine ("\t/// <summary> " + handler + " Delegate </summary>");
|
||||
sw.WriteLine ("\t/// <remarks>");
|
||||
sw.WriteLine ("\t///\tDelegate signature for " + Name + " Event handlers");
|
||||
sw.WriteLine ("\t/// </remarks>");
|
||||
sw.WriteLine ();
|
||||
sw.WriteLine ("\tpublic delegate void " + handler + "(object o, " + argsname + " args);");
|
||||
sw.WriteLine ();
|
||||
sw.WriteLine ("\t/// <summary> " + argsname + " Class </summary>");
|
||||
sw.WriteLine ("\t/// <remarks>");
|
||||
sw.WriteLine ("\t///\tArguments for " + Name + " Event handlers");
|
||||
sw.WriteLine ("\t/// </remarks>");
|
||||
sw.WriteLine ();
|
||||
sw.WriteLine ("\tpublic class " + argsname + " : GtkSharp.SignalArgs {");
|
||||
if (parms != null) {
|
||||
for (int i = 1; i < parms.Count; i++) {
|
||||
|
@ -137,17 +118,20 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine ("\t}");
|
||||
sw.WriteLine ("}");
|
||||
sw.Close ();
|
||||
argsname = container_type.NS + "Sharp." + argsname;
|
||||
return container_type.NS + "Sharp." + handler;
|
||||
argsname = ns + "Sharp." + argsname;
|
||||
return ns + "Sharp." + handler;
|
||||
}
|
||||
|
||||
public void Generate (StreamWriter sw, ClassBase implementor, bool gen_docs)
|
||||
public void Generate (StreamWriter sw, ClassBase implementor)
|
||||
{
|
||||
string cname = "\"" + elem.GetAttribute("cname") + "\"";
|
||||
string qual_marsh = marsh;
|
||||
string ns;
|
||||
if (implementor == null)
|
||||
ns = container_type.NS;
|
||||
else
|
||||
ns = implementor.NS;
|
||||
|
||||
if (gen_docs)
|
||||
GenComments (sw);
|
||||
string qual_marsh = SignalHandler.GetName(elem, ns, container_type.DoGenerate);
|
||||
|
||||
string argsname;
|
||||
string handler = GenHandler (out argsname);
|
||||
|
|
|
@ -102,10 +102,10 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine("\tusing System.Runtime.InteropServices;");
|
||||
sw.WriteLine("\tusing GtkSharp;");
|
||||
sw.WriteLine();
|
||||
sw.Write("\tpublic delegate " + p_ret + " ");
|
||||
sw.Write("\tinternal delegate " + p_ret + " ");
|
||||
sw.WriteLine(dname + "(" + pinv + ", int key);");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("\tpublic class " + sname + " : SignalCallback {");
|
||||
sw.WriteLine("\tinternal class " + sname + " : SignalCallback {");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("\t\tprivate static " + dname + " _Delegate;");
|
||||
sw.WriteLine();
|
||||
|
@ -160,7 +160,7 @@ namespace GtkSharp.Generation {
|
|||
else
|
||||
sw.WriteLine ("\t\t\t\tthrow new Exception(\"args.RetVal unset in callback\");");
|
||||
|
||||
sw.WriteLine("\t\t\treturn (" + p_ret + ") " + SymbolTable.CallByName (retval, "((" + s_ret + ")args.RetVal)") + ";");
|
||||
sw.WriteLine("\t\t\treturn (" + p_ret + ") " + SymbolTable.CallByName (retval, "((" + s_ret + ")args.RetVal)") + ";");
|
||||
}
|
||||
sw.WriteLine("\t\t}");
|
||||
sw.WriteLine();
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace Gnome {
|
|||
public event EventHandler Realize {
|
||||
add {
|
||||
if (EventList["realize"] == null)
|
||||
Signals["realize"] = new GtkSharp.voidObjectSignal(this, Handle, "realize", value, System.Type.GetType("EventArgs"));
|
||||
Signals["realize"] = new GnomeSharp.voidObjectSignal(this, Handle, "realize", value, System.Type.GetType("EventArgs"));
|
||||
EventList.AddHandler("realize", value);
|
||||
}
|
||||
remove {
|
||||
|
@ -54,7 +54,7 @@ namespace Gnome {
|
|||
public event EventHandler Unrealize {
|
||||
add {
|
||||
if (EventList["unrealize"] == null)
|
||||
Signals["unrealize"] = new GtkSharp.voidObjectSignal(this, Handle, "unrealize", value, System.Type.GetType("EventArgs"));
|
||||
Signals["unrealize"] = new GnomeSharp.voidObjectSignal(this, Handle, "unrealize", value, System.Type.GetType("EventArgs"));
|
||||
EventList.AddHandler("unrealize", value);
|
||||
}
|
||||
remove {
|
||||
|
@ -67,7 +67,7 @@ namespace Gnome {
|
|||
public event EventHandler Map {
|
||||
add {
|
||||
if (EventList["map"] == null)
|
||||
Signals["map"] = new GtkSharp.voidObjectSignal(this, Handle, "map", value, System.Type.GetType("EventArgs"));
|
||||
Signals["map"] = new GnomeSharp.voidObjectSignal(this, Handle, "map", value, System.Type.GetType("EventArgs"));
|
||||
EventList.AddHandler("map", value);
|
||||
}
|
||||
remove {
|
||||
|
@ -80,7 +80,7 @@ namespace Gnome {
|
|||
public event EventHandler Unmap {
|
||||
add {
|
||||
if (EventList["unmap"] == null)
|
||||
Signals["unmap"] = new GtkSharp.voidObjectSignal(this, Handle, "unmap", value, System.Type.GetType("EventArgs"));
|
||||
Signals["unmap"] = new GnomeSharp.voidObjectSignal(this, Handle, "unmap", value, System.Type.GetType("EventArgs"));
|
||||
EventList.AddHandler("unmap", value);
|
||||
}
|
||||
remove {
|
||||
|
|
Loading…
Reference in a new issue