@echo OFF

cd ..\..\gtksourceview

if exist gtksourceview-typebuiltins.h del gtksourceview-typebuiltins.h
if exist gtksourceview-typebuiltins.c del gtksourceview-typebuiltins.c

call perl %1\bin\glib-mkenums ^
--fhead "#ifdef HAVE_CONFIG_H\n" ^
--fhead "#include \"config.h\"\n" ^
--fhead "#endif\n\n" ^
--fhead "#include <glib-object.h>\n" ^
--fhead "#include \"gtksourceview-typebuiltins.h\"\n\n" ^
--fprod "\n/* enumerations from \"@filename@\" */" ^
--vhead "static const G@Type@Value _@enum_name@_values[] = {" ^
--vprod "  { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," ^
--vtail "  { 0, NULL, NULL }\n};\n\n" ^
--vtail "GType\n@enum_name@_get_type (void)\n{\n" ^
--vtail "  static GType type = 0;\n\n" ^
--vtail "  if (!type)\n" ^
--vtail "    type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" ^
--vtail "  return type;\n}\n\n" ^
#include "enum.headers"
&1> gtksourceview-typebuiltins.c

call perl %1\bin\glib-mkenums ^
--fhead "#ifndef __GTKSOURCEVIEW_TYPEBUILTINS_H__\n" ^
--fhead "#define __GTKSOURCEVIEW_TYPEBUILTINS_H__\n\n" ^
--ftail "#endif /* __GTKSOURCEVIEW_TYPEBUILTINS_H__ */\n" ^
--fprod "#include <gtksourceview/@filename@>\n" ^
--eprod "G_BEGIN_DECLS\n" ^
--eprod "#define GTK_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" ^
--eprod "GTK_SOURCE_ENUM_EXTERN\nGType @enum_name@_get_type (void);\n" ^
--eprod "G_END_DECLS\n\n" ^
# include "enum.headers"
&1> gtksourceview-typebuiltins.h


call perl -p -i.tmp -e "s/GTK_TYPE_SOURCE_/GTK_SOURCE_TYPE_/g" gtksourceview-typebuiltins.h
del gtksourceview-typebuiltins.h.tmp
