diff --git a/Makefile.am b/Makefile.am index 80cacc147..f6c92a58b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ SUBDIRS = sources generator parser glib gio cairo pango atk gdk gtk gtkdotnet sample doc EXTRA_DIST = \ + gapi.xsd \ gtk-sharp.snk \ policy.config.in \ AssemblyInfo.cs.in \ diff --git a/Makefile.include b/Makefile.include index eb97d9133..b884b96e9 100644 --- a/Makefile.include +++ b/Makefile.include @@ -6,11 +6,13 @@ ASSEMBLY_NAME = $(pkg)-sharp ASSEMBLY_NAME_VERSION = $(ASSEMBLY_NAME),Version=$(API_VERSION) ASSEMBLY = $(ASSEMBLY_NAME).dll +GAPI_XSD=$(top_srcdir)/gapi.xsd + TARGET = $(pkg:=-sharp.dll) $(pkg:=-sharp.dll.config) $(POLICY_ASSEMBLIES) noinst_DATA = $(TARGET) TARGET_API = $(pkg:=-api.xml) gapidir = $(datadir)/gapi-3.0 -gapi_DATA = $(TARGET_API) +gapi_DATA = $(TARGET_API) $(GAPI_XSD) CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb $(POLICY_ASSEMBLIES) generated-stamp generated/*.cs $(API) glue/generated.c $(POLICY_CONFIGS) DISTCLEANFILES = $(ASSEMBLY).config @@ -31,13 +33,14 @@ $(API): $(METADATA) $(RAW_API) $(SYMBOLS) $(top_builddir)/parser/gapi-fixup.exe api_includes = $(addprefix -I:, $(INCLUDE_API)) -generated-stamp: $(API) $(INCLUDE_API) $(top_builddir)/generator/gapi_codegen.exe +generated-stamp: $(API) $(INCLUDE_API) $(top_builddir)/generator/gapi_codegen.exe $(GAPI_XSD) rm -f generated/* && \ $(RUNTIME) $(top_builddir)/generator/gapi_codegen.exe --generate $(API) \ $(api_includes) \ --outdir=generated --assembly-name=$(ASSEMBLY_NAME) \ --gluelib-name=$(pkg)sharpglue-3 --glue-filename=glue/generated.c \ --glue-includes=$(glue_includes) \ + --schema=$(GAPI_XSD) \ && touch generated-stamp policy.%.config: $(top_builddir)/policy.config diff --git a/gapi.xsd b/gapi.xsd new file mode 100644 index 000000000..df5dfd51b --- /dev/null +++ b/gapi.xsd @@ -0,0 +1,362 @@ + + + + + GAPI XML schema. + Copyright 2013 Bertrand Lorentz. + + This program is free software; you can redistribute it and/or + modify it under the terms of version 2 of the Lesser GNU General + Public License as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301 USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/opaquetest/Makefile.am b/sample/opaquetest/Makefile.am index 891e9b65e..a1becf803 100644 --- a/sample/opaquetest/Makefile.am +++ b/sample/opaquetest/Makefile.am @@ -18,7 +18,10 @@ libopaque_la_LIBADD = $(GTK_LIBS) INCLUDES = $(GTK_CFLAGS) generated/*.cs: opaque-api.xml - $(RUNTIME) ../../generator/gapi_codegen.exe --generate $(srcdir)/opaque-api.xml --include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml --outdir=generated --assembly-name=opaque-sharp + $(RUNTIME) ../../generator/gapi_codegen.exe --generate $(srcdir)/opaque-api.xml \ + --include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml \ + --outdir=generated --assembly-name=opaque-sharp \ + --schema=$(top_srcdir)/gapi.xsd api: PATH=../../parser:$(PATH) $(RUNTIME) ../../parser/gapi-parser.exe opaque-sources.xml diff --git a/sample/valtest/Makefile.am b/sample/valtest/Makefile.am index ca79ee92a..209535e2a 100644 --- a/sample/valtest/Makefile.am +++ b/sample/valtest/Makefile.am @@ -18,7 +18,10 @@ libvalobj_la_LIBADD = $(GTK_LIBS) INCLUDES = $(GTK_CFLAGS) Valobj.cs: valobj-api.xml - $(RUNTIME) ../../generator/gapi_codegen.exe --generate $(srcdir)/valobj-api.xml --include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml --outdir=. --assembly-name=valobj-sharp + $(RUNTIME) ../../generator/gapi_codegen.exe --generate $(srcdir)/valobj-api.xml \ + --include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml \ + --outdir=. --assembly-name=valobj-sharp \ + --schema=$(top_srcdir)/gapi.xsd api: PATH=../../parser:$(PATH) $(RUNTIME) ../../parser/gapi-parser.exe valobj-sources.xml