mail-archives/gtk-sharp-list/2003-February/000937.html

137 строки
4.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Changes to gapi_generator to support gtkmozembed
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:crichton%40gimp.org">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="000940.html">
<LINK REL="Next" HREF="000946.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Changes to gapi_generator to support gtkmozembed
</H1>
<B>Mark Crichton
</B>
<A HREF="mailto:crichton%40gimp.org"
TITLE="[Gtk-sharp-list] Changes to gapi_generator to support gtkmozembed">crichton@gimp.org
</A><BR>
<I>Thu, 13 Feb 2003 12:53:14 -0500</I>
<P><UL>
<LI> Previous message: <A HREF="000940.html">[Gtk-sharp-list] Correct Link on Website
</A></li>
<LI> Next message: <A HREF="000946.html">[Gtk-sharp-list] Changes to gapi_generator to support
gtkmozembed
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#937">[ date ]</a>
<a href="thread.html#937">[ thread ]</a>
<a href="subject.html#937">[ subject ]</a>
<a href="author.html#937">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>--uZ3hkaAS1mZxFaxD
Content-Type: multipart/mixed; boundary=&quot;45Z9DzgjV8m4Oswq&quot;
Content-Disposition: inline
--45Z9DzgjV8m4Oswq
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
* Mike Kestner (<A HREF="mailto:mkestner@speakeasy.net">mkestner@speakeasy.net</A>) [030114 22:21]:
&gt;<i> I recall approving the SignalHandler changes, and I don't think we ever
</I>&gt;<i> saw the parser patch.
</I>
Ugly patch attached. Warning, may cause fits of madness, but it works
in the case where you have added types to enums.
Mark
--45Z9DzgjV8m4Oswq
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=&quot;parser.diff&quot;
Content-Transfer-Encoding: quoted-printable
diff -u -r1.15 EnumGen.cs
--- generator/EnumGen.cs 5 Jan 2003 23:51:37 -0000 1.15
+++ generator/EnumGen.cs 13 Feb 2003 17:38:41 -0000
@@ -61,9 +61,35 @@
if (Elem.GetAttribute(&quot;type&quot;) =3D=3D &quot;flags&quot;) =0D
sw.WriteLine (&quot;\t[Flags]&quot;);=0D
=0D
+ // Ok, this is obscene. We need to go through the enums first=0D
+ // to find &quot;large&quot; values. If we find some, we need to change=0D
+ // the base type of the enum.=0D
+=0D
+ string enum_type =3D null;=0D
+=0D
+ foreach (XmlNode node in Elem.ChildNodes) {=0D
+ if (!(node is XmlElement) || node.Name !=3D &quot;member&quot;) {=0D
+ continue;=0D
+ }=0D
+=0D
+ XmlElement member =3D (XmlElement) node;=0D
+=0D
+ if (member.HasAttribute(&quot;value&quot;)) {=0D
+ string value =3D member.GetAttribute(&quot;value&quot;);=0D
+ if (value.EndsWith(&quot;U&quot;)) {=0D
+ enum_type =3D &quot;uint&quot;;=0D
+ member.SetAttribute(&quot;value&quot;, value.TrimEnd('U'));=0D
+ }=0D
+ }=0D
+ }=0D
+=0D
sw.WriteLine (&quot;#region Autogenerated code&quot;);=0D
- =0D
- sw.WriteLine (&quot;\tpublic enum &quot; + Name + &quot; {&quot;);=0D
+ =0D
+ if (enum_type !=3D null)=0D
+ sw.WriteLine (&quot;\tpublic enum &quot; + Name + &quot; : &quot; + enum_type + &quot; {&quot;);=0D
+ else=0D
+ sw.WriteLine (&quot;\tpublic enum &quot; + Name + &quot; {&quot;);=0D
+=0D
sw.WriteLine ();=0D
=0D
foreach (XmlNode node in Elem.ChildNodes) {=0D
--45Z9DzgjV8m4Oswq--
--uZ3hkaAS1mZxFaxD
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (SunOS)
iD8DBQE+S9uJOfj2Ja/u/oARAjgVAKC7AVIcVq1xbDWqkxTB1uCaQa9ltQCgritV
83/EbSV8kW2wViJ/rwa6fnQ=
=vz2u
-----END PGP SIGNATURE-----
--uZ3hkaAS1mZxFaxD--
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="000940.html">[Gtk-sharp-list] Correct Link on Website
</A></li>
<LI> Next message: <A HREF="000946.html">[Gtk-sharp-list] Changes to gapi_generator to support
gtkmozembed
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#937">[ date ]</a>
<a href="thread.html#937">[ thread ]</a>
<a href="subject.html#937">[ subject ]</a>
<a href="author.html#937">[ author ]</a>
</LI>
</UL>
</body></html>