From 65fec771bb67398915b3809c3697f23c17a755cb Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Tue, 7 Oct 2003 05:52:23 +0000 Subject: [PATCH] 2003-10-06 Mike Kestner * Makefile.in : add gtkhtml dir. * configure.in : expand gtkhtml/Makefile * api/Makefile.in : remove gtkhtml-api.xml * generator/CodeGenerator.cs : parse new --outdir, --customdir, and --assembly-name args. * generator/GenerationInfo.cs (Ctor): new (dir, dir,assembly) ctor * gtkhtml/HTMLStream.custom : moved here from gtk dir * gtkhtml/gtkhtml-api.xml : moved here from api dir * gtkhtml/Makefile.in : gen source and build dll * sources/gtk-sharp-sources.xml : write gtkhtml api to new dir svn path=/trunk/gtk-sharp/; revision=18696 --- ChangeLog | 13 ++++++++ Makefile.in | 2 +- api/Makefile.in | 1 - configure.in | 1 + generator/CodeGenerator.cs | 24 +++++++++++++- generator/GenerationInfo.cs | 6 ++-- {gtk => gtkhtml}/HTMLStream.custom | 0 gtkhtml/Makefile.in | 53 +++++++++++++++++++----------- {api => gtkhtml}/gtkhtml-api.xml | 0 sources/gtk-sharp-sources.xml | 2 +- 10 files changed, 76 insertions(+), 26 deletions(-) rename {gtk => gtkhtml}/HTMLStream.custom (100%) rename {api => gtkhtml}/gtkhtml-api.xml (100%) diff --git a/ChangeLog b/ChangeLog index d51fdfc55..c1af19c42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2003-10-06 Mike Kestner + + * Makefile.in : add gtkhtml dir. + * configure.in : expand gtkhtml/Makefile + * api/Makefile.in : remove gtkhtml-api.xml + * generator/CodeGenerator.cs : parse new --outdir, --customdir, + and --assembly-name args. + * generator/GenerationInfo.cs (Ctor): new (dir, dir,assembly) ctor + * gtkhtml/HTMLStream.custom : moved here from gtk dir + * gtkhtml/gtkhtml-api.xml : moved here from api dir + * gtkhtml/Makefile.in : gen source and build dll + * sources/gtk-sharp-sources.xml : write gtkhtml api to new dir + 2003-10-06 Artem Popov * gtk/Dialog.custom : Action area is an HButtonBox, not a VBox. diff --git a/Makefile.in b/Makefile.in index ea7596b42..41e2f883e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ NATIVE_DIRS = glue parser -DIRS=generator api glib pango atk gdk gtk glade art gnome gda gnomedb gconf rsvg sample +DIRS=generator api glib pango atk gdk gtk glade art gnome gtkhtml gda gnomedb gconf rsvg sample ROOT=/cygdrive/$(subst \,/,$(subst :\,/,$(SYSTEMROOT))) CSC=$(ROOT)/microsoft.net/framework/v1.0.3705/csc.exe MCS=mcs diff --git a/api/Makefile.in b/api/Makefile.in index 88a422d04..9853a686c 100644 --- a/api/Makefile.in +++ b/api/Makefile.in @@ -4,7 +4,6 @@ APIS = \ gdk-api.xml \ gdk-symbols.xml \ gtk-api.xml \ - gtkhtml-api.xml \ gtk-symbols.xml \ glade-api.xml \ art-api.xml \ diff --git a/configure.in b/configure.in index 3c6c7c8d1..91d629253 100644 --- a/configure.in +++ b/configure.in @@ -127,6 +127,7 @@ gconf/GConf/Makefile gconf/GConf.PropertyEditors/Makefile gconf/tools/Makefile gst/Makefile +gtkhtml/Makefile rsvg/Makefile sample/Makefile sample/rsvg/Makefile diff --git a/generator/CodeGenerator.cs b/generator/CodeGenerator.cs index bc068a1a6..cc5cca62c 100644 --- a/generator/CodeGenerator.cs +++ b/generator/CodeGenerator.cs @@ -21,6 +21,9 @@ namespace GtkSharp.Generation { bool generate = false; bool include = false; + string dir = ""; + string custom_dir = ""; + string assembly_name = ""; SymbolTable table = SymbolTable.Table; ArrayList gens = new ArrayList (); @@ -33,6 +36,18 @@ namespace GtkSharp.Generation { generate = false; include = true; continue; + } else if (arg.StartsWith ("--outdir=")) { + include = generate = false; + dir = arg.Substring (9); + continue; + } else if (arg.StartsWith ("--customdir=")) { + include = generate = false; + custom_dir = arg.Substring (12); + continue; + } else if (arg.StartsWith ("--assembly-name=")) { + include = generate = false; + assembly_name = arg.Substring (16); + continue; } Parser p = new Parser (); @@ -41,9 +56,16 @@ namespace GtkSharp.Generation { if (generate) gens.AddRange (curr_gens); } + + GenerationInfo gen_info = null; + if (dir != "" || assembly_name != "") + gen_info = new GenerationInfo (dir, custom_dir, assembly_name); foreach (IGeneratable gen in gens) { - gen.Generate (); + if (gen_info == null) + gen.Generate (); + else + gen.Generate (gen_info); } ObjectGen.GenerateMappers (); diff --git a/generator/GenerationInfo.cs b/generator/GenerationInfo.cs index 8a773dc5c..101cf4798 100644 --- a/generator/GenerationInfo.cs +++ b/generator/GenerationInfo.cs @@ -27,10 +27,12 @@ namespace GtkSharp.Generation { assembly_name = ns_name.ToLower () + "-sharp"; } - public GenerationInfo (string dir, string assembly_name) + public GenerationInfo (string dir, string assembly_name) : this (dir, dir, assembly_name) {} + + public GenerationInfo (string dir, string custom_dir, string assembly_name) { this.dir = dir; - custom_dir = dir; + this.custom_dir = custom_dir; this.assembly_name = assembly_name; } diff --git a/gtk/HTMLStream.custom b/gtkhtml/HTMLStream.custom similarity index 100% rename from gtk/HTMLStream.custom rename to gtkhtml/HTMLStream.custom diff --git a/gtkhtml/Makefile.in b/gtkhtml/Makefile.in index ce6cd1a8b..70981adf1 100755 --- a/gtkhtml/Makefile.in +++ b/gtkhtml/Makefile.in @@ -1,29 +1,42 @@ -MCS=mcs -DESTDIR= +INCLUDE_APIS = \ + ../api/atk-api.xml \ + ../api/pango-api.xml \ + ../api/gdk-api.xml \ + ../api/gdk-symbols.xml \ + ../api/gtk-symbols.xml \ + ../api/gtk-api.xml -all: linux +NONINCLUDE_APIS = \ + glade-api.xml \ + art-api.xml \ + gnome-api.xml \ + gda-api.xml \ + gst-api.xml \ + gnomedb-api.xml \ + rsvg-api.xml \ -windows: - $(CSC) /unsafe /target:library \ - /r:../glib/glib-sharp.dll /r:../pango/pango-sharp.dll \ - /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll \ - /r:../gtk/gtk-sharp.dll /r:../gnome/gnome-sharp.dll \ - /out:gtkhtml-sharp.dll /recurse:*.cs -linux: gtkhtml-sharp.dll +RUNTIME=mono -gtkhtml-sharp.dll: generated/*.cs - $(MCS) --unsafe -nowarn:0660,0661 --target library \ - -r ../glib/glib-sharp.dll -r ../pango/pango-sharp.dll \ - -r ../atk/atk-sharp.dll -r ../gdk/gdk-sharp.dll \ - -r ../gtk/gtk-sharp.dll -r ../gnome/gnome-sharp.dll \ - -o gtkhtml-sharp.dll --recurse '*.cs' +all: gtkhtml-sharp.dll + +generated-stamp: gtkhtml-api.xml *.custom ../generator/gapi_codegen.exe + $(RUNTIME) ../generator/gapi_codegen.exe --generate gtkhtml-api.xml --include $(INCLUDE_APIS) --outdir=generated --customdir=. --assembly-name=gtkhtml-sharp && touch generated-stamp + +gtkhtml-sharp.dll: generated-stamp + $(MCS) --unsafe -nowarn:0660,0661 --target library -L ../glib -L ../pango -L ../atk -L ../gdk -L ../gtk -r glib-sharp.dll -r pango-sharp.dll -r atk-sharp.dll -r gdk-sharp.dll -r gtk-sharp.dll -o gtkhtml-sharp.dll --recurse '*.cs' clean: - rm -f *.dll + rm -f generated-stamp + rm -f gtkhtml-sharp.dll rm -rf generated -install: all - ../mkinstalldirs $(DESTDIR)@prefix@/lib && \ - cp gtkhtml-sharp.dll $(DESTDIR)@prefix@/lib +prefix=@prefix@ +DESTDIR= +apidir=$(DESTDIR)$(prefix)/share/gapi +libdir=$(DESTDIR)$(prefix)/lib +install: all + ../mkinstalldirs $(apidir) && \ + cp gtkhtml-api.xml $(apidir) && \ + cp gtkhtml-sharp.dll $(libdir) diff --git a/api/gtkhtml-api.xml b/gtkhtml/gtkhtml-api.xml similarity index 100% rename from api/gtkhtml-api.xml rename to gtkhtml/gtkhtml-api.xml diff --git a/sources/gtk-sharp-sources.xml b/sources/gtk-sharp-sources.xml index 4a5a7e44a..37fb3fba7 100644 --- a/sources/gtk-sharp-sources.xml +++ b/sources/gtk-sharp-sources.xml @@ -60,7 +60,7 @@ - + gtkhtml-3.0.8/src