include: Add rmxftmpl.h with contents generated from rmxftmpl.x.

Dylan Smith dylan.ah.smith at gmail.com
Thu Apr 7 10:33:04 CDT 2011


---
 .gitignore           |    1 +
 include/rmxftmpl.h   |  305 ++++++++++++++++++++++++++++++++++++++
 include/rmxftmpl.x   |  268 +++++++++++++++++++++++++++++++++
 tools/Makefile.in    |    5 +
 tools/binencxftmpl.c |  399 ++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 978 insertions(+), 0 deletions(-)
 create mode 100644 include/rmxftmpl.h
 create mode 100644 include/rmxftmpl.x
 create mode 100644 tools/binencxftmpl.c

diff --git a/.gitignore b/.gitignore
index 84bddc8..89cf850 100644
--- a/.gitignore
+++ b/.gitignore
@@ -279,6 +279,7 @@ tools/make_ctests
 tools/makedep
 tools/relpath
 tools/sfnt2fnt
+tools/binencxftmpl
 tools/widl/parser.tab.c
 tools/widl/parser.tab.h
 tools/widl/parser.yy.c
diff --git a/include/rmxftmpl.h b/include/rmxftmpl.h
new file mode 100644
index 0000000..1642d56
--- /dev/null
+++ b/include/rmxftmpl.h
@@ -0,0 +1,305 @@
+/*
+ * Copyright (C) 2011 Dylan Smith
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_RMXFTMPL_H
+#define __WINE_RMXFTMPL_H
+
+/* sizeof(D3DRM_XTEMPLATES) */
+#define D3DRM_XTEMPLATE_BYTES 3278
+
+/* Contents of D3DRM_XTEMPLATES generated using:
+ * ../tools/binencxftmpl rmxftmpl.x | xxd -i
+ */
+unsigned char D3DRM_XTEMPLATES[] = {
+  0x78, 0x6f, 0x66, 0x20, 0x30, 0x33, 0x30, 0x32, 0x62, 0x69, 0x6e, 0x20,
+  0x30, 0x30, 0x36, 0x34, 0x1f, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x0a, 0x00, 0x05, 0x00, 0x43, 0xab,
+  0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71,
+  0xe4, 0x33, 0x28, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x6d, 0x61,
+  0x6a, 0x6f, 0x72, 0x14, 0x00, 0x28, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00,
+  0x00, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x14, 0x00, 0x29, 0x00, 0x01, 0x00,
+  0x05, 0x00, 0x00, 0x00, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x14, 0x00, 0x0b,
+  0x00, 0x1f, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x56, 0x65, 0x63,
+  0x74, 0x6f, 0x72, 0x0a, 0x00, 0x05, 0x00, 0x5e, 0xab, 0x82, 0x3d, 0xda,
+  0x62, 0xcf, 0x11, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x2a,
+  0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, 0x14, 0x00, 0x2a, 0x00,
+  0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x79, 0x14, 0x00, 0x2a, 0x00, 0x01,
+  0x00, 0x01, 0x00, 0x00, 0x00, 0x7a, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00,
+  0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x73,
+  0x32, 0x64, 0x0a, 0x00, 0x05, 0x00, 0x44, 0x3f, 0xf2, 0xf6, 0x86, 0x76,
+  0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x2a, 0x00,
+  0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x14, 0x00, 0x2a, 0x00, 0x01,
+  0x00, 0x01, 0x00, 0x00, 0x00, 0x76, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00,
+  0x01, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78,
+  0x34, 0x78, 0x34, 0x0a, 0x00, 0x05, 0x00, 0x45, 0x3f, 0xf2, 0xf6, 0x86,
+  0x76, 0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x34,
+  0x00, 0x2a, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x74,
+  0x72, 0x69, 0x78, 0x0e, 0x00, 0x03, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0f,
+  0x00, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x09, 0x00, 0x00,
+  0x00, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, 0x0a, 0x00,
+  0x05, 0x00, 0xe0, 0x44, 0xff, 0x35, 0x7c, 0x6c, 0xcf, 0x11, 0x8f, 0x52,
+  0x00, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x2a, 0x00, 0x01, 0x00, 0x03, 0x00,
+  0x00, 0x00, 0x72, 0x65, 0x64, 0x14, 0x00, 0x2a, 0x00, 0x01, 0x00, 0x05,
+  0x00, 0x00, 0x00, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x14, 0x00, 0x2a, 0x00,
+  0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x62, 0x6c, 0x75, 0x65, 0x14, 0x00,
+  0x2a, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x61, 0x6c, 0x70, 0x68,
+  0x61, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00,
+  0x00, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x0a, 0x00, 0x05,
+  0x00, 0x81, 0x6e, 0xe1, 0xd3, 0x35, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0x00,
+  0x40, 0x33, 0x35, 0x94, 0xa3, 0x2a, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00,
+  0x00, 0x72, 0x65, 0x64, 0x14, 0x00, 0x2a, 0x00, 0x01, 0x00, 0x05, 0x00,
+  0x00, 0x00, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x14, 0x00, 0x2a, 0x00, 0x01,
+  0x00, 0x04, 0x00, 0x00, 0x00, 0x62, 0x6c, 0x75, 0x65, 0x14, 0x00, 0x0b,
+  0x00, 0x1f, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x49, 0x6e, 0x64,
+  0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x0a, 0x00, 0x05,
+  0x00, 0x20, 0xb8, 0x30, 0x16, 0x42, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0x00,
+  0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00,
+  0x00, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x14, 0x00, 0x01, 0x00, 0x09, 0x00,
+  0x00, 0x00, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, 0x01,
+  0x00, 0x0a, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x43, 0x6f,
+  0x6c, 0x6f, 0x72, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x07,
+  0x00, 0x00, 0x00, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x0a, 0x00,
+  0x05, 0x00, 0xa0, 0xa6, 0x7d, 0x53, 0x37, 0xca, 0xd0, 0x11, 0x94, 0x1c,
+  0x00, 0x80, 0xc8, 0x0c, 0xfa, 0x7b, 0x29, 0x00, 0x01, 0x00, 0x09, 0x00,
+  0x00, 0x00, 0x74, 0x72, 0x75, 0x65, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x14,
+  0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x09, 0x00, 0x00, 0x00, 0x42,
+  0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x32, 0x64, 0x0a, 0x00, 0x05, 0x00,
+  0x63, 0xae, 0x85, 0x48, 0xe8, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40,
+  0x33, 0x35, 0x94, 0xa3, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x42, 0x6f,
+  0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75,
+  0x14, 0x00, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x42, 0x6f, 0x6f, 0x6c,
+  0x65, 0x61, 0x6e, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x76, 0x14, 0x00,
+  0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x4d, 0x61,
+  0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x57, 0x72, 0x61, 0x70, 0x0a, 0x00,
+  0x05, 0x00, 0x60, 0xae, 0x85, 0x48, 0xe8, 0x78, 0xcf, 0x11, 0x8f, 0x52,
+  0x00, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x01, 0x00, 0x01, 0x00, 0x00,
+  0x00, 0x75, 0x14, 0x00, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x42, 0x6f,
+  0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x76,
+  0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00,
+  0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x6e,
+  0x61, 0x6d, 0x65, 0x0a, 0x00, 0x05, 0x00, 0xe1, 0x90, 0x27, 0xa4, 0x10,
+  0x78, 0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x31,
+  0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x66, 0x69, 0x6c, 0x65, 0x6e,
+  0x61, 0x6d, 0x65, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x08,
+  0x00, 0x00, 0x00, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x0a,
+  0x00, 0x05, 0x00, 0x4d, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab,
+  0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x01, 0x00, 0x09, 0x00, 0x00,
+  0x00, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, 0x01, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0x66, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6c, 0x6f,
+  0x72, 0x14, 0x00, 0x2a, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x70,
+  0x6f, 0x77, 0x65, 0x72, 0x14, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x01, 0x00, 0x0d, 0x00,
+  0x00, 0x00, 0x73, 0x70, 0x65, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x43, 0x6f,
+  0x6c, 0x6f, 0x72, 0x14, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x43,
+  0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x01, 0x00, 0x0d, 0x00, 0x00,
+  0x00, 0x65, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x6c,
+  0x6f, 0x72, 0x14, 0x00, 0x0e, 0x00, 0x12, 0x00, 0x12, 0x00, 0x12, 0x00,
+  0x0f, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, 0x0a, 0x00, 0x05, 0x00,
+  0x5f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0x00, 0x20,
+  0xaf, 0x71, 0xe4, 0x33, 0x29, 0x00, 0x01, 0x00, 0x12, 0x00, 0x00, 0x00,
+  0x6e, 0x46, 0x61, 0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49,
+  0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x14, 0x00, 0x34, 0x00, 0x29, 0x00,
+  0x01, 0x00, 0x11, 0x00, 0x00, 0x00, 0x66, 0x61, 0x63, 0x65, 0x56, 0x65,
+  0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x0e,
+  0x00, 0x01, 0x00, 0x12, 0x00, 0x00, 0x00, 0x6e, 0x46, 0x61, 0x63, 0x65,
+  0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65,
+  0x73, 0x0f, 0x00, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x0d,
+  0x00, 0x00, 0x00, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, 0x57,
+  0x72, 0x61, 0x70, 0x73, 0x0a, 0x00, 0x05, 0x00, 0xc0, 0xc5, 0x1e, 0xed,
+  0xa8, 0xc0, 0xd0, 0x11, 0x94, 0x1c, 0x00, 0x80, 0xc8, 0x0c, 0xfa, 0x7b,
+  0x29, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x6e, 0x46, 0x61, 0x63,
+  0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x14,
+  0x00, 0x34, 0x00, 0x01, 0x00, 0x09, 0x00, 0x00, 0x00, 0x42, 0x6f, 0x6f,
+  0x6c, 0x65, 0x61, 0x6e, 0x32, 0x64, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00,
+  0x66, 0x61, 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75,
+  0x65, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x6e, 0x46,
+  0x61, 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65,
+  0x73, 0x0f, 0x00, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x11,
+  0x00, 0x00, 0x00, 0x4d, 0x65, 0x73, 0x68, 0x54, 0x65, 0x78, 0x74, 0x75,
+  0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x0a, 0x00, 0x05, 0x00,
+  0x40, 0x3f, 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40,
+  0x33, 0x35, 0x94, 0xa3, 0x29, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00,
+  0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72,
+  0x64, 0x73, 0x14, 0x00, 0x34, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x43, 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x32, 0x64, 0x01, 0x00, 0x0d, 0x00,
+  0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f,
+  0x72, 0x64, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x6e,
+  0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72, 0x64,
+  0x73, 0x0f, 0x00, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x10,
+  0x00, 0x00, 0x00, 0x4d, 0x65, 0x73, 0x68, 0x4d, 0x61, 0x74, 0x65, 0x72,
+  0x69, 0x61, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x0a, 0x00, 0x05, 0x00, 0x42,
+  0x3f, 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40, 0x33,
+  0x35, 0x94, 0xa3, 0x29, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x6e,
+  0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x14, 0x00, 0x29,
+  0x00, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x6e, 0x46, 0x61, 0x63, 0x65,
+  0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x14, 0x00, 0x34, 0x00, 0x29,
+  0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x66, 0x61, 0x63, 0x65, 0x49,
+  0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x0c, 0x00,
+  0x00, 0x00, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78,
+  0x65, 0x73, 0x0f, 0x00, 0x14, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x08, 0x00,
+  0x00, 0x00, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x0f, 0x00,
+  0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x4d, 0x65,
+  0x73, 0x68, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x0a, 0x00, 0x05,
+  0x00, 0x43, 0x3f, 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0x00,
+  0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00,
+  0x00, 0x6e, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0x00, 0x34,
+  0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x56, 0x65, 0x63, 0x74, 0x6f,
+  0x72, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6e, 0x6f, 0x72, 0x6d, 0x61,
+  0x6c, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6e, 0x4e,
+  0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x0f, 0x00, 0x14, 0x00, 0x29, 0x00,
+  0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x4e,
+  0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0x00, 0x34, 0x00, 0x01, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65,
+  0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x66, 0x61, 0x63, 0x65, 0x4e, 0x6f,
+  0x72, 0x6d, 0x61, 0x6c, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x00,
+  0x00, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c,
+  0x73, 0x0f, 0x00, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x10,
+  0x00, 0x00, 0x00, 0x4d, 0x65, 0x73, 0x68, 0x56, 0x65, 0x72, 0x74, 0x65,
+  0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x0a, 0x00, 0x05, 0x00, 0x21,
+  0xb8, 0x30, 0x16, 0x42, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40, 0x33,
+  0x35, 0x94, 0xa3, 0x29, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x6e,
+  0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73,
+  0x14, 0x00, 0x34, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x49, 0x6e,
+  0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x01, 0x00,
+  0x0c, 0x00, 0x00, 0x00, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f,
+  0x6c, 0x6f, 0x72, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x00, 0x00,
+  0x6e, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
+  0x73, 0x0f, 0x00, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x04,
+  0x00, 0x00, 0x00, 0x4d, 0x65, 0x73, 0x68, 0x0a, 0x00, 0x05, 0x00, 0x44,
+  0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0x00, 0x20, 0xaf,
+  0x71, 0xe4, 0x33, 0x29, 0x00, 0x01, 0x00, 0x09, 0x00, 0x00, 0x00, 0x6e,
+  0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x14, 0x00, 0x34, 0x00,
+  0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72,
+  0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63,
+  0x65, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x09, 0x00, 0x00, 0x00, 0x6e, 0x56,
+  0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x0f, 0x00, 0x14, 0x00, 0x29,
+  0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6e, 0x46, 0x61, 0x63, 0x65,
+  0x73, 0x14, 0x00, 0x34, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4d,
+  0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, 0x01, 0x00, 0x05, 0x00, 0x00,
+  0x00, 0x66, 0x61, 0x63, 0x65, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x06, 0x00,
+  0x00, 0x00, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x73, 0x0f, 0x00, 0x14, 0x00,
+  0x0e, 0x00, 0x12, 0x00, 0x12, 0x00, 0x12, 0x00, 0x0f, 0x00, 0x0b, 0x00,
+  0x1f, 0x00, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x46, 0x72, 0x61, 0x6d,
+  0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x4d, 0x61,
+  0x74, 0x72, 0x69, 0x78, 0x0a, 0x00, 0x05, 0x00, 0x41, 0x3f, 0xf2, 0xf6,
+  0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3,
+  0x01, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78,
+  0x34, 0x78, 0x34, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x66, 0x72, 0x61,
+  0x6d, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x14, 0x00, 0x0b, 0x00,
+  0x1f, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x72, 0x61, 0x6d,
+  0x65, 0x0a, 0x00, 0x05, 0x00, 0x46, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf,
+  0x11, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x0e, 0x00, 0x12,
+  0x00, 0x12, 0x00, 0x12, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01,
+  0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65,
+  0x79, 0x73, 0x0a, 0x00, 0x05, 0x00, 0xa9, 0x46, 0xdd, 0x10, 0x5b, 0x77,
+  0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0x00,
+  0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65,
+  0x73, 0x14, 0x00, 0x34, 0x00, 0x2a, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00,
+  0x00, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x07,
+  0x00, 0x00, 0x00, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x0f, 0x00,
+  0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00,
+  0x54, 0x69, 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65,
+  0x79, 0x73, 0x0a, 0x00, 0x05, 0x00, 0x80, 0xb1, 0x06, 0xf4, 0x3b, 0x7b,
+  0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0x00,
+  0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x74, 0x69, 0x6d, 0x65, 0x14, 0x00,
+  0x01, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b,
+  0x65, 0x79, 0x73, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x66, 0x6b,
+  0x65, 0x79, 0x73, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x0c,
+  0x00, 0x00, 0x00, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+  0x4b, 0x65, 0x79, 0x0a, 0x00, 0x05, 0x00, 0xa8, 0x46, 0xdd, 0x10, 0x5b,
+  0x77, 0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29,
+  0x00, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6b, 0x65, 0x79, 0x54, 0x79,
+  0x70, 0x65, 0x14, 0x00, 0x29, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00,
+  0x6e, 0x4b, 0x65, 0x79, 0x73, 0x14, 0x00, 0x34, 0x00, 0x01, 0x00, 0x0e,
+  0x00, 0x00, 0x00, 0x54, 0x69, 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61,
+  0x74, 0x4b, 0x65, 0x79, 0x73, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6b,
+  0x65, 0x79, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x6e,
+  0x4b, 0x65, 0x79, 0x73, 0x0f, 0x00, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00,
+  0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74,
+  0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x00,
+  0x05, 0x00, 0xc0, 0x56, 0xbf, 0xe2, 0x0f, 0x84, 0xcf, 0x11, 0x8f, 0x52,
+  0x00, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0x00, 0x01, 0x00, 0x0a, 0x00,
+  0x00, 0x00, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64,
+  0x14, 0x00, 0x29, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x70, 0x6f,
+  0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74,
+  0x79, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x09, 0x00, 0x00,
+  0x00, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x00,
+  0x05, 0x00, 0x4f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39,
+  0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x0e, 0x00, 0x12, 0x00, 0x12, 0x00,
+  0x12, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x0c, 0x00,
+  0x00, 0x00, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53,
+  0x65, 0x74, 0x0a, 0x00, 0x05, 0x00, 0x50, 0xab, 0x82, 0x3d, 0xda, 0x62,
+  0xcf, 0x11, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x0e, 0x00,
+  0x01, 0x00, 0x09, 0x00, 0x00, 0x00, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74,
+  0x69, 0x6f, 0x6e, 0x0f, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x0a,
+  0x00, 0x00, 0x00, 0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74,
+  0x61, 0x0a, 0x00, 0x05, 0x00, 0xa0, 0xee, 0x23, 0x3a, 0xb1, 0x94, 0xd0,
+  0x11, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x0e, 0x00, 0x01,
+  0x00, 0x06, 0x00, 0x00, 0x00, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x0f,
+  0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x55,
+  0x72, 0x6c, 0x0a, 0x00, 0x05, 0x00, 0xa1, 0xee, 0x23, 0x3a, 0xb1, 0x94,
+  0xd0, 0x11, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29, 0x00,
+  0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x6e, 0x55, 0x72, 0x6c, 0x73, 0x14,
+  0x00, 0x34, 0x00, 0x31, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x75,
+  0x72, 0x6c, 0x73, 0x0e, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x6e,
+  0x55, 0x72, 0x6c, 0x73, 0x0f, 0x00, 0x14, 0x00, 0x0b, 0x00, 0x1f, 0x00,
+  0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65,
+  0x73, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x68, 0x0a, 0x00, 0x05,
+  0x00, 0x60, 0xc3, 0x63, 0x8a, 0x7d, 0x99, 0xd0, 0x11, 0x94, 0x1c, 0x00,
+  0x80, 0xc8, 0x0c, 0xfa, 0x7b, 0x0e, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00,
+  0x00, 0x55, 0x72, 0x6c, 0x13, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x00, 0x00,
+  0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x0f, 0x00,
+  0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x75,
+  0x69, 0x64, 0x0a, 0x00, 0x05, 0x00, 0xe0, 0x90, 0x27, 0xa4, 0x10, 0x78,
+  0xcf, 0x11, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0x00,
+  0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x64, 0x61, 0x74, 0x61, 0x31, 0x14,
+  0x00, 0x28, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x64, 0x61, 0x74,
+  0x61, 0x32, 0x14, 0x00, 0x28, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00,
+  0x64, 0x61, 0x74, 0x61, 0x33, 0x14, 0x00, 0x34, 0x00, 0x2d, 0x00, 0x01,
+  0x00, 0x05, 0x00, 0x00, 0x00, 0x64, 0x61, 0x74, 0x61, 0x34, 0x0e, 0x00,
+  0x03, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x14, 0x00, 0x0b, 0x00,
+  0x1f, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x53, 0x74, 0x72, 0x69,
+  0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x0a, 0x00,
+  0x05, 0x00, 0xe0, 0x21, 0x0f, 0x7f, 0xe1, 0xbf, 0xd1, 0x11, 0x82, 0xc0,
+  0x00, 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x31, 0x00, 0x01, 0x00, 0x03, 0x00,
+  0x00, 0x00, 0x6b, 0x65, 0x79, 0x14, 0x00, 0x31, 0x00, 0x01, 0x00, 0x05,
+  0x00, 0x00, 0x00, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x14, 0x00, 0x0b, 0x00,
+  0x1f, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x50, 0x72, 0x6f, 0x70,
+  0x65, 0x72, 0x74, 0x79, 0x42, 0x61, 0x67, 0x0a, 0x00, 0x05, 0x00, 0xe1,
+  0x21, 0x0f, 0x7f, 0xe1, 0xbf, 0xd1, 0x11, 0x82, 0xc0, 0x00, 0xa0, 0xc9,
+  0x69, 0x72, 0x71, 0x0e, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x53,
+  0x74, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74,
+  0x79, 0x0f, 0x00, 0x0b, 0x00, 0x1f, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00,
+  0x00, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x69, 0x73,
+  0x75, 0x61, 0x6c, 0x0a, 0x00, 0x05, 0x00, 0xa0, 0x6a, 0x11, 0x98, 0xba,
+  0xbd, 0xd1, 0x11, 0x82, 0xc0, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x01,
+  0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x75, 0x69, 0x64, 0x01, 0x00, 0x12,
+  0x00, 0x00, 0x00, 0x67, 0x75, 0x69, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72,
+  0x6e, 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, 0x61, 0x6c, 0x14, 0x00, 0x0e,
+  0x00, 0x12, 0x00, 0x12, 0x00, 0x12, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x1f,
+  0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x52, 0x69, 0x67, 0x68, 0x74,
+  0x48, 0x61, 0x6e, 0x64, 0x65, 0x64, 0x0a, 0x00, 0x05, 0x00, 0xa0, 0x5e,
+  0x5d, 0x7f, 0x3a, 0xd5, 0xd1, 0x11, 0x82, 0xc0, 0x00, 0xa0, 0xc9, 0x69,
+  0x72, 0x71, 0x29, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x62, 0x52,
+  0x69, 0x67, 0x68, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x65, 0x64, 0x14, 0x00,
+  0x0b, 0x00
+};
+
+#endif /* __WINE_RMXFTMPL_H */
diff --git a/include/rmxftmpl.x b/include/rmxftmpl.x
new file mode 100644
index 0000000..e7144b0
--- /dev/null
+++ b/include/rmxftmpl.x
@@ -0,0 +1,268 @@
+xof 0302txt 0064
+// Copyright (C) 2011 Dylan Smith
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library 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 library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+template Header
+{
+    <3D82AB43-62DA-11CF-AB39-0020AF71E433>
+    WORD major;
+    WORD minor;
+    DWORD flags;
+}
+
+template Vector
+{
+    <3D82AB5E-62DA-11CF-AB39-0020AF71E433>
+    FLOAT x;
+    FLOAT y;
+    FLOAT z;
+}
+
+template Coords2d
+{
+    <F6F23F44-7686-11CF-8F52-0040333594A3>
+    FLOAT u;
+    FLOAT v;
+}
+
+template Matrix4x4
+{
+    <F6F23F45-7686-11CF-8F52-0040333594A3>
+    array FLOAT matrix[16];
+}
+
+template ColorRGBA
+{
+    <35FF44E0-6C7C-11CF-8F52-0040333594A3>
+    FLOAT red;
+    FLOAT green;
+    FLOAT blue;
+    FLOAT alpha;
+}
+
+template ColorRGB
+{
+    <D3E16E81-7835-11CF-8F52-0040333594A3>
+    FLOAT red;
+    FLOAT green;
+    FLOAT blue;
+}
+
+template IndexedColor
+{
+    <1630B820-7842-11CF-8F52-0040333594A3>
+    DWORD index;
+    ColorRGBA indexColor;
+}
+
+template Boolean
+{
+    <537DA6A0-CA37-11D0-941C-0080C80CFA7B>
+    DWORD truefalse;
+}
+
+template Boolean2d
+{
+    <4885AE63-78E8-11CF-8F52-0040333594A3>
+    Boolean u;
+    Boolean v;
+}
+
+template MaterialWrap
+{
+    <4885AE60-78E8-11CF-8F52-0040333594A3>
+    Boolean u;
+    Boolean v;
+}
+
+template TextureFilename
+{
+    <A42790E1-7810-11CF-8F52-0040333594A3>
+    STRING filename;
+}
+
+template Material
+{
+    <3D82AB4D-62DA-11CF-AB39-0020AF71E433>
+    ColorRGBA faceColor;
+    FLOAT power;
+    ColorRGB specularColor;
+    ColorRGB emissiveColor;
+    [ ... ]
+}
+
+template MeshFace
+{
+    <3D82AB5F-62DA-11CF-AB39-0020AF71E433>
+    DWORD nFaceVertexIndices;
+    array DWORD faceVertexIndices[nFaceVertexIndices];
+}
+
+template MeshFaceWraps
+{
+    <ED1EC5C0-C0A8-11D0-941C-0080C80CFA7B>
+    DWORD nFaceWrapValues;
+    array Boolean2d faceWrapValues[nFaceWrapValues];
+}
+
+template MeshTextureCoords
+{
+    <F6F23F40-7686-11CF-8F52-0040333594A3>
+    DWORD nTextureCoords;
+    array Coords2d textureCoords[nTextureCoords];
+}
+
+template MeshMaterialList
+{
+    <F6F23F42-7686-11CF-8F52-0040333594A3>
+    DWORD nMaterials;
+    DWORD nFaceIndexes;
+    array DWORD faceIndexes[nFaceIndexes];
+    [ Material ]
+}
+
+template MeshNormals
+{
+    <F6F23F43-7686-11CF-8F52-0040333594A3>
+    DWORD nNormals;
+    array Vector normals[nNormals];
+    DWORD nFaceNormals;
+    array MeshFace faceNormals[nFaceNormals];
+}
+
+template MeshVertexColors
+{
+    <1630B821-7842-11CF-8F52-0040333594A3>
+    DWORD nVertexColors;
+    array IndexedColor vertexColors[nVertexColors];
+}
+
+template Mesh
+{
+    <3D82AB44-62DA-11CF-AB39-0020AF71E433>
+    DWORD nVertices;
+    array Vector vertices[nVertices];
+    DWORD nFaces;
+    array MeshFace faces[nFaces];
+    [ ... ]
+}
+
+template FrameTransformMatrix
+{
+    <F6F23F41-7686-11CF-8F52-0040333594A3>
+    Matrix4x4 frameMatrix;
+}
+
+template Frame
+{
+    <3D82AB46-62DA-11CF-AB39-0020AF71E433>
+    [ ... ]
+}
+
+template FloatKeys
+{
+    <10DD46A9-775B-11CF-8F52-0040333594A3>
+    DWORD nValues;
+    array FLOAT values[nValues];
+}
+
+template TimedFloatKeys
+{
+    <F406B180-7B3B-11CF-8F52-0040333594A3>
+    DWORD time;
+    FloatKeys tfkeys;
+}
+
+template AnimationKey
+{
+    <10DD46A8-775B-11CF-8F52-0040333594A3>
+    DWORD keyType;
+    DWORD nKeys;
+    array TimedFloatKeys keys[nKeys];
+}
+
+template AnimationOptions
+{
+    <E2BF56C0-840F-11CF-8F52-0040333594A3>
+    DWORD openclosed;
+    DWORD positionquality;
+}
+
+template Animation
+{
+    <3D82AB4F-62DA-11CF-AB39-0020AF71E433>
+    [ ... ]
+}
+
+template AnimationSet
+{
+    <3D82AB50-62DA-11CF-AB39-0020AF71E433>
+    [ Animation ]
+}
+
+template InlineData
+{
+    <3A23EEA0-94B1-11D0-AB39-0020AF71E433>
+    [ BINARY ]
+}
+
+template Url
+{
+    <3A23EEA1-94B1-11D0-AB39-0020AF71E433>
+    DWORD nUrls;
+    array STRING urls[nUrls];
+}
+
+template ProgressiveMesh
+{
+    <8A63C360-997D-11D0-941C-0080C80CFA7B>
+    [ Url, InlineData ]
+}
+
+template Guid
+{
+    <A42790E0-7810-11CF-8F52-0040333594A3>
+    DWORD data1;
+    WORD data2;
+    WORD data3;
+    array UCHAR data4[8];
+}
+
+template StringProperty
+{
+    <7F0F21E0-BFE1-11D1-82C0-00A0C9697271>
+    STRING key;
+    STRING value;
+}
+
+template PropertyBag
+{
+    <7F0F21E1-BFE1-11D1-82C0-00A0C9697271>
+    [ StringProperty ]
+}
+
+template ExternalVisual
+{
+    <98116AA0-BDBA-11D1-82C0-00A0C9697271>
+    Guid guidExternalVisual;
+    [ ... ]
+}
+
+template RightHanded
+{
+    <7F5D5EA0-D53A-11D1-82C0-00A0C9697271>
+    DWORD bRightHanded;
+}
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 4c8b238..e6d3f5f 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -3,6 +3,7 @@ EXTRAINCL = @FREETYPEINCL@
 FREETYPELIBS = @FREETYPELIBS@
 
 PROGRAMS = \
