Title: [96821] trunk/Source/WebKit2
Revision
96821
Author
[email protected]
Date
2011-10-06 09:57:25 -0700 (Thu, 06 Oct 2011)

Log Message

[GTK] Do not use C API in GTK+ API public headers
https://bugs.webkit.org/show_bug.cgi?id=69506

Reviewed by Martin Robinson.

* GNUmakefile.am: Add new files to compilation.
* UIProcess/API/gtk/WebKitDefines.h: Added.
* UIProcess/API/gtk/WebKitError.h: Use WEBKIT_API instead of WK_EXPORT.
* UIProcess/API/gtk/WebKitWebContext.h: Ditto.
* UIProcess/API/gtk/WebKitWebLoaderClient.h: Ditto.
* UIProcess/API/gtk/WebKitWebView.h: Ditto.
* UIProcess/API/gtk/WebKitWebViewBase.h: Ditto.
* UIProcess/API/gtk/docs/GNUmakefile.am: Ignore WEBKIT_API
decorator in docs.
* UIProcess/API/gtk/webkit2.h: Include <webkit2/WebKitDefines.h>

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (96820 => 96821)


--- trunk/Source/WebKit2/ChangeLog	2011-10-06 16:51:39 UTC (rev 96820)
+++ trunk/Source/WebKit2/ChangeLog	2011-10-06 16:57:25 UTC (rev 96821)
@@ -1,3 +1,21 @@
+2011-10-06  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Do not use C API in GTK+ API public headers
+        https://bugs.webkit.org/show_bug.cgi?id=69506
+
+        Reviewed by Martin Robinson.
+
+        * GNUmakefile.am: Add new files to compilation.
+        * UIProcess/API/gtk/WebKitDefines.h: Added.
+        * UIProcess/API/gtk/WebKitError.h: Use WEBKIT_API instead of WK_EXPORT.
+        * UIProcess/API/gtk/WebKitWebContext.h: Ditto.
+        * UIProcess/API/gtk/WebKitWebLoaderClient.h: Ditto.
+        * UIProcess/API/gtk/WebKitWebView.h: Ditto.
+        * UIProcess/API/gtk/WebKitWebViewBase.h: Ditto.
+        * UIProcess/API/gtk/docs/GNUmakefile.am: Ignore WEBKIT_API
+        decorator in docs.
+        * UIProcess/API/gtk/webkit2.h: Include <webkit2/WebKitDefines.h>
+
 2011-10-06  Alexis Menard  <[email protected]>
 
         [Qt][WK2] Cursor should change when hovering links or input fields.

Modified: trunk/Source/WebKit2/GNUmakefile.am (96820 => 96821)


--- trunk/Source/WebKit2/GNUmakefile.am	2011-10-06 16:51:39 UTC (rev 96820)
+++ trunk/Source/WebKit2/GNUmakefile.am	2011-10-06 16:57:25 UTC (rev 96821)
@@ -69,6 +69,7 @@
 
 libwebkit2gtkincludedir = $(libwebkitgtkincludedir)/webkit2
 webkit2gtk_headers = \
+	$(WebKit2)/UIProcess/API/gtk/WebKitDefines.h \
 	$(WebKit2)/UIProcess/API/gtk/WebKitError.h \
 	$(WebKit2)/UIProcess/API/gtk/WebKitWebContext.h \
 	$(WebKit2)/UIProcess/API/gtk/WebKitWebLoaderClient.h \
@@ -464,6 +465,7 @@
 	Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h \
 	Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h \
 	Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp \
+	Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h \
 	Source/WebKit2/UIProcess/API/gtk/WebKitError.h \
 	Source/WebKit2/UIProcess/API/gtk/WebKitError.cpp \
 	Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h \

Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h (0 => 96821)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h	2011-10-06 16:57:25 UTC (rev 96821)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
+#error "Only <webkit2/webkit2.h> can be included directly."
+#endif
+
+#ifndef WebKitDefines_h
+#define WebKitDefines_h
+
+#include <glib.h>
+
+#ifdef G_OS_WIN32
+#    ifdef BUILDING_WEBKIT
+#        define WEBKIT_API __declspec(dllexport)
+#    else
+#        define WEBKIT_API __declspec(dllimport)
+#    endif
+#    define WEBKIT_OBSOLETE_API WEBKIT_API
+#else
+#    define WEBKIT_API __attribute__((visibility("default")))
+#    define WEBKIT_OBSOLETE_API WEBKIT_API __attribute__((deprecated))
+#endif
+
+#endif // WebKitDefines_h

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitError.h (96820 => 96821)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitError.h	2011-10-06 16:51:39 UTC (rev 96820)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitError.h	2011-10-06 16:57:25 UTC (rev 96821)
@@ -25,8 +25,7 @@
 #ifndef WebKitError_h
 #define WebKitError_h
 
-#include <WebKit2/WKBase.h>
-#include <glib.h>
+#include <webkit2/WebKitDefines.h>
 
 G_BEGIN_DECLS
 
@@ -70,13 +69,13 @@
     WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD = 204,
 } WebKitPluginError;
 
-WK_EXPORT GQuark
+WEBKIT_API GQuark
 webkit_network_error_quark (void);
 
-WK_EXPORT GQuark
+WEBKIT_API GQuark
 webkit_policy_error_quark  (void);
 
-WK_EXPORT GQuark
+WEBKIT_API GQuark
 webkit_plugin_error_quark  (void);
 
 G_END_DECLS

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h (96820 => 96821)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h	2011-10-06 16:51:39 UTC (rev 96820)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h	2011-10-06 16:57:25 UTC (rev 96821)
@@ -25,7 +25,7 @@
 #define WebKitWebContext_h
 
 #include <glib-object.h>
-#include <WebKit2/WKBase.h>
+#include <webkit2/WebKitDefines.h>
 
 G_BEGIN_DECLS
 
@@ -57,10 +57,10 @@
     void (*_webkit_reserved3) (void);
 };
 
-WK_EXPORT GType
+WEBKIT_API GType
 webkit_web_context_get_type    (void);
 
-WK_EXPORT WebKitWebContext *
+WEBKIT_API WebKitWebContext *
 webkit_web_context_get_default (void);
 
 G_END_DECLS

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebLoaderClient.h (96820 => 96821)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebLoaderClient.h	2011-10-06 16:51:39 UTC (rev 96820)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebLoaderClient.h	2011-10-06 16:57:25 UTC (rev 96821)
@@ -24,8 +24,8 @@
 #ifndef WebKitWebLoaderClient_h
 #define WebKitWebLoaderClient_h
 
-#include <WebKit2/WKBase.h>
 #include <glib-object.h>
+#include <webkit2/WebKitDefines.h>
 
 G_BEGIN_DECLS
 
@@ -62,7 +62,7 @@
                                                             GError                *error);
 };
 
-WK_EXPORT GType
+WEBKIT_API GType
 webkit_web_loader_client_get_type (void);
 
 G_END_DECLS

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h (96820 => 96821)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h	2011-10-06 16:51:39 UTC (rev 96820)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h	2011-10-06 16:57:25 UTC (rev 96821)
@@ -27,6 +27,7 @@
 #ifndef WebKitWebView_h
 #define WebKitWebView_h
 
+#include <webkit2/WebKitDefines.h>
 #include <webkit2/WebKitWebContext.h>
 #include <webkit2/WebKitWebLoaderClient.h>
 #include <webkit2/WebKitWebViewBase.h>
@@ -65,39 +66,39 @@
     void (*_webkit_reserved7) (void);
 };
 
-WK_EXPORT GType
+WEBKIT_API GType
 webkit_web_view_get_type            (void);
 
-WK_EXPORT GtkWidget *
+WEBKIT_API GtkWidget *
 webkit_web_view_new                 (void);
 
-WK_EXPORT GtkWidget *
+WEBKIT_API GtkWidget *
 webkit_web_view_new_with_context    (WebKitWebContext      *context);
 
-WK_EXPORT WebKitWebContext *
+WEBKIT_API WebKitWebContext *
 webkit_web_view_get_context         (WebKitWebView         *web_view);
 
-WK_EXPORT WebKitWebLoaderClient *
+WEBKIT_API WebKitWebLoaderClient *
 webkit_web_view_get_loader_client   (WebKitWebView         *web_view);
 
-WK_EXPORT void
+WEBKIT_API void
 webkit_web_view_set_loader_client   (WebKitWebView         *web_view,
                                      WebKitWebLoaderClient *loader_client);
 
-WK_EXPORT void
+WEBKIT_API void
 webkit_web_view_load_uri            (WebKitWebView         *web_view,
                                      const gchar           *uri);
 
-WK_EXPORT void
+WEBKIT_API void
 webkit_web_view_load_alternate_html (WebKitWebView         *web_view,
                                      const gchar           *content,
                                      const gchar           *base_uri,
                                      const gchar           *unreachable_uri);
 
-WK_EXPORT void
+WEBKIT_API void
 webkit_web_view_go_back             (WebKitWebView         *web_view);
 
-WK_EXPORT void
+WEBKIT_API void
 webkit_web_view_go_forward          (WebKitWebView         *web_view);
 
 G_END_DECLS

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.h (96820 => 96821)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.h	2011-10-06 16:51:39 UTC (rev 96820)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.h	2011-10-06 16:57:25 UTC (rev 96821)
@@ -32,8 +32,8 @@
 #ifndef WebKitWebViewBase_h
 #define WebKitWebViewBase_h
 
-#include <WebKit2/WKBase.h>
 #include <gtk/gtk.h>
+#include <webkit2/WebKitDefines.h>
 
 G_BEGIN_DECLS
 
@@ -64,7 +64,7 @@
     void (*_webkit_reserved3) (void);
 };
 
-WK_EXPORT GType
+WEBKIT_API GType
 webkit_web_view_base_get_type();
 
 G_END_DECLS

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/GNUmakefile.am (96820 => 96821)


--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/GNUmakefile.am	2011-10-06 16:51:39 UTC (rev 96820)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/GNUmakefile.am	2011-10-06 16:57:25 UTC (rev 96821)
@@ -25,7 +25,7 @@
 
 # Extra options to supply to gtkdoc-scan.
 # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
-SCAN_OPTIONS=--ignore-decorators="WK_EXPORT"
+SCAN_OPTIONS=--ignore-decorators="WEBKIT_API"
 
 # Extra options to supply to gtkdoc-mkdb.
 # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h (96820 => 96821)


--- trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h	2011-10-06 16:51:39 UTC (rev 96820)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h	2011-10-06 16:57:25 UTC (rev 96821)
@@ -22,6 +22,7 @@
 
 #define __WEBKIT2_H_INSIDE__
 
+#include <webkit2/WebKitDefines.h>
 #include <webkit2/WebKitEnumTypes.h>
 #include <webkit2/WebKitError.h>
 #include <webkit2/WebKitWebContext.h>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to