From c9a40e80bc5ebcdff248f296656a4afe36e6994b Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Sat, 10 Nov 2001 02:35:15 +0000 Subject: [PATCH] 2001-11-09 Mike Kestner * codegen/defs-parse.pl : Use the @ctors list to determine if a class is abstract. There is an abstract indicator in the new defs format description, but it doesn't appear in the defs files currently. This method should be reliable though, even in the long term. Use the same check to determine if ctor(IntPtr obj) should be gen'd. svn path=/trunk/gtk-sharp/; revision=1315 --- ChangeLog | 8 ++++++++ codegen/defs-parse.pl | 19 ++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f705f0c4..7e02c30bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-11-09 Mike Kestner + + * codegen/defs-parse.pl : Use the @ctors list to determine if a class + is abstract. There is an abstract indicator in the new defs format + description, but it doesn't appear in the defs files currently. This + method should be reliable though, even in the long term. Use the same + check to determine if ctor(IntPtr obj) should be gen'd. + 2001-11-09 Mike Kestner * codegen/defs-parse.pl : Now genning Window, AccelGroup, Bin, and diff --git a/codegen/defs-parse.pl b/codegen/defs-parse.pl index 7593927a5..d095b0d19 100755 --- a/codegen/defs-parse.pl +++ b/codegen/defs-parse.pl @@ -253,17 +253,22 @@ sub gen_object print OUTFILE "\t/// \n\t///\t FIXME: Generate docs\n"; print OUTFILE "\t/// \n\n"; print OUTFILE "\tpublic "; - if ($abstract) { + if (@ctors == 0) { print OUTFILE "abstract "; } print OUTFILE "class $typename : $parent {\n\n"; - print OUTFILE "\t\t/// $typename Constructor \n"; - print OUTFILE "\t\t/// \n"; - print OUTFILE "\t\t///\tWraps a raw GObject reference.\n"; - print OUTFILE "\t\t/// \n\n"; - print OUTFILE "\t\tpublic $typename (IntPtr o)\n\t\t{\n"; - print OUTFILE "\t\t\tRawObject = o;\n\t\t}\n\n"; + # Only generate the wrapper ctor if other ctors exist + if (@ctors) { + print OUTFILE "\t\t/// \n"; + print OUTFILE "\t\t///\t$typename Constructor\n"; + print OUTFILE "\t\t/// \n"; + print OUTFILE "\t\t/// \n"; + print OUTFILE "\t\t///\tWraps a raw GObject reference.\n"; + print OUTFILE "\t\t/// \n\n"; + print OUTFILE "\t\tpublic $typename (IntPtr o)\n\t\t{\n"; + print OUTFILE "\t\t\tRawObject = o;\n\t\t}\n\n"; + } foreach $ctor (@ctors) { print OUTFILE gen_ctor ($ctor, "gtk-1.3.dll");