+	binencxftmpl$(EXEEXT) \
 	fnt2bdf$(EXEEXT) \
 	fnt2fon$(EXEEXT) \
 	make_ctests$(EXEEXT) \
@@ -18,6 +19,7 @@ EXTRA_MANPAGES = \
 	winemaker.fr.man
 
 C_SRCS = \
+	binencxftmpl.c \
 	fnt2bdf.c \
 	fnt2fon.c \
 	make_ctests.c \
@@ -41,6 +43,9 @@ all: makedep$(EXEEXT) $(PROGRAMS)
 
 @MAKE_RULES@
 
+binencxftmpl$(EXEEXT): binencxftmpl.o
+	$(CC) $(CFLAGS) -o $@ binencxftmpl.o $(LDFLAGS)
+
 makedep$(EXEEXT) $(EXEEXT:%=makedep): makedep.o
 	$(CC) $(CFLAGS) -o $@ makedep.o $(LDFLAGS)
 
diff --git a/tools/binencxftmpl.c b/tools/binencxftmpl.c
new file mode 100644
index 0000000..bc26b3a
--- /dev/null
+++ b/tools/binencxftmpl.c
@@ -0,0 +1,399 @@
+/*
+ * Binary encode X templates from text format.
+ *
+ * Copyright 2011 Dylan Smith
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "windef.h"
+#include "guiddef.h"
+
+#define ARRAY_SIZE(array) (sizeof(array)/sizeof(array[0]))
+
+#define TOKEN_NAME         1
+#define TOKEN_STRING       2
+#define TOKEN_INTEGER      3
+#define TOKEN_GUID         5
+#define TOKEN_INTEGER_LIST 6
+#define TOKEN_FLOAT_LIST   7
+#define TOKEN_OBRACE      10
+#define TOKEN_CBRACE      11
+#define TOKEN_OPAREN      12
+#define TOKEN_CPAREN      13
+#define TOKEN_OBRACKET    14
+#define TOKEN_CBRACKET    15
+#define TOKEN_OANGLE      16
+#define TOKEN_CANGLE      17
+#define TOKEN_DOT         18
+#define TOKEN_COMMA       19
+#define TOKEN_SEMICOLON   20
+#define TOKEN_TEMPLATE    31
+#define TOKEN_WORD        40
+#define TOKEN_DWORD       41
+#define TOKEN_FLOAT       42
+#define TOKEN_DOUBLE      43
+#define TOKEN_CHAR        44
+#define TOKEN_UCHAR       45
+#define TOKEN_SWORD       46
+#define TOKEN_SDWORD      47
+#define TOKEN_VOID        48
+#define TOKEN_LPSTR       49
+#define TOKEN_UNICODE     50
+#define TOKEN_CSTRING     51
+#define TOKEN_ARRAY       52
+
+struct parser
+{
+    FILE *infile;
+    FILE *outfile;
+    int line_no;
+};
+
+struct keyword
+{
+    const char *word;
+    WORD token;
+};
+
+static const struct keyword reserved_words[] = {
+    {"ARRAY", TOKEN_ARRAY},
+    {"CHAR", TOKEN_CHAR},
+    {"CSTRING", TOKEN_CSTRING},
+    {"DOUBLE", TOKEN_DOUBLE},
+    {"DWORD", TOKEN_DWORD},
+    {"FLOAT", TOKEN_FLOAT},
+    {"SDWORD", TOKEN_SDWORD},
+    {"STRING", TOKEN_LPSTR},
+    {"SWORD", TOKEN_SWORD},
+    {"TEMPLATE", TOKEN_TEMPLATE},
+    {"UCHAR", TOKEN_UCHAR},
+    {"UNICODE", TOKEN_UNICODE},
+    {"VOID", TOKEN_VOID},
+    {"WORD", TOKEN_WORD}
+};
+
+static char *program_name;
+
+static inline BOOL read_byte(struct parser *parser, char *byte)
+{
+    int c = fgetc(parser->infile);
+    *byte = c;
+    return c != EOF;
+}
+
+static inline BOOL unread_byte(struct parser *parser, char last_byte)
+{
+    return ungetc(last_byte, parser->infile) != EOF;
+}
+
+static inline BOOL read_bytes(struct parser *parser, void *data, DWORD size)
+{
+    return fread(data, size, 1, parser->infile) > 0;
+}
+
+static inline BOOL write_bytes(struct parser *parser, const void *data, DWORD size)
+{
+    return fwrite(data, size, 1, parser->outfile) > 0;
+}
+
+static inline BOOL write_byte(struct parser *parser, BYTE value)
+{
+    return write_bytes(parser, &value, sizeof(value));
+}
+
+static inline BOOL write_word(struct parser *parser, WORD value)
+{
+    return write_bytes(parser, &value, sizeof(value));
+}
+
+static inline BOOL write_dword(struct parser *parser, DWORD value)
+{
+    return write_bytes(parser, &value, sizeof(value));
+}
+
+static int compare_names(const void *a, const void *b)
+{
+    return strcasecmp(*(const char **)a, *(const char **)b);
+}
+
+static BOOL parse_keyword(struct parser *parser, const char *name)
+{
+    const struct keyword *keyword;
+
+    keyword = bsearch(&name, reserved_words, ARRAY_SIZE(reserved_words),
+                      sizeof(reserved_words[0]), compare_names);
+    if (!keyword)
+        return FALSE;
+
+    return write_word(parser, keyword->token);
+}
+
+static BOOL parse_guid(struct parser *parser)
+{
+    char buf[39];
+    GUID guid;
+    DWORD tab[10];
+    BOOL ret;
+    static const char *guidfmt = "<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>";
+
+    buf[0] = '<';
+    if (!read_bytes(parser, buf + 1, 37))
+        return FALSE;
+    buf[38] = 0;
+
+    ret = sscanf(buf, guidfmt, &guid.Data1, tab, tab+1, tab+2, tab+3, tab+4, tab+5, tab+6, tab+7, tab+8, tab+9);
+    if (ret != 11) {
+        fprintf(stderr, "%s: Invalid GUID '%s' (line %d)\n",
+                program_name, buf, parser->line_no);
+        return FALSE;
+    }
+
+    guid.Data2 = tab[0];
+    guid.Data3 = tab[1];
+    guid.Data4[0] = tab[2];
+    guid.Data4[1] = tab[3];
+    guid.Data4[2] = tab[4];
+    guid.Data4[3] = tab[5];
+    guid.Data4[4] = tab[6];
+    guid.Data4[5] = tab[7];
+    guid.Data4[6] = tab[8];
+    guid.Data4[7] = tab[9];
+
+    return write_word(parser, TOKEN_GUID) &&
+           write_bytes(parser, &guid, sizeof(guid));
+}
+
+static BOOL parse_name(struct parser *parser)
+{
+    char c;
+    int len = 0;
+    char name[512];
+
+    while (read_byte(parser, &c) && len < sizeof(name) &&
+           (isalnum(c) || c == '_' || c == '-'))
+    {
+        if (len + 1 < sizeof(name))
+            name[len++] = c;
+    }
+    unread_byte(parser, c);
+    name[len] = 0;
+
+    if (parse_keyword(parser, name)) {
+        return TRUE;
+    } else {
+        return write_word(parser, TOKEN_NAME) &&
+               write_dword(parser, len) &&
+               write_bytes(parser, name, len);
+    }
+}
+
+static BOOL parse_number(struct parser *parser)
+{
+    int len = 0;
+    char c;
+    char buffer[512];
+    BOOL dot = FALSE;
+    BOOL ret;
+
+    while (read_byte(parser, &c) &&
+           ((!len && c == '-') || (!dot && c == '.') || isdigit(c)))
+    {
+        if (len + 1 < sizeof(buffer))
+            buffer[len++] = c;
+        if (c == '.')
+            dot = TRUE;
+    }
+    unread_byte(parser, c);
+    buffer[len] = 0;
+
+    if (dot) {
+        float value;
+        ret = sscanf(buffer, "%f", &value);
+        if (!ret)
+            fprintf(stderr, "%s: Invalid float token (line %d).\n",
+                    program_name, parser->line_no);
+        else
+            ret = write_word(parser, TOKEN_FLOAT) &&
+                  write_bytes(parser, &value, sizeof(value));
+    } else {
+        int value;
+        ret = sscanf(buffer, "%d", &value);
+        if (!ret)
+            fprintf(stderr, "%s: Invalid integer token (line %d).\n",
+                    program_name, parser->line_no);
+        else
+            ret = write_word(parser, TOKEN_INTEGER) &&
+                  write_dword(parser, value);
+    }
+
+    return ret;
+}
+
+BOOL parse_token(struct parser *parser)
+{
+    char c;
+
+    if (!read_byte(parser, &c))
+        return FALSE;
+
+    switch (c)
+    {
+        case '\n':
+            parser->line_no++;
+            /* fall through */
+        case '\r':
+        case ' ':
+        case '\t':
+            return TRUE;
+
+        case '{': return write_word(parser, TOKEN_OBRACE);
+        case '}': return write_word(parser, TOKEN_CBRACE);
+        case '[': return write_word(parser, TOKEN_OBRACKET);
+        case ']': return write_word(parser, TOKEN_CBRACKET);
+        case '(': return write_word(parser, TOKEN_OPAREN);
+        case ')': return write_word(parser, TOKEN_CPAREN);
+        case ',': return write_word(parser, TOKEN_COMMA);
+        case ';': return write_word(parser, TOKEN_SEMICOLON);
+        case '.': return write_word(parser, TOKEN_DOT);
+
+        case '/':
+            if (!read_byte(parser, &c) || c != '/') {
+                fprintf(stderr, "%s: Invalid single '/' comment token (line %d).\n",
+                        program_name, parser->line_no);
+                return FALSE;
+            }
+            /* fall through */
+        case '#':
+            while (read_byte(parser, &c) && c != '\n');
+            return c == '\n';
+
+        case '<':
+            return parse_guid(parser);
+
+        case '"':
+        {
+            int len = 0;
+            char buffer[512];
+
+            /* FIXME: Handle '\' (e.g. "valid\"string") */
+            while (read_byte(parser, &c) && c != '"') {
+                if (len + 1 < sizeof(buffer))
+                    buffer[len++] = c;
+            }
+            if (c == EOF) {
+                fprintf(stderr, "%s: Unterminated string (line %d).\n",
+                        program_name, parser->line_no);
+                return FALSE;
+            }
+            return write_word(parser, TOKEN_STRING) &&
+                   write_dword(parser, len) &&
+                   write_bytes(parser, buffer, len);
+        }
+
+        default:
+            unread_byte(parser, c);
+            if (isdigit(c) || c == '-')
+                return parse_number(parser);
+            if (isalpha(c) || c == '_')
+                return parse_name(parser);
+            fprintf(stderr, "%s: Invalid character (%d) to start token (line %d).\n",
+                    program_name, c, parser->line_no);
+            return FALSE;
+    }
+
+    return TRUE;
+}
+
+int main(int argc, char **argv)
+{
+    const char *infile_name, *outfile_name = NULL;
+    int ret = 1;
+    char header[16];
+    struct parser parser;
+
+    program_name = argv[0];
+    if (argc < 2 || argc > 3)
+    {
+        fprintf(stderr, "Usage: %s INFILE [OUTFILE]\n", program_name);
+        return 1;
+    }
+    infile_name = argv[1];
+    outfile_name = argc >= 3 ? argv[2] : "-";
+
+    if (!strcmp(infile_name, "-")) {
+        parser.infile = stdin;
+        infile_name = "stdin";
+    } else if (!(parser.infile = fopen(infile_name, "rb"))) {
+        perror(infile_name);
+        goto done;
+    }
+
+    if (!strcmp(outfile_name, "-")) {
+        parser.outfile = stdout;
+        outfile_name = "stdout";
+    } else if (!(parser.outfile = fopen(outfile_name, "wb"))) {
+        perror(outfile_name);
+        goto done;
+    }
+
+    if (!read_bytes(&parser, header, sizeof(header)))
+        goto done;
+    if (strncmp(header, "xof ", 4))
+    {
+        fprintf(stderr, "%s: Invalid magic value '%.4s'\n", program_name, header);
+        goto done;
+    }
+    if (strncmp(header + 4, "0302", 4) && strncmp(header + 4, "0303", 4))
+    {
+        fprintf(stderr, "%s: Unsupported version '%.4s'\n", program_name, header + 4);
+        goto done;
+    }
+    if (strncmp(header + 8, "txt ", 4))
+    {
+        fprintf(stderr, "%s: Only support conversion from text encoded X files.",
+                program_name);
+        goto done;
+    }
+    if (strncmp(header + 12, "0032", 4) && strncmp(header + 12, "0064", 4))
+    {
+        fprintf(stderr, "%s: Only 32-bit or 64-bit float format supported, not '%.4s'.\n",
+                program_name, header + 12);
+        goto done;
+    }
+
+    if (!write_bytes(&parser, "xof 0302bin 0064", 16))
+        goto done;
+
+    parser.line_no = 1;
+    while (parse_token(&parser));
+
+    ret = 0;
+done:
+    if (parser.infile) {
+        if (ferror(parser.infile))
+            perror(infile_name);
+        fclose(parser.infile);
+    }
+    if (parser.outfile) {
+        if (ferror(parser.outfile))
+            perror(outfile_name);
+        fclose(parser.outfile);
+    }
+    return ret;
+}
-- 
1.7.2.5



More information about the wine-patches mailing list