Diff
Modified: trunk/Source/WebKit2/ChangeLog (150017 => 150018)
--- trunk/Source/WebKit2/ChangeLog 2013-05-13 15:45:11 UTC (rev 150017)
+++ trunk/Source/WebKit2/ChangeLog 2013-05-13 15:45:52 UTC (rev 150018)
@@ -1,3 +1,15 @@
+2013-05-13 Martin Robinson <[email protected]>
+
+ [GTK] [WebKit2] Use a template file for generated GObject enum files
+ https://bugs.webkit.org/show_bug.cgi?id=115867
+
+ Reviewed by Carlos Garcia Campos.
+
+ * GNUmakefile.am: Use a template file instead of specifying portions of the file on the command-line.
+ * UIProcess/API/gtk/WebKitEnumTypes.cpp.template: Added.
+ * UIProcess/API/gtk/WebKitEnumTypes.h.template: Added.
+ * UIProcess/API/gtk/WebKitFindController.cpp: We can no longer rely on WebKitEnumTypes.h to pull in WebKitWebView.h.
+
2013-05-13 Noam Rosenthal <[email protected]>
[CoordGfx] requestAnimationFrame performance issues
Modified: trunk/Source/WebKit2/GNUmakefile.am (150017 => 150018)
--- trunk/Source/WebKit2/GNUmakefile.am 2013-05-13 15:45:11 UTC (rev 150017)
+++ trunk/Source/WebKit2/GNUmakefile.am 2013-05-13 15:45:52 UTC (rev 150018)
@@ -385,21 +385,7 @@
stamp-webkit2enumtypes: $(libwebkit2gtkinclude_HEADERS) $(WebKit2)/GNUmakefile.am
$(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
- && glib-mkenums \
- --fhead "#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)\n" \
- --fhead "#error \"Only <webkit2/webkit2.h> can be included directly.\"\n" \
- --fhead "#endif\n\n" \
- --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
- --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
- --fhead "#include <glib-object.h>\n\n" \
- --fhead "#include <webkit2/WebKitDefines.h>\n\n" \
- --fhead "G_BEGIN_DECLS\n\n" \
- --ftail "G_END_DECLS\n\n" \
- --ftail "#endif\n" \
- --fprod "#include <webkit2/@basename@>\n\n" \
- --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
- --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
- $(libwebkit2gtkinclude_HEADERS) | \
+ && glib-mkenums --template $(WebKit2)/UIProcess/API/gtk/WebKitEnumTypes.h.template $(libwebkit2gtkinclude_HEADERS) | \
sed 's,web_kit,webkit,' | \
sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
> wk2-xgen-gth \
@@ -409,22 +395,7 @@
$(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.cpp: $(libwebkit2gtkinclude_HEADERS) $(WebKit2)/GNUmakefile.am
$(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
- && glib-mkenums \
- --fhead "#include <config.h>\n" \
- --fhead "#include <glib-object.h>\n" \
- --fhead "#include \"$(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h\"\n\n" \
- --fhead "extern \"C\" {\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 @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" \
- --ftail "}\n" \
- $(libwebkit2gtkinclude_HEADERS) | \
+ && glib-mkenums --template $(WebKit2)/UIProcess/API/gtk/WebKitEnumTypes.cpp.template $(libwebkit2gtkinclude_HEADERS) | \
sed 's,web_kit,webkit,' \
> wk2-xgen-gtc \
&& cp wk2-xgen-gtc $@ \
@@ -720,6 +691,8 @@
$(WebKit2)/Scripts/webkit2/model.py \
$(WebKit2)/Scripts/webkit2/parser.py \
$(WebKit2)/UIProcess/API/gtk/webkit2marshal.list \
+ $(WebKit2)/UIProcess/API/gtk/WebKitEnumTypes.h.template \
+ $(WebKit2)/UIProcess/API/gtk/WebKitEnumTypes.cpp.template \
$(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html \
$(WebKit2)/Scripts/generate-forwarding-headers.pl \
$(shell ls $(WebKit2)/PluginProcess/*.in) \
Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitEnumTypes.cpp.template (0 => 150018)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitEnumTypes.cpp.template (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitEnumTypes.cpp.template 2013-05-13 15:45:52 UTC (rev 150018)
@@ -0,0 +1,62 @@
+/*** BEGIN file-header ***/
+/*
+ * Copyright (C) 2013 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <config.h>
+#include "WebKitEnumTypes.h"
+
+#include <webkit2/webkit2.h>
+extern "C" {
+/*** END file-header ***/
+
+
+/*** BEGIN file-production ***/
+// Enumerations from @filename@.
+/*** END file-production ***/
+
+
+/*** BEGIN value-header ***/
+GType @enum_name@_get_type()
+{
+ static const G@Type@Value values[] = {
+/*** END value-header ***/
+
+
+/*** BEGIN value-production ***/
+ { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+
+
+/*** BEGIN value-tail ***/
+ { 0, NULL, NULL }
+ };
+
+ static GType type = 0;
+ if (G_UNLIKELY(!type))
+ type = g_@type@_register_static("@EnumName@", values);
+
+ return type;
+}
+
+/*** END value-tail ***/
+
+
+/*** BEGIN file-tail ***/
+}
+/*** END file-tail ***/
Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitEnumTypes.h.template (0 => 150018)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitEnumTypes.h.template (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitEnumTypes.h.template 2013-05-13 15:45:52 UTC (rev 150018)
@@ -0,0 +1,54 @@
+/*** BEGIN file-header ***/
+/*
+ * Copyright (C) 2013 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
+#error "Only <webkit2/webkit2.h> can be included directly."
+#endif
+
+#ifndef WEBKIT_ENUM_TYPES_H
+#define WEBKIT_ENUM_TYPES_H
+
+#include <glib-object.h>
+#include <webkit2/WebKitDefines.h>
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+
+/*** BEGIN file-production ***/
+/* Enumerations from @filename@. */
+/*** END file-production ***/
+
+
+/*** BEGIN enumeration-production ***/
+#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type ()
+
+WEBKIT_API GType
+@enum_name@_get_type (void);
+
+/*** END enumeration-production ***/
+
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif
+/*** END file-tail ***/
+
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp (150017 => 150018)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp 2013-05-13 15:45:11 UTC (rev 150017)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp 2013-05-13 15:45:52 UTC (rev 150018)
@@ -22,6 +22,7 @@
#include "WebKitEnumTypes.h"
#include "WebKitPrivate.h"
+#include "WebKitWebView.h"
#include "WebKitWebViewBasePrivate.h"
#include <glib/gi18n-lib.h>
#include <wtf/gobject/GRefPtr.h>