mail-archives/gtk-sharp-list/2002-June/000090.html

628 строки
22 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Pixbuf support
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:hestilow%40ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="000095.html">
<LINK REL="Next" HREF="000092.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Pixbuf support
</H1>
<B>Rachel Hestilow
</B>
<A HREF="mailto:hestilow%40ximian.com"
TITLE="[Gtk-sharp-list] Pixbuf support">hestilow@ximian.com
</A><BR>
<I>14 Jun 2002 17:14:33 -0500</I>
<P><UL>
<LI> Previous message: <A HREF="000095.html">[Gtk-sharp-list] Did I build GTK# on Rotor (aka Sared SourceCLI
.NET)?
</A></li>
<LI> Next message: <A HREF="000092.html">[Gtk-sharp-list] Pixbuf support
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#90">[ date ]</a>
<a href="thread.html#90">[ thread ]</a>
<a href="subject.html#90">[ subject ]</a>
<a href="author.html#90">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>--=-hO/RavFB8Xhc2KIc/GW8
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
I just committed the following patch to CVS. It adds GdkPixbuf support
under the namespace Gdk.Imaging.
As a side effect, GError is now mapped to GLib.GException automatically.
The marshalling is still wonky for the actual exception message, but any
gtk+ function that in C would be passed a GError can now be try/caught
using a GLib.GException.
-- Rachel
--=-hO/RavFB8Xhc2KIc/GW8
Content-Disposition: inline; filename=pixbuf.patch
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; name=pixbuf.patch; charset=ISO-8859-1
Index: ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/ChangeLog,v
retrieving revision 1.95
diff -u -r1.95 ChangeLog
--- ChangeLog 10 Jun 2002 12:34:08 -0000 1.95
+++ ChangeLog 14 Jun 2002 18:24:30 -0000
@@ -1,3 +1,28 @@
+2002-06-14 Rachel Hestilow &lt;<A HREF="mailto:hestilow@ximian.com">hestilow@ximian.com</A>&gt;
+
+ * glib/GException.cs: Added.
+
+ * generator/Ctor.cs, Method.cs: Tag function as unsafe if it throws
+ an exception. Call parms.HandleException.
+
+ * generator/Paramaters.cs: Add property ThrowsException (based
+ on a trailing GError**). If ThrowsException, mask GError in the
+ signature, initialize a GError in Initialize, and add new method
+ HandleException to throw an exception if error !=3D null.
+
+ * generator/SymbolTable.cs: Add gdk-pixbuf DLL, and GError type.
+
+ * gdk.imaging, gdk.imaging/Makefile.in, gdk.imaging/makefile.win32:
+ Added.
+
+ * configure.in, Makefile, makefile.win32: Build gdk.imaging.
+
+ * gtk/Makefile.in, gtk/makefile.win32: Link against gdk.imaging.
+
+ * parser/gapi2xml.pl: Support namespace renaming.
+=09
+ * parser/build.pl: Build gdk-pixbuf as gdk.imaging.
+=09
2002-06-09 Rachel Hestilow &lt;<A HREF="mailto:hestilow@ximian.com">hestilow@ximian.com</A>&gt;
=20
* generator/GenBase.cs: new method AppendCustom, moved from ObjectGen.
Index: configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/configure.in,v
retrieving revision 1.3
diff -u -r1.3 configure.in
--- configure.in 10 Jun 2002 12:34:08 -0000 1.3
+++ configure.in 14 Jun 2002 18:24:30 -0000
@@ -80,6 +80,7 @@
pango/Makefile
atk/Makefile
gdk/Makefile
+gdk.imaging/Makefile
gtk/Makefile
sample/Makefile
])
Index: makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/makefile,v
retrieving revision 1.12
diff -u -r1.12 makefile
--- makefile 28 May 2002 21:19:04 -0000 1.12
+++ makefile 14 Jun 2002 18:24:30 -0000
@@ -1,4 +1,4 @@
-DIRS=3Dgenerator glib pango atk gdk gtk sample
+DIRS=3Dgenerator glib pango atk gdk gdk.imaging gtk sample
ROOT=3D/cygdrive/$(subst \,/,$(subst :\,/,$(SYSTEMROOT)))
CSC=3D$(ROOT)/microsoft.net/framework/v1.0.3705/csc.exe
MCS=3Dmcs
Index: makefile.win32
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/makefile.win32,v
retrieving revision 1.1
diff -u -r1.1 makefile.win32
--- makefile.win32 2 May 2002 21:57:40 -0000 1.1
+++ makefile.win32 14 Jun 2002 18:24:30 -0000
@@ -1,4 +1,4 @@
-DIRS=3Dgenerator glib pango atk gdk gtk sample
+DIRS=3Dgenerator glib pango atk gdk gdk.imaging gtk sample
ROOT=3D/cygdrive/$(subst \,/,$(subst :\,/,$(SYSTEMROOT)))
CSC=3D$(ROOT)/microsoft.net/framework/v1.0.3705/csc.exe
=20
Index: gdk.imaging/Makefile.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: gdk.imaging/Makefile.in
diff -N gdk.imaging/Makefile.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdk.imaging/Makefile.in 14 Jun 2002 18:24:30 -0000
@@ -0,0 +1,19 @@
+MCS=3Dmcs
+
+all: linux
+
+windows:
+ $(CSC) /unsafe /target:library /r:../glib/glib-sharp.dll /r:../pango/pang=
o-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /out:gdk-imagin=
g-sharp.dll /recurse:*.cs
+
+linux: gdk-imaging-sharp.dll
+
+gdk-imaging-sharp.dll: generated/*.cs
+ $(MCS) --unsafe --target library -L ../glib -L ../pango -L ../atk -r glib=
-sharp -r pango-sharp -r atk-sharp -r gdk-sharp -o gdk-imaging-sharp.dll --=
recurse '*.cs'
+
+clean:
+ rm -f *.dll
+ rm -f generated/*
+
+install: all
+ cp gdk-imaging-sharp.dll @prefix@/lib
+
Index: gdk.imaging/makefile.win32
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: gdk.imaging/makefile.win32
diff -N gdk.imaging/makefile.win32
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdk.imaging/makefile.win32 14 Jun 2002 18:24:30 -0000
@@ -0,0 +1,5 @@
+all: windows
+
+windows:
+ $(CSC) /unsafe /target:library /r:../glib/glib-sharp.dll /r:../pango/pang=
o-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /out:gdk-imagin=
g-sharp.dll /recurse:*.cs
+
Index: generator/Ctor.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/generator/Ctor.cs,v
retrieving revision 1.1
diff -u -r1.1 Ctor.cs
--- generator/Ctor.cs 23 May 2002 23:43:24 -0000 1.1
+++ generator/Ctor.cs 14 Jun 2002 18:24:30 -0000
@@ -58,9 +58,14 @@
=09=0D
string cname =3D elem.GetAttribute(&quot;cname&quot;);=0D
string name =3D ((XmlElement)elem.ParentNode).GetAttribute(&quot;name&quot;);=0D
- =09=0D
+ string safety;=0D
+ if (parms !=3D null &amp;&amp; parms.ThrowsException)=0D
+ safety =3D &quot;unsafe &quot;;=0D
+ else=0D
+ safety =3D &quot;&quot;;=0D
+=0D
sw.WriteLine(&quot;\t\t[DllImport(\&quot;&quot; + SymbolTable.GetDllName(ns) + &quot;\&quot;)]&quot;)=
;=0D
- sw.WriteLine(&quot;\t\tstatic extern IntPtr &quot; + cname + isig);=0D
+ sw.WriteLine(&quot;\t\tstatic extern &quot; + safety + &quot;IntPtr &quot; + cname + isig);=0D
sw.WriteLine();=0D
=09=0D
if (clash) {=0D
@@ -71,13 +76,22 @@
mname =3D mname.Substring(0, idx) + mname.Substring(idx+1, 1).ToUpper=
() + mname.Substring(idx+2);=0D
}=0D
=09=0D
- sw.WriteLine(&quot;\t\tpublic static &quot; + name + &quot; &quot; + mname + sig);=0D
+ sw.WriteLine(&quot;\t\tpublic static &quot; + safety + name + &quot; &quot; + mname + sig)=
;=0D
sw.WriteLine(&quot;\t\t{&quot;);=0D
- sw.WriteLine(&quot;\t\t\treturn new &quot; + name + &quot;(&quot; + cname + call + &quot;);&quot;);=0D
+ if (parms !=3D null)=0D
+ parms.Initialize(sw, false);=0D
+ sw.WriteLine(&quot;\t\t\tIntPtr ret =3D &quot; + cname + call + &quot;;&quot;);=0D
+ if (parms !=3D null)=0D
+ parms.HandleException (sw);=0D
+ sw.WriteLine(&quot;\t\t\treturn new &quot; + name + &quot;(ret);&quot;);=0D
} else {=0D
- sw.WriteLine(&quot;\t\tpublic &quot; + name + sig);=0D
+ sw.WriteLine(&quot;\t\tpublic &quot; + safety + name + sig);=0D
sw.WriteLine(&quot;\t\t{&quot;);=0D
+ if (parms !=3D null)=0D
+ parms.Initialize(sw, false);=20=0D
sw.WriteLine(&quot;\t\t\tRaw =3D &quot; + cname + call + &quot;;&quot;);=0D
+ if (parms !=3D null)=0D
+ parms.HandleException (sw);=0D
}=0D
=09=0D
sw.WriteLine(&quot;\t\t}&quot;);=0D
Index: generator/GenBase.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/generator/GenBase.cs,v
retrieving revision 1.2
diff -u -r1.2 GenBase.cs
--- generator/GenBase.cs 10 Jun 2002 12:34:08 -0000 1.2
+++ generator/GenBase.cs 14 Jun 2002 18:24:30 -0000
@@ -56,6 +56,7 @@
char sep =3D Path.DirectorySeparatorChar;=0D
string dir =3D &quot;..&quot; + sep + ns.ToLower() + sep + &quot;generated&quot;;=0D
if (!Directory.Exists(dir)) {=0D
+ Console.WriteLine (&quot;creating &quot; + dir);=0D
Directory.CreateDirectory(dir);=0D
}=0D
String filename =3D dir + sep + Name + &quot;.cs&quot;;=0D
Index: generator/Method.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/generator/Method.cs,v
retrieving revision 1.2
diff -u -r1.2 Method.cs
--- generator/Method.cs 10 Jun 2002 12:34:08 -0000 1.2
+++ generator/Method.cs 14 Jun 2002 18:24:30 -0000
@@ -123,13 +123,19 @@
Statistics.ThrottledCount++;=0D
return;=0D
}=0D
+ =09=0D
+ string safety;=0D
+ if (parms !=3D null &amp;&amp; parms.ThrowsException)=0D
+ safety =3D &quot;unsafe &quot;;=0D
+ else=0D
+ safety =3D &quot;&quot;;=0D
=20=0D
sw.WriteLine(&quot;\t\t[DllImport(\&quot;&quot; + SymbolTable.GetDllName(ns) +=20=0D
&quot;\&quot;, CallingConvention=3DCallingConvention.Cdecl)]&quot;);=0D
- sw.Write(&quot;\t\tstatic extern &quot; + m_ret + &quot; &quot; + cname + isig);=0D
+ sw.Write(&quot;\t\tstatic extern &quot; + safety + m_ret + &quot; &quot; + cname + isig);=0D
sw.WriteLine();=0D
=20=0D
- sw.Write(&quot;\t\tpublic &quot;);=0D
+ sw.Write(&quot;\t\tpublic &quot; + safety);=0D
bool is_get =3D (parms !=3D null &amp;&amp; parms.IsAccessor &amp;&amp; Name.Substring(=
0, 3) =3D=3D &quot;Get&quot;);=0D
if (is_get) {=0D
s_ret =3D parms.AccessorReturnType;=0D
@@ -149,12 +155,16 @@
if (is_get || m_ret =3D=3D &quot;void&quot;) {=0D
sw.WriteLine(cname + call + &quot;;&quot;);=0D
} else {=0D
- sw.WriteLine(&quot;return &quot; + SymbolTable.FromNative(rettype, cname + call)=
+ &quot;;&quot;);=0D
+ sw.WriteLine(s_ret + &quot; ret =3D &quot; + SymbolTable.FromNative(rettype, cna=
me + call) + &quot;;&quot;);=0D
}=0D
=09=0D
- if (is_get)=20=0D
- sw.WriteLine (&quot;\t\t\treturn &quot; + parms.AccessorName + &quot;;&quot;);=20=0D
+ if (parms !=3D null)=0D
+ parms.HandleException (sw);=0D
=20=0D
+ if (is_get)=20=0D
+ sw.WriteLine (&quot;\t\t\treturn &quot; + parms.AccessorName + &quot;;&quot;);=0D
+ else if (m_ret !=3D &quot;void&quot;)=0D
+ sw.WriteLine (&quot;\t\t\treturn ret;&quot;);=0D
=20=0D
sw.Write(&quot;\t\t}&quot;);=0D
if (is_get)=0D
Index: generator/Parameters.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/generator/Parameters.cs,v
retrieving revision 1.2
diff -u -r1.2 Parameters.cs
--- generator/Parameters.cs 10 Jun 2002 12:34:08 -0000 1.2
+++ generator/Parameters.cs 14 Jun 2002 18:24:30 -0000
@@ -69,7 +69,7 @@
Console.Write(&quot;Name: &quot; + name + &quot; Type: &quot; + type + &quot; &quot;);=0D
return false;=0D
}=0D
- =09=0D
+=0D
if (p_elem.HasAttribute(&quot;array&quot;)) {=0D
cs_type +=3D &quot;[]&quot;;=0D
m_type +=3D &quot;[]&quot;;=0D
@@ -77,9 +77,12 @@
=09=0D
if (need_sep) {=0D
call_string +=3D &quot;, &quot;;=0D
- signature +=3D &quot;, &quot;;=0D
import_sig +=3D &quot;, &quot;;=0D
- signature_types +=3D &quot;:&quot;;=0D
+ if (type !=3D &quot;GError**&quot;)=0D
+ {=0D
+ signature +=3D &quot;, &quot;;=0D
+ signature_types +=3D &quot;:&quot;;=0D
+ }=0D
} else {=0D
need_sep =3D true;=0D
}=0D
@@ -87,9 +90,14 @@
if (p_elem.HasAttribute(&quot;pass_as&quot;)) {=0D
signature +=3D p_elem.GetAttribute(&quot;pass_as&quot;) + &quot; &quot;;=0D
}=0D
-=0D
- signature +=3D (cs_type + &quot; &quot; + name);=0D
- signature_types +=3D cs_type;=0D
+ =09=0D
+ if (type =3D=3D &quot;GError**&quot;)=0D
+ call_string +=3D &quot;&amp;&quot;; =09=0D
+ else=0D
+ {=0D
+ signature +=3D (cs_type + &quot; &quot; + name);=0D
+ signature_types +=3D cs_type;=0D
+ }=0D
call_string +=3D call_parm;=0D
import_sig +=3D (m_type + &quot; &quot; + name);=0D
}=0D
@@ -99,6 +107,7 @@
=20=0D
public void Initialize (StreamWriter sw, bool is_get)=0D
{=0D
+ string name;=0D
foreach (XmlNode parm in elem.ChildNodes) {=0D
if (parm.Name !=3D &quot;parameter&quot;) {=0D
continue;=0D
@@ -107,7 +116,7 @@
XmlElement p_elem =3D (XmlElement) parm;=0D
=20=0D
string type =3D SymbolTable.GetCSType(p_elem.GetAttribute (&quot;type&quot;));=0D
- string name =3D MangleName(p_elem.GetAttribute(&quot;name&quot;));=0D
+ name =3D MangleName(p_elem.GetAttribute(&quot;name&quot;));=0D
if (is_get) {=0D
sw.WriteLine (&quot;\t\t\t&quot; + type + &quot; &quot; + name + &quot;;&quot;);=0D
}=0D
@@ -116,9 +125,18 @@
sw.WriteLine(&quot;\t\t\t&quot; + name + &quot; =3D new &quot; + type + &quot;();&quot;);=20=0D
}=0D
}=0D
- =09=0D
+=0D
+ if (ThrowsException)=0D
+ sw.WriteLine (&quot;\t\t\tGLib.GError* {0} =3D null;&quot;, name);=0D
}=0D
=20=0D
+ public void HandleException (StreamWriter sw)=0D
+ {=0D
+ if (!ThrowsException)=0D
+ return;=0D
+ sw.WriteLine (&quot;\t\t\tif (error !=3D null) throw new GLib.GException (er=
ror);&quot;);=0D
+ }=0D
+ =09=0D
public bool IsAccessor {=0D
get {=0D
int length =3D 0;=0D
@@ -137,6 +155,27 @@
}=0D
=20=0D
return (length =3D=3D 1 &amp;&amp; pass_as =3D=3D &quot;out&quot;);=0D
+ }=0D
+ }=0D
+=0D
+ public bool ThrowsException {=0D
+ get {=0D
+ int i =3D 0;=0D
+ XmlNode last_parm =3D null;=0D
+ foreach (XmlNode parm in elem.ChildNodes) {=0D
+ if (parm.Name !=3D &quot;parameter&quot;) {=0D
+ continue;=0D
+ }=0D
+=0D
+ last_parm =3D parm;=0D
+ }=0D
+=0D
+ if (last_parm =3D=3D null)=0D
+ return false;=0D
+=09=0D
+ XmlElement p_elem =3D (XmlElement) last_parm;=0D
+ string type =3D p_elem.GetAttribute(&quot;type&quot;);=0D
+ return (type =3D=3D &quot;GError**&quot;);=0D
}=0D
}=0D
=20=0D
Index: generator/SymbolTable.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/generator/SymbolTable.cs,v
retrieving revision 1.23
diff -u -r1.23 SymbolTable.cs
--- generator/SymbolTable.cs 26 May 2002 16:23:40 -0000 1.23
+++ generator/SymbolTable.cs 14 Jun 2002 18:24:30 -0000
@@ -52,6 +52,7 @@
simple_types.Add (&quot;uint1&quot;, &quot;bool&quot;);=0D
simple_types.Add (&quot;GPtrArray&quot;, &quot;System.IntPtr[]&quot;);=0D
simple_types.Add (&quot;GType&quot;, &quot;int&quot;);=0D
+ simple_types.Add (&quot;GError&quot;, &quot;GLib.GError**&quot;);=0D
=09=0D
// FIXME: These ought to be handled properly.=0D
simple_types.Add (&quot;GList&quot;, &quot;System.IntPtr&quot;);=0D
@@ -70,6 +71,7 @@
dlls.Add(&quot;Pango&quot;, &quot;pango-1.0&quot;);=0D
dlls.Add(&quot;Atk&quot;, &quot;atk-1.0&quot;);=0D
dlls.Add(&quot;Gdk&quot;, &quot;gdk-x11-2.0&quot;);=0D
+ dlls.Add(&quot;Gdk.Imaging&quot;, &quot;gdk_pixbuf-2.0&quot;);=0D
dlls.Add(&quot;Gtk&quot;, &quot;gtk-x11-2.0&quot;);=0D
}=0D
=09=0D
Index: glib/GException.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: glib/GException.cs
diff -N glib/GException.cs
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ glib/GException.cs 14 Jun 2002 18:24:30 -0000
@@ -0,0 +1,40 @@
+// GException.cs : GError handling
+//
+// Authors: Rachel Hestilow &lt;<A HREF="mailto:hestilow@ximian.com">hestilow@ximian.com</A>&gt;
+//
+// (c) 2002 Rachel Hestilow=20
+
+namespace GLib {
+
+ using System;
+ using System.Runtime.InteropServices;
+=09
+ [StructLayout(LayoutKind.Sequential)]
+ public unsafe struct GError
+ {
+ [MarshalAs (UnmanagedType.U4)]
+ public uint domain;
+ [MarshalAs (UnmanagedType.I4)]
+ public int code;
+ [MarshalAs (UnmanagedType.LPStr)]
+ public string message;
+ }
+
+ public unsafe class GException : Exception
+ {
+ GError *errptr;
+=09
+ unsafe public GException (GError *errptr) : base (errptr-&gt;message)
+ {
+ this.errptr =3D errptr;
+ }
+
+ [DllImport(&quot;glib-2.0&quot;)]
+ unsafe static extern void g_clear_error (GError **errptr);
+ ~GException ()
+ {
+ unsafe { g_clear_error (&amp;errptr); }
+ }
+ }
+}
+
Index: gtk/Makefile.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/gtk/Makefile.in,v
retrieving revision 1.5
diff -u -r1.5 Makefile.in
--- gtk/Makefile.in 29 May 2002 10:40:15 -0000 1.5
+++ gtk/Makefile.in 14 Jun 2002 18:24:31 -0000
@@ -3,12 +3,12 @@
all: linux
=20
windows:
- $(CSC) /unsafe /target:library /r:../glib/glib-sharp.dll /r:../pango/pang=
o-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /out:gtk-sharp.=
dll /recurse:*.cs
+ $(CSC) /unsafe /target:library /r:../glib/glib-sharp.dll /r:../pango/pang=
o-sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll /r:../gdk/gdk-i=
maging-sharp.dll /out:gtk-sharp.dll /recurse:*.cs
=20
linux: gtk-sharp.dll
=20
gtk-sharp.dll: *.cs generated/*.cs
- $(MCS) --unsafe --target library -r System.Drawing -L ../glib -L ../pango=
-L ../atk -L ../gdk -r glib-sharp -r pango-sharp -r atk-sharp -r gdk-sharp=
-o gtk-sharp.dll --recurse '*.cs'
+ $(MCS) --unsafe --target library -r System.Drawing -L ../glib -L ../pango=
-L ../atk -L ../gdk -r glib-sharp -r pango-sharp -r atk-sharp -r gdk-sharp=
-r gdk-imaging-sharp -o gtk-sharp.dll --recurse '*.cs'
=20
clean:
rm -f *.dll
Index: parser/build.pl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/parser/build.pl,v
retrieving revision 1.1
diff -u -r1.1 build.pl
--- parser/build.pl 10 Jun 2002 12:34:09 -0000 1.1
+++ parser/build.pl 14 Jun 2002 18:24:31 -0000
@@ -7,10 +7,16 @@
%ns =3D ( &quot;Atk&quot; =3D&gt; &quot;atk-1.0.2/atk&quot;,
&quot;Pango&quot; =3D&gt; &quot;pango-1.0.2/pango&quot;,
&quot;Gdk&quot; =3D&gt; &quot;gtk+-2.0.3/gdk&quot;,
+ &quot;Gdk.Imaging&quot; =3D&gt; &quot;gtk+-2.0.3/gdk-pixbuf&quot;,
&quot;Gtk&quot; =3D&gt; &quot;gtk+-2.0.3/gtk&quot;);
=20
+%c_ns =3D ( &quot;Gdk.Imaging&quot; =3D&gt; &quot;Gdk&quot;);
+
foreach $key (keys %ns) {
$dir =3D $ns{$key};
- system (&quot;./gapi_pp.pl $dir | ./gapi2xml.pl $key $file&quot;);
+ if (not ($c_key =3D $c_ns{$key})) {
+ $c_key =3D $key;
+ }
+ system (&quot;./gapi_pp.pl $dir | ./gapi2xml.pl $c_key $file --out-ns $key&quot;);
}
=20
Index: parser/gapi2xml.pl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/parser/gapi2xml.pl,v
retrieving revision 1.13
diff -u -r1.13 gapi2xml.pl
--- parser/gapi2xml.pl 10 Jun 2002 12:34:09 -0000 1.13
+++ parser/gapi2xml.pl 14 Jun 2002 18:24:31 -0000
@@ -13,11 +13,17 @@
use Metadata;
=20
if (!$ARGV[0]) {
- die &quot;Usage: gapi_pp.pl &lt;srcdir&gt; | gapi2xml.pl &lt;namespace&gt; &lt;outfile&gt;\n&quot;;
+ die &quot;Usage: gapi_pp.pl &lt;srcdir&gt; | gapi2xml.pl &lt;namespace&gt; &lt;outfile&gt; [--ou=
t-ns outns]\n&quot;;
}
=20
$ns =3D $ARGV[0];
=20
+if ($ARGV[2] &amp;&amp; $ARGV[2] eq &quot;--out-ns&quot;) {
+ $out_ns =3D $ARGV[3];
+} else {
+ $out_ns =3D $ns;
+}
+
##############################################################
# If a filename was provided see if it exists. We parse existing files in=
to
# a tree and append the namespace to the root node. If the file doesn't=20
@@ -35,7 +41,7 @@
}
=20
$ns_elem =3D $doc-&gt;createElement('namespace');
-$ns_elem-&gt;setAttribute('name', $ns);
+$ns_elem-&gt;setAttribute('name', $out_ns);
$root-&gt;appendChild($ns_elem);
=20
##############################################################
--=-hO/RavFB8Xhc2KIc/GW8--
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="000095.html">[Gtk-sharp-list] Did I build GTK# on Rotor (aka Sared SourceCLI
.NET)?
</A></li>
<LI> Next message: <A HREF="000092.html">[Gtk-sharp-list] Pixbuf support
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#90">[ date ]</a>
<a href="thread.html#90">[ thread ]</a>
<a href="subject.html#90">[ subject ]</a>
<a href="author.html#90">[ author ]</a>
</LI>
</UL>
</body></html>