[Gtk-sharp-list] Pixbuf support
Rachel Hestilow
hestilow@ximian.com
14 Jun 2002 17:14:33 -0500
--=-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 <hestilow@ximian.com>
+
+ * 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 <hestilow@ximian.com>
=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("cname");=0D
string name =3D ((XmlElement)elem.ParentNode).GetAttribute("name");=0D
- =09=0D
+ string safety;=0D
+ if (parms !=3D null && parms.ThrowsException)=0D
+ safety =3D "unsafe ";=0D
+ else=0D
+ safety =3D "";=0D
+=0D
sw.WriteLine("\t\t[DllImport(\"" + SymbolTable.GetDllName(ns) + "\")]")=
;=0D
- sw.WriteLine("\t\tstatic extern IntPtr " + cname + isig);=0D
+ sw.WriteLine("\t\tstatic extern " + safety + "IntPtr " + 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("\t\tpublic static " + name + " " + mname + sig);=0D
+ sw.WriteLine("\t\tpublic static " + safety + name + " " + mname + sig)=
;=0D
sw.WriteLine("\t\t{");=0D
- sw.WriteLine("\t\t\treturn new " + name + "(" + cname + call + ");");=0D
+ if (parms !=3D null)=0D
+ parms.Initialize(sw, false);=0D
+ sw.WriteLine("\t\t\tIntPtr ret =3D " + cname + call + ";");=0D
+ if (parms !=3D null)=0D
+ parms.HandleException (sw);=0D
+ sw.WriteLine("\t\t\treturn new " + name + "(ret);");=0D
} else {=0D
- sw.WriteLine("\t\tpublic " + name + sig);=0D
+ sw.WriteLine("\t\tpublic " + safety + name + sig);=0D
sw.WriteLine("\t\t{");=0D
+ if (parms !=3D null)=0D
+ parms.Initialize(sw, false);=20=0D
sw.WriteLine("\t\t\tRaw =3D " + cname + call + ";");=0D
+ if (parms !=3D null)=0D
+ parms.HandleException (sw);=0D
}=0D
=09=0D
sw.WriteLine("\t\t}");=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 ".." + sep + ns.ToLower() + sep + "generated";=0D
if (!Directory.Exists(dir)) {=0D
+ Console.WriteLine ("creating " + dir);=0D
Directory.CreateDirectory(dir);=0D
}=0D
String filename =3D dir + sep + Name + ".cs";=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 && parms.ThrowsException)=0D
+ safety =3D "unsafe ";=0D
+ else=0D
+ safety =3D "";=0D
=20=0D
sw.WriteLine("\t\t[DllImport(\"" + SymbolTable.GetDllName(ns) +=20=0D
"\", CallingConvention=3DCallingConvention.Cdecl)]");=0D
- sw.Write("\t\tstatic extern " + m_ret + " " + cname + isig);=0D
+ sw.Write("\t\tstatic extern " + safety + m_ret + " " + cname + isig);=0D
sw.WriteLine();=0D
=20=0D
- sw.Write("\t\tpublic ");=0D
+ sw.Write("\t\tpublic " + safety);=0D
bool is_get =3D (parms !=3D null && parms.IsAccessor && Name.Substring(=
0, 3) =3D=3D "Get");=0D
if (is_get) {=0D
s_ret =3D parms.AccessorReturnType;=0D
@@ -149,12 +155,16 @@
if (is_get || m_ret =3D=3D "void") {=0D
sw.WriteLine(cname + call + ";");=0D
} else {=0D
- sw.WriteLine("return " + SymbolTable.FromNative(rettype, cname + call)=
+ ";");=0D
+ sw.WriteLine(s_ret + " ret =3D " + SymbolTable.FromNative(rettype, cna=
me + call) + ";");=0D
}=0D
=09=0D
- if (is_get)=20=0D
- sw.WriteLine ("\t\t\treturn " + parms.AccessorName + ";");=20=0D
+ if (parms !=3D null)=0D
+ parms.HandleException (sw);=0D
=20=0D
+ if (is_get)=20=0D
+ sw.WriteLine ("\t\t\treturn " + parms.AccessorName + ";");=0D
+ else if (m_ret !=3D "void")=0D
+ sw.WriteLine ("\t\t\treturn ret;");=0D
=20=0D
sw.Write("\t\t}");=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("Name: " + name + " Type: " + type + " ");=0D
return false;=0D
}=0D
- =09=0D
+=0D
if (p_elem.HasAttribute("array")) {=0D
cs_type +=3D "[]";=0D
m_type +=3D "[]";=0D
@@ -77,9 +77,12 @@
=09=0D
if (need_sep) {=0D
call_string +=3D ", ";=0D
- signature +=3D ", ";=0D
import_sig +=3D ", ";=0D
- signature_types +=3D ":";=0D
+ if (type !=3D "GError**")=0D
+ {=0D
+ signature +=3D ", ";=0D
+ signature_types +=3D ":";=0D
+ }=0D
} else {=0D
need_sep =3D true;=0D
}=0D
@@ -87,9 +90,14 @@
if (p_elem.HasAttribute("pass_as")) {=0D
signature +=3D p_elem.GetAttribute("pass_as") + " ";=0D
}=0D
-=0D
- signature +=3D (cs_type + " " + name);=0D
- signature_types +=3D cs_type;=0D
+ =09=0D
+ if (type =3D=3D "GError**")=0D
+ call_string +=3D "&"; =09=0D
+ else=0D
+ {=0D
+ signature +=3D (cs_type + " " + name);=0D
+ signature_types +=3D cs_type;=0D
+ }=0D
call_string +=3D call_parm;=0D
import_sig +=3D (m_type + " " + 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 "parameter") {=0D
continue;=0D
@@ -107,7 +116,7 @@
XmlElement p_elem =3D (XmlElement) parm;=0D
=20=0D
string type =3D SymbolTable.GetCSType(p_elem.GetAttribute ("type"));=0D
- string name =3D MangleName(p_elem.GetAttribute("name"));=0D
+ name =3D MangleName(p_elem.GetAttribute("name"));=0D
if (is_get) {=0D
sw.WriteLine ("\t\t\t" + type + " " + name + ";");=0D
}=0D
@@ -116,9 +125,18 @@
sw.WriteLine("\t\t\t" + name + " =3D new " + type + "();");=20=0D
}=0D
}=0D
- =09=0D
+=0D
+ if (ThrowsException)=0D
+ sw.WriteLine ("\t\t\tGLib.GError* {0} =3D null;", name);=0D
}=0D
=20=0D
+ public void HandleException (StreamWriter sw)=0D
+ {=0D
+ if (!ThrowsException)=0D
+ return;=0D
+ sw.WriteLine ("\t\t\tif (error !=3D null) throw new GLib.GException (er=
ror);");=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 && pass_as =3D=3D "out");=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 "parameter") {=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("type");=0D
+ return (type =3D=3D "GError**");=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 ("uint1", "bool");=0D
simple_types.Add ("GPtrArray", "System.IntPtr[]");=0D
simple_types.Add ("GType", "int");=0D
+ simple_types.Add ("GError", "GLib.GError**");=0D
=09=0D
// FIXME: These ought to be handled properly.=0D
simple_types.Add ("GList", "System.IntPtr");=0D
@@ -70,6 +71,7 @@
dlls.Add("Pango", "pango-1.0");=0D
dlls.Add("Atk", "atk-1.0");=0D
dlls.Add("Gdk", "gdk-x11-2.0");=0D
+ dlls.Add("Gdk.Imaging", "gdk_pixbuf-2.0");=0D
dlls.Add("Gtk", "gtk-x11-2.0");=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 <hestilow@ximian.com>
+//
+// (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->message)
+ {
+ this.errptr =3D errptr;
+ }
+
+ [DllImport("glib-2.0")]
+ unsafe static extern void g_clear_error (GError **errptr);
+ ~GException ()
+ {
+ unsafe { g_clear_error (&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 ( "Atk" =3D> "atk-1.0.2/atk",
"Pango" =3D> "pango-1.0.2/pango",
"Gdk" =3D> "gtk+-2.0.3/gdk",
+ "Gdk.Imaging" =3D> "gtk+-2.0.3/gdk-pixbuf",
"Gtk" =3D> "gtk+-2.0.3/gtk");
=20
+%c_ns =3D ( "Gdk.Imaging" =3D> "Gdk");
+
foreach $key (keys %ns) {
$dir =3D $ns{$key};
- system ("./gapi_pp.pl $dir | ./gapi2xml.pl $key $file");
+ if (not ($c_key =3D $c_ns{$key})) {
+ $c_key =3D $key;
+ }
+ system ("./gapi_pp.pl $dir | ./gapi2xml.pl $c_key $file --out-ns $key");
}
=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 "Usage: gapi_pp.pl <srcdir> | gapi2xml.pl <namespace> <outfile>\n";
+ die "Usage: gapi_pp.pl <srcdir> | gapi2xml.pl <namespace> <outfile> [--ou=
t-ns outns]\n";
}
=20
$ns =3D $ARGV[0];
=20
+if ($ARGV[2] && $ARGV[2] eq "--out-ns") {
+ $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->createElement('namespace');
-$ns_elem->setAttribute('name', $ns);
+$ns_elem->setAttribute('name', $out_ns);
$root->appendChild($ns_elem);
=20
##############################################################
--=-hO/RavFB8Xhc2KIc/GW8--