Bug 879515 - Port GTK2 to GTK3 - dom/plugins fixes. r=karlt

This commit is contained in:
Martin Stransky 2013-06-10 08:36:26 -04:00
parent 9386e8c35b
commit 82972db84e
6 changed files with 15 additions and 13 deletions

View File

@ -54,7 +54,9 @@ using namespace std;
#endif
#include <gdk/gdkx.h>
#include <gdk/gdk.h>
#if (MOZ_WIDGET_GTK == 2)
#include "gtk2xtbin.h"
#endif
#elif defined(MOZ_WIDGET_QT)
#undef KeyPress
@ -113,7 +115,7 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
, mAsyncInvalidateTask(0)
, mCachedWindowActor(nullptr)
, mCachedElementActor(nullptr)
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
, mXEmbed(false)
#endif // MOZ_WIDGET_GTK
#if defined(OS_WIN)
@ -161,7 +163,7 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
mWindow.ws_info = &mWsInfo;
memset(&mWsInfo, 0, sizeof(mWsInfo));
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
mWsInfo.display = NULL;
mXtClient.top_widget = NULL;
#else
@ -503,7 +505,7 @@ PluginInstanceChild::NPN_SetValue(NPPVariable aVar, void* aValue)
return NPERR_GENERIC_ERROR;
NPWindowType newWindowType = windowed ? NPWindowTypeWindow : NPWindowTypeDrawable;
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
if (mWindow.type != newWindowType && mWsInfo.display) {
// plugin type has been changed but we already have a valid display
// so update it for the recent plugin mode
@ -1047,7 +1049,7 @@ bool PluginInstanceChild::CreateWindow(const NPRemoteWindow& aWindow)
aWindow.x, aWindow.y,
aWindow.width, aWindow.height));
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
if (mXEmbed) {
mWindow.window = reinterpret_cast<void*>(aWindow.window);
}
@ -1076,7 +1078,7 @@ void PluginInstanceChild::DeleteWindow()
if (!mWindow.window)
return;
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
if (mXtClient.top_widget) {
xt_client_unrealize(&mXtClient);
xt_client_destroy(&mXtClient);
@ -1257,7 +1259,7 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
bool
PluginInstanceChild::Initialize()
{
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
NPError rv;
if (mWsInfo.display) {
@ -4147,7 +4149,7 @@ PluginInstanceChild::AnswerNPP_Destroy(NPError* aResult)
mAsyncBitmaps.Enumerate(DeleteSurface, this);
}
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
if (mWindow.type == NPWindowTypeWindow && !mXEmbed) {
xt_client_xloop_destroy();
}

View File

@ -34,7 +34,7 @@
#include <map>
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
#include "gtk2xtbin.h"
#endif
@ -383,7 +383,7 @@ private:
#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
NPSetWindowCallbackStruct mWsInfo;
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
bool mXEmbed;
XtClient mXtClient;
#endif

View File

@ -1098,7 +1098,7 @@ _getvalue(NPP aNPP,
*(NPBool*)aValue = value ? true : false;
return result;
}
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
case NPNVxDisplay: {
if (aNPP) {
return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);

View File

@ -163,7 +163,7 @@ MOCHITEST_FILES += \
$(NULL)
endif
ifeq (gtk2,$(MOZ_WIDGET_TOOLKIT))
ifeq (,$(filter-out gtk2 gtk3,$(MOZ_WIDGET_TOOLKIT)))
MOCHITEST_FILES += \
test_copyText.html \
test_crash_nested_loop.html \

View File

@ -6,7 +6,7 @@
DIRS += ['testplugin']
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'cocoa', 'windows'):
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'cocoa', 'windows'):
TEST_DIRS += ['mochitest']
MODULE = 'test_plugin'

View File

@ -6,7 +6,7 @@
toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
if toolkit in ('qt', 'gtk2'):
if toolkit in ('qt', 'gtk2', 'gtk3'):
DIRS += ['unix']
elif toolkit == 'windows':
DIRS += ['windows']