2002-01-08 Mike Kestner <mkestner@speakeasy.net>
* generator/StructBase.cs (GenField): Return a bool success indicator. * generator/ObjectGen.cs : Check the return of GenField. * generator/SymbolTable.cs : More fixage to simple_types. * parser/gapi2xml.pl : Fix multiline comment bug, and callback name hashing logic. Squash callbacks that aren't in the namespace. * sample/HelloWorld.cs : Clean out some debugging to make it closer to compiling. Not quite there yet. svn path=/trunk/gtk-sharp/; revision=1948
This commit is contained in:
parent
dbadac1885
commit
d828b8ce59
8 changed files with 25 additions and 14 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2002-01-08 Mike Kestner <mkestner@speakeasy.net>
|
||||
|
||||
* generator/StructBase.cs (GenField): Return a bool success indicator.
|
||||
* generator/ObjectGen.cs : Check the return of GenField.
|
||||
* generator/SymbolTable.cs : More fixage to simple_types.
|
||||
* parser/gapi2xml.pl : Fix multiline comment bug, and callback name
|
||||
hashing logic. Squash callbacks that aren't in the namespace.
|
||||
* sample/HelloWorld.cs : Clean out some debugging to make it closer to
|
||||
compiling. Not quite there yet.
|
||||
|
||||
2002-01-08 Mike Kestner <mkestner@speakeasy.net>
|
||||
|
||||
* generator/CallbackGen.cs : Use name in QualName, not cname.
|
||||
|
|
|
@ -59,6 +59,7 @@ namespace GtkSharp.Generation {
|
|||
if (!Directory.Exists("..\\" + ns.ToLower() + "\\generated")) {
|
||||
Directory.CreateDirectory("..\\"+ns.ToLower()+"\\generated");
|
||||
}
|
||||
|
||||
String filename = "..\\" + ns.ToLower() + "\\generated\\" + Name + ".cs";
|
||||
|
||||
FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write);
|
||||
|
|
|
@ -86,7 +86,9 @@ namespace GtkSharp.Generation {
|
|||
|
||||
switch (node.Name) {
|
||||
case "field":
|
||||
// GenField(member, table, sw);
|
||||
//if (!GenField(member, table, sw)) {
|
||||
// Console.WriteLine("in object " + CName);
|
||||
//}
|
||||
break;
|
||||
|
||||
case "callback":
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace GtkSharp.Generation {
|
|||
this.elem = elem;
|
||||
}
|
||||
|
||||
protected void GenField (XmlElement field, SymbolTable table, StreamWriter sw)
|
||||
protected bool GenField (XmlElement field, SymbolTable table, StreamWriter sw)
|
||||
{
|
||||
String c_type;
|
||||
|
||||
|
@ -35,8 +35,8 @@ namespace GtkSharp.Generation {
|
|||
String cs_type = table.GetCSType(c_type);
|
||||
|
||||
if (cs_type == "") {
|
||||
Console.WriteLine ("Unknown Type {0}", c_type);
|
||||
return;
|
||||
Console.WriteLine ("Field has unknown Type {0}", c_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
sw.Write ("\t\t public " + cs_type);
|
||||
|
@ -44,6 +44,7 @@ namespace GtkSharp.Generation {
|
|||
sw.Write ("[]");
|
||||
}
|
||||
sw.WriteLine (" " + field.GetAttribute("cname") + ";");
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace GtkSharp.Generation {
|
|||
simple_types.Add ("GClosure", "IntPtr");
|
||||
simple_types.Add ("GArray", "IntPtr");
|
||||
simple_types.Add ("GData", "IntPtr");
|
||||
simple_types.Add ("GTypeModule", "IntPtr");
|
||||
simple_types.Add ("GTypeModule", "GLib.Object");
|
||||
simple_types.Add ("GSList", "IntPtr");
|
||||
simple_types.Add ("GHashTable", "IntPtr");
|
||||
simple_types.Add ("va_list", "IntPtr");
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -61,7 +61,7 @@ while ($line = <STDIN>) {
|
|||
$edef =~ /}\s*(\w+);/;
|
||||
$ename = $1;
|
||||
$edefs{$ename} = $edef;
|
||||
} elsif ($line =~ /typedef\s+\w+\s*\**\s*\(\*(\w+)\)\s*\(/) {
|
||||
} elsif ($line =~ /typedef\s+\w+\s*\**\s*\(\*\s*(\w+)\)\s*\(/) {
|
||||
$fname = $1;
|
||||
$fdef = "";
|
||||
while ($line !~ /;/) {
|
||||
|
@ -70,7 +70,7 @@ while ($line = <STDIN>) {
|
|||
}
|
||||
$fdef .= $line;
|
||||
$fdef =~ s/\n\s+//g;
|
||||
$fpdefs{$1} = $fdef;
|
||||
$fpdefs{$fname} = $fdef;
|
||||
} elsif ($line =~ /struct\s+(\w+)/) {
|
||||
$sname = $1;
|
||||
$sdef = $line;
|
||||
|
@ -78,8 +78,8 @@ while ($line = <STDIN>) {
|
|||
$sdef .= $line;
|
||||
last if ($line =~ /^}/);
|
||||
}
|
||||
$sdef =~ s!/\*.*?(\*/|\n)!!g;
|
||||
$sdef =~ s/\n\s*//g;
|
||||
$sdef =~ s|/\*.*?\*/||g;
|
||||
$sdefs{$sname} = $sdef;
|
||||
} elsif ($line =~ /^(\w+)_class_init\b/) {
|
||||
$class = StudlyCaps($1);
|
||||
|
@ -173,6 +173,7 @@ foreach $cname (sort(keys(%edefs))) {
|
|||
##############################################################
|
||||
|
||||
foreach $cbname (sort(keys(%fpdefs))) {
|
||||
next if ($cbname !~ /$ns/);
|
||||
$cbcnt++;
|
||||
$fdef = $cb = $fpdefs{$cbname};
|
||||
$cb_elem = addNameElem($ns_elem, 'callback', $cbname, $ns);
|
||||
|
|
|
@ -17,8 +17,7 @@ namespace GtkSamples {
|
|||
public static int Main (string[] args)
|
||||
{
|
||||
Application.Init (ref args);
|
||||
Window win = new Window ("Gtk# Hello World");
|
||||
win.DefaultSize = new Size (200, 150);
|
||||
Gtk.Window win = new Gtk.Window ("Gtk# Hello World");
|
||||
win.Deleted += new EventHandler (Window_Delete);
|
||||
win.Show ();
|
||||
Application.Run ();
|
||||
|
@ -27,9 +26,6 @@ namespace GtkSamples {
|
|||
|
||||
static void Window_Delete (object obj, EventArgs args)
|
||||
{
|
||||
SimpleEventArgs sa = (SimpleEventArgs) args;
|
||||
|
||||
Console.WriteLine(sa.Event.type);
|
||||
Application.Quit ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue