Diff
Modified: trunk/ChangeLog (120955 => 120956)
--- trunk/ChangeLog 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/ChangeLog 2012-06-21 19:20:00 UTC (rev 120956)
@@ -1,3 +1,14 @@
+2012-06-21 Kalev Lember <[email protected]>
+
+ [GTK] Fix NPAPI plugins on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=54531
+
+ Reviewed by Martin Robinson.
+
+ Define XP_WIN on Windows for plugin support.
+
+ * GNUmakefile.am:
+
2012-06-21 Ryuan Choi <[email protected]>
[EFL][WK2] Make WebKit2/Efl headers and resources installable.
Modified: trunk/GNUmakefile.am (120955 => 120956)
--- trunk/GNUmakefile.am 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/GNUmakefile.am 2012-06-21 19:20:00 UTC (rev 120956)
@@ -161,8 +161,11 @@
endif
# For the Gtk port we want to use XP_UNIX both in X11 and Mac
-if !TARGET_WIN32
+if TARGET_WIN32
global_cppflags += \
+ -DXP_WIN
+else
+global_cppflags += \
-DXP_UNIX
endif
Modified: trunk/Source/WTF/ChangeLog (120955 => 120956)
--- trunk/Source/WTF/ChangeLog 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WTF/ChangeLog 2012-06-21 19:20:00 UTC (rev 120956)
@@ -1,3 +1,17 @@
+2012-06-21 Kalev Lember <[email protected]>
+
+ [GTK] Fix NPAPI plugins on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=54531
+
+ Reviewed by Martin Robinson.
+
+ Define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH for the GTK+ port, and
+ include OwnPtrWin.cpp in the list of files built on Windows.
+
+ * GNUmakefile.am:
+ * GNUmakefile.list.am:
+ * wtf/Platform.h:
+
2012-06-21 Balazs Kelemen <[email protected]>
Compile error: 'bool std::isinf(float)' is not 'constexpr' with GCC 4.6 in C++11 mode
Modified: trunk/Source/WTF/GNUmakefile.am (120955 => 120956)
--- trunk/Source/WTF/GNUmakefile.am 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WTF/GNUmakefile.am 2012-06-21 19:20:00 UTC (rev 120956)
@@ -15,6 +15,11 @@
$(WINMM_LIBS) \
-lpthread
+if TARGET_WIN32
+# OwnPtrWin.cpp needs the symbols from gdi32 dll
+libWTF_la_LIBADD += -lgdi32
+endif
+
libWTF_la_CXXFLAGS = \
$(global_cxxflags) \
$(libWTF_la_CFLAGS)
Modified: trunk/Source/WTF/GNUmakefile.list.am (120955 => 120956)
--- trunk/Source/WTF/GNUmakefile.list.am 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WTF/GNUmakefile.list.am 2012-06-21 19:20:00 UTC (rev 120956)
@@ -227,7 +227,8 @@
Source/WTF/wtf/OSAllocatorWin.cpp \
Source/WTF/wtf/ThreadFunctionInvocation.h \
Source/WTF/wtf/ThreadingWin.cpp \
- Source/WTF/wtf/ThreadSpecificWin.cpp
+ Source/WTF/wtf/ThreadSpecificWin.cpp \
+ Source/WTF/wtf/win/OwnPtrWin.cpp
else
wtf_sources += \
Source/WTF/wtf/OSAllocatorPosix.cpp
Modified: trunk/Source/WTF/wtf/Platform.h (120955 => 120956)
--- trunk/Source/WTF/wtf/Platform.h 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WTF/wtf/Platform.h 2012-06-21 19:20:00 UTC (rev 120956)
@@ -1026,7 +1026,7 @@
#define WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK 1
#endif
-#if !ENABLE(NETSCAPE_PLUGIN_API) || (ENABLE(NETSCAPE_PLUGIN_API) && ((OS(UNIX) && (PLATFORM(QT) || PLATFORM(WX))) || PLATFORM(GTK) || PLATFORM(EFL)))
+#if !ENABLE(NETSCAPE_PLUGIN_API) || (ENABLE(NETSCAPE_PLUGIN_API) && ((OS(UNIX) && (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WX))) || PLATFORM(EFL)))
#define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1
#endif
Modified: trunk/Source/WebCore/ChangeLog (120955 => 120956)
--- trunk/Source/WebCore/ChangeLog 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/ChangeLog 2012-06-21 19:20:00 UTC (rev 120956)
@@ -1,3 +1,42 @@
+2012-06-21 Kalev Lember <[email protected]>
+
+ [GTK] Fix NPAPI plugins on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=54531
+
+ Reviewed by Martin Robinson.
+
+ Switch to using PluginPackageWin.cpp and PluginViewWin.cpp on Windows
+ platform, and leave plugins/gtk/ only for XP_UNIX platforms. With this
+ we can share a lot of code with other ports and don't have to
+ reimplement all the Windows-specific code in plugins/gtk/.
+
+ * GNUmakefile.am:
+ * GNUmakefile.list.am:
+ * platform/FileSystem.h:
+ (WebCore):
+ * platform/graphics/GraphicsContext.h:
+ (GraphicsContext):
+ * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+ (GraphicsContextPlatformPrivate):
+ * platform/graphics/transforms/TransformationMatrix.h:
+ (TransformationMatrix):
+ * platform/graphics/win/GraphicsContextCairoWin.cpp:
+ (WebCore):
+ * platform/graphics/win/GraphicsContextWin.cpp:
+ (WebCore):
+ * platform/gtk/FileSystemGtk.cpp:
+ (WebCore::unloadModule):
+ * plugins/PluginView.h:
+ (PluginView):
+ * plugins/win/PluginViewWin.cpp:
+ (windowHandleForPageClient):
+ (WebCore::registerPluginView):
+ (WebCore::PluginView::paint):
+ (WebCore::PluginView::handleMouseEvent):
+ (WebCore::PluginView::platformStart):
+ (WebCore::PluginView::snapshot):
+
2012-06-21 Brady Eidson <[email protected]>
<rdar://problem/11718988> and https://bugs.webkit.org/show_bug.cgi?id=89673
Modified: trunk/Source/WebCore/GNUmakefile.am (120955 => 120956)
--- trunk/Source/WebCore/GNUmakefile.am 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/GNUmakefile.am 2012-06-21 19:20:00 UTC (rev 120956)
@@ -155,6 +155,14 @@
-I$(srcdir)/Source/WebCore/platform/graphics/pango
endif # END USE_PANGO
+# ---
+# Windows plugin support
+# ---
+if TARGET_WIN32
+webcoregtk_cppflags += \
+ -I$(srcdir)/Source/WebCore/platform/graphics/win
+endif # END TARGET_WIN32
+
# ----
# HTML Details Element
# ----
@@ -965,6 +973,11 @@
$(XRENDER_CFLAGS) \
$(XT_CFLAGS)
+if TARGET_WIN32
+# PluginPackageWin.cpp needs the symbols from version dll
+libWebCore_la_LIBADD = -lversion
+endif
+
libWebCoreModules_la_SOURCES = \
$(webcore_modules_sources)
Modified: trunk/Source/WebCore/GNUmakefile.list.am (120955 => 120956)
--- trunk/Source/WebCore/GNUmakefile.list.am 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2012-06-21 19:20:00 UTC (rev 120956)
@@ -4818,9 +4818,7 @@
Source/WebCore/platform/gtk/SoundGtk.cpp \
Source/WebCore/platform/gtk/WidgetGtk.cpp \
Source/WebCore/platform/gtk/WidgetRenderingContext.cpp \
- Source/WebCore/platform/gtk/WidgetRenderingContext.h \
- Source/WebCore/plugins/gtk/PluginPackageGtk.cpp \
- Source/WebCore/plugins/gtk/PluginViewGtk.cpp
+ Source/WebCore/platform/gtk/WidgetRenderingContext.h
if TARGET_X11
webcoregtk_sources += \
@@ -4836,13 +4834,28 @@
if TARGET_WIN32
webcore_sources += \
+ Source/WebCore/platform/graphics/win/DIBPixelData.cpp \
+ Source/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp \
+ Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp \
+ Source/WebCore/platform/graphics/win/LocalWindowsContext.h \
+ Source/WebCore/platform/graphics/win/TransformationMatrixWin.cpp \
+ Source/WebCore/platform/win/BitmapInfo.cpp \
+ Source/WebCore/platform/win/BitmapInfo.h \
Source/WebCore/platform/win/SystemInfo.cpp \
Source/WebCore/platform/win/SystemInfo.h \
+ Source/WebCore/platform/win/WebCoreInstanceHandle.cpp \
+ Source/WebCore/platform/win/WebCoreInstanceHandle.h \
Source/WebCore/plugins/win/PluginDatabaseWin.cpp \
Source/WebCore/plugins/win/PluginMessageThrottlerWin.cpp \
- Source/WebCore/plugins/win/PluginMessageThrottlerWin.h
+ Source/WebCore/plugins/win/PluginMessageThrottlerWin.h \
+ Source/WebCore/plugins/win/PluginPackageWin.cpp
webcoregtk_sources += \
- Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp
+ Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp \
+ Source/WebCore/plugins/win/PluginViewWin.cpp
+else
+webcoregtk_sources += \
+ Source/WebCore/plugins/gtk/PluginPackageGtk.cpp \
+ Source/WebCore/plugins/gtk/PluginViewGtk.cpp
endif
# ----
Modified: trunk/Source/WebCore/platform/FileSystem.h (120955 => 120956)
--- trunk/Source/WebCore/platform/FileSystem.h 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/platform/FileSystem.h 2012-06-21 19:20:00 UTC (rev 120956)
@@ -74,10 +74,10 @@
namespace WebCore {
// PlatformModule
-#if PLATFORM(GTK)
+#if OS(WINDOWS)
+typedef HMODULE PlatformModule;
+#elif PLATFORM(GTK)
typedef GModule* PlatformModule;
-#elif OS(WINDOWS)
-typedef HMODULE PlatformModule;
#elif PLATFORM(QT)
#if defined(Q_WS_MAC)
typedef CFBundleRef PlatformModule;
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (120955 => 120956)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2012-06-21 19:20:00 UTC (rev 120956)
@@ -488,7 +488,7 @@
void drawWindowsBitmap(WindowsBitmap*, const IntPoint&);
#endif
-#if (PLATFORM(QT) && OS(WINDOWS)) || (PLATFORM(WX) && OS(WINDOWS))
+#if (PLATFORM(GTK) && OS(WINDOWS)) || (PLATFORM(QT) && OS(WINDOWS)) || (PLATFORM(WX) && OS(WINDOWS))
HDC getWindowsContext(const IntRect&, bool supportAlphaBlend = true, bool mayCreateBitmap = true);
void releaseWindowsContext(HDC, const IntRect&, bool supportAlphaBlend = true, bool mayCreateBitmap = true);
bool shouldIncludeChildWindows() const { return false; }
Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h (120955 => 120956)
--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h 2012-06-21 19:20:00 UTC (rev 120956)
@@ -52,7 +52,8 @@
: platformContext(newPlatformContext)
#if PLATFORM(GTK)
, expose(0)
-#elif PLATFORM(WIN)
+#endif
+#if PLATFORM(WIN) || (PLATFORM(GTK) && OS(WINDOWS))
// NOTE: These may note be needed: review and remove once Cairo implementation is complete
, m_hdc(0)
, m_shouldIncludeChildWindows(false)
@@ -97,7 +98,8 @@
#if PLATFORM(GTK)
GdkEventExpose* expose;
-#elif PLATFORM(WIN)
+#endif
+#if PLATFORM(WIN) || (PLATFORM(GTK) && OS(WINDOWS))
HDC m_hdc;
bool m_shouldIncludeChildWindows;
#endif
Modified: trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h (120955 => 120956)
--- trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h 2012-06-21 19:20:00 UTC (rev 120956)
@@ -50,7 +50,7 @@
#include <wx/graphics.h>
#endif
-#if PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS)) || (PLATFORM(WX) && OS(WINDOWS))
+#if PLATFORM(WIN) || (PLATFORM(GTK) && OS(WINDOWS)) || (PLATFORM(QT) && OS(WINDOWS)) || (PLATFORM(WX) && OS(WINDOWS))
#if COMPILER(MINGW) && !COMPILER(MINGW64)
typedef struct _XFORM XFORM;
#else
@@ -341,7 +341,7 @@
operator wxGraphicsMatrix() const;
#endif
-#if PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS)) || (PLATFORM(WX) && OS(WINDOWS))
+#if PLATFORM(WIN) || (PLATFORM(GTK) && OS(WINDOWS)) || (PLATFORM(QT) && OS(WINDOWS)) || (PLATFORM(WX) && OS(WINDOWS))
operator XFORM() const;
#endif
Modified: trunk/Source/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp (120955 => 120956)
--- trunk/Source/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp 2012-06-21 19:20:00 UTC (rev 120956)
@@ -27,6 +27,7 @@
#include "GraphicsContext.h"
#include "AffineTransform.h"
+#include "DIBPixelData.h"
#include "Path.h"
#include <cairo-win32.h>
@@ -36,6 +37,7 @@
namespace WebCore {
+#if PLATFORM(WIN)
static cairo_t* createCairoContextWithHDC(HDC hdc, bool hasAlpha)
{
// Put the HDC In advanced mode so it will honor affine transforms.
@@ -87,6 +89,7 @@
setPlatformStrokeColor(strokeColor(), strokeColorSpace());
}
}
+#endif
static void setRGBABitmapAlpha(unsigned char* bytes, size_t length, unsigned char level)
{
@@ -149,6 +152,7 @@
::DeleteDC(hdc);
}
+#if PLATFORM(WIN)
void GraphicsContext::drawWindowsBitmap(WindowsBitmap* bitmap, const IntPoint& point)
{
drawBitmapToContext(m_data, platformContext()->cr(), bitmap->windowsDIB(), IntSize(point.x(), bitmap->size().height() + point.y()));
@@ -171,5 +175,6 @@
cairo_surface_flush(surface);
cairo_surface_destroy(surface);
}
+#endif
}
Modified: trunk/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp (120955 => 120956)
--- trunk/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp 2012-06-21 19:20:00 UTC (rev 120956)
@@ -51,6 +51,7 @@
memset(bmpInfo.bmBits, 0, bufferSize);
}
+#if PLATFORM(WIN)
void GraphicsContext::setShouldIncludeChildWindows(bool include)
{
m_data->m_shouldIncludeChildWindows = include;
@@ -94,6 +95,7 @@
{
return adoptPtr(new WindowsBitmap(m_data->m_hdc, size));
}
+#endif
HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
{
@@ -133,6 +135,7 @@
return m_data->m_hdc;
}
+#if PLATFORM(WIN)
void GraphicsContextPlatformPrivate::save()
{
if (!m_hdc)
@@ -202,5 +205,6 @@
XFORM xform = transform.toTransformationMatrix();
SetWorldTransform(m_hdc, &xform);
}
+#endif
}
Modified: trunk/Source/WebCore/platform/gtk/FileSystemGtk.cpp (120955 => 120956)
--- trunk/Source/WebCore/platform/gtk/FileSystemGtk.cpp 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/platform/gtk/FileSystemGtk.cpp 2012-06-21 19:20:00 UTC (rev 120956)
@@ -356,6 +356,10 @@
bool unloadModule(PlatformModule module)
{
+#if OS(WINDOWS)
+ return ::FreeLibrary(module);
+#else
return g_module_close(module);
+#endif
}
}
Modified: trunk/Source/WebCore/plugins/PluginView.h (120955 => 120956)
--- trunk/Source/WebCore/plugins/PluginView.h 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/plugins/PluginView.h 2012-06-21 19:20:00 UTC (rev 120956)
@@ -47,7 +47,7 @@
#include "npruntime_internal.h"
#endif
-#if OS(WINDOWS) && (PLATFORM(QT) || PLATFORM(WX))
+#if OS(WINDOWS) && (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WX))
typedef struct HWND__* HWND;
typedef HWND PlatformPluginWidget;
#else
@@ -376,7 +376,7 @@
bool m_haveUpdatedPluginWidget;
#endif
-#if ((PLATFORM(QT) || PLATFORM(WX)) && OS(WINDOWS)) || defined(XP_MACOSX) || PLATFORM(EFL)
+#if ((PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WX)) && OS(WINDOWS)) || defined(XP_MACOSX) || PLATFORM(EFL)
// On Mac OSX and Qt/Windows the plugin does not have its own native widget,
// but is using the containing window as its reference for positioning/painting.
PlatformPluginWidget m_window;
Modified: trunk/Source/WebCore/plugins/win/PluginViewWin.cpp (120955 => 120956)
--- trunk/Source/WebCore/plugins/win/PluginViewWin.cpp 2012-06-21 18:57:45 UTC (rev 120955)
+++ trunk/Source/WebCore/plugins/win/PluginViewWin.cpp 2012-06-21 19:20:00 UTC (rev 120956)
@@ -86,6 +86,11 @@
#include <cairo-win32.h>
#endif
+#if PLATFORM(GTK)
+#include <gdk/gdkwin32.h>
+#include <gtk/gtk.h>
+#endif
+
#if PLATFORM(QT)
#include "QWebPageClient.h"
#if HAVE(QT5)
@@ -102,9 +107,15 @@
static inline HWND windowHandleForPageClient(PlatformPageClient client)
{
-#if PLATFORM(QT)
+#if PLATFORM(GTK)
if (!client)
return 0;
+ if (GdkWindow* window = gtk_widget_get_window(client))
+ return static_cast<HWND>(GDK_WINDOW_HWND(window));
+ return 0;
+#elif PLATFORM(QT)
+ if (!client)
+ return 0;
#if HAVE(QT5)
if (QWindow* window = client->ownerWindow())
return reinterpret_cast<HWND>(window->winId());
@@ -300,8 +311,8 @@
haveRegisteredWindowClass = true;
-#if PLATFORM(QT)
- WebCore::setInstanceHandle((HINSTANCE)(qWinAppInst()));
+#if PLATFORM(GTK) || PLATFORM(QT)
+ WebCore::setInstanceHandle((HINSTANCE)(GetModuleHandle(0)));
#endif
ASSERT(WebCore::instanceHandle());
@@ -642,9 +653,9 @@
// On Safari/Windows without transparency layers the GraphicsContext returns the HDC
// of the window and the plugin expects that the passed in DC has window coordinates.
- // In the Qt port we always draw in an offscreen buffer and therefore need to preserve
- // the translation set in getWindowsContext.
-#if !PLATFORM(QT) && !OS(WINCE)
+ // In the GTK and Qt ports we always draw in an offscreen buffer and therefore need
+ // to preserve the translation set in getWindowsContext.
+#if !PLATFORM(GTK) && !PLATFORM(QT) && !OS(WINCE)
if (!context->isInTransparencyLayer()) {
XFORM transform;
GetWorldTransform(windowsContext.hdc(), &transform);
@@ -752,7 +763,7 @@
if (dispatchNPEvent(npEvent))
event->setDefaultHandled();
-#if !PLATFORM(QT) && !PLATFORM(WX) && !OS(WINCE)
+#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(WX) && !OS(WINCE)
// Currently, Widget::setCursor is always called after this function in EventHandler.cpp
// and since we don't want that we set ignoreNextSetCursor to true here to prevent that.
ignoreNextSetCursor = true;
@@ -997,7 +1008,7 @@
HWND window = ::CreateWindowEx(0, kWebPluginViewdowClassName, 0, flags,
0, 0, 0, 0, parentWindowHandle, 0, WebCore::instanceHandle(), 0);
-#if OS(WINDOWS) && (PLATFORM(QT) || PLATFORM(WX))
+#if OS(WINDOWS) && (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WX))
m_window = window;
#else
setPlatformWidget(window);
@@ -1040,7 +1051,7 @@
PassRefPtr<Image> PluginView::snapshot()
{
-#if !PLATFORM(WX) && !OS(WINCE)
+#if !PLATFORM(GTK) && !PLATFORM(WX) && !OS(WINCE)
OwnPtr<HDC> hdc = adoptPtr(CreateCompatibleDC(0));
if (!m_isWindowed) {